<jupyter_start><jupyter_text>**Simple Linear Regression**  Data Preprocessing  Importing the libaries<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import pandas as pd<jupyter_output><empty_output><jupyter_text>Importing the dataset<jupyter_code>dataset = pd.read_csv('/content/sample_data/Salary_Data.csv')
x = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values<jupyter_output><empty_output><jupyter_text>Splitting the dataset into Training set and Test set<jupyter_code>from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=1)
pd.DataFrame(X_train, y_train)<jupyter_output><empty_output><jupyter_text>Training the simple Linear Regression model on the Training set<jupyter_code>from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
regressor.fit(X_train, y_train)<jupyter_output><empty_output><jupyter_text>Predicting the Test set results<jupyter_code>y_predict = regressor.predict(X_test)<jupyter_output><empty_output><jupyter_text>Visualising the Training set results<jupyter_code>plt.scatter(X_train, y_train, color = 'red')
plt.plot(X_train, regressor.predict(X_train), color = 'blue')
plt.title('Salary vs Experience (Training set)')
plt.xlabel('Years of Experience')
plt.ylabel('Salary')
plt.show()<jupyter_output><empty_output><jupyter_text>Visualising the Test set results<jupyter_code>plt.scatter(X_test, y_test, color = 'red')
plt.plot(X_train, regressor.predict(X_train), color = 'blue')
#plt.plot(X_test, y_predict, color = 'blue')
plt.title('Salary vs Experience (Test set)')
plt.xlabel('Years of Experience')
plt.ylabel('Salary')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11948955916473318, 'fraction_numerical': 0.002900232018561485, 'mean_word_length': 9.648148148148149, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '232680', 'license': 'MIT', 'n_tokens_mistral': 642, 'n_tokens_neox': 614, 'n_words': 116, 'path': 'SimpleLInearRegression.ipynb', 'repo_name': 'Holarmc/Machine-learning-Models', 'size': '1724'}