training set if the training and test sets have enough in commonwe expect the model to also be accurate on the test set howeverthere are some cases where this can go wrong for exampleif we allow ourselves to build very complex modelswe can always be as accurate as we like on the training set let' take look at made-up example to illustrate this point say novice data scientist wants to predict whether customer will buy boatgiven records of previous boat buyers and customers who we know are not interested in buying boat the goal is to send out promotional emails to people who are likely to actually make purchasebut not bother those customers who won' be interested suppose we have the customer records shown in table - table - example data about customers age number of owns house number of children marital status owns dog bought boat cars owned yes widowed no yes yes married no yes no married yes no no single no no no divorced yes no yes married yes no no single no no yes married yes no yes divorced no yes yes divorced no no yes married yes yes no single no no after looking at the data for whileour novice data scientist comes up with the following rule"if the customer is older than and has less than children or is not divorcedthen they want to buy boat when asked how well this rule of his doesour data scientist answers"it' percent accurate!and indeedon the data that is in the tablethe rule is perfectly accurate there are many possible rules we could come up with that would explain perfectly if someone in this dataset wants to buy boat no age appears twice in the dataso we could say people who are or in the real worldthis is actually tricky problem while we know that the other customers haven' bought boat from us yetthey might have bought one from someone elseor they may still be saving and plan to buy one in the future generalizationoverfittingand underfitting