October 2018
Intermediate to advanced
172 pages
4h 6m
English
When building multiple machine learning models, it is important to understand which of the models in question produces the type of predictions that you want it to generate. The cumulative gains curve helps you with the process of model comparison, by telling you about the percentage of a category/class that appears within a percentage of the sample population for a particular model.
In simple terms, in the fraud detection dataset, we might want to pick a model that can predict a larger number of fraudulent transactions, as opposed to a model that cannot. In order to construct the cumulative gains plot for the k-nearest neighbors model, we use the following code:
import scikitplot as skplttarget_prob = knn_classifier.predict_proba(X_test) ...
Read now
Unlock full access