SlideShare una empresa de Scribd logo
© SuperDataScience
Machine Learning A-Z
Una Advertencia
© SuperDataScience
Machine Learning A-Z
Una Advertencia
1.Linealidad
2.Homocedasticidad
3.Normalidad multivariable
4.Independencia de los errores
5.Ausencia de multicolinealidad
Restricciones de la Regresión Lineal
© SuperDataScience
Machine Learning A-Z
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Variables Dummy
Profit R&D Spend Admin Marketing State
192,261.83 165,349.20 136,897.80 471,784.10 New York
191,792.06 162,597.70 151,377.59 443,898.53 California
191,050.39 153,441.51 101,145.55 407,934.54 California
182,901.99 144,372.41 118,671.85 383,199.62 New York
166,187.94 142,107.34 91,391.77 366,168.42 California
© SuperDataScience
Machine Learning A-Z
y =
Profit R&D Spend Admin Marketing State
192,261.83 165,349.20 136,897.80 471,784.10 New York
191,792.06 162,597.70 151,377.59 443,898.53 California
191,050.39 153,441.51 101,145.55 407,934.54 California
182,901.99 144,372.41 118,671.85 383,199.62 New York
166,187.94 142,107.34 91,391.77 366,168.42 California
Variables Dummy
© SuperDataScience
Machine Learning A-Z
y = b0
Profit R&D Spend Admin Marketing State
192,261.83 165,349.20 136,897.80 471,784.10 New York
191,792.06 162,597.70 151,377.59 443,898.53 California
191,050.39 153,441.51 101,145.55 407,934.54 California
182,901.99 144,372.41 118,671.85 383,199.62 New York
166,187.94 142,107.34 91,391.77 366,168.42 California
Variables Dummy
© SuperDataScience
Machine Learning A-Z
y = b0 + b1*x1
Profit R&D Spend Admin Marketing State
192,261.83 165,349.20 136,897.80 471,784.10 New York
191,792.06 162,597.70 151,377.59 443,898.53 California
191,050.39 153,441.51 101,145.55 407,934.54 California
182,901.99 144,372.41 118,671.85 383,199.62 New York
166,187.94 142,107.34 91,391.77 366,168.42 California
Variables Dummy
© SuperDataScience
Machine Learning A-Z
y = b0 + b1*x1 + b2*x2
Profit R&D Spend Admin Marketing State
192,261.83 165,349.20 136,897.80 471,784.10 New York
191,792.06 162,597.70 151,377.59 443,898.53 California
191,050.39 153,441.51 101,145.55 407,934.54 California
182,901.99 144,372.41 118,671.85 383,199.62 New York
166,187.94 142,107.34 91,391.77 366,168.42 California
Variables Dummy
© SuperDataScience
Machine Learning A-Z
y = b0 + b1*x1 + b2*x2 + b3*x3
Profit R&D Spend Admin Marketing State
192,261.83 165,349.20 136,897.80 471,784.10 New York
191,792.06 162,597.70 151,377.59 443,898.53 California
191,050.39 153,441.51 101,145.55 407,934.54 California
182,901.99 144,372.41 118,671.85 383,199.62 New York
166,187.94 142,107.34 91,391.77 366,168.42 California
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State
192,261.83 165,349.20 136,897.80 471,784.10 New York
191,792.06 162,597.70 151,377.59 443,898.53 California
191,050.39 153,441.51 101,145.55 407,934.54 California
182,901.99 144,372.41 118,671.85 383,199.62 New York
166,187.94 142,107.34 91,391.77 366,168.42 California
y = b0 + b1*x1 + b2*x2 + b3*x3 + ???
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York
191,792.06 162,597.70 151,377.59 443,898.53 California
191,050.39 153,441.51 101,145.55 407,934.54 California
182,901.99 144,372.41 118,671.85 383,199.62 New York
166,187.94 142,107.34 91,391.77 366,168.42 California
y = b0 + b1*x1 + b2*x2 + b3*x3 + ???
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York
191,792.06 162,597.70 151,377.59 443,898.53 California
191,050.39 153,441.51 101,145.55 407,934.54 California
182,901.99 144,372.41 118,671.85 383,199.62 New York
166,187.94 142,107.34 91,391.77 366,168.42 California
y = b0 + b1*x1 + b2*x2 + b3*x3 + ???
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York 1
191,792.06 162,597.70 151,377.59 443,898.53 California 0
191,050.39 153,441.51 101,145.55 407,934.54 California 0
182,901.99 144,372.41 118,671.85 383,199.62 New York 1
166,187.94 142,107.34 91,391.77 366,168.42 California 0
y = b0 + b1*x1 + b2*x2 + b3*x3 + ???
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0
191,792.06 162,597.70 151,377.59 443,898.53 California 0 1
191,050.39 153,441.51 101,145.55 407,934.54 California 0 1
182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0
166,187.94 142,107.34 91,391.77 366,168.42 California 0 1
y = b0 + b1*x1 + b2*x2 + b3*x3 + ???
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0
191,792.06 162,597.70 151,377.59 443,898.53 California 0 1
191,050.39 153,441.51 101,145.55 407,934.54 California 0 1
182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0
166,187.94 142,107.34 91,391.77 366,168.42 California 0 1
y = b0 + b1*x1 + b2*x2 + b3*x3 + ???
Variables Dummy
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0
191,792.06 162,597.70 151,377.59 443,898.53 California 0 1
191,050.39 153,441.51 101,145.55 407,934.54 California 0 1
182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0
166,187.94 142,107.34 91,391.77 366,168.42 California 0 1
y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1
Variables Dummy
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0
191,792.06 162,597.70 151,377.59 443,898.53 California 0 1
191,050.39 153,441.51 101,145.55 407,934.54 California 0 1
182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0
166,187.94 142,107.34 91,391.77 366,168.42 California 0 1
y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1
Variables Dummy
Variables Dummy
© SuperDataScience
Machine Learning A-Z
La trampa de las
Variables Dummies
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0
191,792.06 162,597.70 151,377.59 443,898.53 California 0 1
191,050.39 153,441.51 101,145.55 407,934.54 California 0 1
182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0
166,187.94 142,107.34 91,391.77 366,168.42 California 0 1
La Trampa de las Variables Dummies
y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1
Variables Dummy
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0
191,792.06 162,597.70 151,377.59 443,898.53 California 0 1
191,050.39 153,441.51 101,145.55 407,934.54 California 0 1
182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0
166,187.94 142,107.34 91,391.77 366,168.42 California 0 1
La Trampa de las Variables Dummies
y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1 + b5*D2
Variables Dummy
D2 = 1 - D1
© SuperDataScience
Machine Learning A-Z
Profit R&D Spend Admin Marketing State New York California
192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0
191,792.06 162,597.70 151,377.59 443,898.53 California 0 1
191,050.39 153,441.51 101,145.55 407,934.54 California 0 1
182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0
166,187.94 142,107.34 91,391.77 366,168.42 California 0 1
La Trampa de las Variables Dummies
y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1 + b5*D2
Variables Dummy
Siempre debemos
omitir una variable
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
(Paso a Paso)
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
X2
X3
X4 X5
X6
X1 X7
y
¿Por qué?
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
1)
2)
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
5 métodos para construir modelos:
1. Exhaustivo (All-in)
2. Eliminación hacia atrás
3. Selección hacia adelante
4. Eliminación Bidireccional
5. Comparición de scores
Regresión paso
a paso
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
“All-in” – cases:
• Conocimiento a priori; OR
• Necesidad; OR
• Preparación previa para Eliminación
hacia atrás
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
Eliminación hacia atrás
PASO 1: Seleccionar el nivel de significación para permanecer en el modelo (p.e. SL = 0.05)
PASO 2: Se calcula el modelo con todas las posibles variables predictoras
PASO 3: Considera la variable predictora con el p-valor más grande. Si P > SL, entonces vamos al PASO 4, si no
vamos a FIN
PASO 4: Se elimina la variable predictora
PASO 5: Ajustar el modelo sin dicha variable* FIN: El modelo está listo
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
Selección hacia adelante
PASO 1: Elegimos un nivel de significación para entrar en el modelo (p.e. SL = 0.05)
PASO 2: Ajustamos todos los modelos de regresión lineal simple y ~ xn Elegimos el que tiene menor p-valor.
PASO 3: Conservamos esta variable, y ajustamos todos los posibles modelos con una variable extra
añadida a la(s) que ya tenga(s) el modelo hasta el momento
FIN: Conservamos el modelo anterior
PASO 4: Consideramos la variable predictora con el menor p.valor. Si P < SL, vamos al PASO 3, si no a FIN
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
Eliminación Bidireccional
PASO 1: Seleccionar un nivel de significación para entrar y salir del modelo
p.e.: SLENTER = 0.05, SLSTAY = 0.05
PASO 2: Llevar a cabo el siguiente Paso de Selección hacia adelante (con las nuevas variables con:
P < SLENTER para entrar)
PASO 3: Llevar a cabo TODOS los pasos de la Eliminación hacia atrás (las variables antiguas deben tener
P < SLSTAY para quedarse)
PASO 4: No hay nuevas variables para entrar ni antiguas para salir
FIN: El modelo está listo
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
Todos los modelos posibles
PASO 1: Seleccionar un criterio de bondad de ajuste (p.e. criterio de Akaike)
PASO 2: Construir todos los posibles modelos de regresión: 2N-1 combinaciones en total
PASO 3: Seleccionar el modelo con el mejor criterio elegido
FIN: El modelo está listo
Por ejemplo:
10 columnas significan
1,023 modelos
© SuperDataScience
Machine Learning A-Z
Construir el Modelo
5 métodos para construir modelos:
1. Exhaustivo (All-in)
2. Eliminación hacia atrás
3. Selección hacia adelante
4. Eliminación Bidireccional
5. Comparición de scores
© SuperDataScience
Machine Learning A-Z
Recapitulando
© SuperDataScience
Machine Learning A-Z
Recapitulación
En esta sección hemos visto
1. Como crear variables dummies para las categorías de
variables independientes
2. Como evitar la trampa de las variables dummies
3. Hacia atrás, hacia adelante, Bidireccional, Todos…
4. Construir un modelo paso a paso!!
5. Como usar el R2 Ajustado en modelización
6. Como interpretar los coeficientes de una RLM

