Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 18 additions & 189 deletions features-NLTK.ipynb → featuresNLTK.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -40,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -61,7 +61,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -87,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -120,7 +120,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -130,99 +130,18 @@
"La cantidad de publicaciones con titulo no nulo es: 234613\n",
"La cantidad total de publicaciones es: 240000\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>titulo</th>\n",
" <th>cant_palabras_mas_frecuentes_titulo</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>254099</td>\n",
" <td>depto. tipo a-402</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>53461</td>\n",
" <td>condominio horizontal en venta</td>\n",
" <td>3.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>247984</td>\n",
" <td>casa en venta urbi 3 recamaras tonala</td>\n",
" <td>3.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>209067</td>\n",
" <td>casa sola en toluca zinacantepec con credito i...</td>\n",
" <td>4.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>185997</td>\n",
" <td>paseos del sol</td>\n",
" <td>2.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id titulo \\\n",
"0 254099 depto. tipo a-402 \n",
"1 53461 condominio horizontal en venta \n",
"2 247984 casa en venta urbi 3 recamaras tonala \n",
"3 209067 casa sola en toluca zinacantepec con credito i... \n",
"4 185997 paseos del sol \n",
"\n",
" cant_palabras_mas_frecuentes_titulo \n",
"0 1.0 \n",
"1 3.0 \n",
"2 3.0 \n",
"3 4.0 \n",
"4 2.0 "
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Ejemplo de uso de las palabras mas frecuentes\n",
"\n",
"df_palabras = feature_cantidad_mas_frecuentes(df_train, 'titulo', 200)\n",
"df_palabras[['id', 'titulo', 'cant_palabras_mas_frecuentes_titulo']].head()"
"def ejemplo():\n",
" # Ejemplo de uso de las palabras mas frecuentes\n",
" df_palabras = feature_cantidad_mas_frecuentes(df_train, 'titulo', 200)\n",
" df_palabras[['id', 'titulo', 'cant_palabras_mas_frecuentes_titulo']].head()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -248,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -281,104 +200,14 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"La cantidad de publicaciones con titulo no nulo es: 234613\n",
"La cantidad total de publicaciones es: 240000\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>titulo</th>\n",
" <th>cant_palabras_menos_frecuentes_titulo</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>254099</td>\n",
" <td>depto. tipo a-402</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>53461</td>\n",
" <td>condominio horizontal en venta</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>247984</td>\n",
" <td>casa en venta urbi 3 recamaras tonala</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>209067</td>\n",
" <td>casa sola en toluca zinacantepec con credito i...</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>185997</td>\n",
" <td>paseos del sol</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id titulo \\\n",
"0 254099 depto. tipo a-402 \n",
"1 53461 condominio horizontal en venta \n",
"2 247984 casa en venta urbi 3 recamaras tonala \n",
"3 209067 casa sola en toluca zinacantepec con credito i... \n",
"4 185997 paseos del sol \n",
"\n",
" cant_palabras_menos_frecuentes_titulo \n",
"0 0.0 \n",
"1 0.0 \n",
"2 0.0 \n",
"3 0.0 \n",
"4 0.0 "
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# Ejemplo de uso de las palabras menos frecuentes\n",
"\n",
"df_palabras = feature_cantidad_menos_frecuentes(df_train, 'titulo', 200)\n",
"df_palabras[['id', 'titulo', 'cant_palabras_menos_frecuentes_titulo']].head()"
"def ejemplo():\n",
" # Ejemplo de uso de las palabras menos frecuentes\n",
" df_palabras = feature_cantidad_menos_frecuentes(df_train, 'titulo', 200)\n",
" df_palabras[['id', 'titulo', 'cant_palabras_menos_frecuentes_titulo']].head()"
]
}
],
Expand Down
Loading