Python Forum
Doubt in Linear Reg - "random_state"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Doubt in Linear Reg - "random_state"
#1
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.
Reply
#2
check https://stackoverflow.com/a/28069274/4046632
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Doubt in Linear Reg by 'MLE' method kumarants 2 1,856 May-08-2020, 12:52 PM
Last Post: kumarants
  Linear regression doubt - Urgent kumarants 6 3,054 May-05-2020, 04:11 PM
Last Post: kumarants
  How to build linear regression by implementing Gradient Descent using only linear alg PythonSpeaker 1 2,161 Dec-01-2019, 05:35 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020