from sklearn datasets import load_iris iris load_iris(x_trainx_testy_trainy_test train_test_splitiris datairis targetrandom_state= gbrt gradientboostingclassifier(learning_rate= random_state= gbrt fit(x_trainy_trainin[ ]print("decision function shape{}format(gbrt decision_function(x_testshape)plot the first few entries of the decision function print("decision function:\ {}format(gbrt decision_function(x_test)[: :])out[ ]decision function shape( decision function[[- - - - [- - [- - [- - - ]in the multiclass casethe decision_function has the shape (n_samplesn_classesand each column provides "certainty scorefor each classwhere large score means that class is more likely and small score means the class is less likely you can recover the predictions from these scores by finding the maximum entry for each data pointin[ ]print("argmax of decision function:\ {}formatnp argmax(gbrt decision_function(x_test)axis= ))print("predictions:\ {}format(gbrt predict(x_test))out[ ]argmax of decision function[ predictions[ the output of predict_proba has the same shape(n_samplesn_classesagainthe probabilities for the possible classes for each data point sum to uncertainty estimates from classifiers