STCMRKTFRCST - Multiple Linear Regression
STCMRKTFRCST - Multiple Linear Regression
pyplot as plt
import numpy as np
import pandas as pd
data = pd.read_csv("C:/Users/x/Desktop/Desktop/ML/AAPL.csv")
# Dependent variable Y
close_prices = data['Close(t)']
X = np.array(data2)
print(X)
regr = linear_model.LinearRegression()
regr.fit(X_train, Y_train)
Y_pred = regr.predict(X_test)
# The coefficients
# x axis values
x = data['Close(t)']
y = data['Year']
plt.plot(x, y)
# naming the x axis
plt.xlabel('Price')
plt.ylabel('Date')
plt.title('Closing price')
plt.show()
# x axis values
x = Y_pred
y = data['Year']
plt.plot(x, y)
plt.xlabel('pred.Price')
plt.ylabel('Date')
plt.show()