Tutorial by Examples

Support vector machines is a family of algorithms attempting to pass a (possibly high-dimension) hyperplane between two labelled sets of points, such that the distance of the points from the plane is optimal in some sense. SVMs can be used for classification or regression (corresponding to sklearn.s...
A random forest is a meta estimator that fits a number of decision tree classifiers on various sub-samples of the dataset and use averaging to improve the predictive accuracy and control over-fitting. A simple usage example: Import: from sklearn.ensemble import RandomForestClassifier Define tr...
Build a text report showing the main classification metrics, including the precision and recall, f1-score (the harmonic mean of precision and recall) and support (the number of observations of that class in the training set). Example from sklearn docs: from sklearn.metrics import classification_re...
Gradient Boosting for classification. The Gradient Boosting Classifier is an additive ensemble of a base model whose error is corrected in successive iterations (or stages) by the addition of Regression Trees which correct the residuals (the error of the previous stage). Import: from sklearn.ensem...
A decision tree is a classifier which uses a sequence of verbose rules (like a>7) which can be easily understood. The example below trains a decision tree classifier using three feature vectors of length 3, and then predicts the result for a so far unknown fourth feature vector, the so called te...
In LR Classifier, he probabilities describing the possible outcomes of a single trial are modeled using a logistic function. It is implemented in the linear_model library from sklearn.linear_model import LogisticRegression The sklearn LR implementation can fit binary, One-vs- Rest, or multinomia...

Page 1 of 1