<jupyter_start><jupyter_text>SVD<jupyter_code>X=contador.transform(properati["description"])

from sklearn.decomposition import TruncatedSVD
componentes=10
svd=TruncatedSVD(n_components=componentes)

X_svd=(svd.fit_transform(X))

properati["features"]= [np.split(row,componentes) for row in X_svd]

print nombres

properati[nombres]=pd.DataFrame(properati.features.values.tolist())
properati[nombres].<jupyter_output><empty_output><jupyter_text>Busco features<jupyter_code>properati = pd.read_csv('datos/properati_final.csv')
properati.dropna(subset=["description"],inplace=True)
descripcion = properati["description"]
import re
palabras=[]
for row in descripcion:
    row =row.lower()
    row=filter(None, re.split("[, \-!?:._¡¿'`<>;()+]", row))
    for palabra in row:
        if len(palabra)<4: #saco conectores
            continue
        palabras.append(palabra)
from collections import Counter
contador = Counter(palabras)
contador.most_common(500)
contador.most_common()[-300:]   
features_nuevas=["cochera","comedor","living","amplio","suite","lavadero","cochera","terraza","hall","placard","balcon","parrilla","aire","patio","muebles","pileta"\
                ,"mesada","parque","quincho","escalera","chalet","monoambiente","porcelanato","caldera","solarium","duplex","cancha","ascensor","recepción","vigilancia"]
for feature in features_nuevas:
    properati.loc[:,feature]=descripcion.str.lower().str.contains(feature)
properati.to_csv('datos/properati_final_y_descripcion.csv',index=False)
 test_samples = pd.read_csv('datos/properati_dataset_testing_noprice_acondicionado.csv')
for feature in features_nuevas:
    test_samples.loc[:,feature]=test_samples["description"].str.lower().str.contains(feature)
test_samples.to_csv('datos/properati_dataset_testing_noprice_acondicionado.csv',index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1618685497012493, 'fraction_numerical': 0.004888647474198805, 'mean_word_length': 8.746031746031745, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '524946', 'license': 'MIT', 'n_tokens_mistral': 678, 'n_tokens_neox': 653, 'n_words': 70, 'path': 'Features de la Description.ipynb', 'repo_name': 'AlejandroDaneri/Machine-Learning-Properati', 'size': '1841'}