<jupyter_start><jupyter_text>Montando dataframe<jupyter_code>import pandas as pd
base = pd.read_csv('house_prices.csv')
x = base.iloc[:, 3:19].values
y = base.iloc[:, 2].values<jupyter_output><empty_output><jupyter_text>Divisão de dataframe em teste e treinamento<jupyter_code>from sklearn.model_selection import train_test_split
x_trein, x_teste, y_trein, y_teste = train_test_split(x, y, test_size=0.3, random_state=0)<jupyter_output><empty_output><jupyter_text>Regressão Random Forest<jupyter_code>from sklearn.ensemble import RandomForestRegressor
regressor = RandomForestRegressor(n_estimators=100)
regressor.fit(x_trein, y_trein)
regressor.score(x_trein, y_trein)
previsoes = regressor.predict(x_teste)
from sklearn.metrics import mean_absolute_error
mae = mean_absolute_error(y_teste, previsoes)
mae
regressor.score(x_teste, y_teste)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.011494252873563218, 'mean_word_length': 10.77027027027027, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '148914', 'license': 'MIT', 'n_tokens_mistral': 355, 'n_tokens_neox': 341, 'n_words': 53, 'path': 'regressao_random_forest_casa.ipynb', 'repo_name': 'andrade-lcs/python_machine_learning', 'size': '870'}