Python Forum

Full Version: Doubt in Linear Reg - "random_state"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
import pandas as pd
import numpy as np
from sklearn import linear_model
import statsmodels.api as sm
from sklearn.metrics import mean_squared_error
data=pd.read_excel('C:/Users/Kumaran TS/Desktop/Jupyter prg/Tensile.xlsx')
from sklearn.model_selection import train_test_split
x=data['Hardness'].values.reshape(-1,1)
y=data['Tensile strength'].values.reshape(-1,1)
x_train,x_test,y_train,y_test = train_test_spilt(x,y,test_size=0.2,random_state=80)
what is the purpose of "random_state=80" if i change the value and my output varies. Please explain.