make the boolean true/false into and greater_zero (gbrt decision_function(x_test astype(intuse and as indices into classes_ pred gbrt classes_[greater_zeropred is the same as the output of gbrt predict print("pred is equal to predictions{}formatnp all(pred =gbrt predict(x_test)))out[ ]pred is equal to predictionstrue the range of decision_function can be arbitraryand depends on the data and the model parametersin[ ]decision_function gbrt decision_function(x_testprint("decision function minimum{ fmaximum{ }formatnp min(decision_function)np max(decision_function))out[ ]decision function minimum- maximum this arbitrary scaling makes the output of decision_function often hard to interpret in the following example we plot the decision_function for all points in the plane using color codingnext to visualization of the decision boundaryas we saw earlier we show training points as circles and test data as triangles (figure - )in[ ]figaxes plt subplots( figsize=( )mglearn tools plot_ d_separator(gbrtxax=axes[ ]alpha fill=truecm=mglearn cm scores_image mglearn tools plot_ d_scores(gbrtxax=axes[ ]alpha cm=mglearn reblfor ax in axesplot training and test points mglearn discrete_scatter(x_test[: ]x_test[: ]y_testmarkers='^'ax=axmglearn discrete_scatter(x_train[: ]x_train[: ]y_trainmarkers=' 'ax=axax set_xlabel("feature "ax set_ylabel("feature "cbar plt colorbar(scores_imageax=axes tolist()axes[ legend(["test class ""test class ""train class ""train class "]ncol= loc= )uncertainty estimates from classifiers