Más contenido relacionado

Último

DIAPOSITIVA DE LA NORMA ISO 22000 EXPOSICI�N.pptx
DIAPOSITIVA DE LA NORMA ISO 22000 EXPOSICI�N.pptxDIAPOSITIVA DE LA NORMA ISO 22000 EXPOSICI�N.pptx
DIAPOSITIVA DE LA NORMA ISO 22000 EXPOSICI�N.pptx
KeylaArlethTorresOrt
 
Infografia de operaciones basicas de la construccion.pdf
Infografia de operaciones basicas de la construccion.pdfInfografia de operaciones basicas de la construccion.pdf
Infografia de operaciones basicas de la construccion.pdf
DanielMelndez19
 
Infografia - Hugo Hidalgo - Construcción
Infografia - Hugo Hidalgo - ConstrucciónInfografia - Hugo Hidalgo - Construcción
Infografia - Hugo Hidalgo - Construcción
MaraManuelaUrribarri
 
Cargas de Cálculos Estructurales de un Puente
Cargas de Cálculos Estructurales de un PuenteCargas de Cálculos Estructurales de un Puente
Cargas de Cálculos Estructurales de un Puente
jemifermelgarejoaran1
 
NTP 223 NORMAS PARA TRABAJO SEGURO EN ESPACIOS CONFINADOS. Ing. Josue Donoso ...
NTP 223 NORMAS PARA TRABAJO SEGURO EN ESPACIOS CONFINADOS. Ing. Josue Donoso ...NTP 223 NORMAS PARA TRABAJO SEGURO EN ESPACIOS CONFINADOS. Ing. Josue Donoso ...
NTP 223 NORMAS PARA TRABAJO SEGURO EN ESPACIOS CONFINADOS. Ing. Josue Donoso ...
ssuserf8ae19
 
