- "\n# Comparison of Calibration of Classifiers\n\n\nWell calibrated classifiers are probabilistic classifiers for which the output\nof the predict_proba method can be directly interpreted as a confidence level.\nFor instance a well calibrated (binary) classifier should classify the samples\nsuch that among the samples to which it gave a predict_proba value close to\n0.8, approx. 80% actually belong to the positive class.\n\nLogisticRegression returns well calibrated predictions as it directly\noptimizes log-loss. In contrast, the other methods return biased probabilities,\nwith different biases per method:\n\n* GaussianNaiveBayes tends to push probabilities to 0 or 1 (note the counts in\n the histograms). This is mainly because it makes the assumption that features\n are conditionally independent given the class, which is not the case in this\n dataset which contains 2 redundant features.\n\n* RandomForestClassifier shows the opposite behavior: the histograms show\n peaks at approx. 0.2 and 0.9 probability, while probabilities close to 0 or 1\n are very rare. An explanation for this is given by Niculescu-Mizil and Caruana\n [1]: \"Methods such as bagging and random forests that average predictions from\n a base set of models can have difficulty making predictions near 0 and 1\n because variance in the underlying base models will bias predictions that\n should be near zero or one away from these values. Because predictions are\n restricted to the interval [0,1], errors caused by variance tend to be one-\n sided near zero and one. For example, if a model should predict p = 0 for a\n case, the only way bagging can achieve this is if all bagged trees predict\n zero. If we add noise to the trees that bagging is averaging over, this noise\n will cause some trees to predict values larger than 0 for this case, thus\n moving the average prediction of the bagged ensemble away from 0. We observe\n this effect most strongly with random forests because the base-level trees\n trained with random forests have relatively high variance due to feature\n subseting.\" As a result, the calibration curve shows a characteristic sigmoid\n shape, indicating that the classifier could trust its \"intuition\" more and\n return probabilities closer to 0 or 1 typically.\n\n* Support Vector Classification (SVC) shows an even more sigmoid curve as\n the RandomForestClassifier, which is typical for maximum-margin methods\n (compare Niculescu-Mizil and Caruana [1]), which focus on hard samples\n that are close to the decision boundary (the support vectors).\n\n.. topic:: References:\n\n .. [1] Predicting Good Probabilities with Supervised Learning,\n A. Niculescu-Mizil & R. Caruana, ICML 2005\n\n"
0 commit comments