'Predictions into the future Azure Machine Learning Studio Designer

I am currently developing an automated mechanism where I use the Azure Machine Learning Designer (AMLD). During development i used an 80/20 Split to test the efficency of my predictions. Now i want to go live but I've missed the point where i can actually predict into the future.

I currently get a prediction for the last 20% of my data so i can compare them to the actual data. How do i change it so that the prediction actually starts at the end of my data?

A part of my prediction process is attached:

enter image description here



Solution 1:[1]

Continuing with the comments:

Example problem statement: Predicting salary based on experience.

The dataset consists of three columns and salary is the dependent variable and first two columns will be independent variables

enter image description here

The sample code starts from below.

#importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

#importing the dataset
dataset = pd.read_csv('Position_Salaries.csv')
X = dataset.iloc[:, 1:-1].values
y = dataset.iloc[:, -1].values

#Training the linear regression model on complete dataset
from sklearn.linear_model import LinearRegression
lin_reg = LinearRegression()
lin_reg.fit(X, y)
#Training with the model. 
from sklearn.preprocessing import PolynomialFeatures
poly_reg = PolynomialFeatures(degree = 4)
X_poly = poly_reg.fit_transform(X)
lin_reg_2 = LinearRegression()
lin_reg_2.fit(X_poly, y)

As a sample I am giving polynomial regression

#visualize Linear regression results.
plt.scatter(X, y, color = 'red')
plt.plot(X, lin_reg.predict(X), color = 'blue')
plt.title('Truth or Bluff (Linear Regression)')
plt.xlabel('Position Level')
plt.ylabel('Salary')
plt.show()

#Visualize Polynomial regression results
plt.scatter(X, y, color = 'red')
plt.plot(X, lin_reg_2.predict(poly_reg.fit_transform(X)), color = 'blue')
plt.title('Truth or Bluff (Polynomial Regression)')
plt.xlabel('Position level')
plt.ylabel('Salary')
plt.show()

#Predicting new result with linear regression-> this can help you
lin_reg.predict([[6.5]])

#Predicting new result with polynomial regression
lin_reg_2.predict(poly_reg.fit_transform([[6.5]]))

Go through the flow of implementation of two different regression models on same dataset and how the difference in results will be.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1