I would like to use K-fold cross-validation on my data of my model.
My codes in Keras is :
a = np.array(
[[283, 95, 72, 65],
[290, 100, 80, 72],
[120,170,130,122],
[100,230,110,200],
[300,100,200,500]]
)
X = a[:,0:2]
Y = a[:,3]
from sklearn.model_selection import KFold, cross_val_score
k_fold = KFold(n_splits=3)
model = models.Sequential()
model.add(Dense(12, input_shape=(3,)))
model.add(LeakyReLU())
model.summary()
cross_val_score(model,X,Y)
But, It makes this error:
If no scoring is specified, the estimator passed should have a 'score' method. The estimator does not.
And when I select a scoring parameter as:
cross_val_score(model,X,Y, scoring= 'accuracy')
It makes another error:
TypeError: Cannot clone object '' (type ): it does not seem to be a scikit-learn estimator as it does not implement a 'get_params' methods.
How can I use K-fold cross-validation on this model?
Thank you