<jupyter_start><jupyter_text><jupyter_code>#Import all the required libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
Url='https://raw.githubusercontent.com/VallabhK/MachineLearning/master/LinearRegression/Salary_Data.csv?token=<KEY>'
dataset=pd.read_csv(Url)
X = dataset.iloc[:,:-1].values
y = dataset.iloc[:,-1].values
#Split the data into train and test set
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 1/3, random_state = 0)
#Train the Linear Regression model
from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
regressor.fit(X_train, y_train)
#Testing the model
y_pred = regressor.predict(X_test)
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()
plt.scatter(X_test, y_test, color = 'red')
plt.plot(X_train, regressor.predict(X_train), 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.1300745650372825, 'fraction_numerical': 0.004142502071251036, 'mean_word_length': 7.217687074829932, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 1, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '273632', 'license': 'MIT', 'n_tokens_mistral': 451, 'n_tokens_neox': 425, 'n_words': 99, 'path': 'LinearRegression/SimpleLinearRegression.ipynb', 'repo_name': 'VallabhK/MachineLearning', 'size': '1231'}