INGLES_LISTA_DE_VOCABULARIO una lista completa
INGLES_LISTA_DE_VOCABULARIO una lista completaINGLES_LISTA_DE_VOCABULARIO una lista completa
INGLES_LISTA_DE_VOCABULARIO una lista completa
JaimmsArthur
 
BACTERIAS VERDES grupo 1 corregido-1.pptx
BACTERIAS VERDES grupo 1 corregido-1.pptxBACTERIAS VERDES grupo 1 corregido-1.pptx
BACTERIAS VERDES grupo 1 corregido-1.pptx
JuanEnriqueDavilaBar
 
tema alcanos cicloalcanos de quimica.pdf
tema alcanos cicloalcanos de quimica.pdftema alcanos cicloalcanos de quimica.pdf
tema alcanos cicloalcanos de quimica.pdf
veronicaluna80
 
Presentación transferencia de calor Jesus Morales.pdf
Presentación transferencia de calor Jesus Morales.pdfPresentación transferencia de calor Jesus Morales.pdf
Presentación transferencia de calor Jesus Morales.pdf
jdcumarem02
 
Sesión 03 universidad cesar vallejo 2024
Sesión 03 universidad cesar vallejo 2024Sesión 03 universidad cesar vallejo 2024
Sesión 03 universidad cesar vallejo 2024
FantasticVideo1
 
