Cross validation

I had a query regarding FIT with the cross validation…

When we do linear regression with a SINGLE test train split data set…we get a singleFIT to predict over the test data…

Whereas when we do cross validation (for eg cv=10) in linear regression…we have 10 training datasets…

BUT DO WE ALSO HAVE 10 FIT MODELS AS WELL FOR EACH TRAINING MODEL ???

OR

DO WE HAVE AN AVERAGE OF ALL THE 10 FIT MODELS???

I am able to get coefficient & intercept of the fit model via single training dataset

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.25,random_state=1,)
lm=LinearRegression()
fitting=lm.fit(X_train,y_train)
fitting.coef_
fitting.intercept_

How to get the intercept & coefficient for the fit model via cross validation???

what is the significance of cross_val_predict??? Does it have any relation my query???

Maybe you should have a look at https://stats.meta.stackexchange.com/questions/2254/crossvalidated-vs-datascience-what-is-different to choose an appropriate stackoverflow channel for you since this forum is about Jupyter.

1 Like