Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Formulario Herramientas
Formulario Herramientas
●
● df.groupby('Sex').Survived.value_counts() : Agrupa la sobrevivencia por
sexo.
●
● df.groupby( ['Pclass','Sex'] ).Survived.value_counts() : Agrupa la
supervivencia por clase y sexo.
● df.Pclass.value_counts() : Cantidad de pasajeros por clase
● df.groupby('Pclass').Age.mean() : Edad promedio por clase
●
● GRÁFICOS CON SEABORN:
●
●
● NOTA: PARA QUE SEAN 2 LIENZOS, EN col Tiene que haber una
variable con 2 posibles valores.
●
RESUMEN GRÁFICOS:
● POR DEFECTO JUPYTER: siempre va “f,ax = plt.subplots(1,2,figsize=(16,7))”
○ df.Sex.value_counts().plot(kind='bar',ax=ax[0],color=['pink','brown'] )
○ df.Sex.value_counts().plot(kind='pie',ax=ax[1],autopct='%.2f%%',colors=
['brown','pink'] )
● Libreria SEABORN:
○ sns.countplot(df.Survived,hue=df.Embarked) PSDTA: 1 LIENZO
○ sns.catplot( x='Pclass',hue='Survived',col='Sex',data=df ,kind='count')
PSDTA: 2 LIENZOS, NOTA: PARA QUE SEAN 2 LIENZOS, EN col Tiene
que haber una variable con 2 posibles valores.
○ sns.histplot(df[df.Pclass==1].Fare,ax=ax[0],color=['green']) PSDTA:
PARA DISTRIBUCION
●
● 2) ELIMINAR LAS COLUMNAS QUE NO APORTAN NADA A LA PREDICCION:
●
● 3) Eliminar todas las filas cuyos valores sean todos valores faltantes (NaN).
●
● UNA VEZ REALIZADO LOS 3 PASOS, PODEMOS INICIAR CON EL MACHINE
LEARNING:
● 1) CREAR 2 DF: UNA CON V.I Y EL OTRO CON V.D
●
● 2) INTRODUCIR DATOS DE ENTRENAMIENTO, TESTEO, ETC…
●
● 3) APLICAR ALGORITMOS DE MACHINE LEARNING:
●