figure - roc curve for our logistic regression model we achieved almost accuracy if you remember for this model and hence the roc curve is almost perfect where we also see that the area under curve (aucis which is perfect finallyfrom our feature importance ranks we obtained earlierlet' see if we can visualize the model' decision surface or decision boundarywhich basically gives us visual depiction of how well the model is able to learn data points pertaining to each class and separate points belonging to different classes this surface is basically the hypersurfacewhich helps in separating the underlying vector space of data samples based on their features (feature spaceif this surface is linearthe classification problem is linear and the hypersurface is also known as hyperplane our model evaluation utilities module helps us plot this with the help of an easy-touse function (do note this works only for scikit estimators at the moment since there was no clone function for keras based estimators and it just got published last month as of writing this bookwe might push change sometime in the future once it is stablein [ ]feature_indices [ for ifeature in enumerate(wtp_feature_namesif feature in ['density''total sulfur dioxide']meu plot_model_decision_surface(clf=wtp_lrtrain_features=wtp_train_sx[:feature_indices]train_labels=wtp_train_yplot_step= cmap=plt cm wistia_rmarkers=[','' ']alphas=[ ]colors=[' '' ']since we would want to plot the decision surface on the underlying feature spacevisualizing this becomes extremely difficult when you have more than two features hence for the sake of simplicity and ease of interpretationwe will use the top two most important features (density and total sulfur dioxideto visualize the model decision surface this is done by fitting cloned model of the original model estimator on those two features and then plotting the decision surface based on what it has learned check out the plot_model_decision_surfacefunction for more low-level details on how we visualize the decision surfaces