<jupyter_start><jupyter_text>Sales Channel Prediction Assignment  1. Loading Dataset and Libraries<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline

dataset = pd.read_csv('Advertising.csv',index_col = 0)<jupyter_output><empty_output><jupyter_text>2. Doing Some EDA<jupyter_code>dataset.head()
dataset.info()
dataset.describe()
dataset.shape
dataset.nunique()
dataset.isnull().sum()<jupyter_output><empty_output><jupyter_text>3. Segregating Input and Output Variable<jupyter_code>X = dataset[['TV','radio','newspaper']]
y = dataset['sales']
X.head()
y.head()
X.iloc[:,1:].corr()
from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.30,random_state=101)
from sklearn.linear_model import LinearRegression
Regressor = LinearRegression()
Regressor.fit(X_train,y_train)
y_predict = SimpleLinearRegression.predict(X_test)
from sklearn.metrics import r2_score
score = r2_score(y_test,y_predict)
score<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11641221374045801, 'fraction_numerical': 0.012404580152671756, 'mean_word_length': 9.184466019417476, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '342570', 'license': 'Unlicense', 'n_tokens_mistral': 395, 'n_tokens_neox': 378, 'n_words': 69, 'path': 'MultiCollinearity In Linear Regression/.ipynb_checkpoints/Sales Channel Prediction Assignment-checkpoint.ipynb', 'repo_name': 'yashrajjain726/Machine-Learning-Hands-On-Practice', 'size': '1048'}