0
$\begingroup$

I am new to data science, and the dataset I am working on is divided into train set, test set, and validation set. However, till now I was splitting the data with train_test_split. I expected model.fit() would have an option like validation =. But, there is none. How I can use the CV set to improve results?

$\endgroup$
0
$\begingroup$

Well, there are ways to do it within model.fit(). Namely, you can define validation_split parameter, (e.g. 0.2 or 0.3) which represents a percentage of the data that will be used as a validation in training (0.2 = 20%, 0.3 = 30%). The second way, when you have your validation data, is to use validation_data = (x_val, y_val), where you just pass your validation x and y

| improve this answer | |
$\endgroup$
  • $\begingroup$ That is for Keras. I believe the question referes to scikit-learn. $\endgroup$ – Simon Larsson Sep 24 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.