Equipo 4. Mezclado de Polímeros quimica de polimeros.pptx
Equipo 4. Mezclado de Polímeros quimica de polimeros.pptxEquipo 4. Mezclado de Polímeros quimica de polimeros.pptx
Equipo 4. Mezclado de Polímeros quimica de polimeros.pptx
angiepalacios6170
 
Rinitis alérgica-1.pdfuhycrbibxgvyvyjimomom
Rinitis alérgica-1.pdfuhycrbibxgvyvyjimomomRinitis alérgica-1.pdfuhycrbibxgvyvyjimomom
Rinitis alérgica-1.pdfuhycrbibxgvyvyjimomom
DanielaLoaeza5
 
Reglamento Interno de seguridad y sdalud en
Reglamento Interno de seguridad y sdalud enReglamento Interno de seguridad y sdalud en
Reglamento Interno de seguridad y sdalud en
Jorge Luis Flores Zuñiga
 
DIAGRAMA ELECTRICOS y circuito electrónicos
DIAGRAMA ELECTRICOS y circuito electrónicosDIAGRAMA ELECTRICOS y circuito electrónicos
DIAGRAMA ELECTRICOS y circuito electrónicos
LuisAngelGuarnizoBet
 
SISTEMA AUTOMATIZADO DE LIMPIEZA PARA ACUARIOS
SISTEMA AUTOMATIZADO DE LIMPIEZA PARA ACUARIOSSISTEMA AUTOMATIZADO DE LIMPIEZA PARA ACUARIOS
SISTEMA AUTOMATIZADO DE LIMPIEZA PARA ACUARIOS
micoltadaniel2024
 
Estructura de un buque, tema de estudios generales de navegación
Estructura de un buque, tema de estudios generales de navegaciónEstructura de un buque, tema de estudios generales de navegación
Estructura de un buque, tema de estudios generales de navegación
AlvaroEduardoConsola1
 
Presentación- de motor a combustión -diesel.pptx
Presentación- de motor a combustión -diesel.pptxPresentación- de motor a combustión -diesel.pptx
Presentación- de motor a combustión -diesel.pptx
ronnyrocha223
 
muros de contencion, diseño y generalidades
muros de contencion, diseño y generalidadesmuros de contencion, diseño y generalidades
muros de contencion, diseño y generalidades
AlejandroArturoGutie1
 
INVENTARIO CEROO Y DINAMICAA FABRIL.pptx
INVENTARIO CEROO Y DINAMICAA FABRIL.pptxINVENTARIO CEROO Y DINAMICAA FABRIL.pptx
INVENTARIO CEROO Y DINAMICAA FABRIL.pptx
FernandoRodrigoEscal
 
Semana 12 - Ley 29973 de las personas con discapacidad.pdf
Semana 12 - Ley 29973 de las personas con discapacidad.pdfSemana 12 - Ley 29973 de las personas con discapacidad.pdf
Semana 12 - Ley 29973 de las personas con discapacidad.pdf
SandyCuenca
 

Último (20)

DIAPOSITIVA DE LA NORMA ISO 22000 EXPOSICI�N.pptx
DIAPOSITIVA DE LA NORMA ISO 22000 EXPOSICI�N.pptxDIAPOSITIVA DE LA NORMA ISO 22000 EXPOSICI�N.pptx
DIAPOSITIVA DE LA NORMA ISO 22000 EXPOSICI�N.pptx
 
