Decision boundary of label propagation versus SVM on the Iris dataset

Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demonstrates Label Propagation learning a good boundary even with a small amount of labeled data. print(__doc__) # Authors: Clay Woolam <clay@woolam.org> # License: BSD import numpy as np import matplotlib.pyplot as plt from sklearn import datasets from sklearn import svm from sklearn.semi_supervised import label_propagation rng = np.random.RandomState(0) iris = datasets.load_iris()

Decision Tree Regression

A 1D regression with decision tree. The decision trees is used to fit a sine curve with addition noisy observation. As a result, it learns local linear regressions approximating the sine curve. We can see that if the maximum depth of the tree (controlled by the max_depth parameter) is set too high, the decision trees learn too fine details of the training data and learn from the noise, i.e. they overfit. print(__doc__) # Import the necessary modules and libraries import numpy as np from s

cross_validation.StratifiedShuffleSplit()

Warning DEPRECATED class sklearn.cross_validation.StratifiedShuffleSplit(y, n_iter=10, test_size=0.1, train_size=None, random_state=None) [source] Stratified ShuffleSplit cross validation iterator Deprecated since version 0.18: This module will be removed in 0.20. Use sklearn.model_selection.StratifiedShuffleSplit instead. Provides train/test indices to split data in train test sets. This cross-validation object is a merge of StratifiedKFold and ShuffleSplit, which returns stratified ra

cross_validation.StratifiedKFold()

Warning DEPRECATED class sklearn.cross_validation.StratifiedKFold(y, n_folds=3, shuffle=False, random_state=None) [source] Stratified K-Folds cross validation iterator Deprecated since version 0.18: This module will be removed in 0.20. Use sklearn.model_selection.StratifiedKFold instead. Provides train/test indices to split data in train test sets. This cross-validation object is a variation of KFold that returns stratified folds. The folds are made by preserving the percentage of sampl

cross_validation.ShuffleSplit()

Warning DEPRECATED class sklearn.cross_validation.ShuffleSplit(n, n_iter=10, test_size=0.1, train_size=None, random_state=None) [source] Random permutation cross-validation iterator. Deprecated since version 0.18: This module will be removed in 0.20. Use sklearn.model_selection.ShuffleSplit instead. Yields indices to split data into training and test sets. Note: contrary to other cross-validation strategies, random splits do not guarantee that all folds will be different, although this

cross_validation.PredefinedSplit()

Warning DEPRECATED class sklearn.cross_validation.PredefinedSplit(test_fold) [source] Predefined split cross validation iterator Deprecated since version 0.18: This module will be removed in 0.20. Use sklearn.model_selection.PredefinedSplit instead. Splits the data into training/test set folds according to a predefined scheme. Each sample can be assigned to at most one test set fold, as specified by the user through the test_fold parameter. Read more in the User Guide. Parameters: test

cross_validation.LeavePOut()

Warning DEPRECATED class sklearn.cross_validation.LeavePOut(n, p) [source] Leave-P-Out cross validation iterator Deprecated since version 0.18: This module will be removed in 0.20. Use sklearn.model_selection.LeavePOut instead. Provides train/test indices to split data in train test sets. This results in testing on all distinct samples of size p, while the remaining n - p samples form the training set in each iteration. Note: LeavePOut(n, p) is NOT equivalent to KFold(n, n_folds=n // p)

cross_validation.LeavePLabelOut()

Warning DEPRECATED class sklearn.cross_validation.LeavePLabelOut(labels, p) [source] Leave-P-Label_Out cross-validation iterator Deprecated since version 0.18: This module will be removed in 0.20. Use sklearn.model_selection.LeavePGroupsOut instead. Provides train/test indices to split data according to a third-party provided label. This label information can be used to encode arbitrary domain specific stratifications of the samples as integers. For instance the labels could be the year

cross_validation.LeaveOneOut()

Warning DEPRECATED class sklearn.cross_validation.LeaveOneOut(n) [source] Leave-One-Out cross validation iterator. Deprecated since version 0.18: This module will be removed in 0.20. Use sklearn.model_selection.LeaveOneOut instead. Provides train/test indices to split data in train test sets. Each sample is used once as a test set (singleton) while the remaining samples form the training set. Note: LeaveOneOut(n) is equivalent to KFold(n, n_folds=n) and LeavePOut(n, p=1). Due to the hig

cross_validation.LabelShuffleSplit()

Warning DEPRECATED class sklearn.cross_validation.LabelShuffleSplit(labels, n_iter=5, test_size=0.2, train_size=None, random_state=None) [source] Shuffle-Labels-Out cross-validation iterator Deprecated since version 0.18: This module will be removed in 0.20. Use sklearn.model_selection.GroupShuffleSplit instead. Provides randomized train/test indices to split data according to a third-party provided label. This label information can be used to encode arbitrary domain specific stratifica