<jupyter_start><jupyter_text>Regressão Linear Simples<jupyter_code>!pip install numpy
!pip install matplotlib
!pip install pandas

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
salarios = pd.read_csv('salary_data.csv')
salarios.head()
!pip install sklearn
X = salarios.iloc[:, :-1].values
y = salarios.iloc[:, -1].values

from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.3, random_state=42)
from sklearn.linear_model import LinearRegression
lr = LinearRegression()
lr.fit(X_train, y_train)<jupyter_output><empty_output><jupyter_text>Visualização dos desempenhos em treinamento<jupyter_code>_ = plt.scatter(X_train, y_train, color="red")
plt.ylabel('Salário')
plt.xlabel('Experiência')
_ = plt.scatter(X_test, y_test, color="red")
plt.plot(X_test, lr.predict(X_test), color="blue")
plt.title('Salário vs Experiência (Test)')
plt.ylabel('Salário')
plt.xlabel('Experiência')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12712712712712712, 'fraction_numerical': 0.005005005005005005, 'mean_word_length': 8.174311926605505, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '490928', 'license': 'MIT', 'n_tokens_mistral': 391, 'n_tokens_neox': 375, 'n_words': 76, 'path': 'aprendizado-de-maquina-i/regressao/regressao_linear_simples.ipynb', 'repo_name': 'andredarcie/my-data-science-notebooks', 'size': '999'}