Infografia de operaciones basicas de la construccion.pdf
Infografia de operaciones basicas de la construccion.pdfInfografia de operaciones basicas de la construccion.pdf
Infografia de operaciones basicas de la construccion.pdf
 
Infografia - Hugo Hidalgo - Construcción
Infografia - Hugo Hidalgo - ConstrucciónInfografia - Hugo Hidalgo - Construcción
Infografia - Hugo Hidalgo - Construcción
 
Cargas de Cálculos Estructurales de un Puente
Cargas de Cálculos Estructurales de un PuenteCargas de Cálculos Estructurales de un Puente
Cargas de Cálculos Estructurales de un Puente
 
NTP 223 NORMAS PARA TRABAJO SEGURO EN ESPACIOS CONFINADOS. Ing. Josue Donoso ...
NTP 223 NORMAS PARA TRABAJO SEGURO EN ESPACIOS CONFINADOS. Ing. Josue Donoso ...NTP 223 NORMAS PARA TRABAJO SEGURO EN ESPACIOS CONFINADOS. Ing. Josue Donoso ...
NTP 223 NORMAS PARA TRABAJO SEGURO EN ESPACIOS CONFINADOS. Ing. Josue Donoso ...
 
INGLES_LISTA_DE_VOCABULARIO una lista completa
INGLES_LISTA_DE_VOCABULARIO una lista completaINGLES_LISTA_DE_VOCABULARIO una lista completa
INGLES_LISTA_DE_VOCABULARIO una lista completa
 
BACTERIAS VERDES grupo 1 corregido-1.pptx
BACTERIAS VERDES grupo 1 corregido-1.pptxBACTERIAS VERDES grupo 1 corregido-1.pptx
BACTERIAS VERDES grupo 1 corregido-1.pptx
 
tema alcanos cicloalcanos de quimica.pdf
tema alcanos cicloalcanos de quimica.pdftema alcanos cicloalcanos de quimica.pdf
tema alcanos cicloalcanos de quimica.pdf
 
Presentación transferencia de calor Jesus Morales.pdf
Presentación transferencia de calor Jesus Morales.pdfPresentación transferencia de calor Jesus Morales.pdf
Presentación transferencia de calor Jesus Morales.pdf
 
Sesión 03 universidad cesar vallejo 2024
Sesión 03 universidad cesar vallejo 2024Sesión 03 universidad cesar vallejo 2024
Sesión 03 universidad cesar vallejo 2024
 
Equipo 4. Mezclado de Polímeros quimica de polimeros.pptx
Equipo 4. Mezclado de Polímeros quimica de polimeros.pptxEquipo 4. Mezclado de Polímeros quimica de polimeros.pptx
Equipo 4. Mezclado de Polímeros quimica de polimeros.pptx
 
Rinitis alérgica-1.pdfuhycrbibxgvyvyjimomom
Rinitis alérgica-1.pdfuhycrbibxgvyvyjimomomRinitis alérgica-1.pdfuhycrbibxgvyvyjimomom
Rinitis alérgica-1.pdfuhycrbibxgvyvyjimomom
 
Reglamento Interno de seguridad y sdalud en
Reglamento Interno de seguridad y sdalud enReglamento Interno de seguridad y sdalud en
Reglamento Interno de seguridad y sdalud en
 
DIAGRAMA ELECTRICOS y circuito electrónicos
DIAGRAMA ELECTRICOS y circuito electrónicosDIAGRAMA ELECTRICOS y circuito electrónicos
DIAGRAMA ELECTRICOS y circuito electrónicos
 
SISTEMA AUTOMATIZADO DE LIMPIEZA PARA ACUARIOS
SISTEMA AUTOMATIZADO DE LIMPIEZA PARA ACUARIOSSISTEMA AUTOMATIZADO DE LIMPIEZA PARA ACUARIOS
SISTEMA AUTOMATIZADO DE LIMPIEZA PARA ACUARIOS
 
Estructura de un buque, tema de estudios generales de navegación
Estructura de un buque, tema de estudios generales de navegaciónEstructura de un buque, tema de estudios generales de navegación
Estructura de un buque, tema de estudios generales de navegación
 
Presentación- de motor a combustión -diesel.pptx
Presentación- de motor a combustión -diesel.pptxPresentación- de motor a combustión -diesel.pptx
Presentación- de motor a combustión -diesel.pptx
 
