I am new with sklearn
.
My objective is to estimate the score of a dataset using cross_val_score
with BayesianRidge
estimator. It should be implemented using an unsupervised learning
. The code below is taken from sklearn
except that the target variable
, y
, is excluded.
The data is taken from sklearn.datasets import fetch_california_housing
.
estimator = BayesianRidge()
score_full_data = pd.DataFrame(cross_val_score(br_estimator, X=X, y=None, scoring='neg_mean_squared_error', cv=5), columns=['Data'])
I got a TypeError: fit() missing 1 required positional argument: 'y'
.
The expected result is:
Data
0 -0.408433
1 -0.636009
2 -0.614910
3 -1.089616
4 -0.407541
How is the correct way to do it?