of coef_ and intercept_ scikit-learn always stores anything that is derived from the training data in attributes that end with trailing underscore that is to separate them from parameters that are set by the user the intercept_ attribute is always single float numberwhile the coef_ attribute is numpy array with one entry per input feature as we only have single input feature in the wave datasetlr coef_ only has single entry let' look at the training set and test set performancein[ ]print("training set score{ }format(lr score(x_trainy_train))print("test set score{ }format(lr score(x_testy_test))out[ ]training set score test set score an of around is not very goodbut we can see that the scores on the training and test sets are very close together this means we are likely underfittingnot overfitting for this one-dimensional datasetthere is little danger of overfittingas the model is very simple (or restrictedhoweverwith higher-dimensional datasets (meaning datasets with large number of features)linear models become more powerfuland there is higher chance of overfitting let' take look at how linearre gression performs on more complex datasetlike the boston housing dataset remember that this dataset has samples and derived features firstwe load the dataset and split it into training and test set then we build the linear regression model as beforein[ ]xy mglearn datasets load_extended_boston(x_trainx_testy_trainy_test train_test_split(xyrandom_state= lr linearregression(fit(x_trainy_trainwhen comparing training set and test set scoreswe find that we predict very accurately on the training setbut the on the test set is much worsein[ ]print("training set score{ }format(lr score(x_trainy_train))print("test set score{ }format(lr score(x_testy_test)) supervised learning