muros de contencion, diseño y generalidades
muros de contencion, diseño y generalidadesmuros de contencion, diseño y generalidades
muros de contencion, diseño y generalidades
 
INVENTARIO CEROO Y DINAMICAA FABRIL.pptx
INVENTARIO CEROO Y DINAMICAA FABRIL.pptxINVENTARIO CEROO Y DINAMICAA FABRIL.pptx
INVENTARIO CEROO Y DINAMICAA FABRIL.pptx
 
Semana 12 - Ley 29973 de las personas con discapacidad.pdf
Semana 12 - Ley 29973 de las personas con discapacidad.pdfSemana 12 - Ley 29973 de las personas con discapacidad.pdf
Semana 12 - Ley 29973 de las personas con discapacidad.pdf
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

S4

  • 2. © SuperDataScience Machine Learning A-Z Una Advertencia 1.Linealidad 2.Homocedasticidad 3.Normalidad multivariable 4.Independencia de los errores 5.Ausencia de multicolinealidad Restricciones de la Regresión Lineal
  • 4. © SuperDataScience Machine Learning A-Z Variables Dummy Profit R&D Spend Admin Marketing State 192,261.83 165,349.20 136,897.80 471,784.10 New York 191,792.06 162,597.70 151,377.59 443,898.53 California 191,050.39 153,441.51 101,145.55 407,934.54 California 182,901.99 144,372.41 118,671.85 383,199.62 New York 166,187.94 142,107.34 91,391.77 366,168.42 California
  • 5. © SuperDataScience Machine Learning A-Z y = Profit R&D Spend Admin Marketing State 192,261.83 165,349.20 136,897.80 471,784.10 New York 191,792.06 162,597.70 151,377.59 443,898.53 California 191,050.39 153,441.51 101,145.55 407,934.54 California 182,901.99 144,372.41 118,671.85 383,199.62 New York 166,187.94 142,107.34 91,391.77 366,168.42 California Variables Dummy
  • 6. © SuperDataScience Machine Learning A-Z y = b0 Profit R&D Spend Admin Marketing State 192,261.83 165,349.20 136,897.80 471,784.10 New York 191,792.06 162,597.70 151,377.59 443,898.53 California 191,050.39 153,441.51 101,145.55 407,934.54 California 182,901.99 144,372.41 118,671.85 383,199.62 New York 166,187.94 142,107.34 91,391.77 366,168.42 California Variables Dummy
  • 7. © SuperDataScience Machine Learning A-Z y = b0 + b1*x1 Profit R&D Spend Admin Marketing State 192,261.83 165,349.20 136,897.80 471,784.10 New York 191,792.06 162,597.70 151,377.59 443,898.53 California 191,050.39 153,441.51 101,145.55 407,934.54 California 182,901.99 144,372.41 118,671.85 383,199.62 New York 166,187.94 142,107.34 91,391.77 366,168.42 California Variables Dummy
  • 8. © SuperDataScience Machine Learning A-Z y = b0 + b1*x1 + b2*x2 Profit R&D Spend Admin Marketing State 192,261.83 165,349.20 136,897.80 471,784.10 New York 191,792.06 162,597.70 151,377.59 443,898.53 California 191,050.39 153,441.51 101,145.55 407,934.54 California 182,901.99 144,372.41 118,671.85 383,199.62 New York 166,187.94 142,107.34 91,391.77 366,168.42 California Variables Dummy
  • 9. © SuperDataScience Machine Learning A-Z y = b0 + b1*x1 + b2*x2 + b3*x3 Profit R&D Spend Admin Marketing State 192,261.83 165,349.20 136,897.80 471,784.10 New York 191,792.06 162,597.70 151,377.59 443,898.53 California 191,050.39 153,441.51 101,145.55 407,934.54 California 182,901.99 144,372.41 118,671.85 383,199.62 New York 166,187.94 142,107.34 91,391.77 366,168.42 California Variables Dummy
  • 10. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State 192,261.83 165,349.20 136,897.80 471,784.10 New York 191,792.06 162,597.70 151,377.59 443,898.53 California 191,050.39 153,441.51 101,145.55 407,934.54 California 182,901.99 144,372.41 118,671.85 383,199.62 New York 166,187.94 142,107.34 91,391.77 366,168.42 California y = b0 + b1*x1 + b2*x2 + b3*x3 + ??? Variables Dummy
  • 11. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 191,792.06 162,597.70 151,377.59 443,898.53 California 191,050.39 153,441.51 101,145.55 407,934.54 California 182,901.99 144,372.41 118,671.85 383,199.62 New York 166,187.94 142,107.34 91,391.77 366,168.42 California y = b0 + b1*x1 + b2*x2 + b3*x3 + ??? Variables Dummy
  • 12. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 191,792.06 162,597.70 151,377.59 443,898.53 California 191,050.39 153,441.51 101,145.55 407,934.54 California 182,901.99 144,372.41 118,671.85 383,199.62 New York 166,187.94 142,107.34 91,391.77 366,168.42 California y = b0 + b1*x1 + b2*x2 + b3*x3 + ??? Variables Dummy
  • 13. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 1 191,792.06 162,597.70 151,377.59 443,898.53 California 0 191,050.39 153,441.51 101,145.55 407,934.54 California 0 182,901.99 144,372.41 118,671.85 383,199.62 New York 1 166,187.94 142,107.34 91,391.77 366,168.42 California 0 y = b0 + b1*x1 + b2*x2 + b3*x3 + ??? Variables Dummy
  • 14. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0 191,792.06 162,597.70 151,377.59 443,898.53 California 0 1 191,050.39 153,441.51 101,145.55 407,934.54 California 0 1 182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0 166,187.94 142,107.34 91,391.77 366,168.42 California 0 1 y = b0 + b1*x1 + b2*x2 + b3*x3 + ??? Variables Dummy
  • 15. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0 191,792.06 162,597.70 151,377.59 443,898.53 California 0 1 191,050.39 153,441.51 101,145.55 407,934.54 California 0 1 182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0 166,187.94 142,107.34 91,391.77 366,168.42 California 0 1 y = b0 + b1*x1 + b2*x2 + b3*x3 + ??? Variables Dummy Variables Dummy
  • 16. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0 191,792.06 162,597.70 151,377.59 443,898.53 California 0 1 191,050.39 153,441.51 101,145.55 407,934.54 California 0 1 182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0 166,187.94 142,107.34 91,391.77 366,168.42 California 0 1 y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1 Variables Dummy Variables Dummy
  • 17. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0 191,792.06 162,597.70 151,377.59 443,898.53 California 0 1 191,050.39 153,441.51 101,145.55 407,934.54 California 0 1 182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0 166,187.94 142,107.34 91,391.77 366,168.42 California 0 1 y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1 Variables Dummy Variables Dummy
  • 18. © SuperDataScience Machine Learning A-Z La trampa de las Variables Dummies
  • 19. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0 191,792.06 162,597.70 151,377.59 443,898.53 California 0 1 191,050.39 153,441.51 101,145.55 407,934.54 California 0 1 182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0 166,187.94 142,107.34 91,391.77 366,168.42 California 0 1 La Trampa de las Variables Dummies y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1 Variables Dummy
  • 20. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0 191,792.06 162,597.70 151,377.59 443,898.53 California 0 1 191,050.39 153,441.51 101,145.55 407,934.54 California 0 1 182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0 166,187.94 142,107.34 91,391.77 366,168.42 California 0 1 La Trampa de las Variables Dummies y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1 + b5*D2 Variables Dummy D2 = 1 - D1
  • 21. © SuperDataScience Machine Learning A-Z Profit R&D Spend Admin Marketing State New York California 192,261.83 165,349.20 136,897.80 471,784.10 New York 1 0 191,792.06 162,597.70 151,377.59 443,898.53 California 0 1 191,050.39 153,441.51 101,145.55 407,934.54 California 0 1 182,901.99 144,372.41 118,671.85 383,199.62 New York 1 0 166,187.94 142,107.34 91,391.77 366,168.42 California 0 1 La Trampa de las Variables Dummies y = b0 + b1*x1 + b2*x2 + b3*x3 + b4*D1 + b5*D2 Variables Dummy Siempre debemos omitir una variable
  • 22. © SuperDataScience Machine Learning A-Z Construir el Modelo (Paso a Paso)
  • 23. © SuperDataScience Machine Learning A-Z Construir el Modelo X2 X3 X4 X5 X6 X1 X7 y ¿Por qué?
  • 24. © SuperDataScience Machine Learning A-Z Construir el Modelo 1) 2)
  • 25. © SuperDataScience Machine Learning A-Z Construir el Modelo 5 métodos para construir modelos: 1. Exhaustivo (All-in) 2. Eliminación hacia atrás 3. Selección hacia adelante 4. Eliminación Bidireccional 5. Comparición de scores Regresión paso a paso
  • 26. © SuperDataScience Machine Learning A-Z Construir el Modelo “All-in” – cases: • Conocimiento a priori; OR • Necesidad; OR • Preparación previa para Eliminación hacia atrás
  • 27. © SuperDataScience Machine Learning A-Z Construir el Modelo Eliminación hacia atrás PASO 1: Seleccionar el nivel de significación para permanecer en el modelo (p.e. SL = 0.05) PASO 2: Se calcula el modelo con todas las posibles variables predictoras PASO 3: Considera la variable predictora con el p-valor más grande. Si P > SL, entonces vamos al PASO 4, si no vamos a FIN PASO 4: Se elimina la variable predictora PASO 5: Ajustar el modelo sin dicha variable* FIN: El modelo está listo
  • 28. © SuperDataScience Machine Learning A-Z Construir el Modelo Selección hacia adelante PASO 1: Elegimos un nivel de significación para entrar en el modelo (p.e. SL = 0.05) PASO 2: Ajustamos todos los modelos de regresión lineal simple y ~ xn Elegimos el que tiene menor p-valor. PASO 3: Conservamos esta variable, y ajustamos todos los posibles modelos con una variable extra añadida a la(s) que ya tenga(s) el modelo hasta el momento FIN: Conservamos el modelo anterior PASO 4: Consideramos la variable predictora con el menor p.valor. Si P < SL, vamos al PASO 3, si no a FIN
  • 29. © SuperDataScience Machine Learning A-Z Construir el Modelo Eliminación Bidireccional PASO 1: Seleccionar un nivel de significación para entrar y salir del modelo p.e.: SLENTER = 0.05, SLSTAY = 0.05 PASO 2: Llevar a cabo el siguiente Paso de Selección hacia adelante (con las nuevas variables con: P < SLENTER para entrar) PASO 3: Llevar a cabo TODOS los pasos de la Eliminación hacia atrás (las variables antiguas deben tener P < SLSTAY para quedarse) PASO 4: No hay nuevas variables para entrar ni antiguas para salir FIN: El modelo está listo
  • 30. © SuperDataScience Machine Learning A-Z Construir el Modelo Todos los modelos posibles PASO 1: Seleccionar un criterio de bondad de ajuste (p.e. criterio de Akaike) PASO 2: Construir todos los posibles modelos de regresión: 2N-1 combinaciones en total PASO 3: Seleccionar el modelo con el mejor criterio elegido FIN: El modelo está listo Por ejemplo: 10 columnas significan 1,023 modelos
  • 31. © SuperDataScience Machine Learning A-Z Construir el Modelo 5 métodos para construir modelos: 1. Exhaustivo (All-in) 2. Eliminación hacia atrás 3. Selección hacia adelante 4. Eliminación Bidireccional 5. Comparición de scores
  • 33. © SuperDataScience Machine Learning A-Z Recapitulación En esta sección hemos visto 1. Como crear variables dummies para las categorías de variables independientes 2. Como evitar la trampa de las variables dummies 3. Hacia atrás, hacia adelante, Bidireccional, Todos… 4. Construir un modelo paso a paso!! 5. Como usar el R2 Ajustado en modelización 6. Como interpretar los coeficientes de una RLM

Notas del editor

  1. After this tutorial you are going to be at the same time 1) sick of and 2) an expert in Microsoft Acronyms
  2. After this tutorial you are going to be at the same time 1) sick of and 2) an expert in Microsoft Acronyms
  3. After this tutorial you are going to be at the same time 1) sick of and 2) an expert in Microsoft Acronyms
  4. After this tutorial you are going to be at the same time 1) sick of and 2) an expert in Microsoft Acronyms
  5. After this tutorial you are going to be at the same time 1) sick of and 2) an expert in Microsoft Acronyms