<jupyter_start><jupyter_text>Import Libraries<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import pandas as pd<jupyter_output><empty_output><jupyter_text>Import Dataset<jupyter_code>dataset = pd.read_csv('Salary_Data.csv')
X = dataset.iloc[:, :-1].values
Y = dataset.iloc[:, -1].values
print(X)
print(Y)<jupyter_output>[ 39343.  46205.  37731.  43525.  39891.  56642.  60150.  54445.  64445.
  57189.  63218.  55794.  56957.  57081.  61111.  67938.  66029.  83088.
  81363.  93940.  91738.  98273. 101302. 113812. 109431. 105582. 116969.
 112635. 122391. 121872.]<jupyter_text>Spliting the data 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)
print(X_train)
print(Y_train)
print(X_test)
print(Y_test)<jupyter_output>[83088. 98273. 63218. 93940. 61111. 91738.]<jupyter_text>Predecting the Training set result<jupyter_code>from sklearn.linear_model import LinearRegression
regression = LinearRegression()
regression.fit(X_train,Y_train)<jupyter_output><empty_output><jupyter_text>Predecting the Test set result<jupyter_code>Y_Pred=regression.predict(X_test)<jupyter_output><empty_output><jupyter_text>Visualizing the Training set result<jupyter_code>plt.scatter(X_train,Y_train,color='Red')
plt.plot(X_train,regression.predict(X_train),color='blue')
plt.title('Salary vs Experience (Training Set)')
plt.xlabel('Year of Experience')
plt.ylabel('Salary')
plt.show()<jupyter_output><empty_output><jupyter_text>Visualizing the Test set result<jupyter_code>plt.scatter(X_test,Y_test,color='Red')
plt.plot(X_train,regression.predict(X_train),color='blue')
plt.title('Salary vs Experience (Test Set)')
plt.xlabel('Year of Experience')
plt.ylabel('Salary')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1266233766233766, 'fraction_numerical': 0.10443722943722944, 'mean_word_length': 7.328828828828829, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '96689', 'license': 'MIT', 'n_tokens_mistral': 869, 'n_tokens_neox': 724, 'n_words': 127, 'path': 'Regression/LinearRegressingWithSingleVariable.ipynb', 'repo_name': 'reachtomrinal/ML_A2Z_With_Python_Implementation', 'size': '1848'}