<jupyter_start><jupyter_text><jupyter_code># Importing the Required Libraries Numpy,Pandas & MatplotLib.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Reading from CSV Dataset file.
dataset = pd.read_csv('CO2_data2.csv')

print(dataset)
# Assigning the values to two variables X & Y using List Slicing (Adding all Columns except Target Attribute to X)
X = dataset.iloc[:,:-1].values
Y = dataset.iloc[:,-1].values

print(X)
print(Y)
#Splitting the data into Training and Testing Data (Using 0.3 is giving better accuracy by approx ~ 2%)
from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test = train_test_split(X,Y, test_size=0.3)
print(X_train.shape, X_test.shape)
#Fitting Simple Linear Regression Model using X_train & Y_train values
from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(X_train, Y_train)
#Predicting the test results
Y_pred = model.predict(X_test)
print(Y_pred)
print(Y_train)
#Calculate Accuracy
accuracy = model.score(X_test,Y_test)
print(accuracy)
# Predicting on an external Data
test_data = np.array([[ 2,6,112]])
test_pred = model.predict(test_data)
print(test_pred)
engineSize =int(input("What is your Engine Size? "))
cylinderNumber = int(input("Number of cyclinders your engine has? "))
fuelConsumption = int(input("What is your fuel consumption in L/100km? "))

co2Emission = model.predict(np.array([[engineSize, cylinderNumber, fuelConsumption]])) 
print('Estimated CO2 Emission with ' + str(fuelConsumption) + ' Litres of Fuel , Engine Size =  '+ str(engineSize) + ' & No of Cylinders = ' + str(cylinderNumber) + ' is ' + str(co2Emission[0]) + ' gm per kilometer')<jupyter_output>What is your Engine Size? 4
Number of cyclinders your engine has? 8
What is your fuel consumption in L/100km? 350
Estimated CO2 Emission with 350 Litres of Fuel , Engine Size =  4 & No of Cylinders = 8 is 4008.9111314415204 gm per kilometer
{'fraction_non_alphanumeric': 0.10087493566649511, 'fraction_numerical': 0.02676273803396809, 'mean_word_length': 5.821052631578947, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '566477', 'license': 'MIT', 'n_tokens_mistral': 692, 'n_tokens_neox': 649, 'n_words': 207, 'path': 'Multiple_Regression.ipynb', 'repo_name': 'Prathamesh-Shanbhag/MLDLS2021', 'size': '1943'}