1
$\begingroup$

While I understand that if I train a model using the same data that I test on, then I'll certainly be overfitting, but will the accuracy of that model always be 100%?

In other words, is one method of testing whether I've created my model correctly, to test the model by training it on the testing data?

$\endgroup$
2
$\begingroup$

It will likely be not 100% even though it is possible. But, for example, a linear model might not be able to represent a non-linear relationship in your data. Or your features don't contain sufficient information to separate all classes.

Your other question doesn't seem to make sense. If you train your model on the test data, the test data wouldn't really be test data anymore?!

There are tons of resources on bias-variance trade-off and overfitting.

$\endgroup$
2
  • $\begingroup$ Thanks for the response. So I built a basic regression model, and one of my peers asked me what my accuracy would be if I trained the data using the same dataset that I test on. He was wondering if that should be 100% accurate. $\endgroup$ – Gary Mar 7 '17 at 23:35
  • 1
    $\begingroup$ What do you mean by accuracy in a regression setting? Whatever it is, can't you compute it or is this a general question? In general, it doesn't have to be a perfect fit. But it is possible. For example, KNN would simply memorize the entire dataset and therefor give you a perfect result for every data point that is part of the training set. But, if you build a linear regression model to predict somebodys height based on gender alone than it won't be 100% "accurate" unless all males and females have exactly the same weight. $\endgroup$ – oW_ Mar 7 '17 at 23:57
2
$\begingroup$
  • Just because you're training on your training set, that doesn't mean you overfit your model. In fact, you must train on your training set, this is definition. If you use the test set for training, then it's not a test set.
  • A common way to avoid overfitting is by regularization. Cross-validation is another possibility. There are many many other ways.
  • It's possible to achieve 100% accuracy in both training, validation and testing set. That depends on your complexity of the problem and model.
$\endgroup$

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.