<jupyter_start><jupyter_text>Importação dos dados* uid: 000001* tipo de dia: dia letivo* horario: 13:30 a 17:30* potencia: ativa da fase A* época: primavera* dias: terça e quinta<jupyter_code>data = pd.read_csv ('../datasets/temperatura_e_potencia.csv', sep=',', decimal=',')
data.describe()
data.plot(subplots=True)
data.corr()<jupyter_output><empty_output><jupyter_text>Training<jupyter_code>from sklearn.model_selection import train_test_split 
X = data ['temperatura'].to_frame()
y = data ['potencia ativa A'].to_frame()
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20) 



lm = LinearRegression()
lm.fit (X, y)
pd.DataFrame(lm.coef_,X.columns,columns=['Coefficient'])<jupyter_output><empty_output><jupyter_text>Model Evaluation<jupyter_code>from sklearn import metrics
predictions = lm.predict(X_test)

print('MAE:', metrics.mean_absolute_error(y_test, predictions))
print('MSE:', metrics.mean_squared_error(y_test, predictions))
print('RMSE:', np.sqrt(metrics.mean_squared_error(y_test, predictions)))

plt.scatter(y_test,predictions)<jupyter_output>MAE: 15.363788513254276
MSE: 482.9751182559476
RMSE: 21.976694889267304
{'fraction_non_alphanumeric': 0.140625, 'fraction_numerical': 0.058159722222222224, 'mean_word_length': 8.939655172413794, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '429338', 'license': 'MIT', 'n_tokens_mistral': 504, 'n_tokens_neox': 445, 'n_words': 77, 'path': 'artificial_intelligence/01 - ConsumptionRegression/1 - Linear regression (temperature).ipynb', 'repo_name': 'LeonardoSanBenitez/LorisWeb', 'size': '1152'}