model evaluation and improvement having discussed the fundamentals of supervised and unsupervised learningand having explored variety of machine learning algorithmswe will now dive more deeply into evaluating models and selecting parameters we will focus on the supervised methodsregression and classificationas evaluating and selecting models in unsupervised learning is often very qualitative process (as we saw in to evaluate our supervised modelsso far we have split our dataset into training set and test set using the train_test_split functionbuilt model on the training set by calling the fit methodand evaluated it on the test set using the score methodwhich for classification computes the fraction of correctly classified samples here' an example of that processin[ ]from sklearn datasets import make_blobs from sklearn linear_model import logisticregression from sklearn model_selection import train_test_split create synthetic dataset xy make_blobs(random_state= split data and labels into training and test set x_trainx_testy_trainy_test train_test_split(xyrandom_state= instantiate model and fit it to the training set logreg logisticregression(fit(x_trainy_trainevaluate the model on the test set print("test set score{ }format(logreg score(x_testy_test))out[ ]test set score