May-05-2020, 12:50 PM
Please clarify below error and support me to resolve this
My code is:
My code is:
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') data 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)Error is:
Error:---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-6-ce5307eca8bb> in <module>
1 x=data['Hardness'].values.reshape(-1,1)
2 y=data['Tensile strength'].values.reshape(-1,1)
----> 3 x_train,x_test,y_train,y_test = train_test_spilt(x,y,test_size=0.2,random_state=80)
NameError: name 'train_test_spilt' is not defined