Commit c954c9be authored by Joaquin Torres's avatar Joaquin Torres

Replacing nans with mode and recomputing corr

parent 21b3cb2c
......@@ -3858,6 +3858,40 @@
"print(\"------SIT_TTO 3: ALTA-----\")\n",
"find_diff(3, corr_mats[2][0], corr_mats[2][1])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### PCA (in progress)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# ==============================================================================\n",
"from sklearn.decomposition import PCA\n",
"from sklearn.pipeline import make_pipeline\n",
"from sklearn.preprocessing import StandardScaler\n",
"from sklearn.preprocessing import scale"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Standarize data to have mean 0 and sd 1, since variables have different dispersions -> PCA\n",
"pca_pipe = make_pipeline(StandardScaler(), PCA())\n",
"pca_pipe.fit(bd)\n",
"\n",
"# Se extrae el modelo entrenado del pipeline\n",
"modelo_pca = pca_pipe.named_steps['pca']"
]
}
],
"metadata": {
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment