简体   繁体   中英

Validation_data argument in sklearn fit method

I am trying to get a separate predefined validation set passed to sklearn fit method. I was wondering if there is already a given way in the sklearn API to fulfill this need, like it is given within the keras API:

model.fit(train_X, train_y, validation_data=(val_x, val_y))

and

model.fit(train_X, train_y, validation_split=0.3)

Is there an equivialent within the sklearn API for the argument validation_data=(x_val, y_val) ? I only can find the validation_split argument within the documentation.

according to the docs here , no, you cannot, but you can use the score method after training on the validation set - in this case val_x and val_y - to see the performance of the model

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM