- El Beneficio Incremental ;muestra el beneficio adicional obtenido por cada aumento en el gasto. Las barras positivas (verdes) indican aumentos de gasto rentables.
- Beneficio Total frente al Retorno de la Inversión Publicitaria (ROAS), layuda a identificar el rango de ROAS que maximiza el beneficio.
- El ROAS Marginal : muestra el retorno esperado de la inversión publicitaria correspondiente a un nivel de gasto, lo que ayuda a identificar los rendimientos decrecientes
A Notebook Toolkit since 2013: //Tech// R, Python, GCP, Tableau //Methodologies// Scrum + Kanban, Design Thinking, Data Frameworks
domingo, 11 de agosto de 2024
Curva de Beneficio
martes, 2 de julio de 2024
K-means cluster - How to choose K
One key step in K-means clustering is deciding on the number of clusters. Ideally, the data itself should guide us on the optimal number of groups.
There are several ways to detemine the number of cluster
This is what we want to achieve in a picture with our groups:
Elbow criterion
The elbow criterion helps us achieve this. It plots the ratio of within-cluster variance to between-cluster variance against the number of clusters. We want this ratio to be low, indicating tight clusters and high separation between them.
In a graph:
It looks like this:
As we increase the number of clusters, this ratio initially drops significantly. However, there comes a point where adding more clusters doesn't lead to a substantial improvement.
This point, known as the "elbow," is considered the ideal number of clusters.
More information about the elbow criterion
domingo, 23 de junio de 2024
Customer segmentation with K-Means
Today, let's unravel the magic of K-Means clustering, your trusty tool for discovering those hidden gems within your marketing data.
What's K-Means Clustering, you ask?
Think of K-Means as a way to group similar data points together, helping you uncover those underlying patterns that might not be obvious at first glance. It's like sorting your favorite candies into different piles based on their flavors – except in this case, we're using customer data like demographics or location.
How Does It Work?
- Choose K: First, you need to decide how many clusters (K) you want. It's like deciding how many candy piles you'll have! We'll talk about how to find the perfect K later.
- Random Centers: Imagine randomly picking K candies as the starting centers for your piles. That's what we do with your data – randomly select K points as the initial cluster centers (centroids).
- Calculate Distances: Now, measure the distance between each data point (candy) and each center (pile). We use the Euclidean distance formula (don't worry, it's not as scary as it sounds!).
- Group Them Up: Assign each data point to the closest center, creating your clusters!
- Find New Centers: Re-calculate the center of each new cluster (like finding the average position of all the candies in a pile).
- Repeat: Keep repeating steps 3-5 until your clusters stop changing much. You've found your final clusters!
Validate Your Clusters:
- Check the Variance: How tightly packed are the data points within each cluster? Low variance is good, like having candies that are all very similar in flavor within each pile.
- Dunn Index: This fancy index measures both the tightness of your clusters and how far apart they are. Aim for a high Dunn Index – it means your clusters are well-defined and distinct.
Remember:
- K-Means is just a tool, not magic! You'll need to use your marketing expertise to interpret the clusters and give them meaningful names.
- I´ll cover how to find the best K and name your segments in upcoming posts.
martes, 24 de octubre de 2023
Introducción a Vertex AI y las herramientas que lo componen
Listado de herramientas que encontramos en Vertex AI
De un vistazo podemos ver en esta tabla de las diferentes herramientas que están contenidas dentro de Vertex y que nos ayudan a crear nuestros modelos de forma más fácil desde las soluciones No code a los servicios para entrenar y desarrollar estos
jueves, 17 de agosto de 2023
Descargar videos y cursos de Coursera a nuestro PC
Qué son los MOOC
Pasos que vamos a seguir
- Chrome navegador
- Instalar en Chrome cookies.txt
- Estar inscritos en el curso que queramos descargar. aunque sea en la modalidad auditoria (audit)
- En windows- Abrir CMD
Descargar cookies
Corriendo el script para descargar el curso de Coursera
dl_coursera --cookies /Users/Maria/Downloads/cookies.txt
--slug machine-learning-business-professionals --outdir mt --how builtin
--cookies xxxx-direccion-donde-tenemos-descargadas-las-cookies-de-coursera-xxxx
Aquí debes poner la dirección donde están las cookies)
--slug xxxx-url-especifica-del-curso-xxxx
Aquí pondrás la dirección del curso
--outdir xxxxxxxxAquí el nombre del directorio donde se descargaráResultado : Ya tenemos los videos en nuestro ordenador
Y et voilá aquí tendremos nuestro cursos con sus videos y materialesEspero que sea de ayuda en tu camino al aprendizaje.
Este curso además aunque tiene ya varios años es super útil para entender los beneficios para las empresas.
jueves, 8 de junio de 2023
Crear un modelo de regresión linear en BigQuery ML- GCP
CREATE OR REPLACE MODEL
bike_model.model
OPTIONS
(input_label_cols=['duration'],
model_type='linear_reg')
AS
SELECT
duration,
start_station_name,
CAST(EXTRACT(dayofweek
FROM
start_date) AS STRING) AS dayofweek,
CAST(EXTRACT(hour
FROM
start_date) AS STRING) AS hourofday
FROM
`bigquery-public-data`.london_bicycles.cycle_hire
viernes, 20 de enero de 2023
Framework para EDA y como automatizar en Python el análisis exploratorio
Lo que podemos definir que entra dentro de este análisis va a depender de las necesidades del dataset y de las preguntas que tenga el negocio, Lo que si es cierto es que una vez hecho uno, podemos reutiliar formulas para aplicarlo al resto de análisis.Sobre todo la parte de visualización
Así que podemos definir un framework para transformar esos datos
Framework para realizar el análisis exploratorio
Podemos así ver 5 fases que pueden ser iterativas:
Data Sourcing
De dónde vienen los datos, tenemos que modificar el tipo de variable o la codificación?
Data Cleaning
Existen valores nulos? Debemos eliminar valores atípicos, valores duplicados.
Univariate analysis
Cómo se distribuye cada una de las variables? Valores máximos y mínimos, ...
Bivariate analysis
Existe correlación entre dos variables. Una variabe ayuda a predecir a la otra?
Multivariate analysis
Y cómo se comportan estas variables en su conjunto? Podemos añadir nuevas variables a partir de las que ya tenemos?
Automatización del análisis exploratorio en Python
df.describe()
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
Librerias para la automatización del EDA en Python
- 1. Pandas profiling, que nos da un informe de spoiler como este. Aunque los comandos avanzados no son muy avanzados, aquí tienes como instalar esta librería en Python
- 2. Dataprep
- 3. Sweetviz, que es más ligero de pandas profiling