Linear Regression Prediction of future values in Python using Scatter Plot - Machine Learning
We are Importing Necessary Libraries for this project import pandas as pandas import numpy as numpy import matplotlib.pyplot as pyplot from sklearn.linear_model import LinearRegression Importing Data using Pandas library and creating table dataframe data = pandas.read_csv('python_linear_regression_prediction_python_data.csv') print(data) Assigning Input / Independent columns to X variable and Assigning Output / Dependent Column to Y Variable x = data[['Experience_Years','Calls_Made','Meetings_Conducted']] y = data['Sales_Amount'] Asking Linear Regression Model to learn data from X and Y variables model = LinearRegression() model.fit(x,y) Printing Coefficient and Intercept to check their values print("Coefficient:",model.coef_) print("Intercept",model.intercept_) Adding New Inputs / Independent Values to predict Output / Dependent values new_data = pandas.DataFrame({ 'Experience_Years': [8, 12, 15], '...