diff --git a/0.15/.buildinfo b/0.15/.buildinfo deleted file mode 100644 index cd348e7d780d5..0000000000000 --- a/0.15/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 2d9e1af7a216c9392194ba49f2fd44b7 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/0.15/_downloads/bicluster_newsgroups.py b/0.15/_downloads/bicluster_newsgroups.py deleted file mode 100644 index 45a9f2406e2fb..0000000000000 --- a/0.15/_downloads/bicluster_newsgroups.py +++ /dev/null @@ -1,182 +0,0 @@ -""" -================================================================ -Biclustering documents with the Spectral Co-clustering algorithm -================================================================ - -This example demonstrates the Spectral Co-clustering algorithm on the -twenty newsgroups dataset. The 'comp.os.ms-windows.misc' category is -excluded because it contains many posts containing nothing but data. - -The TF-IDF vectorized posts form a word frequency matrix, which is -then biclustered using Dhillon's Spectral Co-Clustering algorithm. The -resulting document-word biclusters indicate subsets words used more -often in those subsets documents. - -For a few of the best biclusters, its most common document categories -and its ten most important words get printed. The best biclusters are -determined by their normalized cut. The best words are determined by -comparing their sums inside and outside the bicluster. - -For comparison, the documents are also clustered using -MiniBatchKMeans. The document clusters derived from the biclusters -achieve a better V-measure than clusters found by MiniBatchKMeans. - -Output:: - - Vectorizing... - Coclustering... - Done in 9.53s. V-measure: 0.4455 - MiniBatchKMeans... - Done in 12.00s. V-measure: 0.3309 - - Best biclusters: - ---------------- - bicluster 0 : 1951 documents, 4373 words - categories : 23% talk.politics.guns, 19% talk.politics.misc, 14% sci.med - words : gun, guns, geb, banks, firearms, drugs, gordon, clinton, cdt, amendment - - bicluster 1 : 1165 documents, 3304 words - categories : 29% talk.politics.mideast, 26% soc.religion.christian, 25% alt.atheism - words : god, jesus, christians, atheists, kent, sin, morality, belief, resurrection, marriage - - bicluster 2 : 2219 documents, 2830 words - categories : 18% comp.sys.mac.hardware, 16% comp.sys.ibm.pc.hardware, 16% comp.graphics - words : voltage, dsp, board, receiver, circuit, shipping, packages, stereo, compression, package - - bicluster 3 : 1860 documents, 2745 words - categories : 26% rec.motorcycles, 23% rec.autos, 13% misc.forsale - words : bike, car, dod, engine, motorcycle, ride, honda, cars, bmw, bikes - - bicluster 4 : 12 documents, 155 words - categories : 100% rec.sport.hockey - words : scorer, unassisted, reichel, semak, sweeney, kovalenko, ricci, audette, momesso, nedved - -""" -from __future__ import print_function - -print(__doc__) - -from collections import defaultdict -import operator -import re -from time import time - -import numpy as np - -from sklearn.cluster.bicluster import SpectralCoclustering -from sklearn.cluster import MiniBatchKMeans -from sklearn.externals import six -from sklearn.datasets.twenty_newsgroups import fetch_20newsgroups -from sklearn.feature_extraction.text import TfidfVectorizer -from sklearn.metrics.cluster import v_measure_score - - -def number_aware_tokenizer(doc): - """ Tokenizer that maps all numeric tokens to a placeholder. - - For many applications, tokens that begin with a number are not directly - useful, but the fact that such a token exists can be relevant. By applying - this form of dimensionality reduction, some methods may perform better. - """ - token_pattern = re.compile(u'(?u)\\b\\w\\w+\\b') - tokens = token_pattern.findall(doc) - tokens = ["#NUMBER" if token[0] in "0123456789_" else token - for token in tokens] - return tokens - -# exclude 'comp.os.ms-windows.misc' -categories = ['alt.atheism', 'comp.graphics', - 'comp.sys.ibm.pc.hardware', 'comp.sys.mac.hardware', - 'comp.windows.x', 'misc.forsale', 'rec.autos', - 'rec.motorcycles', 'rec.sport.baseball', - 'rec.sport.hockey', 'sci.crypt', 'sci.electronics', - 'sci.med', 'sci.space', 'soc.religion.christian', - 'talk.politics.guns', 'talk.politics.mideast', - 'talk.politics.misc', 'talk.religion.misc'] -newsgroups = fetch_20newsgroups(categories=categories) -y_true = newsgroups.target - -vectorizer = TfidfVectorizer(stop_words='english', min_df=5, - tokenizer=number_aware_tokenizer) -cocluster = SpectralCoclustering(n_clusters=len(categories), - svd_method='arpack', random_state=0) -kmeans = MiniBatchKMeans(n_clusters=len(categories), batch_size=20000, - random_state=0) - -print("Vectorizing...") -X = vectorizer.fit_transform(newsgroups.data) - -print("Coclustering...") -start_time = time() -cocluster.fit(X) -y_cocluster = cocluster.row_labels_ -print("Done in {:.2f}s. V-measure: {:.4f}".format( - time() - start_time, - v_measure_score(y_cocluster, y_true))) - -print("MiniBatchKMeans...") -start_time = time() -y_kmeans = kmeans.fit_predict(X) -print("Done in {:.2f}s. V-measure: {:.4f}".format( - time() - start_time, - v_measure_score(y_kmeans, y_true))) - -feature_names = vectorizer.get_feature_names() -document_names = list(newsgroups.target_names[i] for i in newsgroups.target) - - -def bicluster_ncut(i): - rows, cols = cocluster.get_indices(i) - if not (np.any(rows) and np.any(cols)): - import sys - return sys.float_info.max - row_complement = np.nonzero(np.logical_not(cocluster.rows_[i]))[0] - col_complement = np.nonzero(np.logical_not(cocluster.columns_[i]))[0] - weight = X[rows[:, np.newaxis], cols].sum() - cut = (X[row_complement[:, np.newaxis], cols].sum() + - X[rows[:, np.newaxis], col_complement].sum()) - return cut / weight - - -def most_common(d): - """Items of a defaultdict(int) with the highest values. - - Like Counter.most_common in Python >=2.7. - """ - return sorted(six.iteritems(d), key=operator.itemgetter(1), reverse=True) - - -bicluster_ncuts = list(bicluster_ncut(i) - for i in xrange(len(newsgroups.target_names))) -best_idx = np.argsort(bicluster_ncuts)[:5] - -print() -print("Best biclusters:") -print("----------------") -for idx, cluster in enumerate(best_idx): - n_rows, n_cols = cocluster.get_shape(cluster) - cluster_docs, cluster_words = cocluster.get_indices(cluster) - if not len(cluster_docs) or not len(cluster_words): - continue - - # categories - counter = defaultdict(int) - for i in cluster_docs: - counter[document_names[i]] += 1 - cat_string = ", ".join("{:.0f}% {}".format(float(c) / n_rows * 100, name) - for name, c in most_common(counter)[:3]) - - # words - out_of_cluster_docs = cocluster.row_labels_ != cluster - out_of_cluster_docs = np.where(out_of_cluster_docs)[0] - word_col = X[:, cluster_words] - word_scores = np.array(word_col[cluster_docs, :].sum(axis=0) - - word_col[out_of_cluster_docs, :].sum(axis=0)) - word_scores = word_scores.ravel() - important_words = list(feature_names[cluster_words[i]] - for i in word_scores.argsort()[:-11:-1]) - - print("bicluster {} : {} documents, {} words".format( - idx, n_rows, n_cols)) - print("categories : {}".format(cat_string)) - print("words : {}\n".format(', '.join(important_words))) diff --git a/0.15/_downloads/digits_classification_exercise.py b/0.15/_downloads/digits_classification_exercise.py deleted file mode 100644 index a1f0b84fd1fd2..0000000000000 --- a/0.15/_downloads/digits_classification_exercise.py +++ /dev/null @@ -1,33 +0,0 @@ -""" -================================ -Digits Classification Exercise -================================ - -A tutorial exercise regarding the use of classification techniques on -the Digits dataset. - -This exercise is used in the :ref:`clf_tut` part of the -:ref:`supervised_learning_tut` section of the -:ref:`stat_learn_tut_index`. -""" -print(__doc__) - -from sklearn import datasets, neighbors, linear_model - -digits = datasets.load_digits() -X_digits = digits.data -y_digits = digits.target - -n_samples = len(X_digits) - -X_train = X_digits[:.9 * n_samples] -y_train = y_digits[:.9 * n_samples] -X_test = X_digits[.9 * n_samples:] -y_test = y_digits[.9 * n_samples:] - -knn = neighbors.KNeighborsClassifier() -logistic = linear_model.LogisticRegression() - -print('KNN score: %f' % knn.fit(X_train, y_train).score(X_test, y_test)) -print('LogisticRegression score: %f' - % logistic.fit(X_train, y_train).score(X_test, y_test)) diff --git a/0.15/_downloads/document_classification_20newsgroups.py b/0.15/_downloads/document_classification_20newsgroups.py deleted file mode 100644 index 94b21e1b52a49..0000000000000 --- a/0.15/_downloads/document_classification_20newsgroups.py +++ /dev/null @@ -1,313 +0,0 @@ -""" -====================================================== -Classification of text documents using sparse features -====================================================== - -This is an example showing how scikit-learn can be used to classify documents -by topics using a bag-of-words approach. This example uses a scipy.sparse -matrix to store the features and demonstrates various classifiers that can -efficiently handle sparse matrices. - -The dataset used in this example is the 20 newsgroups dataset. It will be -automatically downloaded, then cached. - -The bar plot indicates the accuracy, training time (normalized) and test time -(normalized) of each classifier. - -""" - -# Author: Peter Prettenhofer -# Olivier Grisel -# Mathieu Blondel -# Lars Buitinck -# License: BSD 3 clause - -from __future__ import print_function - -import logging -import numpy as np -from optparse import OptionParser -import sys -from time import time -import matplotlib.pyplot as plt - -from sklearn.datasets import fetch_20newsgroups -from sklearn.feature_extraction.text import TfidfVectorizer -from sklearn.feature_extraction.text import HashingVectorizer -from sklearn.feature_selection import SelectKBest, chi2 -from sklearn.linear_model import RidgeClassifier -from sklearn.pipeline import Pipeline -from sklearn.svm import LinearSVC -from sklearn.linear_model import SGDClassifier -from sklearn.linear_model import Perceptron -from sklearn.linear_model import PassiveAggressiveClassifier -from sklearn.naive_bayes import BernoulliNB, MultinomialNB -from sklearn.neighbors import KNeighborsClassifier -from sklearn.neighbors import NearestCentroid -from sklearn.ensemble import RandomForestClassifier -from sklearn.utils.extmath import density -from sklearn import metrics - - -# Display progress logs on stdout -logging.basicConfig(level=logging.INFO, - format='%(asctime)s %(levelname)s %(message)s') - - -# parse commandline arguments -op = OptionParser() -op.add_option("--report", - action="store_true", dest="print_report", - help="Print a detailed classification report.") -op.add_option("--chi2_select", - action="store", type="int", dest="select_chi2", - help="Select some number of features using a chi-squared test") -op.add_option("--confusion_matrix", - action="store_true", dest="print_cm", - help="Print the confusion matrix.") -op.add_option("--top10", - action="store_true", dest="print_top10", - help="Print ten most discriminative terms per class" - " for every classifier.") -op.add_option("--all_categories", - action="store_true", dest="all_categories", - help="Whether to use all categories or not.") -op.add_option("--use_hashing", - action="store_true", - help="Use a hashing vectorizer.") -op.add_option("--n_features", - action="store", type=int, default=2 ** 16, - help="n_features when using the hashing vectorizer.") -op.add_option("--filtered", - action="store_true", - help="Remove newsgroup information that is easily overfit: " - "headers, signatures, and quoting.") - -(opts, args) = op.parse_args() -if len(args) > 0: - op.error("this script takes no arguments.") - sys.exit(1) - -print(__doc__) -op.print_help() -print() - - -############################################################################### -# Load some categories from the training set -if opts.all_categories: - categories = None -else: - categories = [ - 'alt.atheism', - 'talk.religion.misc', - 'comp.graphics', - 'sci.space', - ] - -if opts.filtered: - remove = ('headers', 'footers', 'quotes') -else: - remove = () - -print("Loading 20 newsgroups dataset for categories:") -print(categories if categories else "all") - -data_train = fetch_20newsgroups(subset='train', categories=categories, - shuffle=True, random_state=42, - remove=remove) - -data_test = fetch_20newsgroups(subset='test', categories=categories, - shuffle=True, random_state=42, - remove=remove) -print('data loaded') - -categories = data_train.target_names # for case categories == None - - -def size_mb(docs): - return sum(len(s.encode('utf-8')) for s in docs) / 1e6 - -data_train_size_mb = size_mb(data_train.data) -data_test_size_mb = size_mb(data_test.data) - -print("%d documents - %0.3fMB (training set)" % ( - len(data_train.data), data_train_size_mb)) -print("%d documents - %0.3fMB (test set)" % ( - len(data_test.data), data_test_size_mb)) -print("%d categories" % len(categories)) -print() - -# split a training set and a test set -y_train, y_test = data_train.target, data_test.target - -print("Extracting features from the training data using a sparse vectorizer") -t0 = time() -if opts.use_hashing: - vectorizer = HashingVectorizer(stop_words='english', non_negative=True, - n_features=opts.n_features) - X_train = vectorizer.transform(data_train.data) -else: - vectorizer = TfidfVectorizer(sublinear_tf=True, max_df=0.5, - stop_words='english') - X_train = vectorizer.fit_transform(data_train.data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_train_size_mb / duration)) -print("n_samples: %d, n_features: %d" % X_train.shape) -print() - -print("Extracting features from the test data using the same vectorizer") -t0 = time() -X_test = vectorizer.transform(data_test.data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_test_size_mb / duration)) -print("n_samples: %d, n_features: %d" % X_test.shape) -print() - -# mapping from integer feature name to original token string -if opts.use_hashing: - feature_names = None -else: - feature_names = vectorizer.get_feature_names() - -if opts.select_chi2: - print("Extracting %d best features by a chi-squared test" % - opts.select_chi2) - t0 = time() - ch2 = SelectKBest(chi2, k=opts.select_chi2) - X_train = ch2.fit_transform(X_train, y_train) - X_test = ch2.transform(X_test) - if feature_names: - # keep selected feature names - feature_names = [feature_names[i] for i - in ch2.get_support(indices=True)] - print("done in %fs" % (time() - t0)) - print() - -if feature_names: - feature_names = np.asarray(feature_names) - - -def trim(s): - """Trim string to fit on terminal (assuming 80-column display)""" - return s if len(s) <= 80 else s[:77] + "..." - - -############################################################################### -# Benchmark classifiers -def benchmark(clf): - print('_' * 80) - print("Training: ") - print(clf) - t0 = time() - clf.fit(X_train, y_train) - train_time = time() - t0 - print("train time: %0.3fs" % train_time) - - t0 = time() - pred = clf.predict(X_test) - test_time = time() - t0 - print("test time: %0.3fs" % test_time) - - score = metrics.accuracy_score(y_test, pred) - print("accuracy: %0.3f" % score) - - if hasattr(clf, 'coef_'): - print("dimensionality: %d" % clf.coef_.shape[1]) - print("density: %f" % density(clf.coef_)) - - if opts.print_top10 and feature_names is not None: - print("top 10 keywords per class:") - for i, category in enumerate(categories): - top10 = np.argsort(clf.coef_[i])[-10:] - print(trim("%s: %s" - % (category, " ".join(feature_names[top10])))) - print() - - if opts.print_report: - print("classification report:") - print(metrics.classification_report(y_test, pred, - target_names=categories)) - - if opts.print_cm: - print("confusion matrix:") - print(metrics.confusion_matrix(y_test, pred)) - - print() - clf_descr = str(clf).split('(')[0] - return clf_descr, score, train_time, test_time - - -results = [] -for clf, name in ( - (RidgeClassifier(tol=1e-2, solver="lsqr"), "Ridge Classifier"), - (Perceptron(n_iter=50), "Perceptron"), - (PassiveAggressiveClassifier(n_iter=50), "Passive-Aggressive"), - (KNeighborsClassifier(n_neighbors=10), "kNN"), - (RandomForestClassifier(n_estimators=100), "Random forest")): - print('=' * 80) - print(name) - results.append(benchmark(clf)) - -for penalty in ["l2", "l1"]: - print('=' * 80) - print("%s penalty" % penalty.upper()) - # Train Liblinear model - results.append(benchmark(LinearSVC(loss='l2', penalty=penalty, - dual=False, tol=1e-3))) - - # Train SGD model - results.append(benchmark(SGDClassifier(alpha=.0001, n_iter=50, - penalty=penalty))) - -# Train SGD with Elastic Net penalty -print('=' * 80) -print("Elastic-Net penalty") -results.append(benchmark(SGDClassifier(alpha=.0001, n_iter=50, - penalty="elasticnet"))) - -# Train NearestCentroid without threshold -print('=' * 80) -print("NearestCentroid (aka Rocchio classifier)") -results.append(benchmark(NearestCentroid())) - -# Train sparse Naive Bayes classifiers -print('=' * 80) -print("Naive Bayes") -results.append(benchmark(MultinomialNB(alpha=.01))) -results.append(benchmark(BernoulliNB(alpha=.01))) - -print('=' * 80) -print("LinearSVC with L1-based feature selection") -# The smaller C, the stronger the regularization. -# The more regularization, the more sparsity. -results.append(benchmark(Pipeline([ - ('feature_selection', LinearSVC(penalty="l1", dual=False, tol=1e-3)), - ('classification', LinearSVC()) -]))) - -# make some plots - -indices = np.arange(len(results)) - -results = [[x[i] for x in results] for i in range(4)] - -clf_names, score, training_time, test_time = results -training_time = np.array(training_time) / np.max(training_time) -test_time = np.array(test_time) / np.max(test_time) - -plt.figure(figsize=(12, 8)) -plt.title("Score") -plt.barh(indices, score, .2, label="score", color='r') -plt.barh(indices + .3, training_time, .2, label="training time", color='g') -plt.barh(indices + .6, test_time, .2, label="test time", color='b') -plt.yticks(()) -plt.legend(loc='best') -plt.subplots_adjust(left=.25) -plt.subplots_adjust(top=.95) -plt.subplots_adjust(bottom=.05) - -for i, c in zip(indices, clf_names): - plt.text(-.3, i, c) - -plt.show() diff --git a/0.15/_downloads/document_classification_20newsgroups1.py b/0.15/_downloads/document_classification_20newsgroups1.py deleted file mode 100644 index 8ecca4cf53f16..0000000000000 --- a/0.15/_downloads/document_classification_20newsgroups1.py +++ /dev/null @@ -1,315 +0,0 @@ -""" -====================================================== -Classification of text documents using sparse features -====================================================== - -This is an example showing how scikit-learn can be used to classify documents -by topics using a bag-of-words approach. This example uses a scipy.sparse -matrix to store the features and demonstrates various classifiers that can -efficiently handle sparse matrices. - -The dataset used in this example is the 20 newsgroups dataset. It will be -automatically downloaded, then cached. - -The bar plot indicates the accuracy, training time (normalized) and test time -(normalized) of each classifier. - -""" - -# Author: Peter Prettenhofer -# Olivier Grisel -# Mathieu Blondel -# Lars Buitinck -# License: BSD 3 clause - -from __future__ import print_function - -import logging -import numpy as np -from optparse import OptionParser -import sys -from time import time -import matplotlib.pyplot as plt - -from sklearn.datasets import fetch_20newsgroups -from sklearn.feature_extraction.text import TfidfVectorizer -from sklearn.feature_extraction.text import HashingVectorizer -from sklearn.feature_selection import SelectKBest, chi2 -from sklearn.linear_model import RidgeClassifier -from sklearn.svm import LinearSVC -from sklearn.linear_model import SGDClassifier -from sklearn.linear_model import Perceptron -from sklearn.linear_model import PassiveAggressiveClassifier -from sklearn.naive_bayes import BernoulliNB, MultinomialNB -from sklearn.neighbors import KNeighborsClassifier -from sklearn.neighbors import NearestCentroid -from sklearn.utils.extmath import density -from sklearn import metrics - - -# Display progress logs on stdout -logging.basicConfig(level=logging.INFO, - format='%(asctime)s %(levelname)s %(message)s') - - -# parse commandline arguments -op = OptionParser() -op.add_option("--report", - action="store_true", dest="print_report", - help="Print a detailed classification report.") -op.add_option("--chi2_select", - action="store", type="int", dest="select_chi2", - help="Select some number of features using a chi-squared test") -op.add_option("--confusion_matrix", - action="store_true", dest="print_cm", - help="Print the confusion matrix.") -op.add_option("--top10", - action="store_true", dest="print_top10", - help="Print ten most discriminative terms per class" - " for every classifier.") -op.add_option("--all_categories", - action="store_true", dest="all_categories", - help="Whether to use all categories or not.") -op.add_option("--use_hashing", - action="store_true", - help="Use a hashing vectorizer.") -op.add_option("--n_features", - action="store", type=int, default=2 ** 16, - help="n_features when using the hashing vectorizer.") -op.add_option("--filtered", - action="store_true", - help="Remove newsgroup information that is easily overfit: " - "headers, signatures, and quoting.") - -(opts, args) = op.parse_args() -if len(args) > 0: - op.error("this script takes no arguments.") - sys.exit(1) - -print(__doc__) -op.print_help() -print() - - -############################################################################### -# Load some categories from the training set -if opts.all_categories: - categories = None -else: - categories = [ - 'alt.atheism', - 'talk.religion.misc', - 'comp.graphics', - 'sci.space', - ] - -if opts.filtered: - remove = ('headers', 'footers', 'quotes') -else: - remove = () - -print("Loading 20 newsgroups dataset for categories:") -print(categories if categories else "all") - -data_train = fetch_20newsgroups(subset='train', categories=categories, - shuffle=True, random_state=42, - remove=remove) - -data_test = fetch_20newsgroups(subset='test', categories=categories, - shuffle=True, random_state=42, - remove=remove) -print('data loaded') - -categories = data_train.target_names # for case categories == None - - -def size_mb(docs): - return sum(len(s.encode('utf-8')) for s in docs) / 1e6 - -data_train_size_mb = size_mb(data_train.data) -data_test_size_mb = size_mb(data_test.data) - -print("%d documents - %0.3fMB (training set)" % ( - len(data_train.data), data_train_size_mb)) -print("%d documents - %0.3fMB (test set)" % ( - len(data_test.data), data_test_size_mb)) -print("%d categories" % len(categories)) -print() - -# split a training set and a test set -y_train, y_test = data_train.target, data_test.target - -print("Extracting features from the training dataset using a sparse vectorizer") -t0 = time() -if opts.use_hashing: - vectorizer = HashingVectorizer(stop_words='english', non_negative=True, - n_features=opts.n_features) - X_train = vectorizer.transform(data_train.data) -else: - vectorizer = TfidfVectorizer(sublinear_tf=True, max_df=0.5, - stop_words='english') - X_train = vectorizer.fit_transform(data_train.data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_train_size_mb / duration)) -print("n_samples: %d, n_features: %d" % X_train.shape) -print() - -print("Extracting features from the test dataset using the same vectorizer") -t0 = time() -X_test = vectorizer.transform(data_test.data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_test_size_mb / duration)) -print("n_samples: %d, n_features: %d" % X_test.shape) -print() - -if opts.select_chi2: - print("Extracting %d best features by a chi-squared test" % - opts.select_chi2) - t0 = time() - ch2 = SelectKBest(chi2, k=opts.select_chi2) - X_train = ch2.fit_transform(X_train, y_train) - X_test = ch2.transform(X_test) - print("done in %fs" % (time() - t0)) - print() - - -def trim(s): - """Trim string to fit on terminal (assuming 80-column display)""" - return s if len(s) <= 80 else s[:77] + "..." - - -# mapping from integer feature name to original token string -if opts.use_hashing: - feature_names = None -else: - feature_names = np.asarray(vectorizer.get_feature_names()) - - -############################################################################### -# Benchmark classifiers -def benchmark(clf): - print('_' * 80) - print("Training: ") - print(clf) - t0 = time() - clf.fit(X_train, y_train) - train_time = time() - t0 - print("train time: %0.3fs" % train_time) - - t0 = time() - pred = clf.predict(X_test) - test_time = time() - t0 - print("test time: %0.3fs" % test_time) - - score = metrics.f1_score(y_test, pred) - print("f1-score: %0.3f" % score) - - if hasattr(clf, 'coef_'): - print("dimensionality: %d" % clf.coef_.shape[1]) - print("density: %f" % density(clf.coef_)) - - if opts.print_top10 and feature_names is not None: - print("top 10 keywords per class:") - for i, category in enumerate(categories): - top10 = np.argsort(clf.coef_[i])[-10:] - print(trim("%s: %s" - % (category, " ".join(feature_names[top10])))) - print() - - if opts.print_report: - print("classification report:") - print(metrics.classification_report(y_test, pred, - target_names=categories)) - - if opts.print_cm: - print("confusion matrix:") - print(metrics.confusion_matrix(y_test, pred)) - - print() - clf_descr = str(clf).split('(')[0] - return clf_descr, score, train_time, test_time - - -results = [] -for clf, name in ( - (RidgeClassifier(tol=1e-2, solver="lsqr"), "Ridge Classifier"), - (Perceptron(n_iter=50), "Perceptron"), - (PassiveAggressiveClassifier(n_iter=50), "Passive-Aggressive"), - (KNeighborsClassifier(n_neighbors=10), "kNN")): - print('=' * 80) - print(name) - results.append(benchmark(clf)) - -for penalty in ["l2", "l1"]: - print('=' * 80) - print("%s penalty" % penalty.upper()) - # Train Liblinear model - results.append(benchmark(LinearSVC(loss='l2', penalty=penalty, - dual=False, tol=1e-3))) - - # Train SGD model - results.append(benchmark(SGDClassifier(alpha=.0001, n_iter=50, - penalty=penalty))) - -# Train SGD with Elastic Net penalty -print('=' * 80) -print("Elastic-Net penalty") -results.append(benchmark(SGDClassifier(alpha=.0001, n_iter=50, - penalty="elasticnet"))) - -# Train NearestCentroid without threshold -print('=' * 80) -print("NearestCentroid (aka Rocchio classifier)") -results.append(benchmark(NearestCentroid())) - -# Train sparse Naive Bayes classifiers -print('=' * 80) -print("Naive Bayes") -results.append(benchmark(MultinomialNB(alpha=.01))) -results.append(benchmark(BernoulliNB(alpha=.01))) - - -class L1LinearSVC(LinearSVC): - - def fit(self, X, y): - # The smaller C, the stronger the regularization. - # The more regularization, the more sparsity. - self.transformer_ = LinearSVC(penalty="l1", - dual=False, tol=1e-3) - X = self.transformer_.fit_transform(X, y) - return LinearSVC.fit(self, X, y) - - def predict(self, X): - X = self.transformer_.transform(X) - return LinearSVC.predict(self, X) - -print('=' * 80) -print("LinearSVC with L1-based feature selection") -results.append(benchmark(L1LinearSVC())) - - -# make some plots - -indices = np.arange(len(results)) - -results = [[x[i] for x in results] for i in range(4)] - -clf_names, score, training_time, test_time = results -training_time = np.array(training_time) / np.max(training_time) -test_time = np.array(test_time) / np.max(test_time) - -plt.figure(figsize=(12, 8)) -plt.title("Score") -plt.barh(indices, score, .2, label="score", color='r') -plt.barh(indices + .3, training_time, .2, label="training time", color='g') -plt.barh(indices + .6, test_time, .2, label="test time", color='b') -plt.yticks(()) -plt.legend(loc='best') -plt.subplots_adjust(left=.25) -plt.subplots_adjust(top=.95) -plt.subplots_adjust(bottom=.05) - -for i, c in zip(indices, clf_names): - plt.text(-.3, i, c) - -plt.show() diff --git a/0.15/_downloads/document_clustering.py b/0.15/_downloads/document_clustering.py deleted file mode 100644 index 51ae37b6d5913..0000000000000 --- a/0.15/_downloads/document_clustering.py +++ /dev/null @@ -1,210 +0,0 @@ -""" -======================================= -Clustering text documents using k-means -======================================= - -This is an example showing how the scikit-learn can be used to cluster -documents by topics using a bag-of-words approach. This example uses -a scipy.sparse matrix to store the features instead of standard numpy arrays. - -Two feature extraction methods can be used in this example: - - - TfidfVectorizer uses a in-memory vocabulary (a python dict) to map the most - frequent words to features indices and hence compute a word occurrence - frequency (sparse) matrix. The word frequencies are then reweighted using - the Inverse Document Frequency (IDF) vector collected feature-wise over - the corpus. - - - HashingVectorizer hashes word occurrences to a fixed dimensional space, - possibly with collisions. The word count vectors are then normalized to - each have l2-norm equal to one (projected to the euclidean unit-ball) which - seems to be important for k-means to work in high dimensional space. - - HashingVectorizer does not provide IDF weighting as this is a stateless - model (the fit method does nothing). When IDF weighting is needed it can - be added by pipelining its output to a TfidfTransformer instance. - -Two algorithms are demoed: ordinary k-means and its more scalable cousin -minibatch k-means. - -It can be noted that k-means (and minibatch k-means) are very sensitive to -feature scaling and that in this case the IDF weighting helps improve the -quality of the clustering by quite a lot as measured against the "ground truth" -provided by the class label assignments of the 20 newsgroups dataset. - -This improvement is not visible in the Silhouette Coefficient which is small -for both as this measure seem to suffer from the phenomenon called -"Concentration of Measure" or "Curse of Dimensionality" for high dimensional -datasets such as text data. Other measures such as V-measure and Adjusted Rand -Index are information theoretic based evaluation scores: as they are only based -on cluster assignments rather than distances, hence not affected by the curse -of dimensionality. - -Note: as k-means is optimizing a non-convex objective function, it will likely -end up in a local optimum. Several runs with independent random init might be -necessary to get a good convergence. - -""" - -# Author: Peter Prettenhofer -# Lars Buitinck -# License: BSD 3 clause - -from __future__ import print_function - -from sklearn.datasets import fetch_20newsgroups -from sklearn.decomposition import TruncatedSVD -from sklearn.feature_extraction.text import TfidfVectorizer -from sklearn.feature_extraction.text import HashingVectorizer -from sklearn.feature_extraction.text import TfidfTransformer -from sklearn.pipeline import make_pipeline -from sklearn.preprocessing import Normalizer -from sklearn import metrics - -from sklearn.cluster import KMeans, MiniBatchKMeans - -import logging -from optparse import OptionParser -import sys -from time import time - -import numpy as np - - -# Display progress logs on stdout -logging.basicConfig(level=logging.INFO, - format='%(asctime)s %(levelname)s %(message)s') - -# parse commandline arguments -op = OptionParser() -op.add_option("--lsa", - dest="n_components", type="int", - help="Preprocess documents with latent semantic analysis.") -op.add_option("--no-minibatch", - action="store_false", dest="minibatch", default=True, - help="Use ordinary k-means algorithm (in batch mode).") -op.add_option("--no-idf", - action="store_false", dest="use_idf", default=True, - help="Disable Inverse Document Frequency feature weighting.") -op.add_option("--use-hashing", - action="store_true", default=False, - help="Use a hashing feature vectorizer") -op.add_option("--n-features", type=int, default=10000, - help="Maximum number of features (dimensions)" - " to extract from text.") -op.add_option("--verbose", - action="store_true", dest="verbose", default=False, - help="Print progress reports inside k-means algorithm.") - -print(__doc__) -op.print_help() - -(opts, args) = op.parse_args() -if len(args) > 0: - op.error("this script takes no arguments.") - sys.exit(1) - - -############################################################################### -# Load some categories from the training set -categories = [ - 'alt.atheism', - 'talk.religion.misc', - 'comp.graphics', - 'sci.space', -] -# Uncomment the following to do the analysis on all the categories -#categories = None - -print("Loading 20 newsgroups dataset for categories:") -print(categories) - -dataset = fetch_20newsgroups(subset='all', categories=categories, - shuffle=True, random_state=42) - -print("%d documents" % len(dataset.data)) -print("%d categories" % len(dataset.target_names)) -print() - -labels = dataset.target -true_k = np.unique(labels).shape[0] - -print("Extracting features from the training dataset using a sparse vectorizer") -t0 = time() -if opts.use_hashing: - if opts.use_idf: - # Perform an IDF normalization on the output of HashingVectorizer - hasher = HashingVectorizer(n_features=opts.n_features, - stop_words='english', non_negative=True, - norm=None, binary=False) - vectorizer = make_pipeline(hasher, TfidfTransformer()) - else: - vectorizer = HashingVectorizer(n_features=opts.n_features, - stop_words='english', - non_negative=False, norm='l2', - binary=False) -else: - vectorizer = TfidfVectorizer(max_df=0.5, max_features=opts.n_features, - min_df=2, stop_words='english', - use_idf=opts.use_idf) -X = vectorizer.fit_transform(dataset.data) - -print("done in %fs" % (time() - t0)) -print("n_samples: %d, n_features: %d" % X.shape) -print() - -if opts.n_components: - print("Performing dimensionality reduction using LSA") - t0 = time() - # Vectorizer results are normalized, which makes KMeans behave as - # spherical k-means for better results. Since LSA/SVD results are - # not normalized, we have to redo the normalization. - svd = TruncatedSVD(opts.n_components) - lsa = make_pipeline(svd, Normalizer(copy=False)) - - X = lsa.fit_transform(X) - - print("done in %fs" % (time() - t0)) - - explained_variance = svd.explained_variance_ratio_.sum() - print("Explained variance of the SVD step: {}%".format( - int(explained_variance * 100))) - - print() - - -############################################################################### -# Do the actual clustering - -if opts.minibatch: - km = MiniBatchKMeans(n_clusters=true_k, init='k-means++', n_init=1, - init_size=1000, batch_size=1000, verbose=opts.verbose) -else: - km = KMeans(n_clusters=true_k, init='k-means++', max_iter=100, n_init=1, - verbose=opts.verbose) - -print("Clustering sparse data with %s" % km) -t0 = time() -km.fit(X) -print("done in %0.3fs" % (time() - t0)) -print() - -print("Homogeneity: %0.3f" % metrics.homogeneity_score(labels, km.labels_)) -print("Completeness: %0.3f" % metrics.completeness_score(labels, km.labels_)) -print("V-measure: %0.3f" % metrics.v_measure_score(labels, km.labels_)) -print("Adjusted Rand-Index: %.3f" - % metrics.adjusted_rand_score(labels, km.labels_)) -print("Silhouette Coefficient: %0.3f" - % metrics.silhouette_score(X, km.labels_, sample_size=1000)) - -print() - -if not (opts.n_components or opts.use_hashing): - print("Top terms per cluster:") - order_centroids = km.cluster_centers_.argsort()[:, ::-1] - terms = vectorizer.get_feature_names() - for i in range(true_k): - print("Cluster %d:" % i, end='') - for ind in order_centroids[i, :10]: - print(' %s' % terms[ind], end='') - print() diff --git a/0.15/_downloads/document_clustering1.py b/0.15/_downloads/document_clustering1.py deleted file mode 100644 index a00f0442ec28b..0000000000000 --- a/0.15/_downloads/document_clustering1.py +++ /dev/null @@ -1,210 +0,0 @@ -""" -======================================= -Clustering text documents using k-means -======================================= - -This is an example showing how the scikit-learn can be used to cluster -documents by topics using a bag-of-words approach. This example uses -a scipy.sparse matrix to store the features instead of standard numpy arrays. - -Two feature extraction methods can be used in this example: - - - TfidfVectorizer uses a in-memory vocabulary (a python dict) to map the most - frequent words to features indices and hence compute a word occurrence - frequency (sparse) matrix. The word frequencies are then reweighted using - the Inverse Document Frequency (IDF) vector collected feature-wise over - the corpus. - - - HashingVectorizer hashes word occurrences to a fixed dimensional space, - possibly with collisions. The word count vectors are then normalized to - each have l2-norm equal to one (projected to the euclidean unit-ball) which - seems to be important for k-means to work in high dimensional space. - - HashingVectorizer does not provide IDF weighting as this is a stateless - model (the fit method does nothing). When IDF weighting is needed it can - be added by pipelining its output to a TfidfTransformer instance. - -Two algorithms are demoed: ordinary k-means and its more scalable cousin -minibatch k-means. - -It can be noted that k-means (and minibatch k-means) are very sensitive to -feature scaling and that in this case the IDF weighting helps improve the -quality of the clustering by quite a lot as measured against the "ground truth" -provided by the class label assignments of the 20 newsgroups dataset. - -This improvement is not visible in the Silhouette Coefficient which is small -for both as this measure seem to suffer from the phenomenon called -"Concentration of Measure" or "Curse of Dimensionality" for high dimensional -datasets such as text data. Other measures such as V-measure and Adjusted Rand -Index are information theoretic based evaluation scores: as they are only based -on cluster assignments rather than distances, hence not affected by the curse -of dimensionality. - -Note: as k-means is optimizing a non-convex objective function, it will likely -end up in a local optimum. Several runs with independent random init might be -necessary to get a good convergence. - -""" - -# Author: Peter Prettenhofer -# Lars Buitinck -# License: BSD 3 clause - -from __future__ import print_function - -from sklearn.datasets import fetch_20newsgroups -from sklearn.decomposition import TruncatedSVD -from sklearn.feature_extraction.text import TfidfVectorizer -from sklearn.feature_extraction.text import HashingVectorizer -from sklearn.feature_extraction.text import TfidfTransformer -from sklearn.pipeline import make_pipeline -from sklearn.preprocessing import Normalizer -from sklearn import metrics - -from sklearn.cluster import KMeans, MiniBatchKMeans - -import logging -from optparse import OptionParser -import sys -from time import time - -import numpy as np - - -# Display progress logs on stdout -logging.basicConfig(level=logging.INFO, - format='%(asctime)s %(levelname)s %(message)s') - -# parse commandline arguments -op = OptionParser() -op.add_option("--lsa", - dest="n_components", type="int", - help="Preprocess documents with latent semantic analysis.") -op.add_option("--no-minibatch", - action="store_false", dest="minibatch", default=True, - help="Use ordinary k-means algorithm (in batch mode).") -op.add_option("--no-idf", - action="store_false", dest="use_idf", default=True, - help="Disable Inverse Document Frequency feature weighting.") -op.add_option("--use-hashing", - action="store_true", default=False, - help="Use a hashing feature vectorizer") -op.add_option("--n-features", type=int, default=10000, - help="Maximum number of features (dimensions)" - " to extract from text.") -op.add_option("--verbose", - action="store_true", dest="verbose", default=False, - help="Print progress reports inside k-means algorithm.") - -print(__doc__) -op.print_help() - -(opts, args) = op.parse_args() -if len(args) > 0: - op.error("this script takes no arguments.") - sys.exit(1) - - -############################################################################### -# Load some categories from the training set -categories = [ - 'alt.atheism', - 'talk.religion.misc', - 'comp.graphics', - 'sci.space', -] -# Uncomment the following to do the analysis on all the categories -#categories = None - -print("Loading 20 newsgroups dataset for categories:") -print(categories) - -dataset = fetch_20newsgroups(subset='all', categories=categories, - shuffle=True, random_state=42) - -print("%d documents" % len(dataset.data)) -print("%d categories" % len(dataset.target_names)) -print() - -labels = dataset.target -true_k = np.unique(labels).shape[0] - -print("Extracting features from the training dataset using a sparse vectorizer") -t0 = time() -if opts.use_hashing: - if opts.use_idf: - # Perform an IDF normalization on the output of HashingVectorizer - hasher = HashingVectorizer(n_features=opts.n_features, - stop_words='english', non_negative=True, - norm=None, binary=False) - vectorizer = make_pipeline(hasher, TfidfTransformer()) - else: - vectorizer = HashingVectorizer(n_features=opts.n_features, - stop_words='english', - non_negative=False, norm='l2', - binary=False) -else: - vectorizer = TfidfVectorizer(max_df=0.5, max_features=opts.n_features, - min_df=2, stop_words='english', - use_idf=opts.use_idf) -X = vectorizer.fit_transform(dataset.data) - -print("done in %fs" % (time() - t0)) -print("n_samples: %d, n_features: %d" % X.shape) -print() - -if opts.n_components: - print("Performing dimensionality reduction using LSA") - t0 = time() - # Vectorizer results are normalized, which makes KMeans behave as - # spherical k-means for better results. Since LSA/SVD results are - # not normalized, we have to redo the normalization. - svd = TruncatedSVD(opts.n_components) - lsa = make_pipeline(svd, Normalizer(copy=False)) - - X = lsa.fit_transform(X) - - print("done in %fs" % (time() - t0)) - - explained_variance = svd.explained_variance_ratio_.sum() - print("Explained variance of the SVD step: {}%".format( - int(explained_variance * 100))) - - print() - - -############################################################################### -# Do the actual clustering - -if opts.minibatch: - km = MiniBatchKMeans(n_clusters=true_k, init='k-means++', n_init=1, - init_size=1000, batch_size=1000, verbose=opts.verbose) -else: - km = KMeans(n_clusters=true_k, init='k-means++', max_iter=100, n_init=1, - verbose=opts.verbose) - -print("Clustering sparse data with %s" % km) -t0 = time() -km.fit(X) -print("done in %0.3fs" % (time() - t0)) -print() - -print("Homogeneity: %0.3f" % metrics.homogeneity_score(labels, km.labels_)) -print("Completeness: %0.3f" % metrics.completeness_score(labels, km.labels_)) -print("V-measure: %0.3f" % metrics.v_measure_score(labels, km.labels_)) -print("Adjusted Rand-Index: %.3f" - % metrics.adjusted_rand_score(labels, km.labels_)) -print("Silhouette Coefficient: %0.3f" - % metrics.silhouette_score(X, labels, sample_size=1000)) - -print() - -if not (opts.n_components or opts.use_hashing): - print("Top terms per cluster:") - order_centroids = km.cluster_centers_.argsort()[:, ::-1] - terms = vectorizer.get_feature_names() - for i in range(true_k): - print("Cluster %d:" % i, end='') - for ind in order_centroids[i, :10]: - print(' %s' % terms[ind], end='') - print() diff --git a/0.15/_downloads/face_recognition.py b/0.15/_downloads/face_recognition.py deleted file mode 100644 index c261b979f9017..0000000000000 --- a/0.15/_downloads/face_recognition.py +++ /dev/null @@ -1,159 +0,0 @@ -""" -=================================================== -Faces recognition example using eigenfaces and SVMs -=================================================== - -The dataset used in this example is a preprocessed excerpt of the -"Labeled Faces in the Wild", aka LFW_: - - http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (233MB) - -.. _LFW: http://vis-www.cs.umass.edu/lfw/ - -Expected results for the top 5 most represented people in the dataset:: - - precision recall f1-score support - - Gerhard_Schroeder 0.91 0.75 0.82 28 - Donald_Rumsfeld 0.84 0.82 0.83 33 - Tony_Blair 0.65 0.82 0.73 34 - Colin_Powell 0.78 0.88 0.83 58 - George_W_Bush 0.93 0.86 0.90 129 - - avg / total 0.86 0.84 0.85 282 - - - -""" -from __future__ import print_function - -from time import time -import logging -import matplotlib.pyplot as plt - -from sklearn.cross_validation import train_test_split -from sklearn.datasets import fetch_lfw_people -from sklearn.grid_search import GridSearchCV -from sklearn.metrics import classification_report -from sklearn.metrics import confusion_matrix -from sklearn.decomposition import RandomizedPCA -from sklearn.svm import SVC - - -print(__doc__) - -# Display progress logs on stdout -logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s') - - -############################################################################### -# Download the data, if not already on disk and load it as numpy arrays - -lfw_people = fetch_lfw_people(min_faces_per_person=70, resize=0.4) - -# introspect the images arrays to find the shapes (for plotting) -n_samples, h, w = lfw_people.images.shape - -# for machine learning we use the 2 data directly (as relative pixel -# positions info is ignored by this model) -X = lfw_people.data -n_features = X.shape[1] - -# the label to predict is the id of the person -y = lfw_people.target -target_names = lfw_people.target_names -n_classes = target_names.shape[0] - -print("Total dataset size:") -print("n_samples: %d" % n_samples) -print("n_features: %d" % n_features) -print("n_classes: %d" % n_classes) - - -############################################################################### -# Split into a training set and a test set using a stratified k fold - -# split into a training and testing set -X_train, X_test, y_train, y_test = train_test_split( - X, y, test_size=0.25) - - -############################################################################### -# Compute a PCA (eigenfaces) on the face dataset (treated as unlabeled -# dataset): unsupervised feature extraction / dimensionality reduction -n_components = 150 - -print("Extracting the top %d eigenfaces from %d faces" - % (n_components, X_train.shape[0])) -t0 = time() -pca = RandomizedPCA(n_components=n_components, whiten=True).fit(X_train) -print("done in %0.3fs" % (time() - t0)) - -eigenfaces = pca.components_.reshape((n_components, h, w)) - -print("Projecting the input data on the eigenfaces orthonormal basis") -t0 = time() -X_train_pca = pca.transform(X_train) -X_test_pca = pca.transform(X_test) -print("done in %0.3fs" % (time() - t0)) - - -############################################################################### -# Train a SVM classification model - -print("Fitting the classifier to the training set") -t0 = time() -param_grid = {'C': [1e3, 5e3, 1e4, 5e4, 1e5], - 'gamma': [0.0001, 0.0005, 0.001, 0.005, 0.01, 0.1], } -clf = GridSearchCV(SVC(kernel='rbf', class_weight='auto'), param_grid) -clf = clf.fit(X_train_pca, y_train) -print("done in %0.3fs" % (time() - t0)) -print("Best estimator found by grid search:") -print(clf.best_estimator_) - - -############################################################################### -# Quantitative evaluation of the model quality on the test set - -print("Predicting people's names on the test set") -t0 = time() -y_pred = clf.predict(X_test_pca) -print("done in %0.3fs" % (time() - t0)) - -print(classification_report(y_test, y_pred, target_names=target_names)) -print(confusion_matrix(y_test, y_pred, labels=range(n_classes))) - - -############################################################################### -# Qualitative evaluation of the predictions using matplotlib - -def plot_gallery(images, titles, h, w, n_row=3, n_col=4): - """Helper function to plot a gallery of portraits""" - plt.figure(figsize=(1.8 * n_col, 2.4 * n_row)) - plt.subplots_adjust(bottom=0, left=.01, right=.99, top=.90, hspace=.35) - for i in range(n_row * n_col): - plt.subplot(n_row, n_col, i + 1) - plt.imshow(images[i].reshape((h, w)), cmap=plt.cm.gray) - plt.title(titles[i], size=12) - plt.xticks(()) - plt.yticks(()) - - -# plot the result of the prediction on a portion of the test set - -def title(y_pred, y_test, target_names, i): - pred_name = target_names[y_pred[i]].rsplit(' ', 1)[-1] - true_name = target_names[y_test[i]].rsplit(' ', 1)[-1] - return 'predicted: %s\ntrue: %s' % (pred_name, true_name) - -prediction_titles = [title(y_pred, y_test, target_names, i) - for i in range(y_pred.shape[0])] - -plot_gallery(X_test, prediction_titles, h, w) - -# plot the gallery of the most significative eigenfaces - -eigenface_titles = ["eigenface %d" % i for i in range(eigenfaces.shape[0])] -plot_gallery(eigenfaces, eigenface_titles, h, w) - -plt.show() diff --git a/0.15/_downloads/feature_selection_pipeline.py b/0.15/_downloads/feature_selection_pipeline.py deleted file mode 100644 index 59edd941faa3d..0000000000000 --- a/0.15/_downloads/feature_selection_pipeline.py +++ /dev/null @@ -1,29 +0,0 @@ -""" -================== -Pipeline Anova SVM -================== - -Simple usage of Pipeline that runs successively a univariate -feature selection with anova and then a C-SVM of the selected features. -""" -print(__doc__) - -from sklearn import svm -from sklearn.datasets import samples_generator -from sklearn.feature_selection import SelectKBest, f_regression -from sklearn.pipeline import make_pipeline - -# import some data to play with -X, y = samples_generator.make_classification( - n_features=20, n_informative=3, n_redundant=0, n_classes=4, - n_clusters_per_class=2) - -# ANOVA SVM-C -# 1) anova filter, take 3 best ranked features -anova_filter = SelectKBest(f_regression, k=3) -# 2) svm -clf = svm.SVC(kernel='linear') - -anova_svm = make_pipeline(anova_filter, clf) -anova_svm.fit(X, y) -anova_svm.predict(X) diff --git a/0.15/_downloads/feature_selection_pipeline1.py b/0.15/_downloads/feature_selection_pipeline1.py deleted file mode 100644 index 59edd941faa3d..0000000000000 --- a/0.15/_downloads/feature_selection_pipeline1.py +++ /dev/null @@ -1,29 +0,0 @@ -""" -================== -Pipeline Anova SVM -================== - -Simple usage of Pipeline that runs successively a univariate -feature selection with anova and then a C-SVM of the selected features. -""" -print(__doc__) - -from sklearn import svm -from sklearn.datasets import samples_generator -from sklearn.feature_selection import SelectKBest, f_regression -from sklearn.pipeline import make_pipeline - -# import some data to play with -X, y = samples_generator.make_classification( - n_features=20, n_informative=3, n_redundant=0, n_classes=4, - n_clusters_per_class=2) - -# ANOVA SVM-C -# 1) anova filter, take 3 best ranked features -anova_filter = SelectKBest(f_regression, k=3) -# 2) svm -clf = svm.SVC(kernel='linear') - -anova_svm = make_pipeline(anova_filter, clf) -anova_svm.fit(X, y) -anova_svm.predict(X) diff --git a/0.15/_downloads/feature_stacker.py b/0.15/_downloads/feature_stacker.py deleted file mode 100644 index 0139b629d2c1b..0000000000000 --- a/0.15/_downloads/feature_stacker.py +++ /dev/null @@ -1,60 +0,0 @@ -""" -================================================= -Concatenating multiple feature extraction methods -================================================= - -In many real-world examples, there are many ways to extract features from a -dataset. Often it is beneficial to combine several methods to obtain good -performance. This example shows how to use ``FeatureUnion`` to combine -features obtained by PCA and univariate selection. - -Combining features using this transformer has the benefit that it allows -cross validation and grid searches over the whole process. - -The combination used in this example is not particularly helpful on this -dataset and is only used to illustrate the usage of FeatureUnion. -""" - -# Author: Andreas Mueller -# -# License: BSD 3 clause - -from sklearn.pipeline import Pipeline, FeatureUnion -from sklearn.grid_search import GridSearchCV -from sklearn.svm import SVC -from sklearn.datasets import load_iris -from sklearn.decomposition import PCA -from sklearn.feature_selection import SelectKBest - -iris = load_iris() - -X, y = iris.data, iris.target - -# This dataset is way to high-dimensional. Better do PCA: -pca = PCA(n_components=2) - -# Maybe some original features where good, too? -selection = SelectKBest(k=1) - -# Build estimator from PCA and Univariate selection: - -combined_features = FeatureUnion([("pca", pca), ("univ_select", selection)]) - -# Use combined features to transform dataset: -X_features = combined_features.fit(X, y).transform(X) - -# Classify: -svm = SVC(kernel="linear") -svm.fit(X_features, y) - -# Do grid search over k, n_components and C: - -pipeline = Pipeline([("features", combined_features), ("svm", svm)]) - -param_grid = dict(features__pca__n_components=[1, 2, 3], - features__univ_select__k=[1, 2], - svm__C=[0.1, 1, 10]) - -grid_search = GridSearchCV(pipeline, param_grid=param_grid, verbose=10) -grid_search.fit(X, y) -print(grid_search.best_estimator_) diff --git a/0.15/_downloads/gp_diabetes_dataset.py b/0.15/_downloads/gp_diabetes_dataset.py deleted file mode 100644 index e851623a1122c..0000000000000 --- a/0.15/_downloads/gp_diabetes_dataset.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -======================================================================== -Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset -======================================================================== - -This example consists in fitting a Gaussian Process model onto the diabetes -dataset. - -The correlation parameters are determined by means of maximum likelihood -estimation (MLE). An anisotropic squared exponential correlation model with a -constant regression model are assumed. We also used a nugget = 1e-2 in order to -account for the (strong) noise in the targets. - -We compute then compute a cross-validation estimate of the coefficient of -determination (R2) without reperforming MLE, using the set of correlation -parameters found on the whole dataset. -""" -print(__doc__) - -# Author: Vincent Dubourg -# Licence: BSD 3 clause - -from sklearn import datasets -from sklearn.gaussian_process import GaussianProcess -from sklearn.cross_validation import cross_val_score, KFold - -# Load the dataset from scikit's data sets -diabetes = datasets.load_diabetes() -X, y = diabetes.data, diabetes.target - -# Instanciate a GP model -gp = GaussianProcess(regr='constant', corr='absolute_exponential', - theta0=[1e-4] * 10, thetaL=[1e-12] * 10, - thetaU=[1e-2] * 10, nugget=1e-2, optimizer='Welch') - -# Fit the GP model to the data performing maximum likelihood estimation -gp.fit(X, y) - -# Deactivate maximum likelihood estimation for the cross-validation loop -gp.theta0 = gp.theta_ # Given correlation parameter = MLE -gp.thetaL, gp.thetaU = None, None # None bounds deactivate MLE - -# Perform a cross-validation estimate of the coefficient of determination using -# the cross_validation module using all CPUs available on the machine -K = 20 # folds -R2 = cross_val_score(gp, X, y=y, cv=KFold(y.size, K), n_jobs=1).mean() -print("The %d-Folds estimate of the coefficient of determination is R2 = %s" - % (K, R2)) diff --git a/0.15/_downloads/grid_search_digits.py b/0.15/_downloads/grid_search_digits.py deleted file mode 100644 index c8aec1bab8c0f..0000000000000 --- a/0.15/_downloads/grid_search_digits.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -============================================================ -Parameter estimation using grid search with cross-validation -============================================================ - -This examples shows how a classifier is optimized by cross-validation, -which is done using the :class:`sklearn.grid_search.GridSearchCV` object -on a development set that comprises only half of the available labeled data. - -The performance of the selected hyper-parameters and trained model is -then measured on a dedicated evaluation set that was not used during -the model selection step. - -More details on tools available for model selection can be found in the -sections on :ref:`cross_validation` and :ref:`grid_search`. - -""" - -from __future__ import print_function - -from sklearn import datasets -from sklearn.cross_validation import train_test_split -from sklearn.grid_search import GridSearchCV -from sklearn.metrics import classification_report -from sklearn.svm import SVC - -print(__doc__) - -# Loading the Digits dataset -digits = datasets.load_digits() - -# To apply an classifier on this data, we need to flatten the image, to -# turn the data in a (samples, feature) matrix: -n_samples = len(digits.images) -X = digits.images.reshape((n_samples, -1)) -y = digits.target - -# Split the dataset in two equal parts -X_train, X_test, y_train, y_test = train_test_split( - X, y, test_size=0.5, random_state=0) - -# Set the parameters by cross-validation -tuned_parameters = [{'kernel': ['rbf'], 'gamma': [1e-3, 1e-4], - 'C': [1, 10, 100, 1000]}, - {'kernel': ['linear'], 'C': [1, 10, 100, 1000]}] - -scores = ['precision', 'recall'] - -for score in scores: - print("# Tuning hyper-parameters for %s" % score) - print() - - clf = GridSearchCV(SVC(C=1), tuned_parameters, cv=5, - scoring='%s_weighted' % score) - clf.fit(X_train, y_train) - - print("Best parameters set found on development set:") - print() - print(clf.best_params_) - print() - print("Grid scores on development set:") - print() - for params, mean_score, scores in clf.grid_scores_: - print("%0.3f (+/-%0.03f) for %r" - % (mean_score, scores.std() * 2, params)) - print() - - print("Detailed classification report:") - print() - print("The model is trained on the full development set.") - print("The scores are computed on the full evaluation set.") - print() - y_true, y_pred = y_test, clf.predict(X_test) - print(classification_report(y_true, y_pred)) - print() - -# Note the problem is too easy: the hyperparameter plateau is too flat and the -# output model is the same for precision and recall with ties in quality. diff --git a/0.15/_downloads/grid_search_digits1.py b/0.15/_downloads/grid_search_digits1.py deleted file mode 100644 index 20f25d3751cc0..0000000000000 --- a/0.15/_downloads/grid_search_digits1.py +++ /dev/null @@ -1,77 +0,0 @@ -""" -============================================================ -Parameter estimation using grid search with cross-validation -============================================================ - -This examples shows how a classifier is optimized by cross-validation, -which is done using the :class:`sklearn.grid_search.GridSearchCV` object -on a development set that comprises only half of the available labeled data. - -The performance of the selected hyper-parameters and trained model is -then measured on a dedicated evaluation set that was not used during -the model selection step. - -More details on tools available for model selection can be found in the -sections on :ref:`cross_validation` and :ref:`grid_search`. - -""" - -from __future__ import print_function - -from sklearn import datasets -from sklearn.cross_validation import train_test_split -from sklearn.grid_search import GridSearchCV -from sklearn.metrics import classification_report -from sklearn.svm import SVC - -print(__doc__) - -# Loading the Digits dataset -digits = datasets.load_digits() - -# To apply an classifier on this data, we need to flatten the image, to -# turn the data in a (samples, feature) matrix: -n_samples = len(digits.images) -X = digits.images.reshape((n_samples, -1)) -y = digits.target - -# Split the dataset in two equal parts -X_train, X_test, y_train, y_test = train_test_split( - X, y, test_size=0.5, random_state=0) - -# Set the parameters by cross-validation -tuned_parameters = [{'kernel': ['rbf'], 'gamma': [1e-3, 1e-4], - 'C': [1, 10, 100, 1000]}, - {'kernel': ['linear'], 'C': [1, 10, 100, 1000]}] - -scores = ['precision', 'recall'] - -for score in scores: - print("# Tuning hyper-parameters for %s" % score) - print() - - clf = GridSearchCV(SVC(C=1), tuned_parameters, cv=5, scoring=score) - clf.fit(X_train, y_train) - - print("Best parameters set found on development set:") - print() - print(clf.best_estimator_) - print() - print("Grid scores on development set:") - print() - for params, mean_score, scores in clf.grid_scores_: - print("%0.3f (+/-%0.03f) for %r" - % (mean_score, scores.std() / 2, params)) - print() - - print("Detailed classification report:") - print() - print("The model is trained on the full development set.") - print("The scores are computed on the full evaluation set.") - print() - y_true, y_pred = y_test, clf.predict(X_test) - print(classification_report(y_true, y_pred)) - print() - -# Note the problem is too easy: the hyperparameter plateau is too flat and the -# output model is the same for precision and recall with ties in quality. diff --git a/0.15/_downloads/grid_search_text_feature_extraction.py b/0.15/_downloads/grid_search_text_feature_extraction.py deleted file mode 100644 index 11b690d91e2ef..0000000000000 --- a/0.15/_downloads/grid_search_text_feature_extraction.py +++ /dev/null @@ -1,129 +0,0 @@ -""" -========================================================== -Sample pipeline for text feature extraction and evaluation -========================================================== - -The dataset used in this example is the 20 newsgroups dataset which will be -automatically downloaded and then cached and reused for the document -classification example. - -You can adjust the number of categories by giving their names to the dataset -loader or setting them to None to get the 20 of them. - -Here is a sample output of a run on a quad-core machine:: - - Loading 20 newsgroups dataset for categories: - ['alt.atheism', 'talk.religion.misc'] - 1427 documents - 2 categories - - Performing grid search... - pipeline: ['vect', 'tfidf', 'clf'] - parameters: - {'clf__alpha': (1.0000000000000001e-05, 9.9999999999999995e-07), - 'clf__n_iter': (10, 50, 80), - 'clf__penalty': ('l2', 'elasticnet'), - 'tfidf__use_idf': (True, False), - 'vect__max_n': (1, 2), - 'vect__max_df': (0.5, 0.75, 1.0), - 'vect__max_features': (None, 5000, 10000, 50000)} - done in 1737.030s - - Best score: 0.940 - Best parameters set: - clf__alpha: 9.9999999999999995e-07 - clf__n_iter: 50 - clf__penalty: 'elasticnet' - tfidf__use_idf: True - vect__max_n: 2 - vect__max_df: 0.75 - vect__max_features: 50000 - -""" - -# Author: Olivier Grisel -# Peter Prettenhofer -# Mathieu Blondel -# License: BSD 3 clause - -from __future__ import print_function - -from pprint import pprint -from time import time -import logging - -from sklearn.datasets import fetch_20newsgroups -from sklearn.feature_extraction.text import CountVectorizer -from sklearn.feature_extraction.text import TfidfTransformer -from sklearn.linear_model import SGDClassifier -from sklearn.grid_search import GridSearchCV -from sklearn.pipeline import Pipeline - -print(__doc__) - -# Display progress logs on stdout -logging.basicConfig(level=logging.INFO, - format='%(asctime)s %(levelname)s %(message)s') - - -############################################################################### -# Load some categories from the training set -categories = [ - 'alt.atheism', - 'talk.religion.misc', -] -# Uncomment the following to do the analysis on all the categories -#categories = None - -print("Loading 20 newsgroups dataset for categories:") -print(categories) - -data = fetch_20newsgroups(subset='train', categories=categories) -print("%d documents" % len(data.filenames)) -print("%d categories" % len(data.target_names)) -print() - -############################################################################### -# define a pipeline combining a text feature extractor with a simple -# classifier -pipeline = Pipeline([ - ('vect', CountVectorizer()), - ('tfidf', TfidfTransformer()), - ('clf', SGDClassifier()), -]) - -# uncommenting more parameters will give better exploring power but will -# increase processing time in a combinatorial way -parameters = { - 'vect__max_df': (0.5, 0.75, 1.0), - #'vect__max_features': (None, 5000, 10000, 50000), - 'vect__ngram_range': ((1, 1), (1, 2)), # unigrams or bigrams - #'tfidf__use_idf': (True, False), - #'tfidf__norm': ('l1', 'l2'), - 'clf__alpha': (0.00001, 0.000001), - 'clf__penalty': ('l2', 'elasticnet'), - #'clf__n_iter': (10, 50, 80), -} - -if __name__ == "__main__": - # multiprocessing requires the fork to happen in a __main__ protected - # block - - # find the best parameters for both the feature extraction and the - # classifier - grid_search = GridSearchCV(pipeline, parameters, n_jobs=-1, verbose=1) - - print("Performing grid search...") - print("pipeline:", [name for name, _ in pipeline.steps]) - print("parameters:") - pprint(parameters) - t0 = time() - grid_search.fit(data.data, data.target) - print("done in %0.3fs" % (time() - t0)) - print() - - print("Best score: %0.3f" % grid_search.best_score_) - print("Best parameters set:") - best_parameters = grid_search.best_estimator_.get_params() - for param_name in sorted(parameters.keys()): - print("\t%s: %r" % (param_name, best_parameters[param_name])) diff --git a/0.15/_downloads/grid_search_text_feature_extraction1.py b/0.15/_downloads/grid_search_text_feature_extraction1.py deleted file mode 100644 index 11b690d91e2ef..0000000000000 --- a/0.15/_downloads/grid_search_text_feature_extraction1.py +++ /dev/null @@ -1,129 +0,0 @@ -""" -========================================================== -Sample pipeline for text feature extraction and evaluation -========================================================== - -The dataset used in this example is the 20 newsgroups dataset which will be -automatically downloaded and then cached and reused for the document -classification example. - -You can adjust the number of categories by giving their names to the dataset -loader or setting them to None to get the 20 of them. - -Here is a sample output of a run on a quad-core machine:: - - Loading 20 newsgroups dataset for categories: - ['alt.atheism', 'talk.religion.misc'] - 1427 documents - 2 categories - - Performing grid search... - pipeline: ['vect', 'tfidf', 'clf'] - parameters: - {'clf__alpha': (1.0000000000000001e-05, 9.9999999999999995e-07), - 'clf__n_iter': (10, 50, 80), - 'clf__penalty': ('l2', 'elasticnet'), - 'tfidf__use_idf': (True, False), - 'vect__max_n': (1, 2), - 'vect__max_df': (0.5, 0.75, 1.0), - 'vect__max_features': (None, 5000, 10000, 50000)} - done in 1737.030s - - Best score: 0.940 - Best parameters set: - clf__alpha: 9.9999999999999995e-07 - clf__n_iter: 50 - clf__penalty: 'elasticnet' - tfidf__use_idf: True - vect__max_n: 2 - vect__max_df: 0.75 - vect__max_features: 50000 - -""" - -# Author: Olivier Grisel -# Peter Prettenhofer -# Mathieu Blondel -# License: BSD 3 clause - -from __future__ import print_function - -from pprint import pprint -from time import time -import logging - -from sklearn.datasets import fetch_20newsgroups -from sklearn.feature_extraction.text import CountVectorizer -from sklearn.feature_extraction.text import TfidfTransformer -from sklearn.linear_model import SGDClassifier -from sklearn.grid_search import GridSearchCV -from sklearn.pipeline import Pipeline - -print(__doc__) - -# Display progress logs on stdout -logging.basicConfig(level=logging.INFO, - format='%(asctime)s %(levelname)s %(message)s') - - -############################################################################### -# Load some categories from the training set -categories = [ - 'alt.atheism', - 'talk.religion.misc', -] -# Uncomment the following to do the analysis on all the categories -#categories = None - -print("Loading 20 newsgroups dataset for categories:") -print(categories) - -data = fetch_20newsgroups(subset='train', categories=categories) -print("%d documents" % len(data.filenames)) -print("%d categories" % len(data.target_names)) -print() - -############################################################################### -# define a pipeline combining a text feature extractor with a simple -# classifier -pipeline = Pipeline([ - ('vect', CountVectorizer()), - ('tfidf', TfidfTransformer()), - ('clf', SGDClassifier()), -]) - -# uncommenting more parameters will give better exploring power but will -# increase processing time in a combinatorial way -parameters = { - 'vect__max_df': (0.5, 0.75, 1.0), - #'vect__max_features': (None, 5000, 10000, 50000), - 'vect__ngram_range': ((1, 1), (1, 2)), # unigrams or bigrams - #'tfidf__use_idf': (True, False), - #'tfidf__norm': ('l1', 'l2'), - 'clf__alpha': (0.00001, 0.000001), - 'clf__penalty': ('l2', 'elasticnet'), - #'clf__n_iter': (10, 50, 80), -} - -if __name__ == "__main__": - # multiprocessing requires the fork to happen in a __main__ protected - # block - - # find the best parameters for both the feature extraction and the - # classifier - grid_search = GridSearchCV(pipeline, parameters, n_jobs=-1, verbose=1) - - print("Performing grid search...") - print("pipeline:", [name for name, _ in pipeline.steps]) - print("parameters:") - pprint(parameters) - t0 = time() - grid_search.fit(data.data, data.target) - print("done in %0.3fs" % (time() - t0)) - print() - - print("Best score: %0.3f" % grid_search.best_score_) - print("Best parameters set:") - best_parameters = grid_search.best_estimator_.get_params() - for param_name in sorted(parameters.keys()): - print("\t%s: %r" % (param_name, best_parameters[param_name])) diff --git a/0.15/_downloads/hashing_vs_dict_vectorizer.py b/0.15/_downloads/hashing_vs_dict_vectorizer.py deleted file mode 100644 index 7981d7d2b9042..0000000000000 --- a/0.15/_downloads/hashing_vs_dict_vectorizer.py +++ /dev/null @@ -1,111 +0,0 @@ -""" -=========================================== -FeatureHasher and DictVectorizer Comparison -=========================================== - -Compares FeatureHasher and DictVectorizer by using both to vectorize -text documents. - -The example demonstrates syntax and speed only; it doesn't actually do -anything useful with the extracted vectors. See the example scripts -{document_classification_20newsgroups,clustering}.py for actual learning -on text documents. - -A discrepancy between the number of terms reported for DictVectorizer and -for FeatureHasher is to be expected due to hash collisions. -""" - -# Author: Lars Buitinck -# License: BSD 3 clause - -from __future__ import print_function -from collections import defaultdict -import re -import sys -from time import time - -import numpy as np - -from sklearn.datasets import fetch_20newsgroups -from sklearn.feature_extraction import DictVectorizer, FeatureHasher - - -def n_nonzero_columns(X): - """Returns the number of non-zero columns in a CSR matrix X.""" - return len(np.unique(X.nonzero()[1])) - - -def tokens(doc): - """Extract tokens from doc. - - This uses a simple regex to break strings into tokens. For a more - principled approach, see CountVectorizer or TfidfVectorizer. - """ - return (tok.lower() for tok in re.findall(r"\w+", doc)) - - -def token_freqs(doc): - """Extract a dict mapping tokens from doc to their frequencies.""" - freq = defaultdict(int) - for tok in tokens(doc): - freq[tok] += 1 - return freq - - -categories = [ - 'alt.atheism', - 'comp.graphics', - 'comp.sys.ibm.pc.hardware', - 'misc.forsale', - 'rec.autos', - 'sci.space', - 'talk.religion.misc', -] -# Uncomment the following line to use a larger set (11k+ documents) -#categories = None - -print(__doc__) -print("Usage: %s [n_features_for_hashing]" % sys.argv[0]) -print(" The default number of features is 2**18.") -print() - -try: - n_features = int(sys.argv[1]) -except IndexError: - n_features = 2 ** 18 -except ValueError: - print("not a valid number of features: %r" % sys.argv[1]) - sys.exit(1) - - -print("Loading 20 newsgroups training data") -raw_data = fetch_20newsgroups(subset='train', categories=categories).data -data_size_mb = sum(len(s.encode('utf-8')) for s in raw_data) / 1e6 -print("%d documents - %0.3fMB" % (len(raw_data), data_size_mb)) -print() - -print("DictVectorizer") -t0 = time() -vectorizer = DictVectorizer() -vectorizer.fit_transform(token_freqs(d) for d in raw_data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_size_mb / duration)) -print("Found %d unique terms" % len(vectorizer.get_feature_names())) -print() - -print("FeatureHasher on frequency dicts") -t0 = time() -hasher = FeatureHasher(n_features=n_features) -X = hasher.transform(token_freqs(d) for d in raw_data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_size_mb / duration)) -print("Found %d unique terms" % n_nonzero_columns(X)) -print() - -print("FeatureHasher on raw tokens") -t0 = time() -hasher = FeatureHasher(n_features=n_features, input_type="string") -X = hasher.transform(tokens(d) for d in raw_data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_size_mb / duration)) -print("Found %d unique terms" % n_nonzero_columns(X)) diff --git a/0.15/_downloads/hashing_vs_dict_vectorizer1.py b/0.15/_downloads/hashing_vs_dict_vectorizer1.py deleted file mode 100644 index 7981d7d2b9042..0000000000000 --- a/0.15/_downloads/hashing_vs_dict_vectorizer1.py +++ /dev/null @@ -1,111 +0,0 @@ -""" -=========================================== -FeatureHasher and DictVectorizer Comparison -=========================================== - -Compares FeatureHasher and DictVectorizer by using both to vectorize -text documents. - -The example demonstrates syntax and speed only; it doesn't actually do -anything useful with the extracted vectors. See the example scripts -{document_classification_20newsgroups,clustering}.py for actual learning -on text documents. - -A discrepancy between the number of terms reported for DictVectorizer and -for FeatureHasher is to be expected due to hash collisions. -""" - -# Author: Lars Buitinck -# License: BSD 3 clause - -from __future__ import print_function -from collections import defaultdict -import re -import sys -from time import time - -import numpy as np - -from sklearn.datasets import fetch_20newsgroups -from sklearn.feature_extraction import DictVectorizer, FeatureHasher - - -def n_nonzero_columns(X): - """Returns the number of non-zero columns in a CSR matrix X.""" - return len(np.unique(X.nonzero()[1])) - - -def tokens(doc): - """Extract tokens from doc. - - This uses a simple regex to break strings into tokens. For a more - principled approach, see CountVectorizer or TfidfVectorizer. - """ - return (tok.lower() for tok in re.findall(r"\w+", doc)) - - -def token_freqs(doc): - """Extract a dict mapping tokens from doc to their frequencies.""" - freq = defaultdict(int) - for tok in tokens(doc): - freq[tok] += 1 - return freq - - -categories = [ - 'alt.atheism', - 'comp.graphics', - 'comp.sys.ibm.pc.hardware', - 'misc.forsale', - 'rec.autos', - 'sci.space', - 'talk.religion.misc', -] -# Uncomment the following line to use a larger set (11k+ documents) -#categories = None - -print(__doc__) -print("Usage: %s [n_features_for_hashing]" % sys.argv[0]) -print(" The default number of features is 2**18.") -print() - -try: - n_features = int(sys.argv[1]) -except IndexError: - n_features = 2 ** 18 -except ValueError: - print("not a valid number of features: %r" % sys.argv[1]) - sys.exit(1) - - -print("Loading 20 newsgroups training data") -raw_data = fetch_20newsgroups(subset='train', categories=categories).data -data_size_mb = sum(len(s.encode('utf-8')) for s in raw_data) / 1e6 -print("%d documents - %0.3fMB" % (len(raw_data), data_size_mb)) -print() - -print("DictVectorizer") -t0 = time() -vectorizer = DictVectorizer() -vectorizer.fit_transform(token_freqs(d) for d in raw_data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_size_mb / duration)) -print("Found %d unique terms" % len(vectorizer.get_feature_names())) -print() - -print("FeatureHasher on frequency dicts") -t0 = time() -hasher = FeatureHasher(n_features=n_features) -X = hasher.transform(token_freqs(d) for d in raw_data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_size_mb / duration)) -print("Found %d unique terms" % n_nonzero_columns(X)) -print() - -print("FeatureHasher on raw tokens") -t0 = time() -hasher = FeatureHasher(n_features=n_features, input_type="string") -X = hasher.transform(tokens(d) for d in raw_data) -duration = time() - t0 -print("done in %fs at %0.3fMB/s" % (duration, data_size_mb / duration)) -print("Found %d unique terms" % n_nonzero_columns(X)) diff --git a/0.15/_downloads/hetero_feature_union.py b/0.15/_downloads/hetero_feature_union.py deleted file mode 100644 index 9a2c6742f3946..0000000000000 --- a/0.15/_downloads/hetero_feature_union.py +++ /dev/null @@ -1,181 +0,0 @@ -""" -============================================= -Feature Union with Heterogeneous Data Sources -============================================= - -Datasets can often contain components of that require different feature -extraction and processing pipelines. This scenario might occur when: - -1. Your dataset consists of heterogeneous data types (e.g. raster images and - text captions) -2. Your dataset is stored in a Pandas DataFrame and different columns - require different processing pipelines. - -This example demonstrates how to use -:class:`sklearn.feature_extraction.FeatureUnion` on a dataset containing -different types of features. We use the 20-newsgroups dataset and compute -standard bag-of-words features for the subject line and body in separate -pipelines as well as ad hoc features on the body. We combine them (with -weights) using a FeatureUnion and finally train a classifier on the combined -set of features. - -The choice of features is not particularly helpful, but serves to illustrate -the technique. -""" - -# Author: Matt Terry -# -# License: BSD 3 clause -from __future__ import print_function - -import numpy as np - -from sklearn.base import BaseEstimator, TransformerMixin -from sklearn.datasets import fetch_20newsgroups -from sklearn.datasets.twenty_newsgroups import strip_newsgroup_footer -from sklearn.datasets.twenty_newsgroups import strip_newsgroup_quoting -from sklearn.decomposition import TruncatedSVD -from sklearn.feature_extraction import DictVectorizer -from sklearn.feature_extraction.text import TfidfVectorizer -from sklearn.metrics import classification_report -from sklearn.pipeline import FeatureUnion -from sklearn.pipeline import Pipeline -from sklearn.svm import SVC - - -class ItemSelector(BaseEstimator, TransformerMixin): - """For data grouped by feature, select subset of data at a provided key. - - The data is expected to be stored in a 2D data structure, where the first - index is over features and the second is over samples. i.e. - - >> len(data[key]) == n_samples - - Please note that this is the opposite convention to sklearn feature - matrixes (where the first index corresponds to sample). - - ItemSelector only requires that the collection implement getitem - (data[key]). Examples include: a dict of lists, 2D numpy array, Pandas - DataFrame, numpy record array, etc. - - >> data = {'a': [1, 5, 2, 5, 2, 8], - 'b': [9, 4, 1, 4, 1, 3]} - >> ds = ItemSelector(key='a') - >> data['a'] == ds.transform(data) - - ItemSelector is not designed to handle data grouped by sample. (e.g. a - list of dicts). If your data is structured this way, consider a - transformer along the lines of `sklearn.feature_extraction.DictVectorizer`. - - Parameters - ---------- - key : hashable, required - The key corresponding to the desired value in a mappable. - """ - def __init__(self, key): - self.key = key - - def fit(self, x, y=None): - return self - - def transform(self, data_dict): - return data_dict[self.key] - - -class TextStats(BaseEstimator, TransformerMixin): - """Extract features from each document for DictVectorizer""" - - def fit(self, x, y=None): - return self - - def transform(self, posts): - return [{'length': len(text), - 'num_sentences': text.count('.')} - for text in posts] - - -class SubjectBodyExtractor(BaseEstimator, TransformerMixin): - """Extract the subject & body from a usenet post in a single pass. - - Takes a sequence of strings and produces a dict of sequences. Keys are - `subject` and `body`. - """ - def fit(self, x, y=None): - return self - - def transform(self, posts): - features = np.recarray(shape=(len(posts),), - dtype=[('subject', object), ('body', object)]) - for i, text in enumerate(posts): - headers, _, bod = text.partition('\n\n') - bod = strip_newsgroup_footer(bod) - bod = strip_newsgroup_quoting(bod) - features['body'][i] = bod - - prefix = 'Subject:' - sub = '' - for line in headers.split('\n'): - if line.startswith(prefix): - sub = line[len(prefix):] - break - features['subject'][i] = sub - - return features - - -pipeline = Pipeline([ - # Extract the subject & body - ('subjectbody', SubjectBodyExtractor()), - - # Use FeatureUnion to combine the features from subject and body - ('union', FeatureUnion( - transformer_list=[ - - # Pipeline for pulling features from the post's subject line - ('subject', Pipeline([ - ('selector', ItemSelector(key='subject')), - ('tfidf', TfidfVectorizer(min_df=50)), - ])), - - # Pipeline for standard bag-of-words model for body - ('body_bow', Pipeline([ - ('selector', ItemSelector(key='body')), - ('tfidf', TfidfVectorizer()), - ('best', TruncatedSVD(n_components=50)), - ])), - - # Pipeline for pulling ad hoc features from post's body - ('body_stats', Pipeline([ - ('selector', ItemSelector(key='body')), - ('stats', TextStats()), # returns a list of dicts - ('vect', DictVectorizer()), # list of dicts -> feature matrix - ])), - - ], - - # weight components in FeatureUnion - transformer_weights={ - 'subject': 0.8, - 'body_bow': 0.5, - 'body_stats': 1.0, - }, - )), - - # Use a SVC classifier on the combined features - ('svc', SVC(kernel='linear')), -]) - -# limit the list of categories to make running this exmaple faster. -categories = ['alt.atheism', 'talk.religion.misc'] -train = fetch_20newsgroups(random_state=1, - subset='train', - categories=categories, - ) -test = fetch_20newsgroups(random_state=1, - subset='test', - categories=categories, - ) - -pipeline.fit(train.data, train.target) -y = pipeline.predict(test.data) -print(classification_report(y, test.target)) diff --git a/0.15/_downloads/imputation.py b/0.15/_downloads/imputation.py deleted file mode 100644 index 4ccdd41289466..0000000000000 --- a/0.15/_downloads/imputation.py +++ /dev/null @@ -1,66 +0,0 @@ -""" -====================================================== -Imputing missing values before building an estimator -====================================================== - -This example shows that imputing the missing values can give better results -than discarding the samples containing any missing value. - -Missing values can be replaced by the mean, the median or the most frequent -value using the ``strategy`` hyper-parameter. - -Script output: - - Score with the entire dataset = 0.56 - Score without the samples containing missing values = 0.48 - Score after imputation of the missing values = 0.55 - -""" -import numpy as np - -from sklearn.datasets import load_boston -from sklearn.ensemble import RandomForestRegressor -from sklearn.pipeline import Pipeline -from sklearn.preprocessing import Imputer -from sklearn.cross_validation import cross_val_score - -rng = np.random.RandomState(0) - -dataset = load_boston() -X_full, y_full = dataset.data, dataset.target -n_samples = X_full.shape[0] -n_features = X_full.shape[1] - -# Estimate the score on the entire dataset, with no missing values -estimator = RandomForestRegressor(random_state=0, n_estimators=100) -score = cross_val_score(estimator, X_full, y_full).mean() -print("Score with the entire dataset = %.2f" % score) - -# Add missing values in 75% of the lines -missing_rate = 0.75 -n_missing_samples = np.floor(n_samples * missing_rate) -missing_samples = np.hstack((np.zeros(n_samples - n_missing_samples, - dtype=np.bool), - np.ones(n_missing_samples, - dtype=np.bool))) -rng.shuffle(missing_samples) -missing_features = rng.randint(0, n_features, n_missing_samples) - -# Estimate the score without the lines containing missing values -X_filtered = X_full[~missing_samples, :] -y_filtered = y_full[~missing_samples] -estimator = RandomForestRegressor(random_state=0, n_estimators=100) -score = cross_val_score(estimator, X_filtered, y_filtered).mean() -print("Score without the samples containing missing values = %.2f" % score) - -# Estimate the score after imputation of the missing values -X_missing = X_full.copy() -X_missing[np.where(missing_samples)[0], missing_features] = 0 -y_missing = y_full.copy() -estimator = Pipeline([("imputer", Imputer(missing_values=0, - strategy="mean", - axis=0)), - ("forest", RandomForestRegressor(random_state=0, - n_estimators=100))]) -score = cross_val_score(estimator, X_missing, y_missing).mean() -print("Score after imputation of the missing values = %.2f" % score) diff --git a/0.15/_downloads/lasso_dense_vs_sparse_data.py b/0.15/_downloads/lasso_dense_vs_sparse_data.py deleted file mode 100644 index bc8df42a8490e..0000000000000 --- a/0.15/_downloads/lasso_dense_vs_sparse_data.py +++ /dev/null @@ -1,66 +0,0 @@ -""" -============================== -Lasso on dense and sparse data -============================== - -We show that linear_model.Lasso provides the same results for dense and sparse -data and that in the case of sparse data the speed is improved. - -""" -print(__doc__) - -from time import time -from scipy import sparse -from scipy import linalg - -from sklearn.datasets.samples_generator import make_regression -from sklearn.linear_model import Lasso - - -############################################################################### -# The two Lasso implementations on Dense data -print("--- Dense matrices") - -X, y = make_regression(n_samples=200, n_features=5000, random_state=0) -X_sp = sparse.coo_matrix(X) - -alpha = 1 -sparse_lasso = Lasso(alpha=alpha, fit_intercept=False, max_iter=1000) -dense_lasso = Lasso(alpha=alpha, fit_intercept=False, max_iter=1000) - -t0 = time() -sparse_lasso.fit(X_sp, y) -print("Sparse Lasso done in %fs" % (time() - t0)) - -t0 = time() -dense_lasso.fit(X, y) -print("Dense Lasso done in %fs" % (time() - t0)) - -print("Distance between coefficients : %s" - % linalg.norm(sparse_lasso.coef_ - dense_lasso.coef_)) - -############################################################################### -# The two Lasso implementations on Sparse data -print("--- Sparse matrices") - -Xs = X.copy() -Xs[Xs < 2.5] = 0.0 -Xs = sparse.coo_matrix(Xs) -Xs = Xs.tocsc() - -print("Matrix density : %s %%" % (Xs.nnz / float(X.size) * 100)) - -alpha = 0.1 -sparse_lasso = Lasso(alpha=alpha, fit_intercept=False, max_iter=10000) -dense_lasso = Lasso(alpha=alpha, fit_intercept=False, max_iter=10000) - -t0 = time() -sparse_lasso.fit(Xs, y) -print("Sparse Lasso done in %fs" % (time() - t0)) - -t0 = time() -dense_lasso.fit(Xs.toarray(), y) -print("Dense Lasso done in %fs" % (time() - t0)) - -print("Distance between coefficients : %s" - % linalg.norm(sparse_lasso.coef_ - dense_lasso.coef_)) diff --git a/0.15/_downloads/missing_values.py b/0.15/_downloads/missing_values.py deleted file mode 100644 index 59444b36490e3..0000000000000 --- a/0.15/_downloads/missing_values.py +++ /dev/null @@ -1,72 +0,0 @@ -""" -====================================================== -Imputing missing values before building an estimator -====================================================== - -This example shows that imputing the missing values can give better results -than discarding the samples containing any missing value. -Imputing does not always improve the predictions, so please check via cross-validation. -Sometimes dropping rows or using marker values is more effective. - -Missing values can be replaced by the mean, the median or the most frequent -value using the ``strategy`` hyper-parameter. -The median is a more robust estimator for data with high magnitude variables -which could dominate results (otherwise known as a 'long tail'). - -Script output:: - - Score with the entire dataset = 0.56 - Score without the samples containing missing values = 0.48 - Score after imputation of the missing values = 0.55 - -In this case, imputing helps the classifier get close to the original score. - -""" -import numpy as np - -from sklearn.datasets import load_boston -from sklearn.ensemble import RandomForestRegressor -from sklearn.pipeline import Pipeline -from sklearn.preprocessing import Imputer -from sklearn.cross_validation import cross_val_score - -rng = np.random.RandomState(0) - -dataset = load_boston() -X_full, y_full = dataset.data, dataset.target -n_samples = X_full.shape[0] -n_features = X_full.shape[1] - -# Estimate the score on the entire dataset, with no missing values -estimator = RandomForestRegressor(random_state=0, n_estimators=100) -score = cross_val_score(estimator, X_full, y_full).mean() -print("Score with the entire dataset = %.2f" % score) - -# Add missing values in 75% of the lines -missing_rate = 0.75 -n_missing_samples = np.floor(n_samples * missing_rate) -missing_samples = np.hstack((np.zeros(n_samples - n_missing_samples, - dtype=np.bool), - np.ones(n_missing_samples, - dtype=np.bool))) -rng.shuffle(missing_samples) -missing_features = rng.randint(0, n_features, n_missing_samples) - -# Estimate the score without the lines containing missing values -X_filtered = X_full[~missing_samples, :] -y_filtered = y_full[~missing_samples] -estimator = RandomForestRegressor(random_state=0, n_estimators=100) -score = cross_val_score(estimator, X_filtered, y_filtered).mean() -print("Score without the samples containing missing values = %.2f" % score) - -# Estimate the score after imputation of the missing values -X_missing = X_full.copy() -X_missing[np.where(missing_samples)[0], missing_features] = 0 -y_missing = y_full.copy() -estimator = Pipeline([("imputer", Imputer(missing_values=0, - strategy="mean", - axis=0)), - ("forest", RandomForestRegressor(random_state=0, - n_estimators=100))]) -score = cross_val_score(estimator, X_missing, y_missing).mean() -print("Score after imputation of the missing values = %.2f" % score) diff --git a/0.15/_downloads/mlcomp_sparse_document_classification.py b/0.15/_downloads/mlcomp_sparse_document_classification.py deleted file mode 100644 index c1d2631453d9c..0000000000000 --- a/0.15/_downloads/mlcomp_sparse_document_classification.py +++ /dev/null @@ -1,145 +0,0 @@ -""" -======================================================== -Classification of text documents: using a MLComp dataset -======================================================== - -This is an example showing how the scikit-learn can be used to classify -documents by topics using a bag-of-words approach. This example uses -a scipy.sparse matrix to store the features instead of standard numpy arrays. - -The dataset used in this example is the 20 newsgroups dataset and should be -downloaded from the http://mlcomp.org (free registration required): - - http://mlcomp.org/datasets/379 - -Once downloaded unzip the archive somewhere on your filesystem. -For instance in:: - - % mkdir -p ~/data/mlcomp - % cd ~/data/mlcomp - % unzip /path/to/dataset-379-20news-18828_XXXXX.zip - -You should get a folder ``~/data/mlcomp/379`` with a file named ``metadata`` -and subfolders ``raw``, ``train`` and ``test`` holding the text documents -organized by newsgroups. - -Then set the ``MLCOMP_DATASETS_HOME`` environment variable pointing to -the root folder holding the uncompressed archive:: - - % export MLCOMP_DATASETS_HOME="~/data/mlcomp" - -Then you are ready to run this example using your favorite python shell:: - - % ipython examples/mlcomp_sparse_document_classification.py - -""" - -# Author: Olivier Grisel -# License: BSD 3 clause - -from __future__ import print_function - -from time import time -import sys -import os -import numpy as np -import scipy.sparse as sp -import pylab as pl - -from sklearn.datasets import load_mlcomp -from sklearn.feature_extraction.text import TfidfVectorizer -from sklearn.linear_model import SGDClassifier -from sklearn.metrics import confusion_matrix -from sklearn.metrics import classification_report -from sklearn.naive_bayes import MultinomialNB - - -print(__doc__) - -if 'MLCOMP_DATASETS_HOME' not in os.environ: - print("MLCOMP_DATASETS_HOME not set; please follow the above instructions") - sys.exit(0) - -# Load the training set -print("Loading 20 newsgroups training set... ") -news_train = load_mlcomp('20news-18828', 'train') -print(news_train.DESCR) -print("%d documents" % len(news_train.filenames)) -print("%d categories" % len(news_train.target_names)) - -print("Extracting features from the dataset using a sparse vectorizer") -t0 = time() -vectorizer = TfidfVectorizer(encoding='latin1') -X_train = vectorizer.fit_transform((open(f).read() - for f in news_train.filenames)) -print("done in %fs" % (time() - t0)) -print("n_samples: %d, n_features: %d" % X_train.shape) -assert sp.issparse(X_train) -y_train = news_train.target - -print("Loading 20 newsgroups test set... ") -news_test = load_mlcomp('20news-18828', 'test') -t0 = time() -print("done in %fs" % (time() - t0)) - -print("Predicting the labels of the test set...") -print("%d documents" % len(news_test.filenames)) -print("%d categories" % len(news_test.target_names)) - -print("Extracting features from the dataset using the same vectorizer") -t0 = time() -X_test = vectorizer.transform((open(f).read() for f in news_test.filenames)) -y_test = news_test.target -print("done in %fs" % (time() - t0)) -print("n_samples: %d, n_features: %d" % X_test.shape) - - -############################################################################### -# Benchmark classifiers -def benchmark(clf_class, params, name): - print("parameters:", params) - t0 = time() - clf = clf_class(**params).fit(X_train, y_train) - print("done in %fs" % (time() - t0)) - - if hasattr(clf, 'coef_'): - print("Percentage of non zeros coef: %f" - % (np.mean(clf.coef_ != 0) * 100)) - print("Predicting the outcomes of the testing set") - t0 = time() - pred = clf.predict(X_test) - print("done in %fs" % (time() - t0)) - - print("Classification report on test set for classifier:") - print(clf) - print() - print(classification_report(y_test, pred, - target_names=news_test.target_names)) - - cm = confusion_matrix(y_test, pred) - print("Confusion matrix:") - print(cm) - - # Show confusion matrix - pl.matshow(cm) - pl.title('Confusion matrix of the %s classifier' % name) - pl.colorbar() - - -print("Testbenching a linear classifier...") -parameters = { - 'loss': 'hinge', - 'penalty': 'l2', - 'n_iter': 50, - 'alpha': 0.00001, - 'fit_intercept': True, -} - -benchmark(SGDClassifier, parameters, 'SGD') - -print("Testbenching a MultinomialNB classifier...") -parameters = {'alpha': 0.01} - -benchmark(MultinomialNB, parameters, 'MultinomialNB') - -pl.show() diff --git a/0.15/_downloads/plot_adaboost_hastie_10_2.py b/0.15/_downloads/plot_adaboost_hastie_10_2.py deleted file mode 100644 index b27636956ef26..0000000000000 --- a/0.15/_downloads/plot_adaboost_hastie_10_2.py +++ /dev/null @@ -1,112 +0,0 @@ -""" -============================= -Discrete versus Real AdaBoost -============================= - -This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates -the difference in performance between the discrete SAMME [2] boosting -algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluated -on a binary classification task where the target Y is a non-linear function -of 10 input features. - -Discrete SAMME AdaBoost adapts based on errors in predicted class labels -whereas real SAMME.R uses the predicted class probabilities. - -.. [1] T. Hastie, R. Tibshirani and J. Friedman, "Elements of Statistical - Learning Ed. 2", Springer, 2009. - -.. [2] J. Zhu, H. Zou, S. Rosset, T. Hastie, "Multi-class AdaBoost", 2009. - -""" -print(__doc__) - -# Author: Peter Prettenhofer , -# Noel Dawe -# -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import datasets -from sklearn.tree import DecisionTreeClassifier -from sklearn.metrics import zero_one_loss -from sklearn.ensemble import AdaBoostClassifier - - -n_estimators = 400 -# A learning rate of 1. may not be optimal for both SAMME and SAMME.R -learning_rate = 1. - -X, y = datasets.make_hastie_10_2(n_samples=12000, random_state=1) - -X_test, y_test = X[2000:], y[2000:] -X_train, y_train = X[:2000], y[:2000] - -dt_stump = DecisionTreeClassifier(max_depth=1, min_samples_leaf=1) -dt_stump.fit(X_train, y_train) -dt_stump_err = 1.0 - dt_stump.score(X_test, y_test) - -dt = DecisionTreeClassifier(max_depth=9, min_samples_leaf=1) -dt.fit(X_train, y_train) -dt_err = 1.0 - dt.score(X_test, y_test) - -ada_discrete = AdaBoostClassifier( - base_estimator=dt_stump, - learning_rate=learning_rate, - n_estimators=n_estimators, - algorithm="SAMME") -ada_discrete.fit(X_train, y_train) - -ada_real = AdaBoostClassifier( - base_estimator=dt_stump, - learning_rate=learning_rate, - n_estimators=n_estimators, - algorithm="SAMME.R") -ada_real.fit(X_train, y_train) - -fig = plt.figure() -ax = fig.add_subplot(111) - -ax.plot([1, n_estimators], [dt_stump_err] * 2, 'k-', - label='Decision Stump Error') -ax.plot([1, n_estimators], [dt_err] * 2, 'k--', - label='Decision Tree Error') - -ada_discrete_err = np.zeros((n_estimators,)) -for i, y_pred in enumerate(ada_discrete.staged_predict(X_test)): - ada_discrete_err[i] = zero_one_loss(y_pred, y_test) - -ada_discrete_err_train = np.zeros((n_estimators,)) -for i, y_pred in enumerate(ada_discrete.staged_predict(X_train)): - ada_discrete_err_train[i] = zero_one_loss(y_pred, y_train) - -ada_real_err = np.zeros((n_estimators,)) -for i, y_pred in enumerate(ada_real.staged_predict(X_test)): - ada_real_err[i] = zero_one_loss(y_pred, y_test) - -ada_real_err_train = np.zeros((n_estimators,)) -for i, y_pred in enumerate(ada_real.staged_predict(X_train)): - ada_real_err_train[i] = zero_one_loss(y_pred, y_train) - -ax.plot(np.arange(n_estimators) + 1, ada_discrete_err, - label='Discrete AdaBoost Test Error', - color='red') -ax.plot(np.arange(n_estimators) + 1, ada_discrete_err_train, - label='Discrete AdaBoost Train Error', - color='blue') -ax.plot(np.arange(n_estimators) + 1, ada_real_err, - label='Real AdaBoost Test Error', - color='orange') -ax.plot(np.arange(n_estimators) + 1, ada_real_err_train, - label='Real AdaBoost Train Error', - color='green') - -ax.set_ylim((0.0, 0.5)) -ax.set_xlabel('n_estimators') -ax.set_ylabel('error rate') - -leg = ax.legend(loc='upper right', fancybox=True) -leg.get_frame().set_alpha(0.7) - -plt.show() diff --git a/0.15/_downloads/plot_adaboost_multiclass.py b/0.15/_downloads/plot_adaboost_multiclass.py deleted file mode 100644 index 39e7cdcb8ef4d..0000000000000 --- a/0.15/_downloads/plot_adaboost_multiclass.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -===================================== -Multi-class AdaBoosted Decision Trees -===================================== - -This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can -improve prediction accuracy on a multi-class problem. The classification -dataset is constructed by taking a ten-dimensional standard normal distribution -and defining three classes separated by nested concentric ten-dimensional -spheres such that roughly equal numbers of samples are in each class (quantiles -of the :math:`\chi^2` distribution). - -The performance of the SAMME and SAMME.R [1] algorithms are compared. SAMME.R -uses the probability estimates to update the additive model, while SAMME uses -the classifications only. As the example illustrates, the SAMME.R algorithm -typically converges faster than SAMME, achieving a lower test error with fewer -boosting iterations. The error of each algorithm on the test set after each -boosting iteration is shown on the left, the classification error on the test -set of each tree is shown in the middle, and the boost weight of each tree is -shown on the right. All trees have a weight of one in the SAMME.R algorithm and -therefore are not shown. - -.. [1] J. Zhu, H. Zou, S. Rosset, T. Hastie, "Multi-class AdaBoost", 2009. - -""" -print(__doc__) - -# Author: Noel Dawe -# -# License: BSD 3 clause - -from sklearn.externals.six.moves import zip - -import matplotlib.pyplot as plt - -from sklearn.datasets import make_gaussian_quantiles -from sklearn.ensemble import AdaBoostClassifier -from sklearn.metrics import accuracy_score -from sklearn.tree import DecisionTreeClassifier - - -X, y = make_gaussian_quantiles(n_samples=13000, n_features=10, - n_classes=3, random_state=1) - -n_split = 3000 - -X_train, X_test = X[:n_split], X[n_split:] -y_train, y_test = y[:n_split], y[n_split:] - -bdt_real = AdaBoostClassifier( - DecisionTreeClassifier(max_depth=2), - n_estimators=600, - learning_rate=1) - -bdt_discrete = AdaBoostClassifier( - DecisionTreeClassifier(max_depth=2), - n_estimators=600, - learning_rate=1.5, - algorithm="SAMME") - -bdt_real.fit(X_train, y_train) -bdt_discrete.fit(X_train, y_train) - -real_test_errors = [] -discrete_test_errors = [] - -for real_test_predict, discrete_train_predict in zip( - bdt_real.staged_predict(X_test), bdt_discrete.staged_predict(X_test)): - real_test_errors.append( - 1. - accuracy_score(real_test_predict, y_test)) - discrete_test_errors.append( - 1. - accuracy_score(discrete_train_predict, y_test)) - -n_trees_discrete = len(bdt_discrete) -n_trees_real = len(bdt_real) - -# Boosting might terminate early, but the following arrays are always -# n_estimators long. We crop them to the actual number of trees here: -discrete_estimator_errors = bdt_discrete.estimator_errors_[:n_trees_discrete] -real_estimator_errors = bdt_real.estimator_errors_[:n_trees_real] -discrete_estimator_weights = bdt_discrete.estimator_weights_[:n_trees_discrete] - -plt.figure(figsize=(15, 5)) - -plt.subplot(131) -plt.plot(range(1, n_trees_discrete + 1), - discrete_test_errors, c='black', label='SAMME') -plt.plot(range(1, n_trees_real + 1), - real_test_errors, c='black', - linestyle='dashed', label='SAMME.R') -plt.legend() -plt.ylim(0.18, 0.62) -plt.ylabel('Test Error') -plt.xlabel('Number of Trees') - -plt.subplot(132) -plt.plot(range(1, n_trees_discrete + 1), discrete_estimator_errors, - "b", label='SAMME', alpha=.5) -plt.plot(range(1, n_trees_real + 1), real_estimator_errors, - "r", label='SAMME.R', alpha=.5) -plt.legend() -plt.ylabel('Error') -plt.xlabel('Number of Trees') -plt.ylim((.2, - max(real_estimator_errors.max(), - discrete_estimator_errors.max()) * 1.2)) -plt.xlim((-20, len(bdt_discrete) + 20)) - -plt.subplot(133) -plt.plot(range(1, n_trees_discrete + 1), discrete_estimator_weights, - "b", label='SAMME') -plt.legend() -plt.ylabel('Weight') -plt.xlabel('Number of Trees') -plt.ylim((0, discrete_estimator_weights.max() * 1.2)) -plt.xlim((-20, n_trees_discrete + 20)) - -# prevent overlapping y-axis labels -plt.subplots_adjust(wspace=0.25) -plt.show() diff --git a/0.15/_downloads/plot_adaboost_regression.py b/0.15/_downloads/plot_adaboost_regression.py deleted file mode 100644 index 8a7c2ecdb2e4e..0000000000000 --- a/0.15/_downloads/plot_adaboost_regression.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -====================================== -Decision Tree Regression with AdaBoost -====================================== - -A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D -sinusoidal dataset with a small amount of Gaussian noise. -299 boosts (300 decision trees) is compared with a single decision tree -regressor. As the number of boosts is increased the regressor can fit more -detail. - -.. [1] H. Drucker, "Improving Regressors using Boosting Techniques", 1997. - -""" -print(__doc__) - -# Author: Noel Dawe -# -# License: BSD 3 clause - -# importing necessary libraries -import numpy as np -import matplotlib.pyplot as plt -from sklearn.tree import DecisionTreeRegressor -from sklearn.ensemble import AdaBoostRegressor - -# Create a the dataset -rng = np.random.RandomState(1) -X = np.linspace(0, 6, 100)[:, np.newaxis] -y = np.sin(X).ravel() + np.sin(6 * X).ravel() + rng.normal(0, 0.1, X.shape[0]) - -# Fit regression model -clf_1 = DecisionTreeRegressor(max_depth=4) - -clf_2 = AdaBoostRegressor(DecisionTreeRegressor(max_depth=4), - n_estimators=300, random_state=rng) - -clf_1.fit(X, y) -clf_2.fit(X, y) - -# Predict -y_1 = clf_1.predict(X) -y_2 = clf_2.predict(X) - -# Plot the results -plt.figure() -plt.scatter(X, y, c="k", label="training samples") -plt.plot(X, y_1, c="g", label="n_estimators=1", linewidth=2) -plt.plot(X, y_2, c="r", label="n_estimators=300", linewidth=2) -plt.xlabel("data") -plt.ylabel("target") -plt.title("Boosted Decision Tree Regression") -plt.legend() -plt.show() diff --git a/0.15/_downloads/plot_adaboost_twoclass.py b/0.15/_downloads/plot_adaboost_twoclass.py deleted file mode 100644 index 40412b9d7c77f..0000000000000 --- a/0.15/_downloads/plot_adaboost_twoclass.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -================== -Two-class AdaBoost -================== - -This example fits an AdaBoosted decision stump on a non-linearly separable -classification dataset composed of two "Gaussian quantiles" clusters -(see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision -boundary and decision scores. The distributions of decision scores are shown -separately for samples of class A and B. The predicted class label for each -sample is determined by the sign of the decision score. Samples with decision -scores greater than zero are classified as B, and are otherwise classified -as A. The magnitude of a decision score determines the degree of likeness with -the predicted class label. Additionally, a new dataset could be constructed -containing a desired purity of class B, for example, by only selecting samples -with a decision score above some value. - -""" -print(__doc__) - -# Author: Noel Dawe -# -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.ensemble import AdaBoostClassifier -from sklearn.tree import DecisionTreeClassifier -from sklearn.datasets import make_gaussian_quantiles - - -# Construct dataset -X1, y1 = make_gaussian_quantiles(cov=2., - n_samples=200, n_features=2, - n_classes=2, random_state=1) -X2, y2 = make_gaussian_quantiles(mean=(3, 3), cov=1.5, - n_samples=300, n_features=2, - n_classes=2, random_state=1) -X = np.concatenate((X1, X2)) -y = np.concatenate((y1, - y2 + 1)) - -# Create and fit an AdaBoosted decision tree -bdt = AdaBoostClassifier(DecisionTreeClassifier(max_depth=1), - algorithm="SAMME", - n_estimators=200) - -bdt.fit(X, y) - -plot_colors = "br" -plot_step = 0.02 -class_names = "AB" - -plt.figure(figsize=(10, 5)) - -# Plot the decision boundaries -plt.subplot(121) -x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 -y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 -xx, yy = np.meshgrid(np.arange(x_min, x_max, plot_step), - np.arange(y_min, y_max, plot_step)) - -Z = bdt.predict(np.c_[xx.ravel(), yy.ravel()]) -Z = Z.reshape(xx.shape) -cs = plt.contourf(xx, yy, Z, cmap=plt.cm.Paired) -plt.axis("tight") - -# Plot the training points -for i, n, c in zip(range(2), class_names, plot_colors): - idx = np.where(y == i) - plt.scatter(X[idx, 0], X[idx, 1], - c=c, cmap=plt.cm.Paired, - label="Class %s" % n) -plt.xlim(x_min, x_max) -plt.ylim(y_min, y_max) -plt.legend(loc='upper right') -plt.xlabel("Decision Boundary") - -# Plot the two-class decision scores -twoclass_output = bdt.decision_function(X) -plot_range = (twoclass_output.min(), twoclass_output.max()) -plt.subplot(122) -for i, n, c in zip(range(2), class_names, plot_colors): - plt.hist(twoclass_output[y == i], - bins=10, - range=plot_range, - facecolor=c, - label='Class %s' % n, - alpha=.5) -x1, x2, y1, y2 = plt.axis() -plt.axis((x1, x2, y1, y2 * 1.2)) -plt.legend(loc='upper right') -plt.ylabel('Samples') -plt.xlabel('Decision Scores') - -plt.subplots_adjust(wspace=0.25) -plt.show() diff --git a/0.15/_downloads/plot_adjusted_for_chance_measures.py b/0.15/_downloads/plot_adjusted_for_chance_measures.py deleted file mode 100644 index 66298d3c5ba96..0000000000000 --- a/0.15/_downloads/plot_adjusted_for_chance_measures.py +++ /dev/null @@ -1,123 +0,0 @@ -""" -========================================================== -Adjustment for chance in clustering performance evaluation -========================================================== - -The following plots demonstrate the impact of the number of clusters and -number of samples on various clustering performance evaluation metrics. - -Non-adjusted measures such as the V-Measure show a dependency between -the number of clusters and the number of samples: the mean V-Measure -of random labeling increases significantly as the number of clusters is -closer to the total number of samples used to compute the measure. - -Adjusted for chance measure such as ARI display some random variations -centered around a mean score of 0.0 for any number of samples and -clusters. - -Only adjusted measures can hence safely be used as a consensus index -to evaluate the average stability of clustering algorithms for a given -value of k on various overlapping sub-samples of the dataset. - -""" -print(__doc__) - -# Author: Olivier Grisel -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from time import time -from sklearn import metrics - - -def uniform_labelings_scores(score_func, n_samples, n_clusters_range, - fixed_n_classes=None, n_runs=5, seed=42): - """Compute score for 2 random uniform cluster labelings. - - Both random labelings have the same number of clusters for each value - possible value in ``n_clusters_range``. - - When fixed_n_classes is not None the first labeling is considered a ground - truth class assignment with fixed number of classes. - """ - random_labels = np.random.RandomState(seed).random_integers - scores = np.zeros((len(n_clusters_range), n_runs)) - - if fixed_n_classes is not None: - labels_a = random_labels(low=0, high=fixed_n_classes - 1, - size=n_samples) - - for i, k in enumerate(n_clusters_range): - for j in range(n_runs): - if fixed_n_classes is None: - labels_a = random_labels(low=0, high=k - 1, size=n_samples) - labels_b = random_labels(low=0, high=k - 1, size=n_samples) - scores[i, j] = score_func(labels_a, labels_b) - return scores - -score_funcs = [ - metrics.adjusted_rand_score, - metrics.v_measure_score, - metrics.adjusted_mutual_info_score, - metrics.mutual_info_score, -] - -# 2 independent random clusterings with equal cluster number - -n_samples = 100 -n_clusters_range = np.linspace(2, n_samples, 10).astype(np.int) - -plt.figure(1) - -plots = [] -names = [] -for score_func in score_funcs: - print("Computing %s for %d values of n_clusters and n_samples=%d" - % (score_func.__name__, len(n_clusters_range), n_samples)) - - t0 = time() - scores = uniform_labelings_scores(score_func, n_samples, n_clusters_range) - print("done in %0.3fs" % (time() - t0)) - plots.append(plt.errorbar( - n_clusters_range, np.median(scores, axis=1), scores.std(axis=1))[0]) - names.append(score_func.__name__) - -plt.title("Clustering measures for 2 random uniform labelings\n" - "with equal number of clusters") -plt.xlabel('Number of clusters (Number of samples is fixed to %d)' % n_samples) -plt.ylabel('Score value') -plt.legend(plots, names) -plt.ylim(ymin=-0.05, ymax=1.05) - - -# Random labeling with varying n_clusters against ground class labels -# with fixed number of clusters - -n_samples = 1000 -n_clusters_range = np.linspace(2, 100, 10).astype(np.int) -n_classes = 10 - -plt.figure(2) - -plots = [] -names = [] -for score_func in score_funcs: - print("Computing %s for %d values of n_clusters and n_samples=%d" - % (score_func.__name__, len(n_clusters_range), n_samples)) - - t0 = time() - scores = uniform_labelings_scores(score_func, n_samples, n_clusters_range, - fixed_n_classes=n_classes) - print("done in %0.3fs" % (time() - t0)) - plots.append(plt.errorbar( - n_clusters_range, scores.mean(axis=1), scores.std(axis=1))[0]) - names.append(score_func.__name__) - -plt.title("Clustering measures for random uniform labeling\n" - "against reference assignment with %d classes" % n_classes) -plt.xlabel('Number of clusters (Number of samples is fixed to %d)' % n_samples) -plt.ylabel('Score value') -plt.ylim(ymin=-0.05, ymax=1.05) -plt.legend(plots, names) -plt.show() diff --git a/0.15/_downloads/plot_affinity_propagation.py b/0.15/_downloads/plot_affinity_propagation.py deleted file mode 100644 index 0d6c395a4e4bf..0000000000000 --- a/0.15/_downloads/plot_affinity_propagation.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -================================================= -Demo of affinity propagation clustering algorithm -================================================= - -Reference: -Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages -Between Data Points", Science Feb. 2007 - -""" -print(__doc__) - -from sklearn.cluster import AffinityPropagation -from sklearn import metrics -from sklearn.datasets.samples_generator import make_blobs - -############################################################################## -# Generate sample data -centers = [[1, 1], [-1, -1], [1, -1]] -X, labels_true = make_blobs(n_samples=300, centers=centers, cluster_std=0.5, - random_state=0) - -############################################################################## -# Compute Affinity Propagation -af = AffinityPropagation(preference=-50).fit(X) -cluster_centers_indices = af.cluster_centers_indices_ -labels = af.labels_ - -n_clusters_ = len(cluster_centers_indices) - -print('Estimated number of clusters: %d' % n_clusters_) -print("Homogeneity: %0.3f" % metrics.homogeneity_score(labels_true, labels)) -print("Completeness: %0.3f" % metrics.completeness_score(labels_true, labels)) -print("V-measure: %0.3f" % metrics.v_measure_score(labels_true, labels)) -print("Adjusted Rand Index: %0.3f" - % metrics.adjusted_rand_score(labels_true, labels)) -print("Adjusted Mutual Information: %0.3f" - % metrics.adjusted_mutual_info_score(labels_true, labels)) -print("Silhouette Coefficient: %0.3f" - % metrics.silhouette_score(X, labels, metric='sqeuclidean')) - -############################################################################## -# Plot result -import matplotlib.pyplot as plt -from itertools import cycle - -plt.close('all') -plt.figure(1) -plt.clf() - -colors = cycle('bgrcmykbgrcmykbgrcmykbgrcmyk') -for k, col in zip(range(n_clusters_), colors): - class_members = labels == k - cluster_center = X[cluster_centers_indices[k]] - plt.plot(X[class_members, 0], X[class_members, 1], col + '.') - plt.plot(cluster_center[0], cluster_center[1], 'o', markerfacecolor=col, - markeredgecolor='k', markersize=14) - for x in X[class_members]: - plt.plot([cluster_center[0], x[0]], [cluster_center[1], x[1]], col) - -plt.title('Estimated number of clusters: %d' % n_clusters_) -plt.show() diff --git a/0.15/_downloads/plot_agglomerative_clustering.py b/0.15/_downloads/plot_agglomerative_clustering.py deleted file mode 100644 index e14b2c40f7002..0000000000000 --- a/0.15/_downloads/plot_agglomerative_clustering.py +++ /dev/null @@ -1,76 +0,0 @@ -""" -Agglomerative clustering with and without structure -=================================================== - -This example shows the effect of imposing a connectivity graph to capture -local structure in the data. The graph is simply the graph of 20 nearest -neighbors. - -Two consequences of imposing a connectivity can be seen. First clustering -with a connectivity matrix is much faster. - -Second, when using a connectivity matrix, average and complete linkage are -unstable and tend to create a few clusters that grow very quickly. Indeed, -average and complete linkage fight this percolation behavior by considering all -the distances between two clusters when merging them. The connectivity -graph breaks this mechanism. This effect is more pronounced for very -sparse graphs (try decreasing the number of neighbors in -kneighbors_graph) and with complete linkage. In particular, having a very -small number of neighbors in the graph, imposes a geometry that is -close to that of single linkage, which is well known to have this -percolation instability. -""" -# Authors: Gael Varoquaux, Nelle Varoquaux -# License: BSD 3 clause - -import time -import matplotlib.pyplot as plt -import numpy as np - -from sklearn.cluster import AgglomerativeClustering -from sklearn.neighbors import kneighbors_graph - -# Generate sample data -n_samples = 1500 -np.random.seed(0) -t = 1.5 * np.pi * (1 + 3 * np.random.rand(1, n_samples)) -x = t * np.cos(t) -y = t * np.sin(t) - - -X = np.concatenate((x, y)) -X += .7 * np.random.randn(2, n_samples) -X = X.T - -# Create a graph capturing local connectivity. Larger number of neighbors -# will give more homogeneous clusters to the cost of computation -# time. A very large number of neighbors gives more evenly distributed -# cluster sizes, but may not impose the local manifold structure of -# the data -knn_graph = kneighbors_graph(X, 30) - -for connectivity in (None, knn_graph): - for n_clusters in (30, 3): - plt.figure(figsize=(10, 4)) - for index, linkage in enumerate(('average', 'complete', 'ward')): - plt.subplot(1, 3, index + 1) - model = AgglomerativeClustering(linkage=linkage, - connectivity=connectivity, - n_clusters=n_clusters) - t0 = time.time() - model.fit(X) - elapsed_time = time.time() - t0 - plt.scatter(X[:, 0], X[:, 1], c=model.labels_, - cmap=plt.cm.spectral) - plt.title('linkage=%s (time %.2fs)' % (linkage, elapsed_time), - fontdict=dict(verticalalignment='top')) - plt.axis('equal') - plt.axis('off') - - plt.subplots_adjust(bottom=0, top=.89, wspace=0, - left=0, right=1) - plt.suptitle('n_cluster=%i, connectivity=%r' % - (n_clusters, connectivity is not None), size=17) - - -plt.show() diff --git a/0.15/_downloads/plot_agglomerative_clustering_metrics.py b/0.15/_downloads/plot_agglomerative_clustering_metrics.py deleted file mode 100644 index f5cad0f550757..0000000000000 --- a/0.15/_downloads/plot_agglomerative_clustering_metrics.py +++ /dev/null @@ -1,129 +0,0 @@ -""" -Agglomerative clustering with different metrics -=============================================== - -Demonstrates the effect of different metrics on the hierarchical clustering. - -The example is engineered to show the effect of the choice of different -metrics. It is applied to waveforms, which can be seen as -high-dimensional vector. Indeed, the difference between metrics is -usually more pronounced in high dimension (in particular for euclidean -and cityblock). - -We generate data from three groups of waveforms. Two of the waveforms -(waveform 1 and waveform 2) are proportional one to the other. The cosine -distance is invariant to a scaling of the data, as a result, it cannot -distinguish these two waveforms. Thus even with no noise, clustering -using this distance will not separate out waveform 1 and 2. - -We add observation noise to these waveforms. We generate very sparse -noise: only 6% of the time points contain noise. As a result, the -l1 norm of this noise (ie "cityblock" distance) is much smaller than it's -l2 norm ("euclidean" distance). This can be seen on the inter-class -distance matrices: the values on the diagonal, that caracterize the -spread of the class, are much bigger for the Euclidean distance than for -the cityblock distance. - -When we apply clustering to the data, we find that the clustering -reflects what was in the distance matrices. Indeed, for the Euclidean -distance, the classes are ill-separated because of the noise, and thus -the clustering does not separate the waveforms. For the cityblock -distance, the separation is good and the waveform classes are recovered. -Finally, the cosine distance does not separate at all waveform 1 and 2, -thus the clustering puts them in the same cluster. -""" -# Author: Gael Varoquaux -# License: BSD 3-Clause or CC-0 - -import matplotlib.pyplot as plt -import numpy as np - -from sklearn.cluster import AgglomerativeClustering -from sklearn.metrics import pairwise_distances - -np.random.seed(0) - -# Generate waveform data -n_features = 2000 -t = np.pi * np.linspace(0, 1, n_features) - - -def sqr(x): - return np.sign(np.cos(x)) - -X = list() -y = list() -for i, (phi, a) in enumerate([(.5, .15), (.5, .6), (.3, .2)]): - for _ in range(30): - phase_noise = .01 * np.random.normal() - amplitude_noise = .04 * np.random.normal() - additional_noise = 1 - 2 * np.random.rand(n_features) - # Make the noise sparse - additional_noise[np.abs(additional_noise) < .997] = 0 - - X.append(12 * ((a + amplitude_noise) - * (sqr(6 * (t + phi + phase_noise))) - + additional_noise)) - y.append(i) - -X = np.array(X) -y = np.array(y) - -n_clusters = 3 - -labels = ('Waveform 1', 'Waveform 2', 'Waveform 3') - -# Plot the ground-truth labelling -plt.figure() -plt.axes([0, 0, 1, 1]) -for l, c, n in zip(range(n_clusters), 'rgb', - labels): - lines = plt.plot(X[y == l].T, c=c, alpha=.5) - lines[0].set_label(n) - -plt.legend(loc='best') - -plt.axis('tight') -plt.axis('off') -plt.suptitle("Ground truth", size=20) - - -# Plot the distances -for index, metric in enumerate(["cosine", "euclidean", "cityblock"]): - avg_dist = np.zeros((n_clusters, n_clusters)) - plt.figure(figsize=(5, 4.5)) - for i in range(n_clusters): - for j in range(n_clusters): - avg_dist[i, j] = pairwise_distances(X[y == i], X[y == j], - metric=metric).mean() - avg_dist /= avg_dist.max() - for i in range(n_clusters): - for j in range(n_clusters): - plt.text(i, j, '%5.3f' % avg_dist[i, j], - verticalalignment='center', - horizontalalignment='center') - - plt.imshow(avg_dist, interpolation='nearest', cmap=plt.cm.gnuplot2, - vmin=0) - plt.xticks(range(n_clusters), labels, rotation=45) - plt.yticks(range(n_clusters), labels) - plt.colorbar() - plt.suptitle("Interclass %s distances" % metric, size=18) - plt.tight_layout() - - -# Plot clustering results -for index, metric in enumerate(["cosine", "euclidean", "cityblock"]): - model = AgglomerativeClustering(n_clusters=n_clusters, - linkage="average", affinity=metric) - model.fit(X) - plt.figure() - plt.axes([0, 0, 1, 1]) - for l, c in zip(np.arange(model.n_clusters), 'rgbk'): - plt.plot(X[model.labels_ == l].T, c=c, alpha=.5) - plt.axis('tight') - plt.axis('off') - plt.suptitle("AgglomerativeClustering(affinity=%s)" % metric, size=20) - - -plt.show() diff --git a/0.15/_downloads/plot_approximate_nearest_neighbors_hyperparameters.py b/0.15/_downloads/plot_approximate_nearest_neighbors_hyperparameters.py deleted file mode 100644 index 207e4e634c51b..0000000000000 --- a/0.15/_downloads/plot_approximate_nearest_neighbors_hyperparameters.py +++ /dev/null @@ -1,132 +0,0 @@ -""" -================================================= -Hyper-parameters of Approximate Nearest Neighbors -================================================= - -This example demonstrates the behaviour of the -accuracy of the nearest neighbor queries of Locality Sensitive Hashing -Forest as the number of candidates and the number of estimators (trees) -vary. - -In the first plot, accuracy is measured with the number of candidates. Here, -the term "number of candidates" refers to maximum bound for the number of -distinct points retrieved from each tree to calculate the distances. Nearest -neighbors are selected from this pool of candidates. Number of estimators is -maintained at three fixed levels (1, 5, 10). - -In the second plot, the number of candidates is fixed at 50. Number of trees -is varied and the accuracy is plotted against those values. To measure the -accuracy, the true nearest neighbors are required, therefore -:class:`sklearn.neighbors.NearestNeighbors` is used to compute the exact -neighbors. -""" -from __future__ import division -print(__doc__) - -# Author: Maheshakya Wijewardena -# -# License: BSD 3 clause - - -############################################################################### -import numpy as np -from sklearn.datasets.samples_generator import make_blobs -from sklearn.neighbors import LSHForest -from sklearn.neighbors import NearestNeighbors -import matplotlib.pyplot as plt - - -# Initialize size of the database, iterations and required neighbors. -n_samples = 10000 -n_features = 100 -n_queries = 30 -rng = np.random.RandomState(42) - -# Generate sample data -X, _ = make_blobs(n_samples=n_samples + n_queries, - n_features=n_features, centers=10, - random_state=0) -X_index = X[:n_samples] -X_query = X[n_samples:] -# Get exact neighbors -nbrs = NearestNeighbors(n_neighbors=1, algorithm='brute', - metric='cosine').fit(X_index) -neighbors_exact = nbrs.kneighbors(X_query, return_distance=False) - -# Set `n_candidate` values -n_candidates_values = np.linspace(10, 500, 5).astype(np.int) -n_estimators_for_candidate_value = [1, 5, 10] -n_iter = 10 -stds_accuracies = np.zeros((len(n_estimators_for_candidate_value), - n_candidates_values.shape[0]), - dtype=float) -accuracies_c = np.zeros((len(n_estimators_for_candidate_value), - n_candidates_values.shape[0]), dtype=float) - -# LSH Forest is a stochastic index: perform several iteration to estimate -# expected accuracy and standard deviation displayed as error bars in -# the plots -for j, value in enumerate(n_estimators_for_candidate_value): - for i, n_candidates in enumerate(n_candidates_values): - accuracy_c = [] - for seed in range(n_iter): - lshf = LSHForest(n_estimators=value, - n_candidates=n_candidates, n_neighbors=1, - random_state=seed) - # Build the LSH Forest index - lshf.fit(X_index) - # Get neighbors - neighbors_approx = lshf.kneighbors(X_query, - return_distance=False) - accuracy_c.append(np.sum(np.equal(neighbors_approx, - neighbors_exact)) / - n_queries) - - stds_accuracies[j, i] = np.std(accuracy_c) - accuracies_c[j, i] = np.mean(accuracy_c) - -# Set `n_estimators` values -n_estimators_values = [1, 5, 10, 20, 30, 40, 50] -accuracies_trees = np.zeros(len(n_estimators_values), dtype=float) - -# Calculate average accuracy for each value of `n_estimators` -for i, n_estimators in enumerate(n_estimators_values): - lshf = LSHForest(n_estimators=n_estimators, n_neighbors=1) - # Build the LSH Forest index - lshf.fit(X_index) - # Get neighbors - neighbors_approx = lshf.kneighbors(X_query, return_distance=False) - accuracies_trees[i] = np.sum(np.equal(neighbors_approx, - neighbors_exact))/n_queries - -############################################################################### -# Plot the accuracy variation with `n_candidates` -plt.figure() -colors = ['c', 'm', 'y'] -for i, n_estimators in enumerate(n_estimators_for_candidate_value): - label = 'n_estimators = %d ' % n_estimators - plt.plot(n_candidates_values, accuracies_c[i, :], - 'o-', c=colors[i], label=label) - plt.errorbar(n_candidates_values, accuracies_c[i, :], - stds_accuracies[i, :], c=colors[i]) - -plt.legend(loc='upper left', fontsize='small') -plt.ylim([0, 1.2]) -plt.xlim(min(n_candidates_values), max(n_candidates_values)) -plt.ylabel("Accuracy") -plt.xlabel("n_candidates") -plt.grid(which='both') -plt.title("Accuracy variation with n_candidates") - -# Plot the accuracy variation with `n_estimators` -plt.figure() -plt.scatter(n_estimators_values, accuracies_trees, c='k') -plt.plot(n_estimators_values, accuracies_trees, c='g') -plt.ylim([0, 1.2]) -plt.xlim(min(n_estimators_values), max(n_estimators_values)) -plt.ylabel("Accuracy") -plt.xlabel("n_estimators") -plt.grid(which='both') -plt.title("Accuracy variation with n_estimators") - -plt.show() diff --git a/0.15/_downloads/plot_approximate_nearest_neighbors_scalability.py b/0.15/_downloads/plot_approximate_nearest_neighbors_scalability.py deleted file mode 100644 index 00d8d8c91729e..0000000000000 --- a/0.15/_downloads/plot_approximate_nearest_neighbors_scalability.py +++ /dev/null @@ -1,156 +0,0 @@ -""" -============================================ -Scalability of Approximate Nearest Neighbors -============================================ - -This example studies the scalability profile of approximate 10-neighbors -queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200`` -when varying the number of samples in the dataset. - -The first plot demonstrates the relationship between query time and index size -of LSHForest. Query time is compared with the brute force method in exact -nearest neighbor search for the same index sizes. The brute force queries have a -very predictable linear scalability with the index (full scan). LSHForest index -have sub-linear scalability profile but can be slower for small datasets. - -The second plot shows the speedup when using approximate queries vs brute force -exact queries. The speedup tends to increase with the dataset size but should -reach a plateau typically when doing queries on datasets with millions of -samples and a few hundreds of dimensions. Higher dimensional datasets tends to -benefit more from LSHForest indexing. - -The break even point (speedup = 1) depends on the dimensionality and structure -of the indexed data and the parameters of the LSHForest index. - -The precision of approximate queries should decrease slowly with the dataset -size. The speed of the decrease depends mostly on the LSHForest parameters and -the dimensionality of the data. - -""" -from __future__ import division -print(__doc__) - -# Authors: Maheshakya Wijewardena -# Olivier Grisel -# -# License: BSD 3 clause - - -############################################################################### -import time -import numpy as np -from sklearn.datasets.samples_generator import make_blobs -from sklearn.neighbors import LSHForest -from sklearn.neighbors import NearestNeighbors -import matplotlib.pyplot as plt - -# Parameters of the study -n_samples_min = int(1e3) -n_samples_max = int(1e5) -n_features = 100 -n_centers = 100 -n_queries = 100 -n_steps = 6 -n_iter = 5 - -# Initialize the range of `n_samples` -n_samples_values = np.logspace(np.log10(n_samples_min), - np.log10(n_samples_max), - n_steps).astype(np.int) - -# Generate some structured data -rng = np.random.RandomState(42) -all_data, _ = make_blobs(n_samples=n_samples_max + n_queries, - n_features=n_features, centers=n_centers, shuffle=True, - random_state=0) -queries = all_data[:n_queries] -index_data = all_data[n_queries:] - -# Metrics to collect for the plots -average_times_exact = [] -average_times_approx = [] -std_times_approx = [] -accuracies = [] -std_accuracies = [] -average_speedups = [] -std_speedups = [] - -# Calculate the average query time -for n_samples in n_samples_values: - X = index_data[:n_samples] - # Initialize LSHForest for queries of a single neighbor - lshf = LSHForest(n_estimators=20, n_candidates=200, - n_neighbors=10).fit(X) - nbrs = NearestNeighbors(algorithm='brute', metric='cosine', - n_neighbors=10).fit(X) - time_approx = [] - time_exact = [] - accuracy = [] - - for i in range(n_iter): - # pick one query at random to study query time variability in LSHForest - query = queries[rng.randint(0, n_queries)] - - t0 = time.time() - exact_neighbors = nbrs.kneighbors(query, return_distance=False) - time_exact.append(time.time() - t0) - - t0 = time.time() - approx_neighbors = lshf.kneighbors(query, return_distance=False) - time_approx.append(time.time() - t0) - - accuracy.append(np.in1d(approx_neighbors, exact_neighbors).mean()) - - average_time_exact = np.mean(time_exact) - average_time_approx = np.mean(time_approx) - speedup = np.array(time_exact) / np.array(time_approx) - average_speedup = np.mean(speedup) - mean_accuracy = np.mean(accuracy) - std_accuracy = np.std(accuracy) - print("Index size: %d, exact: %0.3fs, LSHF: %0.3fs, speedup: %0.1f, " - "accuracy: %0.2f +/-%0.2f" % - (n_samples, average_time_exact, average_time_approx, average_speedup, - mean_accuracy, std_accuracy)) - - accuracies.append(mean_accuracy) - std_accuracies.append(std_accuracy) - average_times_exact.append(average_time_exact) - average_times_approx.append(average_time_approx) - std_times_approx.append(np.std(time_approx)) - average_speedups.append(average_speedup) - std_speedups.append(np.std(speedup)) - -# Plot average query time against n_samples -plt.figure() -plt.errorbar(n_samples_values, average_times_approx, yerr=std_times_approx, - fmt='o-', c='r', label='LSHForest') -plt.plot(n_samples_values, average_times_exact, c='b', - label="NearestNeighbors(algorithm='brute', metric='cosine')") -plt.legend(loc='upper left', fontsize='small') -plt.ylim(0, None) -plt.ylabel("Average query time in seconds") -plt.xlabel("n_samples") -plt.grid(which='both') -plt.title("Impact of index size on response time for first " - "nearest neighbors queries") - -# Plot average query speedup versus index size -plt.figure() -plt.errorbar(n_samples_values, average_speedups, yerr=std_speedups, - fmt='o-', c='r') -plt.ylim(0, None) -plt.ylabel("Average speedup") -plt.xlabel("n_samples") -plt.grid(which='both') -plt.title("Speedup of the approximate NN queries vs brute force") - -# Plot average precision versus index size -plt.figure() -plt.errorbar(n_samples_values, accuracies, std_accuracies, fmt='o-', c='c') -plt.ylim(0, 1.1) -plt.ylabel("precision@10") -plt.xlabel("n_samples") -plt.grid(which='both') -plt.title("precision of 10-nearest-neighbors queries with index size") - -plt.show() diff --git a/0.15/_downloads/plot_ard.py b/0.15/_downloads/plot_ard.py deleted file mode 100644 index 7fb2ff787029b..0000000000000 --- a/0.15/_downloads/plot_ard.py +++ /dev/null @@ -1,82 +0,0 @@ -""" -================================================== -Automatic Relevance Determination Regression (ARD) -================================================== - -Fit regression model with Bayesian Ridge Regression. - -See :ref:`bayesian_ridge_regression` for more information on the regressor. - -Compared to the OLS (ordinary least squares) estimator, the coefficient -weights are slightly shifted toward zeros, which stabilises them. - -The histogram of the estimated weights is very peaked, as a sparsity-inducing -prior is implied on the weights. - -The estimation of the model is done by iteratively maximizing the -marginal log-likelihood of the observations. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from scipy import stats - -from sklearn.linear_model import ARDRegression, LinearRegression - -############################################################################### -# Generating simulated data with Gaussian weights - -# Parameters of the example -np.random.seed(0) -n_samples, n_features = 100, 100 -# Create Gaussian data -X = np.random.randn(n_samples, n_features) -# Create weigts with a precision lambda_ of 4. -lambda_ = 4. -w = np.zeros(n_features) -# Only keep 10 weights of interest -relevant_features = np.random.randint(0, n_features, 10) -for i in relevant_features: - w[i] = stats.norm.rvs(loc=0, scale=1. / np.sqrt(lambda_)) -# Create noite with a precision alpha of 50. -alpha_ = 50. -noise = stats.norm.rvs(loc=0, scale=1. / np.sqrt(alpha_), size=n_samples) -# Create the target -y = np.dot(X, w) + noise - -############################################################################### -# Fit the ARD Regression -clf = ARDRegression(compute_score=True) -clf.fit(X, y) - -ols = LinearRegression() -ols.fit(X, y) - -############################################################################### -# Plot the true weights, the estimated weights and the histogram of the -# weights -plt.figure(figsize=(6, 5)) -plt.title("Weights of the model") -plt.plot(clf.coef_, 'b-', label="ARD estimate") -plt.plot(ols.coef_, 'r--', label="OLS estimate") -plt.plot(w, 'g-', label="Ground truth") -plt.xlabel("Features") -plt.ylabel("Values of the weights") -plt.legend(loc=1) - -plt.figure(figsize=(6, 5)) -plt.title("Histogram of the weights") -plt.hist(clf.coef_, bins=n_features, log=True) -plt.plot(clf.coef_[relevant_features], 5 * np.ones(len(relevant_features)), - 'ro', label="Relevant features") -plt.ylabel("Features") -plt.xlabel("Values of the weights") -plt.legend(loc=1) - -plt.figure(figsize=(6, 5)) -plt.title("Marginal log-likelihood") -plt.plot(clf.scores_) -plt.ylabel("Score") -plt.xlabel("Iterations") -plt.show() diff --git a/0.15/_downloads/plot_bayesian_ridge.py b/0.15/_downloads/plot_bayesian_ridge.py deleted file mode 100644 index 1442a143cda65..0000000000000 --- a/0.15/_downloads/plot_bayesian_ridge.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -========================= -Bayesian Ridge Regression -========================= - -Computes a Bayesian Ridge Regression on a synthetic dataset. - -See :ref:`bayesian_ridge_regression` for more information on the regressor. - -Compared to the OLS (ordinary least squares) estimator, the coefficient -weights are slightly shifted toward zeros, which stabilises them. - -As the prior on the weights is a Gaussian prior, the histogram of the -estimated weights is Gaussian. - -The estimation of the model is done by iteratively maximizing the -marginal log-likelihood of the observations. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from scipy import stats - -from sklearn.linear_model import BayesianRidge, LinearRegression - -############################################################################### -# Generating simulated data with Gaussian weigthts -np.random.seed(0) -n_samples, n_features = 100, 100 -X = np.random.randn(n_samples, n_features) # Create Gaussian data -# Create weigts with a precision lambda_ of 4. -lambda_ = 4. -w = np.zeros(n_features) -# Only keep 10 weights of interest -relevant_features = np.random.randint(0, n_features, 10) -for i in relevant_features: - w[i] = stats.norm.rvs(loc=0, scale=1. / np.sqrt(lambda_)) -# Create noise with a precision alpha of 50. -alpha_ = 50. -noise = stats.norm.rvs(loc=0, scale=1. / np.sqrt(alpha_), size=n_samples) -# Create the target -y = np.dot(X, w) + noise - -############################################################################### -# Fit the Bayesian Ridge Regression and an OLS for comparison -clf = BayesianRidge(compute_score=True) -clf.fit(X, y) - -ols = LinearRegression() -ols.fit(X, y) - -############################################################################### -# Plot true weights, estimated weights and histogram of the weights -plt.figure(figsize=(6, 5)) -plt.title("Weights of the model") -plt.plot(clf.coef_, 'b-', label="Bayesian Ridge estimate") -plt.plot(w, 'g-', label="Ground truth") -plt.plot(ols.coef_, 'r--', label="OLS estimate") -plt.xlabel("Features") -plt.ylabel("Values of the weights") -plt.legend(loc="best", prop=dict(size=12)) - -plt.figure(figsize=(6, 5)) -plt.title("Histogram of the weights") -plt.hist(clf.coef_, bins=n_features, log=True) -plt.plot(clf.coef_[relevant_features], 5 * np.ones(len(relevant_features)), - 'ro', label="Relevant features") -plt.ylabel("Features") -plt.xlabel("Values of the weights") -plt.legend(loc="lower left") - -plt.figure(figsize=(6, 5)) -plt.title("Marginal log-likelihood") -plt.plot(clf.scores_) -plt.ylabel("Score") -plt.xlabel("Iterations") -plt.show() diff --git a/0.15/_downloads/plot_bias_variance.py b/0.15/_downloads/plot_bias_variance.py deleted file mode 100644 index 8d88f99df1668..0000000000000 --- a/0.15/_downloads/plot_bias_variance.py +++ /dev/null @@ -1,184 +0,0 @@ -""" -============================================================ -Single estimator versus bagging: bias-variance decomposition -============================================================ - -This example illustrates and compares the bias-variance decomposition of the -expected mean squared error of a single estimator against a bagging ensemble. - -In regression, the expected mean squared error of an estimator can be -decomposed in terms of bias, variance and noise. On average over datasets of -the regression problem, the bias term measures the average amount by which the -predictions of the estimator differ from the predictions of the best possible -estimator for the problem (i.e., the Bayes model). The variance term measures -the variability of the predictions of the estimator when fit over different -instances LS of the problem. Finally, the noise measures the irreducible part -of the error which is due the variability in the data. - -The upper left figure illustrates the predictions (in dark red) of a single -decision tree trained over a random dataset LS (the blue dots) of a toy 1d -regression problem. It also illustrates the predictions (in light red) of other -single decision trees trained over other (and different) randomly drawn -instances LS of the problem. Intuitively, the variance term here corresponds to -the width of the beam of predictions (in light red) of the individual -estimators. The larger the variance, the more sensitive are the predictions for -`x` to small changes in the training set. The bias term corresponds to the -difference between the average prediction of the estimator (in cyan) and the -best possible model (in dark blue). On this problem, we can thus observe that -the bias is quite low (both the cyan and the blue curves are close to each -other) while the variance is large (the red beam is rather wide). - -The lower left figure plots the pointwise decomposition of the expected mean -squared error of a single decision tree. It confirms that the bias term (in -blue) is low while the variance is large (in green). It also illustrates the -noise part of the error which, as expected, appears to be constant and around -`0.01`. - -The right figures correspond to the same plots but using instead a bagging -ensemble of decision trees. In both figures, we can observe that the bias term -is larger than in the previous case. In the upper right figure, the difference -between the average prediction (in cyan) and the best possible model is larger -(e.g., notice the offset around `x=2`). In the lower right figure, the bias -curve is also slightly higher than in the lower left figure. In terms of -variance however, the beam of predictions is narrower, which suggests that the -variance is lower. Indeed, as the lower right figure confirms, the variance -term (in green) is lower than for single decision trees. Overall, the bias- -variance decomposition is therefore no longer the same. The tradeoff is better -for bagging: averaging several decision trees fit on bootstrap copies of the -dataset slightly increases the bias term but allows for a larger reduction of -the variance, which results in a lower overall mean squared error (compare the -red curves int the lower figures). The script output also confirms this -intuition. The total error of the bagging ensemble is lower than the total -error of a single decision tree, and this difference indeed mainly stems from a -reduced variance. - -For further details on bias-variance decomposition, see section 7.3 of [1]_. - -References ----------- - -.. [1] T. Hastie, R. Tibshirani and J. Friedman, - "Elements of Statistical Learning", Springer, 2009. - -""" -print(__doc__) - -# Author: Gilles Louppe -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.ensemble import BaggingRegressor -from sklearn.tree import DecisionTreeRegressor - -# Settings -n_repeat = 50 # Number of iterations for computing expectations -n_train = 50 # Size of the training set -n_test = 1000 # Size of the test set -noise = 0.1 # Standard deviation of the noise -np.random.seed(0) - -# Change this for exploring the bias-variance decomposition of other -# estimators. This should work well for estimators with high variance (e.g., -# decision trees or KNN), but poorly for estimators with low variance (e.g., -# linear models). -estimators = [("Tree", DecisionTreeRegressor()), - ("Bagging(Tree)", BaggingRegressor(DecisionTreeRegressor()))] - -n_estimators = len(estimators) - -# Generate data -def f(x): - x = x.ravel() - - return np.exp(-x ** 2) + 1.5 * np.exp(-(x - 2) ** 2) - -def generate(n_samples, noise, n_repeat=1): - X = np.random.rand(n_samples) * 10 - 5 - X = np.sort(X) - - if n_repeat == 1: - y = f(X) + np.random.normal(0.0, noise, n_samples) - else: - y = np.zeros((n_samples, n_repeat)) - - for i in range(n_repeat): - y[:, i] = f(X) + np.random.normal(0.0, noise, n_samples) - - X = X.reshape((n_samples, 1)) - - return X, y - -X_train = [] -y_train = [] - -for i in range(n_repeat): - X, y = generate(n_samples=n_train, noise=noise) - X_train.append(X) - y_train.append(y) - -X_test, y_test = generate(n_samples=n_test, noise=noise, n_repeat=n_repeat) - -# Loop over estimators to compare -for n, (name, estimator) in enumerate(estimators): - # Compute predictions - y_predict = np.zeros((n_test, n_repeat)) - - for i in range(n_repeat): - estimator.fit(X_train[i], y_train[i]) - y_predict[:, i] = estimator.predict(X_test) - - # Bias^2 + Variance + Noise decomposition of the mean squared error - y_error = np.zeros(n_test) - - for i in range(n_repeat): - for j in range(n_repeat): - y_error += (y_test[:, j] - y_predict[:, i]) ** 2 - - y_error /= (n_repeat * n_repeat) - - y_noise = np.var(y_test, axis=1) - y_bias = (f(X_test) - np.mean(y_predict, axis=1)) ** 2 - y_var = np.var(y_predict, axis=1) - - print("{0}: {1:.4f} (error) = {2:.4f} (bias^2) " - " + {3:.4f} (var) + {4:.4f} (noise)".format(name, - np.mean(y_error), - np.mean(y_bias), - np.mean(y_var), - np.mean(y_noise))) - - # Plot figures - plt.subplot(2, n_estimators, n + 1) - plt.plot(X_test, f(X_test), "b", label="$f(x)$") - plt.plot(X_train[0], y_train[0], ".b", label="LS ~ $y = f(x)+noise$") - - for i in range(n_repeat): - if i == 0: - plt.plot(X_test, y_predict[:, i], "r", label="$\^y(x)$") - else: - plt.plot(X_test, y_predict[:, i], "r", alpha=0.05) - - plt.plot(X_test, np.mean(y_predict, axis=1), "c", - label="$\mathbb{E}_{LS} \^y(x)$") - - plt.xlim([-5, 5]) - plt.title(name) - - if n == 0: - plt.legend(loc="upper left", prop={"size": 11}) - - plt.subplot(2, n_estimators, n_estimators + n + 1) - plt.plot(X_test, y_error, "r", label="$error(x)$") - plt.plot(X_test, y_bias, "b", label="$bias^2(x)$"), - plt.plot(X_test, y_var, "g", label="$variance(x)$"), - plt.plot(X_test, y_noise, "c", label="$noise(x)$") - - plt.xlim([-5, 5]) - plt.ylim([0, 0.1]) - - if n == 0: - plt.legend(loc="upper left", prop={"size": 11}) - -plt.show() diff --git a/0.15/_downloads/plot_birch_vs_minibatchkmeans.py b/0.15/_downloads/plot_birch_vs_minibatchkmeans.py deleted file mode 100644 index b12d6c412b0ad..0000000000000 --- a/0.15/_downloads/plot_birch_vs_minibatchkmeans.py +++ /dev/null @@ -1,103 +0,0 @@ -""" -================================= -Compare BIRCH and MiniBatchKMeans -================================= - -This example compares the timing of Birch (with and without the global -clustering step) and MiniBatchKMeans on a synthetic dataset having -100,000 samples and 2 features generated using make_blobs. - -If ``n_clusters`` is set to None, the data is reduced from 100,000 -samples to a set of 158 clusters. This can be viewed as a preprocessing -step before the final (global) clustering step that further reduces these -158 clusters to 100 clusters. -""" - -# Authors: Manoj Kumar -# License: BSD 3 clause - -print(__doc__) - -from itertools import cycle -from time import time -import numpy as np -import matplotlib.pyplot as plt -import matplotlib.colors as colors - -from sklearn.preprocessing import StandardScaler -from sklearn.cluster import Birch, MiniBatchKMeans -from sklearn.datasets.samples_generator import make_blobs - - -# Generate centers for the blobs so that it forms a 10 X 10 grid. -xx = np.linspace(-22, 22, 10) -yy = np.linspace(-22, 22, 10) -xx, yy = np.meshgrid(xx, yy) -n_centres = np.hstack((np.ravel(xx)[:, np.newaxis], - np.ravel(yy)[:, np.newaxis])) - -# Generate blobs to do a comparison between MiniBatchKMeans and Birch. -X, y = make_blobs(n_samples=100000, centers=n_centres, random_state=0) - - -# Use all colors that matplotlib provides by default. -colors_ = cycle(colors.cnames.keys()) - -fig = plt.figure(figsize=(12, 4)) -fig.subplots_adjust(left=0.04, right=0.98, bottom=0.1, top=0.9) - -# Compute clustering with Birch with and without the final clustering step -# and plot. -birch_models = [Birch(threshold=1.7, n_clusters=None), - Birch(threshold=1.7, n_clusters=100)] -final_step = ['without global clustering', 'with global clustering'] - -for ind, (birch_model, info) in enumerate(zip(birch_models, final_step)): - t = time() - birch_model.fit(X) - time_ = time() - t - print("Birch %s as the final step took %0.2f seconds" % ( - info, (time() - t))) - - # Plot result - labels = birch_model.labels_ - centroids = birch_model.subcluster_centers_ - n_clusters = np.unique(labels).size - print("n_clusters : %d" % n_clusters) - - ax = fig.add_subplot(1, 3, ind + 1) - for this_centroid, k, col in zip(centroids, range(n_clusters), colors_): - mask = labels == k - ax.plot(X[mask, 0], X[mask, 1], 'w', - markerfacecolor=col, marker='.') - if birch_model.n_clusters is None: - ax.plot(this_centroid[0], this_centroid[1], '+', markerfacecolor=col, - markeredgecolor='k', markersize=5) - ax.set_ylim([-25, 25]) - ax.set_xlim([-25, 25]) - ax.set_autoscaley_on(False) - ax.set_title('Birch %s' % info) - -# Compute clustering with MiniBatchKMeans. -mbk = MiniBatchKMeans(init='k-means++', n_clusters=100, batch_size=100, - n_init=10, max_no_improvement=10, verbose=0, - random_state=0) -t0 = time() -mbk.fit(X) -t_mini_batch = time() - t0 -print("Time taken to run MiniBatchKMeans %0.2f seconds" % t_mini_batch) -mbk_means_labels_unique = np.unique(mbk.labels_) - -ax = fig.add_subplot(1, 3, 3) -for this_centroid, k, col in zip(mbk.cluster_centers_, - range(n_clusters), colors_): - mask = mbk.labels_ == k - ax.plot(X[mask, 0], X[mask, 1], 'w', markerfacecolor=col, marker='.') - ax.plot(this_centroid[0], this_centroid[1], '+', markeredgecolor='k', - markersize=5) -ax.set_xlim([-25, 25]) -ax.set_ylim([-25, 25]) -ax.set_title("MiniBatchKMeans") -ax.set_autoscaley_on(False) -plt.show() diff --git a/0.15/_downloads/plot_calibration.py b/0.15/_downloads/plot_calibration.py deleted file mode 100644 index 2267f02dd0022..0000000000000 --- a/0.15/_downloads/plot_calibration.py +++ /dev/null @@ -1,116 +0,0 @@ -""" -====================================== -Probability calibration of classifiers -====================================== - -When performing classification you often want to predict not only -the class label, but also the associated probability. This probability -gives you some kind of confidence on the prediction. However, not all -classifiers provide well-calibrated probabilities, some being over-confident -while others being under-confident. Thus, a separate calibration of predicted -probabilities is often desirable as a postprocessing. This example illustrates -two different methods for this calibration and evaluates the quality of the -returned probabilities using Brier's score -(see http://en.wikipedia.org/wiki/Brier_score). - -Compared are the estimated probability using a Gaussian naive Bayes classifier -without calibration, with a sigmoid calibration, and with a non-parametric -isotonic calibration. One can observe that only the non-parametric model is able -to provide a probability calibration that returns probabilities close to the -expected 0.5 for most of the samples belonging to the middle cluster with -heterogeneous labels. This results in a significantly improved Brier score. -""" -print(__doc__) - -# Author: Mathieu Blondel -# Alexandre Gramfort -# Balazs Kegl -# Jan Hendrik Metzen -# License: BSD Style. - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib import cm - -from sklearn.datasets import make_blobs -from sklearn.naive_bayes import GaussianNB -from sklearn.metrics import brier_score_loss -from sklearn.calibration import CalibratedClassifierCV -from sklearn.cross_validation import train_test_split - - -n_samples = 50000 -n_bins = 3 # use 3 bins for calibration_curve as we have 3 clusters here - -# Generate 3 blobs with 2 classes where the second blob contains -# half positive samples and half negative samples. Probability in this -# blob is therefore 0.5. -centers = [(-5, -5), (0, 0), (5, 5)] -X, y = make_blobs(n_samples=n_samples, n_features=2, cluster_std=1.0, - centers=centers, shuffle=False, random_state=42) - -y[:n_samples // 2] = 0 -y[n_samples // 2:] = 1 -sample_weight = np.random.RandomState(42).rand(y.shape[0]) - -# split train, test for calibration -X_train, X_test, y_train, y_test, sw_train, sw_test = \ - train_test_split(X, y, sample_weight, test_size=0.9, random_state=42) - -# Gaussian Naive-Bayes with no calibration -clf = GaussianNB() -clf.fit(X_train, y_train) # GaussianNB itself does not support sample-weights -prob_pos_clf = clf.predict_proba(X_test)[:, 1] - -# Gaussian Naive-Bayes with isotonic calibration -clf_isotonic = CalibratedClassifierCV(clf, cv=2, method='isotonic') -clf_isotonic.fit(X_train, y_train, sw_train) -prob_pos_isotonic = clf_isotonic.predict_proba(X_test)[:, 1] - -# Gaussian Naive-Bayes with sigmoid calibration -clf_sigmoid = CalibratedClassifierCV(clf, cv=2, method='sigmoid') -clf_sigmoid.fit(X_train, y_train, sw_train) -prob_pos_sigmoid = clf_sigmoid.predict_proba(X_test)[:, 1] - -print("Brier scores: (the smaller the better)") - -clf_score = brier_score_loss(y_test, prob_pos_clf, sw_test) -print("No calibration: %1.3f" % clf_score) - -clf_isotonic_score = brier_score_loss(y_test, prob_pos_isotonic, sw_test) -print("With isotonic calibration: %1.3f" % clf_isotonic_score) - -clf_sigmoid_score = brier_score_loss(y_test, prob_pos_sigmoid, sw_test) -print("With sigmoid calibration: %1.3f" % clf_sigmoid_score) - -############################################################################### -# Plot the data and the predicted probabilities -plt.figure() -y_unique = np.unique(y) -colors = cm.rainbow(np.linspace(0.0, 1.0, y_unique.size)) -for this_y, color in zip(y_unique, colors): - this_X = X_train[y_train == this_y] - this_sw = sw_train[y_train == this_y] - plt.scatter(this_X[:, 0], this_X[:, 1], s=this_sw * 50, c=color, alpha=0.5, - label="Class %s" % this_y) -plt.legend(loc="best") -plt.title("Data") - -plt.figure() -order = np.lexsort((prob_pos_clf, )) -plt.plot(prob_pos_clf[order], 'r', label='No calibration (%1.3f)' % clf_score) -plt.plot(prob_pos_isotonic[order], 'g', linewidth=3, - label='Isotonic calibration (%1.3f)' % clf_isotonic_score) -plt.plot(prob_pos_sigmoid[order], 'b', linewidth=3, - label='Sigmoid calibration (%1.3f)' % clf_sigmoid_score) -plt.plot(np.linspace(0, y_test.size, 51)[1::2], - y_test[order].reshape(25, -1).mean(1), - 'k', linewidth=3, label=r'Empirical') -plt.ylim([-0.05, 1.05]) -plt.xlabel("Instances sorted according to predicted probability " - "(uncalibrated GNB)") -plt.ylabel("P(y=1)") -plt.legend(loc="upper left") -plt.title("Gaussian naive Bayes probabilities") - -plt.show() diff --git a/0.15/_downloads/plot_calibration_curve.py b/0.15/_downloads/plot_calibration_curve.py deleted file mode 100644 index 42dc8473e6c30..0000000000000 --- a/0.15/_downloads/plot_calibration_curve.py +++ /dev/null @@ -1,134 +0,0 @@ -""" -============================== -Probability Calibration curves -============================== - -When performing classification one often wants to predict not only the class -label, but also the associated probability. This probability gives some -kind of confidence on the prediction. This example demonstrates how to display -how well calibrated the predicted probabilities are and how to calibrate an -uncalibrated classifier. - -The experiment is performed on an artificial dataset for binary classification -with 100.000 samples (1.000 of them are used for model fitting) with 20 -features. Of the 20 features, only 2 are informative and 10 are redundant. The -first figure shows the estimated probabilities obtained with logistic -regression, Gaussian naive Bayes, and Gaussian naive Bayes with both isotonic -calibration and sigmoid calibration. The calibration performance is evaluated -with Brier score, reported in the legend (the smaller the better). One can -observe here that logistic regression is well calibrated while raw Gaussian -naive Bayes performs very badly. This is because of the redundant features -which violate the assumption of feature-independence and result in an overly -confident classifier, which is indicated by the typical transposed-sigmoid -curve. - -Calibration of the probabilities of Gaussian naive Bayes with isotonic -regression can fix this issue as can be seen from the nearly diagonal -calibration curve. Sigmoid calibration also improves the brier score slightly, -albeit not as strongly as the non-parametric isotonic regression. This can be -attributed to the fact that we have plenty of calibration data such that the -greater flexibility of the non-parametric model can be exploited. - -The second figure shows the calibration curve of a linear support-vector -classifier (LinearSVC). LinearSVC shows the opposite behavior as Gaussian -naive Bayes: the calibration curve has a sigmoid curve, which is typical for -an under-confident classifier. In the case of LinearSVC, this is caused by the -margin property of the hinge loss, which lets the model focus on hard samples -that are close to the decision boundary (the support vectors). - -Both kinds of calibration can fix this issue and yield nearly identical -results. This shows that sigmoid calibration can deal with situations where -the calibration curve of the base classifier is sigmoid (e.g., for LinearSVC) -but not where it is transposed-sigmoid (e.g., Gaussian naive Bayes). -""" -print(__doc__) - -# Author: Alexandre Gramfort -# Jan Hendrik Metzen -# License: BSD Style. - -import matplotlib.pyplot as plt - -from sklearn import datasets -from sklearn.naive_bayes import GaussianNB -from sklearn.svm import LinearSVC -from sklearn.linear_model import LogisticRegression -from sklearn.metrics import (brier_score_loss, precision_score, recall_score, - f1_score) -from sklearn.calibration import CalibratedClassifierCV, calibration_curve -from sklearn.cross_validation import train_test_split - - -# Create dataset of classification task with many redundant and few -# informative features -X, y = datasets.make_classification(n_samples=100000, n_features=20, - n_informative=2, n_redundant=10, - random_state=42) - -X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.99, - random_state=42) - - -def plot_calibration_curve(est, name, fig_index): - """Plot calibration curve for est w/o and with calibration. """ - # Calibrated with isotonic calibration - isotonic = CalibratedClassifierCV(est, cv=2, method='isotonic') - - # Calibrated with sigmoid calibration - sigmoid = CalibratedClassifierCV(est, cv=2, method='sigmoid') - - # Logistic regression with no calibration as baseline - lr = LogisticRegression(C=1., solver='lbfgs') - - fig = plt.figure(fig_index, figsize=(10, 10)) - ax1 = plt.subplot2grid((3, 1), (0, 0), rowspan=2) - ax2 = plt.subplot2grid((3, 1), (2, 0)) - - ax1.plot([0, 1], [0, 1], "k:", label="Perfectly calibrated") - for clf, name in [(lr, 'Logistic'), - (est, name), - (isotonic, name + ' + Isotonic'), - (sigmoid, name + ' + Sigmoid')]: - clf.fit(X_train, y_train) - y_pred = clf.predict(X_test) - if hasattr(clf, "predict_proba"): - prob_pos = clf.predict_proba(X_test)[:, 1] - else: # use decision function - prob_pos = clf.decision_function(X_test) - prob_pos = \ - (prob_pos - prob_pos.min()) / (prob_pos.max() - prob_pos.min()) - - clf_score = brier_score_loss(y_test, prob_pos, pos_label=y.max()) - print("%s:" % name) - print("\tBrier: %1.3f" % (clf_score)) - print("\tPrecision: %1.3f" % precision_score(y_test, y_pred)) - print("\tRecall: %1.3f" % recall_score(y_test, y_pred)) - print("\tF1: %1.3f\n" % f1_score(y_test, y_pred)) - - fraction_of_positives, mean_predicted_value = \ - calibration_curve(y_test, prob_pos, n_bins=10) - - ax1.plot(mean_predicted_value, fraction_of_positives, "s-", - label="%s (%1.3f)" % (name, clf_score)) - - ax2.hist(prob_pos, range=(0, 1), bins=10, label=name, - histtype="step", lw=2) - - ax1.set_ylabel("Fraction of positives") - ax1.set_ylim([-0.05, 1.05]) - ax1.legend(loc="lower right") - ax1.set_title('Calibration plots (reliability curve)') - - ax2.set_xlabel("Mean predicted value") - ax2.set_ylabel("Count") - ax2.legend(loc="upper center", ncol=2) - - plt.tight_layout() - -# Plot calibration cuve for Gaussian Naive Bayes -plot_calibration_curve(GaussianNB(), "Naive Bayes", 1) - -# Plot calibration cuve for Linear SVC -plot_calibration_curve(LinearSVC(), "SVC", 2) - -plt.show() diff --git a/0.15/_downloads/plot_calibration_multiclass.py b/0.15/_downloads/plot_calibration_multiclass.py deleted file mode 100644 index 7843b84fa35cb..0000000000000 --- a/0.15/_downloads/plot_calibration_multiclass.py +++ /dev/null @@ -1,168 +0,0 @@ -""" -================================================== -Probability Calibration for 3-class classification -================================================== - -This example illustrates how sigmoid calibration changes predicted -probabilities for a 3-class classification problem. Illustrated is the -standard 2-simplex, where the three corners correspond to the three classes. -Arrows point from the probability vectors predicted by an uncalibrated -classifier to the probability vectors predicted by the same classifier after -sigmoid calibration on a hold-out validation set. Colors indicate the true -class of an instance (red: class 1, green: class 2, blue: class 3). - -The base classifier is a random forest classifier with 25 base estimators -(trees). If this classifier is trained on all 800 training datapoints, it is -overly confident in its predictions and thus incurs a large log-loss. -Calibrating an identical classifier, which was trained on 600 datapoints, with -method='sigmoid' on the remaining 200 datapoints reduces the confidence of the -predictions, i.e., moves the probability vectors from the edges of the simplex -towards the center. This calibration results in a lower log-loss. Note that an -alternative would have been to increase the number of base estimators which -would have resulted in a similar decrease in log-loss. -""" -print(__doc__) - -# Author: Jan Hendrik Metzen -# License: BSD Style. - - -import matplotlib.pyplot as plt - -import numpy as np - -from sklearn.datasets import make_blobs -from sklearn.ensemble import RandomForestClassifier -from sklearn.calibration import CalibratedClassifierCV -from sklearn.metrics import log_loss - -np.random.seed(0) - -# Generate data -X, y = make_blobs(n_samples=1000, n_features=2, random_state=42, - cluster_std=5.0) -X_train, y_train = X[:600], y[:600] -X_valid, y_valid = X[600:800], y[600:800] -X_train_valid, y_train_valid = X[:800], y[:800] -X_test, y_test = X[800:], y[800:] - -# Train uncalibrated random forest classifier on whole train and validation -# data and evaluate on test data -clf = RandomForestClassifier(n_estimators=25) -clf.fit(X_train_valid, y_train_valid) -clf_probs = clf.predict_proba(X_test) -score = log_loss(y_test, clf_probs) - -# Train random forest classifier, calibrate on validation data and evaluate -# on test data -clf = RandomForestClassifier(n_estimators=25) -clf.fit(X_train, y_train) -clf_probs = clf.predict_proba(X_test) -sig_clf = CalibratedClassifierCV(clf, method="sigmoid", cv="prefit") -sig_clf.fit(X_valid, y_valid) -sig_clf_probs = sig_clf.predict_proba(X_test) -sig_score = log_loss(y_test, sig_clf_probs) - -# Plot changes in predicted probabilities via arrows -plt.figure(0) -colors = ["r", "g", "b"] -for i in range(clf_probs.shape[0]): - plt.arrow(clf_probs[i, 0], clf_probs[i, 1], - sig_clf_probs[i, 0] - clf_probs[i, 0], - sig_clf_probs[i, 1] - clf_probs[i, 1], - color=colors[y_test[i]], head_width=1e-2) - -# Plot perfect predictions -plt.plot([1.0], [0.0], 'ro', ms=20, label="Class 1") -plt.plot([0.0], [1.0], 'go', ms=20, label="Class 2") -plt.plot([0.0], [0.0], 'bo', ms=20, label="Class 3") - -# Plot boundaries of unit simplex -plt.plot([0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], 'k', label="Simplex") - -# Annotate points on the simplex -plt.annotate(r'($\frac{1}{3}$, $\frac{1}{3}$, $\frac{1}{3}$)', - xy=(1.0/3, 1.0/3), xytext=(1.0/3, .23), xycoords='data', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='center', verticalalignment='center') -plt.plot([1.0/3], [1.0/3], 'ko', ms=5) -plt.annotate(r'($\frac{1}{2}$, $0$, $\frac{1}{2}$)', - xy=(.5, .0), xytext=(.5, .1), xycoords='data', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='center', verticalalignment='center') -plt.annotate(r'($0$, $\frac{1}{2}$, $\frac{1}{2}$)', - xy=(.0, .5), xytext=(.1, .5), xycoords='data', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='center', verticalalignment='center') -plt.annotate(r'($\frac{1}{2}$, $\frac{1}{2}$, $0$)', - xy=(.5, .5), xytext=(.6, .6), xycoords='data', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='center', verticalalignment='center') -plt.annotate(r'($0$, $0$, $1$)', - xy=(0, 0), xytext=(.1, .1), xycoords='data', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='center', verticalalignment='center') -plt.annotate(r'($1$, $0$, $0$)', - xy=(1, 0), xytext=(1, .1), xycoords='data', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='center', verticalalignment='center') -plt.annotate(r'($0$, $1$, $0$)', - xy=(0, 1), xytext=(.1, 1), xycoords='data', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='center', verticalalignment='center') -# Add grid -plt.grid("off") -for x in [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]: - plt.plot([0, x], [x, 0], 'k', alpha=0.2) - plt.plot([0, 0 + (1-x)/2], [x, x + (1-x)/2], 'k', alpha=0.2) - plt.plot([x, x + (1-x)/2], [0, 0 + (1-x)/2], 'k', alpha=0.2) - -plt.title("Change of predicted probabilities after sigmoid calibration") -plt.xlabel("Probability class 1") -plt.ylabel("Probability class 2") -plt.xlim(-0.05, 1.05) -plt.ylim(-0.05, 1.05) -plt.legend(loc="best") - -print("Log-loss of") -print(" * uncalibrated classifier trained on 800 datapoints: %.3f " - % score) -print(" * classifier trained on 600 datapoints and calibrated on " - "200 datapoint: %.3f" % sig_score) - -# Illustrate calibrator -plt.figure(1) -# generate grid over 2-simplex -p1d = np.linspace(0, 1, 20) -p0, p1 = np.meshgrid(p1d, p1d) -p2 = 1 - p0 - p1 -p = np.c_[p0.ravel(), p1.ravel(), p2.ravel()] -p = p[p[:, 2] >= 0] - -calibrated_classifier = sig_clf.calibrated_classifiers_[0] -prediction = np.vstack([calibrator.predict(this_p) - for calibrator, this_p in - zip(calibrated_classifier.calibrators_, p.T)]).T -prediction /= prediction.sum(axis=1)[:, None] - -# Ploit modifications of calibrator -for i in range(prediction.shape[0]): - plt.arrow(p[i, 0], p[i, 1], - prediction[i, 0] - p[i, 0], prediction[i, 1] - p[i, 1], - head_width=1e-2, color=colors[np.argmax(p[i])]) -# Plot boundaries of unit simplex -plt.plot([0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], 'k', label="Simplex") - -plt.grid("off") -for x in [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]: - plt.plot([0, x], [x, 0], 'k', alpha=0.2) - plt.plot([0, 0 + (1-x)/2], [x, x + (1-x)/2], 'k', alpha=0.2) - plt.plot([x, x + (1-x)/2], [0, 0 + (1-x)/2], 'k', alpha=0.2) - -plt.title("Illustration of sigmoid calibrator") -plt.xlabel("Probability class 1") -plt.ylabel("Probability class 2") -plt.xlim(-0.05, 1.05) -plt.ylim(-0.05, 1.05) - -plt.show() diff --git a/0.15/_downloads/plot_classification.py b/0.15/_downloads/plot_classification.py deleted file mode 100644 index 9bd7c92f51117..0000000000000 --- a/0.15/_downloads/plot_classification.py +++ /dev/null @@ -1,55 +0,0 @@ -""" -================================ -Nearest Neighbors Classification -================================ - -Sample usage of Nearest Neighbors classification. -It will plot the decision boundaries for each class. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.colors import ListedColormap -from sklearn import neighbors, datasets - -n_neighbors = 15 - -# import some data to play with -iris = datasets.load_iris() -X = iris.data[:, :2] # we only take the first two features. We could - # avoid this ugly slicing by using a two-dim dataset -y = iris.target - -h = .02 # step size in the mesh - -# Create color maps -cmap_light = ListedColormap(['#FFAAAA', '#AAFFAA', '#AAAAFF']) -cmap_bold = ListedColormap(['#FF0000', '#00FF00', '#0000FF']) - -for weights in ['uniform', 'distance']: - # we create an instance of Neighbours Classifier and fit the data. - clf = neighbors.KNeighborsClassifier(n_neighbors, weights=weights) - clf.fit(X, y) - - # Plot the decision boundary. For that, we will assign a color to each - # point in the mesh [x_min, m_max]x[y_min, y_max]. - x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 - y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 - xx, yy = np.meshgrid(np.arange(x_min, x_max, h), - np.arange(y_min, y_max, h)) - Z = clf.predict(np.c_[xx.ravel(), yy.ravel()]) - - # Put the result into a color plot - Z = Z.reshape(xx.shape) - plt.figure() - plt.pcolormesh(xx, yy, Z, cmap=cmap_light) - - # Plot also the training points - plt.scatter(X[:, 0], X[:, 1], c=y, cmap=cmap_bold) - plt.xlim(xx.min(), xx.max()) - plt.ylim(yy.min(), yy.max()) - plt.title("3-Class classification (k = %i, weights = '%s')" - % (n_neighbors, weights)) - -plt.show() diff --git a/0.15/_downloads/plot_classification_probability.py b/0.15/_downloads/plot_classification_probability.py deleted file mode 100644 index 1b768535e4391..0000000000000 --- a/0.15/_downloads/plot_classification_probability.py +++ /dev/null @@ -1,81 +0,0 @@ -""" -=============================== -Plot classification probability -=============================== - -Plot the classification probability for different classifiers. We use a 3 -class dataset, and we classify it with a Support Vector classifier, L1 -and L2 penalized logistic regression with either a One-Vs-Rest or multinomial -setting. - -The logistic regression is not a multiclass classifier out of the box. As -a result it can identify only the first class. -""" -print(__doc__) - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -import matplotlib.pyplot as plt -import numpy as np - -from sklearn.linear_model import LogisticRegression -from sklearn.svm import SVC -from sklearn import datasets - -iris = datasets.load_iris() -X = iris.data[:, 0:2] # we only take the first two features for visualization -y = iris.target - -n_features = X.shape[1] - -C = 1.0 - -# Create different classifiers. The logistic regression cannot do -# multiclass out of the box. -classifiers = {'L1 logistic': LogisticRegression(C=C, penalty='l1'), - 'L2 logistic (OvR)': LogisticRegression(C=C, penalty='l2'), - 'Linear SVC': SVC(kernel='linear', C=C, probability=True, - random_state=0), - 'L2 logistic (Multinomial)': LogisticRegression( - C=C, solver='lbfgs', multi_class='multinomial' - )} - -n_classifiers = len(classifiers) - -plt.figure(figsize=(3 * 2, n_classifiers * 2)) -plt.subplots_adjust(bottom=.2, top=.95) - -xx = np.linspace(3, 9, 100) -yy = np.linspace(1, 5, 100).T -xx, yy = np.meshgrid(xx, yy) -Xfull = np.c_[xx.ravel(), yy.ravel()] - -for index, (name, classifier) in enumerate(classifiers.items()): - classifier.fit(X, y) - - y_pred = classifier.predict(X) - classif_rate = np.mean(y_pred.ravel() == y.ravel()) * 100 - print("classif_rate for %s : %f " % (name, classif_rate)) - - # View probabilities= - probas = classifier.predict_proba(Xfull) - n_classes = np.unique(y_pred).size - for k in range(n_classes): - plt.subplot(n_classifiers, n_classes, index * n_classes + k + 1) - plt.title("Class %d" % k) - if k == 0: - plt.ylabel(name) - imshow_handle = plt.imshow(probas[:, k].reshape((100, 100)), - extent=(3, 9, 1, 5), origin='lower') - plt.xticks(()) - plt.yticks(()) - idx = (y_pred == k) - if idx.any(): - plt.scatter(X[idx, 0], X[idx, 1], marker='o', c='k') - -ax = plt.axes([0.15, 0.04, 0.7, 0.05]) -plt.title("Probability") -plt.colorbar(imshow_handle, cax=ax, orientation='horizontal') - -plt.show() diff --git a/0.15/_downloads/plot_classification_probability1.py b/0.15/_downloads/plot_classification_probability1.py deleted file mode 100644 index e63bc1d376099..0000000000000 --- a/0.15/_downloads/plot_classification_probability1.py +++ /dev/null @@ -1,76 +0,0 @@ -""" -=============================== -Plot classification probability -=============================== - -Plot the classification probability for different classifiers. We use a 3 -class dataset, and we classify it with a Support Vector classifier, as -well as L1 and L2 penalized logistic regression. - -The logistic regression is not a multiclass classifier out of the box. As -a result it can identify only the first class. -""" -print(__doc__) - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -import matplotlib.pyplot as plt -import numpy as np - -from sklearn.linear_model import LogisticRegression -from sklearn.svm import SVC -from sklearn import datasets - -iris = datasets.load_iris() -X = iris.data[:, 0:2] # we only take the first two features for visualization -y = iris.target - -n_features = X.shape[1] - -C = 1.0 - -# Create different classifiers. The logistic regression cannot do -# multiclass out of the box. -classifiers = {'L1 logistic': LogisticRegression(C=C, penalty='l1'), - 'L2 logistic': LogisticRegression(C=C, penalty='l2'), - 'Linear SVC': SVC(kernel='linear', C=C, probability=True, - random_state=0)} - -n_classifiers = len(classifiers) - -plt.figure(figsize=(3 * 2, n_classifiers * 2)) -plt.subplots_adjust(bottom=.2, top=.95) - -for index, (name, classifier) in enumerate(classifiers.items()): - classifier.fit(X, y) - - y_pred = classifier.predict(X) - classif_rate = np.mean(y_pred.ravel() == y.ravel()) * 100 - print("classif_rate for %s : %f " % (name, classif_rate)) - - # View probabilities= - xx = np.linspace(3, 9, 100) - yy = np.linspace(1, 5, 100).T - xx, yy = np.meshgrid(xx, yy) - Xfull = np.c_[xx.ravel(), yy.ravel()] - probas = classifier.predict_proba(Xfull) - n_classes = np.unique(y_pred).size - for k in range(n_classes): - plt.subplot(n_classifiers, n_classes, index * n_classes + k + 1) - plt.title("Class %d" % k) - if k == 0: - plt.ylabel(name) - imshow_handle = plt.imshow(probas[:, k].reshape((100, 100)), - extent=(3, 9, 1, 5), origin='lower') - plt.xticks(()) - plt.yticks(()) - idx = (y_pred == k) - if idx.any(): - plt.scatter(X[idx, 0], X[idx, 1], marker='o', c='k') - -ax = plt.axes([0.15, 0.04, 0.7, 0.05]) -plt.title("Probability") -plt.colorbar(imshow_handle, cax=ax, orientation='horizontal') - -plt.show() diff --git a/0.15/_downloads/plot_classifier_comparison.py b/0.15/_downloads/plot_classifier_comparison.py deleted file mode 100644 index 7be3c0cacad9f..0000000000000 --- a/0.15/_downloads/plot_classifier_comparison.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -===================== -Classifier comparison -===================== - -A comparison of a several classifiers in scikit-learn on synthetic datasets. -The point of this example is to illustrate the nature of decision boundaries -of different classifiers. -This should be taken with a grain of salt, as the intuition conveyed by -these examples does not necessarily carry over to real datasets. - -Particularly in high-dimensional spaces, data can more easily be separated -linearly and the simplicity of classifiers such as naive Bayes and linear SVMs -might lead to better generalization than is achieved by other classifiers. - -The plots show training points in solid colors and testing points -semi-transparent. The lower right shows the classification accuracy on the test -set. -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Andreas Müller -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.colors import ListedColormap -from sklearn.cross_validation import train_test_split -from sklearn.preprocessing import StandardScaler -from sklearn.datasets import make_moons, make_circles, make_classification -from sklearn.neighbors import KNeighborsClassifier -from sklearn.svm import SVC -from sklearn.tree import DecisionTreeClassifier -from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier -from sklearn.naive_bayes import GaussianNB -from sklearn.lda import LDA -from sklearn.qda import QDA - -h = .02 # step size in the mesh - -names = ["Nearest Neighbors", "Linear SVM", "RBF SVM", "Decision Tree", - "Random Forest", "AdaBoost", "Naive Bayes", "LDA", "QDA"] -classifiers = [ - KNeighborsClassifier(3), - SVC(kernel="linear", C=0.025), - SVC(gamma=2, C=1), - DecisionTreeClassifier(max_depth=5), - RandomForestClassifier(max_depth=5, n_estimators=10, max_features=1), - AdaBoostClassifier(), - GaussianNB(), - LDA(), - QDA()] - -X, y = make_classification(n_features=2, n_redundant=0, n_informative=2, - random_state=1, n_clusters_per_class=1) -rng = np.random.RandomState(2) -X += 2 * rng.uniform(size=X.shape) -linearly_separable = (X, y) - -datasets = [make_moons(noise=0.3, random_state=0), - make_circles(noise=0.2, factor=0.5, random_state=1), - linearly_separable - ] - -figure = plt.figure(figsize=(27, 9)) -i = 1 -# iterate over datasets -for ds in datasets: - # preprocess dataset, split into training and test part - X, y = ds - X = StandardScaler().fit_transform(X) - X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.4) - - x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5 - y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5 - xx, yy = np.meshgrid(np.arange(x_min, x_max, h), - np.arange(y_min, y_max, h)) - - # just plot the dataset first - cm = plt.cm.RdBu - cm_bright = ListedColormap(['#FF0000', '#0000FF']) - ax = plt.subplot(len(datasets), len(classifiers) + 1, i) - # Plot the training points - ax.scatter(X_train[:, 0], X_train[:, 1], c=y_train, cmap=cm_bright) - # and testing points - ax.scatter(X_test[:, 0], X_test[:, 1], c=y_test, cmap=cm_bright, alpha=0.6) - ax.set_xlim(xx.min(), xx.max()) - ax.set_ylim(yy.min(), yy.max()) - ax.set_xticks(()) - ax.set_yticks(()) - i += 1 - - # iterate over classifiers - for name, clf in zip(names, classifiers): - ax = plt.subplot(len(datasets), len(classifiers) + 1, i) - clf.fit(X_train, y_train) - score = clf.score(X_test, y_test) - - # Plot the decision boundary. For that, we will assign a color to each - # point in the mesh [x_min, m_max]x[y_min, y_max]. - if hasattr(clf, "decision_function"): - Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) - else: - Z = clf.predict_proba(np.c_[xx.ravel(), yy.ravel()])[:, 1] - - # Put the result into a color plot - Z = Z.reshape(xx.shape) - ax.contourf(xx, yy, Z, cmap=cm, alpha=.8) - - # Plot also the training points - ax.scatter(X_train[:, 0], X_train[:, 1], c=y_train, cmap=cm_bright) - # and testing points - ax.scatter(X_test[:, 0], X_test[:, 1], c=y_test, cmap=cm_bright, - alpha=0.6) - - ax.set_xlim(xx.min(), xx.max()) - ax.set_ylim(yy.min(), yy.max()) - ax.set_xticks(()) - ax.set_yticks(()) - ax.set_title(name) - ax.text(xx.max() - .3, yy.min() + .3, ('%.2f' % score).lstrip('0'), - size=15, horizontalalignment='right') - i += 1 - -figure.subplots_adjust(left=.02, right=.98) -plt.show() diff --git a/0.15/_downloads/plot_classifier_comparison1.py b/0.15/_downloads/plot_classifier_comparison1.py deleted file mode 100644 index 7be3c0cacad9f..0000000000000 --- a/0.15/_downloads/plot_classifier_comparison1.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -===================== -Classifier comparison -===================== - -A comparison of a several classifiers in scikit-learn on synthetic datasets. -The point of this example is to illustrate the nature of decision boundaries -of different classifiers. -This should be taken with a grain of salt, as the intuition conveyed by -these examples does not necessarily carry over to real datasets. - -Particularly in high-dimensional spaces, data can more easily be separated -linearly and the simplicity of classifiers such as naive Bayes and linear SVMs -might lead to better generalization than is achieved by other classifiers. - -The plots show training points in solid colors and testing points -semi-transparent. The lower right shows the classification accuracy on the test -set. -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Andreas Müller -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.colors import ListedColormap -from sklearn.cross_validation import train_test_split -from sklearn.preprocessing import StandardScaler -from sklearn.datasets import make_moons, make_circles, make_classification -from sklearn.neighbors import KNeighborsClassifier -from sklearn.svm import SVC -from sklearn.tree import DecisionTreeClassifier -from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier -from sklearn.naive_bayes import GaussianNB -from sklearn.lda import LDA -from sklearn.qda import QDA - -h = .02 # step size in the mesh - -names = ["Nearest Neighbors", "Linear SVM", "RBF SVM", "Decision Tree", - "Random Forest", "AdaBoost", "Naive Bayes", "LDA", "QDA"] -classifiers = [ - KNeighborsClassifier(3), - SVC(kernel="linear", C=0.025), - SVC(gamma=2, C=1), - DecisionTreeClassifier(max_depth=5), - RandomForestClassifier(max_depth=5, n_estimators=10, max_features=1), - AdaBoostClassifier(), - GaussianNB(), - LDA(), - QDA()] - -X, y = make_classification(n_features=2, n_redundant=0, n_informative=2, - random_state=1, n_clusters_per_class=1) -rng = np.random.RandomState(2) -X += 2 * rng.uniform(size=X.shape) -linearly_separable = (X, y) - -datasets = [make_moons(noise=0.3, random_state=0), - make_circles(noise=0.2, factor=0.5, random_state=1), - linearly_separable - ] - -figure = plt.figure(figsize=(27, 9)) -i = 1 -# iterate over datasets -for ds in datasets: - # preprocess dataset, split into training and test part - X, y = ds - X = StandardScaler().fit_transform(X) - X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.4) - - x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5 - y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5 - xx, yy = np.meshgrid(np.arange(x_min, x_max, h), - np.arange(y_min, y_max, h)) - - # just plot the dataset first - cm = plt.cm.RdBu - cm_bright = ListedColormap(['#FF0000', '#0000FF']) - ax = plt.subplot(len(datasets), len(classifiers) + 1, i) - # Plot the training points - ax.scatter(X_train[:, 0], X_train[:, 1], c=y_train, cmap=cm_bright) - # and testing points - ax.scatter(X_test[:, 0], X_test[:, 1], c=y_test, cmap=cm_bright, alpha=0.6) - ax.set_xlim(xx.min(), xx.max()) - ax.set_ylim(yy.min(), yy.max()) - ax.set_xticks(()) - ax.set_yticks(()) - i += 1 - - # iterate over classifiers - for name, clf in zip(names, classifiers): - ax = plt.subplot(len(datasets), len(classifiers) + 1, i) - clf.fit(X_train, y_train) - score = clf.score(X_test, y_test) - - # Plot the decision boundary. For that, we will assign a color to each - # point in the mesh [x_min, m_max]x[y_min, y_max]. - if hasattr(clf, "decision_function"): - Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) - else: - Z = clf.predict_proba(np.c_[xx.ravel(), yy.ravel()])[:, 1] - - # Put the result into a color plot - Z = Z.reshape(xx.shape) - ax.contourf(xx, yy, Z, cmap=cm, alpha=.8) - - # Plot also the training points - ax.scatter(X_train[:, 0], X_train[:, 1], c=y_train, cmap=cm_bright) - # and testing points - ax.scatter(X_test[:, 0], X_test[:, 1], c=y_test, cmap=cm_bright, - alpha=0.6) - - ax.set_xlim(xx.min(), xx.max()) - ax.set_ylim(yy.min(), yy.max()) - ax.set_xticks(()) - ax.set_yticks(()) - ax.set_title(name) - ax.text(xx.max() - .3, yy.min() + .3, ('%.2f' % score).lstrip('0'), - size=15, horizontalalignment='right') - i += 1 - -figure.subplots_adjust(left=.02, right=.98) -plt.show() diff --git a/0.15/_downloads/plot_cluster_comparison.py b/0.15/_downloads/plot_cluster_comparison.py deleted file mode 100644 index b15c28aef2f63..0000000000000 --- a/0.15/_downloads/plot_cluster_comparison.py +++ /dev/null @@ -1,125 +0,0 @@ -""" -========================================================= -Comparing different clustering algorithms on toy datasets -========================================================= - -This example aims at showing characteristics of different -clustering algorithms on datasets that are "interesting" -but still in 2D. The last dataset is an example of a 'null' -situation for clustering: the data is homogeneous, and -there is no good clustering. - -While these examples give some intuition about the algorithms, -this intuition might not apply to very high dimensional data. - -The results could be improved by tweaking the parameters for -each clustering strategy, for instance setting the number of -clusters for the methods that needs this parameter -specified. Note that affinity propagation has a tendency to -create many clusters. Thus in this example its two parameters -(damping and per-point preference) were set to to mitigate this -behavior. -""" -print(__doc__) - -import time - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import cluster, datasets -from sklearn.metrics import euclidean_distances -from sklearn.neighbors import kneighbors_graph -from sklearn.preprocessing import StandardScaler - -np.random.seed(0) - -# Generate datasets. We choose the size big enough to see the scalability -# of the algorithms, but not too big to avoid too long running times -n_samples = 1500 -noisy_circles = datasets.make_circles(n_samples=n_samples, factor=.5, - noise=.05) -noisy_moons = datasets.make_moons(n_samples=n_samples, noise=.05) -blobs = datasets.make_blobs(n_samples=n_samples, random_state=8) -no_structure = np.random.rand(n_samples, 2), None - -colors = np.array([x for x in 'bgrcmykbgrcmykbgrcmykbgrcmyk']) -colors = np.hstack([colors] * 20) - -plt.figure(figsize=(17, 9.5)) -plt.subplots_adjust(left=.001, right=.999, bottom=.001, top=.96, wspace=.05, - hspace=.01) - -plot_num = 1 -for i_dataset, dataset in enumerate([noisy_circles, noisy_moons, blobs, - no_structure]): - X, y = dataset - # normalize dataset for easier parameter selection - X = StandardScaler().fit_transform(X) - - # estimate bandwidth for mean shift - bandwidth = cluster.estimate_bandwidth(X, quantile=0.3) - - # connectivity matrix for structured Ward - connectivity = kneighbors_graph(X, n_neighbors=10) - # make connectivity symmetric - connectivity = 0.5 * (connectivity + connectivity.T) - - # Compute distances - #distances = np.exp(-euclidean_distances(X)) - distances = euclidean_distances(X) - - # create clustering estimators - ms = cluster.MeanShift(bandwidth=bandwidth, bin_seeding=True) - two_means = cluster.MiniBatchKMeans(n_clusters=2) - ward = cluster.AgglomerativeClustering(n_clusters=2, - linkage='ward', connectivity=connectivity) - spectral = cluster.SpectralClustering(n_clusters=2, - eigen_solver='arpack', - affinity="nearest_neighbors") - dbscan = cluster.DBSCAN(eps=.2) - affinity_propagation = cluster.AffinityPropagation(damping=.9, - preference=-200) - - average_linkage = cluster.AgglomerativeClustering(linkage="average", - affinity="cityblock", n_clusters=2, - connectivity=connectivity) - - for name, algorithm in [ - ('MiniBatchKMeans', two_means), - ('AffinityPropagation', affinity_propagation), - ('MeanShift', ms), - ('SpectralClustering', spectral), - ('Ward', ward), - ('AgglomerativeClustering', average_linkage), - ('DBSCAN', dbscan) - ]: - # predict cluster memberships - t0 = time.time() - algorithm.fit(X) - t1 = time.time() - if hasattr(algorithm, 'labels_'): - y_pred = algorithm.labels_.astype(np.int) - else: - y_pred = algorithm.predict(X) - - # plot - plt.subplot(4, 7, plot_num) - if i_dataset == 0: - plt.title(name, size=18) - plt.scatter(X[:, 0], X[:, 1], color=colors[y_pred].tolist(), s=10) - - if hasattr(algorithm, 'cluster_centers_'): - centers = algorithm.cluster_centers_ - center_colors = colors[:len(centers)] - plt.scatter(centers[:, 0], centers[:, 1], s=100, c=center_colors) - plt.xlim(-2, 2) - plt.ylim(-2, 2) - plt.xticks(()) - plt.yticks(()) - plt.text(.99, .01, ('%.2fs' % (t1 - t0)).lstrip('0'), - transform=plt.gca().transAxes, size=15, - horizontalalignment='right') - plot_num += 1 - -plt.show() diff --git a/0.15/_downloads/plot_cluster_iris.py b/0.15/_downloads/plot_cluster_iris.py deleted file mode 100644 index b837d53887f15..0000000000000 --- a/0.15/_downloads/plot_cluster_iris.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -K-means Clustering -========================================================= - -The plots display firstly what a K-means algorithm would yield -using three clusters. It is then shown what the effect of a bad -initialization is on the classification process: -By setting n_init to only 1 (default is 10), the amount of -times that the algorithm will be run with different centroid -seeds is reduced. -The next plot displays what using eight clusters would deliver -and finally the ground truth. - -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from mpl_toolkits.mplot3d import Axes3D - - -from sklearn.cluster import KMeans -from sklearn import datasets - -np.random.seed(5) - -centers = [[1, 1], [-1, -1], [1, -1]] -iris = datasets.load_iris() -X = iris.data -y = iris.target - -estimators = {'k_means_iris_3': KMeans(n_clusters=3), - 'k_means_iris_8': KMeans(n_clusters=8), - 'k_means_iris_bad_init': KMeans(n_clusters=3, n_init=1, - init='random')} - - -fignum = 1 -for name, est in estimators.items(): - fig = plt.figure(fignum, figsize=(4, 3)) - plt.clf() - ax = Axes3D(fig, rect=[0, 0, .95, 1], elev=48, azim=134) - - plt.cla() - est.fit(X) - labels = est.labels_ - - ax.scatter(X[:, 3], X[:, 0], X[:, 2], c=labels.astype(np.float)) - - ax.w_xaxis.set_ticklabels([]) - ax.w_yaxis.set_ticklabels([]) - ax.w_zaxis.set_ticklabels([]) - ax.set_xlabel('Petal width') - ax.set_ylabel('Sepal length') - ax.set_zlabel('Petal length') - fignum = fignum + 1 - -# Plot the ground truth -fig = plt.figure(fignum, figsize=(4, 3)) -plt.clf() -ax = Axes3D(fig, rect=[0, 0, .95, 1], elev=48, azim=134) - -plt.cla() - -for name, label in [('Setosa', 0), - ('Versicolour', 1), - ('Virginica', 2)]: - ax.text3D(X[y == label, 3].mean(), - X[y == label, 0].mean() + 1.5, - X[y == label, 2].mean(), name, - horizontalalignment='center', - bbox=dict(alpha=.5, edgecolor='w', facecolor='w')) -# Reorder the labels to have colors matching the cluster results -y = np.choose(y, [1, 2, 0]).astype(np.float) -ax.scatter(X[:, 3], X[:, 0], X[:, 2], c=y) - -ax.w_xaxis.set_ticklabels([]) -ax.w_yaxis.set_ticklabels([]) -ax.w_zaxis.set_ticklabels([]) -ax.set_xlabel('Petal width') -ax.set_ylabel('Sepal length') -ax.set_zlabel('Petal length') -plt.show() diff --git a/0.15/_downloads/plot_color_quantization.py b/0.15/_downloads/plot_color_quantization.py deleted file mode 100644 index 428e05093eea8..0000000000000 --- a/0.15/_downloads/plot_color_quantization.py +++ /dev/null @@ -1,105 +0,0 @@ -# -*- coding: utf-8 -*- -""" -================================== -Color Quantization using K-Means -================================== - -Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace -(China), reducing the number of colors required to show the image from 96,615 -unique colors to 64, while preserving the overall appearance quality. - -In this example, pixels are represented in a 3D-space and K-means is used to -find 64 color clusters. In the image processing literature, the codebook -obtained from K-means (the cluster centers) is called the color palette. Using -a single byte, up to 256 colors can be addressed, whereas an RGB encoding -requires 3 bytes per pixel. The GIF file format, for example, uses such a -palette. - -For comparison, a quantized image using a random codebook (colors picked up -randomly) is also shown. -""" -# Authors: Robert Layton -# Olivier Grisel -# Mathieu Blondel -# -# License: BSD 3 clause - -print(__doc__) -import numpy as np -import matplotlib.pyplot as plt -from sklearn.cluster import KMeans -from sklearn.metrics import pairwise_distances_argmin -from sklearn.datasets import load_sample_image -from sklearn.utils import shuffle -from time import time - -n_colors = 64 - -# Load the Summer Palace photo -china = load_sample_image("china.jpg") - -# Convert to floats instead of the default 8 bits integer coding. Dividing by -# 255 is important so that plt.imshow behaves works well on float data (need to -# be in the range [0-1] -china = np.array(china, dtype=np.float64) / 255 - -# Load Image and transform to a 2D numpy array. -w, h, d = original_shape = tuple(china.shape) -assert d == 3 -image_array = np.reshape(china, (w * h, d)) - -print("Fitting model on a small sub-sample of the data") -t0 = time() -image_array_sample = shuffle(image_array, random_state=0)[:1000] -kmeans = KMeans(n_clusters=n_colors, random_state=0).fit(image_array_sample) -print("done in %0.3fs." % (time() - t0)) - -# Get labels for all points -print("Predicting color indices on the full image (k-means)") -t0 = time() -labels = kmeans.predict(image_array) -print("done in %0.3fs." % (time() - t0)) - - -codebook_random = shuffle(image_array, random_state=0)[:n_colors + 1] -print("Predicting color indices on the full image (random)") -t0 = time() -labels_random = pairwise_distances_argmin(codebook_random, - image_array, - axis=0) -print("done in %0.3fs." % (time() - t0)) - - -def recreate_image(codebook, labels, w, h): - """Recreate the (compressed) image from the code book & labels""" - d = codebook.shape[1] - image = np.zeros((w, h, d)) - label_idx = 0 - for i in range(w): - for j in range(h): - image[i][j] = codebook[labels[label_idx]] - label_idx += 1 - return image - -# Display all results, alongside original image -plt.figure(1) -plt.clf() -ax = plt.axes([0, 0, 1, 1]) -plt.axis('off') -plt.title('Original image (96,615 colors)') -plt.imshow(china) - -plt.figure(2) -plt.clf() -ax = plt.axes([0, 0, 1, 1]) -plt.axis('off') -plt.title('Quantized image (64 colors, K-Means)') -plt.imshow(recreate_image(kmeans.cluster_centers_, labels, w, h)) - -plt.figure(3) -plt.clf() -ax = plt.axes([0, 0, 1, 1]) -plt.axis('off') -plt.title('Quantized image (64 colors, Random)') -plt.imshow(recreate_image(codebook_random, labels_random, w, h)) -plt.show() diff --git a/0.15/_downloads/plot_compare_calibration.py b/0.15/_downloads/plot_compare_calibration.py deleted file mode 100644 index fb6bcd283e228..0000000000000 --- a/0.15/_downloads/plot_compare_calibration.py +++ /dev/null @@ -1,122 +0,0 @@ -""" -======================================== -Comparison of Calibration of Classifiers -======================================== - -Well calibrated classifiers are probabilistic classifiers for which the output -of the predict_proba method can be directly interpreted as a confidence level. -For instance a well calibrated (binary) classifier should classify the samples -such that among the samples to which it gave a predict_proba value close to -0.8, approx. 80% actually belong to the positive class. - -LogisticRegression returns well calibrated predictions as it directly -optimizes log-loss. In contrast, the other methods return biased probilities, -with different biases per method: - -* GaussianNaiveBayes tends to push probabilties to 0 or 1 (note the counts in - the histograms). This is mainly because it makes the assumption that features - are conditionally independent given the class, which is not the case in this - dataset which contains 2 redundant features. - -* RandomForestClassifier shows the opposite behavior: the histograms show - peaks at approx. 0.2 and 0.9 probability, while probabilities close to 0 or 1 - are very rare. An explanation for this is given by Niculescu-Mizil and Caruana - [1]: "Methods such as bagging and random forests that average predictions from - a base set of models can have difficulty making predictions near 0 and 1 - because variance in the underlying base models will bias predictions that - should be near zero or one away from these values. Because predictions are - restricted to the interval [0,1], errors caused by variance tend to be one- - sided near zero and one. For example, if a model should predict p = 0 for a - case, the only way bagging can achieve this is if all bagged trees predict - zero. If we add noise to the trees that bagging is averaging over, this noise - will cause some trees to predict values larger than 0 for this case, thus - moving the average prediction of the bagged ensemble away from 0. We observe - this effect most strongly with random forests because the base-level trees - trained with random forests have relatively high variance due to feature - subseting." As a result, the calibration curve shows a characteristic sigmoid - shape, indicating that the classifier could trust its "intuition" more and - return probabilties closer to 0 or 1 typically. - -* Support Vector Classification (SVC) shows an even more sigmoid curve as - the RandomForestClassifier, which is typical for maximum-margin methods - (compare Niculescu-Mizil and Caruana [1]), which focus on hard samples - that are close to the decision boundary (the support vectors). - -.. topic:: References: - - .. [1] Predicting Good Probabilities with Supervised Learning, - A. Niculescu-Mizil & R. Caruana, ICML 2005 -""" -print(__doc__) - -# Author: Jan Hendrik Metzen -# License: BSD Style. - -import numpy as np -np.random.seed(0) - -import matplotlib.pyplot as plt - -from sklearn import datasets -from sklearn.naive_bayes import GaussianNB -from sklearn.linear_model import LogisticRegression -from sklearn.ensemble import RandomForestClassifier -from sklearn.svm import LinearSVC -from sklearn.calibration import calibration_curve - -X, y = datasets.make_classification(n_samples=100000, n_features=20, - n_informative=2, n_redundant=2) - -train_samples = 100 # Samples used for training the models - -X_train = X[:train_samples] -X_test = X[train_samples:] -y_train = y[:train_samples] -y_test = y[train_samples:] - -# Create classifiers -lr = LogisticRegression() -gnb = GaussianNB() -svc = LinearSVC(C=1.0) -rfc = RandomForestClassifier(n_estimators=100) - - -############################################################################### -# Plot calibration plots - -plt.figure(figsize=(10, 10)) -ax1 = plt.subplot2grid((3, 1), (0, 0), rowspan=2) -ax2 = plt.subplot2grid((3, 1), (2, 0)) - -ax1.plot([0, 1], [0, 1], "k:", label="Perfectly calibrated") -for clf, name in [(lr, 'Logistic'), - (gnb, 'Naive Bayes'), - (svc, 'Support Vector Classification'), - (rfc, 'Random Forest')]: - clf.fit(X_train, y_train) - if hasattr(clf, "predict_proba"): - prob_pos = clf.predict_proba(X_test)[:, 1] - else: # use decision function - prob_pos = clf.decision_function(X_test) - prob_pos = \ - (prob_pos - prob_pos.min()) / (prob_pos.max() - prob_pos.min()) - fraction_of_positives, mean_predicted_value = \ - calibration_curve(y_test, prob_pos, n_bins=10) - - ax1.plot(mean_predicted_value, fraction_of_positives, "s-", - label="%s" % (name, )) - - ax2.hist(prob_pos, range=(0, 1), bins=10, label=name, - histtype="step", lw=2) - -ax1.set_ylabel("Fraction of positives") -ax1.set_ylim([-0.05, 1.05]) -ax1.legend(loc="lower right") -ax1.set_title('Calibration plots (reliability curve)') - -ax2.set_xlabel("Mean predicted value") -ax2.set_ylabel("Count") -ax2.legend(loc="upper center", ncol=2) - -plt.tight_layout() -plt.show() diff --git a/0.15/_downloads/plot_compare_cross_decomposition.py b/0.15/_downloads/plot_compare_cross_decomposition.py deleted file mode 100644 index f582be9e00048..0000000000000 --- a/0.15/_downloads/plot_compare_cross_decomposition.py +++ /dev/null @@ -1,148 +0,0 @@ -""" -=================================== -Compare cross decomposition methods -=================================== - -Simple usage of various cross decomposition algorithms: -- PLSCanonical -- PLSRegression, with multivariate response, a.k.a. PLS2 -- PLSRegression, with univariate response, a.k.a. PLS1 -- CCA - -Given 2 multivariate covarying two-dimensional datasets, X, and Y, -PLS extracts the 'directions of covariance', i.e. the components of each -datasets that explain the most shared variance between both datasets. -This is apparent on the **scatterplot matrix** display: components 1 in -dataset X and dataset Y are maximally correlated (points lie around the -first diagonal). This is also true for components 2 in both dataset, -however, the correlation across datasets for different components is -weak: the point cloud is very spherical. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn.cross_decomposition import PLSCanonical, PLSRegression, CCA - -############################################################################### -# Dataset based latent variables model - -n = 500 -# 2 latents vars: -l1 = np.random.normal(size=n) -l2 = np.random.normal(size=n) - -latents = np.array([l1, l1, l2, l2]).T -X = latents + np.random.normal(size=4 * n).reshape((n, 4)) -Y = latents + np.random.normal(size=4 * n).reshape((n, 4)) - -X_train = X[:n / 2] -Y_train = Y[:n / 2] -X_test = X[n / 2:] -Y_test = Y[n / 2:] - -print("Corr(X)") -print(np.round(np.corrcoef(X.T), 2)) -print("Corr(Y)") -print(np.round(np.corrcoef(Y.T), 2)) - -############################################################################### -# Canonical (symmetric) PLS - -# Transform data -# ~~~~~~~~~~~~~~ -plsca = PLSCanonical(n_components=2) -plsca.fit(X_train, Y_train) -X_train_r, Y_train_r = plsca.transform(X_train, Y_train) -X_test_r, Y_test_r = plsca.transform(X_test, Y_test) - -# Scatter plot of scores -# ~~~~~~~~~~~~~~~~~~~~~~ -# 1) On diagonal plot X vs Y scores on each components -plt.figure(figsize=(12, 8)) -plt.subplot(221) -plt.plot(X_train_r[:, 0], Y_train_r[:, 0], "ob", label="train") -plt.plot(X_test_r[:, 0], Y_test_r[:, 0], "or", label="test") -plt.xlabel("x scores") -plt.ylabel("y scores") -plt.title('Comp. 1: X vs Y (test corr = %.2f)' % - np.corrcoef(X_test_r[:, 0], Y_test_r[:, 0])[0, 1]) -plt.xticks(()) -plt.yticks(()) -plt.legend(loc="best") - -plt.subplot(224) -plt.plot(X_train_r[:, 1], Y_train_r[:, 1], "ob", label="train") -plt.plot(X_test_r[:, 1], Y_test_r[:, 1], "or", label="test") -plt.xlabel("x scores") -plt.ylabel("y scores") -plt.title('Comp. 2: X vs Y (test corr = %.2f)' % - np.corrcoef(X_test_r[:, 1], Y_test_r[:, 1])[0, 1]) -plt.xticks(()) -plt.yticks(()) -plt.legend(loc="best") - -# 2) Off diagonal plot components 1 vs 2 for X and Y -plt.subplot(222) -plt.plot(X_train_r[:, 0], X_train_r[:, 1], "*b", label="train") -plt.plot(X_test_r[:, 0], X_test_r[:, 1], "*r", label="test") -plt.xlabel("X comp. 1") -plt.ylabel("X comp. 2") -plt.title('X comp. 1 vs X comp. 2 (test corr = %.2f)' - % np.corrcoef(X_test_r[:, 0], X_test_r[:, 1])[0, 1]) -plt.legend(loc="best") -plt.xticks(()) -plt.yticks(()) - -plt.subplot(223) -plt.plot(Y_train_r[:, 0], Y_train_r[:, 1], "*b", label="train") -plt.plot(Y_test_r[:, 0], Y_test_r[:, 1], "*r", label="test") -plt.xlabel("Y comp. 1") -plt.ylabel("Y comp. 2") -plt.title('Y comp. 1 vs Y comp. 2 , (test corr = %.2f)' - % np.corrcoef(Y_test_r[:, 0], Y_test_r[:, 1])[0, 1]) -plt.legend(loc="best") -plt.xticks(()) -plt.yticks(()) -plt.show() - -############################################################################### -# PLS regression, with multivariate response, a.k.a. PLS2 - -n = 1000 -q = 3 -p = 10 -X = np.random.normal(size=n * p).reshape((n, p)) -B = np.array([[1, 2] + [0] * (p - 2)] * q).T -# each Yj = 1*X1 + 2*X2 + noize -Y = np.dot(X, B) + np.random.normal(size=n * q).reshape((n, q)) + 5 - -pls2 = PLSRegression(n_components=3) -pls2.fit(X, Y) -print("True B (such that: Y = XB + Err)") -print(B) -# compare pls2.coefs with B -print("Estimated B") -print(np.round(pls2.coefs, 1)) -pls2.predict(X) - -############################################################################### -# PLS regression, with univariate response, a.k.a. PLS1 - -n = 1000 -p = 10 -X = np.random.normal(size=n * p).reshape((n, p)) -y = X[:, 0] + 2 * X[:, 1] + np.random.normal(size=n * 1) + 5 -pls1 = PLSRegression(n_components=3) -pls1.fit(X, y) -# note that the number of compements exceeds 1 (the dimension of y) -print("Estimated betas") -print(np.round(pls1.coefs, 1)) - -############################################################################### -# CCA (PLS mode B with symmetric deflation) - -cca = CCA(n_components=2) -cca.fit(X_train, Y_train) -X_train_r, Y_train_r = plsca.transform(X_train, Y_train) -X_test_r, Y_test_r = plsca.transform(X_test, Y_test) diff --git a/0.15/_downloads/plot_compare_methods.py b/0.15/_downloads/plot_compare_methods.py deleted file mode 100644 index 08ae4082cc2e0..0000000000000 --- a/0.15/_downloads/plot_compare_methods.py +++ /dev/null @@ -1,123 +0,0 @@ -""" -========================================= - Comparison of Manifold Learning methods -========================================= - -An illustration of dimensionality reduction on the S-curve dataset -with various manifold learning methods. - -For a discussion and comparison of these algorithms, see the -:ref:`manifold module page ` - -For a similar example, where the methods are applied to a -sphere dataset, see :ref:`example_manifold_plot_manifold_sphere.py` - -Note that the purpose of the MDS is to find a low-dimensional -representation of the data (here 2D) in which the distances respect well -the distances in the original high-dimensional space, unlike other -manifold-learning algorithms, it does not seeks an isotropic -representation of the data in the low-dimensional space. -""" - -# Author: Jake Vanderplas -- - -print(__doc__) - -from time import time - -import matplotlib.pyplot as plt -from mpl_toolkits.mplot3d import Axes3D -from matplotlib.ticker import NullFormatter - -from sklearn import manifold, datasets - -# Next line to silence pyflakes. This import is needed. -Axes3D - -n_points = 1000 -X, color = datasets.samples_generator.make_s_curve(n_points, random_state=0) -n_neighbors = 10 -n_components = 2 - -fig = plt.figure(figsize=(15, 8)) -plt.suptitle("Manifold Learning with %i points, %i neighbors" - % (1000, n_neighbors), fontsize=14) - -try: - # compatibility matplotlib < 1.0 - ax = fig.add_subplot(251, projection='3d') - ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=color, cmap=plt.cm.Spectral) - ax.view_init(4, -72) -except: - ax = fig.add_subplot(251, projection='3d') - plt.scatter(X[:, 0], X[:, 2], c=color, cmap=plt.cm.Spectral) - -methods = ['standard', 'ltsa', 'hessian', 'modified'] -labels = ['LLE', 'LTSA', 'Hessian LLE', 'Modified LLE'] - -for i, method in enumerate(methods): - t0 = time() - Y = manifold.LocallyLinearEmbedding(n_neighbors, n_components, - eigen_solver='auto', - method=method).fit_transform(X) - t1 = time() - print("%s: %.2g sec" % (methods[i], t1 - t0)) - - ax = fig.add_subplot(252 + i) - plt.scatter(Y[:, 0], Y[:, 1], c=color, cmap=plt.cm.Spectral) - plt.title("%s (%.2g sec)" % (labels[i], t1 - t0)) - ax.xaxis.set_major_formatter(NullFormatter()) - ax.yaxis.set_major_formatter(NullFormatter()) - plt.axis('tight') - -t0 = time() -Y = manifold.Isomap(n_neighbors, n_components).fit_transform(X) -t1 = time() -print("Isomap: %.2g sec" % (t1 - t0)) -ax = fig.add_subplot(257) -plt.scatter(Y[:, 0], Y[:, 1], c=color, cmap=plt.cm.Spectral) -plt.title("Isomap (%.2g sec)" % (t1 - t0)) -ax.xaxis.set_major_formatter(NullFormatter()) -ax.yaxis.set_major_formatter(NullFormatter()) -plt.axis('tight') - - -t0 = time() -mds = manifold.MDS(n_components, max_iter=100, n_init=1) -Y = mds.fit_transform(X) -t1 = time() -print("MDS: %.2g sec" % (t1 - t0)) -ax = fig.add_subplot(258) -plt.scatter(Y[:, 0], Y[:, 1], c=color, cmap=plt.cm.Spectral) -plt.title("MDS (%.2g sec)" % (t1 - t0)) -ax.xaxis.set_major_formatter(NullFormatter()) -ax.yaxis.set_major_formatter(NullFormatter()) -plt.axis('tight') - - -t0 = time() -se = manifold.SpectralEmbedding(n_components=n_components, - n_neighbors=n_neighbors) -Y = se.fit_transform(X) -t1 = time() -print("SpectralEmbedding: %.2g sec" % (t1 - t0)) -ax = fig.add_subplot(259) -plt.scatter(Y[:, 0], Y[:, 1], c=color, cmap=plt.cm.Spectral) -plt.title("SpectralEmbedding (%.2g sec)" % (t1 - t0)) -ax.xaxis.set_major_formatter(NullFormatter()) -ax.yaxis.set_major_formatter(NullFormatter()) -plt.axis('tight') - -t0 = time() -tsne = manifold.TSNE(n_components=n_components, init='pca', random_state=0) -Y = tsne.fit_transform(X) -t1 = time() -print("t-SNE: %.2g sec" % (t1 - t0)) -ax = fig.add_subplot(250) -plt.scatter(Y[:, 0], Y[:, 1], c=color, cmap=plt.cm.Spectral) -plt.title("t-SNE (%.2g sec)" % (t1 - t0)) -ax.xaxis.set_major_formatter(NullFormatter()) -ax.yaxis.set_major_formatter(NullFormatter()) -plt.axis('tight') - -plt.show() diff --git a/0.15/_downloads/plot_confusion_matrix.py b/0.15/_downloads/plot_confusion_matrix.py deleted file mode 100644 index 771d058e2a4a5..0000000000000 --- a/0.15/_downloads/plot_confusion_matrix.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -================ -Confusion matrix -================ - -Example of confusion matrix usage to evaluate the quality -of the output of a classifier on the iris data set. The -diagonal elements represent the number of points for which -the predicted label is equal to the true label, while -off-diagonal elements are those that are mislabeled by the -classifier. The higher the diagonal values of the confusion -matrix the better, indicating many correct predictions. - -The figures show the confusion matrix with and without -normalization by class support size (number of elements -in each class). This kind of normalization can be -interesting in case of class imbalance to have a more -visual interpretation of which class is being misclassified. - -Here the results are not as good as they could be as our -choice for the regularization parameter C was not the best. -In real life applications this parameter is usually chosen -using :ref:`grid_search`. - -""" - -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import svm, datasets -from sklearn.cross_validation import train_test_split -from sklearn.metrics import confusion_matrix - -# import some data to play with -iris = datasets.load_iris() -X = iris.data -y = iris.target - -# Split the data into a training set and a test set -X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0) - -# Run classifier, using a model that is too regularized (C too low) to see -# the impact on the results -classifier = svm.SVC(kernel='linear', C=0.01) -y_pred = classifier.fit(X_train, y_train).predict(X_test) - - -def plot_confusion_matrix(cm, title='Confusion matrix', cmap=plt.cm.Blues): - plt.imshow(cm, interpolation='nearest', cmap=cmap) - plt.title(title) - plt.colorbar() - tick_marks = np.arange(len(iris.target_names)) - plt.xticks(tick_marks, iris.target_names, rotation=45) - plt.yticks(tick_marks, iris.target_names) - plt.tight_layout() - plt.ylabel('True label') - plt.xlabel('Predicted label') - - -# Compute confusion matrix -cm = confusion_matrix(y_test, y_pred) -np.set_printoptions(precision=2) -print('Confusion matrix, without normalization') -print(cm) -plt.figure() -plot_confusion_matrix(cm) - -# Normalize the confusion matrix by row (i.e by the number of samples -# in each class) -cm_normalized = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] -print('Normalized confusion matrix') -print(cm_normalized) -plt.figure() -plot_confusion_matrix(cm_normalized, title='Normalized confusion matrix') - -plt.show() diff --git a/0.15/_downloads/plot_confusion_matrix1.py b/0.15/_downloads/plot_confusion_matrix1.py deleted file mode 100644 index 144020a320577..0000000000000 --- a/0.15/_downloads/plot_confusion_matrix1.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -================ -Confusion matrix -================ - -Example of confusion matrix usage to evaluate the quality -of the output of a classifier on the iris data set. The -diagonal elements represent the number of points for which -the predicted label is equal to the true label, while -off-diagonal elements are those that are mislabeled by the -classifier. The higher the diagonal values of the confusion -matrix the better, indicating many correct predictions. -""" - -print(__doc__) - -from sklearn import svm, datasets -from sklearn.cross_validation import train_test_split -from sklearn.metrics import confusion_matrix - -import matplotlib.pyplot as plt - -# import some data to play with -iris = datasets.load_iris() -X = iris.data -y = iris.target - -# Split the data into a training set and a test set -X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0) - -# Run classifier -classifier = svm.SVC(kernel='linear') -y_pred = classifier.fit(X_train, y_train).predict(X_test) - -# Compute confusion matrix -cm = confusion_matrix(y_test, y_pred) - -print(cm) - -# Show confusion matrix in a separate window -plt.matshow(cm) -plt.title('Confusion matrix') -plt.colorbar() -plt.ylabel('True label') -plt.xlabel('Predicted label') -plt.show() diff --git a/0.15/_downloads/plot_covariance_estimation.py b/0.15/_downloads/plot_covariance_estimation.py deleted file mode 100644 index 85e26705b03e9..0000000000000 --- a/0.15/_downloads/plot_covariance_estimation.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -======================================================================= -Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood -======================================================================= - -When working with covariance estimation, the usual approach is to use -a maximum likelihood estimator, such as the -:class:`sklearn.covariance.EmpiricalCovariance`. It is unbiased, i.e. it -converges to the true (population) covariance when given many -observations. However, it can also be beneficial to regularize it, in -order to reduce its variance; this, in turn, introduces some bias. This -example illustrates the simple regularization used in -:ref:`shrunk_covariance` estimators. In particular, it focuses on how to -set the amount of regularization, i.e. how to choose the bias-variance -trade-off. - -Here we compare 3 approaches: - -* Setting the parameter by cross-validating the likelihood on three folds - according to a grid of potential shrinkage parameters. - -* A close formula proposed by Ledoit and Wolf to compute - the asymptotically optimal regularization parameter (minimizing a MSE - criterion), yielding the :class:`sklearn.covariance.LedoitWolf` - covariance estimate. - -* An improvement of the Ledoit-Wolf shrinkage, the - :class:`sklearn.covariance.OAS`, proposed by Chen et al. Its - convergence is significantly better under the assumption that the data - are Gaussian, in particular for small samples. - -To quantify estimation error, we plot the likelihood of unseen data for -different values of the shrinkage parameter. We also show the choices by -cross-validation, or with the LedoitWolf and OAS estimates. - -Note that the maximum likelihood estimate corresponds to no shrinkage, -and thus performs poorly. The Ledoit-Wolf estimate performs really well, -as it is close to the optimal and is computational not costly. In this -example, the OAS estimate is a bit further away. Interestingly, both -approaches outperform cross-validation, which is significantly most -computationally costly. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from scipy import linalg - -from sklearn.covariance import LedoitWolf, OAS, ShrunkCovariance, \ - log_likelihood, empirical_covariance -from sklearn.grid_search import GridSearchCV - - -############################################################################### -# Generate sample data -n_features, n_samples = 40, 20 -np.random.seed(42) -base_X_train = np.random.normal(size=(n_samples, n_features)) -base_X_test = np.random.normal(size=(n_samples, n_features)) - -# Color samples -coloring_matrix = np.random.normal(size=(n_features, n_features)) -X_train = np.dot(base_X_train, coloring_matrix) -X_test = np.dot(base_X_test, coloring_matrix) - -############################################################################### -# Compute the likelihood on test data - -# spanning a range of possible shrinkage coefficient values -shrinkages = np.logspace(-2, 0, 30) -negative_logliks = [-ShrunkCovariance(shrinkage=s).fit(X_train).score(X_test) - for s in shrinkages] - -# under the ground-truth model, which we would not have access to in real -# settings -real_cov = np.dot(coloring_matrix.T, coloring_matrix) -emp_cov = empirical_covariance(X_train) -loglik_real = -log_likelihood(emp_cov, linalg.inv(real_cov)) - -############################################################################### -# Compare different approaches to setting the parameter - -# GridSearch for an optimal shrinkage coefficient -tuned_parameters = [{'shrinkage': shrinkages}] -cv = GridSearchCV(ShrunkCovariance(), tuned_parameters) -cv.fit(X_train) - -# Ledoit-Wolf optimal shrinkage coefficient estimate -lw = LedoitWolf() -loglik_lw = lw.fit(X_train).score(X_test) - -# OAS coefficient estimate -oa = OAS() -loglik_oa = oa.fit(X_train).score(X_test) - -############################################################################### -# Plot results -fig = plt.figure() -plt.title("Regularized covariance: likelihood and shrinkage coefficient") -plt.xlabel('Regularizaton parameter: shrinkage coefficient') -plt.ylabel('Error: negative log-likelihood on test data') -# range shrinkage curve -plt.loglog(shrinkages, negative_logliks, label="Negative log-likelihood") - -plt.plot(plt.xlim(), 2 * [loglik_real], '--r', - label="Real covariance likelihood") - -# adjust view -lik_max = np.amax(negative_logliks) -lik_min = np.amin(negative_logliks) -ymin = lik_min - 6. * np.log((plt.ylim()[1] - plt.ylim()[0])) -ymax = lik_max + 10. * np.log(lik_max - lik_min) -xmin = shrinkages[0] -xmax = shrinkages[-1] -# LW likelihood -plt.vlines(lw.shrinkage_, ymin, -loglik_lw, color='magenta', - linewidth=3, label='Ledoit-Wolf estimate') -# OAS likelihood -plt.vlines(oa.shrinkage_, ymin, -loglik_oa, color='purple', - linewidth=3, label='OAS estimate') -# best CV estimator likelihood -plt.vlines(cv.best_estimator_.shrinkage, ymin, - -cv.best_estimator_.score(X_test), color='cyan', - linewidth=3, label='Cross-validation best estimate') - -plt.ylim(ymin, ymax) -plt.xlim(xmin, xmax) -plt.legend() - -plt.show() diff --git a/0.15/_downloads/plot_custom_kernel.py b/0.15/_downloads/plot_custom_kernel.py deleted file mode 100644 index d36a48f561abf..0000000000000 --- a/0.15/_downloads/plot_custom_kernel.py +++ /dev/null @@ -1,57 +0,0 @@ -""" -====================== -SVM with custom kernel -====================== - -Simple usage of Support Vector Machines to classify a sample. It will -plot the decision surface and the support vectors. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm, datasets - -# import some data to play with -iris = datasets.load_iris() -X = iris.data[:, :2] # we only take the first two features. We could - # avoid this ugly slicing by using a two-dim dataset -Y = iris.target - - -def my_kernel(x, y): - """ - We create a custom kernel: - - (2 0) - k(x, y) = x ( ) y.T - (0 1) - """ - M = np.array([[2, 0], [0, 1.0]]) - return np.dot(np.dot(x, M), y.T) - - -h = .02 # step size in the mesh - -# we create an instance of SVM and fit out data. -clf = svm.SVC(kernel=my_kernel) -clf.fit(X, Y) - -# Plot the decision boundary. For that, we will assign a color to each -# point in the mesh [x_min, m_max]x[y_min, y_max]. -x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 -y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 -xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h)) -Z = clf.predict(np.c_[xx.ravel(), yy.ravel()]) - -# Put the result into a color plot -Z = Z.reshape(xx.shape) -plt.pcolormesh(xx, yy, Z, cmap=plt.cm.Paired) - -# Plot also the training points -plt.scatter(X[:, 0], X[:, 1], c=Y, cmap=plt.cm.Paired) -plt.title('3-Class classification using Support Vector Machine with custom' - ' kernel') -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_cv_diabetes.py b/0.15/_downloads/plot_cv_diabetes.py deleted file mode 100644 index 4d1b984443ca5..0000000000000 --- a/0.15/_downloads/plot_cv_diabetes.py +++ /dev/null @@ -1,71 +0,0 @@ -""" -=============================================== -Cross-validation on diabetes Dataset Exercise -=============================================== - -A tutorial excercise which uses cross-validation with linear models. - -This exercise is used in the :ref:`cv_estimators_tut` part of the -:ref:`model_selection_tut` section of the :ref:`stat_learn_tut_index`. -""" -from __future__ import print_function -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import cross_validation, datasets, linear_model - -diabetes = datasets.load_diabetes() -X = diabetes.data[:150] -y = diabetes.target[:150] - -lasso = linear_model.Lasso() -alphas = np.logspace(-4, -.5, 30) - -scores = list() -scores_std = list() - -for alpha in alphas: - lasso.alpha = alpha - this_scores = cross_validation.cross_val_score(lasso, X, y, n_jobs=1) - scores.append(np.mean(this_scores)) - scores_std.append(np.std(this_scores)) - -plt.figure(figsize=(4, 3)) -plt.semilogx(alphas, scores) -# plot error lines showing +/- std. errors of the scores -plt.semilogx(alphas, np.array(scores) + np.array(scores_std) / np.sqrt(len(X)), - 'b--') -plt.semilogx(alphas, np.array(scores) - np.array(scores_std) / np.sqrt(len(X)), - 'b--') -plt.ylabel('CV score') -plt.xlabel('alpha') -plt.axhline(np.max(scores), linestyle='--', color='.5') - -############################################################################## -# Bonus: how much can you trust the selection of alpha? - -# To answer this question we use the LassoCV object that sets its alpha -# parameter automatically from the data by internal cross-validation (i.e. it -# performs cross-validation on the training data it receives). -# We use external cross-validation to see how much the automatically obtained -# alphas differ across different cross-validation folds. -lasso_cv = linear_model.LassoCV(alphas=alphas) -k_fold = cross_validation.KFold(len(X), 3) - -print("Answer to the bonus question:", - "how much can you trust the selection of alpha?") -print() -print("Alpha parameters maximising the generalization score on different") -print("subsets of the data:") -for k, (train, test) in enumerate(k_fold): - lasso_cv.fit(X[train], y[train]) - print("[fold {0}] alpha: {1:.5f}, score: {2:.5f}". - format(k, lasso_cv.alpha_, lasso_cv.score(X[test], y[test]))) -print() -print("Answer: Not very much since we obtained different alphas for different") -print("subsets of the data and moreover, the scores for these alphas differ") -print("quite substantially.") - -plt.show() diff --git a/0.15/_downloads/plot_cv_digits.py b/0.15/_downloads/plot_cv_digits.py deleted file mode 100644 index 361b904126560..0000000000000 --- a/0.15/_downloads/plot_cv_digits.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -============================================= -Cross-validation on Digits Dataset Exercise -============================================= - -A tutorial excercise using Cross-validation with an SVM on the Digits dataset. - -This exercise is used in the :ref:`cv_generators_tut` part of the -:ref:`model_selection_tut` section of the :ref:`stat_learn_tut_index`. -""" -print(__doc__) - - -import numpy as np -from sklearn import cross_validation, datasets, svm - -digits = datasets.load_digits() -X = digits.data -y = digits.target - -svc = svm.SVC(kernel='linear') -C_s = np.logspace(-10, 0, 10) - -scores = list() -scores_std = list() -for C in C_s: - svc.C = C - this_scores = cross_validation.cross_val_score(svc, X, y, n_jobs=1) - scores.append(np.mean(this_scores)) - scores_std.append(np.std(this_scores)) - -# Do the plotting -import matplotlib.pyplot as plt -plt.figure(1, figsize=(4, 3)) -plt.clf() -plt.semilogx(C_s, scores) -plt.semilogx(C_s, np.array(scores) + np.array(scores_std), 'b--') -plt.semilogx(C_s, np.array(scores) - np.array(scores_std), 'b--') -locs, labels = plt.yticks() -plt.yticks(locs, list(map(lambda x: "%g" % x, locs))) -plt.ylabel('CV score') -plt.xlabel('Parameter C') -plt.ylim(0, 1.1) -plt.show() diff --git a/0.15/_downloads/plot_cv_predict.py b/0.15/_downloads/plot_cv_predict.py deleted file mode 100644 index 404099d861764..0000000000000 --- a/0.15/_downloads/plot_cv_predict.py +++ /dev/null @@ -1,28 +0,0 @@ -""" -==================================== -Plotting Cross-Validated Predictions -==================================== - -This example shows how to use `cross_val_predict` to visualize prediction -errors. - -""" -from sklearn import datasets -from sklearn.cross_validation import cross_val_predict -from sklearn import linear_model -import matplotlib.pyplot as plt - -lr = linear_model.LinearRegression() -boston = datasets.load_boston() -y = boston.target - -# cross_val_predict returns an array of the same size as `y` where each entry -# is a prediction obtained by cross validated: -predicted = cross_val_predict(lr, boston.data, y, cv=10) - -fig,ax = plt.subplots() -ax.scatter(y, predicted) -ax.plot([y.min(), y.max()], [y.min(), y.max()], 'k--', lw=4) -ax.set_xlabel('Measured') -ax.set_ylabel('Predicted') -fig.show() diff --git a/0.15/_downloads/plot_dbscan.py b/0.15/_downloads/plot_dbscan.py deleted file mode 100644 index 46e315835a048..0000000000000 --- a/0.15/_downloads/plot_dbscan.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -""" -=================================== -Demo of DBSCAN clustering algorithm -=================================== - -Finds core samples of high density and expands clusters from them. - -""" -print(__doc__) - -import numpy as np - -from sklearn.cluster import DBSCAN -from sklearn import metrics -from sklearn.datasets.samples_generator import make_blobs -from sklearn.preprocessing import StandardScaler - - -############################################################################## -# Generate sample data -centers = [[1, 1], [-1, -1], [1, -1]] -X, labels_true = make_blobs(n_samples=750, centers=centers, cluster_std=0.4, - random_state=0) - -X = StandardScaler().fit_transform(X) - -############################################################################## -# Compute DBSCAN -db = DBSCAN(eps=0.3, min_samples=10).fit(X) -core_samples_mask = np.zeros_like(db.labels_, dtype=bool) -core_samples_mask[db.core_sample_indices_] = True -labels = db.labels_ - -# Number of clusters in labels, ignoring noise if present. -n_clusters_ = len(set(labels)) - (1 if -1 in labels else 0) - -print('Estimated number of clusters: %d' % n_clusters_) -print("Homogeneity: %0.3f" % metrics.homogeneity_score(labels_true, labels)) -print("Completeness: %0.3f" % metrics.completeness_score(labels_true, labels)) -print("V-measure: %0.3f" % metrics.v_measure_score(labels_true, labels)) -print("Adjusted Rand Index: %0.3f" - % metrics.adjusted_rand_score(labels_true, labels)) -print("Adjusted Mutual Information: %0.3f" - % metrics.adjusted_mutual_info_score(labels_true, labels)) -print("Silhouette Coefficient: %0.3f" - % metrics.silhouette_score(X, labels)) - -############################################################################## -# Plot result -import matplotlib.pyplot as plt - -# Black removed and is used for noise instead. -unique_labels = set(labels) -colors = plt.cm.Spectral(np.linspace(0, 1, len(unique_labels))) -for k, col in zip(unique_labels, colors): - if k == -1: - # Black used for noise. - col = 'k' - - class_member_mask = (labels == k) - - xy = X[class_member_mask & core_samples_mask] - plt.plot(xy[:, 0], xy[:, 1], 'o', markerfacecolor=col, - markeredgecolor='k', markersize=14) - - xy = X[class_member_mask & ~core_samples_mask] - plt.plot(xy[:, 0], xy[:, 1], 'o', markerfacecolor=col, - markeredgecolor='k', markersize=6) - -plt.title('Estimated number of clusters: %d' % n_clusters_) -plt.show() diff --git a/0.15/_downloads/plot_dict_face_patches.py b/0.15/_downloads/plot_dict_face_patches.py deleted file mode 100644 index 18c4fcf43c342..0000000000000 --- a/0.15/_downloads/plot_dict_face_patches.py +++ /dev/null @@ -1,84 +0,0 @@ -""" -Online learning of a dictionary of parts of faces -================================================== - -This example uses a large dataset of faces to learn a set of 20 x 20 -images patches that constitute faces. - -From the programming standpoint, it is interesting because it shows how -to use the online API of the scikit-learn to process a very large -dataset by chunks. The way we proceed is that we load an image at a time -and extract randomly 15 patches from this image. Once we have accumulated -750 of these patches (using 50 images), we run the `partial_fit` method -of the online KMeans object, MiniBatchKMeans. - -The verbose setting on the MiniBatchKMeans enables us to see that some -clusters are reassigned during the successive calls to -partial-fit. This is because the number of patches that they represent -has become too low, and it is better to choose a random new -cluster. -""" -print(__doc__) - -import time - -import matplotlib.pyplot as plt -import numpy as np - - -from sklearn import datasets -from sklearn.cluster import MiniBatchKMeans -from sklearn.feature_extraction.image import extract_patches_2d - -faces = datasets.fetch_olivetti_faces() - -############################################################################### -# Learn the dictionary of images - -print('Learning the dictionary... ') -rng = np.random.RandomState(0) -kmeans = MiniBatchKMeans(n_clusters=81, random_state=rng, verbose=True) -patch_size = (20, 20) - -buffer = [] -index = 1 -t0 = time.time() - -# The online learning part: cycle over the whole dataset 4 times -index = 0 -for _ in range(6): - for img in faces.images: - data = extract_patches_2d(img, patch_size, max_patches=50, - random_state=rng) - data = np.reshape(data, (len(data), -1)) - buffer.append(data) - index += 1 - if index % 10 == 0: - data = np.concatenate(buffer, axis=0) - data -= np.mean(data, axis=0) - data /= np.std(data, axis=0) - kmeans.partial_fit(data) - buffer = [] - if index % 100 == 0: - print('Partial fit of %4i out of %i' - % (index, 6 * len(faces.images))) - -dt = time.time() - t0 -print('done in %.2fs.' % dt) - -############################################################################### -# Plot the results -plt.figure(figsize=(4.2, 4)) -for i, patch in enumerate(kmeans.cluster_centers_): - plt.subplot(9, 9, i + 1) - plt.imshow(patch.reshape(patch_size), cmap=plt.cm.gray, - interpolation='nearest') - plt.xticks(()) - plt.yticks(()) - - -plt.suptitle('Patches of faces\nTrain time %.1fs on %d patches' % - (dt, 8 * len(faces.images)), fontsize=16) -plt.subplots_adjust(0.08, 0.02, 0.92, 0.85, 0.08, 0.23) - -plt.show() diff --git a/0.15/_downloads/plot_digits_agglomeration.py b/0.15/_downloads/plot_digits_agglomeration.py deleted file mode 100644 index 31d8094e1cf2d..0000000000000 --- a/0.15/_downloads/plot_digits_agglomeration.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -Feature agglomeration -========================================================= - -These images how similar features are merged together using -feature agglomeration. -""" -print(__doc__) - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import datasets, cluster -from sklearn.feature_extraction.image import grid_to_graph - -digits = datasets.load_digits() -images = digits.images -X = np.reshape(images, (len(images), -1)) -connectivity = grid_to_graph(*images[0].shape) - -agglo = cluster.FeatureAgglomeration(connectivity=connectivity, - n_clusters=32) - -agglo.fit(X) -X_reduced = agglo.transform(X) - -X_restored = agglo.inverse_transform(X_reduced) -images_restored = np.reshape(X_restored, images.shape) -plt.figure(1, figsize=(4, 3.5)) -plt.clf() -plt.subplots_adjust(left=.01, right=.99, bottom=.01, top=.91) -for i in range(4): - plt.subplot(3, 4, i + 1) - plt.imshow(images[i], cmap=plt.cm.gray, vmax=16, interpolation='nearest') - plt.xticks(()) - plt.yticks(()) - if i == 1: - plt.title('Original data') - plt.subplot(3, 4, 4 + i + 1) - plt.imshow(images_restored[i], cmap=plt.cm.gray, vmax=16, - interpolation='nearest') - if i == 1: - plt.title('Agglomerated data') - plt.xticks(()) - plt.yticks(()) - -plt.subplot(3, 4, 10) -plt.imshow(np.reshape(agglo.labels_, images[0].shape), - interpolation='nearest', cmap=plt.cm.spectral) -plt.xticks(()) -plt.yticks(()) -plt.title('Labels') -plt.show() diff --git a/0.15/_downloads/plot_digits_classification.py b/0.15/_downloads/plot_digits_classification.py deleted file mode 100644 index 55062006b5bea..0000000000000 --- a/0.15/_downloads/plot_digits_classification.py +++ /dev/null @@ -1,66 +0,0 @@ -""" -================================ -Recognizing hand-written digits -================================ - -An example showing how the scikit-learn can be used to recognize images of -hand-written digits. - -This example is commented in the -:ref:`tutorial section of the user manual `. - -""" -print(__doc__) - -# Author: Gael Varoquaux -# License: BSD 3 clause - -# Standard scientific Python imports -import matplotlib.pyplot as plt - -# Import datasets, classifiers and performance metrics -from sklearn import datasets, svm, metrics - -# The digits dataset -digits = datasets.load_digits() - -# The data that we are interested in is made of 8x8 images of digits, let's -# have a look at the first 3 images, stored in the `images` attribute of the -# dataset. If we were working from image files, we could load them using -# pylab.imread. Note that each image must have the same size. For these -# images, we know which digit they represent: it is given in the 'target' of -# the dataset. -images_and_labels = list(zip(digits.images, digits.target)) -for index, (image, label) in enumerate(images_and_labels[:4]): - plt.subplot(2, 4, index + 1) - plt.axis('off') - plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest') - plt.title('Training: %i' % label) - -# To apply a classifier on this data, we need to flatten the image, to -# turn the data in a (samples, feature) matrix: -n_samples = len(digits.images) -data = digits.images.reshape((n_samples, -1)) - -# Create a classifier: a support vector classifier -classifier = svm.SVC(gamma=0.001) - -# We learn the digits on the first half of the digits -classifier.fit(data[:n_samples / 2], digits.target[:n_samples / 2]) - -# Now predict the value of the digit on the second half: -expected = digits.target[n_samples / 2:] -predicted = classifier.predict(data[n_samples / 2:]) - -print("Classification report for classifier %s:\n%s\n" - % (classifier, metrics.classification_report(expected, predicted))) -print("Confusion matrix:\n%s" % metrics.confusion_matrix(expected, predicted)) - -images_and_predictions = list(zip(digits.images[n_samples / 2:], predicted)) -for index, (image, prediction) in enumerate(images_and_predictions[:4]): - plt.subplot(2, 4, index + 5) - plt.axis('off') - plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest') - plt.title('Prediction: %i' % prediction) - -plt.show() diff --git a/0.15/_downloads/plot_digits_classification1.py b/0.15/_downloads/plot_digits_classification1.py deleted file mode 100644 index 55062006b5bea..0000000000000 --- a/0.15/_downloads/plot_digits_classification1.py +++ /dev/null @@ -1,66 +0,0 @@ -""" -================================ -Recognizing hand-written digits -================================ - -An example showing how the scikit-learn can be used to recognize images of -hand-written digits. - -This example is commented in the -:ref:`tutorial section of the user manual `. - -""" -print(__doc__) - -# Author: Gael Varoquaux -# License: BSD 3 clause - -# Standard scientific Python imports -import matplotlib.pyplot as plt - -# Import datasets, classifiers and performance metrics -from sklearn import datasets, svm, metrics - -# The digits dataset -digits = datasets.load_digits() - -# The data that we are interested in is made of 8x8 images of digits, let's -# have a look at the first 3 images, stored in the `images` attribute of the -# dataset. If we were working from image files, we could load them using -# pylab.imread. Note that each image must have the same size. For these -# images, we know which digit they represent: it is given in the 'target' of -# the dataset. -images_and_labels = list(zip(digits.images, digits.target)) -for index, (image, label) in enumerate(images_and_labels[:4]): - plt.subplot(2, 4, index + 1) - plt.axis('off') - plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest') - plt.title('Training: %i' % label) - -# To apply a classifier on this data, we need to flatten the image, to -# turn the data in a (samples, feature) matrix: -n_samples = len(digits.images) -data = digits.images.reshape((n_samples, -1)) - -# Create a classifier: a support vector classifier -classifier = svm.SVC(gamma=0.001) - -# We learn the digits on the first half of the digits -classifier.fit(data[:n_samples / 2], digits.target[:n_samples / 2]) - -# Now predict the value of the digit on the second half: -expected = digits.target[n_samples / 2:] -predicted = classifier.predict(data[n_samples / 2:]) - -print("Classification report for classifier %s:\n%s\n" - % (classifier, metrics.classification_report(expected, predicted))) -print("Confusion matrix:\n%s" % metrics.confusion_matrix(expected, predicted)) - -images_and_predictions = list(zip(digits.images[n_samples / 2:], predicted)) -for index, (image, prediction) in enumerate(images_and_predictions[:4]): - plt.subplot(2, 4, index + 5) - plt.axis('off') - plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest') - plt.title('Prediction: %i' % prediction) - -plt.show() diff --git a/0.15/_downloads/plot_digits_kde_sampling.py b/0.15/_downloads/plot_digits_kde_sampling.py deleted file mode 100644 index 4680a41780aed..0000000000000 --- a/0.15/_downloads/plot_digits_kde_sampling.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -========================= -Kernel Density Estimation -========================= - -This example shows how kernel density estimation (KDE), a powerful -non-parametric density estimation technique, can be used to learn -a generative model for a dataset. With this generative model in place, -new samples can be drawn. These new samples reflect the underlying model -of the data. -""" - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.datasets import load_digits -from sklearn.neighbors import KernelDensity -from sklearn.decomposition import PCA -from sklearn.grid_search import GridSearchCV - -# load the data -digits = load_digits() -data = digits.data - -# project the 64-dimensional data to a lower dimension -pca = PCA(n_components=15, whiten=False) -data = pca.fit_transform(digits.data) - -# use grid search cross-validation to optimize the bandwidth -params = {'bandwidth': np.logspace(-1, 1, 20)} -grid = GridSearchCV(KernelDensity(), params) -grid.fit(data) - -print("best bandwidth: {0}".format(grid.best_estimator_.bandwidth)) - -# use the best estimator to compute the kernel density estimate -kde = grid.best_estimator_ - -# sample 44 new points from the data -new_data = kde.sample(44, random_state=0) -new_data = pca.inverse_transform(new_data) - -# turn data into a 4x11 grid -new_data = new_data.reshape((4, 11, -1)) -real_data = digits.data[:44].reshape((4, 11, -1)) - -# plot real digits and resampled digits -fig, ax = plt.subplots(9, 11, subplot_kw=dict(xticks=[], yticks=[])) -for j in range(11): - ax[4, j].set_visible(False) - for i in range(4): - im = ax[i, j].imshow(real_data[i, j].reshape((8, 8)), - cmap=plt.cm.binary, interpolation='nearest') - im.set_clim(0, 16) - im = ax[i + 5, j].imshow(new_data[i, j].reshape((8, 8)), - cmap=plt.cm.binary, interpolation='nearest') - im.set_clim(0, 16) - -ax[0, 5].set_title('Selection from the input data') -ax[5, 5].set_title('"New" digits drawn from the kernel density model') - -plt.show() diff --git a/0.15/_downloads/plot_digits_last_image.py b/0.15/_downloads/plot_digits_last_image.py deleted file mode 100644 index f08f06888a8f3..0000000000000 --- a/0.15/_downloads/plot_digits_last_image.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -The Digit Dataset -========================================================= - -This dataset is made up of 1797 8x8 images. Each image, -like the one shown below, is of a hand-written digit. -In order to utilize an 8x8 figure like this, we'd have to -first transform it into a feature vector with length 64. - -See `here -`_ -for more information about this dataset. -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -from sklearn import datasets - -import matplotlib.pyplot as plt - -#Load the digits dataset -digits = datasets.load_digits() - -#Display the first digit -plt.figure(1, figsize=(3, 3)) -plt.imshow(digits.images[-1], cmap=plt.cm.gray_r, interpolation='nearest') -plt.show() diff --git a/0.15/_downloads/plot_digits_linkage.py b/0.15/_downloads/plot_digits_linkage.py deleted file mode 100644 index f1fe1783c10e5..0000000000000 --- a/0.15/_downloads/plot_digits_linkage.py +++ /dev/null @@ -1,91 +0,0 @@ -""" -============================================================================= -Various Agglomerative Clustering on a 2D embedding of digits -============================================================================= - -An illustration of various linkage option for agglomerative clustering on -a 2D embedding of the digits dataset. - -The goal of this example is to show intuitively how the metrics behave, and -not to find good clusters for the digits. This is why the example works on a -2D embedding. - -What this example shows us is the behavior "rich getting richer" of -agglomerative clustering that tends to create uneven cluster sizes. -This behavior is especially pronounced for the average linkage strategy, -that ends up with a couple of singleton clusters. -""" - -# Authors: Gael Varoquaux -# License: BSD 3 clause (C) INRIA 2014 - -print(__doc__) -from time import time - -import numpy as np -from scipy import ndimage -from matplotlib import pyplot as plt - -from sklearn import manifold, datasets - -digits = datasets.load_digits(n_class=10) -X = digits.data -y = digits.target -n_samples, n_features = X.shape - -np.random.seed(0) - -def nudge_images(X, y): - # Having a larger dataset shows more clearly the behavior of the - # methods, but we multiply the size of the dataset only by 2, as the - # cost of the hierarchical clustering methods are strongly - # super-linear in n_samples - shift = lambda x: ndimage.shift(x.reshape((8, 8)), - .3 * np.random.normal(size=2), - mode='constant', - ).ravel() - X = np.concatenate([X, np.apply_along_axis(shift, 1, X)]) - Y = np.concatenate([y, y], axis=0) - return X, Y - - -X, y = nudge_images(X, y) - - -#---------------------------------------------------------------------- -# Visualize the clustering -def plot_clustering(X_red, X, labels, title=None): - x_min, x_max = np.min(X_red, axis=0), np.max(X_red, axis=0) - X_red = (X_red - x_min) / (x_max - x_min) - - plt.figure(figsize=(6, 4)) - for i in range(X_red.shape[0]): - plt.text(X_red[i, 0], X_red[i, 1], str(y[i]), - color=plt.cm.spectral(labels[i] / 10.), - fontdict={'weight': 'bold', 'size': 9}) - - plt.xticks([]) - plt.yticks([]) - if title is not None: - plt.title(title, size=17) - plt.axis('off') - plt.tight_layout() - -#---------------------------------------------------------------------- -# 2D embedding of the digits dataset -print("Computing embedding") -X_red = manifold.SpectralEmbedding(n_components=2).fit_transform(X) -print("Done.") - -from sklearn.cluster import AgglomerativeClustering - -for linkage in ('ward', 'average', 'complete'): - clustering = AgglomerativeClustering(linkage=linkage, n_clusters=10) - t0 = time() - clustering.fit(X_red) - print("%s : %.2fs" % (linkage, time() - t0)) - - plot_clustering(X_red, X, clustering.labels_, "%s linkage" % linkage) - - -plt.show() diff --git a/0.15/_downloads/plot_digits_pipe.py b/0.15/_downloads/plot_digits_pipe.py deleted file mode 100644 index 139ade15ba7c2..0000000000000 --- a/0.15/_downloads/plot_digits_pipe.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -Pipelining: chaining a PCA and a logistic regression -========================================================= - -The PCA does an unsupervised dimensionality reduction, while the logistic -regression does the prediction. - -We use a GridSearchCV to set the dimensionality of the PCA - -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import linear_model, decomposition, datasets -from sklearn.pipeline import Pipeline -from sklearn.grid_search import GridSearchCV - -logistic = linear_model.LogisticRegression() - -pca = decomposition.PCA() -pipe = Pipeline(steps=[('pca', pca), ('logistic', logistic)]) - -digits = datasets.load_digits() -X_digits = digits.data -y_digits = digits.target - -############################################################################### -# Plot the PCA spectrum -pca.fit(X_digits) - -plt.figure(1, figsize=(4, 3)) -plt.clf() -plt.axes([.2, .2, .7, .7]) -plt.plot(pca.explained_variance_, linewidth=2) -plt.axis('tight') -plt.xlabel('n_components') -plt.ylabel('explained_variance_') - -############################################################################### -# Prediction - -n_components = [20, 40, 64] -Cs = np.logspace(-4, 4, 3) - -#Parameters of pipelines can be set using ‘__’ separated parameter names: - -estimator = GridSearchCV(pipe, - dict(pca__n_components=n_components, - logistic__C=Cs)) -estimator.fit(X_digits, y_digits) - -plt.axvline(estimator.best_estimator_.named_steps['pca'].n_components, - linestyle=':', label='n_components chosen') -plt.legend(prop=dict(size=12)) -plt.show() diff --git a/0.15/_downloads/plot_ensemble_oob.py b/0.15/_downloads/plot_ensemble_oob.py deleted file mode 100644 index ed484e97d6127..0000000000000 --- a/0.15/_downloads/plot_ensemble_oob.py +++ /dev/null @@ -1,86 +0,0 @@ -""" -============================= -OOB Errors for Random Forests -============================= - -The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where -each new tree is fit from a bootstrap sample of the training observations -:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average error for -each :math:`z_i` calculated using predictions from the trees that do not -contain :math:`z_i` in their respective bootstrap sample. This allows the -``RandomForestClassifier`` to be fit and validated whilst being trained [1]. - -The example below demonstrates how the OOB error can be measured at the -addition of each new tree during training. The resulting plot allows a -practitioner to approximate a suitable value of ``n_estimators`` at which the -error stabilizes. - -.. [1] T. Hastie, R. Tibshirani and J. Friedman, "Elements of Statistical - Learning Ed. 2", p592-593, Springer, 2009. - -""" -import matplotlib.pyplot as plt - -from collections import OrderedDict -from sklearn.datasets import make_classification -from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier - -# Author: Kian Ho -# Gilles Louppe -# Andreas Mueller -# -# License: BSD 3 Clause - -print(__doc__) - -RANDOM_STATE = 123 - -# Generate a binary classification dataset. -X, y = make_classification(n_samples=500, n_features=25, - n_clusters_per_class=1, n_informative=15, - random_state=RANDOM_STATE) - -# NOTE: Setting the `warm_start` construction parameter to `True` disables -# support for paralellised ensembles but is necessary for tracking the OOB -# error trajectory during training. -ensemble_clfs = [ - ("RandomForestClassifier, max_features='sqrt'", - RandomForestClassifier(warm_start=True, oob_score=True, - max_features="sqrt", - random_state=RANDOM_STATE)), - ("RandomForestClassifier, max_features='log2'", - RandomForestClassifier(warm_start=True, max_features='log2', - oob_score=True, - random_state=RANDOM_STATE)), - ("RandomForestClassifier, max_features=None", - RandomForestClassifier(warm_start=True, max_features=None, - oob_score=True, - random_state=RANDOM_STATE)) -] - -# Map a classifier name to a list of (, ) pairs. -error_rate = OrderedDict((label, []) for label, _ in ensemble_clfs) - -# Range of `n_estimators` values to explore. -min_estimators = 15 -max_estimators = 175 - -for label, clf in ensemble_clfs: - for i in range(min_estimators, max_estimators + 1): - clf.set_params(n_estimators=i) - clf.fit(X, y) - - # Record the OOB error for each `n_estimators=i` setting. - oob_error = 1 - clf.oob_score_ - error_rate[label].append((i, oob_error)) - -# Generate the "OOB error rate" vs. "n_estimators" plot. -for label, clf_err in error_rate.items(): - xs, ys = zip(*clf_err) - plt.plot(xs, ys, label=label) - -plt.xlim(min_estimators, max_estimators) -plt.xlabel("n_estimators") -plt.ylabel("OOB error rate") -plt.legend(loc="upper right") -plt.show() diff --git a/0.15/_downloads/plot_faces_decomposition.py b/0.15/_downloads/plot_faces_decomposition.py deleted file mode 100644 index e85da1b952253..0000000000000 --- a/0.15/_downloads/plot_faces_decomposition.py +++ /dev/null @@ -1,133 +0,0 @@ -""" -============================ -Faces dataset decompositions -============================ - -This example applies to :ref:`olivetti_faces` different unsupervised -matrix decomposition (dimension reduction) methods from the module -:py:mod:`sklearn.decomposition` (see the documentation chapter -:ref:`decompositions`) . - -""" -print(__doc__) - -# Authors: Vlad Niculae, Alexandre Gramfort -# License: BSD 3 clause - -import logging -from time import time - -from numpy.random import RandomState -import matplotlib.pyplot as plt - -from sklearn.datasets import fetch_olivetti_faces -from sklearn.cluster import MiniBatchKMeans -from sklearn import decomposition - -# Display progress logs on stdout -logging.basicConfig(level=logging.INFO, - format='%(asctime)s %(levelname)s %(message)s') -n_row, n_col = 2, 3 -n_components = n_row * n_col -image_shape = (64, 64) -rng = RandomState(0) - -############################################################################### -# Load faces data -dataset = fetch_olivetti_faces(shuffle=True, random_state=rng) -faces = dataset.data - -n_samples, n_features = faces.shape - -# global centering -faces_centered = faces - faces.mean(axis=0) - -# local centering -faces_centered -= faces_centered.mean(axis=1).reshape(n_samples, -1) - -print("Dataset consists of %d faces" % n_samples) - - -############################################################################### -def plot_gallery(title, images, n_col=n_col, n_row=n_row): - plt.figure(figsize=(2. * n_col, 2.26 * n_row)) - plt.suptitle(title, size=16) - for i, comp in enumerate(images): - plt.subplot(n_row, n_col, i + 1) - vmax = max(comp.max(), -comp.min()) - plt.imshow(comp.reshape(image_shape), cmap=plt.cm.gray, - interpolation='nearest', - vmin=-vmax, vmax=vmax) - plt.xticks(()) - plt.yticks(()) - plt.subplots_adjust(0.01, 0.05, 0.99, 0.93, 0.04, 0.) - -############################################################################### -# List of the different estimators, whether to center and transpose the -# problem, and whether the transformer uses the clustering API. -estimators = [ - ('Eigenfaces - RandomizedPCA', - decomposition.RandomizedPCA(n_components=n_components, whiten=True), - True), - - ('Non-negative components - NMF', - decomposition.NMF(n_components=n_components, init='nndsvda', beta=5.0, - tol=5e-3, sparseness='components'), - False), - - ('Independent components - FastICA', - decomposition.FastICA(n_components=n_components, whiten=True), - True), - - ('Sparse comp. - MiniBatchSparsePCA', - decomposition.MiniBatchSparsePCA(n_components=n_components, alpha=0.8, - n_iter=100, batch_size=3, - random_state=rng), - True), - - ('MiniBatchDictionaryLearning', - decomposition.MiniBatchDictionaryLearning(n_components=15, alpha=0.1, - n_iter=50, batch_size=3, - random_state=rng), - True), - - ('Cluster centers - MiniBatchKMeans', - MiniBatchKMeans(n_clusters=n_components, tol=1e-3, batch_size=20, - max_iter=50, random_state=rng), - True), - - ('Factor Analysis components - FA', - decomposition.FactorAnalysis(n_components=n_components, max_iter=2), - True), -] - - -############################################################################### -# Plot a sample of the input data - -plot_gallery("First centered Olivetti faces", faces_centered[:n_components]) - -############################################################################### -# Do the estimation and plot it - -for name, estimator, center in estimators: - print("Extracting the top %d %s..." % (n_components, name)) - t0 = time() - data = faces - if center: - data = faces_centered - estimator.fit(data) - train_time = (time() - t0) - print("done in %0.3fs" % train_time) - if hasattr(estimator, 'cluster_centers_'): - components_ = estimator.cluster_centers_ - else: - components_ = estimator.components_ - if hasattr(estimator, 'noise_variance_'): - plot_gallery("Pixelwise variance", - estimator.noise_variance_.reshape(1, -1), n_col=1, - n_row=1) - plot_gallery('%s - Train time %.1fs' % (name, train_time), - components_[:n_components]) - -plt.show() diff --git a/0.15/_downloads/plot_feature_agglomeration_vs_univariate_selection.py b/0.15/_downloads/plot_feature_agglomeration_vs_univariate_selection.py deleted file mode 100644 index a56a45e6d20dc..0000000000000 --- a/0.15/_downloads/plot_feature_agglomeration_vs_univariate_selection.py +++ /dev/null @@ -1,108 +0,0 @@ -""" -============================================== -Feature agglomeration vs. univariate selection -============================================== - -This example compares 2 dimensionality reduction strategies: - -- univariate feature selection with Anova - -- feature agglomeration with Ward hierarchical clustering - -Both methods are compared in a regression problem using -a BayesianRidge as supervised estimator. -""" - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -print(__doc__) - -import shutil -import tempfile - -import numpy as np -import matplotlib.pyplot as plt -from scipy import linalg, ndimage - -from sklearn.feature_extraction.image import grid_to_graph -from sklearn import feature_selection -from sklearn.cluster import FeatureAgglomeration -from sklearn.linear_model import BayesianRidge -from sklearn.pipeline import Pipeline -from sklearn.grid_search import GridSearchCV -from sklearn.externals.joblib import Memory -from sklearn.cross_validation import KFold - -############################################################################### -# Generate data -n_samples = 200 -size = 40 # image size -roi_size = 15 -snr = 5. -np.random.seed(0) -mask = np.ones([size, size], dtype=np.bool) - -coef = np.zeros((size, size)) -coef[0:roi_size, 0:roi_size] = -1. -coef[-roi_size:, -roi_size:] = 1. - -X = np.random.randn(n_samples, size ** 2) -for x in X: # smooth data - x[:] = ndimage.gaussian_filter(x.reshape(size, size), sigma=1.0).ravel() -X -= X.mean(axis=0) -X /= X.std(axis=0) - -y = np.dot(X, coef.ravel()) -noise = np.random.randn(y.shape[0]) -noise_coef = (linalg.norm(y, 2) / np.exp(snr / 20.)) / linalg.norm(noise, 2) -y += noise_coef * noise # add noise - -############################################################################### -# Compute the coefs of a Bayesian Ridge with GridSearch -cv = KFold(len(y), 2) # cross-validation generator for model selection -ridge = BayesianRidge() -cachedir = tempfile.mkdtemp() -mem = Memory(cachedir=cachedir, verbose=1) - -# Ward agglomeration followed by BayesianRidge -connectivity = grid_to_graph(n_x=size, n_y=size) -ward = FeatureAgglomeration(n_clusters=10, connectivity=connectivity, - memory=mem, n_components=1) -clf = Pipeline([('ward', ward), ('ridge', ridge)]) -# Select the optimal number of parcels with grid search -clf = GridSearchCV(clf, {'ward__n_clusters': [10, 20, 30]}, n_jobs=1, cv=cv) -clf.fit(X, y) # set the best parameters -coef_ = clf.best_estimator_.steps[-1][1].coef_ -coef_ = clf.best_estimator_.steps[0][1].inverse_transform(coef_) -coef_agglomeration_ = coef_.reshape(size, size) - -# Anova univariate feature selection followed by BayesianRidge -f_regression = mem.cache(feature_selection.f_regression) # caching function -anova = feature_selection.SelectPercentile(f_regression) -clf = Pipeline([('anova', anova), ('ridge', ridge)]) -# Select the optimal percentage of features with grid search -clf = GridSearchCV(clf, {'anova__percentile': [5, 10, 20]}, cv=cv) -clf.fit(X, y) # set the best parameters -coef_ = clf.best_estimator_.steps[-1][1].coef_ -coef_ = clf.best_estimator_.steps[0][1].inverse_transform(coef_) -coef_selection_ = coef_.reshape(size, size) - -############################################################################### -# Inverse the transformation to plot the results on an image -plt.close('all') -plt.figure(figsize=(7.3, 2.7)) -plt.subplot(1, 3, 1) -plt.imshow(coef, interpolation="nearest", cmap=plt.cm.RdBu_r) -plt.title("True weights") -plt.subplot(1, 3, 2) -plt.imshow(coef_selection_, interpolation="nearest", cmap=plt.cm.RdBu_r) -plt.title("Feature Selection") -plt.subplot(1, 3, 3) -plt.imshow(coef_agglomeration_, interpolation="nearest", cmap=plt.cm.RdBu_r) -plt.title("Feature Agglomeration") -plt.subplots_adjust(0.04, 0.0, 0.98, 0.94, 0.16, 0.26) -plt.show() - -# Attempt to remove the temporary cachedir, but don't worry if it fails -shutil.rmtree(cachedir, ignore_errors=True) diff --git a/0.15/_downloads/plot_feature_selection.py b/0.15/_downloads/plot_feature_selection.py deleted file mode 100644 index 9361791ce81d1..0000000000000 --- a/0.15/_downloads/plot_feature_selection.py +++ /dev/null @@ -1,84 +0,0 @@ -""" -=============================== -Univariate Feature Selection -=============================== - -An example showing univariate feature selection. - -Noisy (non informative) features are added to the iris data and -univariate feature selection is applied. For each feature, we plot the -p-values for the univariate feature selection and the corresponding -weights of an SVM. We can see that univariate feature selection -selects the informative features and that these have larger SVM weights. - -In the total set of features, only the 4 first ones are significant. We -can see that they have the highest score with univariate feature -selection. The SVM assigns a large weight to one of these features, but also -Selects many of the non-informative features. -Applying univariate feature selection before the SVM -increases the SVM weight attributed to the significant features, and will -thus improve classification. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import datasets, svm -from sklearn.feature_selection import SelectPercentile, f_classif - -############################################################################### -# import some data to play with - -# The iris dataset -iris = datasets.load_iris() - -# Some noisy data not correlated -E = np.random.uniform(0, 0.1, size=(len(iris.data), 20)) - -# Add the noisy data to the informative features -X = np.hstack((iris.data, E)) -y = iris.target - -############################################################################### -plt.figure(1) -plt.clf() - -X_indices = np.arange(X.shape[-1]) - -############################################################################### -# Univariate feature selection with F-test for feature scoring -# We use the default selection function: the 10% most significant features -selector = SelectPercentile(f_classif, percentile=10) -selector.fit(X, y) -scores = -np.log10(selector.pvalues_) -scores /= scores.max() -plt.bar(X_indices - .45, scores, width=.2, - label=r'Univariate score ($-Log(p_{value})$)', color='g') - -############################################################################### -# Compare to the weights of an SVM -clf = svm.SVC(kernel='linear') -clf.fit(X, y) - -svm_weights = (clf.coef_ ** 2).sum(axis=0) -svm_weights /= svm_weights.max() - -plt.bar(X_indices - .25, svm_weights, width=.2, label='SVM weight', color='r') - -clf_selected = svm.SVC(kernel='linear') -clf_selected.fit(selector.transform(X), y) - -svm_weights_selected = (clf_selected.coef_ ** 2).sum(axis=0) -svm_weights_selected /= svm_weights_selected.max() - -plt.bar(X_indices[selector.get_support()] - .05, svm_weights_selected, - width=.2, label='SVM weights after selection', color='b') - - -plt.title("Comparing feature selection") -plt.xlabel('Feature number') -plt.yticks(()) -plt.axis('tight') -plt.legend(loc='upper right') -plt.show() diff --git a/0.15/_downloads/plot_feature_selection1.py b/0.15/_downloads/plot_feature_selection1.py deleted file mode 100644 index 9361791ce81d1..0000000000000 --- a/0.15/_downloads/plot_feature_selection1.py +++ /dev/null @@ -1,84 +0,0 @@ -""" -=============================== -Univariate Feature Selection -=============================== - -An example showing univariate feature selection. - -Noisy (non informative) features are added to the iris data and -univariate feature selection is applied. For each feature, we plot the -p-values for the univariate feature selection and the corresponding -weights of an SVM. We can see that univariate feature selection -selects the informative features and that these have larger SVM weights. - -In the total set of features, only the 4 first ones are significant. We -can see that they have the highest score with univariate feature -selection. The SVM assigns a large weight to one of these features, but also -Selects many of the non-informative features. -Applying univariate feature selection before the SVM -increases the SVM weight attributed to the significant features, and will -thus improve classification. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import datasets, svm -from sklearn.feature_selection import SelectPercentile, f_classif - -############################################################################### -# import some data to play with - -# The iris dataset -iris = datasets.load_iris() - -# Some noisy data not correlated -E = np.random.uniform(0, 0.1, size=(len(iris.data), 20)) - -# Add the noisy data to the informative features -X = np.hstack((iris.data, E)) -y = iris.target - -############################################################################### -plt.figure(1) -plt.clf() - -X_indices = np.arange(X.shape[-1]) - -############################################################################### -# Univariate feature selection with F-test for feature scoring -# We use the default selection function: the 10% most significant features -selector = SelectPercentile(f_classif, percentile=10) -selector.fit(X, y) -scores = -np.log10(selector.pvalues_) -scores /= scores.max() -plt.bar(X_indices - .45, scores, width=.2, - label=r'Univariate score ($-Log(p_{value})$)', color='g') - -############################################################################### -# Compare to the weights of an SVM -clf = svm.SVC(kernel='linear') -clf.fit(X, y) - -svm_weights = (clf.coef_ ** 2).sum(axis=0) -svm_weights /= svm_weights.max() - -plt.bar(X_indices - .25, svm_weights, width=.2, label='SVM weight', color='r') - -clf_selected = svm.SVC(kernel='linear') -clf_selected.fit(selector.transform(X), y) - -svm_weights_selected = (clf_selected.coef_ ** 2).sum(axis=0) -svm_weights_selected /= svm_weights_selected.max() - -plt.bar(X_indices[selector.get_support()] - .05, svm_weights_selected, - width=.2, label='SVM weights after selection', color='b') - - -plt.title("Comparing feature selection") -plt.xlabel('Feature number') -plt.yticks(()) -plt.axis('tight') -plt.legend(loc='upper right') -plt.show() diff --git a/0.15/_downloads/plot_forest_importances.py b/0.15/_downloads/plot_forest_importances.py deleted file mode 100644 index 7c84cf716d369..0000000000000 --- a/0.15/_downloads/plot_forest_importances.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -========================================= -Feature importances with forests of trees -========================================= - -This examples shows the use of forests of trees to evaluate the importance of -features on an artificial classification task. The red bars are the feature -importances of the forest, along with their inter-trees variability. - -As expected, the plot suggests that 3 features are informative, while the -remaining are not. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.datasets import make_classification -from sklearn.ensemble import ExtraTreesClassifier - -# Build a classification task using 3 informative features -X, y = make_classification(n_samples=1000, - n_features=10, - n_informative=3, - n_redundant=0, - n_repeated=0, - n_classes=2, - random_state=0, - shuffle=False) - -# Build a forest and compute the feature importances -forest = ExtraTreesClassifier(n_estimators=250, - random_state=0) - -forest.fit(X, y) -importances = forest.feature_importances_ -std = np.std([tree.feature_importances_ for tree in forest.estimators_], - axis=0) -indices = np.argsort(importances)[::-1] - -# Print the feature ranking -print("Feature ranking:") - -for f in range(10): - print("%d. feature %d (%f)" % (f + 1, indices[f], importances[indices[f]])) - -# Plot the feature importances of the forest -plt.figure() -plt.title("Feature importances") -plt.bar(range(10), importances[indices], - color="r", yerr=std[indices], align="center") -plt.xticks(range(10), indices) -plt.xlim([-1, 10]) -plt.show() diff --git a/0.15/_downloads/plot_forest_importances_faces.py b/0.15/_downloads/plot_forest_importances_faces.py deleted file mode 100644 index 6b6fdbb797bfa..0000000000000 --- a/0.15/_downloads/plot_forest_importances_faces.py +++ /dev/null @@ -1,49 +0,0 @@ -""" -================================================= -Pixel importances with a parallel forest of trees -================================================= - -This example shows the use of forests of trees to evaluate the importance -of the pixels in an image classification task (faces). The hotter the pixel, -the more important. - -The code below also illustrates how the construction and the computation -of the predictions can be parallelized within multiple jobs. -""" -print(__doc__) - -from time import time -import matplotlib.pyplot as plt - -from sklearn.datasets import fetch_olivetti_faces -from sklearn.ensemble import ExtraTreesClassifier - -# Number of cores to use to perform parallel fitting of the forest model -n_jobs = 1 - -# Load the faces dataset -data = fetch_olivetti_faces() -X = data.images.reshape((len(data.images), -1)) -y = data.target - -mask = y < 5 # Limit to 5 classes -X = X[mask] -y = y[mask] - -# Build a forest and compute the pixel importances -print("Fitting ExtraTreesClassifier on faces data with %d cores..." % n_jobs) -t0 = time() -forest = ExtraTreesClassifier(n_estimators=1000, - max_features=128, - n_jobs=n_jobs, - random_state=0) - -forest.fit(X, y) -print("done in %0.3fs" % (time() - t0)) -importances = forest.feature_importances_ -importances = importances.reshape(data.images[0].shape) - -# Plot pixel importances -plt.matshow(importances, cmap=plt.cm.hot) -plt.title("Pixel importances with forests of trees") -plt.show() diff --git a/0.15/_downloads/plot_forest_iris.py b/0.15/_downloads/plot_forest_iris.py deleted file mode 100644 index 96efdab2d05a3..0000000000000 --- a/0.15/_downloads/plot_forest_iris.py +++ /dev/null @@ -1,152 +0,0 @@ -""" -==================================================================== -Plot the decision surfaces of ensembles of trees on the iris dataset -==================================================================== - -Plot the decision surfaces of forests of randomized trees trained on pairs of -features of the iris dataset. - -This plot compares the decision surfaces learned by a decision tree classifier -(first column), by a random forest classifier (second column), by an extra- -trees classifier (third column) and by an AdaBoost classifier (fourth column). - -In the first row, the classifiers are built using the sepal width and the sepal -length features only, on the second row using the petal length and sepal length -only, and on the third row using the petal width and the petal length only. - -In descending order of quality, when trained (outside of this example) on all -4 features using 30 estimators and scored using 10 fold cross validation, we see:: - - ExtraTreesClassifier() # 0.95 score - RandomForestClassifier() # 0.94 score - AdaBoost(DecisionTree(max_depth=3)) # 0.94 score - DecisionTree(max_depth=None) # 0.94 score - -Increasing `max_depth` for AdaBoost lowers the standard deviation of the scores (but -the average score does not improve). - -See the console's output for further details about each model. - -In this example you might try to: - -1) vary the ``max_depth`` for the ``DecisionTreeClassifier`` and - ``AdaBoostClassifier``, perhaps try ``max_depth=3`` for the - ``DecisionTreeClassifier`` or ``max_depth=None`` for ``AdaBoostClassifier`` -2) vary ``n_estimators`` - -It is worth noting that RandomForests and ExtraTrees can be fitted in parallel -on many cores as each tree is built independently of the others. AdaBoost's -samples are built sequentially and so do not use multiple cores. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import clone -from sklearn.datasets import load_iris -from sklearn.ensemble import (RandomForestClassifier, ExtraTreesClassifier, - AdaBoostClassifier) -from sklearn.externals.six.moves import xrange -from sklearn.tree import DecisionTreeClassifier - -# Parameters -n_classes = 3 -n_estimators = 30 -plot_colors = "ryb" -cmap = plt.cm.RdYlBu -plot_step = 0.02 # fine step width for decision surface contours -plot_step_coarser = 0.5 # step widths for coarse classifier guesses -RANDOM_SEED = 13 # fix the seed on each iteration - -# Load data -iris = load_iris() - -plot_idx = 1 - -models = [DecisionTreeClassifier(max_depth=None), - RandomForestClassifier(n_estimators=n_estimators), - ExtraTreesClassifier(n_estimators=n_estimators), - AdaBoostClassifier(DecisionTreeClassifier(max_depth=3), - n_estimators=n_estimators)] - -for pair in ([0, 1], [0, 2], [2, 3]): - for model in models: - # We only take the two corresponding features - X = iris.data[:, pair] - y = iris.target - - # Shuffle - idx = np.arange(X.shape[0]) - np.random.seed(RANDOM_SEED) - np.random.shuffle(idx) - X = X[idx] - y = y[idx] - - # Standardize - mean = X.mean(axis=0) - std = X.std(axis=0) - X = (X - mean) / std - - # Train - clf = clone(model) - clf = model.fit(X, y) - - scores = clf.score(X, y) - # Create a title for each column and the console by using str() and - # slicing away useless parts of the string - model_title = str(type(model)).split(".")[-1][:-2][:-len("Classifier")] - model_details = model_title - if hasattr(model, "estimators_"): - model_details += " with {} estimators".format(len(model.estimators_)) - print( model_details + " with features", pair, "has a score of", scores ) - - plt.subplot(3, 4, plot_idx) - if plot_idx <= len(models): - # Add a title at the top of each column - plt.title(model_title) - - # Now plot the decision boundary using a fine mesh as input to a - # filled contour plot - x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 - y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 - xx, yy = np.meshgrid(np.arange(x_min, x_max, plot_step), - np.arange(y_min, y_max, plot_step)) - - # Plot either a single DecisionTreeClassifier or alpha blend the - # decision surfaces of the ensemble of classifiers - if isinstance(model, DecisionTreeClassifier): - Z = model.predict(np.c_[xx.ravel(), yy.ravel()]) - Z = Z.reshape(xx.shape) - cs = plt.contourf(xx, yy, Z, cmap=cmap) - else: - # Choose alpha blend level with respect to the number of estimators - # that are in use (noting that AdaBoost can use fewer estimators - # than its maximum if it achieves a good enough fit early on) - estimator_alpha = 1.0 / len(model.estimators_) - for tree in model.estimators_: - Z = tree.predict(np.c_[xx.ravel(), yy.ravel()]) - Z = Z.reshape(xx.shape) - cs = plt.contourf(xx, yy, Z, alpha=estimator_alpha, cmap=cmap) - - # Build a coarser grid to plot a set of ensemble classifications - # to show how these are different to what we see in the decision - # surfaces. These points are regularly space and do not have a black outline - xx_coarser, yy_coarser = np.meshgrid(np.arange(x_min, x_max, plot_step_coarser), - np.arange(y_min, y_max, plot_step_coarser)) - Z_points_coarser = model.predict(np.c_[xx_coarser.ravel(), yy_coarser.ravel()]).reshape(xx_coarser.shape) - cs_points = plt.scatter(xx_coarser, yy_coarser, s=15, c=Z_points_coarser, cmap=cmap, edgecolors="none") - - # Plot the training points, these are clustered together and have a - # black outline - for i, c in zip(xrange(n_classes), plot_colors): - idx = np.where(y == i) - plt.scatter(X[idx, 0], X[idx, 1], c=c, label=iris.target_names[i], - cmap=cmap) - - plot_idx += 1 # move on to the next plot in sequence - -plt.suptitle("Classifiers on feature subsets of the Iris dataset") -plt.axis("tight") - -plt.show() diff --git a/0.15/_downloads/plot_gmm.py b/0.15/_downloads/plot_gmm.py deleted file mode 100644 index 1ce272706778c..0000000000000 --- a/0.15/_downloads/plot_gmm.py +++ /dev/null @@ -1,80 +0,0 @@ -""" -================================= -Gaussian Mixture Model Ellipsoids -================================= - -Plot the confidence ellipsoids of a mixture of two Gaussians with EM -and variational Dirichlet process. - -Both models have access to five components with which to fit the -data. Note that the EM model will necessarily use all five components -while the DP model will effectively only use as many as are needed for -a good fit. This is a property of the Dirichlet Process prior. Here we -can see that the EM model splits some components arbitrarily, because it -is trying to fit too many components, while the Dirichlet Process model -adapts it number of state automatically. - -This example doesn't show it, as we're in a low-dimensional space, but -another advantage of the Dirichlet process model is that it can fit -full covariance matrices effectively even when there are less examples -per cluster than there are dimensions in the data, due to -regularization properties of the inference algorithm. -""" -import itertools - -import numpy as np -from scipy import linalg -import matplotlib.pyplot as plt -import matplotlib as mpl - -from sklearn import mixture - -# Number of samples per component -n_samples = 500 - -# Generate random sample, two components -np.random.seed(0) -C = np.array([[0., -0.1], [1.7, .4]]) -X = np.r_[np.dot(np.random.randn(n_samples, 2), C), - .7 * np.random.randn(n_samples, 2) + np.array([-6, 3])] - -# Fit a mixture of Gaussians with EM using five components -gmm = mixture.GMM(n_components=5, covariance_type='full') -gmm.fit(X) - -# Fit a Dirichlet process mixture of Gaussians using five components -dpgmm = mixture.DPGMM(n_components=5, covariance_type='full') -dpgmm.fit(X) - -color_iter = itertools.cycle(['r', 'g', 'b', 'c', 'm']) - -for i, (clf, title) in enumerate([(gmm, 'GMM'), - (dpgmm, 'Dirichlet Process GMM')]): - splot = plt.subplot(2, 1, 1 + i) - Y_ = clf.predict(X) - for i, (mean, covar, color) in enumerate(zip( - clf.means_, clf._get_covars(), color_iter)): - v, w = linalg.eigh(covar) - u = w[0] / linalg.norm(w[0]) - # as the DP will not use every component it has access to - # unless it needs it, we shouldn't plot the redundant - # components. - if not np.any(Y_ == i): - continue - plt.scatter(X[Y_ == i, 0], X[Y_ == i, 1], .8, color=color) - - # Plot an ellipse to show the Gaussian component - angle = np.arctan(u[1] / u[0]) - angle = 180 * angle / np.pi # convert to degrees - ell = mpl.patches.Ellipse(mean, v[0], v[1], 180 + angle, color=color) - ell.set_clip_box(splot.bbox) - ell.set_alpha(0.5) - splot.add_artist(ell) - - plt.xlim(-10, 10) - plt.ylim(-3, 6) - plt.xticks(()) - plt.yticks(()) - plt.title(title) - -plt.show() diff --git a/0.15/_downloads/plot_gmm_classifier.py b/0.15/_downloads/plot_gmm_classifier.py deleted file mode 100644 index cebbe36cada69..0000000000000 --- a/0.15/_downloads/plot_gmm_classifier.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -================== -GMM classification -================== - -Demonstration of Gaussian mixture models for classification. - -See :ref:`gmm` for more information on the estimator. - -Plots predicted labels on both training and held out test data using a -variety of GMM classifiers on the iris dataset. - -Compares GMMs with spherical, diagonal, full, and tied covariance -matrices in increasing order of performance. Although one would -expect full covariance to perform best in general, it is prone to -overfitting on small datasets and does not generalize well to held out -test data. - -On the plots, train data is shown as dots, while test data is shown as -crosses. The iris dataset is four-dimensional. Only the first two -dimensions are shown here, and thus some points are separated in other -dimensions. -""" -print(__doc__) - -# Author: Ron Weiss , Gael Varoquaux -# License: BSD 3 clause - -# $Id$ - -import matplotlib.pyplot as plt -import matplotlib as mpl -import numpy as np - -from sklearn import datasets -from sklearn.cross_validation import StratifiedKFold -from sklearn.externals.six.moves import xrange -from sklearn.mixture import GMM - - -def make_ellipses(gmm, ax): - for n, color in enumerate('rgb'): - v, w = np.linalg.eigh(gmm._get_covars()[n][:2, :2]) - u = w[0] / np.linalg.norm(w[0]) - angle = np.arctan2(u[1], u[0]) - angle = 180 * angle / np.pi # convert to degrees - v *= 9 - ell = mpl.patches.Ellipse(gmm.means_[n, :2], v[0], v[1], - 180 + angle, color=color) - ell.set_clip_box(ax.bbox) - ell.set_alpha(0.5) - ax.add_artist(ell) - -iris = datasets.load_iris() - -# Break up the dataset into non-overlapping training (75%) and testing -# (25%) sets. -skf = StratifiedKFold(iris.target, n_folds=4) -# Only take the first fold. -train_index, test_index = next(iter(skf)) - - -X_train = iris.data[train_index] -y_train = iris.target[train_index] -X_test = iris.data[test_index] -y_test = iris.target[test_index] - -n_classes = len(np.unique(y_train)) - -# Try GMMs using different types of covariances. -classifiers = dict((covar_type, GMM(n_components=n_classes, - covariance_type=covar_type, init_params='wc', n_iter=20)) - for covar_type in ['spherical', 'diag', 'tied', 'full']) - -n_classifiers = len(classifiers) - -plt.figure(figsize=(3 * n_classifiers / 2, 6)) -plt.subplots_adjust(bottom=.01, top=0.95, hspace=.15, wspace=.05, - left=.01, right=.99) - - -for index, (name, classifier) in enumerate(classifiers.items()): - # Since we have class labels for the training data, we can - # initialize the GMM parameters in a supervised manner. - classifier.means_ = np.array([X_train[y_train == i].mean(axis=0) - for i in xrange(n_classes)]) - - # Train the other parameters using the EM algorithm. - classifier.fit(X_train) - - h = plt.subplot(2, n_classifiers / 2, index + 1) - make_ellipses(classifier, h) - - for n, color in enumerate('rgb'): - data = iris.data[iris.target == n] - plt.scatter(data[:, 0], data[:, 1], 0.8, color=color, - label=iris.target_names[n]) - # Plot the test data with crosses - for n, color in enumerate('rgb'): - data = X_test[y_test == n] - plt.plot(data[:, 0], data[:, 1], 'x', color=color) - - y_train_pred = classifier.predict(X_train) - train_accuracy = np.mean(y_train_pred.ravel() == y_train.ravel()) * 100 - plt.text(0.05, 0.9, 'Train accuracy: %.1f' % train_accuracy, - transform=h.transAxes) - - y_test_pred = classifier.predict(X_test) - test_accuracy = np.mean(y_test_pred.ravel() == y_test.ravel()) * 100 - plt.text(0.05, 0.8, 'Test accuracy: %.1f' % test_accuracy, - transform=h.transAxes) - - plt.xticks(()) - plt.yticks(()) - plt.title(name) - -plt.legend(loc='lower right', prop=dict(size=12)) - - -plt.show() diff --git a/0.15/_downloads/plot_gmm_pdf.py b/0.15/_downloads/plot_gmm_pdf.py deleted file mode 100644 index a1b7ea5de202f..0000000000000 --- a/0.15/_downloads/plot_gmm_pdf.py +++ /dev/null @@ -1,50 +0,0 @@ -""" -============================================= -Density Estimation for a mixture of Gaussians -============================================= - -Plot the density estimation of a mixture of two Gaussians. Data is -generated from two Gaussians with different centers and covariance -matrices. -""" - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.colors import LogNorm -from sklearn import mixture - -n_samples = 300 - -# generate random sample, two components -np.random.seed(0) - -# generate spherical data centered on (20, 20) -shifted_gaussian = np.random.randn(n_samples, 2) + np.array([20, 20]) - -# generate zero centered stretched Gaussian data -C = np.array([[0., -0.7], [3.5, .7]]) -stretched_gaussian = np.dot(np.random.randn(n_samples, 2), C) - -# concatenate the two datasets into the final training set -X_train = np.vstack([shifted_gaussian, stretched_gaussian]) - -# fit a Gaussian Mixture Model with two components -clf = mixture.GMM(n_components=2, covariance_type='full') -clf.fit(X_train) - -# display predicted scores by the model as a contour plot -x = np.linspace(-20.0, 30.0) -y = np.linspace(-20.0, 40.0) -X, Y = np.meshgrid(x, y) -XX = np.array([X.ravel(), Y.ravel()]).T -Z = -clf.score_samples(XX)[0] -Z = Z.reshape(X.shape) - -CS = plt.contour(X, Y, Z, norm=LogNorm(vmin=1.0, vmax=1000.0), - levels=np.logspace(0, 3, 10)) -CB = plt.colorbar(CS, shrink=0.8, extend='both') -plt.scatter(X_train[:, 0], X_train[:, 1], .8) - -plt.title('Negative log-likelihood predicted by a GMM') -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_gmm_selection.py b/0.15/_downloads/plot_gmm_selection.py deleted file mode 100644 index 435c8da5c88a5..0000000000000 --- a/0.15/_downloads/plot_gmm_selection.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -================================= -Gaussian Mixture Model Selection -================================= - -This example shows that model selection can be performed with -Gaussian Mixture Models using information-theoretic criteria (BIC). -Model selection concerns both the covariance type -and the number of components in the model. -In that case, AIC also provides the right result (not shown to save time), -but BIC is better suited if the problem is to identify the right model. -Unlike Bayesian procedures, such inferences are prior-free. - -In that case, the model with 2 components and full covariance -(which corresponds to the true generative model) is selected. -""" -print(__doc__) - -import itertools - -import numpy as np -from scipy import linalg -import matplotlib.pyplot as plt -import matplotlib as mpl - -from sklearn import mixture - -# Number of samples per component -n_samples = 500 - -# Generate random sample, two components -np.random.seed(0) -C = np.array([[0., -0.1], [1.7, .4]]) -X = np.r_[np.dot(np.random.randn(n_samples, 2), C), - .7 * np.random.randn(n_samples, 2) + np.array([-6, 3])] - -lowest_bic = np.infty -bic = [] -n_components_range = range(1, 7) -cv_types = ['spherical', 'tied', 'diag', 'full'] -for cv_type in cv_types: - for n_components in n_components_range: - # Fit a mixture of Gaussians with EM - gmm = mixture.GMM(n_components=n_components, covariance_type=cv_type) - gmm.fit(X) - bic.append(gmm.bic(X)) - if bic[-1] < lowest_bic: - lowest_bic = bic[-1] - best_gmm = gmm - -bic = np.array(bic) -color_iter = itertools.cycle(['k', 'r', 'g', 'b', 'c', 'm', 'y']) -clf = best_gmm -bars = [] - -# Plot the BIC scores -spl = plt.subplot(2, 1, 1) -for i, (cv_type, color) in enumerate(zip(cv_types, color_iter)): - xpos = np.array(n_components_range) + .2 * (i - 2) - bars.append(plt.bar(xpos, bic[i * len(n_components_range): - (i + 1) * len(n_components_range)], - width=.2, color=color)) -plt.xticks(n_components_range) -plt.ylim([bic.min() * 1.01 - .01 * bic.max(), bic.max()]) -plt.title('BIC score per model') -xpos = np.mod(bic.argmin(), len(n_components_range)) + .65 +\ - .2 * np.floor(bic.argmin() / len(n_components_range)) -plt.text(xpos, bic.min() * 0.97 + .03 * bic.max(), '*', fontsize=14) -spl.set_xlabel('Number of components') -spl.legend([b[0] for b in bars], cv_types) - -# Plot the winner -splot = plt.subplot(2, 1, 2) -Y_ = clf.predict(X) -for i, (mean, covar, color) in enumerate(zip(clf.means_, clf.covars_, - color_iter)): - v, w = linalg.eigh(covar) - if not np.any(Y_ == i): - continue - plt.scatter(X[Y_ == i, 0], X[Y_ == i, 1], .8, color=color) - - # Plot an ellipse to show the Gaussian component - angle = np.arctan2(w[0][1], w[0][0]) - angle = 180 * angle / np.pi # convert to degrees - v *= 4 - ell = mpl.patches.Ellipse(mean, v[0], v[1], 180 + angle, color=color) - ell.set_clip_box(splot.bbox) - ell.set_alpha(.5) - splot.add_artist(ell) - -plt.xlim(-10, 10) -plt.ylim(-3, 6) -plt.xticks(()) -plt.yticks(()) -plt.title('Selected GMM: full model, 2 components') -plt.subplots_adjust(hspace=.35, bottom=.02) -plt.show() diff --git a/0.15/_downloads/plot_gmm_sin.py b/0.15/_downloads/plot_gmm_sin.py deleted file mode 100644 index 0fe87a3bd71e4..0000000000000 --- a/0.15/_downloads/plot_gmm_sin.py +++ /dev/null @@ -1,82 +0,0 @@ -""" -================================= -Gaussian Mixture Model Sine Curve -================================= - -This example highlights the advantages of the Dirichlet Process: -complexity control and dealing with sparse data. The dataset is formed -by 100 points loosely spaced following a noisy sine curve. The fit by -the GMM class, using the expectation-maximization algorithm to fit a -mixture of 10 Gaussian components, finds too-small components and very -little structure. The fits by the Dirichlet process, however, show -that the model can either learn a global structure for the data (small -alpha) or easily interpolate to finding relevant local structure -(large alpha), never falling into the problems shown by the GMM class. -""" - -import itertools - -import numpy as np -from scipy import linalg -import matplotlib.pyplot as plt -import matplotlib as mpl - -from sklearn import mixture -from sklearn.externals.six.moves import xrange - -# Number of samples per component -n_samples = 100 - -# Generate random sample following a sine curve -np.random.seed(0) -X = np.zeros((n_samples, 2)) -step = 4 * np.pi / n_samples - -for i in xrange(X.shape[0]): - x = i * step - 6 - X[i, 0] = x + np.random.normal(0, 0.1) - X[i, 1] = 3 * (np.sin(x) + np.random.normal(0, .2)) - - -color_iter = itertools.cycle(['r', 'g', 'b', 'c', 'm']) - - -for i, (clf, title) in enumerate([ - (mixture.GMM(n_components=10, covariance_type='full', n_iter=100), - "Expectation-maximization"), - (mixture.DPGMM(n_components=10, covariance_type='full', alpha=0.01, - n_iter=100), - "Dirichlet Process,alpha=0.01"), - (mixture.DPGMM(n_components=10, covariance_type='diag', alpha=100., - n_iter=100), - "Dirichlet Process,alpha=100.")]): - - clf.fit(X) - splot = plt.subplot(3, 1, 1 + i) - Y_ = clf.predict(X) - for i, (mean, covar, color) in enumerate(zip( - clf.means_, clf._get_covars(), color_iter)): - v, w = linalg.eigh(covar) - u = w[0] / linalg.norm(w[0]) - # as the DP will not use every component it has access to - # unless it needs it, we shouldn't plot the redundant - # components. - if not np.any(Y_ == i): - continue - plt.scatter(X[Y_ == i, 0], X[Y_ == i, 1], .8, color=color) - - # Plot an ellipse to show the Gaussian component - angle = np.arctan(u[1] / u[0]) - angle = 180 * angle / np.pi # convert to degrees - ell = mpl.patches.Ellipse(mean, v[0], v[1], 180 + angle, color=color) - ell.set_clip_box(splot.bbox) - ell.set_alpha(0.5) - splot.add_artist(ell) - - plt.xlim(-6, 4 * np.pi - 6) - plt.ylim(-5, 5) - plt.title(title) - plt.xticks(()) - plt.yticks(()) - -plt.show() diff --git a/0.15/_downloads/plot_gp_probabilistic_classification_after_regression.py b/0.15/_downloads/plot_gp_probabilistic_classification_after_regression.py deleted file mode 100644 index 3c9887aa66852..0000000000000 --- a/0.15/_downloads/plot_gp_probabilistic_classification_after_regression.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -============================================================================== -Gaussian Processes classification example: exploiting the probabilistic output -============================================================================== - -A two-dimensional regression exercise with a post-processing allowing for -probabilistic classification thanks to the Gaussian property of the prediction. - -The figure illustrates the probability that the prediction is negative with -respect to the remaining uncertainty in the prediction. The red and blue lines -corresponds to the 95% confidence interval on the prediction of the zero level -set. -""" -print(__doc__) - -# Author: Vincent Dubourg -# Licence: BSD 3 clause - -import numpy as np -from scipy import stats -from sklearn.gaussian_process import GaussianProcess -from matplotlib import pyplot as pl -from matplotlib import cm - -# Standard normal distribution functions -phi = stats.distributions.norm().pdf -PHI = stats.distributions.norm().cdf -PHIinv = stats.distributions.norm().ppf - -# A few constants -lim = 8 - - -def g(x): - """The function to predict (classification will then consist in predicting - whether g(x) <= 0 or not)""" - return 5. - x[:, 1] - .5 * x[:, 0] ** 2. - -# Design of experiments -X = np.array([[-4.61611719, -6.00099547], - [4.10469096, 5.32782448], - [0.00000000, -0.50000000], - [-6.17289014, -4.6984743], - [1.3109306, -6.93271427], - [-5.03823144, 3.10584743], - [-2.87600388, 6.74310541], - [5.21301203, 4.26386883]]) - -# Observations -y = g(X) - -# Instanciate and fit Gaussian Process Model -gp = GaussianProcess(theta0=5e-1) - -# Don't perform MLE or you'll get a perfect prediction for this simple example! -gp.fit(X, y) - -# Evaluate real function, the prediction and its MSE on a grid -res = 50 -x1, x2 = np.meshgrid(np.linspace(- lim, lim, res), - np.linspace(- lim, lim, res)) -xx = np.vstack([x1.reshape(x1.size), x2.reshape(x2.size)]).T - -y_true = g(xx) -y_pred, MSE = gp.predict(xx, eval_MSE=True) -sigma = np.sqrt(MSE) -y_true = y_true.reshape((res, res)) -y_pred = y_pred.reshape((res, res)) -sigma = sigma.reshape((res, res)) -k = PHIinv(.975) - -# Plot the probabilistic classification iso-values using the Gaussian property -# of the prediction -fig = pl.figure(1) -ax = fig.add_subplot(111) -ax.axes.set_aspect('equal') -pl.xticks([]) -pl.yticks([]) -ax.set_xticklabels([]) -ax.set_yticklabels([]) -pl.xlabel('$x_1$') -pl.ylabel('$x_2$') - -cax = pl.imshow(np.flipud(PHI(- y_pred / sigma)), cmap=cm.gray_r, alpha=0.8, - extent=(- lim, lim, - lim, lim)) -norm = pl.matplotlib.colors.Normalize(vmin=0., vmax=0.9) -cb = pl.colorbar(cax, ticks=[0., 0.2, 0.4, 0.6, 0.8, 1.], norm=norm) -cb.set_label('${\\rm \mathbb{P}}\left[\widehat{G}(\mathbf{x}) \leq 0\\right]$') - -pl.plot(X[y <= 0, 0], X[y <= 0, 1], 'r.', markersize=12) - -pl.plot(X[y > 0, 0], X[y > 0, 1], 'b.', markersize=12) - -cs = pl.contour(x1, x2, y_true, [0.], colors='k', linestyles='dashdot') - -cs = pl.contour(x1, x2, PHI(- y_pred / sigma), [0.025], colors='b', - linestyles='solid') -pl.clabel(cs, fontsize=11) - -cs = pl.contour(x1, x2, PHI(- y_pred / sigma), [0.5], colors='k', - linestyles='dashed') -pl.clabel(cs, fontsize=11) - -cs = pl.contour(x1, x2, PHI(- y_pred / sigma), [0.975], colors='r', - linestyles='solid') -pl.clabel(cs, fontsize=11) - -pl.show() diff --git a/0.15/_downloads/plot_gp_regression.py b/0.15/_downloads/plot_gp_regression.py deleted file mode 100644 index 33b78750d1fe4..0000000000000 --- a/0.15/_downloads/plot_gp_regression.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -r""" -========================================================= -Gaussian Processes regression: basic introductory example -========================================================= - -A simple one-dimensional regression exercise computed in two different ways: - -1. A noise-free case with a cubic correlation model -2. A noisy case with a squared Euclidean correlation model - -In both cases, the model parameters are estimated using the maximum -likelihood principle. - -The figures illustrate the interpolating property of the Gaussian Process -model as well as its probabilistic nature in the form of a pointwise 95% -confidence interval. - -Note that the parameter ``nugget`` is applied as a Tikhonov regularization -of the assumed covariance between the training points. In the special case -of the squared euclidean correlation model, nugget is mathematically equivalent -to a normalized variance: That is - -.. math:: - \mathrm{nugget}_i = \left[\frac{\sigma_i}{y_i}\right]^2 - -""" -print(__doc__) - -# Author: Vincent Dubourg -# Jake Vanderplas -# Licence: BSD 3 clause - -import numpy as np -from sklearn.gaussian_process import GaussianProcess -from matplotlib import pyplot as pl - -np.random.seed(1) - - -def f(x): - """The function to predict.""" - return x * np.sin(x) - -#---------------------------------------------------------------------- -# First the noiseless case -X = np.atleast_2d([1., 3., 5., 6., 7., 8.]).T - -# Observations -y = f(X).ravel() - -# Mesh the input space for evaluations of the real function, the prediction and -# its MSE -x = np.atleast_2d(np.linspace(0, 10, 1000)).T - -# Instanciate a Gaussian Process model -gp = GaussianProcess(corr='cubic', theta0=1e-2, thetaL=1e-4, thetaU=1e-1, - random_start=100) - -# Fit to data using Maximum Likelihood Estimation of the parameters -gp.fit(X, y) - -# Make the prediction on the meshed x-axis (ask for MSE as well) -y_pred, MSE = gp.predict(x, eval_MSE=True) -sigma = np.sqrt(MSE) - -# Plot the function, the prediction and the 95% confidence interval based on -# the MSE -fig = pl.figure() -pl.plot(x, f(x), 'r:', label=u'$f(x) = x\,\sin(x)$') -pl.plot(X, y, 'r.', markersize=10, label=u'Observations') -pl.plot(x, y_pred, 'b-', label=u'Prediction') -pl.fill(np.concatenate([x, x[::-1]]), - np.concatenate([y_pred - 1.9600 * sigma, - (y_pred + 1.9600 * sigma)[::-1]]), - alpha=.5, fc='b', ec='None', label='95% confidence interval') -pl.xlabel('$x$') -pl.ylabel('$f(x)$') -pl.ylim(-10, 20) -pl.legend(loc='upper left') - -#---------------------------------------------------------------------- -# now the noisy case -X = np.linspace(0.1, 9.9, 20) -X = np.atleast_2d(X).T - -# Observations and noise -y = f(X).ravel() -dy = 0.5 + 1.0 * np.random.random(y.shape) -noise = np.random.normal(0, dy) -y += noise - -# Mesh the input space for evaluations of the real function, the prediction and -# its MSE -x = np.atleast_2d(np.linspace(0, 10, 1000)).T - -# Instanciate a Gaussian Process model -gp = GaussianProcess(corr='squared_exponential', theta0=1e-1, - thetaL=1e-3, thetaU=1, - nugget=(dy / y) ** 2, - random_start=100) - -# Fit to data using Maximum Likelihood Estimation of the parameters -gp.fit(X, y) - -# Make the prediction on the meshed x-axis (ask for MSE as well) -y_pred, MSE = gp.predict(x, eval_MSE=True) -sigma = np.sqrt(MSE) - -# Plot the function, the prediction and the 95% confidence interval based on -# the MSE -fig = pl.figure() -pl.plot(x, f(x), 'r:', label=u'$f(x) = x\,\sin(x)$') -pl.errorbar(X.ravel(), y, dy, fmt='r.', markersize=10, label=u'Observations') -pl.plot(x, y_pred, 'b-', label=u'Prediction') -pl.fill(np.concatenate([x, x[::-1]]), - np.concatenate([y_pred - 1.9600 * sigma, - (y_pred + 1.9600 * sigma)[::-1]]), - alpha=.5, fc='b', ec='None', label='95% confidence interval') -pl.xlabel('$x$') -pl.ylabel('$f(x)$') -pl.ylim(-10, 20) -pl.legend(loc='upper left') - -pl.show() diff --git a/0.15/_downloads/plot_gradient_boosting_oob.py b/0.15/_downloads/plot_gradient_boosting_oob.py deleted file mode 100644 index 639bae6b8e30b..0000000000000 --- a/0.15/_downloads/plot_gradient_boosting_oob.py +++ /dev/null @@ -1,136 +0,0 @@ -""" -====================================== -Gradient Boosting Out-of-Bag estimates -====================================== - -Out-of-bag (OOB) estimates can be a useful heuristic to estimate -the "optimal" number of boosting iterations. -OOB estimates are almost identical to cross-validation estimates but -they can be computed on-the-fly without the need for repeated model -fitting. -OOB estimates are only available for Stochastic Gradient Boosting -(i.e. ``subsample < 1.0``), the estimates are derived from the improvement -in loss based on the examples not included in the boostrap sample -(the so-called out-of-bag examples). -The OOB estimator is a pessimistic estimator of the true -test loss, but remains a fairly good approximation for a small number of trees. - -The figure shows the cumulative sum of the negative OOB improvements -as a function of the boosting iteration. As you can see, it tracks the test -loss for the first hundred iterations but then diverges in a -pessimistic way. -The figure also shows the performance of 3-fold cross validation which -usually gives a better estimate of the test loss -but is computationally more demanding. -""" -print(__doc__) - -# Author: Peter Prettenhofer -# -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import ensemble -from sklearn.cross_validation import KFold -from sklearn.cross_validation import train_test_split - - -# Generate data (adapted from G. Ridgeway's gbm example) -n_samples = 1000 -random_state = np.random.RandomState(13) -x1 = random_state.uniform(size=n_samples) -x2 = random_state.uniform(size=n_samples) -x3 = random_state.randint(0, 4, size=n_samples) - -p = 1 / (1.0 + np.exp(-(np.sin(3 * x1) - 4 * x2 + x3))) -y = random_state.binomial(1, p, size=n_samples) - -X = np.c_[x1, x2, x3] - -X = X.astype(np.float32) -X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, - random_state=9) - -# Fit classifier with out-of-bag estimates -params = {'n_estimators': 1200, 'max_depth': 3, 'subsample': 0.5, - 'learning_rate': 0.01, 'min_samples_leaf': 1, 'random_state': 3} -clf = ensemble.GradientBoostingClassifier(**params) - -clf.fit(X_train, y_train) -acc = clf.score(X_test, y_test) -print("Accuracy: {:.4f}".format(acc)) - -n_estimators = params['n_estimators'] -x = np.arange(n_estimators) + 1 - - -def heldout_score(clf, X_test, y_test): - """compute deviance scores on ``X_test`` and ``y_test``. """ - score = np.zeros((n_estimators,), dtype=np.float64) - for i, y_pred in enumerate(clf.staged_decision_function(X_test)): - score[i] = clf.loss_(y_test, y_pred) - return score - - -def cv_estimate(n_folds=3): - cv = KFold(n=X_train.shape[0], n_folds=n_folds) - cv_clf = ensemble.GradientBoostingClassifier(**params) - val_scores = np.zeros((n_estimators,), dtype=np.float64) - for train, test in cv: - cv_clf.fit(X_train[train], y_train[train]) - val_scores += heldout_score(cv_clf, X_train[test], y_train[test]) - val_scores /= n_folds - return val_scores - - -# Estimate best n_estimator using cross-validation -cv_score = cv_estimate(3) - -# Compute best n_estimator for test data -test_score = heldout_score(clf, X_test, y_test) - -# negative cumulative sum of oob improvements -cumsum = -np.cumsum(clf.oob_improvement_) - -# min loss according to OOB -oob_best_iter = x[np.argmin(cumsum)] - -# min loss according to test (normalize such that first loss is 0) -test_score -= test_score[0] -test_best_iter = x[np.argmin(test_score)] - -# min loss according to cv (normalize such that first loss is 0) -cv_score -= cv_score[0] -cv_best_iter = x[np.argmin(cv_score)] - -# color brew for the three curves -oob_color = list(map(lambda x: x / 256.0, (190, 174, 212))) -test_color = list(map(lambda x: x / 256.0, (127, 201, 127))) -cv_color = list(map(lambda x: x / 256.0, (253, 192, 134))) - -# plot curves and vertical lines for best iterations -plt.plot(x, cumsum, label='OOB loss', color=oob_color) -plt.plot(x, test_score, label='Test loss', color=test_color) -plt.plot(x, cv_score, label='CV loss', color=cv_color) -plt.axvline(x=oob_best_iter, color=oob_color) -plt.axvline(x=test_best_iter, color=test_color) -plt.axvline(x=cv_best_iter, color=cv_color) - -# add three vertical lines to xticks -xticks = plt.xticks() -xticks_pos = np.array(xticks[0].tolist() + - [oob_best_iter, cv_best_iter, test_best_iter]) -xticks_label = np.array(list(map(lambda t: int(t), xticks[0])) + - ['OOB', 'CV', 'Test']) -ind = np.argsort(xticks_pos) -xticks_pos = xticks_pos[ind] -xticks_label = xticks_label[ind] -plt.xticks(xticks_pos, xticks_label) - -plt.legend(loc='upper right') -plt.ylabel('normalized loss') -plt.xlabel('number of iterations') - -plt.show() diff --git a/0.15/_downloads/plot_gradient_boosting_quantile.py b/0.15/_downloads/plot_gradient_boosting_quantile.py deleted file mode 100644 index 6fb2731a513ec..0000000000000 --- a/0.15/_downloads/plot_gradient_boosting_quantile.py +++ /dev/null @@ -1,79 +0,0 @@ -""" -===================================================== -Prediction Intervals for Gradient Boosting Regression -===================================================== - -This example shows how quantile regression can be used -to create prediction intervals. -""" - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.ensemble import GradientBoostingRegressor - -np.random.seed(1) - - -def f(x): - """The function to predict.""" - return x * np.sin(x) - -#---------------------------------------------------------------------- -# First the noiseless case -X = np.atleast_2d(np.random.uniform(0, 10.0, size=100)).T -X = X.astype(np.float32) - -# Observations -y = f(X).ravel() - -dy = 1.5 + 1.0 * np.random.random(y.shape) -noise = np.random.normal(0, dy) -y += noise -y = y.astype(np.float32) - -# Mesh the input space for evaluations of the real function, the prediction and -# its MSE -xx = np.atleast_2d(np.linspace(0, 10, 1000)).T -xx = xx.astype(np.float32) - -alpha = 0.95 - -clf = GradientBoostingRegressor(loss='quantile', alpha=alpha, - n_estimators=250, max_depth=3, - learning_rate=.1, min_samples_leaf=9, - min_samples_split=9) - -clf.fit(X, y) - -# Make the prediction on the meshed x-axis -y_upper = clf.predict(xx) - -clf.set_params(alpha=1.0 - alpha) -clf.fit(X, y) - -# Make the prediction on the meshed x-axis -y_lower = clf.predict(xx) - -clf.set_params(loss='ls') -clf.fit(X, y) - -# Make the prediction on the meshed x-axis -y_pred = clf.predict(xx) - -# Plot the function, the prediction and the 90% confidence interval based on -# the MSE -fig = plt.figure() -plt.plot(xx, f(xx), 'g:', label=u'$f(x) = x\,\sin(x)$') -plt.plot(X, y, 'b.', markersize=10, label=u'Observations') -plt.plot(xx, y_pred, 'r-', label=u'Prediction') -plt.plot(xx, y_upper, 'k-') -plt.plot(xx, y_lower, 'k-') -plt.fill(np.concatenate([xx, xx[::-1]]), - np.concatenate([y_upper, y_lower[::-1]]), - alpha=.5, fc='b', ec='None', label='90% prediction interval') -plt.xlabel('$x$') -plt.ylabel('$f(x)$') -plt.ylim(-10, 20) -plt.legend(loc='upper left') -plt.show() diff --git a/0.15/_downloads/plot_gradient_boosting_regression.py b/0.15/_downloads/plot_gradient_boosting_regression.py deleted file mode 100644 index d12b5c541bdd1..0000000000000 --- a/0.15/_downloads/plot_gradient_boosting_regression.py +++ /dev/null @@ -1,76 +0,0 @@ -""" -============================ -Gradient Boosting regression -============================ - -Demonstrate Gradient Boosting on the boston housing dataset. - -This example fits a Gradient Boosting model with least squares loss and -500 regression trees of depth 4. -""" -print(__doc__) - -# Author: Peter Prettenhofer -# -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import ensemble -from sklearn import datasets -from sklearn.utils import shuffle -from sklearn.metrics import mean_squared_error - -############################################################################### -# Load data -boston = datasets.load_boston() -X, y = shuffle(boston.data, boston.target, random_state=13) -X = X.astype(np.float32) -offset = int(X.shape[0] * 0.9) -X_train, y_train = X[:offset], y[:offset] -X_test, y_test = X[offset:], y[offset:] - -############################################################################### -# Fit regression model -params = {'n_estimators': 500, 'max_depth': 4, 'min_samples_split': 1, - 'learning_rate': 0.01, 'loss': 'ls'} -clf = ensemble.GradientBoostingRegressor(**params) - -clf.fit(X_train, y_train) -mse = mean_squared_error(y_test, clf.predict(X_test)) -print("MSE: %.4f" % mse) - -############################################################################### -# Plot training deviance - -# compute test set deviance -test_score = np.zeros((params['n_estimators'],), dtype=np.float64) - -for i, y_pred in enumerate(clf.staged_decision_function(X_test)): - test_score[i] = clf.loss_(y_test, y_pred) - -plt.figure(figsize=(12, 6)) -plt.subplot(1, 2, 1) -plt.title('Deviance') -plt.plot(np.arange(params['n_estimators']) + 1, clf.train_score_, 'b-', - label='Training Set Deviance') -plt.plot(np.arange(params['n_estimators']) + 1, test_score, 'r-', - label='Test Set Deviance') -plt.legend(loc='upper right') -plt.xlabel('Boosting Iterations') -plt.ylabel('Deviance') - -############################################################################### -# Plot feature importance -feature_importance = clf.feature_importances_ -# make importances relative to max importance -feature_importance = 100.0 * (feature_importance / feature_importance.max()) -sorted_idx = np.argsort(feature_importance) -pos = np.arange(sorted_idx.shape[0]) + .5 -plt.subplot(1, 2, 2) -plt.barh(pos, feature_importance[sorted_idx], align='center') -plt.yticks(pos, boston.feature_names[sorted_idx]) -plt.xlabel('Relative Importance') -plt.title('Variable Importance') -plt.show() diff --git a/0.15/_downloads/plot_gradient_boosting_regularization.py b/0.15/_downloads/plot_gradient_boosting_regularization.py deleted file mode 100644 index e5a01240ccdb0..0000000000000 --- a/0.15/_downloads/plot_gradient_boosting_regularization.py +++ /dev/null @@ -1,79 +0,0 @@ -""" -================================ -Gradient Boosting regularization -================================ - -Illustration of the effect of different regularization strategies -for Gradient Boosting. The example is taken from Hastie et al 2009. - -The loss function used is binomial deviance. Regularization via -shrinkage (``learning_rate < 1.0``) improves performance considerably. -In combination with shrinkage, stochastic gradient boosting -(``subsample < 1.0``) can produce more accurate models by reducing the -variance via bagging. -Subsampling without shrinkage usually does poorly. -Another strategy to reduce the variance is by subsampling the features -analogous to the random splits in Random Forests -(via the ``max_features`` parameter). - -.. [1] T. Hastie, R. Tibshirani and J. Friedman, "Elements of Statistical - Learning Ed. 2", Springer, 2009. -""" -print(__doc__) - -# Author: Peter Prettenhofer -# -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import ensemble -from sklearn import datasets - - -X, y = datasets.make_hastie_10_2(n_samples=12000, random_state=1) -X = X.astype(np.float32) - -# map labels from {-1, 1} to {0, 1} -labels, y = np.unique(y, return_inverse=True) - -X_train, X_test = X[:2000], X[2000:] -y_train, y_test = y[:2000], y[2000:] - -original_params = {'n_estimators': 1000, 'max_leaf_nodes': 4, 'max_depth': None, 'random_state': 2, - 'min_samples_split': 5} - -plt.figure() - -for label, color, setting in [('No shrinkage', 'orange', - {'learning_rate': 1.0, 'subsample': 1.0}), - ('learning_rate=0.1', 'turquoise', - {'learning_rate': 0.1, 'subsample': 1.0}), - ('subsample=0.5', 'blue', - {'learning_rate': 1.0, 'subsample': 0.5}), - ('learning_rate=0.1, subsample=0.5', 'gray', - {'learning_rate': 0.1, 'subsample': 0.5}), - ('learning_rate=0.1, max_features=2', 'magenta', - {'learning_rate': 0.1, 'max_features': 2})]: - params = dict(original_params) - params.update(setting) - - clf = ensemble.GradientBoostingClassifier(**params) - clf.fit(X_train, y_train) - - # compute test set deviance - test_deviance = np.zeros((params['n_estimators'],), dtype=np.float64) - - for i, y_pred in enumerate(clf.staged_decision_function(X_test)): - # clf.loss_ assumes that y_test[i] in {0, 1} - test_deviance[i] = clf.loss_(y_test, y_pred) - - plt.plot((np.arange(test_deviance.shape[0]) + 1)[::5], test_deviance[::5], - '-', color=color, label=label) - -plt.legend(loc='upper left') -plt.xlabel('Boosting Iterations') -plt.ylabel('Test Set Deviance') - -plt.show() diff --git a/0.15/_downloads/plot_ica_blind_source_separation.py b/0.15/_downloads/plot_ica_blind_source_separation.py deleted file mode 100644 index 9ba5a1523a3c6..0000000000000 --- a/0.15/_downloads/plot_ica_blind_source_separation.py +++ /dev/null @@ -1,73 +0,0 @@ -""" -===================================== -Blind source separation using FastICA -===================================== - -An example of estimating sources from noisy data. - -:ref:`ICA` is used to estimate sources given noisy measurements. -Imagine 3 instruments playing simultaneously and 3 microphones -recording the mixed signals. ICA is used to recover the sources -ie. what is played by each instrument. Importantly, PCA fails -at recovering our `instruments` since the related signals reflect -non-Gaussian processes. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from scipy import signal - -from sklearn.decomposition import FastICA, PCA - -############################################################################### -# Generate sample data -np.random.seed(0) -n_samples = 2000 -time = np.linspace(0, 8, n_samples) - -s1 = np.sin(2 * time) # Signal 1 : sinusoidal signal -s2 = np.sign(np.sin(3 * time)) # Signal 2 : square signal -s3 = signal.sawtooth(2 * np.pi * time) # Signal 3: saw tooth signal - -S = np.c_[s1, s2, s3] -S += 0.2 * np.random.normal(size=S.shape) # Add noise - -S /= S.std(axis=0) # Standardize data -# Mix data -A = np.array([[1, 1, 1], [0.5, 2, 1.0], [1.5, 1.0, 2.0]]) # Mixing matrix -X = np.dot(S, A.T) # Generate observations - -# Compute ICA -ica = FastICA(n_components=3) -S_ = ica.fit_transform(X) # Reconstruct signals -A_ = ica.mixing_ # Get estimated mixing matrix - -# We can `prove` that the ICA model applies by reverting the unmixing. -assert np.allclose(X, np.dot(S_, A_.T) + ica.mean_) - -# For comparison, compute PCA -pca = PCA(n_components=3) -H = pca.fit_transform(X) # Reconstruct signals based on orthogonal components - -############################################################################### -# Plot results - -plt.figure() - -models = [X, S, S_, H] -names = ['Observations (mixed signal)', - 'True Sources', - 'ICA recovered signals', - 'PCA recovered signals'] -colors = ['red', 'steelblue', 'orange'] - -for ii, (model, name) in enumerate(zip(models, names), 1): - plt.subplot(4, 1, ii) - plt.title(name) - for sig, color in zip(model.T, colors): - plt.plot(sig, color=color) - -plt.subplots_adjust(0.09, 0.04, 0.94, 0.94, 0.26, 0.46) -plt.show() diff --git a/0.15/_downloads/plot_ica_vs_pca.py b/0.15/_downloads/plot_ica_vs_pca.py deleted file mode 100644 index b53230f3fdcf4..0000000000000 --- a/0.15/_downloads/plot_ica_vs_pca.py +++ /dev/null @@ -1,105 +0,0 @@ -""" -========================== -FastICA on 2D point clouds -========================== - -This example illustrates visually in the feature space a comparison by -results using two different component analysis techniques. - -:ref:`ICA` vs :ref:`PCA`. - -Representing ICA in the feature space gives the view of 'geometric ICA': -ICA is an algorithm that finds directions in the feature space -corresponding to projections with high non-Gaussianity. These directions -need not be orthogonal in the original feature space, but they are -orthogonal in the whitened feature space, in which all directions -correspond to the same variance. - -PCA, on the other hand, finds orthogonal directions in the raw feature -space that correspond to directions accounting for maximum variance. - -Here we simulate independent sources using a highly non-Gaussian -process, 2 student T with a low number of degrees of freedom (top left -figure). We mix them to create observations (top right figure). -In this raw observation space, directions identified by PCA are -represented by orange vectors. We represent the signal in the PCA space, -after whitening by the variance corresponding to the PCA vectors (lower -left). Running ICA corresponds to finding a rotation in this space to -identify the directions of largest non-Gaussianity (lower right). -""" -print(__doc__) - -# Authors: Alexandre Gramfort, Gael Varoquaux -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.decomposition import PCA, FastICA - -############################################################################### -# Generate sample data -rng = np.random.RandomState(42) -S = rng.standard_t(1.5, size=(20000, 2)) -S[:, 0] *= 2. - -# Mix data -A = np.array([[1, 1], [0, 2]]) # Mixing matrix - -X = np.dot(S, A.T) # Generate observations - -pca = PCA() -S_pca_ = pca.fit(X).transform(X) - -ica = FastICA(random_state=rng) -S_ica_ = ica.fit(X).transform(X) # Estimate the sources - -S_ica_ /= S_ica_.std(axis=0) - - -############################################################################### -# Plot results - -def plot_samples(S, axis_list=None): - plt.scatter(S[:, 0], S[:, 1], s=2, marker='o', linewidths=0, zorder=10, - color='steelblue', alpha=0.5) - if axis_list is not None: - colors = ['orange', 'red'] - for color, axis in zip(colors, axis_list): - axis /= axis.std() - x_axis, y_axis = axis - # Trick to get legend to work - plt.plot(0.1 * x_axis, 0.1 * y_axis, linewidth=2, color=color) - plt.quiver(0, 0, x_axis, y_axis, zorder=11, width=0.01, scale=6, - color=color) - - plt.hlines(0, -3, 3) - plt.vlines(0, -3, 3) - plt.xlim(-3, 3) - plt.ylim(-3, 3) - plt.xlabel('x') - plt.ylabel('y') - -plt.figure() -plt.subplot(2, 2, 1) -plot_samples(S / S.std()) -plt.title('True Independent Sources') - -axis_list = [pca.components_.T, ica.mixing_] -plt.subplot(2, 2, 2) -plot_samples(X / np.std(X), axis_list=axis_list) -legend = plt.legend(['PCA', 'ICA'], loc='upper right') -legend.set_zorder(100) - -plt.title('Observations') - -plt.subplot(2, 2, 3) -plot_samples(S_pca_ / np.std(S_pca_, axis=0)) -plt.title('PCA recovered signals') - -plt.subplot(2, 2, 4) -plot_samples(S_ica_ / np.std(S_ica_)) -plt.title('ICA recovered signals') - -plt.subplots_adjust(0.09, 0.04, 0.94, 0.94, 0.26, 0.36) -plt.show() diff --git a/0.15/_downloads/plot_image_denoising.py b/0.15/_downloads/plot_image_denoising.py deleted file mode 100644 index 09bf83c006c5d..0000000000000 --- a/0.15/_downloads/plot_image_denoising.py +++ /dev/null @@ -1,164 +0,0 @@ -""" -========================================= -Image denoising using dictionary learning -========================================= - -An example comparing the effect of reconstructing noisy fragments -of the Lena image using firstly online :ref:`DictionaryLearning` and -various transform methods. - -The dictionary is fitted on the distorted left half of the image, and -subsequently used to reconstruct the right half. Note that even better -performance could be achieved by fitting to an undistorted (i.e. -noiseless) image, but here we start from the assumption that it is not -available. - -A common practice for evaluating the results of image denoising is by looking -at the difference between the reconstruction and the original image. If the -reconstruction is perfect this will look like Gaussian noise. - -It can be seen from the plots that the results of :ref:`omp` with two -non-zero coefficients is a bit less biased than when keeping only one -(the edges look less prominent). It is in addition closer from the ground -truth in Frobenius norm. - -The result of :ref:`least_angle_regression` is much more strongly biased: the -difference is reminiscent of the local intensity value of the original image. - -Thresholding is clearly not useful for denoising, but it is here to show that -it can produce a suggestive output with very high speed, and thus be useful -for other tasks such as object classification, where performance is not -necessarily related to visualisation. - -""" -print(__doc__) - -from time import time - -import matplotlib.pyplot as plt -import numpy as np - -from scipy.misc import lena - -from sklearn.decomposition import MiniBatchDictionaryLearning -from sklearn.feature_extraction.image import extract_patches_2d -from sklearn.feature_extraction.image import reconstruct_from_patches_2d - -############################################################################### -# Load Lena image and extract patches - -lena = lena() / 256.0 - -# downsample for higher speed -lena = lena[::2, ::2] + lena[1::2, ::2] + lena[::2, 1::2] + lena[1::2, 1::2] -lena /= 4.0 -height, width = lena.shape - -# Distort the right half of the image -print('Distorting image...') -distorted = lena.copy() -distorted[:, height // 2:] += 0.075 * np.random.randn(width, height // 2) - -# Extract all reference patches from the left half of the image -print('Extracting reference patches...') -t0 = time() -patch_size = (7, 7) -data = extract_patches_2d(distorted[:, :height // 2], patch_size) -data = data.reshape(data.shape[0], -1) -data -= np.mean(data, axis=0) -data /= np.std(data, axis=0) -print('done in %.2fs.' % (time() - t0)) - -############################################################################### -# Learn the dictionary from reference patches - -print('Learning the dictionary...') -t0 = time() -dico = MiniBatchDictionaryLearning(n_components=100, alpha=1, n_iter=500) -V = dico.fit(data).components_ -dt = time() - t0 -print('done in %.2fs.' % dt) - -plt.figure(figsize=(4.2, 4)) -for i, comp in enumerate(V[:100]): - plt.subplot(10, 10, i + 1) - plt.imshow(comp.reshape(patch_size), cmap=plt.cm.gray_r, - interpolation='nearest') - plt.xticks(()) - plt.yticks(()) -plt.suptitle('Dictionary learned from Lena patches\n' + - 'Train time %.1fs on %d patches' % (dt, len(data)), - fontsize=16) -plt.subplots_adjust(0.08, 0.02, 0.92, 0.85, 0.08, 0.23) - - -############################################################################### -# Display the distorted image - -def show_with_diff(image, reference, title): - """Helper function to display denoising""" - plt.figure(figsize=(5, 3.3)) - plt.subplot(1, 2, 1) - plt.title('Image') - plt.imshow(image, vmin=0, vmax=1, cmap=plt.cm.gray, interpolation='nearest') - plt.xticks(()) - plt.yticks(()) - plt.subplot(1, 2, 2) - difference = image - reference - - plt.title('Difference (norm: %.2f)' % np.sqrt(np.sum(difference ** 2))) - plt.imshow(difference, vmin=-0.5, vmax=0.5, cmap=plt.cm.PuOr, - interpolation='nearest') - plt.xticks(()) - plt.yticks(()) - plt.suptitle(title, size=16) - plt.subplots_adjust(0.02, 0.02, 0.98, 0.79, 0.02, 0.2) - -show_with_diff(distorted, lena, 'Distorted image') - -############################################################################### -# Extract noisy patches and reconstruct them using the dictionary - -print('Extracting noisy patches... ') -t0 = time() -data = extract_patches_2d(distorted[:, height // 2:], patch_size) -data = data.reshape(data.shape[0], -1) -intercept = np.mean(data, axis=0) -data -= intercept -print('done in %.2fs.' % (time() - t0)) - -transform_algorithms = [ - ('Orthogonal Matching Pursuit\n1 atom', 'omp', - {'transform_n_nonzero_coefs': 1}), - ('Orthogonal Matching Pursuit\n2 atoms', 'omp', - {'transform_n_nonzero_coefs': 2}), - ('Least-angle regression\n5 atoms', 'lars', - {'transform_n_nonzero_coefs': 5}), - ('Thresholding\n alpha=0.1', 'threshold', {'transform_alpha': .1})] - -reconstructions = {} -for title, transform_algorithm, kwargs in transform_algorithms: - print(title + '...') - reconstructions[title] = lena.copy() - t0 = time() - dico.set_params(transform_algorithm=transform_algorithm, **kwargs) - code = dico.transform(data) - patches = np.dot(code, V) - - if transform_algorithm == 'threshold': - patches -= patches.min() - patches /= patches.max() - - patches += intercept - patches = patches.reshape(len(data), *patch_size) - if transform_algorithm == 'threshold': - patches -= patches.min() - patches /= patches.max() - reconstructions[title][:, height // 2:] = reconstruct_from_patches_2d( - patches, (width, height // 2)) - dt = time() - t0 - print('done in %.2fs.' % dt) - show_with_diff(reconstructions[title], lena, - title + ' (time: %.1fs)' % dt) - -plt.show() diff --git a/0.15/_downloads/plot_incremental_pca.py b/0.15/_downloads/plot_incremental_pca.py deleted file mode 100644 index 899ae6ce1cff0..0000000000000 --- a/0.15/_downloads/plot_incremental_pca.py +++ /dev/null @@ -1,58 +0,0 @@ -""" - -=============== -Incremental PCA -=============== - -Incremental principal component analysis (IPCA) is typically used as a -replacement for principal component analysis (PCA) when the dataset to be -decomposed is too large to fit in memory. IPCA builds a low-rank approximation -for the input data using an amount of memory which is independent of the -number of input data samples. It is still dependent on the input data features, -but changing the batch size allows for control of memory usage. - -This example serves as a visual check that IPCA is able to find a similar -projection of the data to PCA (to a sign flip), while only processing a -few samples at a time. This can be considered a "toy example", as IPCA is -intended for large datasets which do not fit in main memory, requiring -incremental approaches. - -""" -print(__doc__) - -# Authors: Kyle Kastner -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.datasets import load_iris -from sklearn.decomposition import PCA, IncrementalPCA - -iris = load_iris() -X = iris.data -y = iris.target - -n_components = 2 -ipca = IncrementalPCA(n_components=n_components, batch_size=10) -X_ipca = ipca.fit_transform(X) - -pca = PCA(n_components=n_components) -X_pca = pca.fit_transform(X) - -for X_transformed, title in [(X_ipca, "Incremental PCA"), (X_pca, "PCA")]: - plt.figure(figsize=(8, 8)) - for c, i, target_name in zip("rgb", [0, 1, 2], iris.target_names): - plt.scatter(X_transformed[y == i, 0], X_transformed[y == i, 1], - c=c, label=target_name) - - if "Incremental" in title: - err = np.abs(np.abs(X_pca) - np.abs(X_ipca)).mean() - plt.title(title + " of iris dataset\nMean absolute unsigned error " - "%.6f" % err) - else: - plt.title(title + " of iris dataset") - plt.legend(loc="best") - plt.axis([-4, 4, -1.5, 1.5]) - -plt.show() diff --git a/0.15/_downloads/plot_iris.py b/0.15/_downloads/plot_iris.py deleted file mode 100644 index 2fe6d64daca49..0000000000000 --- a/0.15/_downloads/plot_iris.py +++ /dev/null @@ -1,93 +0,0 @@ -""" -================================================== -Plot different SVM classifiers in the iris dataset -================================================== - -Comparison of different linear SVM classifiers on a 2D projection of the iris -dataset. We only consider the first 2 features of this dataset: - -- Sepal length -- Sepal width - -This example shows how to plot the decision surface for four SVM classifiers -with different kernels. - -The linear models ``LinearSVC()`` and ``SVC(kernel='linear')`` yield slightly -different decision boundaries. This can be a consequence of the following -differences: - -- ``LinearSVC`` minimizes the squared hinge loss while ``SVC`` minimizes the - regular hinge loss. - -- ``LinearSVC`` uses the One-vs-All (also known as One-vs-Rest) multiclass - reduction while ``SVC`` uses the One-vs-One multiclass reduction. - -Both linear models have linear decision boundaries (intersecting hyperplanes) -while the non-linear kernel models (polynomial or Gaussian RBF) have more -flexible non-linear decision boundaries with shapes that depend on the kind of -kernel and its parameters. - -.. NOTE:: while plotting the decision function of classifiers for toy 2D - datasets can help get an intuitive understanding of their respective - expressive power, be aware that those intuitions don't always generalize to - more realistic high-dimensional problem. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm, datasets - -# import some data to play with -iris = datasets.load_iris() -X = iris.data[:, :2] # we only take the first two features. We could - # avoid this ugly slicing by using a two-dim dataset -y = iris.target - -h = .02 # step size in the mesh - -# we create an instance of SVM and fit out data. We do not scale our -# data since we want to plot the support vectors -C = 1.0 # SVM regularization parameter -svc = svm.SVC(kernel='linear', C=C).fit(X, y) -rbf_svc = svm.SVC(kernel='rbf', gamma=0.7, C=C).fit(X, y) -poly_svc = svm.SVC(kernel='poly', degree=3, C=C).fit(X, y) -lin_svc = svm.LinearSVC(C=C).fit(X, y) - -# create a mesh to plot in -x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 -y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 -xx, yy = np.meshgrid(np.arange(x_min, x_max, h), - np.arange(y_min, y_max, h)) - -# title for the plots -titles = ['SVC with linear kernel', - 'LinearSVC (linear kernel)', - 'SVC with RBF kernel', - 'SVC with polynomial (degree 3) kernel'] - - -for i, clf in enumerate((svc, lin_svc, rbf_svc, poly_svc)): - # Plot the decision boundary. For that, we will assign a color to each - # point in the mesh [x_min, m_max]x[y_min, y_max]. - plt.subplot(2, 2, i + 1) - plt.subplots_adjust(wspace=0.4, hspace=0.4) - - Z = clf.predict(np.c_[xx.ravel(), yy.ravel()]) - - # Put the result into a color plot - Z = Z.reshape(xx.shape) - plt.contourf(xx, yy, Z, cmap=plt.cm.Paired, alpha=0.8) - - # Plot also the training points - plt.scatter(X[:, 0], X[:, 1], c=y, cmap=plt.cm.Paired) - plt.xlabel('Sepal length') - plt.ylabel('Sepal width') - plt.xlim(xx.min(), xx.max()) - plt.ylim(yy.min(), yy.max()) - plt.xticks(()) - plt.yticks(()) - plt.title(titles[i]) - -plt.show() diff --git a/0.15/_downloads/plot_iris1.py b/0.15/_downloads/plot_iris1.py deleted file mode 100644 index d30674b11b177..0000000000000 --- a/0.15/_downloads/plot_iris1.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -================================================================ -Plot the decision surface of a decision tree on the iris dataset -================================================================ - -Plot the decision surface of a decision tree trained on pairs -of features of the iris dataset. - -See :ref:`decision tree ` for more information on the estimator. - -For each pair of iris features, the decision tree learns decision -boundaries made of combinations of simple thresholding rules inferred from -the training samples. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.datasets import load_iris -from sklearn.tree import DecisionTreeClassifier - -# Parameters -n_classes = 3 -plot_colors = "bry" -plot_step = 0.02 - -# Load data -iris = load_iris() - -for pairidx, pair in enumerate([[0, 1], [0, 2], [0, 3], - [1, 2], [1, 3], [2, 3]]): - # We only take the two corresponding features - X = iris.data[:, pair] - y = iris.target - - # Shuffle - idx = np.arange(X.shape[0]) - np.random.seed(13) - np.random.shuffle(idx) - X = X[idx] - y = y[idx] - - # Standardize - mean = X.mean(axis=0) - std = X.std(axis=0) - X = (X - mean) / std - - # Train - clf = DecisionTreeClassifier().fit(X, y) - - # Plot the decision boundary - plt.subplot(2, 3, pairidx + 1) - - x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 - y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 - xx, yy = np.meshgrid(np.arange(x_min, x_max, plot_step), - np.arange(y_min, y_max, plot_step)) - - Z = clf.predict(np.c_[xx.ravel(), yy.ravel()]) - Z = Z.reshape(xx.shape) - cs = plt.contourf(xx, yy, Z, cmap=plt.cm.Paired) - - plt.xlabel(iris.feature_names[pair[0]]) - plt.ylabel(iris.feature_names[pair[1]]) - plt.axis("tight") - - # Plot the training points - for i, color in zip(range(n_classes), plot_colors): - idx = np.where(y == i) - plt.scatter(X[idx, 0], X[idx, 1], c=color, label=iris.target_names[i], - cmap=plt.cm.Paired) - - plt.axis("tight") - -plt.suptitle("Decision surface of a decision tree using paired features") -plt.legend() -plt.show() diff --git a/0.15/_downloads/plot_iris_dataset.py b/0.15/_downloads/plot_iris_dataset.py deleted file mode 100644 index 2436dac67253c..0000000000000 --- a/0.15/_downloads/plot_iris_dataset.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -The Iris Dataset -========================================================= -This data sets consists of 3 different types of irises' -(Setosa, Versicolour, and Virginica) petal and sepal -length, stored in a 150x4 numpy.ndarray - -The rows being the samples and the columns being: -Sepal Length, Sepal Width, Petal Length and Petal Width. - -The below plot uses the first two features. -See `here `_ for more -information on this dataset. -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -import matplotlib.pyplot as plt -from mpl_toolkits.mplot3d import Axes3D -from sklearn import datasets -from sklearn.decomposition import PCA - -# import some data to play with -iris = datasets.load_iris() -X = iris.data[:, :2] # we only take the first two features. -Y = iris.target - -x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5 -y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5 - -plt.figure(2, figsize=(8, 6)) -plt.clf() - -# Plot the training points -plt.scatter(X[:, 0], X[:, 1], c=Y, cmap=plt.cm.Paired) -plt.xlabel('Sepal length') -plt.ylabel('Sepal width') - -plt.xlim(x_min, x_max) -plt.ylim(y_min, y_max) -plt.xticks(()) -plt.yticks(()) - -# To getter a better understanding of interaction of the dimensions -# plot the first three PCA dimensions -fig = plt.figure(1, figsize=(8, 6)) -ax = Axes3D(fig, elev=-150, azim=110) -X_reduced = PCA(n_components=3).fit_transform(iris.data) -ax.scatter(X_reduced[:, 0], X_reduced[:, 1], X_reduced[:, 2], c=Y, - cmap=plt.cm.Paired) -ax.set_title("First three PCA directions") -ax.set_xlabel("1st eigenvector") -ax.w_xaxis.set_ticklabels([]) -ax.set_ylabel("2nd eigenvector") -ax.w_yaxis.set_ticklabels([]) -ax.set_zlabel("3rd eigenvector") -ax.w_zaxis.set_ticklabels([]) - -plt.show() diff --git a/0.15/_downloads/plot_iris_exercise.py b/0.15/_downloads/plot_iris_exercise.py deleted file mode 100644 index cf1da9109aaaf..0000000000000 --- a/0.15/_downloads/plot_iris_exercise.py +++ /dev/null @@ -1,65 +0,0 @@ -""" -================================ -SVM Exercise -================================ - -A tutorial exercise for using different SVM kernels. - -This exercise is used in the :ref:`using_kernels_tut` part of the -:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. -""" -print(__doc__) - - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import datasets, svm - -iris = datasets.load_iris() -X = iris.data -y = iris.target - -X = X[y != 0, :2] -y = y[y != 0] - -n_sample = len(X) - -np.random.seed(0) -order = np.random.permutation(n_sample) -X = X[order] -y = y[order].astype(np.float) - -X_train = X[:.9 * n_sample] -y_train = y[:.9 * n_sample] -X_test = X[.9 * n_sample:] -y_test = y[.9 * n_sample:] - -# fit the model -for fig_num, kernel in enumerate(('linear', 'rbf', 'poly')): - clf = svm.SVC(kernel=kernel, gamma=10) - clf.fit(X_train, y_train) - - plt.figure(fig_num) - plt.clf() - plt.scatter(X[:, 0], X[:, 1], c=y, zorder=10, cmap=plt.cm.Paired) - - # Circle out the test data - plt.scatter(X_test[:, 0], X_test[:, 1], s=80, facecolors='none', zorder=10) - - plt.axis('tight') - x_min = X[:, 0].min() - x_max = X[:, 0].max() - y_min = X[:, 1].min() - y_max = X[:, 1].max() - - XX, YY = np.mgrid[x_min:x_max:200j, y_min:y_max:200j] - Z = clf.decision_function(np.c_[XX.ravel(), YY.ravel()]) - - # Put the result into a color plot - Z = Z.reshape(XX.shape) - plt.pcolormesh(XX, YY, Z > 0, cmap=plt.cm.Paired) - plt.contour(XX, YY, Z, colors=['k', 'k', 'k'], linestyles=['--', '-', '--'], - levels=[-.5, 0, .5]) - - plt.title(kernel) -plt.show() diff --git a/0.15/_downloads/plot_iris_logistic.py b/0.15/_downloads/plot_iris_logistic.py deleted file mode 100644 index 4cd705dc32df3..0000000000000 --- a/0.15/_downloads/plot_iris_logistic.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -Logistic Regression 3-class Classifier -========================================================= - -Show below is a logistic-regression classifiers decision boundaries on the -`iris `_ dataset. The -datapoints are colored according to their labels. - -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import linear_model, datasets - -# import some data to play with -iris = datasets.load_iris() -X = iris.data[:, :2] # we only take the first two features. -Y = iris.target - -h = .02 # step size in the mesh - -logreg = linear_model.LogisticRegression(C=1e5) - -# we create an instance of Neighbours Classifier and fit the data. -logreg.fit(X, Y) - -# Plot the decision boundary. For that, we will assign a color to each -# point in the mesh [x_min, m_max]x[y_min, y_max]. -x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5 -y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5 -xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h)) -Z = logreg.predict(np.c_[xx.ravel(), yy.ravel()]) - -# Put the result into a color plot -Z = Z.reshape(xx.shape) -plt.figure(1, figsize=(4, 3)) -plt.pcolormesh(xx, yy, Z, cmap=plt.cm.Paired) - -# Plot also the training points -plt.scatter(X[:, 0], X[:, 1], c=Y, edgecolors='k', cmap=plt.cm.Paired) -plt.xlabel('Sepal length') -plt.ylabel('Sepal width') - -plt.xlim(xx.min(), xx.max()) -plt.ylim(yy.min(), yy.max()) -plt.xticks(()) -plt.yticks(()) - -plt.show() diff --git a/0.15/_downloads/plot_isotonic_regression.py b/0.15/_downloads/plot_isotonic_regression.py deleted file mode 100644 index 45a369e5b6e3e..0000000000000 --- a/0.15/_downloads/plot_isotonic_regression.py +++ /dev/null @@ -1,58 +0,0 @@ -""" -=================== -Isotonic Regression -=================== - -An illustration of the isotonic regression on generated data. The -isotonic regression finds a non-decreasing approximation of a function -while minimizing the mean squared error on the training data. The benefit -of such a model is that it does not assume any form for the target -function such as linearity. For comparison a linear regression is also -presented. - -""" -print(__doc__) - -# Author: Nelle Varoquaux -# Alexandre Gramfort -# Licence: BSD - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.collections import LineCollection - -from sklearn.linear_model import LinearRegression -from sklearn.isotonic import IsotonicRegression -from sklearn.utils import check_random_state - -n = 100 -x = np.arange(n) -rs = check_random_state(0) -y = rs.randint(-50, 50, size=(n,)) + 50. * np.log(1 + np.arange(n)) - -############################################################################### -# Fit IsotonicRegression and LinearRegression models - -ir = IsotonicRegression() - -y_ = ir.fit_transform(x, y) - -lr = LinearRegression() -lr.fit(x[:, np.newaxis], y) # x needs to be 2d for LinearRegression - -############################################################################### -# plot result - -segments = [[[i, y[i]], [i, y_[i]]] for i in range(n)] -lc = LineCollection(segments, zorder=0) -lc.set_array(np.ones(len(y))) -lc.set_linewidths(0.5 * np.ones(n)) - -fig = plt.figure() -plt.plot(x, y, 'r.', markersize=12) -plt.plot(x, y_, 'g.-', markersize=12) -plt.plot(x, lr.predict(x[:, np.newaxis]), 'b-') -plt.gca().add_collection(lc) -plt.legend(('Data', 'Isotonic Fit', 'Linear Fit'), loc='lower right') -plt.title('Isotonic regression') -plt.show() diff --git a/0.15/_downloads/plot_johnson_lindenstrauss_bound.py b/0.15/_downloads/plot_johnson_lindenstrauss_bound.py deleted file mode 100644 index 4e292814f5796..0000000000000 --- a/0.15/_downloads/plot_johnson_lindenstrauss_bound.py +++ /dev/null @@ -1,198 +0,0 @@ -""" -===================================================================== -The Johnson-Lindenstrauss bound for embedding with random projections -===================================================================== - - -The `Johnson-Lindenstrauss lemma`_ states that any high dimensional -dataset can be randomly projected into a lower dimensional Euclidean -space while controlling the distortion in the pairwise distances. - -.. _`Johnson-Lindenstrauss lemma`: http://en.wikipedia.org/wiki/Johnson%E2%80%93Lindenstrauss_lemma - - -Theoretical bounds -================== - -The distortion introduced by a random projection `p` is asserted by -the fact that `p` is defining an eps-embedding with good probability -as defined by: - - (1 - eps) ||u - v||^2 < ||p(u) - p(v)||^2 < (1 + eps) ||u - v||^2 - -Where u and v are any rows taken from a dataset of shape [n_samples, -n_features] and p is a projection by a random Gaussian N(0, 1) matrix -with shape [n_components, n_features] (or a sparse Achlioptas matrix). - -The minimum number of components to guarantees the eps-embedding is -given by: - - n_components >= 4 log(n_samples) / (eps^2 / 2 - eps^3 / 3) - - -The first plot shows that with an increasing number of samples ``n_samples``, -the minimal number of dimensions ``n_components`` increased logarithmically -in order to guarantee an ``eps``-embedding. - -The second plot shows that an increase of the admissible -distortion ``eps`` allows to reduce drastically the minimal number of -dimensions ``n_components`` for a given number of samples ``n_samples`` - - -Empirical validation -==================== - -We validate the above bounds on the the digits dataset or on the 20 newsgroups -text document (TF-IDF word frequencies) dataset: - -- for the digits dataset, some 8x8 gray level pixels data for 500 - handwritten digits pictures are randomly projected to spaces for various - larger number of dimensions ``n_components``. - -- for the 20 newsgroups dataset some 500 documents with 100k - features in total are projected using a sparse random matrix to smaller - euclidean spaces with various values for the target number of dimensions - ``n_components``. - -The default dataset is the digits dataset. To run the example on the twenty -newsgroups dataset, pass the --twenty-newsgroups command line argument to this -script. - -For each value of ``n_components``, we plot: - -- 2D distribution of sample pairs with pairwise distances in original - and projected spaces as x and y axis respectively. - -- 1D histogram of the ratio of those distances (projected / original). - -We can see that for low values of ``n_components`` the distribution is wide -with many distorted pairs and a skewed distribution (due to the hard -limit of zero ratio on the left as distances are always positives) -while for larger values of n_components the distortion is controlled -and the distances are well preserved by the random projection. - - -Remarks -======= - -According to the JL lemma, projecting 500 samples without too much distortion -will require at least several thousands dimensions, irrespective of the -number of features of the original dataset. - -Hence using random projections on the digits dataset which only has 64 features -in the input space does not make sense: it does not allow for dimensionality -reduction in this case. - -On the twenty newsgroups on the other hand the dimensionality can be decreased -from 56436 down to 10000 while reasonably preserving pairwise distances. - -""" -print(__doc__) - -import sys -from time import time -import numpy as np -import matplotlib.pyplot as plt -from sklearn.random_projection import johnson_lindenstrauss_min_dim -from sklearn.random_projection import SparseRandomProjection -from sklearn.datasets import fetch_20newsgroups_vectorized -from sklearn.datasets import load_digits -from sklearn.metrics.pairwise import euclidean_distances - -# Part 1: plot the theoretical dependency between n_components_min and -# n_samples - -# range of admissible distortions -eps_range = np.linspace(0.1, 0.99, 5) -colors = plt.cm.Blues(np.linspace(0.3, 1.0, len(eps_range))) - -# range of number of samples (observation) to embed -n_samples_range = np.logspace(1, 9, 9) - -plt.figure() -for eps, color in zip(eps_range, colors): - min_n_components = johnson_lindenstrauss_min_dim(n_samples_range, eps=eps) - plt.loglog(n_samples_range, min_n_components, color=color) - -plt.legend(["eps = %0.1f" % eps for eps in eps_range], loc="lower right") -plt.xlabel("Number of observations to eps-embed") -plt.ylabel("Minimum number of dimensions") -plt.title("Johnson-Lindenstrauss bounds:\nn_samples vs n_components") -plt.show() - -# range of admissible distortions -eps_range = np.linspace(0.01, 0.99, 100) - -# range of number of samples (observation) to embed -n_samples_range = np.logspace(2, 6, 5) -colors = plt.cm.Blues(np.linspace(0.3, 1.0, len(n_samples_range))) - -plt.figure() -for n_samples, color in zip(n_samples_range, colors): - min_n_components = johnson_lindenstrauss_min_dim(n_samples, eps=eps_range) - plt.semilogy(eps_range, min_n_components, color=color) - -plt.legend(["n_samples = %d" % n for n in n_samples_range], loc="upper right") -plt.xlabel("Distortion eps") -plt.ylabel("Minimum number of dimensions") -plt.title("Johnson-Lindenstrauss bounds:\nn_components vs eps") -plt.show() - -# Part 2: perform sparse random projection of some digits images which are -# quite low dimensional and dense or documents of the 20 newsgroups dataset -# which is both high dimensional and sparse - -if '--twenty-newsgroups' in sys.argv: - # Need an internet connection hence not enabled by default - data = fetch_20newsgroups_vectorized().data[:500] -else: - data = load_digits().data[:500] - -n_samples, n_features = data.shape -print("Embedding %d samples with dim %d using various random projections" - % (n_samples, n_features)) - -n_components_range = np.array([300, 1000, 10000]) -dists = euclidean_distances(data, squared=True).ravel() - -# select only non-identical samples pairs -nonzero = dists != 0 -dists = dists[nonzero] - -for n_components in n_components_range: - t0 = time() - rp = SparseRandomProjection(n_components=n_components) - projected_data = rp.fit_transform(data) - print("Projected %d samples from %d to %d in %0.3fs" - % (n_samples, n_features, n_components, time() - t0)) - if hasattr(rp, 'components_'): - n_bytes = rp.components_.data.nbytes - n_bytes += rp.components_.indices.nbytes - print("Random matrix with size: %0.3fMB" % (n_bytes / 1e6)) - - projected_dists = euclidean_distances( - projected_data, squared=True).ravel()[nonzero] - - plt.figure() - plt.hexbin(dists, projected_dists, gridsize=100) - plt.xlabel("Pairwise squared distances in original space") - plt.ylabel("Pairwise squared distances in projected space") - plt.title("Pairwise distances distribution for n_components=%d" % - n_components) - cb = plt.colorbar() - cb.set_label('Sample pairs counts') - - rates = projected_dists / dists - print("Mean distances rate: %0.2f (%0.2f)" - % (np.mean(rates), np.std(rates))) - - plt.figure() - plt.hist(rates, bins=50, normed=True, range=(0., 2.)) - plt.xlabel("Squared distances rate: projected / original") - plt.ylabel("Distribution of samples pairs") - plt.title("Histogram of pairwise distance rates for n_components=%d" % - n_components) - plt.show() - - # TODO: compute the expected value of eps and add them to the previous plot - # as vertical lines / region diff --git a/0.15/_downloads/plot_kde_1d.py b/0.15/_downloads/plot_kde_1d.py deleted file mode 100644 index d52c924c7ceb6..0000000000000 --- a/0.15/_downloads/plot_kde_1d.py +++ /dev/null @@ -1,144 +0,0 @@ -""" -=================================== -Simple 1D Kernel Density Estimation -=================================== -This example uses the :class:`sklearn.neighbors.KernelDensity` class to -demonstrate the principles of Kernel Density Estimation in one dimension. - -The first plot shows one of the problems with using histograms to visualize -the density of points in 1D. Intuitively, a histogram can be thought of as a -scheme in which a unit "block" is stacked above each point on a regular grid. -As the top two panels show, however, the choice of gridding for these blocks -can lead to wildly divergent ideas about the underlying shape of the density -distribution. If we instead center each block on the point it represents, we -get the estimate shown in the bottom left panel. This is a kernel density -estimation with a "top hat" kernel. This idea can be generalized to other -kernel shapes: the bottom-right panel of the first figure shows a Gaussian -kernel density estimate over the same distribution. - -Scikit-learn implements efficient kernel density estimation using either -a Ball Tree or KD Tree structure, through the -:class:`sklearn.neighbors.KernelDensity` estimator. The available kernels -are shown in the second figure of this example. - -The third figure compares kernel density estimates for a distribution of 100 -samples in 1 dimension. Though this example uses 1D distributions, kernel -density estimation is easily and efficiently extensible to higher dimensions -as well. -""" -# Author: Jake Vanderplas -# -import numpy as np -import matplotlib.pyplot as plt -from scipy.stats import norm -from sklearn.neighbors import KernelDensity - - -#---------------------------------------------------------------------- -# Plot the progression of histograms to kernels -np.random.seed(1) -N = 20 -X = np.concatenate((np.random.normal(0, 1, 0.3 * N), - np.random.normal(5, 1, 0.7 * N)))[:, np.newaxis] -X_plot = np.linspace(-5, 10, 1000)[:, np.newaxis] -bins = np.linspace(-5, 10, 10) - -fig, ax = plt.subplots(2, 2, sharex=True, sharey=True) -fig.subplots_adjust(hspace=0.05, wspace=0.05) - -# histogram 1 -ax[0, 0].hist(X[:, 0], bins=bins, fc='#AAAAFF', normed=True) -ax[0, 0].text(-3.5, 0.31, "Histogram") - -# histogram 2 -ax[0, 1].hist(X[:, 0], bins=bins + 0.75, fc='#AAAAFF', normed=True) -ax[0, 1].text(-3.5, 0.31, "Histogram, bins shifted") - -# tophat KDE -kde = KernelDensity(kernel='tophat', bandwidth=0.75).fit(X) -log_dens = kde.score_samples(X_plot) -ax[1, 0].fill(X_plot[:, 0], np.exp(log_dens), fc='#AAAAFF') -ax[1, 0].text(-3.5, 0.31, "Tophat Kernel Density") - -# Gaussian KDE -kde = KernelDensity(kernel='gaussian', bandwidth=0.75).fit(X) -log_dens = kde.score_samples(X_plot) -ax[1, 1].fill(X_plot[:, 0], np.exp(log_dens), fc='#AAAAFF') -ax[1, 1].text(-3.5, 0.31, "Gaussian Kernel Density") - -for axi in ax.ravel(): - axi.plot(X[:, 0], np.zeros(X.shape[0]) - 0.01, '+k') - axi.set_xlim(-4, 9) - axi.set_ylim(-0.02, 0.34) - -for axi in ax[:, 0]: - axi.set_ylabel('Normalized Density') - -for axi in ax[1, :]: - axi.set_xlabel('x') - -#---------------------------------------------------------------------- -# Plot all available kernels -X_plot = np.linspace(-6, 6, 1000)[:, None] -X_src = np.zeros((1, 1)) - -fig, ax = plt.subplots(2, 3, sharex=True, sharey=True) -fig.subplots_adjust(left=0.05, right=0.95, hspace=0.05, wspace=0.05) - - -def format_func(x, loc): - if x == 0: - return '0' - elif x == 1: - return 'h' - elif x == -1: - return '-h' - else: - return '%ih' % x - -for i, kernel in enumerate(['gaussian', 'tophat', 'epanechnikov', - 'exponential', 'linear', 'cosine']): - axi = ax.ravel()[i] - log_dens = KernelDensity(kernel=kernel).fit(X_src).score_samples(X_plot) - axi.fill(X_plot[:, 0], np.exp(log_dens), '-k', fc='#AAAAFF') - axi.text(-2.6, 0.95, kernel) - - axi.xaxis.set_major_formatter(plt.FuncFormatter(format_func)) - axi.xaxis.set_major_locator(plt.MultipleLocator(1)) - axi.yaxis.set_major_locator(plt.NullLocator()) - - axi.set_ylim(0, 1.05) - axi.set_xlim(-2.9, 2.9) - -ax[0, 1].set_title('Available Kernels') - -#---------------------------------------------------------------------- -# Plot a 1D density example -N = 100 -np.random.seed(1) -X = np.concatenate((np.random.normal(0, 1, 0.3 * N), - np.random.normal(5, 1, 0.7 * N)))[:, np.newaxis] - -X_plot = np.linspace(-5, 10, 1000)[:, np.newaxis] - -true_dens = (0.3 * norm(0, 1).pdf(X_plot[:, 0]) - + 0.7 * norm(5, 1).pdf(X_plot[:, 0])) - -fig, ax = plt.subplots() -ax.fill(X_plot[:, 0], true_dens, fc='black', alpha=0.2, - label='input distribution') - -for kernel in ['gaussian', 'tophat', 'epanechnikov']: - kde = KernelDensity(kernel=kernel, bandwidth=0.5).fit(X) - log_dens = kde.score_samples(X_plot) - ax.plot(X_plot[:, 0], np.exp(log_dens), '-', - label="kernel = '{0}'".format(kernel)) - -ax.text(6, 0.38, "N={0} points".format(N)) - -ax.legend(loc='upper left') -ax.plot(X[:, 0], -0.005 - 0.01 * np.random.random(X.shape[0]), '+k') - -ax.set_xlim(-4, 9) -ax.set_ylim(-0.02, 0.4) -plt.show() diff --git a/0.15/_downloads/plot_kernel_approximation.py b/0.15/_downloads/plot_kernel_approximation.py deleted file mode 100644 index cbf78be4dfbc0..0000000000000 --- a/0.15/_downloads/plot_kernel_approximation.py +++ /dev/null @@ -1,210 +0,0 @@ -""" -================================================== -Explicit feature map approximation for RBF kernels -================================================== - -An example illustrating the approximation of the feature map -of an RBF kernel. - -.. currentmodule:: sklearn.kernel_approximation - -It shows how to use :class:`RBFSampler` and :class:`Nystroem` to -approximate the feature map of an RBF kernel for classification with an SVM on -the digits dataset. Results using a linear SVM in the original space, a linear -SVM using the approximate mappings and using a kernelized SVM are compared. -Timings and accuracy for varying amounts of Monte Carlo samplings (in the case -of :class:`RBFSampler`, which uses random Fourier features) and different sized -subsets of the training set (for :class:`Nystroem`) for the approximate mapping -are shown. - -Please note that the dataset here is not large enough to show the benefits -of kernel approximation, as the exact SVM is still reasonably fast. - -Sampling more dimensions clearly leads to better classification results, but -comes at a greater cost. This means there is a tradeoff between runtime and -accuracy, given by the parameter n_components. Note that solving the Linear -SVM and also the approximate kernel SVM could be greatly accelerated by using -stochastic gradient descent via :class:`sklearn.linear_model.SGDClassifier`. -This is not easily possible for the case of the kernelized SVM. - -The second plot visualized the decision surfaces of the RBF kernel SVM and -the linear SVM with approximate kernel maps. -The plot shows decision surfaces of the classifiers projected onto -the first two principal components of the data. This visualization should -be taken with a grain of salt since it is just an interesting slice through -the decision surface in 64 dimensions. In particular note that -a datapoint (represented as a dot) does not necessarily be classified -into the region it is lying in, since it will not lie on the plane -that the first two principal components span. - -The usage of :class:`RBFSampler` and :class:`Nystroem` is described in detail -in :ref:`kernel_approximation`. - -""" -print(__doc__) - -# Author: Gael Varoquaux -# Andreas Mueller -# License: BSD 3 clause - -# Standard scientific Python imports -import matplotlib.pyplot as plt -import numpy as np -from time import time - -# Import datasets, classifiers and performance metrics -from sklearn import datasets, svm, pipeline -from sklearn.kernel_approximation import (RBFSampler, - Nystroem) -from sklearn.decomposition import PCA - -# The digits dataset -digits = datasets.load_digits(n_class=9) - -# To apply an classifier on this data, we need to flatten the image, to -# turn the data in a (samples, feature) matrix: -n_samples = len(digits.data) -data = digits.data / 16. -data -= data.mean(axis=0) - -# We learn the digits on the first half of the digits -data_train, targets_train = data[:n_samples / 2], digits.target[:n_samples / 2] - - -# Now predict the value of the digit on the second half: -data_test, targets_test = data[n_samples / 2:], digits.target[n_samples / 2:] -#data_test = scaler.transform(data_test) - -# Create a classifier: a support vector classifier -kernel_svm = svm.SVC(gamma=.2) -linear_svm = svm.LinearSVC() - -# create pipeline from kernel approximation -# and linear svm -feature_map_fourier = RBFSampler(gamma=.2, random_state=1) -feature_map_nystroem = Nystroem(gamma=.2, random_state=1) -fourier_approx_svm = pipeline.Pipeline([("feature_map", feature_map_fourier), - ("svm", svm.LinearSVC())]) - -nystroem_approx_svm = pipeline.Pipeline([("feature_map", feature_map_nystroem), - ("svm", svm.LinearSVC())]) - -# fit and predict using linear and kernel svm: - -kernel_svm_time = time() -kernel_svm.fit(data_train, targets_train) -kernel_svm_score = kernel_svm.score(data_test, targets_test) -kernel_svm_time = time() - kernel_svm_time - -linear_svm_time = time() -linear_svm.fit(data_train, targets_train) -linear_svm_score = linear_svm.score(data_test, targets_test) -linear_svm_time = time() - linear_svm_time - -sample_sizes = 30 * np.arange(1, 10) -fourier_scores = [] -nystroem_scores = [] -fourier_times = [] -nystroem_times = [] - -for D in sample_sizes: - fourier_approx_svm.set_params(feature_map__n_components=D) - nystroem_approx_svm.set_params(feature_map__n_components=D) - start = time() - nystroem_approx_svm.fit(data_train, targets_train) - nystroem_times.append(time() - start) - - start = time() - fourier_approx_svm.fit(data_train, targets_train) - fourier_times.append(time() - start) - - fourier_score = fourier_approx_svm.score(data_test, targets_test) - nystroem_score = nystroem_approx_svm.score(data_test, targets_test) - nystroem_scores.append(nystroem_score) - fourier_scores.append(fourier_score) - -# plot the results: -plt.figure(figsize=(8, 8)) -accuracy = plt.subplot(211) -# second y axis for timeings -timescale = plt.subplot(212) - -accuracy.plot(sample_sizes, nystroem_scores, label="Nystroem approx. kernel") -timescale.plot(sample_sizes, nystroem_times, '--', - label='Nystroem approx. kernel') - -accuracy.plot(sample_sizes, fourier_scores, label="Fourier approx. kernel") -timescale.plot(sample_sizes, fourier_times, '--', - label='Fourier approx. kernel') - -# horizontal lines for exact rbf and linear kernels: -accuracy.plot([sample_sizes[0], sample_sizes[-1]], - [linear_svm_score, linear_svm_score], label="linear svm") -timescale.plot([sample_sizes[0], sample_sizes[-1]], - [linear_svm_time, linear_svm_time], '--', label='linear svm') - -accuracy.plot([sample_sizes[0], sample_sizes[-1]], - [kernel_svm_score, kernel_svm_score], label="rbf svm") -timescale.plot([sample_sizes[0], sample_sizes[-1]], - [kernel_svm_time, kernel_svm_time], '--', label='rbf svm') - -# vertical line for dataset dimensionality = 64 -accuracy.plot([64, 64], [0.7, 1], label="n_features") - -# legends and labels -accuracy.set_title("Classification accuracy") -timescale.set_title("Training times") -accuracy.set_xlim(sample_sizes[0], sample_sizes[-1]) -accuracy.set_xticks(()) -accuracy.set_ylim(np.min(fourier_scores), 1) -timescale.set_xlabel("Sampling steps = transformed feature dimension") -accuracy.set_ylabel("Classification accuracy") -timescale.set_ylabel("Training time in seconds") -accuracy.legend(loc='best') -timescale.legend(loc='best') - -# visualize the decision surface, projected down to the first -# two principal components of the dataset -pca = PCA(n_components=8).fit(data_train) - -X = pca.transform(data_train) - -# Gemerate grid along first two principal components -multiples = np.arange(-2, 2, 0.1) -# steps along first component -first = multiples[:, np.newaxis] * pca.components_[0, :] -# steps along second component -second = multiples[:, np.newaxis] * pca.components_[1, :] -# combine -grid = first[np.newaxis, :, :] + second[:, np.newaxis, :] -flat_grid = grid.reshape(-1, data.shape[1]) - -# title for the plots -titles = ['SVC with rbf kernel', - 'SVC (linear kernel)\n with Fourier rbf feature map\n' - 'n_components=100', - 'SVC (linear kernel)\n with Nystroem rbf feature map\n' - 'n_components=100'] - -plt.tight_layout() -plt.figure(figsize=(12, 5)) - -# predict and plot -for i, clf in enumerate((kernel_svm, nystroem_approx_svm, - fourier_approx_svm)): - # Plot the decision boundary. For that, we will assign a color to each - # point in the mesh [x_min, m_max]x[y_min, y_max]. - plt.subplot(1, 3, i + 1) - Z = clf.predict(flat_grid) - - # Put the result into a color plot - Z = Z.reshape(grid.shape[:-1]) - plt.contourf(multiples, multiples, Z, cmap=plt.cm.Paired) - plt.axis('off') - - # Plot also the training points - plt.scatter(X[:, 0], X[:, 1], c=targets_train, cmap=plt.cm.Paired) - - plt.title(titles[i]) -plt.tight_layout() -plt.show() diff --git a/0.15/_downloads/plot_kernel_pca.py b/0.15/_downloads/plot_kernel_pca.py deleted file mode 100644 index 070c489e9f970..0000000000000 --- a/0.15/_downloads/plot_kernel_pca.py +++ /dev/null @@ -1,73 +0,0 @@ -""" -========== -Kernel PCA -========== - -This example shows that Kernel PCA is able to find a projection of the data -that makes data linearly separable. -""" -print(__doc__) - -# Authors: Mathieu Blondel -# Andreas Mueller -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.decomposition import PCA, KernelPCA -from sklearn.datasets import make_circles - -np.random.seed(0) - -X, y = make_circles(n_samples=400, factor=.3, noise=.05) - -kpca = KernelPCA(kernel="rbf", fit_inverse_transform=True, gamma=10) -X_kpca = kpca.fit_transform(X) -X_back = kpca.inverse_transform(X_kpca) -pca = PCA() -X_pca = pca.fit_transform(X) - -# Plot results - -plt.figure() -plt.subplot(2, 2, 1, aspect='equal') -plt.title("Original space") -reds = y == 0 -blues = y == 1 - -plt.plot(X[reds, 0], X[reds, 1], "ro") -plt.plot(X[blues, 0], X[blues, 1], "bo") -plt.xlabel("$x_1$") -plt.ylabel("$x_2$") - -X1, X2 = np.meshgrid(np.linspace(-1.5, 1.5, 50), np.linspace(-1.5, 1.5, 50)) -X_grid = np.array([np.ravel(X1), np.ravel(X2)]).T -# projection on the first principal component (in the phi space) -Z_grid = kpca.transform(X_grid)[:, 0].reshape(X1.shape) -plt.contour(X1, X2, Z_grid, colors='grey', linewidths=1, origin='lower') - -plt.subplot(2, 2, 2, aspect='equal') -plt.plot(X_pca[reds, 0], X_pca[reds, 1], "ro") -plt.plot(X_pca[blues, 0], X_pca[blues, 1], "bo") -plt.title("Projection by PCA") -plt.xlabel("1st principal component") -plt.ylabel("2nd component") - -plt.subplot(2, 2, 3, aspect='equal') -plt.plot(X_kpca[reds, 0], X_kpca[reds, 1], "ro") -plt.plot(X_kpca[blues, 0], X_kpca[blues, 1], "bo") -plt.title("Projection by KPCA") -plt.xlabel("1st principal component in space induced by $\phi$") -plt.ylabel("2nd component") - -plt.subplot(2, 2, 4, aspect='equal') -plt.plot(X_back[reds, 0], X_back[reds, 1], "ro") -plt.plot(X_back[blues, 0], X_back[blues, 1], "bo") -plt.title("Original space after inverse transform") -plt.xlabel("$x_1$") -plt.ylabel("$x_2$") - -plt.subplots_adjust(0.02, 0.10, 0.98, 0.94, 0.04, 0.35) - -plt.show() diff --git a/0.15/_downloads/plot_kernel_ridge_regression.py b/0.15/_downloads/plot_kernel_ridge_regression.py deleted file mode 100644 index 19aeece6658cc..0000000000000 --- a/0.15/_downloads/plot_kernel_ridge_regression.py +++ /dev/null @@ -1,170 +0,0 @@ -""" -============================================= -Comparison of kernel ridge regression and SVR -============================================= - -Both kernel ridge regression (KRR) and SVR learn a non-linear function by -employing the kernel trick, i.e., they learn a linear function in the space -induced by the respective kernel which corresponds to a non-linear function in -the original space. They differ in the loss functions (ridge versus -epsilon-insensitive loss). In contrast to SVR, fitting a KRR can be done in -closed-form and is typically faster for medium-sized datasets. On the other -hand, the learned model is non-sparse and thus slower than SVR at -prediction-time. - -This example illustrates both methods on an artificial dataset, which -consists of a sinusoidal target function and strong noise added to every fifth -datapoint. The first figure compares the learned model of KRR and SVR when both -complexity/regularization and bandwidth of the RBF kernel are optimized using -grid-search. The learned functions are very similar; however, fitting KRR is -approx. seven times faster than fitting SVR (both with grid-search). However, -prediction of 100000 target values is more than tree times faster with SVR -since it has learned a sparse model using only approx. 1/3 of the 100 training -datapoints as support vectors. - -The next figure compares the time for fitting and prediction of KRR and SVR for -different sizes of the training set. Fitting KRR is faster than SVR for medium- -sized training sets (less than 1000 samples); however, for larger training sets -SVR scales better. With regard to prediction time, SVR is faster than -KRR for all sizes of the training set because of the learned sparse -solution. Note that the degree of sparsity and thus the prediction time depends -on the parameters epsilon and C of the SVR. -""" - -# Authors: Jan Hendrik Metzen -# License: BSD 3 clause - - -from __future__ import division -import time - -import numpy as np - -from sklearn.svm import SVR -from sklearn.grid_search import GridSearchCV -from sklearn.learning_curve import learning_curve -from sklearn.kernel_ridge import KernelRidge -import matplotlib.pyplot as plt - -rng = np.random.RandomState(0) - -############################################################################# -# Generate sample data -X = 5 * rng.rand(10000, 1) -y = np.sin(X).ravel() - -# Add noise to targets -y[::5] += 3 * (0.5 - rng.rand(X.shape[0]/5)) - -X_plot = np.linspace(0, 5, 100000)[:, None] - -############################################################################# -# Fit regression model -train_size = 100 -svr = GridSearchCV(SVR(kernel='rbf', gamma=0.1), cv=5, - param_grid={"C": [1e0, 1e1, 1e2, 1e3], - "gamma": np.logspace(-2, 2, 5)}) - -kr = GridSearchCV(KernelRidge(kernel='rbf', gamma=0.1), cv=5, - param_grid={"alpha": [1e0, 0.1, 1e-2, 1e-3], - "gamma": np.logspace(-2, 2, 5)}) - -t0 = time.time() -svr.fit(X[:train_size], y[:train_size]) -svr_fit = time.time() - t0 -print("SVR complexity and bandwidth selected and model fitted in %.3f s" - % svr_fit) - -t0 = time.time() -kr.fit(X[:train_size], y[:train_size]) -kr_fit = time.time() - t0 -print("KRR complexity and bandwidth selected and model fitted in %.3f s" - % kr_fit) - -sv_ratio = svr.best_estimator_.support_.shape[0] / train_size -print("Support vector ratio: %.3f" % sv_ratio) - -t0 = time.time() -y_svr = svr.predict(X_plot) -svr_predict = time.time() - t0 -print("SVR prediction for %d inputs in %.3f s" - % (X_plot.shape[0], svr_predict)) - -t0 = time.time() -y_kr = kr.predict(X_plot) -kr_predict = time.time() - t0 -print("KRR prediction for %d inputs in %.3f s" - % (X_plot.shape[0], kr_predict)) - - -############################################################################# -# look at the results -sv_ind = svr.best_estimator_.support_ -plt.scatter(X[sv_ind], y[sv_ind], c='r', s=50, label='SVR support vectors') -plt.scatter(X[:100], y[:100], c='k', label='data') -plt.hold('on') -plt.plot(X_plot, y_svr, c='r', - label='SVR (fit: %.3fs, predict: %.3fs)' % (svr_fit, svr_predict)) -plt.plot(X_plot, y_kr, c='g', - label='KRR (fit: %.3fs, predict: %.3fs)' % (kr_fit, kr_predict)) -plt.xlabel('data') -plt.ylabel('target') -plt.title('SVR versus Kernel Ridge') -plt.legend() - -# Visualize training and prediction time -plt.figure() - -# Generate sample data -X = 5 * rng.rand(10000, 1) -y = np.sin(X).ravel() -y[::5] += 3 * (0.5 - rng.rand(X.shape[0]/5)) -sizes = np.logspace(1, 4, 7) -for name, estimator in {"KRR": KernelRidge(kernel='rbf', alpha=0.1, - gamma=10), - "SVR": SVR(kernel='rbf', C=1e1, gamma=10)}.items(): - train_time = [] - test_time = [] - for train_test_size in sizes: - t0 = time.time() - estimator.fit(X[:train_test_size], y[:train_test_size]) - train_time.append(time.time() - t0) - - t0 = time.time() - estimator.predict(X_plot[:1000]) - test_time.append(time.time() - t0) - - plt.plot(sizes, train_time, 'o-', color="r" if name == "SVR" else "g", - label="%s (train)" % name) - plt.plot(sizes, test_time, 'o--', color="r" if name == "SVR" else "g", - label="%s (test)" % name) - -plt.xscale("log") -plt.yscale("log") -plt.xlabel("Train size") -plt.ylabel("Time (seconds)") -plt.title('Execution Time') -plt.legend(loc="best") - -# Visualize learning curves -plt.figure() - -svr = SVR(kernel='rbf', C=1e1, gamma=0.1) -kr = KernelRidge(kernel='rbf', alpha=0.1, gamma=0.1) -train_sizes, train_scores_svr, test_scores_svr = \ - learning_curve(svr, X[:100], y[:100], train_sizes=np.linspace(0.1, 1, 10), - scoring="mean_squared_error", cv=10) -train_sizes_abs, train_scores_kr, test_scores_kr = \ - learning_curve(kr, X[:100], y[:100], train_sizes=np.linspace(0.1, 1, 10), - scoring="mean_squared_error", cv=10) - -plt.plot(train_sizes, test_scores_svr.mean(1), 'o-', color="r", - label="SVR") -plt.plot(train_sizes, test_scores_kr.mean(1), 'o-', color="g", - label="KRR") -plt.xlabel("Train size") -plt.ylabel("Mean Squared Error") -plt.title('Learning curves') -plt.legend(loc="best") - -plt.show() diff --git a/0.15/_downloads/plot_kmeans_digits.py b/0.15/_downloads/plot_kmeans_digits.py deleted file mode 100644 index cdd5073937efd..0000000000000 --- a/0.15/_downloads/plot_kmeans_digits.py +++ /dev/null @@ -1,127 +0,0 @@ -""" -=========================================================== -A demo of K-Means clustering on the handwritten digits data -=========================================================== - -In this example we compare the various initialization strategies for -K-means in terms of runtime and quality of the results. - -As the ground truth is known here, we also apply different cluster -quality metrics to judge the goodness of fit of the cluster labels to the -ground truth. - -Cluster quality metrics evaluated (see :ref:`clustering_evaluation` for -definitions and discussions of the metrics): - -=========== ======================================================== -Shorthand full name -=========== ======================================================== -homo homogeneity score -compl completeness score -v-meas V measure -ARI adjusted Rand index -AMI adjusted mutual information -silhouette silhouette coefficient -=========== ======================================================== - -""" -print(__doc__) - -from time import time -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import metrics -from sklearn.cluster import KMeans -from sklearn.datasets import load_digits -from sklearn.decomposition import PCA -from sklearn.preprocessing import scale - -np.random.seed(42) - -digits = load_digits() -data = scale(digits.data) - -n_samples, n_features = data.shape -n_digits = len(np.unique(digits.target)) -labels = digits.target - -sample_size = 300 - -print("n_digits: %d, \t n_samples %d, \t n_features %d" - % (n_digits, n_samples, n_features)) - - -print(79 * '_') -print('% 9s' % 'init' - ' time inertia homo compl v-meas ARI AMI silhouette') - - -def bench_k_means(estimator, name, data): - t0 = time() - estimator.fit(data) - print('% 9s %.2fs %i %.3f %.3f %.3f %.3f %.3f %.3f' - % (name, (time() - t0), estimator.inertia_, - metrics.homogeneity_score(labels, estimator.labels_), - metrics.completeness_score(labels, estimator.labels_), - metrics.v_measure_score(labels, estimator.labels_), - metrics.adjusted_rand_score(labels, estimator.labels_), - metrics.adjusted_mutual_info_score(labels, estimator.labels_), - metrics.silhouette_score(data, estimator.labels_, - metric='euclidean', - sample_size=sample_size))) - -bench_k_means(KMeans(init='k-means++', n_clusters=n_digits, n_init=10), - name="k-means++", data=data) - -bench_k_means(KMeans(init='random', n_clusters=n_digits, n_init=10), - name="random", data=data) - -# in this case the seeding of the centers is deterministic, hence we run the -# kmeans algorithm only once with n_init=1 -pca = PCA(n_components=n_digits).fit(data) -bench_k_means(KMeans(init=pca.components_, n_clusters=n_digits, n_init=1), - name="PCA-based", - data=data) -print(79 * '_') - -############################################################################### -# Visualize the results on PCA-reduced data - -reduced_data = PCA(n_components=2).fit_transform(data) -kmeans = KMeans(init='k-means++', n_clusters=n_digits, n_init=10) -kmeans.fit(reduced_data) - -# Step size of the mesh. Decrease to increase the quality of the VQ. -h = .02 # point in the mesh [x_min, m_max]x[y_min, y_max]. - -# Plot the decision boundary. For that, we will assign a color to each -x_min, x_max = reduced_data[:, 0].min() + 1, reduced_data[:, 0].max() - 1 -y_min, y_max = reduced_data[:, 1].min() + 1, reduced_data[:, 1].max() - 1 -xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h)) - -# Obtain labels for each point in mesh. Use last trained model. -Z = kmeans.predict(np.c_[xx.ravel(), yy.ravel()]) - -# Put the result into a color plot -Z = Z.reshape(xx.shape) -plt.figure(1) -plt.clf() -plt.imshow(Z, interpolation='nearest', - extent=(xx.min(), xx.max(), yy.min(), yy.max()), - cmap=plt.cm.Paired, - aspect='auto', origin='lower') - -plt.plot(reduced_data[:, 0], reduced_data[:, 1], 'k.', markersize=2) -# Plot the centroids as a white X -centroids = kmeans.cluster_centers_ -plt.scatter(centroids[:, 0], centroids[:, 1], - marker='x', s=169, linewidths=3, - color='w', zorder=10) -plt.title('K-means clustering on the digits dataset (PCA-reduced data)\n' - 'Centroids are marked with white cross') -plt.xlim(x_min, x_max) -plt.ylim(y_min, y_max) -plt.xticks(()) -plt.yticks(()) -plt.show() diff --git a/0.15/_downloads/plot_kmeans_silhouette_analysis.py b/0.15/_downloads/plot_kmeans_silhouette_analysis.py deleted file mode 100644 index ed29ef7734529..0000000000000 --- a/0.15/_downloads/plot_kmeans_silhouette_analysis.py +++ /dev/null @@ -1,141 +0,0 @@ -""" -=============================================================================== -Selecting the number of clusters with silhouette analysis on KMeans clustering -=============================================================================== - -Silhouette analysis can be used to study the separation distance between the -resulting clusters. The silhouette plot displays a measure of how close each -point in one cluster is to points in the neighboring clusters and thus provides -a way to assess parameters like number of clusters visually. This measure has a -range of [-1, 1]. - -Silhoette coefficients (as these values are referred to as) near +1 indicate -that the sample is far away from the neighboring clusters. A value of 0 -indicates that the sample is on or very close to the decision boundary between -two neighboring clusters and negative values indicate that those samples might -have been assigned to the wrong cluster. - -In this example the silhouette analysis is used to choose an optimal value for -``n_clusters``. The silhouette plot shows that the ``n_clusters`` value of 3, 5 -and 6 are a bad pick for the given data due to the presence of clusters with -below average silhouette scores and also due to wide fluctuations in the size -of the silhouette plots. Silhouette analysis is more ambivalent in deciding -between 2 and 4. - -Also from the thickness of the silhouette plot the cluster size can be -visualized. The silhouette plot for cluster 0 when ``n_clusters`` is equal to -2, is bigger in size owing to the grouping of the 3 sub clusters into one big -cluster. However when the ``n_clusters`` is equal to 4, all the plots are more -or less of similar thickness and hence are of similar sizes as can be also -verified from the labelled scatter plot on the right. -""" - -from __future__ import print_function - -from sklearn.datasets import make_blobs -from sklearn.cluster import KMeans -from sklearn.metrics import silhouette_samples, silhouette_score - -import matplotlib.pyplot as plt -import matplotlib.cm as cm -import numpy as np - -print(__doc__) - -# Generating the sample data from make_blobs -# This particular setting has one distict cluster and 3 clusters placed close -# together. -X, y = make_blobs(n_samples=500, - n_features=2, - centers=4, - cluster_std=1, - center_box=(-10.0, 10.0), - shuffle=True, - random_state=1) # For reproducibility - -range_n_clusters = [2, 3, 4, 5, 6] - -for n_clusters in range_n_clusters: - # Create a subplot with 1 row and 2 columns - fig, (ax1, ax2) = plt.subplots(1, 2) - fig.set_size_inches(18, 7) - - # The 1st subplot is the silhouette plot - # The silhouette coefficient can range from -1, 1 but in this example all - # lie within [-0.1, 1] - ax1.set_xlim([-0.1, 1]) - # The (n_clusters+1)*10 is for inserting blank space between silhouette - # plots of individual clusters, to demarcate them clearly. - ax1.set_ylim([0, len(X) + (n_clusters + 1) * 10]) - - # Initialize the clusterer with n_clusters value and a random generator - # seed of 10 for reproducibility. - clusterer = KMeans(n_clusters=n_clusters, random_state=10) - cluster_labels = clusterer.fit_predict(X) - - # The silhouette_score gives the average value for all the samples. - # This gives a perspective into the density and separation of the formed - # clusters - silhouette_avg = silhouette_score(X, cluster_labels) - print("For n_clusters =", n_clusters, - "The average silhouette_score is :", silhouette_avg) - - # Compute the silhouette scores for each sample - sample_silhouette_values = silhouette_samples(X, cluster_labels) - - y_lower = 10 - for i in range(n_clusters): - # Aggregate the silhouette scores for samples belonging to - # cluster i, and sort them - ith_cluster_silhouette_values = \ - sample_silhouette_values[cluster_labels == i] - - ith_cluster_silhouette_values.sort() - - size_cluster_i = ith_cluster_silhouette_values.shape[0] - y_upper = y_lower + size_cluster_i - - color = cm.spectral(float(i) / n_clusters) - ax1.fill_betweenx(np.arange(y_lower, y_upper), - 0, ith_cluster_silhouette_values, - facecolor=color, edgecolor=color, alpha=0.7) - - # Label the silhouette plots with their cluster numbers at the middle - ax1.text(-0.05, y_lower + 0.5 * size_cluster_i, str(i)) - - # Compute the new y_lower for next plot - y_lower = y_upper + 10 # 10 for the 0 samples - - ax1.set_title("The silhouette plot for the various clusters.") - ax1.set_xlabel("The silhouette coefficient values") - ax1.set_ylabel("Cluster label") - - # The vertical line for average silhoutte score of all the values - ax1.axvline(x=silhouette_avg, color="red", linestyle="--") - - ax1.set_yticks([]) # Clear the yaxis labels / ticks - ax1.set_xticks([-0.1, 0, 0.2, 0.4, 0.6, 0.8, 1]) - - # 2nd Plot showing the actual clusters formed - colors = cm.spectral(cluster_labels.astype(float) / n_clusters) - ax2.scatter(X[:, 0], X[:, 1], marker='.', s=30, lw=0, alpha=0.7, - c=colors) - - # Labeling the clusters - centers = clusterer.cluster_centers_ - # Draw white circles at cluster centers - ax2.scatter(centers[:, 0], centers[:, 1], - marker='o', c="white", alpha=1, s=200) - - for i, c in enumerate(centers): - ax2.scatter(c[0], c[1], marker='$%d$' % i, alpha=1, s=50) - - ax2.set_title("The visualization of the clustered data.") - ax2.set_xlabel("Feature space for the 1st feature") - ax2.set_ylabel("Feature space for the 2nd feature") - - plt.suptitle(("Silhouette analysis for KMeans clustering on sample data " - "with n_clusters = %d" % n_clusters), - fontsize=14, fontweight='bold') - - plt.show() diff --git a/0.15/_downloads/plot_kmeans_stability_low_dim_dense.py b/0.15/_downloads/plot_kmeans_stability_low_dim_dense.py deleted file mode 100644 index 7c1763e830434..0000000000000 --- a/0.15/_downloads/plot_kmeans_stability_low_dim_dense.py +++ /dev/null @@ -1,119 +0,0 @@ -""" -============================================================ -Empirical evaluation of the impact of k-means initialization -============================================================ - -Evaluate the ability of k-means initializations strategies to make -the algorithm convergence robust as measured by the relative standard -deviation of the inertia of the clustering (i.e. the sum of distances -to the nearest cluster center). - -The first plot shows the best inertia reached for each combination -of the model (``KMeans`` or ``MiniBatchKMeans``) and the init method -(``init="random"`` or ``init="kmeans++"``) for increasing values of the -``n_init`` parameter that controls the number of initializations. - -The second plot demonstrate one single run of the ``MiniBatchKMeans`` -estimator using a ``init="random"`` and ``n_init=1``. This run leads to -a bad convergence (local optimum) with estimated centers between stucked -between ground truth clusters. - -The dataset used for evaluation is a 2D grid of isotropic Gaussian -clusters widely spaced. -""" -print(__doc__) - -# Author: Olivier Grisel -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -import matplotlib.cm as cm - -from sklearn.utils import shuffle -from sklearn.utils import check_random_state -from sklearn.cluster import MiniBatchKMeans -from sklearn.cluster import KMeans - -random_state = np.random.RandomState(0) - -# Number of run (with randomly generated dataset) for each strategy so as -# to be able to compute an estimate of the standard deviation -n_runs = 5 - -# k-means models can do several random inits so as to be able to trade -# CPU time for convergence robustness -n_init_range = np.array([1, 5, 10, 15, 20]) - -# Datasets generation parameters -n_samples_per_center = 100 -grid_size = 3 -scale = 0.1 -n_clusters = grid_size ** 2 - - -def make_data(random_state, n_samples_per_center, grid_size, scale): - random_state = check_random_state(random_state) - centers = np.array([[i, j] - for i in range(grid_size) - for j in range(grid_size)]) - n_clusters_true, n_features = centers.shape - - noise = random_state.normal( - scale=scale, size=(n_samples_per_center, centers.shape[1])) - - X = np.concatenate([c + noise for c in centers]) - y = np.concatenate([[i] * n_samples_per_center - for i in range(n_clusters_true)]) - return shuffle(X, y, random_state=random_state) - -# Part 1: Quantitative evaluation of various init methods - -fig = plt.figure() -plots = [] -legends = [] - -cases = [ - (KMeans, 'k-means++', {}), - (KMeans, 'random', {}), - (MiniBatchKMeans, 'k-means++', {'max_no_improvement': 3}), - (MiniBatchKMeans, 'random', {'max_no_improvement': 3, 'init_size': 500}), -] - -for factory, init, params in cases: - print("Evaluation of %s with %s init" % (factory.__name__, init)) - inertia = np.empty((len(n_init_range), n_runs)) - - for run_id in range(n_runs): - X, y = make_data(run_id, n_samples_per_center, grid_size, scale) - for i, n_init in enumerate(n_init_range): - km = factory(n_clusters=n_clusters, init=init, random_state=run_id, - n_init=n_init, **params).fit(X) - inertia[i, run_id] = km.inertia_ - p = plt.errorbar(n_init_range, inertia.mean(axis=1), inertia.std(axis=1)) - plots.append(p[0]) - legends.append("%s with %s init" % (factory.__name__, init)) - -plt.xlabel('n_init') -plt.ylabel('inertia') -plt.legend(plots, legends) -plt.title("Mean inertia for various k-means init across %d runs" % n_runs) - -# Part 2: Qualitative visual inspection of the convergence - -X, y = make_data(random_state, n_samples_per_center, grid_size, scale) -km = MiniBatchKMeans(n_clusters=n_clusters, init='random', n_init=1, - random_state=random_state).fit(X) - -fig = plt.figure() -for k in range(n_clusters): - my_members = km.labels_ == k - color = cm.spectral(float(k) / n_clusters, 1) - plt.plot(X[my_members, 0], X[my_members, 1], 'o', marker='.', c=color) - cluster_center = km.cluster_centers_[k] - plt.plot(cluster_center[0], cluster_center[1], 'o', - markerfacecolor=color, markeredgecolor='k', markersize=6) - plt.title("Example cluster allocation with a single random init\n" - "with MiniBatchKMeans") - -plt.show() diff --git a/0.15/_downloads/plot_label_propagation_digits.py b/0.15/_downloads/plot_label_propagation_digits.py deleted file mode 100644 index c0ba5e911c492..0000000000000 --- a/0.15/_downloads/plot_label_propagation_digits.py +++ /dev/null @@ -1,90 +0,0 @@ -""" -=================================================== -Label Propagation digits: Demonstrating performance -=================================================== - -This example demonstrates the power of semisupervised learning by -training a Label Spreading model to classify handwritten digits -with sets of very few labels. - -The handwritten digit dataset has 1797 total points. The model will -be trained using all points, but only 30 will be labeled. Results -in the form of a confusion matrix and a series of metrics over each -class will be very good. - -At the end, the top 10 most uncertain predictions will be shown. -""" -print(__doc__) - -# Authors: Clay Woolam -# Licence: BSD - -import numpy as np -import matplotlib.pyplot as plt - -from scipy import stats - -from sklearn import datasets -from sklearn.semi_supervised import label_propagation - -from sklearn.metrics import metrics -from sklearn.metrics.metrics import confusion_matrix - -digits = datasets.load_digits() -rng = np.random.RandomState(0) -indices = np.arange(len(digits.data)) -rng.shuffle(indices) - -X = digits.data[indices[:330]] -y = digits.target[indices[:330]] -images = digits.images[indices[:330]] - -n_total_samples = len(y) -n_labeled_points = 30 - -indices = np.arange(n_total_samples) - -unlabeled_set = indices[n_labeled_points:] - -# shuffle everything around -y_train = np.copy(y) -y_train[unlabeled_set] = -1 - -############################################################################### -# Learn with LabelSpreading -lp_model = label_propagation.LabelSpreading(gamma=0.25, max_iter=5) -lp_model.fit(X, y_train) -predicted_labels = lp_model.transduction_[unlabeled_set] -true_labels = y[unlabeled_set] - -cm = confusion_matrix(true_labels, predicted_labels, labels=lp_model.classes_) - -print("Label Spreading model: %d labeled & %d unlabeled points (%d total)" % - (n_labeled_points, n_total_samples - n_labeled_points, n_total_samples)) - -print(metrics.classification_report(true_labels, predicted_labels)) - -print("Confusion matrix") -print(cm) - -# calculate uncertainty values for each transduced distribution -pred_entropies = stats.distributions.entropy(lp_model.label_distributions_.T) - -# pick the top 10 most uncertain labels -uncertainty_index = np.argsort(pred_entropies)[-10:] - -############################################################################### -# plot -f = plt.figure(figsize=(7, 5)) -for index, image_index in enumerate(uncertainty_index): - image = images[image_index] - - sub = f.add_subplot(2, 5, index + 1) - sub.imshow(image, cmap=plt.cm.gray_r) - plt.xticks([]) - plt.yticks([]) - sub.set_title('predict: %i\ntrue: %i' % ( - lp_model.transduction_[image_index], y[image_index])) - -f.suptitle('Learning with small amount of labeled data') -plt.show() diff --git a/0.15/_downloads/plot_label_propagation_digits_active_learning.py b/0.15/_downloads/plot_label_propagation_digits_active_learning.py deleted file mode 100644 index 05329ed00b4ec..0000000000000 --- a/0.15/_downloads/plot_label_propagation_digits_active_learning.py +++ /dev/null @@ -1,99 +0,0 @@ -""" -======================================== -Label Propagation digits active learning -======================================== - -Demonstrates an active learning technique to learn handwritten digits -using label propagation. - -We start by training a label propagation model with only 10 labeled points, -then we select the top five most uncertain points to label. Next, we train -with 15 labeled points (original 10 + 5 new ones). We repeat this process -four times to have a model trained with 30 labeled examples. - -A plot will appear showing the top 5 most uncertain digits for each iteration -of training. These may or may not contain mistakes, but we will train the next -model with their true labels. -""" -print(__doc__) - -# Authors: Clay Woolam -# Licence: BSD - -import numpy as np -import matplotlib.pyplot as plt -from scipy import stats - -from sklearn import datasets -from sklearn.semi_supervised import label_propagation -from sklearn.metrics import classification_report, confusion_matrix - -digits = datasets.load_digits() -rng = np.random.RandomState(0) -indices = np.arange(len(digits.data)) -rng.shuffle(indices) - -X = digits.data[indices[:330]] -y = digits.target[indices[:330]] -images = digits.images[indices[:330]] - -n_total_samples = len(y) -n_labeled_points = 10 - -unlabeled_indices = np.arange(n_total_samples)[n_labeled_points:] -f = plt.figure() - -for i in range(5): - y_train = np.copy(y) - y_train[unlabeled_indices] = -1 - - lp_model = label_propagation.LabelSpreading(gamma=0.25, max_iter=5) - lp_model.fit(X, y_train) - - predicted_labels = lp_model.transduction_[unlabeled_indices] - true_labels = y[unlabeled_indices] - - cm = confusion_matrix(true_labels, predicted_labels, - labels=lp_model.classes_) - - print('Iteration %i %s' % (i, 70 * '_')) - print("Label Spreading model: %d labeled & %d unlabeled (%d total)" - % (n_labeled_points, n_total_samples - n_labeled_points, n_total_samples)) - - print(classification_report(true_labels, predicted_labels)) - - print("Confusion matrix") - print(cm) - - # compute the entropies of transduced label distributions - pred_entropies = stats.distributions.entropy( - lp_model.label_distributions_.T) - - # select five digit examples that the classifier is most uncertain about - uncertainty_index = uncertainty_index = np.argsort(pred_entropies)[-5:] - - # keep track of indices that we get labels for - delete_indices = np.array([]) - - f.text(.05, (1 - (i + 1) * .183), - "model %d\n\nfit with\n%d labels" % ((i + 1), i * 5 + 10), size=10) - for index, image_index in enumerate(uncertainty_index): - image = images[image_index] - - sub = f.add_subplot(5, 5, index + 1 + (5 * i)) - sub.imshow(image, cmap=plt.cm.gray_r) - sub.set_title('predict: %i\ntrue: %i' % ( - lp_model.transduction_[image_index], y[image_index]), size=10) - sub.axis('off') - - # labeling 5 points, remote from labeled set - delete_index, = np.where(unlabeled_indices == image_index) - delete_indices = np.concatenate((delete_indices, delete_index)) - - unlabeled_indices = np.delete(unlabeled_indices, delete_indices) - n_labeled_points += 5 - -f.suptitle("Active learning with Label Propagation.\nRows show 5 most " - "uncertain labels to learn with the next model.") -plt.subplots_adjust(0.12, 0.03, 0.9, 0.8, 0.2, 0.45) -plt.show() diff --git a/0.15/_downloads/plot_label_propagation_structure.py b/0.15/_downloads/plot_label_propagation_structure.py deleted file mode 100644 index 24ab31ba33d6d..0000000000000 --- a/0.15/_downloads/plot_label_propagation_structure.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -============================================== -Label Propagation learning a complex structure -============================================== - -Example of LabelPropagation learning a complex internal structure -to demonstrate "manifold learning". The outer circle should be -labeled "red" and the inner circle "blue". Because both label groups -lie inside their own distinct shape, we can see that the labels -propagate correctly around the circle. -""" -print(__doc__) - -# Authors: Clay Woolam -# Andreas Mueller -# Licence: BSD - -import numpy as np -import matplotlib.pyplot as plt -from sklearn.semi_supervised import label_propagation -from sklearn.datasets import make_circles - -# generate ring with inner box -n_samples = 200 -X, y = make_circles(n_samples=n_samples, shuffle=False) -outer, inner = 0, 1 -labels = -np.ones(n_samples) -labels[0] = outer -labels[-1] = inner - -############################################################################### -# Learn with LabelSpreading -label_spread = label_propagation.LabelSpreading(kernel='knn', alpha=1.0) -label_spread.fit(X, labels) - -############################################################################### -# Plot output labels -output_labels = label_spread.transduction_ -plt.figure(figsize=(8.5, 4)) -plt.subplot(1, 2, 1) -plot_outer_labeled, = plt.plot(X[labels == outer, 0], - X[labels == outer, 1], 'rs') -plot_unlabeled, = plt.plot(X[labels == -1, 0], X[labels == -1, 1], 'g.') -plot_inner_labeled, = plt.plot(X[labels == inner, 0], - X[labels == inner, 1], 'bs') -plt.legend((plot_outer_labeled, plot_inner_labeled, plot_unlabeled), - ('Outer Labeled', 'Inner Labeled', 'Unlabeled'), 'upper left', - numpoints=1, shadow=False) -plt.title("Raw data (2 classes=red and blue)") - -plt.subplot(1, 2, 2) -output_label_array = np.asarray(output_labels) -outer_numbers = np.where(output_label_array == outer)[0] -inner_numbers = np.where(output_label_array == inner)[0] -plot_outer, = plt.plot(X[outer_numbers, 0], X[outer_numbers, 1], 'rs') -plot_inner, = plt.plot(X[inner_numbers, 0], X[inner_numbers, 1], 'bs') -plt.legend((plot_outer, plot_inner), ('Outer Learned', 'Inner Learned'), - 'upper left', numpoints=1, shadow=False) -plt.title("Labels learned with Label Spreading (KNN)") - -plt.subplots_adjust(left=0.07, bottom=0.07, right=0.93, top=0.92) -plt.show() diff --git a/0.15/_downloads/plot_label_propagation_versus_svm_iris.py b/0.15/_downloads/plot_label_propagation_versus_svm_iris.py deleted file mode 100644 index 399b04b642a45..0000000000000 --- a/0.15/_downloads/plot_label_propagation_versus_svm_iris.py +++ /dev/null @@ -1,79 +0,0 @@ -""" -===================================================================== -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 -# Licence: 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() - -X = iris.data[:, :2] -y = iris.target - -# step size in the mesh -h = .02 - -y_30 = np.copy(y) -y_30[rng.rand(len(y)) < 0.3] = -1 -y_50 = np.copy(y) -y_50[rng.rand(len(y)) < 0.5] = -1 -# we create an instance of SVM and fit out data. We do not scale our -# data since we want to plot the support vectors -ls30 = (label_propagation.LabelSpreading().fit(X, y_30), - y_30) -ls50 = (label_propagation.LabelSpreading().fit(X, y_50), - y_50) -ls100 = (label_propagation.LabelSpreading().fit(X, y), y) -rbf_svc = (svm.SVC(kernel='rbf').fit(X, y), y) - -# create a mesh to plot in -x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 -y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 -xx, yy = np.meshgrid(np.arange(x_min, x_max, h), - np.arange(y_min, y_max, h)) - -# title for the plots -titles = ['Label Spreading 30% data', - 'Label Spreading 50% data', - 'Label Spreading 100% data', - 'SVC with rbf kernel'] - -color_map = {-1: (1, 1, 1), 0: (0, 0, .9), 1: (1, 0, 0), 2: (.8, .6, 0)} - -for i, (clf, y_train) in enumerate((ls30, ls50, ls100, rbf_svc)): - # Plot the decision boundary. For that, we will assign a color to each - # point in the mesh [x_min, m_max]x[y_min, y_max]. - plt.subplot(2, 2, i + 1) - Z = clf.predict(np.c_[xx.ravel(), yy.ravel()]) - - # Put the result into a color plot - Z = Z.reshape(xx.shape) - plt.contourf(xx, yy, Z, cmap=plt.cm.Paired) - plt.axis('off') - - # Plot also the training points - colors = [color_map[y] for y in y_train] - plt.scatter(X[:, 0], X[:, 1], c=colors, cmap=plt.cm.Paired) - - plt.title(titles[i]) - -plt.text(.90, 0, "Unlabeled points are colored white") -plt.show() diff --git a/0.15/_downloads/plot_lasso_and_elasticnet.py b/0.15/_downloads/plot_lasso_and_elasticnet.py deleted file mode 100644 index c9a1fbb2c3196..0000000000000 --- a/0.15/_downloads/plot_lasso_and_elasticnet.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -======================================== -Lasso and Elastic Net for Sparse Signals -======================================== - -Estimates Lasso and Elastic-Net regression models on a manually generated -sparse signal corrupted with an additive noise. Estimated coefficients are -compared with the ground-truth. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.metrics import r2_score - -############################################################################### -# generate some sparse data to play with -np.random.seed(42) - -n_samples, n_features = 50, 200 -X = np.random.randn(n_samples, n_features) -coef = 3 * np.random.randn(n_features) -inds = np.arange(n_features) -np.random.shuffle(inds) -coef[inds[10:]] = 0 # sparsify coef -y = np.dot(X, coef) - -# add noise -y += 0.01 * np.random.normal((n_samples,)) - -# Split data in train set and test set -n_samples = X.shape[0] -X_train, y_train = X[:n_samples / 2], y[:n_samples / 2] -X_test, y_test = X[n_samples / 2:], y[n_samples / 2:] - -############################################################################### -# Lasso -from sklearn.linear_model import Lasso - -alpha = 0.1 -lasso = Lasso(alpha=alpha) - -y_pred_lasso = lasso.fit(X_train, y_train).predict(X_test) -r2_score_lasso = r2_score(y_test, y_pred_lasso) -print(lasso) -print("r^2 on test data : %f" % r2_score_lasso) - -############################################################################### -# ElasticNet -from sklearn.linear_model import ElasticNet - -enet = ElasticNet(alpha=alpha, l1_ratio=0.7) - -y_pred_enet = enet.fit(X_train, y_train).predict(X_test) -r2_score_enet = r2_score(y_test, y_pred_enet) -print(enet) -print("r^2 on test data : %f" % r2_score_enet) - -plt.plot(enet.coef_, label='Elastic net coefficients') -plt.plot(lasso.coef_, label='Lasso coefficients') -plt.plot(coef, '--', label='original coefficients') -plt.legend(loc='best') -plt.title("Lasso R^2: %f, Elastic Net R^2: %f" - % (r2_score_lasso, r2_score_enet)) -plt.show() diff --git a/0.15/_downloads/plot_lasso_coordinate_descent_path.py b/0.15/_downloads/plot_lasso_coordinate_descent_path.py deleted file mode 100644 index d4c1bd79f7f8a..0000000000000 --- a/0.15/_downloads/plot_lasso_coordinate_descent_path.py +++ /dev/null @@ -1,88 +0,0 @@ -""" -===================== -Lasso and Elastic Net -===================== - -Lasso and elastic net (L1 and L2 penalisation) implemented using a -coordinate descent. - -The coefficients can be forced to be positive. -""" -print(__doc__) - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.linear_model import lasso_path, enet_path -from sklearn import datasets - -diabetes = datasets.load_diabetes() -X = diabetes.data -y = diabetes.target - -X /= X.std(axis=0) # Standardize data (easier to set the l1_ratio parameter) - -# Compute paths - -eps = 5e-3 # the smaller it is the longer is the path - -print("Computing regularization path using the lasso...") -alphas_lasso, coefs_lasso, _ = lasso_path(X, y, eps, fit_intercept=False) - -print("Computing regularization path using the positive lasso...") -alphas_positive_lasso, coefs_positive_lasso, _ = lasso_path( - X, y, eps, positive=True, fit_intercept=False) -print("Computing regularization path using the elastic net...") -alphas_enet, coefs_enet, _ = enet_path( - X, y, eps=eps, l1_ratio=0.8, fit_intercept=False) - -print("Computing regularization path using the positve elastic net...") -alphas_positive_enet, coefs_positive_enet, _ = enet_path( - X, y, eps=eps, l1_ratio=0.8, positive=True, fit_intercept=False) - -# Display results - -plt.figure(1) -ax = plt.gca() -ax.set_color_cycle(2 * ['b', 'r', 'g', 'c', 'k']) -l1 = plt.plot(-np.log10(alphas_lasso), coefs_lasso.T) -l2 = plt.plot(-np.log10(alphas_enet), coefs_enet.T, linestyle='--') - -plt.xlabel('-Log(alpha)') -plt.ylabel('coefficients') -plt.title('Lasso and Elastic-Net Paths') -plt.legend((l1[-1], l2[-1]), ('Lasso', 'Elastic-Net'), loc='lower left') -plt.axis('tight') - - -plt.figure(2) -ax = plt.gca() -ax.set_color_cycle(2 * ['b', 'r', 'g', 'c', 'k']) -l1 = plt.plot(-np.log10(alphas_lasso), coefs_lasso.T) -l2 = plt.plot(-np.log10(alphas_positive_lasso), coefs_positive_lasso.T, - linestyle='--') - -plt.xlabel('-Log(alpha)') -plt.ylabel('coefficients') -plt.title('Lasso and positive Lasso') -plt.legend((l1[-1], l2[-1]), ('Lasso', 'positive Lasso'), loc='lower left') -plt.axis('tight') - - -plt.figure(3) -ax = plt.gca() -ax.set_color_cycle(2 * ['b', 'r', 'g', 'c', 'k']) -l1 = plt.plot(-np.log10(alphas_enet), coefs_enet.T) -l2 = plt.plot(-np.log10(alphas_positive_enet), coefs_positive_enet.T, - linestyle='--') - -plt.xlabel('-Log(alpha)') -plt.ylabel('coefficients') -plt.title('Elastic-Net and positive Elastic-Net') -plt.legend((l1[-1], l2[-1]), ('Elastic-Net', 'positive Elastic-Net'), - loc='lower left') -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_lasso_lars.py b/0.15/_downloads/plot_lasso_lars.py deleted file mode 100644 index dde26ee0347dd..0000000000000 --- a/0.15/_downloads/plot_lasso_lars.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -""" -===================== -Lasso path using LARS -===================== - -Computes Lasso Path along the regularization parameter using the LARS -algorithm on the diabetes dataset. Each color represents a different -feature of the coefficient vector, and this is displayed as a function -of the regularization parameter. - -""" -print(__doc__) - -# Author: Fabian Pedregosa -# Alexandre Gramfort -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import linear_model -from sklearn import datasets - -diabetes = datasets.load_diabetes() -X = diabetes.data -y = diabetes.target - -print("Computing regularization path using the LARS ...") -alphas, _, coefs = linear_model.lars_path(X, y, method='lasso', verbose=True) - -xx = np.sum(np.abs(coefs.T), axis=1) -xx /= xx[-1] - -plt.plot(xx, coefs.T) -ymin, ymax = plt.ylim() -plt.vlines(xx, ymin, ymax, linestyle='dashed') -plt.xlabel('|coef| / max|coef|') -plt.ylabel('Coefficients') -plt.title('LASSO Path') -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_lasso_model_selection.py b/0.15/_downloads/plot_lasso_model_selection.py deleted file mode 100644 index 10bdc9b5f1d40..0000000000000 --- a/0.15/_downloads/plot_lasso_model_selection.py +++ /dev/null @@ -1,155 +0,0 @@ -""" -=================================================== -Lasso model selection: Cross-Validation / AIC / BIC -=================================================== - -Use the Akaike information criterion (AIC), the Bayes Information -criterion (BIC) and cross-validation to select an optimal value -of the regularization parameter alpha of the :ref:`lasso` estimator. - -Results obtained with LassoLarsIC are based on AIC/BIC criteria. - -Information-criterion based model selection is very fast, but it -relies on a proper estimation of degrees of freedom, are -derived for large samples (asymptotic results) and assume the model -is correct, i.e. that the data are actually generated by this model. -They also tend to break when the problem is badly conditioned -(more features than samples). - -For cross-validation, we use 20-fold with 2 algorithms to compute the -Lasso path: coordinate descent, as implemented by the LassoCV class, and -Lars (least angle regression) as implemented by the LassoLarsCV class. -Both algorithms give roughly the same results. They differ with regards -to their execution speed and sources of numerical errors. - -Lars computes a path solution only for each kink in the path. As a -result, it is very efficient when there are only of few kinks, which is -the case if there are few features or samples. Also, it is able to -compute the full path without setting any meta parameter. On the -opposite, coordinate descent compute the path points on a pre-specified -grid (here we use the default). Thus it is more efficient if the number -of grid points is smaller than the number of kinks in the path. Such a -strategy can be interesting if the number of features is really large -and there are enough samples to select a large amount. In terms of -numerical errors, for heavily correlated variables, Lars will accumulate -more errors, while the coordinate descent algorithm will only sample the -path on a grid. - -Note how the optimal value of alpha varies for each fold. This -illustrates why nested-cross validation is necessary when trying to -evaluate the performance of a method for which a parameter is chosen by -cross-validation: this choice of parameter may not be optimal for unseen -data. -""" -print(__doc__) - -# Author: Olivier Grisel, Gael Varoquaux, Alexandre Gramfort -# License: BSD 3 clause - -import time - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.linear_model import LassoCV, LassoLarsCV, LassoLarsIC -from sklearn import datasets - -diabetes = datasets.load_diabetes() -X = diabetes.data -y = diabetes.target - -rng = np.random.RandomState(42) -X = np.c_[X, rng.randn(X.shape[0], 14)] # add some bad features - -# normalize data as done by Lars to allow for comparison -X /= np.sqrt(np.sum(X ** 2, axis=0)) - -############################################################################## -# LassoLarsIC: least angle regression with BIC/AIC criterion - -model_bic = LassoLarsIC(criterion='bic') -t1 = time.time() -model_bic.fit(X, y) -t_bic = time.time() - t1 -alpha_bic_ = model_bic.alpha_ - -model_aic = LassoLarsIC(criterion='aic') -model_aic.fit(X, y) -alpha_aic_ = model_aic.alpha_ - - -def plot_ic_criterion(model, name, color): - alpha_ = model.alpha_ - alphas_ = model.alphas_ - criterion_ = model.criterion_ - plt.plot(-np.log10(alphas_), criterion_, '--', color=color, - linewidth=3, label='%s criterion' % name) - plt.axvline(-np.log10(alpha_), color=color, linewidth=3, - label='alpha: %s estimate' % name) - plt.xlabel('-log(alpha)') - plt.ylabel('criterion') - -plt.figure() -plot_ic_criterion(model_aic, 'AIC', 'b') -plot_ic_criterion(model_bic, 'BIC', 'r') -plt.legend() -plt.title('Information-criterion for model selection (training time %.3fs)' - % t_bic) - -############################################################################## -# LassoCV: coordinate descent - -# Compute paths -print("Computing regularization path using the coordinate descent lasso...") -t1 = time.time() -model = LassoCV(cv=20).fit(X, y) -t_lasso_cv = time.time() - t1 - -# Display results -m_log_alphas = -np.log10(model.alphas_) - -plt.figure() -ymin, ymax = 2300, 3800 -plt.plot(m_log_alphas, model.mse_path_, ':') -plt.plot(m_log_alphas, model.mse_path_.mean(axis=-1), 'k', - label='Average across the folds', linewidth=2) -plt.axvline(-np.log10(model.alpha_), linestyle='--', color='k', - label='alpha: CV estimate') - -plt.legend() - -plt.xlabel('-log(alpha)') -plt.ylabel('Mean square error') -plt.title('Mean square error on each fold: coordinate descent ' - '(train time: %.2fs)' % t_lasso_cv) -plt.axis('tight') -plt.ylim(ymin, ymax) - -############################################################################## -# LassoLarsCV: least angle regression - -# Compute paths -print("Computing regularization path using the Lars lasso...") -t1 = time.time() -model = LassoLarsCV(cv=20).fit(X, y) -t_lasso_lars_cv = time.time() - t1 - -# Display results -m_log_alphas = -np.log10(model.cv_alphas_) - -plt.figure() -plt.plot(m_log_alphas, model.cv_mse_path_, ':') -plt.plot(m_log_alphas, model.cv_mse_path_.mean(axis=-1), 'k', - label='Average across the folds', linewidth=2) -plt.axvline(-np.log10(model.alpha_), linestyle='--', color='k', - label='alpha CV') -plt.legend() - -plt.xlabel('-log(alpha)') -plt.ylabel('Mean square error') -plt.title('Mean square error on each fold: Lars (train time: %.2fs)' - % t_lasso_lars_cv) -plt.axis('tight') -plt.ylim(ymin, ymax) - -plt.show() diff --git a/0.15/_downloads/plot_lda.py b/0.15/_downloads/plot_lda.py deleted file mode 100644 index 42b404c45784c..0000000000000 --- a/0.15/_downloads/plot_lda.py +++ /dev/null @@ -1,70 +0,0 @@ -""" -==================================================================== -Normal and Shrinkage Linear Discriminant Analysis for classification -==================================================================== - -Shows how shrinkage improves classification. -""" - -from __future__ import division - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.datasets import make_blobs -from sklearn.lda import LDA - - -n_train = 20 # samples for training -n_test = 200 # samples for testing -n_averages = 50 # how often to repeat classification -n_features_max = 75 # maximum number of features -step = 4 # step size for the calculation - - -def generate_data(n_samples, n_features): - """Generate random blob-ish data with noisy features. - - This returns an array of input data with shape `(n_samples, n_features)` - and an array of `n_samples` target labels. - - Only one feature contains discriminative information, the other features - contain only noise. - """ - X, y = make_blobs(n_samples=n_samples, n_features=1, centers=[[-2], [2]]) - - # add non-discriminative features - if n_features > 1: - X = np.hstack([X, np.random.randn(n_samples, n_features - 1)]) - return X, y - -acc_clf1, acc_clf2 = [], [] -n_features_range = range(1, n_features_max + 1, step) -for n_features in n_features_range: - score_clf1, score_clf2 = 0, 0 - for _ in range(n_averages): - X, y = generate_data(n_train, n_features) - - clf1 = LDA(solver='lsqr', shrinkage='auto').fit(X, y) - clf2 = LDA(solver='lsqr', shrinkage=None).fit(X, y) - - X, y = generate_data(n_test, n_features) - score_clf1 += clf1.score(X, y) - score_clf2 += clf2.score(X, y) - - acc_clf1.append(score_clf1 / n_averages) - acc_clf2.append(score_clf2 / n_averages) - -features_samples_ratio = np.array(n_features_range) / n_train - -plt.plot(features_samples_ratio, acc_clf1, linewidth=2, - label="LDA with shrinkage", color='r') -plt.plot(features_samples_ratio, acc_clf2, linewidth=2, - label="LDA", color='g') - -plt.xlabel('n_features / n_samples') -plt.ylabel('Classification accuracy') - -plt.legend(loc=1, prop={'size': 12}) -plt.suptitle('LDA vs. shrinkage LDA (1 discriminative feature)') -plt.show() diff --git a/0.15/_downloads/plot_lda_qda.py b/0.15/_downloads/plot_lda_qda.py deleted file mode 100644 index c22f38e2a47e2..0000000000000 --- a/0.15/_downloads/plot_lda_qda.py +++ /dev/null @@ -1,142 +0,0 @@ -""" -==================================================================== -Linear and Quadratic Discriminant Analysis with confidence ellipsoid -==================================================================== - -Plot the confidence ellipsoids of each class and decision boundary -""" -print(__doc__) - -from scipy import linalg -import numpy as np -import matplotlib.pyplot as plt -import matplotlib as mpl -from matplotlib import colors - -from sklearn.lda import LDA -from sklearn.qda import QDA - -############################################################################### -# colormap -cmap = colors.LinearSegmentedColormap( - 'red_blue_classes', - {'red': [(0, 1, 1), (1, 0.7, 0.7)], - 'green': [(0, 0.7, 0.7), (1, 0.7, 0.7)], - 'blue': [(0, 0.7, 0.7), (1, 1, 1)]}) -plt.cm.register_cmap(cmap=cmap) - - -############################################################################### -# generate datasets -def dataset_fixed_cov(): - '''Generate 2 Gaussians samples with the same covariance matrix''' - n, dim = 300, 2 - np.random.seed(0) - C = np.array([[0., -0.23], [0.83, .23]]) - X = np.r_[np.dot(np.random.randn(n, dim), C), - np.dot(np.random.randn(n, dim), C) + np.array([1, 1])] - y = np.hstack((np.zeros(n), np.ones(n))) - return X, y - - -def dataset_cov(): - '''Generate 2 Gaussians samples with different covariance matrices''' - n, dim = 300, 2 - np.random.seed(0) - C = np.array([[0., -1.], [2.5, .7]]) * 2. - X = np.r_[np.dot(np.random.randn(n, dim), C), - np.dot(np.random.randn(n, dim), C.T) + np.array([1, 4])] - y = np.hstack((np.zeros(n), np.ones(n))) - return X, y - - -############################################################################### -# plot functions -def plot_data(lda, X, y, y_pred, fig_index): - splot = plt.subplot(2, 2, fig_index) - if fig_index == 1: - plt.title('Linear Discriminant Analysis') - plt.ylabel('Data with fixed covariance') - elif fig_index == 2: - plt.title('Quadratic Discriminant Analysis') - elif fig_index == 3: - plt.ylabel('Data with varying covariances') - - tp = (y == y_pred) # True Positive - tp0, tp1 = tp[y == 0], tp[y == 1] - X0, X1 = X[y == 0], X[y == 1] - X0_tp, X0_fp = X0[tp0], X0[~tp0] - X1_tp, X1_fp = X1[tp1], X1[~tp1] - xmin, xmax = X[:, 0].min(), X[:, 0].max() - ymin, ymax = X[:, 1].min(), X[:, 1].max() - - # class 0: dots - plt.plot(X0_tp[:, 0], X0_tp[:, 1], 'o', color='red') - plt.plot(X0_fp[:, 0], X0_fp[:, 1], '.', color='#990000') # dark red - - # class 1: dots - plt.plot(X1_tp[:, 0], X1_tp[:, 1], 'o', color='blue') - plt.plot(X1_fp[:, 0], X1_fp[:, 1], '.', color='#000099') # dark blue - - # class 0 and 1 : areas - nx, ny = 200, 100 - x_min, x_max = plt.xlim() - y_min, y_max = plt.ylim() - xx, yy = np.meshgrid(np.linspace(x_min, x_max, nx), - np.linspace(y_min, y_max, ny)) - Z = lda.predict_proba(np.c_[xx.ravel(), yy.ravel()]) - Z = Z[:, 1].reshape(xx.shape) - plt.pcolormesh(xx, yy, Z, cmap='red_blue_classes', - norm=colors.Normalize(0., 1.)) - plt.contour(xx, yy, Z, [0.5], linewidths=2., colors='k') - - # means - plt.plot(lda.means_[0][0], lda.means_[0][1], - 'o', color='black', markersize=10) - plt.plot(lda.means_[1][0], lda.means_[1][1], - 'o', color='black', markersize=10) - - return splot - - -def plot_ellipse(splot, mean, cov, color): - v, w = linalg.eigh(cov) - u = w[0] / linalg.norm(w[0]) - angle = np.arctan(u[1] / u[0]) - angle = 180 * angle / np.pi # convert to degrees - # filled Gaussian at 2 standard deviation - ell = mpl.patches.Ellipse(mean, 2 * v[0] ** 0.5, 2 * v[1] ** 0.5, - 180 + angle, color=color) - ell.set_clip_box(splot.bbox) - ell.set_alpha(0.5) - splot.add_artist(ell) - splot.set_xticks(()) - splot.set_yticks(()) - - -def plot_lda_cov(lda, splot): - plot_ellipse(splot, lda.means_[0], lda.covariance_, 'red') - plot_ellipse(splot, lda.means_[1], lda.covariance_, 'blue') - - -def plot_qda_cov(qda, splot): - plot_ellipse(splot, qda.means_[0], qda.covariances_[0], 'red') - plot_ellipse(splot, qda.means_[1], qda.covariances_[1], 'blue') - -############################################################################### -for i, (X, y) in enumerate([dataset_fixed_cov(), dataset_cov()]): - # LDA - lda = LDA(solver="svd", store_covariance=True) - y_pred = lda.fit(X, y).predict(X) - splot = plot_data(lda, X, y, y_pred, fig_index=2 * i + 1) - plot_lda_cov(lda, splot) - plt.axis('tight') - - # QDA - qda = QDA() - y_pred = qda.fit(X, y, store_covariances=True).predict(X) - splot = plot_data(qda, X, y, y_pred, fig_index=2 * i + 2) - plot_qda_cov(qda, splot) - plt.axis('tight') -plt.suptitle('LDA vs QDA') -plt.show() diff --git a/0.15/_downloads/plot_lda_qda1.py b/0.15/_downloads/plot_lda_qda1.py deleted file mode 100644 index d2cf1ddb446b9..0000000000000 --- a/0.15/_downloads/plot_lda_qda1.py +++ /dev/null @@ -1,142 +0,0 @@ -""" -==================================================================== -Linear and Quadratic Discriminant Analysis with confidence ellipsoid -==================================================================== - -Plot the confidence ellipsoids of each class and decision boundary -""" -print(__doc__) - -from scipy import linalg -import numpy as np -import matplotlib.pyplot as plt -import matplotlib as mpl -from matplotlib import colors - -from sklearn.lda import LDA -from sklearn.qda import QDA - -############################################################################### -# colormap -cmap = colors.LinearSegmentedColormap( - 'red_blue_classes', - {'red': [(0, 1, 1), (1, 0.7, 0.7)], - 'green': [(0, 0.7, 0.7), (1, 0.7, 0.7)], - 'blue': [(0, 0.7, 0.7), (1, 1, 1)]}) -plt.cm.register_cmap(cmap=cmap) - - -############################################################################### -# generate datasets -def dataset_fixed_cov(): - '''Generate 2 Gaussians samples with the same covariance matrix''' - n, dim = 300, 2 - np.random.seed(0) - C = np.array([[0., -0.23], [0.83, .23]]) - X = np.r_[np.dot(np.random.randn(n, dim), C), - np.dot(np.random.randn(n, dim), C) + np.array([1, 1])] - y = np.hstack((np.zeros(n), np.ones(n))) - return X, y - - -def dataset_cov(): - '''Generate 2 Gaussians samples with different covariance matrices''' - n, dim = 300, 2 - np.random.seed(0) - C = np.array([[0., -1.], [2.5, .7]]) * 2. - X = np.r_[np.dot(np.random.randn(n, dim), C), - np.dot(np.random.randn(n, dim), C.T) + np.array([1, 4])] - y = np.hstack((np.zeros(n), np.ones(n))) - return X, y - - -############################################################################### -# plot functions -def plot_data(lda, X, y, y_pred, fig_index): - splot = plt.subplot(2, 2, fig_index) - if fig_index == 1: - plt.title('Linear Discriminant Analysis') - plt.ylabel('Data with fixed covariance') - elif fig_index == 2: - plt.title('Quadratic Discriminant Analysis') - elif fig_index == 3: - plt.ylabel('Data with varying covariances') - - tp = (y == y_pred) # True Positive - tp0, tp1 = tp[y == 0], tp[y == 1] - X0, X1 = X[y == 0], X[y == 1] - X0_tp, X0_fp = X0[tp0], X0[~tp0] - X1_tp, X1_fp = X1[tp1], X1[~tp1] - xmin, xmax = X[:, 0].min(), X[:, 0].max() - ymin, ymax = X[:, 1].min(), X[:, 1].max() - - # class 0: dots - plt.plot(X0_tp[:, 0], X0_tp[:, 1], 'o', color='red') - plt.plot(X0_fp[:, 0], X0_fp[:, 1], '.', color='#990000') # dark red - - # class 1: dots - plt.plot(X1_tp[:, 0], X1_tp[:, 1], 'o', color='blue') - plt.plot(X1_fp[:, 0], X1_fp[:, 1], '.', color='#000099') # dark blue - - # class 0 and 1 : areas - nx, ny = 200, 100 - x_min, x_max = plt.xlim() - y_min, y_max = plt.ylim() - xx, yy = np.meshgrid(np.linspace(x_min, x_max, nx), - np.linspace(y_min, y_max, ny)) - Z = lda.predict_proba(np.c_[xx.ravel(), yy.ravel()]) - Z = Z[:, 1].reshape(xx.shape) - plt.pcolormesh(xx, yy, Z, cmap='red_blue_classes', - norm=colors.Normalize(0., 1.)) - plt.contour(xx, yy, Z, [0.5], linewidths=2., colors='k') - - # means - plt.plot(lda.means_[0][0], lda.means_[0][1], - 'o', color='black', markersize=10) - plt.plot(lda.means_[1][0], lda.means_[1][1], - 'o', color='black', markersize=10) - - return splot - - -def plot_ellipse(splot, mean, cov, color): - v, w = linalg.eigh(cov) - u = w[0] / linalg.norm(w[0]) - angle = np.arctan(u[1] / u[0]) - angle = 180 * angle / np.pi # convert to degrees - # filled Gaussian at 2 standard deviation - ell = mpl.patches.Ellipse(mean, 2 * v[0] ** 0.5, 2 * v[1] ** 0.5, - 180 + angle, color=color) - ell.set_clip_box(splot.bbox) - ell.set_alpha(0.5) - splot.add_artist(ell) - splot.set_xticks(()) - splot.set_yticks(()) - - -def plot_lda_cov(lda, splot): - plot_ellipse(splot, lda.means_[0], lda.covariance_, 'red') - plot_ellipse(splot, lda.means_[1], lda.covariance_, 'blue') - - -def plot_qda_cov(qda, splot): - plot_ellipse(splot, qda.means_[0], qda.covariances_[0], 'red') - plot_ellipse(splot, qda.means_[1], qda.covariances_[1], 'blue') - -############################################################################### -for i, (X, y) in enumerate([dataset_fixed_cov(), dataset_cov()]): - # LDA - lda = LDA() - y_pred = lda.fit(X, y, store_covariance=True).predict(X) - splot = plot_data(lda, X, y, y_pred, fig_index=2 * i + 1) - plot_lda_cov(lda, splot) - plt.axis('tight') - - # QDA - qda = QDA() - y_pred = qda.fit(X, y, store_covariances=True).predict(X) - splot = plot_data(qda, X, y, y_pred, fig_index=2 * i + 2) - plot_qda_cov(qda, splot) - plt.axis('tight') -plt.suptitle('LDA vs QDA') -plt.show() diff --git a/0.15/_downloads/plot_learning_curve.py b/0.15/_downloads/plot_learning_curve.py deleted file mode 100644 index 7a47fd574635d..0000000000000 --- a/0.15/_downloads/plot_learning_curve.py +++ /dev/null @@ -1,107 +0,0 @@ -""" -======================== -Plotting Learning Curves -======================== - -On the left side the learning curve of a naive Bayes classifier is shown for -the digits dataset. Note that the training score and the cross-validation score -are both not very good at the end. However, the shape of the curve can be found -in more complex datasets very often: the training score is very high at the -beginning and decreases and the cross-validation score is very low at the -beginning and increases. On the right side we see the learning curve of an SVM -with RBF kernel. We can see clearly that the training score is still around -the maximum and the validation score could be increased with more training -samples. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import cross_validation -from sklearn.naive_bayes import GaussianNB -from sklearn.svm import SVC -from sklearn.datasets import load_digits -from sklearn.learning_curve import learning_curve - - -def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, - n_jobs=1, train_sizes=np.linspace(.1, 1.0, 5)): - """ - Generate a simple plot of the test and traning learning curve. - - Parameters - ---------- - estimator : object type that implements the "fit" and "predict" methods - An object of that type which is cloned for each validation. - - title : string - Title for the chart. - - X : array-like, shape (n_samples, n_features) - Training vector, where n_samples is the number of samples and - n_features is the number of features. - - y : array-like, shape (n_samples) or (n_samples, n_features), optional - Target relative to X for classification or regression; - None for unsupervised learning. - - ylim : tuple, shape (ymin, ymax), optional - Defines minimum and maximum yvalues plotted. - - cv : integer, cross-validation generator, optional - If an integer is passed, it is the number of folds (defaults to 3). - Specific cross-validation objects can be passed, see - sklearn.cross_validation module for the list of possible objects - - n_jobs : integer, optional - Number of jobs to run in parallel (default 1). - """ - plt.figure() - plt.title(title) - if ylim is not None: - plt.ylim(*ylim) - plt.xlabel("Training examples") - plt.ylabel("Score") - train_sizes, train_scores, test_scores = learning_curve( - estimator, X, y, cv=cv, n_jobs=n_jobs, train_sizes=train_sizes) - train_scores_mean = np.mean(train_scores, axis=1) - train_scores_std = np.std(train_scores, axis=1) - test_scores_mean = np.mean(test_scores, axis=1) - test_scores_std = np.std(test_scores, axis=1) - plt.grid() - - plt.fill_between(train_sizes, train_scores_mean - train_scores_std, - train_scores_mean + train_scores_std, alpha=0.1, - color="r") - plt.fill_between(train_sizes, test_scores_mean - test_scores_std, - test_scores_mean + test_scores_std, alpha=0.1, color="g") - plt.plot(train_sizes, train_scores_mean, 'o-', color="r", - label="Training score") - plt.plot(train_sizes, test_scores_mean, 'o-', color="g", - label="Cross-validation score") - - plt.legend(loc="best") - return plt - - -digits = load_digits() -X, y = digits.data, digits.target - - -title = "Learning Curves (Naive Bayes)" -# Cross validation with 100 iterations to get smoother mean test and train -# score curves, each time with 20% data randomly selected as a validation set. -cv = cross_validation.ShuffleSplit(digits.data.shape[0], n_iter=100, - test_size=0.2, random_state=0) - -estimator = GaussianNB() -plot_learning_curve(estimator, title, X, y, ylim=(0.7, 1.01), cv=cv, n_jobs=4) - -title = "Learning Curves (SVM, RBF kernel, $\gamma=0.001$)" -# SVC is more expensive so we do a lower number of CV iterations: -cv = cross_validation.ShuffleSplit(digits.data.shape[0], n_iter=10, - test_size=0.2, random_state=0) -estimator = SVC(gamma=0.001) -plot_learning_curve(estimator, title, X, y, (0.7, 1.01), cv=cv, n_jobs=4) - -plt.show() diff --git a/0.15/_downloads/plot_learning_curve1.py b/0.15/_downloads/plot_learning_curve1.py deleted file mode 100644 index 7a47fd574635d..0000000000000 --- a/0.15/_downloads/plot_learning_curve1.py +++ /dev/null @@ -1,107 +0,0 @@ -""" -======================== -Plotting Learning Curves -======================== - -On the left side the learning curve of a naive Bayes classifier is shown for -the digits dataset. Note that the training score and the cross-validation score -are both not very good at the end. However, the shape of the curve can be found -in more complex datasets very often: the training score is very high at the -beginning and decreases and the cross-validation score is very low at the -beginning and increases. On the right side we see the learning curve of an SVM -with RBF kernel. We can see clearly that the training score is still around -the maximum and the validation score could be increased with more training -samples. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import cross_validation -from sklearn.naive_bayes import GaussianNB -from sklearn.svm import SVC -from sklearn.datasets import load_digits -from sklearn.learning_curve import learning_curve - - -def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, - n_jobs=1, train_sizes=np.linspace(.1, 1.0, 5)): - """ - Generate a simple plot of the test and traning learning curve. - - Parameters - ---------- - estimator : object type that implements the "fit" and "predict" methods - An object of that type which is cloned for each validation. - - title : string - Title for the chart. - - X : array-like, shape (n_samples, n_features) - Training vector, where n_samples is the number of samples and - n_features is the number of features. - - y : array-like, shape (n_samples) or (n_samples, n_features), optional - Target relative to X for classification or regression; - None for unsupervised learning. - - ylim : tuple, shape (ymin, ymax), optional - Defines minimum and maximum yvalues plotted. - - cv : integer, cross-validation generator, optional - If an integer is passed, it is the number of folds (defaults to 3). - Specific cross-validation objects can be passed, see - sklearn.cross_validation module for the list of possible objects - - n_jobs : integer, optional - Number of jobs to run in parallel (default 1). - """ - plt.figure() - plt.title(title) - if ylim is not None: - plt.ylim(*ylim) - plt.xlabel("Training examples") - plt.ylabel("Score") - train_sizes, train_scores, test_scores = learning_curve( - estimator, X, y, cv=cv, n_jobs=n_jobs, train_sizes=train_sizes) - train_scores_mean = np.mean(train_scores, axis=1) - train_scores_std = np.std(train_scores, axis=1) - test_scores_mean = np.mean(test_scores, axis=1) - test_scores_std = np.std(test_scores, axis=1) - plt.grid() - - plt.fill_between(train_sizes, train_scores_mean - train_scores_std, - train_scores_mean + train_scores_std, alpha=0.1, - color="r") - plt.fill_between(train_sizes, test_scores_mean - test_scores_std, - test_scores_mean + test_scores_std, alpha=0.1, color="g") - plt.plot(train_sizes, train_scores_mean, 'o-', color="r", - label="Training score") - plt.plot(train_sizes, test_scores_mean, 'o-', color="g", - label="Cross-validation score") - - plt.legend(loc="best") - return plt - - -digits = load_digits() -X, y = digits.data, digits.target - - -title = "Learning Curves (Naive Bayes)" -# Cross validation with 100 iterations to get smoother mean test and train -# score curves, each time with 20% data randomly selected as a validation set. -cv = cross_validation.ShuffleSplit(digits.data.shape[0], n_iter=100, - test_size=0.2, random_state=0) - -estimator = GaussianNB() -plot_learning_curve(estimator, title, X, y, ylim=(0.7, 1.01), cv=cv, n_jobs=4) - -title = "Learning Curves (SVM, RBF kernel, $\gamma=0.001$)" -# SVC is more expensive so we do a lower number of CV iterations: -cv = cross_validation.ShuffleSplit(digits.data.shape[0], n_iter=10, - test_size=0.2, random_state=0) -estimator = SVC(gamma=0.001) -plot_learning_curve(estimator, title, X, y, (0.7, 1.01), cv=cv, n_jobs=4) - -plt.show() diff --git a/0.15/_downloads/plot_lena_compress.py b/0.15/_downloads/plot_lena_compress.py deleted file mode 100644 index 209d77265ef4d..0000000000000 --- a/0.15/_downloads/plot_lena_compress.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -Vector Quantization Example -========================================================= - -The classic image processing example, Lena, an 8-bit grayscale -bit-depth, 512 x 512 sized image, is used here to illustrate -how `k`-means is used for vector quantization. - -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -import numpy as np -import scipy as sp -import matplotlib.pyplot as plt - -from sklearn import cluster - -n_clusters = 5 -np.random.seed(0) - -try: - lena = sp.lena() -except AttributeError: - # Newer versions of scipy have lena in misc - from scipy import misc - lena = misc.lena() -X = lena.reshape((-1, 1)) # We need an (n_sample, n_feature) array -k_means = cluster.KMeans(n_clusters=n_clusters, n_init=4) -k_means.fit(X) -values = k_means.cluster_centers_.squeeze() -labels = k_means.labels_ - -# create an array from labels and values -lena_compressed = np.choose(labels, values) -lena_compressed.shape = lena.shape - -vmin = lena.min() -vmax = lena.max() - -# original lena -plt.figure(1, figsize=(3, 2.2)) -plt.imshow(lena, cmap=plt.cm.gray, vmin=vmin, vmax=256) - -# compressed lena -plt.figure(2, figsize=(3, 2.2)) -plt.imshow(lena_compressed, cmap=plt.cm.gray, vmin=vmin, vmax=vmax) - -# equal bins lena -regular_values = np.linspace(0, 256, n_clusters + 1) -regular_labels = np.searchsorted(regular_values, lena) - 1 -regular_values = .5 * (regular_values[1:] + regular_values[:-1]) # mean -regular_lena = np.choose(regular_labels.ravel(), regular_values) -regular_lena.shape = lena.shape -plt.figure(3, figsize=(3, 2.2)) -plt.imshow(regular_lena, cmap=plt.cm.gray, vmin=vmin, vmax=vmax) - -# histogram -plt.figure(4, figsize=(3, 2.2)) -plt.clf() -plt.axes([.01, .01, .98, .98]) -plt.hist(X, bins=256, color='.5', edgecolor='.5') -plt.yticks(()) -plt.xticks(regular_values) -values = np.sort(values) -for center_1, center_2 in zip(values[:-1], values[1:]): - plt.axvline(.5 * (center_1 + center_2), color='b') - -for center_1, center_2 in zip(regular_values[:-1], regular_values[1:]): - plt.axvline(.5 * (center_1 + center_2), color='b', linestyle='--') - -plt.show() diff --git a/0.15/_downloads/plot_lena_segmentation.py b/0.15/_downloads/plot_lena_segmentation.py deleted file mode 100644 index 0a7ffe09e9ad6..0000000000000 --- a/0.15/_downloads/plot_lena_segmentation.py +++ /dev/null @@ -1,74 +0,0 @@ -""" -========================================= -Segmenting the picture of Lena in regions -========================================= - -This example uses :ref:`spectral_clustering` on a graph created from -voxel-to-voxel difference on an image to break this image into multiple -partly-homogeneous regions. - -This procedure (spectral clustering on an image) is an efficient -approximate solution for finding normalized graph cuts. - -There are two options to assign labels: - -* with 'kmeans' spectral clustering will cluster samples in the embedding space - using a kmeans algorithm -* whereas 'discrete' will iteratively search for the closest partition - space to the embedding space. -""" -print(__doc__) - -# Author: Gael Varoquaux , Brian Cheung -# License: BSD 3 clause - -import time - -import numpy as np -import scipy as sp -import matplotlib.pyplot as plt - -from sklearn.feature_extraction import image -from sklearn.cluster import spectral_clustering - -lena = sp.misc.lena() -# Downsample the image by a factor of 4 -lena = lena[::2, ::2] + lena[1::2, ::2] + lena[::2, 1::2] + lena[1::2, 1::2] -lena = lena[::2, ::2] + lena[1::2, ::2] + lena[::2, 1::2] + lena[1::2, 1::2] - -# Convert the image into a graph with the value of the gradient on the -# edges. -graph = image.img_to_graph(lena) - -# Take a decreasing function of the gradient: an exponential -# The smaller beta is, the more independent the segmentation is of the -# actual image. For beta=1, the segmentation is close to a voronoi -beta = 5 -eps = 1e-6 -graph.data = np.exp(-beta * graph.data / lena.std()) + eps - -# Apply spectral clustering (this step goes much faster if you have pyamg -# installed) -N_REGIONS = 11 - -############################################################################### -# Visualize the resulting regions - -for assign_labels in ('kmeans', 'discretize'): - t0 = time.time() - labels = spectral_clustering(graph, n_clusters=N_REGIONS, - assign_labels=assign_labels, - random_state=1) - t1 = time.time() - labels = labels.reshape(lena.shape) - - plt.figure(figsize=(5, 5)) - plt.imshow(lena, cmap=plt.cm.gray) - for l in range(N_REGIONS): - plt.contour(labels == l, contours=1, - colors=[plt.cm.spectral(l / float(N_REGIONS)), ]) - plt.xticks(()) - plt.yticks(()) - plt.title('Spectral clustering: %s, %.2fs' % (assign_labels, (t1 - t0))) - -plt.show() diff --git a/0.15/_downloads/plot_lena_ward_segmentation.py b/0.15/_downloads/plot_lena_ward_segmentation.py deleted file mode 100644 index 2d31325588895..0000000000000 --- a/0.15/_downloads/plot_lena_ward_segmentation.py +++ /dev/null @@ -1,56 +0,0 @@ -""" -=============================================================== -A demo of structured Ward hierarchical clustering on Lena image -=============================================================== - -Compute the segmentation of a 2D image with Ward hierarchical -clustering. The clustering is spatially constrained in order -for each segmented region to be in one piece. -""" - -# Author : Vincent Michel, 2010 -# Alexandre Gramfort, 2011 -# License: BSD 3 clause - -print(__doc__) - -import time as time -import numpy as np -import scipy as sp -import matplotlib.pyplot as plt -from sklearn.feature_extraction.image import grid_to_graph -from sklearn.cluster import AgglomerativeClustering - -############################################################################### -# Generate data -lena = sp.misc.lena() -# Downsample the image by a factor of 4 -lena = lena[::2, ::2] + lena[1::2, ::2] + lena[::2, 1::2] + lena[1::2, 1::2] -X = np.reshape(lena, (-1, 1)) - -############################################################################### -# Define the structure A of the data. Pixels connected to their neighbors. -connectivity = grid_to_graph(*lena.shape) - -############################################################################### -# Compute clustering -print("Compute structured hierarchical clustering...") -st = time.time() -n_clusters = 15 # number of regions -ward = AgglomerativeClustering(n_clusters=n_clusters, - linkage='ward', connectivity=connectivity).fit(X) -label = np.reshape(ward.labels_, lena.shape) -print("Elapsed time: ", time.time() - st) -print("Number of pixels: ", label.size) -print("Number of clusters: ", np.unique(label).size) - -############################################################################### -# Plot the results on an image -plt.figure(figsize=(5, 5)) -plt.imshow(lena, cmap=plt.cm.gray) -for l in range(n_clusters): - plt.contour(label == l, contours=1, - colors=[plt.cm.spectral(l / float(n_clusters)), ]) -plt.xticks(()) -plt.yticks(()) -plt.show() diff --git a/0.15/_downloads/plot_lle_digits.py b/0.15/_downloads/plot_lle_digits.py deleted file mode 100644 index 5f75e8582c221..0000000000000 --- a/0.15/_downloads/plot_lle_digits.py +++ /dev/null @@ -1,230 +0,0 @@ -""" -============================================================================= -Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... -============================================================================= - -An illustration of various embeddings on the digits dataset. - -The RandomTreesEmbedding, from the :mod:`sklearn.ensemble` module, is not -technically a manifold embedding method, as it learn a high-dimensional -representation on which we apply a dimensionality reduction method. -However, it is often useful to cast a dataset into a representation in -which the classes are linearly-separable. - -t-SNE will be initialized with the embedding that is generated by PCA in -this example, which is not the default setting. It ensures global stability -of the embedding, i.e., the embedding does not depend on random -initialization. -""" - -# Authors: Fabian Pedregosa -# Olivier Grisel -# Mathieu Blondel -# Gael Varoquaux -# License: BSD 3 clause (C) INRIA 2011 - -print(__doc__) -from time import time - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib import offsetbox -from sklearn import (manifold, datasets, decomposition, ensemble, lda, - random_projection) - -digits = datasets.load_digits(n_class=6) -X = digits.data -y = digits.target -n_samples, n_features = X.shape -n_neighbors = 30 - - -#---------------------------------------------------------------------- -# Scale and visualize the embedding vectors -def plot_embedding(X, title=None): - x_min, x_max = np.min(X, 0), np.max(X, 0) - X = (X - x_min) / (x_max - x_min) - - plt.figure() - ax = plt.subplot(111) - for i in range(X.shape[0]): - plt.text(X[i, 0], X[i, 1], str(digits.target[i]), - color=plt.cm.Set1(y[i] / 10.), - fontdict={'weight': 'bold', 'size': 9}) - - if hasattr(offsetbox, 'AnnotationBbox'): - # only print thumbnails with matplotlib > 1.0 - shown_images = np.array([[1., 1.]]) # just something big - for i in range(digits.data.shape[0]): - dist = np.sum((X[i] - shown_images) ** 2, 1) - if np.min(dist) < 4e-3: - # don't show points that are too close - continue - shown_images = np.r_[shown_images, [X[i]]] - imagebox = offsetbox.AnnotationBbox( - offsetbox.OffsetImage(digits.images[i], cmap=plt.cm.gray_r), - X[i]) - ax.add_artist(imagebox) - plt.xticks([]), plt.yticks([]) - if title is not None: - plt.title(title) - - -#---------------------------------------------------------------------- -# Plot images of the digits -n_img_per_row = 20 -img = np.zeros((10 * n_img_per_row, 10 * n_img_per_row)) -for i in range(n_img_per_row): - ix = 10 * i + 1 - for j in range(n_img_per_row): - iy = 10 * j + 1 - img[ix:ix + 8, iy:iy + 8] = X[i * n_img_per_row + j].reshape((8, 8)) - -plt.imshow(img, cmap=plt.cm.binary) -plt.xticks([]) -plt.yticks([]) -plt.title('A selection from the 64-dimensional digits dataset') - - -#---------------------------------------------------------------------- -# Random 2D projection using a random unitary matrix -print("Computing random projection") -rp = random_projection.SparseRandomProjection(n_components=2, random_state=42) -X_projected = rp.fit_transform(X) -plot_embedding(X_projected, "Random Projection of the digits") - - -#---------------------------------------------------------------------- -# Projection on to the first 2 principal components - -print("Computing PCA projection") -t0 = time() -X_pca = decomposition.TruncatedSVD(n_components=2).fit_transform(X) -plot_embedding(X_pca, - "Principal Components projection of the digits (time %.2fs)" % - (time() - t0)) - -#---------------------------------------------------------------------- -# Projection on to the first 2 linear discriminant components - -print("Computing LDA projection") -X2 = X.copy() -X2.flat[::X.shape[1] + 1] += 0.01 # Make X invertible -t0 = time() -X_lda = lda.LDA(n_components=2).fit_transform(X2, y) -plot_embedding(X_lda, - "Linear Discriminant projection of the digits (time %.2fs)" % - (time() - t0)) - - -#---------------------------------------------------------------------- -# Isomap projection of the digits dataset -print("Computing Isomap embedding") -t0 = time() -X_iso = manifold.Isomap(n_neighbors, n_components=2).fit_transform(X) -print("Done.") -plot_embedding(X_iso, - "Isomap projection of the digits (time %.2fs)" % - (time() - t0)) - - -#---------------------------------------------------------------------- -# Locally linear embedding of the digits dataset -print("Computing LLE embedding") -clf = manifold.LocallyLinearEmbedding(n_neighbors, n_components=2, - method='standard') -t0 = time() -X_lle = clf.fit_transform(X) -print("Done. Reconstruction error: %g" % clf.reconstruction_error_) -plot_embedding(X_lle, - "Locally Linear Embedding of the digits (time %.2fs)" % - (time() - t0)) - - -#---------------------------------------------------------------------- -# Modified Locally linear embedding of the digits dataset -print("Computing modified LLE embedding") -clf = manifold.LocallyLinearEmbedding(n_neighbors, n_components=2, - method='modified') -t0 = time() -X_mlle = clf.fit_transform(X) -print("Done. Reconstruction error: %g" % clf.reconstruction_error_) -plot_embedding(X_mlle, - "Modified Locally Linear Embedding of the digits (time %.2fs)" % - (time() - t0)) - - -#---------------------------------------------------------------------- -# HLLE embedding of the digits dataset -print("Computing Hessian LLE embedding") -clf = manifold.LocallyLinearEmbedding(n_neighbors, n_components=2, - method='hessian') -t0 = time() -X_hlle = clf.fit_transform(X) -print("Done. Reconstruction error: %g" % clf.reconstruction_error_) -plot_embedding(X_hlle, - "Hessian Locally Linear Embedding of the digits (time %.2fs)" % - (time() - t0)) - - -#---------------------------------------------------------------------- -# LTSA embedding of the digits dataset -print("Computing LTSA embedding") -clf = manifold.LocallyLinearEmbedding(n_neighbors, n_components=2, - method='ltsa') -t0 = time() -X_ltsa = clf.fit_transform(X) -print("Done. Reconstruction error: %g" % clf.reconstruction_error_) -plot_embedding(X_ltsa, - "Local Tangent Space Alignment of the digits (time %.2fs)" % - (time() - t0)) - -#---------------------------------------------------------------------- -# MDS embedding of the digits dataset -print("Computing MDS embedding") -clf = manifold.MDS(n_components=2, n_init=1, max_iter=100) -t0 = time() -X_mds = clf.fit_transform(X) -print("Done. Stress: %f" % clf.stress_) -plot_embedding(X_mds, - "MDS embedding of the digits (time %.2fs)" % - (time() - t0)) - -#---------------------------------------------------------------------- -# Random Trees embedding of the digits dataset -print("Computing Totally Random Trees embedding") -hasher = ensemble.RandomTreesEmbedding(n_estimators=200, random_state=0, - max_depth=5) -t0 = time() -X_transformed = hasher.fit_transform(X) -pca = decomposition.TruncatedSVD(n_components=2) -X_reduced = pca.fit_transform(X_transformed) - -plot_embedding(X_reduced, - "Random forest embedding of the digits (time %.2fs)" % - (time() - t0)) - -#---------------------------------------------------------------------- -# Spectral embedding of the digits dataset -print("Computing Spectral embedding") -embedder = manifold.SpectralEmbedding(n_components=2, random_state=0, - eigen_solver="arpack") -t0 = time() -X_se = embedder.fit_transform(X) - -plot_embedding(X_se, - "Spectral embedding of the digits (time %.2fs)" % - (time() - t0)) - -#---------------------------------------------------------------------- -# t-SNE embedding of the digits dataset -print("Computing t-SNE embedding") -tsne = manifold.TSNE(n_components=2, init='pca', random_state=0) -t0 = time() -X_tsne = tsne.fit_transform(X) - -plot_embedding(X_tsne, - "t-SNE embedding of the digits (time %.2fs)" % - (time() - t0)) - -plt.show() diff --git a/0.15/_downloads/plot_logistic.py b/0.15/_downloads/plot_logistic.py deleted file mode 100644 index cdb95a7cfa563..0000000000000 --- a/0.15/_downloads/plot_logistic.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - - -""" -========================================================= -Logit function -========================================================= - -Show in the plot is how the logistic regression would, in this -synthetic dataset, classify values as either 0 or 1, -i.e. class one or two, using the logit-curve. - -""" -print(__doc__) - - -# Code source: Gael Varoquaux -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import linear_model - -# this is our test set, it's just a straight line with some -# Gaussian noise -xmin, xmax = -5, 5 -n_samples = 100 -np.random.seed(0) -X = np.random.normal(size=n_samples) -y = (X > 0).astype(np.float) -X[X > 0] *= 4 -X += .3 * np.random.normal(size=n_samples) - -X = X[:, np.newaxis] -# run the classifier -clf = linear_model.LogisticRegression(C=1e5) -clf.fit(X, y) - -# and plot the result -plt.figure(1, figsize=(4, 3)) -plt.clf() -plt.scatter(X.ravel(), y, color='black', zorder=20) -X_test = np.linspace(-5, 10, 300) - - -def model(x): - return 1 / (1 + np.exp(-x)) -loss = model(X_test * clf.coef_ + clf.intercept_).ravel() -plt.plot(X_test, loss, color='blue', linewidth=3) - -ols = linear_model.LinearRegression() -ols.fit(X, y) -plt.plot(X_test, ols.coef_ * X_test + ols.intercept_, linewidth=1) -plt.axhline(.5, color='.5') - -plt.ylabel('y') -plt.xlabel('X') -plt.xticks(()) -plt.yticks(()) -plt.ylim(-.25, 1.25) -plt.xlim(-4, 10) - -plt.show() diff --git a/0.15/_downloads/plot_logistic_l1_l2_sparsity.py b/0.15/_downloads/plot_logistic_l1_l2_sparsity.py deleted file mode 100644 index 9e20e6bcd56d1..0000000000000 --- a/0.15/_downloads/plot_logistic_l1_l2_sparsity.py +++ /dev/null @@ -1,79 +0,0 @@ -""" -============================================== -L1 Penalty and Sparsity in Logistic Regression -============================================== - -Comparison of the sparsity (percentage of zero coefficients) of solutions when -L1 and L2 penalty are used for different values of C. We can see that large -values of C give more freedom to the model. Conversely, smaller values of C -constrain the model more. In the L1 penalty case, this leads to sparser -solutions. - -We classify 8x8 images of digits into two classes: 0-4 against 5-9. -The visualization shows coefficients of the models for varying C. -""" - -print(__doc__) - -# Authors: Alexandre Gramfort -# Mathieu Blondel -# Andreas Mueller -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.linear_model import LogisticRegression -from sklearn import datasets -from sklearn.preprocessing import StandardScaler - -digits = datasets.load_digits() - -X, y = digits.data, digits.target -X = StandardScaler().fit_transform(X) - -# classify small against large digits -y = (y > 4).astype(np.int) - - -# Set regularization parameter -for i, C in enumerate(10. ** np.arange(1, 4)): - # turn down tolerance for short training time - clf_l1_LR = LogisticRegression(C=C, penalty='l1', tol=0.01) - clf_l2_LR = LogisticRegression(C=C, penalty='l2', tol=0.01) - clf_l1_LR.fit(X, y) - clf_l2_LR.fit(X, y) - - coef_l1_LR = clf_l1_LR.coef_.ravel() - coef_l2_LR = clf_l2_LR.coef_.ravel() - - # coef_l1_LR contains zeros due to the - # L1 sparsity inducing norm - - sparsity_l1_LR = np.mean(coef_l1_LR == 0) * 100 - sparsity_l2_LR = np.mean(coef_l2_LR == 0) * 100 - - print("C=%d" % C) - print("Sparsity with L1 penalty: %.2f%%" % sparsity_l1_LR) - print("score with L1 penalty: %.4f" % clf_l1_LR.score(X, y)) - print("Sparsity with L2 penalty: %.2f%%" % sparsity_l2_LR) - print("score with L2 penalty: %.4f" % clf_l2_LR.score(X, y)) - - l1_plot = plt.subplot(3, 2, 2 * i + 1) - l2_plot = plt.subplot(3, 2, 2 * (i + 1)) - if i == 0: - l1_plot.set_title("L1 penalty") - l2_plot.set_title("L2 penalty") - - l1_plot.imshow(np.abs(coef_l1_LR.reshape(8, 8)), interpolation='nearest', - cmap='binary', vmax=1, vmin=0) - l2_plot.imshow(np.abs(coef_l2_LR.reshape(8, 8)), interpolation='nearest', - cmap='binary', vmax=1, vmin=0) - plt.text(-8, 3, "C = %d" % C) - - l1_plot.set_xticks(()) - l1_plot.set_yticks(()) - l2_plot.set_xticks(()) - l2_plot.set_yticks(()) - -plt.show() diff --git a/0.15/_downloads/plot_logistic_path.py b/0.15/_downloads/plot_logistic_path.py deleted file mode 100644 index d1b17948c78e0..0000000000000 --- a/0.15/_downloads/plot_logistic_path.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python -""" -================================= -Path with L1- Logistic Regression -================================= - -Computes path on IRIS dataset. - -""" -print(__doc__) - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -from datetime import datetime -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import linear_model -from sklearn import datasets -from sklearn.svm import l1_min_c - -iris = datasets.load_iris() -X = iris.data -y = iris.target - -X = X[y != 2] -y = y[y != 2] - -X -= np.mean(X, 0) - -############################################################################### -# Demo path functions - -cs = l1_min_c(X, y, loss='log') * np.logspace(0, 3) - - -print("Computing regularization path ...") -start = datetime.now() -clf = linear_model.LogisticRegression(C=1.0, penalty='l1', tol=1e-6) -coefs_ = [] -for c in cs: - clf.set_params(C=c) - clf.fit(X, y) - coefs_.append(clf.coef_.ravel().copy()) -print("This took ", datetime.now() - start) - -coefs_ = np.array(coefs_) -plt.plot(np.log10(cs), coefs_) -ymin, ymax = plt.ylim() -plt.xlabel('log(C)') -plt.ylabel('Coefficients') -plt.title('Logistic Regression Path') -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_lw_vs_oas.py b/0.15/_downloads/plot_lw_vs_oas.py deleted file mode 100644 index 59b6536e83d89..0000000000000 --- a/0.15/_downloads/plot_lw_vs_oas.py +++ /dev/null @@ -1,83 +0,0 @@ -""" -============================= -Ledoit-Wolf vs OAS estimation -============================= - -The usual covariance maximum likelihood estimate can be regularized -using shrinkage. Ledoit and Wolf proposed a close formula to compute -the asymptotically optimal shrinkage parameter (minimizing a MSE -criterion), yielding the Ledoit-Wolf covariance estimate. - -Chen et al. proposed an improvement of the Ledoit-Wolf shrinkage -parameter, the OAS coefficient, whose convergence is significantly -better under the assumption that the data are Gaussian. - -This example, inspired from Chen's publication [1], shows a comparison -of the estimated MSE of the LW and OAS methods, using Gaussian -distributed data. - -[1] "Shrinkage Algorithms for MMSE Covariance Estimation" -Chen et al., IEEE Trans. on Sign. Proc., Volume 58, Issue 10, October 2010. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from scipy.linalg import toeplitz, cholesky - -from sklearn.covariance import LedoitWolf, OAS - -np.random.seed(0) -############################################################################### -n_features = 100 -# simulation covariance matrix (AR(1) process) -r = 0.1 -real_cov = toeplitz(r ** np.arange(n_features)) -coloring_matrix = cholesky(real_cov) - -n_samples_range = np.arange(6, 31, 1) -repeat = 100 -lw_mse = np.zeros((n_samples_range.size, repeat)) -oa_mse = np.zeros((n_samples_range.size, repeat)) -lw_shrinkage = np.zeros((n_samples_range.size, repeat)) -oa_shrinkage = np.zeros((n_samples_range.size, repeat)) -for i, n_samples in enumerate(n_samples_range): - for j in range(repeat): - X = np.dot( - np.random.normal(size=(n_samples, n_features)), coloring_matrix.T) - - lw = LedoitWolf(store_precision=False, assume_centered=True) - lw.fit(X) - lw_mse[i, j] = lw.error_norm(real_cov, scaling=False) - lw_shrinkage[i, j] = lw.shrinkage_ - - oa = OAS(store_precision=False, assume_centered=True) - oa.fit(X) - oa_mse[i, j] = oa.error_norm(real_cov, scaling=False) - oa_shrinkage[i, j] = oa.shrinkage_ - -# plot MSE -plt.subplot(2, 1, 1) -plt.errorbar(n_samples_range, lw_mse.mean(1), yerr=lw_mse.std(1), - label='Ledoit-Wolf', color='g') -plt.errorbar(n_samples_range, oa_mse.mean(1), yerr=oa_mse.std(1), - label='OAS', color='r') -plt.ylabel("Squared error") -plt.legend(loc="upper right") -plt.title("Comparison of covariance estimators") -plt.xlim(5, 31) - -# plot shrinkage coefficient -plt.subplot(2, 1, 2) -plt.errorbar(n_samples_range, lw_shrinkage.mean(1), yerr=lw_shrinkage.std(1), - label='Ledoit-Wolf', color='g') -plt.errorbar(n_samples_range, oa_shrinkage.mean(1), yerr=oa_shrinkage.std(1), - label='OAS', color='r') -plt.xlabel("n_samples") -plt.ylabel("Shrinkage") -plt.legend(loc="lower right") -plt.ylim(plt.ylim()[0], 1. + (plt.ylim()[1] - plt.ylim()[0]) / 10.) -plt.xlim(5, 31) - -plt.show() diff --git a/0.15/_downloads/plot_mahalanobis_distances.py b/0.15/_downloads/plot_mahalanobis_distances.py deleted file mode 100644 index 53329aa71b80f..0000000000000 --- a/0.15/_downloads/plot_mahalanobis_distances.py +++ /dev/null @@ -1,144 +0,0 @@ -r""" -================================================================ -Robust covariance estimation and Mahalanobis distances relevance -================================================================ - -An example to show covariance estimation with the Mahalanobis -distances on Gaussian distributed data. - -For Gaussian distributed data, the distance of an observation -:math:`x_i` to the mode of the distribution can be computed using its -Mahalanobis distance: :math:`d_{(\mu,\Sigma)}(x_i)^2 = (x_i - -\mu)'\Sigma^{-1}(x_i - \mu)` where :math:`\mu` and :math:`\Sigma` are -the location and the covariance of the underlying Gaussian -distribution. - -In practice, :math:`\mu` and :math:`\Sigma` are replaced by some -estimates. The usual covariance maximum likelihood estimate is very -sensitive to the presence of outliers in the data set and therefor, -the corresponding Mahalanobis distances are. One would better have to -use a robust estimator of covariance to guarantee that the estimation is -resistant to "erroneous" observations in the data set and that the -associated Mahalanobis distances accurately reflect the true -organisation of the observations. - -The Minimum Covariance Determinant estimator is a robust, -high-breakdown point (i.e. it can be used to estimate the covariance -matrix of highly contaminated datasets, up to -:math:`\frac{n_\text{samples}-n_\text{features}-1}{2}` outliers) -estimator of covariance. The idea is to find -:math:`\frac{n_\text{samples}+n_\text{features}+1}{2}` -observations whose empirical covariance has the smallest determinant, -yielding a "pure" subset of observations from which to compute -standards estimates of location and covariance. - -The Minimum Covariance Determinant estimator (MCD) has been introduced -by P.J.Rousseuw in [1]. - -This example illustrates how the Mahalanobis distances are affected by -outlying data: observations drawn from a contaminating distribution -are not distinguishable from the observations coming from the real, -Gaussian distribution that one may want to work with. Using MCD-based -Mahalanobis distances, the two populations become -distinguishable. Associated applications are outliers detection, -observations ranking, clustering, ... -For visualization purpose, the cubic root of the Mahalanobis distances -are represented in the boxplot, as Wilson and Hilferty suggest [2] - -[1] P. J. Rousseeuw. Least median of squares regression. J. Am - Stat Ass, 79:871, 1984. -[2] Wilson, E. B., & Hilferty, M. M. (1931). The distribution of chi-square. - Proceedings of the National Academy of Sciences of the United States - of America, 17, 684-688. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.covariance import EmpiricalCovariance, MinCovDet - -n_samples = 125 -n_outliers = 25 -n_features = 2 - -# generate data -gen_cov = np.eye(n_features) -gen_cov[0, 0] = 2. -X = np.dot(np.random.randn(n_samples, n_features), gen_cov) -# add some outliers -outliers_cov = np.eye(n_features) -outliers_cov[np.arange(1, n_features), np.arange(1, n_features)] = 7. -X[-n_outliers:] = np.dot(np.random.randn(n_outliers, n_features), outliers_cov) - -# fit a Minimum Covariance Determinant (MCD) robust estimator to data -robust_cov = MinCovDet().fit(X) - -# compare estimators learnt from the full data set with true parameters -emp_cov = EmpiricalCovariance().fit(X) - -############################################################################### -# Display results -fig = plt.figure() -plt.subplots_adjust(hspace=-.1, wspace=.4, top=.95, bottom=.05) - -# Show data set -subfig1 = plt.subplot(3, 1, 1) -inlier_plot = subfig1.scatter(X[:, 0], X[:, 1], - color='black', label='inliers') -outlier_plot = subfig1.scatter(X[:, 0][-n_outliers:], X[:, 1][-n_outliers:], - color='red', label='outliers') -subfig1.set_xlim(subfig1.get_xlim()[0], 11.) -subfig1.set_title("Mahalanobis distances of a contaminated data set:") - -# Show contours of the distance functions -xx, yy = np.meshgrid(np.linspace(plt.xlim()[0], plt.xlim()[1], 100), - np.linspace(plt.ylim()[0], plt.ylim()[1], 100)) -zz = np.c_[xx.ravel(), yy.ravel()] - -mahal_emp_cov = emp_cov.mahalanobis(zz) -mahal_emp_cov = mahal_emp_cov.reshape(xx.shape) -emp_cov_contour = subfig1.contour(xx, yy, np.sqrt(mahal_emp_cov), - cmap=plt.cm.PuBu_r, - linestyles='dashed') - -mahal_robust_cov = robust_cov.mahalanobis(zz) -mahal_robust_cov = mahal_robust_cov.reshape(xx.shape) -robust_contour = subfig1.contour(xx, yy, np.sqrt(mahal_robust_cov), - cmap=plt.cm.YlOrBr_r, linestyles='dotted') - -subfig1.legend([emp_cov_contour.collections[1], robust_contour.collections[1], - inlier_plot, outlier_plot], - ['MLE dist', 'robust dist', 'inliers', 'outliers'], - loc="upper right", borderaxespad=0) -plt.xticks(()) -plt.yticks(()) - -# Plot the scores for each point -emp_mahal = emp_cov.mahalanobis(X - np.mean(X, 0)) ** (0.33) -subfig2 = plt.subplot(2, 2, 3) -subfig2.boxplot([emp_mahal[:-n_outliers], emp_mahal[-n_outliers:]], widths=.25) -subfig2.plot(1.26 * np.ones(n_samples - n_outliers), - emp_mahal[:-n_outliers], '+k', markeredgewidth=1) -subfig2.plot(2.26 * np.ones(n_outliers), - emp_mahal[-n_outliers:], '+k', markeredgewidth=1) -subfig2.axes.set_xticklabels(('inliers', 'outliers'), size=15) -subfig2.set_ylabel(r"$\sqrt[3]{\rm{(Mahal. dist.)}}$", size=16) -subfig2.set_title("1. from non-robust estimates\n(Maximum Likelihood)") -plt.yticks(()) - -robust_mahal = robust_cov.mahalanobis(X - robust_cov.location_) ** (0.33) -subfig3 = plt.subplot(2, 2, 4) -subfig3.boxplot([robust_mahal[:-n_outliers], robust_mahal[-n_outliers:]], - widths=.25) -subfig3.plot(1.26 * np.ones(n_samples - n_outliers), - robust_mahal[:-n_outliers], '+k', markeredgewidth=1) -subfig3.plot(2.26 * np.ones(n_outliers), - robust_mahal[-n_outliers:], '+k', markeredgewidth=1) -subfig3.axes.set_xticklabels(('inliers', 'outliers'), size=15) -subfig3.set_ylabel(r"$\sqrt[3]{\rm{(Mahal. dist.)}}$", size=16) -subfig3.set_title("2. from robust estimates\n(Minimum Covariance Determinant)") -plt.yticks(()) - -plt.show() diff --git a/0.15/_downloads/plot_manifold_sphere.py b/0.15/_downloads/plot_manifold_sphere.py deleted file mode 100644 index 23c2ea70da3b7..0000000000000 --- a/0.15/_downloads/plot_manifold_sphere.py +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -============================================= -Manifold Learning methods on a severed sphere -============================================= - -An application of the different :ref:`manifold` techniques -on a spherical data-set. Here one can see the use of -dimensionality reduction in order to gain some intuition -regarding the manifold learning methods. Regarding the dataset, -the poles are cut from the sphere, as well as a thin slice down its -side. This enables the manifold learning techniques to -'spread it open' whilst projecting it onto two dimensions. - -For a similar example, where the methods are applied to the -S-curve dataset, see :ref:`example_manifold_plot_compare_methods.py` - -Note that the purpose of the :ref:`MDS ` is -to find a low-dimensional representation of the data (here 2D) in -which the distances respect well the distances in the original -high-dimensional space, unlike other manifold-learning algorithms, -it does not seeks an isotropic representation of the data in -the low-dimensional space. Here the manifold problem matches fairly -that of representing a flat map of the Earth, as with -`map projection `_ -""" - -# Author: Jaques Grobler -# License: BSD 3 clause - -print(__doc__) - -from time import time - -import numpy as np -import matplotlib.pyplot as plt -from mpl_toolkits.mplot3d import Axes3D -from matplotlib.ticker import NullFormatter - -from sklearn import manifold -from sklearn.utils import check_random_state - -# Next line to silence pyflakes. -Axes3D - -# Variables for manifold learning. -n_neighbors = 10 -n_samples = 1000 - -# Create our sphere. -random_state = check_random_state(0) -p = random_state.rand(n_samples) * (2 * np.pi - 0.55) -t = random_state.rand(n_samples) * np.pi - -# Sever the poles from the sphere. -indices = ((t < (np.pi - (np.pi / 8))) & (t > ((np.pi / 8)))) -colors = p[indices] -x, y, z = np.sin(t[indices]) * np.cos(p[indices]), \ - np.sin(t[indices]) * np.sin(p[indices]), \ - np.cos(t[indices]) - -# Plot our dataset. -fig = plt.figure(figsize=(15, 8)) -plt.suptitle("Manifold Learning with %i points, %i neighbors" - % (1000, n_neighbors), fontsize=14) - -ax = fig.add_subplot(251, projection='3d') -ax.scatter(x, y, z, c=p[indices], cmap=plt.cm.rainbow) -try: - # compatibility matplotlib < 1.0 - ax.view_init(40, -10) -except: - pass - -sphere_data = np.array([x, y, z]).T - -# Perform Locally Linear Embedding Manifold learning -methods = ['standard', 'ltsa', 'hessian', 'modified'] -labels = ['LLE', 'LTSA', 'Hessian LLE', 'Modified LLE'] - -for i, method in enumerate(methods): - t0 = time() - trans_data = manifold\ - .LocallyLinearEmbedding(n_neighbors, 2, - method=method).fit_transform(sphere_data).T - t1 = time() - print("%s: %.2g sec" % (methods[i], t1 - t0)) - - ax = fig.add_subplot(252 + i) - plt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow) - plt.title("%s (%.2g sec)" % (labels[i], t1 - t0)) - ax.xaxis.set_major_formatter(NullFormatter()) - ax.yaxis.set_major_formatter(NullFormatter()) - plt.axis('tight') - -# Perform Isomap Manifold learning. -t0 = time() -trans_data = manifold.Isomap(n_neighbors, n_components=2)\ - .fit_transform(sphere_data).T -t1 = time() -print("%s: %.2g sec" % ('ISO', t1 - t0)) - -ax = fig.add_subplot(257) -plt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow) -plt.title("%s (%.2g sec)" % ('Isomap', t1 - t0)) -ax.xaxis.set_major_formatter(NullFormatter()) -ax.yaxis.set_major_formatter(NullFormatter()) -plt.axis('tight') - -# Perform Multi-dimensional scaling. -t0 = time() -mds = manifold.MDS(2, max_iter=100, n_init=1) -trans_data = mds.fit_transform(sphere_data).T -t1 = time() -print("MDS: %.2g sec" % (t1 - t0)) - -ax = fig.add_subplot(258) -plt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow) -plt.title("MDS (%.2g sec)" % (t1 - t0)) -ax.xaxis.set_major_formatter(NullFormatter()) -ax.yaxis.set_major_formatter(NullFormatter()) -plt.axis('tight') - -# Perform Spectral Embedding. -t0 = time() -se = manifold.SpectralEmbedding(n_components=2, - n_neighbors=n_neighbors) -trans_data = se.fit_transform(sphere_data).T -t1 = time() -print("Spectral Embedding: %.2g sec" % (t1 - t0)) - -ax = fig.add_subplot(259) -plt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow) -plt.title("Spectral Embedding (%.2g sec)" % (t1 - t0)) -ax.xaxis.set_major_formatter(NullFormatter()) -ax.yaxis.set_major_formatter(NullFormatter()) -plt.axis('tight') - -# Perform t-distributed stochastic neighbor embedding. -t0 = time() -tsne = manifold.TSNE(n_components=2, init='pca', random_state=0) -trans_data = tsne.fit_transform(sphere_data).T -t1 = time() -print("t-SNE: %.2g sec" % (t1 - t0)) - -ax = fig.add_subplot(250) -plt.scatter(trans_data[0], trans_data[1], c=colors, cmap=plt.cm.rainbow) -plt.title("t-SNE (%.2g sec)" % (t1 - t0)) -ax.xaxis.set_major_formatter(NullFormatter()) -ax.yaxis.set_major_formatter(NullFormatter()) -plt.axis('tight') - -plt.show() diff --git a/0.15/_downloads/plot_mds.py b/0.15/_downloads/plot_mds.py deleted file mode 100644 index bd35baa984428..0000000000000 --- a/0.15/_downloads/plot_mds.py +++ /dev/null @@ -1,86 +0,0 @@ -""" -========================= -Multi-dimensional scaling -========================= - -An illustration of the metric and non-metric MDS on generated noisy data. - -The reconstructed points using the metric MDS and non metric MDS are slightly -shifted to avoid overlapping. -""" - -# Author: Nelle Varoquaux -# Licence: BSD - -print(__doc__) -import numpy as np - -from matplotlib import pyplot as plt -from matplotlib.collections import LineCollection - -from sklearn import manifold -from sklearn.metrics import euclidean_distances -from sklearn.decomposition import PCA - -n_samples = 20 -seed = np.random.RandomState(seed=3) -X_true = seed.randint(0, 20, 2 * n_samples).astype(np.float) -X_true = X_true.reshape((n_samples, 2)) -# Center the data -X_true -= X_true.mean() - -similarities = euclidean_distances(X_true) - -# Add noise to the similarities -noise = np.random.rand(n_samples, n_samples) -noise = noise + noise.T -noise[np.arange(noise.shape[0]), np.arange(noise.shape[0])] = 0 -similarities += noise - -mds = manifold.MDS(n_components=2, max_iter=3000, eps=1e-9, random_state=seed, - dissimilarity="precomputed", n_jobs=1) -pos = mds.fit(similarities).embedding_ - -nmds = manifold.MDS(n_components=2, metric=False, max_iter=3000, eps=1e-12, - dissimilarity="precomputed", random_state=seed, n_jobs=1, - n_init=1) -npos = nmds.fit_transform(similarities, init=pos) - -# Rescale the data -pos *= np.sqrt((X_true ** 2).sum()) / np.sqrt((pos ** 2).sum()) -npos *= np.sqrt((X_true ** 2).sum()) / np.sqrt((npos ** 2).sum()) - -# Rotate the data -clf = PCA(n_components=2) -X_true = clf.fit_transform(X_true) - -pos = clf.fit_transform(pos) - -npos = clf.fit_transform(npos) - -fig = plt.figure(1) -ax = plt.axes([0., 0., 1., 1.]) - -plt.scatter(X_true[:, 0], X_true[:, 1], c='r', s=20) -plt.scatter(pos[:, 0], pos[:, 1], s=20, c='g') -plt.scatter(npos[:, 0], npos[:, 1], s=20, c='b') -plt.legend(('True position', 'MDS', 'NMDS'), loc='best') - -similarities = similarities.max() / similarities * 100 -similarities[np.isinf(similarities)] = 0 - -# Plot the edges -start_idx, end_idx = np.where(pos) -#a sequence of (*line0*, *line1*, *line2*), where:: -# linen = (x0, y0), (x1, y1), ... (xm, ym) -segments = [[X_true[i, :], X_true[j, :]] - for i in range(len(pos)) for j in range(len(pos))] -values = np.abs(similarities) -lc = LineCollection(segments, - zorder=0, cmap=plt.cm.hot_r, - norm=plt.Normalize(0, values.max())) -lc.set_array(similarities.flatten()) -lc.set_linewidths(0.5 * np.ones(len(segments))) -ax.add_collection(lc) - -plt.show() diff --git a/0.15/_downloads/plot_mean_shift.py b/0.15/_downloads/plot_mean_shift.py deleted file mode 100644 index 775cd98e59527..0000000000000 --- a/0.15/_downloads/plot_mean_shift.py +++ /dev/null @@ -1,56 +0,0 @@ -""" -============================================= -A demo of the mean-shift clustering algorithm -============================================= - -Reference: - -Dorin Comaniciu and Peter Meer, "Mean Shift: A robust approach toward -feature space analysis". IEEE Transactions on Pattern Analysis and -Machine Intelligence. 2002. pp. 603-619. - -""" -print(__doc__) - -import numpy as np -from sklearn.cluster import MeanShift, estimate_bandwidth -from sklearn.datasets.samples_generator import make_blobs - -############################################################################### -# Generate sample data -centers = [[1, 1], [-1, -1], [1, -1]] -X, _ = make_blobs(n_samples=10000, centers=centers, cluster_std=0.6) - -############################################################################### -# Compute clustering with MeanShift - -# The following bandwidth can be automatically detected using -bandwidth = estimate_bandwidth(X, quantile=0.2, n_samples=500) - -ms = MeanShift(bandwidth=bandwidth, bin_seeding=True) -ms.fit(X) -labels = ms.labels_ -cluster_centers = ms.cluster_centers_ - -labels_unique = np.unique(labels) -n_clusters_ = len(labels_unique) - -print("number of estimated clusters : %d" % n_clusters_) - -############################################################################### -# Plot result -import matplotlib.pyplot as plt -from itertools import cycle - -plt.figure(1) -plt.clf() - -colors = cycle('bgrcmykbgrcmykbgrcmykbgrcmyk') -for k, col in zip(range(n_clusters_), colors): - my_members = labels == k - cluster_center = cluster_centers[k] - plt.plot(X[my_members, 0], X[my_members, 1], col + '.') - plt.plot(cluster_center[0], cluster_center[1], 'o', markerfacecolor=col, - markeredgecolor='k', markersize=14) -plt.title('Estimated number of clusters: %d' % n_clusters_) -plt.show() diff --git a/0.15/_downloads/plot_mini_batch_kmeans.py b/0.15/_downloads/plot_mini_batch_kmeans.py deleted file mode 100644 index ed4afcf995794..0000000000000 --- a/0.15/_downloads/plot_mini_batch_kmeans.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -==================================================================== -Comparison of the K-Means and MiniBatchKMeans clustering algorithms -==================================================================== - -We want to compare the performance of the MiniBatchKMeans and KMeans: -the MiniBatchKMeans is faster, but gives slightly different results (see -:ref:`mini_batch_kmeans`). - -We will cluster a set of data, first with KMeans and then with -MiniBatchKMeans, and plot the results. -We will also plot the points that are labelled differently between the two -algorithms. -""" -print(__doc__) - -import time - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.cluster import MiniBatchKMeans, KMeans -from sklearn.metrics.pairwise import pairwise_distances_argmin -from sklearn.datasets.samples_generator import make_blobs - -############################################################################## -# Generate sample data -np.random.seed(0) - -batch_size = 45 -centers = [[1, 1], [-1, -1], [1, -1]] -n_clusters = len(centers) -X, labels_true = make_blobs(n_samples=3000, centers=centers, cluster_std=0.7) - -############################################################################## -# Compute clustering with Means - -k_means = KMeans(init='k-means++', n_clusters=3, n_init=10) -t0 = time.time() -k_means.fit(X) -t_batch = time.time() - t0 -k_means_labels = k_means.labels_ -k_means_cluster_centers = k_means.cluster_centers_ -k_means_labels_unique = np.unique(k_means_labels) - -############################################################################## -# Compute clustering with MiniBatchKMeans - -mbk = MiniBatchKMeans(init='k-means++', n_clusters=3, batch_size=batch_size, - n_init=10, max_no_improvement=10, verbose=0) -t0 = time.time() -mbk.fit(X) -t_mini_batch = time.time() - t0 -mbk_means_labels = mbk.labels_ -mbk_means_cluster_centers = mbk.cluster_centers_ -mbk_means_labels_unique = np.unique(mbk_means_labels) - -############################################################################## -# Plot result - -fig = plt.figure(figsize=(8, 3)) -fig.subplots_adjust(left=0.02, right=0.98, bottom=0.05, top=0.9) -colors = ['#4EACC5', '#FF9C34', '#4E9A06'] - -# We want to have the same colors for the same cluster from the -# MiniBatchKMeans and the KMeans algorithm. Let's pair the cluster centers per -# closest one. - -order = pairwise_distances_argmin(k_means_cluster_centers, - mbk_means_cluster_centers) - -# KMeans -ax = fig.add_subplot(1, 3, 1) -for k, col in zip(range(n_clusters), colors): - my_members = k_means_labels == k - cluster_center = k_means_cluster_centers[k] - ax.plot(X[my_members, 0], X[my_members, 1], 'w', - markerfacecolor=col, marker='.') - ax.plot(cluster_center[0], cluster_center[1], 'o', markerfacecolor=col, - markeredgecolor='k', markersize=6) -ax.set_title('KMeans') -ax.set_xticks(()) -ax.set_yticks(()) -plt.text(-3.5, 1.8, 'train time: %.2fs\ninertia: %f' % ( - t_batch, k_means.inertia_)) - -# MiniBatchKMeans -ax = fig.add_subplot(1, 3, 2) -for k, col in zip(range(n_clusters), colors): - my_members = mbk_means_labels == order[k] - cluster_center = mbk_means_cluster_centers[order[k]] - ax.plot(X[my_members, 0], X[my_members, 1], 'w', - markerfacecolor=col, marker='.') - ax.plot(cluster_center[0], cluster_center[1], 'o', markerfacecolor=col, - markeredgecolor='k', markersize=6) -ax.set_title('MiniBatchKMeans') -ax.set_xticks(()) -ax.set_yticks(()) -plt.text(-3.5, 1.8, 'train time: %.2fs\ninertia: %f' % - (t_mini_batch, mbk.inertia_)) - -# Initialise the different array to all False -different = (mbk_means_labels == 4) -ax = fig.add_subplot(1, 3, 3) - -for l in range(n_clusters): - different += ((k_means_labels == k) != (mbk_means_labels == order[k])) - -identic = np.logical_not(different) -ax.plot(X[identic, 0], X[identic, 1], 'w', - markerfacecolor='#bbbbbb', marker='.') -ax.plot(X[different, 0], X[different, 1], 'w', - markerfacecolor='m', marker='.') -ax.set_title('Difference') -ax.set_xticks(()) -ax.set_yticks(()) - -plt.show() diff --git a/0.15/_downloads/plot_model_complexity_influence.py b/0.15/_downloads/plot_model_complexity_influence.py deleted file mode 100644 index 0c9a4db117d04..0000000000000 --- a/0.15/_downloads/plot_model_complexity_influence.py +++ /dev/null @@ -1,169 +0,0 @@ -""" -========================== -Model Complexity Influence -========================== - -Demonstrate how model complexity influences both prediction accuracy and -computational performance. - -The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for -regression (resp. classification). - -For each class of models we make the model complexity vary through the choice -of relevant model parameters and measure the influence on both computational -performance (latency) and predictive power (MSE or Hamming Loss). -""" - -print(__doc__) - -# Author: Eustache Diemert -# License: BSD 3 clause - -import time -import numpy as np -import matplotlib.pyplot as plt -from mpl_toolkits.axes_grid1.parasite_axes import host_subplot -from mpl_toolkits.axisartist.axislines import Axes -from scipy.sparse.csr import csr_matrix - -from sklearn import datasets -from sklearn.utils import shuffle -from sklearn.metrics import mean_squared_error -from sklearn.svm.classes import NuSVR -from sklearn.ensemble.gradient_boosting import GradientBoostingRegressor -from sklearn.linear_model.stochastic_gradient import SGDClassifier -from sklearn.metrics.metrics import hamming_loss - -############################################################################### -# Routines - - -# initialize random generator -np.random.seed(0) - - -def generate_data(case, sparse=False): - """Generate regression/classification data.""" - bunch = None - if case == 'regression': - bunch = datasets.load_boston() - elif case == 'classification': - bunch = datasets.fetch_20newsgroups_vectorized(subset='all') - X, y = shuffle(bunch.data, bunch.target) - offset = int(X.shape[0] * 0.8) - X_train, y_train = X[:offset], y[:offset] - X_test, y_test = X[offset:], y[offset:] - if sparse: - X_train = csr_matrix(X_train) - X_test = csr_matrix(X_test) - else: - X_train = np.array(X_train) - X_test = np.array(X_test) - y_test = np.array(y_test) - y_train = np.array(y_train) - data = {'X_train': X_train, 'X_test': X_test, 'y_train': y_train, - 'y_test': y_test} - return data - - -def benchmark_influence(conf): - """ - Benchmark influence of :changing_param: on both MSE and latency. - """ - prediction_times = [] - prediction_powers = [] - complexities = [] - for param_value in conf['changing_param_values']: - conf['tuned_params'][conf['changing_param']] = param_value - estimator = conf['estimator'](**conf['tuned_params']) - print("Benchmarking %s" % estimator) - estimator.fit(conf['data']['X_train'], conf['data']['y_train']) - conf['postfit_hook'](estimator) - complexity = conf['complexity_computer'](estimator) - complexities.append(complexity) - start_time = time.time() - for _ in range(conf['n_samples']): - y_pred = estimator.predict(conf['data']['X_test']) - elapsed_time = (time.time() - start_time) / float(conf['n_samples']) - prediction_times.append(elapsed_time) - pred_score = conf['prediction_performance_computer']( - conf['data']['y_test'], y_pred) - prediction_powers.append(pred_score) - print("Complexity: %d | %s: %.4f | Pred. Time: %fs\n" % ( - complexity, conf['prediction_performance_label'], pred_score, - elapsed_time)) - return prediction_powers, prediction_times, complexities - - -def plot_influence(conf, mse_values, prediction_times, complexities): - """ - Plot influence of model complexity on both accuracy and latency. - """ - plt.figure(figsize=(12, 6)) - host = host_subplot(111, axes_class=Axes) - plt.subplots_adjust(right=0.75) - par1 = host.twinx() - host.set_xlabel('Model Complexity (%s)' % conf['complexity_label']) - y1_label = conf['prediction_performance_label'] - y2_label = "Time (s)" - host.set_ylabel(y1_label) - par1.set_ylabel(y2_label) - p1, = host.plot(complexities, mse_values, 'b-', label="prediction error") - p2, = par1.plot(complexities, prediction_times, 'r-', - label="latency") - host.legend(loc='upper right') - host.axis["left"].label.set_color(p1.get_color()) - par1.axis["right"].label.set_color(p2.get_color()) - plt.title('Influence of Model Complexity - %s' % conf['estimator'].__name__) - plt.show() - - -def _count_nonzero_coefficients(estimator): - a = estimator.coef_.toarray() - return np.count_nonzero(a) - -############################################################################### -# main code -regression_data = generate_data('regression') -classification_data = generate_data('classification', sparse=True) -configurations = [ - {'estimator': SGDClassifier, - 'tuned_params': {'penalty': 'elasticnet', 'alpha': 0.001, 'loss': - 'modified_huber', 'fit_intercept': True}, - 'changing_param': 'l1_ratio', - 'changing_param_values': [0.25, 0.5, 0.75, 0.9], - 'complexity_label': 'non_zero coefficients', - 'complexity_computer': _count_nonzero_coefficients, - 'prediction_performance_computer': hamming_loss, - 'prediction_performance_label': 'Hamming Loss (Misclassification Ratio)', - 'postfit_hook': lambda x: x.sparsify(), - 'data': classification_data, - 'n_samples': 30}, - {'estimator': NuSVR, - 'tuned_params': {'C': 1e3, 'gamma': 2**-15}, - 'changing_param': 'nu', - 'changing_param_values': [0.1, 0.25, 0.5, 0.75, 0.9], - 'complexity_label': 'n_support_vectors', - 'complexity_computer': lambda x: len(x.support_vectors_), - 'data': regression_data, - 'postfit_hook': lambda x: x, - 'prediction_performance_computer': mean_squared_error, - 'prediction_performance_label': 'MSE', - 'n_samples': 30}, - {'estimator': GradientBoostingRegressor, - 'tuned_params': {'loss': 'ls'}, - 'changing_param': 'n_estimators', - 'changing_param_values': [10, 50, 100, 200, 500], - 'complexity_label': 'n_trees', - 'complexity_computer': lambda x: x.n_estimators, - 'data': regression_data, - 'postfit_hook': lambda x: x, - 'prediction_performance_computer': mean_squared_error, - 'prediction_performance_label': 'MSE', - 'n_samples': 30}, -] -for conf in configurations: - prediction_performances, prediction_times, complexities = \ - benchmark_influence(conf) - plot_influence(conf, prediction_performances, prediction_times, - complexities) diff --git a/0.15/_downloads/plot_multi_task_lasso_support.py b/0.15/_downloads/plot_multi_task_lasso_support.py deleted file mode 100644 index 940282d678d5b..0000000000000 --- a/0.15/_downloads/plot_multi_task_lasso_support.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python -""" -============================================= -Joint feature selection with multi-task Lasso -============================================= - -The multi-task lasso allows to fit multiple regression problems -jointly enforcing the selected features to be the same across -tasks. This example simulates sequential measurements, each task -is a time instant, and the relevant features vary in amplitude -over time while being the same. The multi-task lasso imposes that -features that are selected at one time point are select for all time -point. This makes feature selection by the Lasso more stable. - -""" -print(__doc__) - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -import matplotlib.pyplot as plt -import numpy as np - -from sklearn.linear_model import MultiTaskLasso, Lasso - -rng = np.random.RandomState(42) - -# Generate some 2D coefficients with sine waves with random frequency and phase -n_samples, n_features, n_tasks = 100, 30, 40 -n_relevant_features = 5 -coef = np.zeros((n_tasks, n_features)) -times = np.linspace(0, 2 * np.pi, n_tasks) -for k in range(n_relevant_features): - coef[:, k] = np.sin((1. + rng.randn(1)) * times + 3 * rng.randn(1)) - -X = rng.randn(n_samples, n_features) -Y = np.dot(X, coef.T) + rng.randn(n_samples, n_tasks) - -coef_lasso_ = np.array([Lasso(alpha=0.5).fit(X, y).coef_ for y in Y.T]) -coef_multi_task_lasso_ = MultiTaskLasso(alpha=1.).fit(X, Y).coef_ - -############################################################################### -# Plot support and time series -fig = plt.figure(figsize=(8, 5)) -plt.subplot(1, 2, 1) -plt.spy(coef_lasso_) -plt.xlabel('Feature') -plt.ylabel('Time (or Task)') -plt.text(10, 5, 'Lasso') -plt.subplot(1, 2, 2) -plt.spy(coef_multi_task_lasso_) -plt.xlabel('Feature') -plt.ylabel('Time (or Task)') -plt.text(10, 5, 'MultiTaskLasso') -fig.suptitle('Coefficient non-zero location') - -feature_to_plot = 0 -plt.figure() -plt.plot(coef[:, feature_to_plot], 'k', label='Ground truth') -plt.plot(coef_lasso_[:, feature_to_plot], 'g', label='Lasso') -plt.plot(coef_multi_task_lasso_[:, feature_to_plot], - 'r', label='MultiTaskLasso') -plt.legend(loc='upper center') -plt.axis('tight') -plt.ylim([-1.1, 1.1]) -plt.show() diff --git a/0.15/_downloads/plot_multilabel.py b/0.15/_downloads/plot_multilabel.py deleted file mode 100644 index c8e4ce1cf3734..0000000000000 --- a/0.15/_downloads/plot_multilabel.py +++ /dev/null @@ -1,116 +0,0 @@ -# Authors: Vlad Niculae, Mathieu Blondel -# License: BSD 3 clause -""" -========================= -Multilabel classification -========================= - -This example simulates a multi-label document classification problem. The -dataset is generated randomly based on the following process: - - - pick the number of labels: n ~ Poisson(n_labels) - - n times, choose a class c: c ~ Multinomial(theta) - - pick the document length: k ~ Poisson(length) - - k times, choose a word: w ~ Multinomial(theta_c) - -In the above process, rejection sampling is used to make sure that n is more -than 2, and that the document length is never zero. Likewise, we reject classes -which have already been chosen. The documents that are assigned to both -classes are plotted surrounded by two colored circles. - -The classification is performed by projecting to the first two principal -components found by PCA and CCA for visualisation purposes, followed by using -the :class:`sklearn.multiclass.OneVsRestClassifier` metaclassifier using two -SVCs with linear kernels to learn a discriminative model for each class. -Note that PCA is used to perform an unsupervised dimensionality reduction, -while CCA is used to perform a supervised one. - -Note: in the plot, "unlabeled samples" does not mean that we don't know the -labels (as in semi-supervised learning) but that the samples simply do *not* -have a label. -""" -print(__doc__) - -import numpy as np -import matplotlib.pylab as pl - -from sklearn.datasets import make_multilabel_classification -from sklearn.multiclass import OneVsRestClassifier -from sklearn.svm import SVC -from sklearn.preprocessing import LabelBinarizer -from sklearn.decomposition import PCA -from sklearn.cross_decomposition import CCA - - -def plot_hyperplane(clf, min_x, max_x, linestyle, label): - # get the separating hyperplane - w = clf.coef_[0] - a = -w[0] / w[1] - xx = np.linspace(min_x - 5, max_x + 5) # make sure the line is long enough - yy = a * xx - (clf.intercept_[0]) / w[1] - pl.plot(xx, yy, linestyle, label=label) - - -def plot_subfigure(X, Y, subplot, title, transform): - if transform == "pca": - X = PCA(n_components=2).fit_transform(X) - elif transform == "cca": - X = CCA(n_components=2).fit(X, Y).transform(X) - else: - raise ValueError - - min_x = np.min(X[:, 0]) - max_x = np.max(X[:, 0]) - - min_y = np.min(X[:, 1]) - max_y = np.max(X[:, 1]) - - classif = OneVsRestClassifier(SVC(kernel='linear')) - classif.fit(X, Y) - - pl.subplot(2, 2, subplot) - pl.title(title) - - zero_class = np.where(Y[:, 0]) - one_class = np.where(Y[:, 1]) - pl.scatter(X[:, 0], X[:, 1], s=40, c='gray') - pl.scatter(X[zero_class, 0], X[zero_class, 1], s=160, edgecolors='b', - facecolors='none', linewidths=2, label='Class 1') - pl.scatter(X[one_class, 0], X[one_class, 1], s=80, edgecolors='orange', - facecolors='none', linewidths=2, label='Class 2') - - plot_hyperplane(classif.estimators_[0], min_x, max_x, 'k--', - 'Boundary\nfor class 1') - plot_hyperplane(classif.estimators_[1], min_x, max_x, 'k-.', - 'Boundary\nfor class 2') - pl.xticks(()) - pl.yticks(()) - - pl.xlim(min_x - .5 * max_x, max_x + .5 * max_x) - pl.ylim(min_y - .5 * max_y, max_y + .5 * max_y) - if subplot == 2: - pl.xlabel('First principal component') - pl.ylabel('Second principal component') - pl.legend(loc="upper left") - - -pl.figure(figsize=(8, 6)) - -X, Y = make_multilabel_classification(n_classes=2, n_labels=1, - allow_unlabeled=True, - return_indicator=True, - random_state=1) - -plot_subfigure(X, Y, 1, "With unlabeled samples + CCA", "cca") -plot_subfigure(X, Y, 2, "With unlabeled samples + PCA", "pca") - -X, Y = make_multilabel_classification(n_classes=2, n_labels=1, - allow_unlabeled=False, - return_indicator=True, - random_state=1) - -plot_subfigure(X, Y, 3, "Without unlabeled samples + CCA", "cca") -plot_subfigure(X, Y, 4, "Without unlabeled samples + PCA", "pca") - -pl.subplots_adjust(.04, .02, .97, .94, .09, .2) -pl.show() diff --git a/0.15/_downloads/plot_multioutput_face_completion.py b/0.15/_downloads/plot_multioutput_face_completion.py deleted file mode 100644 index 7a218a6ecb9f9..0000000000000 --- a/0.15/_downloads/plot_multioutput_face_completion.py +++ /dev/null @@ -1,98 +0,0 @@ -""" -============================================== -Face completion with a multi-output estimators -============================================== - -This example shows the use of multi-output estimator to complete images. -The goal is to predict the lower half of a face given its upper half. - -The first column of images shows true faces. The next columns illustrate -how extremely randomized trees, k nearest neighbors, linear -regression and ridge regression complete the lower half of those faces. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.datasets import fetch_olivetti_faces -from sklearn.utils.validation import check_random_state - -from sklearn.ensemble import ExtraTreesRegressor -from sklearn.neighbors import KNeighborsRegressor -from sklearn.linear_model import LinearRegression -from sklearn.linear_model import RidgeCV - -# Load the faces datasets -data = fetch_olivetti_faces() -targets = data.target - -data = data.images.reshape((len(data.images), -1)) -train = data[targets < 30] -test = data[targets >= 30] # Test on independent people - -# Test on a subset of people -n_faces = 5 -rng = check_random_state(4) -face_ids = rng.randint(test.shape[0], size=(n_faces, )) -test = test[face_ids, :] - -n_pixels = data.shape[1] -X_train = train[:, :np.ceil(0.5 * n_pixels)] # Upper half of the faces -y_train = train[:, np.floor(0.5 * n_pixels):] # Lower half of the faces -X_test = test[:, :np.ceil(0.5 * n_pixels)] -y_test = test[:, np.floor(0.5 * n_pixels):] - -# Fit estimators -ESTIMATORS = { - "Extra trees": ExtraTreesRegressor(n_estimators=10, max_features=32, - random_state=0), - "K-nn": KNeighborsRegressor(), - "Linear regression": LinearRegression(), - "Ridge": RidgeCV(), -} - -y_test_predict = dict() -for name, estimator in ESTIMATORS.items(): - estimator.fit(X_train, y_train) - y_test_predict[name] = estimator.predict(X_test) - -# Plot the completed faces -image_shape = (64, 64) - -n_cols = 1 + len(ESTIMATORS) -plt.figure(figsize=(2. * n_cols, 2.26 * n_faces)) -plt.suptitle("Face completion with multi-output estimators", size=16) - -for i in range(n_faces): - true_face = np.hstack((X_test[i], y_test[i])) - - if i: - sub = plt.subplot(n_faces, n_cols, i * n_cols + 1) - else: - sub = plt.subplot(n_faces, n_cols, i * n_cols + 1, - title="true faces") - - - sub.axis("off") - sub.imshow(true_face.reshape(image_shape), - cmap=plt.cm.gray, - interpolation="nearest") - - for j, est in enumerate(sorted(ESTIMATORS)): - completed_face = np.hstack((X_test[i], y_test_predict[est][i])) - - if i: - sub = plt.subplot(n_faces, n_cols, i * n_cols + 2 + j) - - else: - sub = plt.subplot(n_faces, n_cols, i * n_cols + 2 + j, - title=est) - - sub.axis("off") - sub.imshow(completed_face.reshape(image_shape), - cmap=plt.cm.gray, - interpolation="nearest") - -plt.show() diff --git a/0.15/_downloads/plot_nearest_centroid.py b/0.15/_downloads/plot_nearest_centroid.py deleted file mode 100644 index 05d277db08f02..0000000000000 --- a/0.15/_downloads/plot_nearest_centroid.py +++ /dev/null @@ -1,56 +0,0 @@ -""" -=============================== -Nearest Centroid Classification -=============================== - -Sample usage of Nearest Centroid classification. -It will plot the decision boundaries for each class. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.colors import ListedColormap -from sklearn import datasets -from sklearn.neighbors import NearestCentroid - -n_neighbors = 15 - -# import some data to play with -iris = datasets.load_iris() -X = iris.data[:, :2] # we only take the first two features. We could - # avoid this ugly slicing by using a two-dim dataset -y = iris.target - -h = .02 # step size in the mesh - -# Create color maps -cmap_light = ListedColormap(['#FFAAAA', '#AAFFAA', '#AAAAFF']) -cmap_bold = ListedColormap(['#FF0000', '#00FF00', '#0000FF']) - -for shrinkage in [None, 0.1]: - # we create an instance of Neighbours Classifier and fit the data. - clf = NearestCentroid(shrink_threshold=shrinkage) - clf.fit(X, y) - y_pred = clf.predict(X) - print(shrinkage, np.mean(y == y_pred)) - # Plot the decision boundary. For that, we will assign a color to each - # point in the mesh [x_min, m_max]x[y_min, y_max]. - x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 - y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 - xx, yy = np.meshgrid(np.arange(x_min, x_max, h), - np.arange(y_min, y_max, h)) - Z = clf.predict(np.c_[xx.ravel(), yy.ravel()]) - - # Put the result into a color plot - Z = Z.reshape(xx.shape) - plt.figure() - plt.pcolormesh(xx, yy, Z, cmap=cmap_light) - - # Plot also the training points - plt.scatter(X[:, 0], X[:, 1], c=y, cmap=cmap_bold) - plt.title("3-Class classification (shrink_threshold=%r)" - % shrinkage) - plt.axis('tight') - -plt.show() diff --git a/0.15/_downloads/plot_ols.py b/0.15/_downloads/plot_ols.py deleted file mode 100644 index 39a03d1fa0ad4..0000000000000 --- a/0.15/_downloads/plot_ols.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -Linear Regression Example -========================================================= -This example uses the only the first feature of the `diabetes` dataset, in -order to illustrate a two-dimensional plot of this regression technique. The -straight line can be seen in the plot, showing how linear regression attempts -to draw a straight line that will best minimize the residual sum of squares -between the observed responses in the dataset, and the responses predicted by -the linear approximation. - -The coefficients, the residual sum of squares and the variance score are also -calculated. - -""" -print(__doc__) - - -# Code source: Jaques Grobler -# License: BSD 3 clause - - -import matplotlib.pyplot as plt -import numpy as np -from sklearn import datasets, linear_model - -# Load the diabetes dataset -diabetes = datasets.load_diabetes() - - -# Use only one feature -diabetes_X = diabetes.data[:, np.newaxis] -diabetes_X_temp = diabetes_X[:, :, 2] - -# Split the data into training/testing sets -diabetes_X_train = diabetes_X_temp[:-20] -diabetes_X_test = diabetes_X_temp[-20:] - -# Split the targets into training/testing sets -diabetes_y_train = diabetes.target[:-20] -diabetes_y_test = diabetes.target[-20:] - -# Create linear regression object -regr = linear_model.LinearRegression() - -# Train the model using the training sets -regr.fit(diabetes_X_train, diabetes_y_train) - -# The coefficients -print('Coefficients: \n', regr.coef_) -# The mean square error -print("Residual sum of squares: %.2f" - % np.mean((regr.predict(diabetes_X_test) - diabetes_y_test) ** 2)) -# Explained variance score: 1 is perfect prediction -print('Variance score: %.2f' % regr.score(diabetes_X_test, diabetes_y_test)) - -# Plot outputs -plt.scatter(diabetes_X_test, diabetes_y_test, color='black') -plt.plot(diabetes_X_test, regr.predict(diabetes_X_test), color='blue', - linewidth=3) - -plt.xticks(()) -plt.yticks(()) - -plt.show() diff --git a/0.15/_downloads/plot_ols_3d.py b/0.15/_downloads/plot_ols_3d.py deleted file mode 100644 index 23dfa01d60ecc..0000000000000 --- a/0.15/_downloads/plot_ols_3d.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -Sparsity Example: Fitting only features 1 and 2 -========================================================= - -Features 1 and 2 of the diabetes-dataset are fitted and -plotted below. It illustrates that although feature 2 -has a strong coefficient on the full model, it does not -give us much regarding `y` when compared to just feature 1 - -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -import matplotlib.pyplot as plt -import numpy as np -from mpl_toolkits.mplot3d import Axes3D - -from sklearn import datasets, linear_model - -diabetes = datasets.load_diabetes() -indices = (0, 1) - -X_train = diabetes.data[:-20, indices] -X_test = diabetes.data[-20:, indices] -y_train = diabetes.target[:-20] -y_test = diabetes.target[-20:] - -ols = linear_model.LinearRegression() -ols.fit(X_train, y_train) - - -############################################################################### -# Plot the figure -def plot_figs(fig_num, elev, azim, X_train, clf): - fig = plt.figure(fig_num, figsize=(4, 3)) - plt.clf() - ax = Axes3D(fig, elev=elev, azim=azim) - - ax.scatter(X_train[:, 0], X_train[:, 1], y_train, c='k', marker='+') - ax.plot_surface(np.array([[-.1, -.1], [.15, .15]]), - np.array([[-.1, .15], [-.1, .15]]), - clf.predict(np.array([[-.1, -.1, .15, .15], - [-.1, .15, -.1, .15]]).T - ).reshape((2, 2)), - alpha=.5) - ax.set_xlabel('X_1') - ax.set_ylabel('X_2') - ax.set_zlabel('Y') - ax.w_xaxis.set_ticklabels([]) - ax.w_yaxis.set_ticklabels([]) - ax.w_zaxis.set_ticklabels([]) - -#Generate the three different figures from different views -elev = 43.5 -azim = -110 -plot_figs(1, elev, azim, X_train, ols) - -elev = -.5 -azim = 0 -plot_figs(2, elev, azim, X_train, ols) - -elev = -.5 -azim = 90 -plot_figs(3, elev, azim, X_train, ols) - -plt.show() diff --git a/0.15/_downloads/plot_ols_ridge_variance.py b/0.15/_downloads/plot_ols_ridge_variance.py deleted file mode 100644 index a68ed005aef4c..0000000000000 --- a/0.15/_downloads/plot_ols_ridge_variance.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -Ordinary Least Squares and Ridge Regression Variance -========================================================= -Due to the few points in each dimension and the straight -line that linear regression uses to follow these points -as well as it can, noise on the observations will cause -great variance as shown in the first plot. Every line's slope -can vary quite a bit for each prediction due to the noise -induced in the observations. - -Ridge regression is basically minimizing a penalised version -of the least-squared function. The penalising `shrinks` the -value of the regression coefficients. -Despite the few data points in each dimension, the slope -of the prediction is much more stable and the variance -in the line itself is greatly reduced, in comparison to that -of the standard linear regression -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import linear_model - -X_train = np.c_[.5, 1].T -y_train = [.5, 1] -X_test = np.c_[0, 2].T - -np.random.seed(0) - -classifiers = dict(ols=linear_model.LinearRegression(), - ridge=linear_model.Ridge(alpha=.1)) - -fignum = 1 -for name, clf in classifiers.items(): - fig = plt.figure(fignum, figsize=(4, 3)) - plt.clf() - plt.title(name) - ax = plt.axes([.12, .12, .8, .8]) - - for _ in range(6): - this_X = .1 * np.random.normal(size=(2, 1)) + X_train - clf.fit(this_X, y_train) - - ax.plot(X_test, clf.predict(X_test), color='.5') - ax.scatter(this_X, y_train, s=3, c='.5', marker='o', zorder=10) - - clf.fit(X_train, y_train) - ax.plot(X_test, clf.predict(X_test), linewidth=2, color='blue') - ax.scatter(X_train, y_train, s=30, c='r', marker='+', zorder=10) - - ax.set_xticks(()) - ax.set_yticks(()) - ax.set_ylim((0, 1.6)) - ax.set_xlabel('X') - ax.set_ylabel('y') - ax.set_xlim(0, 2) - fignum += 1 - -plt.show() diff --git a/0.15/_downloads/plot_omp.py b/0.15/_downloads/plot_omp.py deleted file mode 100644 index f07b7d723340a..0000000000000 --- a/0.15/_downloads/plot_omp.py +++ /dev/null @@ -1,82 +0,0 @@ -""" -=========================== -Orthogonal Matching Pursuit -=========================== - -Using orthogonal matching pursuit for recovering a sparse signal from a noisy -measurement encoded with a dictionary -""" -print(__doc__) - -import matplotlib.pyplot as plt -import numpy as np -from sklearn.linear_model import OrthogonalMatchingPursuit -from sklearn.linear_model import OrthogonalMatchingPursuitCV -from sklearn.datasets import make_sparse_coded_signal - -n_components, n_features = 512, 100 -n_nonzero_coefs = 17 - -# generate the data -################### - -# y = Xw -# |x|_0 = n_nonzero_coefs - -y, X, w = make_sparse_coded_signal(n_samples=1, - n_components=n_components, - n_features=n_features, - n_nonzero_coefs=n_nonzero_coefs, - random_state=0) - -idx, = w.nonzero() - -# distort the clean signal -########################## -y_noisy = y + 0.05 * np.random.randn(len(y)) - -# plot the sparse signal -######################## -plt.figure(figsize=(7, 7)) -plt.subplot(4, 1, 1) -plt.xlim(0, 512) -plt.title("Sparse signal") -plt.stem(idx, w[idx]) - -# plot the noise-free reconstruction -#################################### - -omp = OrthogonalMatchingPursuit(n_nonzero_coefs=n_nonzero_coefs) -omp.fit(X, y) -coef = omp.coef_ -idx_r, = coef.nonzero() -plt.subplot(4, 1, 2) -plt.xlim(0, 512) -plt.title("Recovered signal from noise-free measurements") -plt.stem(idx_r, coef[idx_r]) - -# plot the noisy reconstruction -############################### -omp.fit(X, y_noisy) -coef = omp.coef_ -idx_r, = coef.nonzero() -plt.subplot(4, 1, 3) -plt.xlim(0, 512) -plt.title("Recovered signal from noisy measurements") -plt.stem(idx_r, coef[idx_r]) - -# plot the noisy reconstruction with number of non-zeros set by CV -################################################################## -omp_cv = OrthogonalMatchingPursuitCV() -omp_cv.fit(X, y_noisy) -coef = omp_cv.coef_ -idx_r, = coef.nonzero() -plt.subplot(4, 1, 4) -plt.xlim(0, 512) -plt.title("Recovered signal from noisy measurements with CV") -plt.stem(idx_r, coef[idx_r]) - -plt.subplots_adjust(0.06, 0.04, 0.94, 0.90, 0.20, 0.38) -plt.suptitle('Sparse signal recovery with Orthogonal Matching Pursuit', - fontsize=16) -plt.show() diff --git a/0.15/_downloads/plot_oneclass.py b/0.15/_downloads/plot_oneclass.py deleted file mode 100644 index 8c765673a63cd..0000000000000 --- a/0.15/_downloads/plot_oneclass.py +++ /dev/null @@ -1,63 +0,0 @@ -""" -========================================== -One-class SVM with non-linear kernel (RBF) -========================================== - -An example using a one-class SVM for novelty detection. - -:ref:`One-class SVM ` is an unsupervised -algorithm that learns a decision function for novelty detection: -classifying new data as similar or different to the training set. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -import matplotlib.font_manager -from sklearn import svm - -xx, yy = np.meshgrid(np.linspace(-5, 5, 500), np.linspace(-5, 5, 500)) -# Generate train data -X = 0.3 * np.random.randn(100, 2) -X_train = np.r_[X + 2, X - 2] -# Generate some regular novel observations -X = 0.3 * np.random.randn(20, 2) -X_test = np.r_[X + 2, X - 2] -# Generate some abnormal novel observations -X_outliers = np.random.uniform(low=-4, high=4, size=(20, 2)) - -# fit the model -clf = svm.OneClassSVM(nu=0.1, kernel="rbf", gamma=0.1) -clf.fit(X_train) -y_pred_train = clf.predict(X_train) -y_pred_test = clf.predict(X_test) -y_pred_outliers = clf.predict(X_outliers) -n_error_train = y_pred_train[y_pred_train == -1].size -n_error_test = y_pred_test[y_pred_test == -1].size -n_error_outliers = y_pred_outliers[y_pred_outliers == 1].size - -# plot the line, the points, and the nearest vectors to the plane -Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) -Z = Z.reshape(xx.shape) - -plt.title("Novelty Detection") -plt.contourf(xx, yy, Z, levels=np.linspace(Z.min(), 0, 7), cmap=plt.cm.Blues_r) -a = plt.contour(xx, yy, Z, levels=[0], linewidths=2, colors='red') -plt.contourf(xx, yy, Z, levels=[0, Z.max()], colors='orange') - -b1 = plt.scatter(X_train[:, 0], X_train[:, 1], c='white') -b2 = plt.scatter(X_test[:, 0], X_test[:, 1], c='green') -c = plt.scatter(X_outliers[:, 0], X_outliers[:, 1], c='red') -plt.axis('tight') -plt.xlim((-5, 5)) -plt.ylim((-5, 5)) -plt.legend([a.collections[0], b1, b2, c], - ["learned frontier", "training observations", - "new regular observations", "new abnormal observations"], - loc="upper left", - prop=matplotlib.font_manager.FontProperties(size=11)) -plt.xlabel( - "error train: %d/200 ; errors novel regular: %d/40 ; " - "errors novel abnormal: %d/40" - % (n_error_train, n_error_test, n_error_outliers)) -plt.show() diff --git a/0.15/_downloads/plot_out_of_core_classification.py b/0.15/_downloads/plot_out_of_core_classification.py deleted file mode 100644 index 61e899053a6a3..0000000000000 --- a/0.15/_downloads/plot_out_of_core_classification.py +++ /dev/null @@ -1,416 +0,0 @@ -""" -====================================================== -Out-of-core classification of text documents -====================================================== - -This is an example showing how scikit-learn can be used for classification -using an out-of-core approach: learning from data that doesn't fit into main -memory. We make use of an online classifier, i.e., one that supports the -partial_fit method, that will be fed with batches of examples. To guarantee -that the features space remains the same over time we leverage a -HashingVectorizer that will project each example into the same feature space. -This is especially useful in the case of text classification where new -features (words) may appear in each batch. - -The dataset used in this example is Reuters-21578 as provided by the UCI ML -repository. It will be automatically downloaded and uncompressed on first run. - -The plot represents the learning curve of the classifier: the evolution -of classification accuracy over the course of the mini-batches. Accuracy is -measured on the first 1000 samples, held out as a validation set. - -To limit the memory consumption, we queue examples up to a fixed amount before -feeding them to the learner. -""" - -# Authors: Eustache Diemert -# @FedericoV -# License: BSD 3 clause - -from __future__ import print_function - -from glob import glob -import itertools -import os.path -import re -import tarfile -import time - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib import rcParams - -from sklearn.externals import six -from sklearn.externals.six.moves import html_parser -from sklearn.externals.six.moves import urllib -from sklearn.datasets import get_data_home -from sklearn.feature_extraction.text import HashingVectorizer -from sklearn.linear_model.stochastic_gradient import SGDClassifier -from sklearn.linear_model import PassiveAggressiveClassifier -from sklearn.linear_model import Perceptron -from sklearn.naive_bayes import MultinomialNB - - -def _not_in_sphinx(): - # Hack to detect whether we are running by the sphinx builder - return '__file__' in globals() - - -############################################################################### -# Reuters Dataset related routines -############################################################################### - - -class ReutersParser(html_parser.HTMLParser): - """Utility class to parse a SGML file and yield documents one at a time.""" - - def __init__(self, encoding='latin-1'): - html_parser.HTMLParser.__init__(self) - self._reset() - self.encoding = encoding - - def handle_starttag(self, tag, attrs): - method = 'start_' + tag - getattr(self, method, lambda x: None)(attrs) - - def handle_endtag(self, tag): - method = 'end_' + tag - getattr(self, method, lambda: None)() - - def _reset(self): - self.in_title = 0 - self.in_body = 0 - self.in_topics = 0 - self.in_topic_d = 0 - self.title = "" - self.body = "" - self.topics = [] - self.topic_d = "" - - def parse(self, fd): - self.docs = [] - for chunk in fd: - self.feed(chunk.decode(self.encoding)) - for doc in self.docs: - yield doc - self.docs = [] - self.close() - - def handle_data(self, data): - if self.in_body: - self.body += data - elif self.in_title: - self.title += data - elif self.in_topic_d: - self.topic_d += data - - def start_reuters(self, attributes): - pass - - def end_reuters(self): - self.body = re.sub(r'\s+', r' ', self.body) - self.docs.append({'title': self.title, - 'body': self.body, - 'topics': self.topics}) - self._reset() - - def start_title(self, attributes): - self.in_title = 1 - - def end_title(self): - self.in_title = 0 - - def start_body(self, attributes): - self.in_body = 1 - - def end_body(self): - self.in_body = 0 - - def start_topics(self, attributes): - self.in_topics = 1 - - def end_topics(self): - self.in_topics = 0 - - def start_d(self, attributes): - self.in_topic_d = 1 - - def end_d(self): - self.in_topic_d = 0 - self.topics.append(self.topic_d) - self.topic_d = "" - - -def stream_reuters_documents(data_path=None): - """Iterate over documents of the Reuters dataset. - - The Reuters archive will automatically be downloaded and uncompressed if - the `data_path` directory does not exist. - - Documents are represented as dictionaries with 'body' (str), - 'title' (str), 'topics' (list(str)) keys. - - """ - - DOWNLOAD_URL = ('http://archive.ics.uci.edu/ml/machine-learning-databases/' - 'reuters21578-mld/reuters21578.tar.gz') - ARCHIVE_FILENAME = 'reuters21578.tar.gz' - - if data_path is None: - data_path = os.path.join(get_data_home(), "reuters") - if not os.path.exists(data_path): - """Download the dataset.""" - print("downloading dataset (once and for all) into %s" % - data_path) - os.mkdir(data_path) - - def progress(blocknum, bs, size): - total_sz_mb = '%.2f MB' % (size / 1e6) - current_sz_mb = '%.2f MB' % ((blocknum * bs) / 1e6) - if _not_in_sphinx(): - print('\rdownloaded %s / %s' % (current_sz_mb, total_sz_mb), - end='') - - archive_path = os.path.join(data_path, ARCHIVE_FILENAME) - urllib.request.urlretrieve(DOWNLOAD_URL, filename=archive_path, - reporthook=progress) - if _not_in_sphinx(): - print('\r', end='') - print("untarring Reuters dataset...") - tarfile.open(archive_path, 'r:gz').extractall(data_path) - print("done.") - - parser = ReutersParser() - for filename in glob(os.path.join(data_path, "*.sgm")): - for doc in parser.parse(open(filename, 'rb')): - yield doc - - -############################################################################### -# Main -############################################################################### -# Create the vectorizer and limit the number of features to a reasonable -# maximum -vectorizer = HashingVectorizer(decode_error='ignore', n_features=2 ** 18, - non_negative=True) - - -# Iterator over parsed Reuters SGML files. -data_stream = stream_reuters_documents() - -# We learn a binary classification between the "acq" class and all the others. -# "acq" was chosen as it is more or less evenly distributed in the Reuters -# files. For other datasets, one should take care of creating a test set with -# a realistic portion of positive instances. -all_classes = np.array([0, 1]) -positive_class = 'acq' - -# Here are some classifiers that support the `partial_fit` method -partial_fit_classifiers = { - 'SGD': SGDClassifier(), - 'Perceptron': Perceptron(), - 'NB Multinomial': MultinomialNB(alpha=0.01), - 'Passive-Aggressive': PassiveAggressiveClassifier(), -} - - -def get_minibatch(doc_iter, size, pos_class=positive_class): - """Extract a minibatch of examples, return a tuple X_text, y. - - Note: size is before excluding invalid docs with no topics assigned. - - """ - data = [(u'{title}\n\n{body}'.format(**doc), pos_class in doc['topics']) - for doc in itertools.islice(doc_iter, size) - if doc['topics']] - if not len(data): - return np.asarray([], dtype=int), np.asarray([], dtype=int) - X_text, y = zip(*data) - return X_text, np.asarray(y, dtype=int) - - -def iter_minibatches(doc_iter, minibatch_size): - """Generator of minibatches.""" - X_text, y = get_minibatch(doc_iter, minibatch_size) - while len(X_text): - yield X_text, y - X_text, y = get_minibatch(doc_iter, minibatch_size) - - -# test data statistics -test_stats = {'n_test': 0, 'n_test_pos': 0} - -# First we hold out a number of examples to estimate accuracy -n_test_documents = 1000 -tick = time.time() -X_test_text, y_test = get_minibatch(data_stream, 1000) -parsing_time = time.time() - tick -tick = time.time() -X_test = vectorizer.transform(X_test_text) -vectorizing_time = time.time() - tick -test_stats['n_test'] += len(y_test) -test_stats['n_test_pos'] += sum(y_test) -print("Test set is %d documents (%d positive)" % (len(y_test), sum(y_test))) - - -def progress(cls_name, stats): - """Report progress information, return a string.""" - duration = time.time() - stats['t0'] - s = "%20s classifier : \t" % cls_name - s += "%(n_train)6d train docs (%(n_train_pos)6d positive) " % stats - s += "%(n_test)6d test docs (%(n_test_pos)6d positive) " % test_stats - s += "accuracy: %(accuracy).3f " % stats - s += "in %.2fs (%5d docs/s)" % (duration, stats['n_train'] / duration) - return s - - -cls_stats = {} - -for cls_name in partial_fit_classifiers: - stats = {'n_train': 0, 'n_train_pos': 0, - 'accuracy': 0.0, 'accuracy_history': [(0, 0)], 't0': time.time(), - 'runtime_history': [(0, 0)], 'total_fit_time': 0.0} - cls_stats[cls_name] = stats - -get_minibatch(data_stream, n_test_documents) -# Discard test set - -# We will feed the classifier with mini-batches of 1000 documents; this means -# we have at most 1000 docs in memory at any time. The smaller the document -# batch, the bigger the relative overhead of the partial fit methods. -minibatch_size = 1000 - -# Create the data_stream that parses Reuters SGML files and iterates on -# documents as a stream. -minibatch_iterators = iter_minibatches(data_stream, minibatch_size) -total_vect_time = 0.0 - -# Main loop : iterate on mini-batchs of examples -for i, (X_train_text, y_train) in enumerate(minibatch_iterators): - - tick = time.time() - X_train = vectorizer.transform(X_train_text) - total_vect_time += time.time() - tick - - for cls_name, cls in partial_fit_classifiers.items(): - tick = time.time() - # update estimator with examples in the current mini-batch - cls.partial_fit(X_train, y_train, classes=all_classes) - - # accumulate test accuracy stats - cls_stats[cls_name]['total_fit_time'] += time.time() - tick - cls_stats[cls_name]['n_train'] += X_train.shape[0] - cls_stats[cls_name]['n_train_pos'] += sum(y_train) - tick = time.time() - cls_stats[cls_name]['accuracy'] = cls.score(X_test, y_test) - cls_stats[cls_name]['prediction_time'] = time.time() - tick - acc_history = (cls_stats[cls_name]['accuracy'], - cls_stats[cls_name]['n_train']) - cls_stats[cls_name]['accuracy_history'].append(acc_history) - run_history = (cls_stats[cls_name]['accuracy'], - total_vect_time + cls_stats[cls_name]['total_fit_time']) - cls_stats[cls_name]['runtime_history'].append(run_history) - - if i % 3 == 0: - print(progress(cls_name, cls_stats[cls_name])) - if i % 3 == 0: - print('\n') - - -############################################################################### -# Plot results -############################################################################### - - -def plot_accuracy(x, y, x_legend): - """Plot accuracy as a function of x.""" - x = np.array(x) - y = np.array(y) - plt.title('Classification accuracy as a function of %s' % x_legend) - plt.xlabel('%s' % x_legend) - plt.ylabel('Accuracy') - plt.grid(True) - plt.plot(x, y) - -rcParams['legend.fontsize'] = 10 -cls_names = list(sorted(cls_stats.keys())) - -# Plot accuracy evolution -plt.figure() -for _, stats in sorted(cls_stats.items()): - # Plot accuracy evolution with #examples - accuracy, n_examples = zip(*stats['accuracy_history']) - plot_accuracy(n_examples, accuracy, "training examples (#)") - ax = plt.gca() - ax.set_ylim((0.8, 1)) -plt.legend(cls_names, loc='best') - -plt.figure() -for _, stats in sorted(cls_stats.items()): - # Plot accuracy evolution with runtime - accuracy, runtime = zip(*stats['runtime_history']) - plot_accuracy(runtime, accuracy, 'runtime (s)') - ax = plt.gca() - ax.set_ylim((0.8, 1)) -plt.legend(cls_names, loc='best') - -# Plot fitting times -plt.figure() -fig = plt.gcf() -cls_runtime = [] -for cls_name, stats in sorted(cls_stats.items()): - cls_runtime.append(stats['total_fit_time']) - -cls_runtime.append(total_vect_time) -cls_names.append('Vectorization') -bar_colors = rcParams['axes.color_cycle'][:len(cls_names)] - -ax = plt.subplot(111) -rectangles = plt.bar(range(len(cls_names)), cls_runtime, width=0.5, - color=bar_colors) - -ax.set_xticks(np.linspace(0.25, len(cls_names) - 0.75, len(cls_names))) -ax.set_xticklabels(cls_names, fontsize=10) -ymax = max(cls_runtime) * 1.2 -ax.set_ylim((0, ymax)) -ax.set_ylabel('runtime (s)') -ax.set_title('Training Times') - - -def autolabel(rectangles): - """attach some text vi autolabel on rectangles.""" - for rect in rectangles: - height = rect.get_height() - ax.text(rect.get_x() + rect.get_width() / 2., - 1.05 * height, '%.4f' % height, - ha='center', va='bottom') - -autolabel(rectangles) -plt.show() - -# Plot prediction times -plt.figure() -#fig = plt.gcf() -cls_runtime = [] -cls_names = list(sorted(cls_stats.keys())) -for cls_name, stats in sorted(cls_stats.items()): - cls_runtime.append(stats['prediction_time']) -cls_runtime.append(parsing_time) -cls_names.append('Read/Parse\n+Feat.Extr.') -cls_runtime.append(vectorizing_time) -cls_names.append('Hashing\n+Vect.') -bar_colors = rcParams['axes.color_cycle'][:len(cls_names)] - -ax = plt.subplot(111) -rectangles = plt.bar(range(len(cls_names)), cls_runtime, width=0.5, - color=bar_colors) - -ax.set_xticks(np.linspace(0.25, len(cls_names) - 0.75, len(cls_names))) -ax.set_xticklabels(cls_names, fontsize=8) -plt.setp(plt.xticks()[1], rotation=30) -ymax = max(cls_runtime) * 1.2 -ax.set_ylim((0, ymax)) -ax.set_ylabel('runtime (s)') -ax.set_title('Prediction Times (%d instances)' % n_test_documents) -autolabel(rectangles) -plt.show() diff --git a/0.15/_downloads/plot_outlier_detection.py b/0.15/_downloads/plot_outlier_detection.py deleted file mode 100644 index c65656d34a760..0000000000000 --- a/0.15/_downloads/plot_outlier_detection.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -========================================== -Outlier detection with several methods. -========================================== - -When the amount of contamination is known, this example illustrates two -different ways of performing :ref:`outlier_detection`: - -- based on a robust estimator of covariance, which is assuming that the - data are Gaussian distributed and performs better than the One-Class SVM - in that case. - -- using the One-Class SVM and its ability to capture the shape of the - data set, hence performing better when the data is strongly - non-Gaussian, i.e. with two well-separated clusters; - -The ground truth about inliers and outliers is given by the points colors -while the orange-filled area indicates which points are reported as outliers -by each method. - -Here, we assume that we know the fraction of outliers in the datasets. -Thus rather than using the 'predict' method of the objects, we set the -threshold on the decision_function to separate out the corresponding -fraction. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -import matplotlib.font_manager -from scipy import stats - -from sklearn import svm -from sklearn.covariance import EllipticEnvelope - -# Example settings -n_samples = 200 -outliers_fraction = 0.25 -clusters_separation = [0, 1, 2] - -# define two outlier detection tools to be compared -classifiers = { - "One-Class SVM": svm.OneClassSVM(nu=0.95 * outliers_fraction + 0.05, - kernel="rbf", gamma=0.1), - "robust covariance estimator": EllipticEnvelope(contamination=.1)} - -# Compare given classifiers under given settings -xx, yy = np.meshgrid(np.linspace(-7, 7, 500), np.linspace(-7, 7, 500)) -n_inliers = int((1. - outliers_fraction) * n_samples) -n_outliers = int(outliers_fraction * n_samples) -ground_truth = np.ones(n_samples, dtype=int) -ground_truth[-n_outliers:] = 0 - -# Fit the problem with varying cluster separation -for i, offset in enumerate(clusters_separation): - np.random.seed(42) - # Data generation - X1 = 0.3 * np.random.randn(0.5 * n_inliers, 2) - offset - X2 = 0.3 * np.random.randn(0.5 * n_inliers, 2) + offset - X = np.r_[X1, X2] - # Add outliers - X = np.r_[X, np.random.uniform(low=-6, high=6, size=(n_outliers, 2))] - - # Fit the model with the One-Class SVM - plt.figure(figsize=(10, 5)) - for i, (clf_name, clf) in enumerate(classifiers.items()): - # fit the data and tag outliers - clf.fit(X) - y_pred = clf.decision_function(X).ravel() - threshold = stats.scoreatpercentile(y_pred, - 100 * outliers_fraction) - y_pred = y_pred > threshold - n_errors = (y_pred != ground_truth).sum() - # plot the levels lines and the points - Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) - Z = Z.reshape(xx.shape) - subplot = plt.subplot(1, 2, i + 1) - subplot.set_title("Outlier detection") - subplot.contourf(xx, yy, Z, levels=np.linspace(Z.min(), threshold, 7), - cmap=plt.cm.Blues_r) - a = subplot.contour(xx, yy, Z, levels=[threshold], - linewidths=2, colors='red') - subplot.contourf(xx, yy, Z, levels=[threshold, Z.max()], - colors='orange') - b = subplot.scatter(X[:-n_outliers, 0], X[:-n_outliers, 1], c='white') - c = subplot.scatter(X[-n_outliers:, 0], X[-n_outliers:, 1], c='black') - subplot.axis('tight') - subplot.legend( - [a.collections[0], b, c], - ['learned decision function', 'true inliers', 'true outliers'], - prop=matplotlib.font_manager.FontProperties(size=11)) - subplot.set_xlabel("%d. %s (errors: %d)" % (i + 1, clf_name, n_errors)) - subplot.set_xlim((-7, 7)) - subplot.set_ylim((-7, 7)) - plt.subplots_adjust(0.04, 0.1, 0.96, 0.94, 0.1, 0.26) - -plt.show() diff --git a/0.15/_downloads/plot_outlier_detection_housing.py b/0.15/_downloads/plot_outlier_detection_housing.py deleted file mode 100644 index 7c2576827a77d..0000000000000 --- a/0.15/_downloads/plot_outlier_detection_housing.py +++ /dev/null @@ -1,132 +0,0 @@ -""" -==================================== -Outlier detection on a real data set -==================================== - -This example illustrates the need for robust covariance estimation -on a real data set. It is useful both for outlier detection and for -a better understanding of the data structure. - -We selected two sets of two variables from the boston housing data set -as an illustration of what kind of analysis can be done with several -outlier detection tools. For the purpose of visualization, we are working -with two-dimensional examples, but one should be aware that things are -not so trivial in high-dimension, as it will be pointed out. - -In both examples below, the main result is that the empirical covariance -estimate, as a non-robust one, is highly influenced by the heterogeneous -structure of the observations. Although the robust covariance estimate is -able to focus on the main mode of the data distribution, it sticks to the -assumption that the data should be Gaussian distributed, yielding some biased -estimation of the data structure, but yet accurate to some extent. -The One-Class SVM algorithm - -First example -------------- -The first example illustrates how robust covariance estimation can help -concentrating on a relevant cluster when another one exists. Here, many -observations are confounded into one and break down the empirical covariance -estimation. -Of course, some screening tools would have pointed out the presence of two -clusters (Support Vector Machines, Gaussian Mixture Models, univariate -outlier detection, ...). But had it been a high-dimensional example, none -of these could be applied that easily. - -Second example --------------- -The second example shows the ability of the Minimum Covariance Determinant -robust estimator of covariance to concentrate on the main mode of the data -distribution: the location seems to be well estimated, although the covariance -is hard to estimate due to the banana-shaped distribution. Anyway, we can -get rid of some outlying observations. -The One-Class SVM is able to capture the real data structure, but the -difficulty is to adjust its kernel bandwidth parameter so as to obtain -a good compromise between the shape of the data scatter matrix and the -risk of over-fitting the data. - -""" -print(__doc__) - -# Author: Virgile Fritsch -# License: BSD 3 clause - -import numpy as np -from sklearn.covariance import EllipticEnvelope -from sklearn.svm import OneClassSVM -import matplotlib.pyplot as plt -import matplotlib.font_manager -from sklearn.datasets import load_boston - -# Get data -X1 = load_boston()['data'][:, [8, 10]] # two clusters -X2 = load_boston()['data'][:, [5, 12]] # "banana"-shaped - -# Define "classifiers" to be used -classifiers = { - "Empirical Covariance": EllipticEnvelope(support_fraction=1., - contamination=0.261), - "Robust Covariance (Minimum Covariance Determinant)": - EllipticEnvelope(contamination=0.261), - "OCSVM": OneClassSVM(nu=0.261, gamma=0.05)} -colors = ['m', 'g', 'b'] -legend1 = {} -legend2 = {} - -# Learn a frontier for outlier detection with several classifiers -xx1, yy1 = np.meshgrid(np.linspace(-8, 28, 500), np.linspace(3, 40, 500)) -xx2, yy2 = np.meshgrid(np.linspace(3, 10, 500), np.linspace(-5, 45, 500)) -for i, (clf_name, clf) in enumerate(classifiers.items()): - plt.figure(1) - clf.fit(X1) - Z1 = clf.decision_function(np.c_[xx1.ravel(), yy1.ravel()]) - Z1 = Z1.reshape(xx1.shape) - legend1[clf_name] = plt.contour( - xx1, yy1, Z1, levels=[0], linewidths=2, colors=colors[i]) - plt.figure(2) - clf.fit(X2) - Z2 = clf.decision_function(np.c_[xx2.ravel(), yy2.ravel()]) - Z2 = Z2.reshape(xx2.shape) - legend2[clf_name] = plt.contour( - xx2, yy2, Z2, levels=[0], linewidths=2, colors=colors[i]) - -legend1_values_list = list( legend1.values() ) -legend1_keys_list = list( legend1.keys() ) - -# Plot the results (= shape of the data points cloud) -plt.figure(1) # two clusters -plt.title("Outlier detection on a real data set (boston housing)") -plt.scatter(X1[:, 0], X1[:, 1], color='black') -bbox_args = dict(boxstyle="round", fc="0.8") -arrow_args = dict(arrowstyle="->") -plt.annotate("several confounded points", xy=(24, 19), - xycoords="data", textcoords="data", - xytext=(13, 10), bbox=bbox_args, arrowprops=arrow_args) -plt.xlim((xx1.min(), xx1.max())) -plt.ylim((yy1.min(), yy1.max())) -plt.legend((legend1_values_list[0].collections[0], - legend1_values_list[1].collections[0], - legend1_values_list[2].collections[0]), - (legend1_keys_list[0], legend1_keys_list[1], legend1_keys_list[2]), - loc="upper center", - prop=matplotlib.font_manager.FontProperties(size=12)) -plt.ylabel("accessibility to radial highways") -plt.xlabel("pupil-teatcher ratio by town") - -legend2_values_list = list( legend2.values() ) -legend2_keys_list = list( legend2.keys() ) - -plt.figure(2) # "banana" shape -plt.title("Outlier detection on a real data set (boston housing)") -plt.scatter(X2[:, 0], X2[:, 1], color='black') -plt.xlim((xx2.min(), xx2.max())) -plt.ylim((yy2.min(), yy2.max())) -plt.legend((legend2_values_list[0].collections[0], - legend2_values_list[1].collections[0], - legend2_values_list[2].collections[0]), - (legend2_values_list[0], legend2_values_list[1], legend2_values_list[2]), - loc="upper center", - prop=matplotlib.font_manager.FontProperties(size=12)) -plt.ylabel("% lower status of the population") -plt.xlabel("average number of rooms per dwelling") - -plt.show() diff --git a/0.15/_downloads/plot_partial_dependence.py b/0.15/_downloads/plot_partial_dependence.py deleted file mode 100644 index b480e228d3ca3..0000000000000 --- a/0.15/_downloads/plot_partial_dependence.py +++ /dev/null @@ -1,111 +0,0 @@ -""" -======================== -Partial Dependence Plots -======================== - -Partial dependence plots show the dependence between the target function [1]_ -and a set of 'target' features, marginalizing over the -values of all other features (the complement features). Due to the limits -of human perception the size of the target feature set must be small (usually, -one or two) thus the target features are usually chosen among the most -important features -(see :attr:`~sklearn.ensemble.GradientBoostingRegressor.feature_importances_`). - -This example shows how to obtain partial dependence plots from a -:class:`~sklearn.ensemble.GradientBoostingRegressor` trained on the California -housing dataset. The example is taken from [HTF2009]_. - -The plot shows four one-way and one two-way partial dependence plots. -The target variables for the one-way PDP are: -median income (`MedInc`), avg. occupants per household (`AvgOccup`), -median house age (`HouseAge`), and avg. rooms per household (`AveRooms`). - -We can clearly see that the median house price shows a linear relationship -with the median income (top left) and that the house price drops when the -avg. occupants per household increases (top middle). -The top right plot shows that the house age in a district does not have -a strong influence on the (median) house price; so does the average rooms -per household. -The tick marks on the x-axis represent the deciles of the feature values -in the training data. - -Partial dependence plots with two target features enable us to visualize -interactions among them. The two-way partial dependence plot shows the -dependence of median house price on joint values of house age and avg. -occupants per household. We can clearly see an interaction between the -two features: -For an avg. occupancy greater than two, the house price is nearly independent -of the house age, whereas for values less than two there is a strong dependence -on age. - -.. [HTF2009] T. Hastie, R. Tibshirani and J. Friedman, - "Elements of Statistical Learning Ed. 2", Springer, 2009. - -.. [1] For classification you can think of it as the regression score before - the link function. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from mpl_toolkits.mplot3d import Axes3D - -from sklearn.cross_validation import train_test_split -from sklearn.ensemble import GradientBoostingRegressor -from sklearn.ensemble.partial_dependence import plot_partial_dependence -from sklearn.ensemble.partial_dependence import partial_dependence -from sklearn.datasets.california_housing import fetch_california_housing - -# fetch California housing dataset -cal_housing = fetch_california_housing() - -# split 80/20 train-test -X_train, X_test, y_train, y_test = train_test_split(cal_housing.data, - cal_housing.target, - test_size=0.2, - random_state=1) -names = cal_housing.feature_names - -print('_' * 80) -print("Training GBRT...") -clf = GradientBoostingRegressor(n_estimators=100, max_depth=4, - learning_rate=0.1, loss='huber', - random_state=1) -clf.fit(X_train, y_train) -print("done.") - -print('_' * 80) -print('Convenience plot with ``partial_dependence_plots``') -print - -features = [0, 5, 1, 2, (5, 1)] -fig, axs = plot_partial_dependence(clf, X_train, features, feature_names=names, - n_jobs=3, grid_resolution=50) -fig.suptitle('Partial dependence of house value on nonlocation features\n' - 'for the California housing dataset') -plt.subplots_adjust(top=0.9) # tight_layout causes overlap with suptitle - -print('_' * 80) -print('Custom 3d plot via ``partial_dependence``') -print -fig = plt.figure() - -target_feature = (1, 5) -pdp, (x_axis, y_axis) = partial_dependence(clf, target_feature, - X=X_train, grid_resolution=50) -XX, YY = np.meshgrid(x_axis, y_axis) -Z = pdp.T.reshape(XX.shape).T -ax = Axes3D(fig) -surf = ax.plot_surface(XX, YY, Z, rstride=1, cstride=1, cmap=plt.cm.BuPu) -ax.set_xlabel(names[target_feature[0]]) -ax.set_ylabel(names[target_feature[1]]) -ax.set_zlabel('Partial dependence') -# pretty init view -ax.view_init(elev=22, azim=122) -plt.colorbar(surf) -plt.suptitle('Partial dependence of house value on median age and ' - 'average occupancy') -plt.subplots_adjust(top=0.9) - -plt.show() diff --git a/0.15/_downloads/plot_pca_3d.py b/0.15/_downloads/plot_pca_3d.py deleted file mode 100644 index 621a6964eb247..0000000000000 --- a/0.15/_downloads/plot_pca_3d.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -Principal components analysis (PCA) -========================================================= - -These figures aid in illustrating how a point cloud -can be very flat in one direction--which is where PCA -comes in to choose a direction that is not flat. - -""" -print(__doc__) - -# Authors: Gael Varoquaux -# Jaques Grobler -# Kevin Hughes -# License: BSD 3 clause - -from sklearn.decomposition import PCA - -from mpl_toolkits.mplot3d import Axes3D -import numpy as np -import matplotlib.pyplot as plt -from scipy import stats - - -############################################################################### -# Create the data - -e = np.exp(1) -np.random.seed(4) - - -def pdf(x): - return 0.5 * (stats.norm(scale=0.25 / e).pdf(x) - + stats.norm(scale=4 / e).pdf(x)) - -y = np.random.normal(scale=0.5, size=(30000)) -x = np.random.normal(scale=0.5, size=(30000)) -z = np.random.normal(scale=0.1, size=len(x)) - -density = pdf(x) * pdf(y) -pdf_z = pdf(5 * z) - -density *= pdf_z - -a = x + y -b = 2 * y -c = a - b + z - -norm = np.sqrt(a.var() + b.var()) -a /= norm -b /= norm - - -############################################################################### -# Plot the figures -def plot_figs(fig_num, elev, azim): - fig = plt.figure(fig_num, figsize=(4, 3)) - plt.clf() - ax = Axes3D(fig, rect=[0, 0, .95, 1], elev=elev, azim=azim) - - ax.scatter(a[::10], b[::10], c[::10], c=density, marker='+', alpha=.4) - Y = np.c_[a, b, c] - - # Using SciPy's SVD, this would be: - # _, pca_score, V = scipy.linalg.svd(Y, full_matrices=False) - - pca = PCA(n_components=3) - pca.fit(Y) - pca_score = pca.explained_variance_ratio_ - V = pca.components_ - - x_pca_axis, y_pca_axis, z_pca_axis = V.T * pca_score / pca_score.min() - - x_pca_axis, y_pca_axis, z_pca_axis = 3 * V.T - x_pca_plane = np.r_[x_pca_axis[:2], - x_pca_axis[1::-1]] - y_pca_plane = np.r_[y_pca_axis[:2], - y_pca_axis[1::-1]] - z_pca_plane = np.r_[z_pca_axis[:2], - z_pca_axis[1::-1]] - x_pca_plane.shape = (2, 2) - y_pca_plane.shape = (2, 2) - z_pca_plane.shape = (2, 2) - ax.plot_surface(x_pca_plane, y_pca_plane, z_pca_plane) - ax.w_xaxis.set_ticklabels([]) - ax.w_yaxis.set_ticklabels([]) - ax.w_zaxis.set_ticklabels([]) - - -elev = -40 -azim = -80 -plot_figs(1, elev, azim) - -elev = 30 -azim = 20 -plot_figs(2, elev, azim) - -plt.show() diff --git a/0.15/_downloads/plot_pca_iris.py b/0.15/_downloads/plot_pca_iris.py deleted file mode 100644 index 98e9c966fb283..0000000000000 --- a/0.15/_downloads/plot_pca_iris.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -PCA example with Iris Data-set -========================================================= - -Principal Component Analysis applied to the Iris dataset. - -See `here `_ for more -information on this dataset. - -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from mpl_toolkits.mplot3d import Axes3D - - -from sklearn import decomposition -from sklearn import datasets - -np.random.seed(5) - -centers = [[1, 1], [-1, -1], [1, -1]] -iris = datasets.load_iris() -X = iris.data -y = iris.target - -fig = plt.figure(1, figsize=(4, 3)) -plt.clf() -ax = Axes3D(fig, rect=[0, 0, .95, 1], elev=48, azim=134) - -plt.cla() -pca = decomposition.PCA(n_components=3) -pca.fit(X) -X = pca.transform(X) - -for name, label in [('Setosa', 0), ('Versicolour', 1), ('Virginica', 2)]: - ax.text3D(X[y == label, 0].mean(), - X[y == label, 1].mean() + 1.5, - X[y == label, 2].mean(), name, - horizontalalignment='center', - bbox=dict(alpha=.5, edgecolor='w', facecolor='w')) -# Reorder the labels to have colors matching the cluster results -y = np.choose(y, [1, 2, 0]).astype(np.float) -ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=y, cmap=plt.cm.spectral) - -x_surf = [X[:, 0].min(), X[:, 0].max(), - X[:, 0].min(), X[:, 0].max()] -y_surf = [X[:, 0].max(), X[:, 0].max(), - X[:, 0].min(), X[:, 0].min()] -x_surf = np.array(x_surf) -y_surf = np.array(y_surf) -v0 = pca.transform(pca.components_[0]) -v0 /= v0[-1] -v1 = pca.transform(pca.components_[1]) -v1 /= v1[-1] - -ax.w_xaxis.set_ticklabels([]) -ax.w_yaxis.set_ticklabels([]) -ax.w_zaxis.set_ticklabels([]) - -plt.show() diff --git a/0.15/_downloads/plot_pca_vs_fa_model_selection.py b/0.15/_downloads/plot_pca_vs_fa_model_selection.py deleted file mode 100644 index ec01d91cb1407..0000000000000 --- a/0.15/_downloads/plot_pca_vs_fa_model_selection.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -================================================================= -Model selection with Probabilistic (PCA) and Factor Analysis (FA) -================================================================= - -Probabilistic PCA and Factor Analysis are probabilistic models. -The consequence is that the likelihood of new data can be used -for model selection and covariance estimation. -Here we compare PCA and FA with cross-validation on low rank data corrupted -with homoscedastic noise (noise variance -is the same for each feature) or heteroscedastic noise (noise variance -is the different for each feature). In a second step we compare the model -likelihood to the likelihoods obtained from shrinkage covariance estimators. - -One can observe that with homoscedastic noise both FA and PCA succeed -in recovering the size of the low rank subspace. The likelihood with PCA -is higher than FA in this case. However PCA fails and overestimates -the rank when heteroscedastic noise is present. Under appropriate -circumstances the low rank models are more likely than shrinkage models. - -The automatic estimation from -Automatic Choice of Dimensionality for PCA. NIPS 2000: 598-604 -by Thomas P. Minka is also compared. - -""" -print(__doc__) - -# Authors: Alexandre Gramfort -# Denis A. Engemann -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from scipy import linalg - -from sklearn.decomposition import PCA, FactorAnalysis -from sklearn.covariance import ShrunkCovariance, LedoitWolf -from sklearn.cross_validation import cross_val_score -from sklearn.grid_search import GridSearchCV - -############################################################################### -# Create the data - -n_samples, n_features, rank = 1000, 50, 10 -sigma = 1. -rng = np.random.RandomState(42) -U, _, _ = linalg.svd(rng.randn(n_features, n_features)) -X = np.dot(rng.randn(n_samples, rank), U[:, :rank].T) - -# Adding homoscedastic noise -X_homo = X + sigma * rng.randn(n_samples, n_features) - -# Adding heteroscedastic noise -sigmas = sigma * rng.rand(n_features) + sigma / 2. -X_hetero = X + rng.randn(n_samples, n_features) * sigmas - -############################################################################### -# Fit the models - -n_components = np.arange(0, n_features, 5) # options for n_components - - -def compute_scores(X): - pca = PCA() - fa = FactorAnalysis() - - pca_scores, fa_scores = [], [] - for n in n_components: - pca.n_components = n - fa.n_components = n - pca_scores.append(np.mean(cross_val_score(pca, X))) - fa_scores.append(np.mean(cross_val_score(fa, X))) - - return pca_scores, fa_scores - - -def shrunk_cov_score(X): - shrinkages = np.logspace(-2, 0, 30) - cv = GridSearchCV(ShrunkCovariance(), {'shrinkage': shrinkages}) - return np.mean(cross_val_score(cv.fit(X).best_estimator_, X)) - - -def lw_score(X): - return np.mean(cross_val_score(LedoitWolf(), X)) - - -for X, title in [(X_homo, 'Homoscedastic Noise'), - (X_hetero, 'Heteroscedastic Noise')]: - pca_scores, fa_scores = compute_scores(X) - n_components_pca = n_components[np.argmax(pca_scores)] - n_components_fa = n_components[np.argmax(fa_scores)] - - pca = PCA(n_components='mle') - pca.fit(X) - n_components_pca_mle = pca.n_components_ - - print("best n_components by PCA CV = %d" % n_components_pca) - print("best n_components by FactorAnalysis CV = %d" % n_components_fa) - print("best n_components by PCA MLE = %d" % n_components_pca_mle) - - plt.figure() - plt.plot(n_components, pca_scores, 'b', label='PCA scores') - plt.plot(n_components, fa_scores, 'r', label='FA scores') - plt.axvline(rank, color='g', label='TRUTH: %d' % rank, linestyle='-') - plt.axvline(n_components_pca, color='b', - label='PCA CV: %d' % n_components_pca, linestyle='--') - plt.axvline(n_components_fa, color='r', - label='FactorAnalysis CV: %d' % n_components_fa, linestyle='--') - plt.axvline(n_components_pca_mle, color='k', - label='PCA MLE: %d' % n_components_pca_mle, linestyle='--') - - # compare with other covariance estimators - plt.axhline(shrunk_cov_score(X), color='violet', - label='Shrunk Covariance MLE', linestyle='-.') - plt.axhline(lw_score(X), color='orange', - label='LedoitWolf MLE' % n_components_pca_mle, linestyle='-.') - - plt.xlabel('nb of components') - plt.ylabel('CV scores') - plt.legend(loc='lower right') - plt.title(title) - -plt.show() diff --git a/0.15/_downloads/plot_pca_vs_lda.py b/0.15/_downloads/plot_pca_vs_lda.py deleted file mode 100644 index b51683535aba3..0000000000000 --- a/0.15/_downloads/plot_pca_vs_lda.py +++ /dev/null @@ -1,55 +0,0 @@ -""" -======================================================= -Comparison of LDA and PCA 2D projection of Iris dataset -======================================================= - -The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour -and Virginica) with 4 attributes: sepal length, sepal width, petal length -and petal width. - -Principal Component Analysis (PCA) applied to this data identifies the -combination of attributes (principal components, or directions in the -feature space) that account for the most variance in the data. Here we -plot the different samples on the 2 first principal components. - -Linear Discriminant Analysis (LDA) tries to identify attributes that -account for the most variance *between classes*. In particular, -LDA, in contrast to PCA, is a supervised method, using known class labels. -""" -print(__doc__) - -import matplotlib.pyplot as plt - -from sklearn import datasets -from sklearn.decomposition import PCA -from sklearn.lda import LDA - -iris = datasets.load_iris() - -X = iris.data -y = iris.target -target_names = iris.target_names - -pca = PCA(n_components=2) -X_r = pca.fit(X).transform(X) - -lda = LDA(n_components=2) -X_r2 = lda.fit(X, y).transform(X) - -# Percentage of variance explained for each components -print('explained variance ratio (first two components): %s' - % str(pca.explained_variance_ratio_)) - -plt.figure() -for c, i, target_name in zip("rgb", [0, 1, 2], target_names): - plt.scatter(X_r[y == i, 0], X_r[y == i, 1], c=c, label=target_name) -plt.legend() -plt.title('PCA of IRIS dataset') - -plt.figure() -for c, i, target_name in zip("rgb", [0, 1, 2], target_names): - plt.scatter(X_r2[y == i, 0], X_r2[y == i, 1], c=c, label=target_name) -plt.legend() -plt.title('LDA of IRIS dataset') - -plt.show() diff --git a/0.15/_downloads/plot_permutation_test_for_classification.py b/0.15/_downloads/plot_permutation_test_for_classification.py deleted file mode 100644 index 4df102578c9da..0000000000000 --- a/0.15/_downloads/plot_permutation_test_for_classification.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -================================================================= -Test with permutations the significance of a classification score -================================================================= - -In order to test if a classification score is significative a technique -in repeating the classification procedure after randomizing, permuting, -the labels. The p-value is then given by the percentage of runs for -which the score obtained is greater than the classification score -obtained in the first place. - -""" - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.svm import SVC -from sklearn.cross_validation import StratifiedKFold, permutation_test_score -from sklearn import datasets - - -############################################################################## -# Loading a dataset -iris = datasets.load_iris() -X = iris.data -y = iris.target -n_classes = np.unique(y).size - -# Some noisy data not correlated -random = np.random.RandomState(seed=0) -E = random.normal(size=(len(X), 2200)) - -# Add noisy data to the informative features for make the task harder -X = np.c_[X, E] - -svm = SVC(kernel='linear') -cv = StratifiedKFold(y, 2) - -score, permutation_scores, pvalue = permutation_test_score( - svm, X, y, scoring="accuracy", cv=cv, n_permutations=100, n_jobs=1) - -print("Classification score %s (pvalue : %s)" % (score, pvalue)) - -############################################################################### -# View histogram of permutation scores -plt.hist(permutation_scores, 20, label='Permutation scores') -ylim = plt.ylim() -# BUG: vlines(..., linestyle='--') fails on older versions of matplotlib -#plt.vlines(score, ylim[0], ylim[1], linestyle='--', -# color='g', linewidth=3, label='Classification Score' -# ' (pvalue %s)' % pvalue) -#plt.vlines(1.0 / n_classes, ylim[0], ylim[1], linestyle='--', -# color='k', linewidth=3, label='Luck') -plt.plot(2 * [score], ylim, '--g', linewidth=3, - label='Classification Score' - ' (pvalue %s)' % pvalue) -plt.plot(2 * [1. / n_classes], ylim, '--k', linewidth=3, label='Luck') - -plt.ylim(ylim) -plt.legend() -plt.xlabel('Score') -plt.show() diff --git a/0.15/_downloads/plot_permutation_test_for_classification1.py b/0.15/_downloads/plot_permutation_test_for_classification1.py deleted file mode 100644 index 4df102578c9da..0000000000000 --- a/0.15/_downloads/plot_permutation_test_for_classification1.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -================================================================= -Test with permutations the significance of a classification score -================================================================= - -In order to test if a classification score is significative a technique -in repeating the classification procedure after randomizing, permuting, -the labels. The p-value is then given by the percentage of runs for -which the score obtained is greater than the classification score -obtained in the first place. - -""" - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.svm import SVC -from sklearn.cross_validation import StratifiedKFold, permutation_test_score -from sklearn import datasets - - -############################################################################## -# Loading a dataset -iris = datasets.load_iris() -X = iris.data -y = iris.target -n_classes = np.unique(y).size - -# Some noisy data not correlated -random = np.random.RandomState(seed=0) -E = random.normal(size=(len(X), 2200)) - -# Add noisy data to the informative features for make the task harder -X = np.c_[X, E] - -svm = SVC(kernel='linear') -cv = StratifiedKFold(y, 2) - -score, permutation_scores, pvalue = permutation_test_score( - svm, X, y, scoring="accuracy", cv=cv, n_permutations=100, n_jobs=1) - -print("Classification score %s (pvalue : %s)" % (score, pvalue)) - -############################################################################### -# View histogram of permutation scores -plt.hist(permutation_scores, 20, label='Permutation scores') -ylim = plt.ylim() -# BUG: vlines(..., linestyle='--') fails on older versions of matplotlib -#plt.vlines(score, ylim[0], ylim[1], linestyle='--', -# color='g', linewidth=3, label='Classification Score' -# ' (pvalue %s)' % pvalue) -#plt.vlines(1.0 / n_classes, ylim[0], ylim[1], linestyle='--', -# color='k', linewidth=3, label='Luck') -plt.plot(2 * [score], ylim, '--g', linewidth=3, - label='Classification Score' - ' (pvalue %s)' % pvalue) -plt.plot(2 * [1. / n_classes], ylim, '--k', linewidth=3, label='Luck') - -plt.ylim(ylim) -plt.legend() -plt.xlabel('Score') -plt.show() diff --git a/0.15/_downloads/plot_polynomial_interpolation.py b/0.15/_downloads/plot_polynomial_interpolation.py deleted file mode 100644 index 0327fed59208e..0000000000000 --- a/0.15/_downloads/plot_polynomial_interpolation.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python -""" -======================== -Polynomial interpolation -======================== - -This example demonstrates how to approximate a function with a polynomial of -degree n_degree by using ridge regression. Concretely, from n_samples 1d -points, it suffices to build the Vandermonde matrix, which is n_samples x -n_degree+1 and has the following form: - -[[1, x_1, x_1 ** 2, x_1 ** 3, ...], - [1, x_2, x_2 ** 2, x_2 ** 3, ...], - ...] - -Intuitively, this matrix can be interpreted as a matrix of pseudo features (the -points raised to some power). The matrix is akin to (but different from) the -matrix induced by a polynomial kernel. - -This example shows that you can do non-linear regression with a linear model, -using a pipeline to add non-linear features. Kernel methods extend this idea -and can induce very high (even infinite) dimensional feature spaces. -""" -print(__doc__) - -# Author: Mathieu Blondel -# Jake Vanderplas -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.linear_model import Ridge -from sklearn.preprocessing import PolynomialFeatures -from sklearn.pipeline import make_pipeline - - -def f(x): - """ function to approximate by polynomial interpolation""" - return x * np.sin(x) - - -# generate points used to plot -x_plot = np.linspace(0, 10, 100) - -# generate points and keep a subset of them -x = np.linspace(0, 10, 100) -rng = np.random.RandomState(0) -rng.shuffle(x) -x = np.sort(x[:20]) -y = f(x) - -# create matrix versions of these arrays -X = x[:, np.newaxis] -X_plot = x_plot[:, np.newaxis] - -plt.plot(x_plot, f(x_plot), label="ground truth") -plt.scatter(x, y, label="training points") - -for degree in [3, 4, 5]: - model = make_pipeline(PolynomialFeatures(degree), Ridge()) - model.fit(X, y) - y_plot = model.predict(X_plot) - plt.plot(x_plot, y_plot, label="degree %d" % degree) - -plt.legend(loc='lower left') - -plt.show() diff --git a/0.15/_downloads/plot_precision_recall.py b/0.15/_downloads/plot_precision_recall.py deleted file mode 100644 index 6617a6b5d88fa..0000000000000 --- a/0.15/_downloads/plot_precision_recall.py +++ /dev/null @@ -1,150 +0,0 @@ -""" -================ -Precision-Recall -================ - -Example of Precision-Recall metric to evaluate classifier output quality. - -In information retrieval, precision is a measure of result relevancy, while -recall is a measure of how many truly relevant results are returned. A high -area under the curve represents both high recall and high precision, where high -precision relates to a low false positive rate, and high recall relates to a -low false negative rate. High scores for both show that the classifier is -returning accurate results (high precision), as well as returning a majority of -all positive results (high recall). - -A system with high recall but low precision returns many results, but most of -its predicted labels are incorrect when compared to the training labels. A -system with high precision but low recall is just the opposite, returning very -few results, but most of its predicted labels are correct when compared to the -training labels. An ideal system with high precision and high recall will -return many results, with all results labeled correctly. - -Precision (:math:`P`) is defined as the number of true positives (:math:`T_p`) -over the number of true positives plus the number of false positives -(:math:`F_p`). - -:math:`P = \\frac{T_p}{T_p+F_p}` - -Recall (:math:`R`) is defined as the number of true positives (:math:`T_p`) -over the number of true positives plus the number of false negatives -(:math:`F_n`). - -:math:`R = \\frac{T_p}{T_p + F_n}` - -These quantities are also related to the (:math:`F_1`) score, which is defined -as the harmonic mean of precision and recall. - -:math:`F1 = 2\\frac{P \\times R}{P+R}` - -It is important to note that the precision may not decrease with recall. The -definition of precision (:math:`\\frac{T_p}{T_p + F_p}`) shows that lowering -the threshold of a classifier may increase the denominator, by increasing the -number of results returned. If the threshold was previously set too high, the -new results may all be true positives, which will increase precision. If the -previous threshold was about right or too low, further lowering the threshold -will introduce false positives, decreasing precision. - -Recall is defined as :math:`\\frac{T_p}{T_p+F_n}`, where :math:`T_p+F_n` does -not depend on the classifier threshold. This means that lowering the classifier -threshold may increase recall, by increasing the number of true positive -results. It is also possible that lowering the threshold may leave recall -unchanged, while the precision fluctuates. - -The relationship between recall and precision can be observed in the -stairstep area of the plot - at the edges of these steps a small change -in the threshold considerably reduces precision, with only a minor gain in -recall. See the corner at recall = .59, precision = .8 for an example of this -phenomenon. - -Precision-recall curves are typically used in binary classification to study -the output of a classifier. In order to extend Precision-recall curve and -average precision to multi-class or multi-label classification, it is necessary -to binarize the output. One curve can be drawn per label, but one can also draw -a precision-recall curve by considering each element of the label indicator -matrix as a binary prediction (micro-averaging). - -.. note:: - - See also :func:`sklearn.metrics.average_precision_score`, - :func:`sklearn.metrics.recall_score`, - :func:`sklearn.metrics.precision_score`, - :func:`sklearn.metrics.f1_score` -""" -print(__doc__) - -import matplotlib.pyplot as plt -import numpy as np -from sklearn import svm, datasets -from sklearn.metrics import precision_recall_curve -from sklearn.metrics import average_precision_score -from sklearn.cross_validation import train_test_split -from sklearn.preprocessing import label_binarize -from sklearn.multiclass import OneVsRestClassifier - -# import some data to play with -iris = datasets.load_iris() -X = iris.data -y = iris.target - -# Binarize the output -y = label_binarize(y, classes=[0, 1, 2]) -n_classes = y.shape[1] - -# Add noisy features -random_state = np.random.RandomState(0) -n_samples, n_features = X.shape -X = np.c_[X, random_state.randn(n_samples, 200 * n_features)] - -# Split into training and test -X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.5, - random_state=random_state) - -# Run classifier -classifier = OneVsRestClassifier(svm.SVC(kernel='linear', probability=True, - random_state=random_state)) -y_score = classifier.fit(X_train, y_train).decision_function(X_test) - -# Compute Precision-Recall and plot curve -precision = dict() -recall = dict() -average_precision = dict() -for i in range(n_classes): - precision[i], recall[i], _ = precision_recall_curve(y_test[:, i], - y_score[:, i]) - average_precision[i] = average_precision_score(y_test[:, i], y_score[:, i]) - -# Compute micro-average ROC curve and ROC area -precision["micro"], recall["micro"], _ = precision_recall_curve(y_test.ravel(), - y_score.ravel()) -average_precision["micro"] = average_precision_score(y_test, y_score, - average="micro") - -# Plot Precision-Recall curve -plt.clf() -plt.plot(recall[0], precision[0], label='Precision-Recall curve') -plt.xlabel('Recall') -plt.ylabel('Precision') -plt.ylim([0.0, 1.05]) -plt.xlim([0.0, 1.0]) -plt.title('Precision-Recall example: AUC={0:0.2f}'.format(average_precision[0])) -plt.legend(loc="lower left") -plt.show() - -# Plot Precision-Recall curve for each class -plt.clf() -plt.plot(recall["micro"], precision["micro"], - label='micro-average Precision-recall curve (area = {0:0.2f})' - ''.format(average_precision["micro"])) -for i in range(n_classes): - plt.plot(recall[i], precision[i], - label='Precision-recall curve of class {0} (area = {1:0.2f})' - ''.format(i, average_precision[i])) - -plt.xlim([0.0, 1.0]) -plt.ylim([0.0, 1.05]) -plt.xlabel('Recall') -plt.ylabel('Precision') -plt.title('Extension of Precision-Recall curve to multi-class') -plt.legend(loc="lower right") -plt.show() diff --git a/0.15/_downloads/plot_precision_recall1.py b/0.15/_downloads/plot_precision_recall1.py deleted file mode 100644 index 6617a6b5d88fa..0000000000000 --- a/0.15/_downloads/plot_precision_recall1.py +++ /dev/null @@ -1,150 +0,0 @@ -""" -================ -Precision-Recall -================ - -Example of Precision-Recall metric to evaluate classifier output quality. - -In information retrieval, precision is a measure of result relevancy, while -recall is a measure of how many truly relevant results are returned. A high -area under the curve represents both high recall and high precision, where high -precision relates to a low false positive rate, and high recall relates to a -low false negative rate. High scores for both show that the classifier is -returning accurate results (high precision), as well as returning a majority of -all positive results (high recall). - -A system with high recall but low precision returns many results, but most of -its predicted labels are incorrect when compared to the training labels. A -system with high precision but low recall is just the opposite, returning very -few results, but most of its predicted labels are correct when compared to the -training labels. An ideal system with high precision and high recall will -return many results, with all results labeled correctly. - -Precision (:math:`P`) is defined as the number of true positives (:math:`T_p`) -over the number of true positives plus the number of false positives -(:math:`F_p`). - -:math:`P = \\frac{T_p}{T_p+F_p}` - -Recall (:math:`R`) is defined as the number of true positives (:math:`T_p`) -over the number of true positives plus the number of false negatives -(:math:`F_n`). - -:math:`R = \\frac{T_p}{T_p + F_n}` - -These quantities are also related to the (:math:`F_1`) score, which is defined -as the harmonic mean of precision and recall. - -:math:`F1 = 2\\frac{P \\times R}{P+R}` - -It is important to note that the precision may not decrease with recall. The -definition of precision (:math:`\\frac{T_p}{T_p + F_p}`) shows that lowering -the threshold of a classifier may increase the denominator, by increasing the -number of results returned. If the threshold was previously set too high, the -new results may all be true positives, which will increase precision. If the -previous threshold was about right or too low, further lowering the threshold -will introduce false positives, decreasing precision. - -Recall is defined as :math:`\\frac{T_p}{T_p+F_n}`, where :math:`T_p+F_n` does -not depend on the classifier threshold. This means that lowering the classifier -threshold may increase recall, by increasing the number of true positive -results. It is also possible that lowering the threshold may leave recall -unchanged, while the precision fluctuates. - -The relationship between recall and precision can be observed in the -stairstep area of the plot - at the edges of these steps a small change -in the threshold considerably reduces precision, with only a minor gain in -recall. See the corner at recall = .59, precision = .8 for an example of this -phenomenon. - -Precision-recall curves are typically used in binary classification to study -the output of a classifier. In order to extend Precision-recall curve and -average precision to multi-class or multi-label classification, it is necessary -to binarize the output. One curve can be drawn per label, but one can also draw -a precision-recall curve by considering each element of the label indicator -matrix as a binary prediction (micro-averaging). - -.. note:: - - See also :func:`sklearn.metrics.average_precision_score`, - :func:`sklearn.metrics.recall_score`, - :func:`sklearn.metrics.precision_score`, - :func:`sklearn.metrics.f1_score` -""" -print(__doc__) - -import matplotlib.pyplot as plt -import numpy as np -from sklearn import svm, datasets -from sklearn.metrics import precision_recall_curve -from sklearn.metrics import average_precision_score -from sklearn.cross_validation import train_test_split -from sklearn.preprocessing import label_binarize -from sklearn.multiclass import OneVsRestClassifier - -# import some data to play with -iris = datasets.load_iris() -X = iris.data -y = iris.target - -# Binarize the output -y = label_binarize(y, classes=[0, 1, 2]) -n_classes = y.shape[1] - -# Add noisy features -random_state = np.random.RandomState(0) -n_samples, n_features = X.shape -X = np.c_[X, random_state.randn(n_samples, 200 * n_features)] - -# Split into training and test -X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.5, - random_state=random_state) - -# Run classifier -classifier = OneVsRestClassifier(svm.SVC(kernel='linear', probability=True, - random_state=random_state)) -y_score = classifier.fit(X_train, y_train).decision_function(X_test) - -# Compute Precision-Recall and plot curve -precision = dict() -recall = dict() -average_precision = dict() -for i in range(n_classes): - precision[i], recall[i], _ = precision_recall_curve(y_test[:, i], - y_score[:, i]) - average_precision[i] = average_precision_score(y_test[:, i], y_score[:, i]) - -# Compute micro-average ROC curve and ROC area -precision["micro"], recall["micro"], _ = precision_recall_curve(y_test.ravel(), - y_score.ravel()) -average_precision["micro"] = average_precision_score(y_test, y_score, - average="micro") - -# Plot Precision-Recall curve -plt.clf() -plt.plot(recall[0], precision[0], label='Precision-Recall curve') -plt.xlabel('Recall') -plt.ylabel('Precision') -plt.ylim([0.0, 1.05]) -plt.xlim([0.0, 1.0]) -plt.title('Precision-Recall example: AUC={0:0.2f}'.format(average_precision[0])) -plt.legend(loc="lower left") -plt.show() - -# Plot Precision-Recall curve for each class -plt.clf() -plt.plot(recall["micro"], precision["micro"], - label='micro-average Precision-recall curve (area = {0:0.2f})' - ''.format(average_precision["micro"])) -for i in range(n_classes): - plt.plot(recall[i], precision[i], - label='Precision-recall curve of class {0} (area = {1:0.2f})' - ''.format(i, average_precision[i])) - -plt.xlim([0.0, 1.0]) -plt.ylim([0.0, 1.05]) -plt.xlabel('Recall') -plt.ylabel('Precision') -plt.title('Extension of Precision-Recall curve to multi-class') -plt.legend(loc="lower right") -plt.show() diff --git a/0.15/_downloads/plot_prediction_latency.py b/0.15/_downloads/plot_prediction_latency.py deleted file mode 100644 index 23011f542bcaf..0000000000000 --- a/0.15/_downloads/plot_prediction_latency.py +++ /dev/null @@ -1,313 +0,0 @@ -""" -================== -Prediction Latency -================== - -This is an example showing the prediction latency of various scikit-learn -estimators. - -The goal is to measure the latency one can expect when doing predictions -either in bulk or atomic (i.e. one by one) mode. - -The plots represent the distribution of the prediction latency as a boxplot. - -""" - -# Authors: Eustache Diemert -# License: BSD 3 clause - -from __future__ import print_function -from collections import defaultdict - -import time -import gc -import numpy as np -import matplotlib.pyplot as plt - -from scipy.stats import scoreatpercentile -from sklearn.datasets.samples_generator import make_regression -from sklearn.ensemble.forest import RandomForestRegressor -from sklearn.linear_model.ridge import Ridge -from sklearn.linear_model.stochastic_gradient import SGDRegressor -from sklearn.svm.classes import SVR - - -def _not_in_sphinx(): - # Hack to detect whether we are running by the sphinx builder - return '__file__' in globals() - - -def atomic_benchmark_estimator(estimator, X_test, verbose=False): - """Measure runtime prediction of each instance.""" - n_instances = X_test.shape[0] - runtimes = np.zeros(n_instances, dtype=np.float) - for i in range(n_instances): - instance = X_test[i, :] - start = time.time() - estimator.predict(instance) - runtimes[i] = time.time() - start - if verbose: - print("atomic_benchmark runtimes:", min(runtimes), scoreatpercentile( - runtimes, 50), max(runtimes)) - return runtimes - - -def bulk_benchmark_estimator(estimator, X_test, n_bulk_repeats, verbose): - """Measure runtime prediction of the whole input.""" - n_instances = X_test.shape[0] - runtimes = np.zeros(n_bulk_repeats, dtype=np.float) - for i in range(n_bulk_repeats): - start = time.time() - estimator.predict(X_test) - runtimes[i] = time.time() - start - runtimes = np.array(list(map(lambda x: x / float(n_instances), runtimes))) - if verbose: - print("bulk_benchmark runtimes:", min(runtimes), scoreatpercentile( - runtimes, 50), max(runtimes)) - return runtimes - - -def benchmark_estimator(estimator, X_test, n_bulk_repeats=30, verbose=False): - """ - Measure runtimes of prediction in both atomic and bulk mode. - - Parameters - ---------- - estimator : already trained estimator supporting `predict()` - X_test : test input - n_bulk_repeats : how many times to repeat when evaluating bulk mode - - Returns - ------- - atomic_runtimes, bulk_runtimes : a pair of `np.array` which contain the - runtimes in seconds. - - """ - atomic_runtimes = atomic_benchmark_estimator(estimator, X_test, verbose) - bulk_runtimes = bulk_benchmark_estimator(estimator, X_test, n_bulk_repeats, - verbose) - return atomic_runtimes, bulk_runtimes - - -def generate_dataset(n_train, n_test, n_features, noise=0.1, verbose=False): - """Generate a regression dataset with the given parameters.""" - if verbose: - print("generating dataset...") - X, y, coef = make_regression(n_samples=n_train + n_test, - n_features=n_features, noise=noise, coef=True) - X_train = X[:n_train] - y_train = y[:n_train] - X_test = X[n_train:] - y_test = y[n_train:] - idx = np.arange(n_train) - np.random.seed(13) - np.random.shuffle(idx) - X_train = X_train[idx] - y_train = y_train[idx] - - std = X_train.std(axis=0) - mean = X_train.mean(axis=0) - X_train = (X_train - mean) / std - X_test = (X_test - mean) / std - - std = y_train.std(axis=0) - mean = y_train.mean(axis=0) - y_train = (y_train - mean) / std - y_test = (y_test - mean) / std - - gc.collect() - if verbose: - print("ok") - return X_train, y_train, X_test, y_test - - -def boxplot_runtimes(runtimes, pred_type, configuration): - """ - Plot a new `Figure` with boxplots of prediction runtimes. - - Parameters - ---------- - runtimes : list of `np.array` of latencies in micro-seconds - cls_names : list of estimator class names that generated the runtimes - pred_type : 'bulk' or 'atomic' - - """ - fig, ax1 = plt.subplots(figsize=(10, 6)) - bp = plt.boxplot(runtimes, ) - - cls_infos = ['%s\n(%d %s)' % (estimator_conf['name'], - estimator_conf['complexity_computer']( - estimator_conf['instance']), - estimator_conf['complexity_label']) for - estimator_conf in configuration['estimators']] - xtick_names = plt.setp(ax1, xticklabels=cls_infos) - plt.setp(xtick_names) - - plt.setp(bp['boxes'], color='black') - plt.setp(bp['whiskers'], color='black') - plt.setp(bp['fliers'], color='red', marker='+') - - ax1.yaxis.grid(True, linestyle='-', which='major', color='lightgrey', - alpha=0.5) - - ax1.set_axisbelow(True) - ax1.set_title('Prediction Time per Instance - %s, %d feats.' % ( - pred_type.capitalize(), - configuration['n_features'])) - ax1.set_ylabel('Prediction Time (us)') - - plt.show() - - -def benchmark(configuration): - """Run the whole benchmark.""" - X_train, y_train, X_test, y_test = generate_dataset( - configuration['n_train'], configuration['n_test'], - configuration['n_features']) - - stats = {} - for estimator_conf in configuration['estimators']: - print("Benchmarking", estimator_conf['instance']) - estimator_conf['instance'].fit(X_train, y_train) - gc.collect() - a, b = benchmark_estimator(estimator_conf['instance'], X_test) - stats[estimator_conf['name']] = {'atomic': a, 'bulk': b} - - cls_names = [estimator_conf['name'] for estimator_conf in configuration[ - 'estimators']] - runtimes = [1e6 * stats[clf_name]['atomic'] for clf_name in cls_names] - boxplot_runtimes(runtimes, 'atomic', configuration) - runtimes = [1e6 * stats[clf_name]['bulk'] for clf_name in cls_names] - boxplot_runtimes(runtimes, 'bulk (%d)' % configuration['n_test'], - configuration) - - -def n_feature_influence(estimators, n_train, n_test, n_features, percentile): - """ - Estimate influence of the number of features on prediction time. - - Parameters - ---------- - - estimators : dict of (name (str), estimator) to benchmark - n_train : nber of training instances (int) - n_test : nber of testing instances (int) - n_features : list of feature-space dimensionality to test (int) - percentile : percentile at which to measure the speed (int [0-100]) - - Returns: - -------- - - percentiles : dict(estimator_name, - dict(n_features, percentile_perf_in_us)) - - """ - percentiles = defaultdict(defaultdict) - for n in n_features: - print("benchmarking with %d features" % n) - X_train, y_train, X_test, y_test = generate_dataset(n_train, n_test, n) - for cls_name, estimator in estimators.items(): - estimator.fit(X_train, y_train) - gc.collect() - runtimes = bulk_benchmark_estimator(estimator, X_test, 30, False) - percentiles[cls_name][n] = 1e6 * scoreatpercentile(runtimes, - percentile) - return percentiles - - -def plot_n_features_influence(percentiles, percentile): - fig, ax1 = plt.subplots(figsize=(10, 6)) - colors = ['r', 'g', 'b'] - for i, cls_name in enumerate(percentiles.keys()): - x = np.array(sorted([n for n in percentiles[cls_name].keys()])) - y = np.array([percentiles[cls_name][n] for n in x]) - plt.plot(x, y, color=colors[i], ) - ax1.yaxis.grid(True, linestyle='-', which='major', color='lightgrey', - alpha=0.5) - ax1.set_axisbelow(True) - ax1.set_title('Evolution of Prediction Time with #Features') - ax1.set_xlabel('#Features') - ax1.set_ylabel('Prediction Time at %d%%-ile (us)' % percentile) - plt.show() - - -def benchmark_throughputs(configuration, duration_secs=0.1): - """benchmark throughput for different estimators.""" - X_train, y_train, X_test, y_test = generate_dataset( - configuration['n_train'], configuration['n_test'], - configuration['n_features']) - throughputs = dict() - for estimator_config in configuration['estimators']: - estimator_config['instance'].fit(X_train, y_train) - start_time = time.time() - n_predictions = 0 - while (time.time() - start_time) < duration_secs: - estimator_config['instance'].predict(X_test[0]) - n_predictions += 1 - throughputs[estimator_config['name']] = n_predictions / duration_secs - return throughputs - - -def plot_benchmark_throughput(throughputs, configuration): - fig, ax = plt.subplots(figsize=(10, 6)) - colors = ['r', 'g', 'b'] - cls_infos = ['%s\n(%d %s)' % (estimator_conf['name'], - estimator_conf['complexity_computer']( - estimator_conf['instance']), - estimator_conf['complexity_label']) for - estimator_conf in configuration['estimators']] - cls_values = [throughputs[estimator_conf['name']] for estimator_conf in - configuration['estimators']] - plt.bar(range(len(throughputs)), cls_values, width=0.5, color=colors) - ax.set_xticks(np.linspace(0.25, len(throughputs) - 0.75, len(throughputs))) - ax.set_xticklabels(cls_infos, fontsize=10) - ymax = max(cls_values) * 1.2 - ax.set_ylim((0, ymax)) - ax.set_ylabel('Throughput (predictions/sec)') - ax.set_title('Prediction Throughput for different estimators (%d ' - 'features)' % configuration['n_features']) - plt.show() - - -############################################################################### -# main code - -start_time = time.time() - -# benchmark bulk/atomic prediction speed for various regressors -configuration = { - 'n_train': int(1e3), - 'n_test': int(1e2), - 'n_features': int(1e2), - 'estimators': [ - {'name': 'Linear Model', - 'instance': SGDRegressor(penalty='elasticnet', alpha=0.01, - l1_ratio=0.25, fit_intercept=True), - 'complexity_label': 'non-zero coefficients', - 'complexity_computer': lambda clf: np.count_nonzero(clf.coef_)}, - {'name': 'RandomForest', - 'instance': RandomForestRegressor(), - 'complexity_label': 'estimators', - 'complexity_computer': lambda clf: clf.n_estimators}, - {'name': 'SVR', - 'instance': SVR(kernel='rbf'), - 'complexity_label': 'support vectors', - 'complexity_computer': lambda clf: len(clf.support_vectors_)}, - ] -} -benchmark(configuration) - -# benchmark n_features influence on prediction speed -percentile = 90 -percentiles = n_feature_influence({'ridge': Ridge()}, - configuration['n_train'], - configuration['n_test'], - [100, 250, 500], percentile) -plot_n_features_influence(percentiles, percentile) - -# benchmark throughput -throughputs = benchmark_throughputs(configuration) -plot_benchmark_throughput(throughputs, configuration) - -stop_time = time.time() -print("example run in %.2fs" % (stop_time - start_time)) diff --git a/0.15/_downloads/plot_random_dataset.py b/0.15/_downloads/plot_random_dataset.py deleted file mode 100644 index be5108754c145..0000000000000 --- a/0.15/_downloads/plot_random_dataset.py +++ /dev/null @@ -1,49 +0,0 @@ -""" -============================================== -Plot randomly generated classification dataset -============================================== - -Plot several randomly generated 2D classification datasets. -This example illustrates the `datasets.make_classification` -function. - -Three binary and two multi-class classification datasets -are generated, with different numbers of informative -features and clusters per class. -""" - -print(__doc__) - -import matplotlib.pyplot as plt - -from sklearn.datasets import make_classification - -plt.figure(figsize=(8, 6)) -plt.subplots_adjust(bottom=.05, top=.9, left=.05, right=.95) - -plt.subplot(221) -plt.title("One informative feature, one cluster", fontsize='small') -X1, Y1 = make_classification(n_features=2, n_redundant=0, n_informative=1, - n_clusters_per_class=1) -plt.scatter(X1[:, 0], X1[:, 1], marker='o', c=Y1) - -plt.subplot(222) -plt.title("Two informative features, one cluster", fontsize='small') -X1, Y1 = make_classification(n_features=2, n_redundant=0, n_informative=2, - n_clusters_per_class=1) -plt.scatter(X1[:, 0], X1[:, 1], marker='o', c=Y1) - -plt.subplot(223) -plt.title("Two informative features, two clusters", fontsize='small') -X2, Y2 = make_classification(n_features=2, n_redundant=0, n_informative=2) -plt.scatter(X2[:, 0], X2[:, 1], marker='o', c=Y2) - - -plt.subplot(224) -plt.title("Multi-class, two informative features, one cluster", - fontsize='small') -X1, Y1 = make_classification(n_features=2, n_redundant=0, n_informative=2, - n_clusters_per_class=1, n_classes=3) -plt.scatter(X1[:, 0], X1[:, 1], marker='o', c=Y1) - -plt.show() diff --git a/0.15/_downloads/plot_random_forest_embedding.py b/0.15/_downloads/plot_random_forest_embedding.py deleted file mode 100644 index ba6329d72905b..0000000000000 --- a/0.15/_downloads/plot_random_forest_embedding.py +++ /dev/null @@ -1,105 +0,0 @@ -""" -========================================================= -Hashing feature transformation using Totally Random Trees -========================================================= - -RandomTreesEmbedding provides a way to map data to a -very high-dimensional, sparse representation, which might -be beneficial for classification. -The mapping is completely unsupervised and very efficient. - -This example visualizes the partitions given by several -trees and shows how the transformation can also be used for -non-linear dimensionality reduction or non-linear classification. - -Points that are neighboring often share the same leaf of a tree and therefore -share large parts of their hashed representation. This allows to -separate two concentric circles simply based on the principal components of the -transformed data. - -In high-dimensional spaces, linear classifiers often achieve -excellent accuracy. For sparse binary data, BernoulliNB -is particularly well-suited. The bottom row compares the -decision boundary obtained by BernoulliNB in the transformed -space with an ExtraTreesClassifier forests learned on the -original data. -""" -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.datasets import make_circles -from sklearn.ensemble import RandomTreesEmbedding, ExtraTreesClassifier -from sklearn.decomposition import TruncatedSVD -from sklearn.naive_bayes import BernoulliNB - -# make a synthetic dataset -X, y = make_circles(factor=0.5, random_state=0, noise=0.05) - -# use RandomTreesEmbedding to transform data -hasher = RandomTreesEmbedding(n_estimators=10, random_state=0, max_depth=3) -X_transformed = hasher.fit_transform(X) - -# Visualize result using PCA -pca = TruncatedSVD(n_components=2) -X_reduced = pca.fit_transform(X_transformed) - -# Learn a Naive Bayes classifier on the transformed data -nb = BernoulliNB() -nb.fit(X_transformed, y) - - -# Learn an ExtraTreesClassifier for comparison -trees = ExtraTreesClassifier(max_depth=3, n_estimators=10, random_state=0) -trees.fit(X, y) - - -# scatter plot of original and reduced data -fig = plt.figure(figsize=(9, 8)) - -ax = plt.subplot(221) -ax.scatter(X[:, 0], X[:, 1], c=y, s=50) -ax.set_title("Original Data (2d)") -ax.set_xticks(()) -ax.set_yticks(()) - -ax = plt.subplot(222) -ax.scatter(X_reduced[:, 0], X_reduced[:, 1], c=y, s=50) -ax.set_title("PCA reduction (2d) of transformed data (%dd)" % - X_transformed.shape[1]) -ax.set_xticks(()) -ax.set_yticks(()) - -# Plot the decision in original space. For that, we will assign a color to each -# point in the mesh [x_min, m_max] x [y_min, y_max]. -h = .01 -x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5 -y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5 -xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h)) - -# transform grid using RandomTreesEmbedding -transformed_grid = hasher.transform(np.c_[xx.ravel(), yy.ravel()]) -y_grid_pred = nb.predict_proba(transformed_grid)[:, 1] - -ax = plt.subplot(223) -ax.set_title("Naive Bayes on Transformed data") -ax.pcolormesh(xx, yy, y_grid_pred.reshape(xx.shape)) -ax.scatter(X[:, 0], X[:, 1], c=y, s=50) -ax.set_ylim(-1.4, 1.4) -ax.set_xlim(-1.4, 1.4) -ax.set_xticks(()) -ax.set_yticks(()) - -# transform grid using ExtraTreesClassifier -y_grid_pred = trees.predict_proba(np.c_[xx.ravel(), yy.ravel()])[:, 1] - -ax = plt.subplot(224) -ax.set_title("ExtraTrees predictions") -ax.pcolormesh(xx, yy, y_grid_pred.reshape(xx.shape)) -ax.scatter(X[:, 0], X[:, 1], c=y, s=50) -ax.set_ylim(-1.4, 1.4) -ax.set_xlim(-1.4, 1.4) -ax.set_xticks(()) -ax.set_yticks(()) - -plt.tight_layout() -plt.show() diff --git a/0.15/_downloads/plot_random_multilabel_dataset.py b/0.15/_downloads/plot_random_multilabel_dataset.py deleted file mode 100644 index 4137a79bf5630..0000000000000 --- a/0.15/_downloads/plot_random_multilabel_dataset.py +++ /dev/null @@ -1,96 +0,0 @@ -""" -============================================== -Plot randomly generated multilabel dataset -============================================== - -This illustrates the `datasets.make_multilabel_classification` dataset -generator. Each sample consists of counts of two features (up to 50 in -total), which are differently distributed in each of two classes. - -Points are labeled as follows, where Y means the class is present: - - ===== ===== ===== ====== - 1 2 3 Color - ===== ===== ===== ====== - Y N N Red - N Y N Blue - N N Y Yellow - Y Y N Purple - Y N Y Orange - Y Y N Green - Y Y Y Brown - ===== ===== ===== ====== - -A star marks the expected sample for each class; its size reflects the -probability of selecting that class label. - -The left and right examples highlight the ``n_labels`` parameter: -more of the samples in the right plot have 2 or 3 labels. - -Note that this two-dimensional example is very degenerate: -generally the number of features would be much greater than the -"document length", while here we have much larger documents than vocabulary. -Similarly, with ``n_classes > n_features``, it is much less likely that a -feature distinguishes a particular class. -""" - -from __future__ import print_function -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.datasets import make_multilabel_classification as make_ml_clf - -print(__doc__) - -COLORS = np.array(['!', - '#FF3333', # red - '#0198E1', # blue - '#BF5FFF', # purple - '#FCD116', # yellow - '#FF7216', # orange - '#4DBD33', # green - '#87421F' # brown - ]) - -# Use same random seed for multiple calls to make_multilabel_classification to -# ensure same distributions -RANDOM_SEED = np.random.randint(2 ** 10) - - -def plot_2d(ax, n_labels=1, n_classes=3, length=50): - X, Y, p_c, p_w_c = make_ml_clf(n_samples=150, n_features=2, - n_classes=n_classes, n_labels=n_labels, - length=length, allow_unlabeled=False, - return_indicator=True, - return_distributions=True, - random_state=RANDOM_SEED) - - ax.scatter(X[:, 0], X[:, 1], color=COLORS.take((Y * [1, 2, 4] - ).sum(axis=1)), - marker='.') - ax.scatter(p_w_c[0] * length, p_w_c[1] * length, - marker='*', linewidth=.5, edgecolor='black', - s=20 + 1500 * p_c ** 2, - color=COLORS.take([1, 2, 4])) - ax.set_xlabel('Feature 0 count') - return p_c, p_w_c - - -_, (ax1, ax2) = plt.subplots(1, 2, sharex='row', sharey='row', figsize=(8, 4)) -plt.subplots_adjust(bottom=.15) - -p_c, p_w_c = plot_2d(ax1, n_labels=1) -ax1.set_title('n_labels=1, length=50') -ax1.set_ylabel('Feature 1 count') - -plot_2d(ax2, n_labels=3) -ax2.set_title('n_labels=3, length=50') -ax2.set_xlim(left=0, auto=True) -ax2.set_ylim(bottom=0, auto=True) - -plt.show() - -print('The data was generated from (random_state=%d):' % RANDOM_SEED) -print('Class', 'P(C)', 'P(w0|C)', 'P(w1|C)', sep='\t') -for k, p, p_w in zip(['red', 'blue', 'yellow'], p_c, p_w_c.T): - print('%s\t%0.2f\t%0.2f\t%0.2f' % (k, p, p_w[0], p_w[1])) diff --git a/0.15/_downloads/plot_ransac.py b/0.15/_downloads/plot_ransac.py deleted file mode 100644 index 5e93e55290bdb..0000000000000 --- a/0.15/_downloads/plot_ransac.py +++ /dev/null @@ -1,53 +0,0 @@ -""" -=========================================== -Robust linear model estimation using RANSAC -=========================================== - -In this example we see how to robustly fit a linear model to faulty data using -the RANSAC algorithm. - -""" -import numpy as np -from matplotlib import pyplot as plt - -from sklearn import linear_model, datasets - - -n_samples = 1000 -n_outliers = 50 - - -X, y, coef = datasets.make_regression(n_samples=n_samples, n_features=1, - n_informative=1, noise=10, - coef=True, random_state=0) - -# Add outlier data -np.random.seed(0) -X[:n_outliers] = 3 + 0.5 * np.random.normal(size=(n_outliers, 1)) -y[:n_outliers] = -3 + 10 * np.random.normal(size=n_outliers) - -# Fit line using all data -model = linear_model.LinearRegression() -model.fit(X, y) - -# Robustly fit linear model with RANSAC algorithm -model_ransac = linear_model.RANSACRegressor(linear_model.LinearRegression()) -model_ransac.fit(X, y) -inlier_mask = model_ransac.inlier_mask_ -outlier_mask = np.logical_not(inlier_mask) - -# Predict data of estimated models -line_X = np.arange(-5, 5) -line_y = model.predict(line_X[:, np.newaxis]) -line_y_ransac = model_ransac.predict(line_X[:, np.newaxis]) - -# Compare estimated coefficients -print("Estimated coefficients (true, normal, RANSAC):") -print(coef, model.coef_, model_ransac.estimator_.coef_) - -plt.plot(X[inlier_mask], y[inlier_mask], '.g', label='Inliers') -plt.plot(X[outlier_mask], y[outlier_mask], '.r', label='Outliers') -plt.plot(line_X, line_y, '-k', label='Linear regressor') -plt.plot(line_X, line_y_ransac, '-b', label='RANSAC regressor') -plt.legend(loc='lower right') -plt.show() diff --git a/0.15/_downloads/plot_rbf_parameters.py b/0.15/_downloads/plot_rbf_parameters.py deleted file mode 100644 index 072f4559d56f3..0000000000000 --- a/0.15/_downloads/plot_rbf_parameters.py +++ /dev/null @@ -1,127 +0,0 @@ -''' -================== -RBF SVM parameters -================== - -This example illustrates the effect of the parameters `gamma` -and `C` of the rbf kernel SVM. - -Intuitively, the `gamma` parameter defines how far the influence -of a single training example reaches, with low values meaning 'far' -and high values meaning 'close'. -The `C` parameter trades off misclassification of training examples -against simplicity of the decision surface. A low C makes -the decision surface smooth, while a high C aims at classifying -all training examples correctly. - -Two plots are generated. The first is a visualization of the -decision function for a variety of parameter values, and the second -is a heatmap of the classifier's cross-validation accuracy as -a function of `C` and `gamma`. For this example we explore a relatively -large grid for illustration purposes. In practice, a logarithmic -grid from `10**-3` to `10**3` is usually sufficient. -''' -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.svm import SVC -from sklearn.preprocessing import StandardScaler -from sklearn.datasets import load_iris -from sklearn.cross_validation import StratifiedKFold -from sklearn.grid_search import GridSearchCV - -############################################################################## -# Load and prepare data set -# -# dataset for grid search -iris = load_iris() -X = iris.data -Y = iris.target - -# dataset for decision function visualization -X_2d = X[:, :2] -X_2d = X_2d[Y > 0] -Y_2d = Y[Y > 0] -Y_2d -= 1 - -# It is usually a good idea to scale the data for SVM training. -# We are cheating a bit in this example in scaling all of the data, -# instead of fitting the transformation on the training set and -# just applying it on the test set. - -scaler = StandardScaler() - -X = scaler.fit_transform(X) -X_2d = scaler.fit_transform(X_2d) - -############################################################################## -# Train classifier -# -# For an initial search, a logarithmic grid with basis -# 10 is often helpful. Using a basis of 2, a finer -# tuning can be achieved but at a much higher cost. - -C_range = 10.0 ** np.arange(-2, 9) -gamma_range = 10.0 ** np.arange(-5, 4) -param_grid = dict(gamma=gamma_range, C=C_range) -cv = StratifiedKFold(y=Y, n_folds=3) -grid = GridSearchCV(SVC(), param_grid=param_grid, cv=cv) -grid.fit(X, Y) - -print("The best classifier is: ", grid.best_estimator_) - -# Now we need to fit a classifier for all parameters in the 2d version -# (we use a smaller set of parameters here because it takes a while to train) -C_2d_range = [1, 1e2, 1e4] -gamma_2d_range = [1e-1, 1, 1e1] -classifiers = [] -for C in C_2d_range: - for gamma in gamma_2d_range: - clf = SVC(C=C, gamma=gamma) - clf.fit(X_2d, Y_2d) - classifiers.append((C, gamma, clf)) - -############################################################################## -# visualization -# -# draw visualization of parameter effects -plt.figure(figsize=(8, 6)) -xx, yy = np.meshgrid(np.linspace(-5, 5, 200), np.linspace(-5, 5, 200)) -for (k, (C, gamma, clf)) in enumerate(classifiers): - # evaluate decision function in a grid - Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) - Z = Z.reshape(xx.shape) - - # visualize decision function for these parameters - plt.subplot(len(C_2d_range), len(gamma_2d_range), k + 1) - plt.title("gamma 10^%d, C 10^%d" % (np.log10(gamma), np.log10(C)), - size='medium') - - # visualize parameter's effect on decision function - plt.pcolormesh(xx, yy, -Z, cmap=plt.cm.jet) - plt.scatter(X_2d[:, 0], X_2d[:, 1], c=Y_2d, cmap=plt.cm.jet) - plt.xticks(()) - plt.yticks(()) - plt.axis('tight') - -# plot the scores of the grid -# grid_scores_ contains parameter settings and scores -score_dict = grid.grid_scores_ - -# We extract just the scores -scores = [x[1] for x in score_dict] -scores = np.array(scores).reshape(len(C_range), len(gamma_range)) - -# draw heatmap of accuracy as a function of gamma and C -plt.figure(figsize=(8, 6)) -plt.subplots_adjust(left=0.05, right=0.95, bottom=0.15, top=0.95) -plt.imshow(scores, interpolation='nearest', cmap=plt.cm.spectral) -plt.xlabel('gamma') -plt.ylabel('C') -plt.colorbar() -plt.xticks(np.arange(len(gamma_range)), gamma_range, rotation=45) -plt.yticks(np.arange(len(C_range)), C_range) - -plt.show() diff --git a/0.15/_downloads/plot_rbm_logistic_classification.py b/0.15/_downloads/plot_rbm_logistic_classification.py deleted file mode 100644 index 9f085036d2013..0000000000000 --- a/0.15/_downloads/plot_rbm_logistic_classification.py +++ /dev/null @@ -1,141 +0,0 @@ -""" -============================================================== -Restricted Boltzmann Machine features for digit classification -============================================================== - -For greyscale image data where pixel values can be interpreted as degrees of -blackness on a white background, like handwritten digit recognition, the -Bernoulli Restricted Boltzmann machine model (:class:`BernoulliRBM -`) can perform effective non-linear -feature extraction. - -In order to learn good latent representations from a small dataset, we -artificially generate more labeled data by perturbing the training data with -linear shifts of 1 pixel in each direction. - -This example shows how to build a classification pipeline with a BernoulliRBM -feature extractor and a :class:`LogisticRegression -` classifier. The hyperparameters -of the entire model (learning rate, hidden layer size, regularization) -were optimized by grid search, but the search is not reproduced here because -of runtime constraints. - -Logistic regression on raw pixel values is presented for comparison. The -example shows that the features extracted by the BernoulliRBM help improve the -classification accuracy. -""" - -from __future__ import print_function - -print(__doc__) - -# Authors: Yann N. Dauphin, Vlad Niculae, Gabriel Synnaeve -# License: BSD - -import numpy as np -import matplotlib.pyplot as plt - -from scipy.ndimage import convolve -from sklearn import linear_model, datasets, metrics -from sklearn.cross_validation import train_test_split -from sklearn.neural_network import BernoulliRBM -from sklearn.pipeline import Pipeline - - -############################################################################### -# Setting up - -def nudge_dataset(X, Y): - """ - This produces a dataset 5 times bigger than the original one, - by moving the 8x8 images in X around by 1px to left, right, down, up - """ - direction_vectors = [ - [[0, 1, 0], - [0, 0, 0], - [0, 0, 0]], - - [[0, 0, 0], - [1, 0, 0], - [0, 0, 0]], - - [[0, 0, 0], - [0, 0, 1], - [0, 0, 0]], - - [[0, 0, 0], - [0, 0, 0], - [0, 1, 0]]] - - shift = lambda x, w: convolve(x.reshape((8, 8)), mode='constant', - weights=w).ravel() - X = np.concatenate([X] + - [np.apply_along_axis(shift, 1, X, vector) - for vector in direction_vectors]) - Y = np.concatenate([Y for _ in range(5)], axis=0) - return X, Y - -# Load Data -digits = datasets.load_digits() -X = np.asarray(digits.data, 'float32') -X, Y = nudge_dataset(X, digits.target) -X = (X - np.min(X, 0)) / (np.max(X, 0) + 0.0001) # 0-1 scaling - -X_train, X_test, Y_train, Y_test = train_test_split(X, Y, - test_size=0.2, - random_state=0) - -# Models we will use -logistic = linear_model.LogisticRegression() -rbm = BernoulliRBM(random_state=0, verbose=True) - -classifier = Pipeline(steps=[('rbm', rbm), ('logistic', logistic)]) - -############################################################################### -# Training - -# Hyper-parameters. These were set by cross-validation, -# using a GridSearchCV. Here we are not performing cross-validation to -# save time. -rbm.learning_rate = 0.06 -rbm.n_iter = 20 -# More components tend to give better prediction performance, but larger -# fitting time -rbm.n_components = 100 -logistic.C = 6000.0 - -# Training RBM-Logistic Pipeline -classifier.fit(X_train, Y_train) - -# Training Logistic regression -logistic_classifier = linear_model.LogisticRegression(C=100.0) -logistic_classifier.fit(X_train, Y_train) - -############################################################################### -# Evaluation - -print() -print("Logistic regression using RBM features:\n%s\n" % ( - metrics.classification_report( - Y_test, - classifier.predict(X_test)))) - -print("Logistic regression using raw pixel features:\n%s\n" % ( - metrics.classification_report( - Y_test, - logistic_classifier.predict(X_test)))) - -############################################################################### -# Plotting - -plt.figure(figsize=(4.2, 4)) -for i, comp in enumerate(rbm.components_): - plt.subplot(10, 10, i + 1) - plt.imshow(comp.reshape((8, 8)), cmap=plt.cm.gray_r, - interpolation='nearest') - plt.xticks(()) - plt.yticks(()) -plt.suptitle('100 components extracted by RBM', fontsize=16) -plt.subplots_adjust(0.08, 0.02, 0.92, 0.85, 0.08, 0.23) - -plt.show() diff --git a/0.15/_downloads/plot_rbm_logistic_classification1.py b/0.15/_downloads/plot_rbm_logistic_classification1.py deleted file mode 100644 index 9f085036d2013..0000000000000 --- a/0.15/_downloads/plot_rbm_logistic_classification1.py +++ /dev/null @@ -1,141 +0,0 @@ -""" -============================================================== -Restricted Boltzmann Machine features for digit classification -============================================================== - -For greyscale image data where pixel values can be interpreted as degrees of -blackness on a white background, like handwritten digit recognition, the -Bernoulli Restricted Boltzmann machine model (:class:`BernoulliRBM -`) can perform effective non-linear -feature extraction. - -In order to learn good latent representations from a small dataset, we -artificially generate more labeled data by perturbing the training data with -linear shifts of 1 pixel in each direction. - -This example shows how to build a classification pipeline with a BernoulliRBM -feature extractor and a :class:`LogisticRegression -` classifier. The hyperparameters -of the entire model (learning rate, hidden layer size, regularization) -were optimized by grid search, but the search is not reproduced here because -of runtime constraints. - -Logistic regression on raw pixel values is presented for comparison. The -example shows that the features extracted by the BernoulliRBM help improve the -classification accuracy. -""" - -from __future__ import print_function - -print(__doc__) - -# Authors: Yann N. Dauphin, Vlad Niculae, Gabriel Synnaeve -# License: BSD - -import numpy as np -import matplotlib.pyplot as plt - -from scipy.ndimage import convolve -from sklearn import linear_model, datasets, metrics -from sklearn.cross_validation import train_test_split -from sklearn.neural_network import BernoulliRBM -from sklearn.pipeline import Pipeline - - -############################################################################### -# Setting up - -def nudge_dataset(X, Y): - """ - This produces a dataset 5 times bigger than the original one, - by moving the 8x8 images in X around by 1px to left, right, down, up - """ - direction_vectors = [ - [[0, 1, 0], - [0, 0, 0], - [0, 0, 0]], - - [[0, 0, 0], - [1, 0, 0], - [0, 0, 0]], - - [[0, 0, 0], - [0, 0, 1], - [0, 0, 0]], - - [[0, 0, 0], - [0, 0, 0], - [0, 1, 0]]] - - shift = lambda x, w: convolve(x.reshape((8, 8)), mode='constant', - weights=w).ravel() - X = np.concatenate([X] + - [np.apply_along_axis(shift, 1, X, vector) - for vector in direction_vectors]) - Y = np.concatenate([Y for _ in range(5)], axis=0) - return X, Y - -# Load Data -digits = datasets.load_digits() -X = np.asarray(digits.data, 'float32') -X, Y = nudge_dataset(X, digits.target) -X = (X - np.min(X, 0)) / (np.max(X, 0) + 0.0001) # 0-1 scaling - -X_train, X_test, Y_train, Y_test = train_test_split(X, Y, - test_size=0.2, - random_state=0) - -# Models we will use -logistic = linear_model.LogisticRegression() -rbm = BernoulliRBM(random_state=0, verbose=True) - -classifier = Pipeline(steps=[('rbm', rbm), ('logistic', logistic)]) - -############################################################################### -# Training - -# Hyper-parameters. These were set by cross-validation, -# using a GridSearchCV. Here we are not performing cross-validation to -# save time. -rbm.learning_rate = 0.06 -rbm.n_iter = 20 -# More components tend to give better prediction performance, but larger -# fitting time -rbm.n_components = 100 -logistic.C = 6000.0 - -# Training RBM-Logistic Pipeline -classifier.fit(X_train, Y_train) - -# Training Logistic regression -logistic_classifier = linear_model.LogisticRegression(C=100.0) -logistic_classifier.fit(X_train, Y_train) - -############################################################################### -# Evaluation - -print() -print("Logistic regression using RBM features:\n%s\n" % ( - metrics.classification_report( - Y_test, - classifier.predict(X_test)))) - -print("Logistic regression using raw pixel features:\n%s\n" % ( - metrics.classification_report( - Y_test, - logistic_classifier.predict(X_test)))) - -############################################################################### -# Plotting - -plt.figure(figsize=(4.2, 4)) -for i, comp in enumerate(rbm.components_): - plt.subplot(10, 10, i + 1) - plt.imshow(comp.reshape((8, 8)), cmap=plt.cm.gray_r, - interpolation='nearest') - plt.xticks(()) - plt.yticks(()) -plt.suptitle('100 components extracted by RBM', fontsize=16) -plt.subplots_adjust(0.08, 0.02, 0.92, 0.85, 0.08, 0.23) - -plt.show() diff --git a/0.15/_downloads/plot_regression.py b/0.15/_downloads/plot_regression.py deleted file mode 100644 index c664d7f173b0e..0000000000000 --- a/0.15/_downloads/plot_regression.py +++ /dev/null @@ -1,49 +0,0 @@ -""" -============================ -Nearest Neighbors regression -============================ - -Demonstrate the resolution of a regression problem -using a k-Nearest Neighbor and the interpolation of the -target using both barycenter and constant weights. - -""" -print(__doc__) - -# Author: Alexandre Gramfort -# Fabian Pedregosa -# -# License: BSD 3 clause (C) INRIA - - -############################################################################### -# Generate sample data -import numpy as np -import matplotlib.pyplot as plt -from sklearn import neighbors - -np.random.seed(0) -X = np.sort(5 * np.random.rand(40, 1), axis=0) -T = np.linspace(0, 5, 500)[:, np.newaxis] -y = np.sin(X).ravel() - -# Add noise to targets -y[::5] += 1 * (0.5 - np.random.rand(8)) - -############################################################################### -# Fit regression model -n_neighbors = 5 - -for i, weights in enumerate(['uniform', 'distance']): - knn = neighbors.KNeighborsRegressor(n_neighbors, weights=weights) - y_ = knn.fit(X, y).predict(T) - - plt.subplot(2, 1, i + 1) - plt.scatter(X, y, c='k', label='data') - plt.plot(T, y_, c='g', label='prediction') - plt.axis('tight') - plt.legend() - plt.title("KNeighborsRegressor (k = %i, weights = '%s')" % (n_neighbors, - weights)) - -plt.show() diff --git a/0.15/_downloads/plot_rfe_digits.py b/0.15/_downloads/plot_rfe_digits.py deleted file mode 100644 index bcbf28c7d78ca..0000000000000 --- a/0.15/_downloads/plot_rfe_digits.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -============================= -Recursive feature elimination -============================= - -A recursive feature elimination example showing the relevance of pixels in -a digit classification task. - -.. note:: - - See also :ref:`example_feature_selection_plot_rfe_with_cross_validation.py` - -""" -print(__doc__) - -from sklearn.svm import SVC -from sklearn.datasets import load_digits -from sklearn.feature_selection import RFE -import matplotlib.pyplot as plt - -# Load the digits dataset -digits = load_digits() -X = digits.images.reshape((len(digits.images), -1)) -y = digits.target - -# Create the RFE object and rank each pixel -svc = SVC(kernel="linear", C=1) -rfe = RFE(estimator=svc, n_features_to_select=1, step=1) -rfe.fit(X, y) -ranking = rfe.ranking_.reshape(digits.images[0].shape) - -# Plot pixel ranking -plt.matshow(ranking) -plt.colorbar() -plt.title("Ranking of pixels with RFE") -plt.show() diff --git a/0.15/_downloads/plot_rfe_digits1.py b/0.15/_downloads/plot_rfe_digits1.py deleted file mode 100644 index 56f6a161c89b0..0000000000000 --- a/0.15/_downloads/plot_rfe_digits1.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -============================= -Recursive feature elimination -============================= - -A recursive feature elimination example showing the relevance of pixels in -a digit classification task. - -.. note:: - - See also :ref:`example_plot_rfe_with_cross_validation.py` - -""" -print(__doc__) - -from sklearn.svm import SVC -from sklearn.datasets import load_digits -from sklearn.feature_selection import RFE -import matplotlib.pyplot as plt - -# Load the digits dataset -digits = load_digits() -X = digits.images.reshape((len(digits.images), -1)) -y = digits.target - -# Create the RFE object and rank each pixel -svc = SVC(kernel="linear", C=1) -rfe = RFE(estimator=svc, n_features_to_select=1, step=1) -rfe.fit(X, y) -ranking = rfe.ranking_.reshape(digits.images[0].shape) - -# Plot pixel ranking -plt.matshow(ranking) -plt.colorbar() -plt.title("Ranking of pixels with RFE") -plt.show() diff --git a/0.15/_downloads/plot_rfe_with_cross_validation.py b/0.15/_downloads/plot_rfe_with_cross_validation.py deleted file mode 100644 index 232aa115c2d77..0000000000000 --- a/0.15/_downloads/plot_rfe_with_cross_validation.py +++ /dev/null @@ -1,37 +0,0 @@ -""" -=================================================== -Recursive feature elimination with cross-validation -=================================================== - -A recursive feature elimination example with automatic tuning of the -number of features selected with cross-validation. -""" -print(__doc__) - -import matplotlib.pyplot as plt -from sklearn.svm import SVC -from sklearn.cross_validation import StratifiedKFold -from sklearn.feature_selection import RFECV -from sklearn.datasets import make_classification - -# Build a classification task using 3 informative features -X, y = make_classification(n_samples=1000, n_features=25, n_informative=3, - n_redundant=2, n_repeated=0, n_classes=8, - n_clusters_per_class=1, random_state=0) - -# Create the RFE object and compute a cross-validated score. -svc = SVC(kernel="linear") -# The "accuracy" scoring is proportional to the number of correct -# classifications -rfecv = RFECV(estimator=svc, step=1, cv=StratifiedKFold(y, 2), - scoring='accuracy') -rfecv.fit(X, y) - -print("Optimal number of features : %d" % rfecv.n_features_) - -# Plot number of features VS. cross-validation scores -plt.figure() -plt.xlabel("Number of features selected") -plt.ylabel("Cross validation score (nb of correct classifications)") -plt.plot(range(1, len(rfecv.grid_scores_) + 1), rfecv.grid_scores_) -plt.show() diff --git a/0.15/_downloads/plot_rfe_with_cross_validation1.py b/0.15/_downloads/plot_rfe_with_cross_validation1.py deleted file mode 100644 index 237258b4759d2..0000000000000 --- a/0.15/_downloads/plot_rfe_with_cross_validation1.py +++ /dev/null @@ -1,37 +0,0 @@ -""" -=================================================== -Recursive feature elimination with cross-validation -=================================================== - -A recursive feature elimination example with automatic tuning of the -number of features selected with cross-validation. -""" -print(__doc__) - -from sklearn.svm import SVC -from sklearn.cross_validation import StratifiedKFold -from sklearn.feature_selection import RFECV -from sklearn.datasets import make_classification - -# Build a classification task using 3 informative features -X, y = make_classification(n_samples=1000, n_features=25, n_informative=3, - n_redundant=2, n_repeated=0, n_classes=8, - n_clusters_per_class=1, random_state=0) - -# Create the RFE object and compute a cross-validated score. -svc = SVC(kernel="linear") -# The "accuracy" scoring is proportional to the number of correct -# classifications -rfecv = RFECV(estimator=svc, step=1, cv=StratifiedKFold(y, 2), - scoring='accuracy') -rfecv.fit(X, y) - -print("Optimal number of features : %d" % rfecv.n_features_) - -# Plot number of features VS. cross-validation scores -import matplotlib.pyplot as plt -plt.figure() -plt.xlabel("Number of features selected") -plt.ylabel("Cross validation score (nb of correct classifications)") -plt.plot(range(1, len(rfecv.grid_scores_) + 1), rfecv.grid_scores_) -plt.show() diff --git a/0.15/_downloads/plot_ridge_path.py b/0.15/_downloads/plot_ridge_path.py deleted file mode 100644 index 46e5e6036d2f6..0000000000000 --- a/0.15/_downloads/plot_ridge_path.py +++ /dev/null @@ -1,59 +0,0 @@ -""" -=========================================================== -Plot Ridge coefficients as a function of the regularization -=========================================================== - -Shows the effect of collinearity in the coefficients of an estimator. - -.. currentmodule:: sklearn.linear_model - -:class:`Ridge` Regression is the estimator used in this example. -Each color represents a different feature of the -coefficient vector, and this is displayed as a function of the -regularization parameter. - -At the end of the path, as alpha tends toward zero -and the solution tends towards the ordinary least squares, coefficients -exhibit big oscillations. -""" - -# Author: Fabian Pedregosa -- -# License: BSD 3 clause - -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import linear_model - -# X is the 10x10 Hilbert matrix -X = 1. / (np.arange(1, 11) + np.arange(0, 10)[:, np.newaxis]) -y = np.ones(10) - -############################################################################### -# Compute paths - -n_alphas = 200 -alphas = np.logspace(-10, -2, n_alphas) -clf = linear_model.Ridge(fit_intercept=False) - -coefs = [] -for a in alphas: - clf.set_params(alpha=a) - clf.fit(X, y) - coefs.append(clf.coef_) - -############################################################################### -# Display results - -ax = plt.gca() -ax.set_color_cycle(['b', 'r', 'g', 'c', 'k', 'y', 'm']) - -ax.plot(alphas, coefs) -ax.set_xscale('log') -ax.set_xlim(ax.get_xlim()[::-1]) # reverse axis -plt.xlabel('alpha') -plt.ylabel('weights') -plt.title('Ridge coefficients as a function of the regularization') -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_robust_fit.py b/0.15/_downloads/plot_robust_fit.py deleted file mode 100644 index 19b7b897c22cc..0000000000000 --- a/0.15/_downloads/plot_robust_fit.py +++ /dev/null @@ -1,87 +0,0 @@ -""" -Robust linear estimator fitting -=============================== - -Here a sine function is fit with a polynomial of order 3, for values -close to zero. - -Robust fitting is demoed in different situations: - -- No measurement errors, only modelling errors (fitting a sine with a - polynomial) - -- Measurement errors in X - -- Measurement errors in y - -The median absolute deviation to non corrupt new data is used to judge -the quality of the prediction. - -What we can see that: - -- RANSAC is good for strong outliers in the y direction - -- TheilSen is good for small outliers, both in direction X and y, but has - a break point above which it performs worst than OLS. - -""" - -from matplotlib import pyplot as plt -import numpy as np - -from sklearn import linear_model, metrics -from sklearn.preprocessing import PolynomialFeatures -from sklearn.pipeline import make_pipeline - -np.random.seed(42) - -X = np.random.normal(size=400) -y = np.sin(X) -# Make sure that it X is 2D -X = X[:, np.newaxis] - -X_test = np.random.normal(size=200) -y_test = np.sin(X_test) -X_test = X_test[:, np.newaxis] - -y_errors = y.copy() -y_errors[::3] = 3 - -X_errors = X.copy() -X_errors[::3] = 3 - -y_errors_large = y.copy() -y_errors_large[::3] = 10 - -X_errors_large = X.copy() -X_errors_large[::3] = 10 - -estimators = [('OLS', linear_model.LinearRegression()), - ('Theil-Sen', linear_model.TheilSenRegressor(random_state=42)), - ('RANSAC', linear_model.RANSACRegressor(random_state=42)), ] - -x_plot = np.linspace(X.min(), X.max()) - -for title, this_X, this_y in [ - ('Modeling errors only', X, y), - ('Corrupt X, small deviants', X_errors, y), - ('Corrupt y, small deviants', X, y_errors), - ('Corrupt X, large deviants', X_errors_large, y), - ('Corrupt y, large deviants', X, y_errors_large)]: - plt.figure(figsize=(5, 4)) - plt.plot(this_X[:, 0], this_y, 'k+') - - for name, estimator in estimators: - model = make_pipeline(PolynomialFeatures(3), estimator) - model.fit(this_X, this_y) - mse = metrics.mean_squared_error(model.predict(X_test), y_test) - y_plot = model.predict(x_plot[:, np.newaxis]) - plt.plot(x_plot, y_plot, - label='%s: error = %.3f' % (name, mse)) - - plt.legend(loc='best', frameon=False, - title='Error: mean absolute deviation\n to non corrupt data') - plt.xlim(-4, 10.2) - plt.ylim(-2, 10.2) - plt.title(title) -plt.show() diff --git a/0.15/_downloads/plot_robust_scaling.py b/0.15/_downloads/plot_robust_scaling.py deleted file mode 100644 index adb1d9c6e79b4..0000000000000 --- a/0.15/_downloads/plot_robust_scaling.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -Robust Scaling on Toy Data -========================================================= - -Making sure that each Feature has approximately the same scale can be a -crucial preprocessing step. However, when data contains outliers, -:class:`StandardScaler ` can often -be mislead. In such cases, it is better to use a scaler that is robust -against outliers. - -Here, we demonstrate this on a toy dataset, where one single datapoint -is a large outlier. -""" -from __future__ import print_function -print(__doc__) - - -# Code source: Thomas Unterthiner -# License: BSD 3 clause - -import matplotlib.pyplot as plt -import numpy as np -from sklearn.preprocessing import StandardScaler, RobustScaler - -# Create training and test data -np.random.seed(42) -n_datapoints = 100 -Cov = [[0.9, 0.0], [0.0, 20.0]] -mu1 = [100.0, -3.0] -mu2 = [101.0, -3.0] -X1 = np.random.multivariate_normal(mean=mu1, cov=Cov, size=n_datapoints) -X2 = np.random.multivariate_normal(mean=mu2, cov=Cov, size=n_datapoints) -Y_train = np.hstack([[-1]*n_datapoints, [1]*n_datapoints]) -X_train = np.vstack([X1, X2]) - -X1 = np.random.multivariate_normal(mean=mu1, cov=Cov, size=n_datapoints) -X2 = np.random.multivariate_normal(mean=mu2, cov=Cov, size=n_datapoints) -Y_test = np.hstack([[-1]*n_datapoints, [1]*n_datapoints]) -X_test = np.vstack([X1, X2]) - -X_train[0, 0] = -1000 # a fairly large outlier - - -# Scale data -standard_scaler = StandardScaler() -Xtr_s = standard_scaler.fit_transform(X_train) -Xte_s = standard_scaler.transform(X_test) - -robust_scaler = RobustScaler() -Xtr_r = robust_scaler.fit_transform(X_train) -Xte_r = robust_scaler.fit_transform(X_test) - - -# Plot data -fig, ax = plt.subplots(1, 3, figsize=(12, 4)) -ax[0].scatter(X_train[:, 0], X_train[:, 1], - color=np.where(Y_train > 0, 'r', 'b')) -ax[1].scatter(Xtr_s[:, 0], Xtr_s[:, 1], color=np.where(Y_train > 0, 'r', 'b')) -ax[2].scatter(Xtr_r[:, 0], Xtr_r[:, 1], color=np.where(Y_train > 0, 'r', 'b')) -ax[0].set_title("Unscaled data") -ax[1].set_title("After standard scaling (zoomed in)") -ax[2].set_title("After robust scaling (zoomed in)") -# for the scaled data, we zoom in to the data center (outlier can't be seen!) -for a in ax[1:]: - a.set_xlim(-3, 3) - a.set_ylim(-3, 3) -plt.tight_layout() -plt.show() - - -# Classify using k-NN -from sklearn.neighbors import KNeighborsClassifier - -knn = KNeighborsClassifier() -knn.fit(Xtr_s, Y_train) -acc_s = knn.score(Xte_s, Y_test) -print("Testset accuracy using standard scaler: %.3f" % acc_s) -knn.fit(Xtr_r, Y_train) -acc_r = knn.score(Xte_r, Y_test) -print("Testset accuracy using robust scaler: %.3f" % acc_r) diff --git a/0.15/_downloads/plot_robust_vs_empirical_covariance.py b/0.15/_downloads/plot_robust_vs_empirical_covariance.py deleted file mode 100644 index 3a412d96d1fa8..0000000000000 --- a/0.15/_downloads/plot_robust_vs_empirical_covariance.py +++ /dev/null @@ -1,151 +0,0 @@ -r""" -======================================= -Robust vs Empirical covariance estimate -======================================= - -The usual covariance maximum likelihood estimate is very sensitive to the -presence of outliers in the data set. In such a case, it would be better to -use a robust estimator of covariance to guarantee that the estimation is -resistant to "erroneous" observations in the data set. - -Minimum Covariance Determinant Estimator ----------------------------------------- -The Minimum Covariance Determinant estimator is a robust, high-breakdown point -(i.e. it can be used to estimate the covariance matrix of highly contaminated -datasets, up to -:math:`\frac{n_\text{samples} - n_\text{features}-1}{2}` outliers) estimator of -covariance. The idea is to find -:math:`\frac{n_\text{samples} + n_\text{features}+1}{2}` -observations whose empirical covariance has the smallest determinant, yielding -a "pure" subset of observations from which to compute standards estimates of -location and covariance. After a correction step aiming at compensating the -fact that the estimates were learned from only a portion of the initial data, -we end up with robust estimates of the data set location and covariance. - -The Minimum Covariance Determinant estimator (MCD) has been introduced by -P.J.Rousseuw in [1]_. - -Evaluation ----------- -In this example, we compare the estimation errors that are made when using -various types of location and covariance estimates on contaminated Gaussian -distributed data sets: - -- The mean and the empirical covariance of the full dataset, which break - down as soon as there are outliers in the data set -- The robust MCD, that has a low error provided - :math:`n_\text{samples} > 5n_\text{features}` -- The mean and the empirical covariance of the observations that are known - to be good ones. This can be considered as a "perfect" MCD estimation, - so one can trust our implementation by comparing to this case. - - -References ----------- -.. [1] P. J. Rousseeuw. Least median of squares regression. J. Am - Stat Ass, 79:871, 1984. -.. [2] Johanna Hardin, David M Rocke. Journal of Computational and - Graphical Statistics. December 1, 2005, 14(4): 928-946. -.. [3] Zoubir A., Koivunen V., Chakhchoukh Y. and Muma M. (2012). Robust - estimation in signal processing: A tutorial-style treatment of - fundamental concepts. IEEE Signal Processing Magazine 29(4), 61-80. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -import matplotlib.font_manager - -from sklearn.covariance import EmpiricalCovariance, MinCovDet - -# example settings -n_samples = 80 -n_features = 5 -repeat = 10 - -range_n_outliers = np.concatenate( - (np.linspace(0, n_samples / 8, 5), - np.linspace(n_samples / 8, n_samples / 2, 5)[1:-1])) - -# definition of arrays to store results -err_loc_mcd = np.zeros((range_n_outliers.size, repeat)) -err_cov_mcd = np.zeros((range_n_outliers.size, repeat)) -err_loc_emp_full = np.zeros((range_n_outliers.size, repeat)) -err_cov_emp_full = np.zeros((range_n_outliers.size, repeat)) -err_loc_emp_pure = np.zeros((range_n_outliers.size, repeat)) -err_cov_emp_pure = np.zeros((range_n_outliers.size, repeat)) - -# computation -for i, n_outliers in enumerate(range_n_outliers): - for j in range(repeat): - - rng = np.random.RandomState(i * j) - - # generate data - X = rng.randn(n_samples, n_features) - # add some outliers - outliers_index = rng.permutation(n_samples)[:n_outliers] - outliers_offset = 10. * \ - (np.random.randint(2, size=(n_outliers, n_features)) - 0.5) - X[outliers_index] += outliers_offset - inliers_mask = np.ones(n_samples).astype(bool) - inliers_mask[outliers_index] = False - - # fit a Minimum Covariance Determinant (MCD) robust estimator to data - mcd = MinCovDet().fit(X) - # compare raw robust estimates with the true location and covariance - err_loc_mcd[i, j] = np.sum(mcd.location_ ** 2) - err_cov_mcd[i, j] = mcd.error_norm(np.eye(n_features)) - - # compare estimators learned from the full data set with true - # parameters - err_loc_emp_full[i, j] = np.sum(X.mean(0) ** 2) - err_cov_emp_full[i, j] = EmpiricalCovariance().fit(X).error_norm( - np.eye(n_features)) - - # compare with an empirical covariance learned from a pure data set - # (i.e. "perfect" mcd) - pure_X = X[inliers_mask] - pure_location = pure_X.mean(0) - pure_emp_cov = EmpiricalCovariance().fit(pure_X) - err_loc_emp_pure[i, j] = np.sum(pure_location ** 2) - err_cov_emp_pure[i, j] = pure_emp_cov.error_norm(np.eye(n_features)) - -# Display results -font_prop = matplotlib.font_manager.FontProperties(size=11) -plt.subplot(2, 1, 1) -plt.errorbar(range_n_outliers, err_loc_mcd.mean(1), - yerr=err_loc_mcd.std(1) / np.sqrt(repeat), - label="Robust location", color='m') -plt.errorbar(range_n_outliers, err_loc_emp_full.mean(1), - yerr=err_loc_emp_full.std(1) / np.sqrt(repeat), - label="Full data set mean", color='green') -plt.errorbar(range_n_outliers, err_loc_emp_pure.mean(1), - yerr=err_loc_emp_pure.std(1) / np.sqrt(repeat), - label="Pure data set mean", color='black') -plt.title("Influence of outliers on the location estimation") -plt.ylabel(r"Error ($||\mu - \hat{\mu}||_2^2$)") -plt.legend(loc="upper left", prop=font_prop) - -plt.subplot(2, 1, 2) -x_size = range_n_outliers.size -plt.errorbar(range_n_outliers, err_cov_mcd.mean(1), - yerr=err_cov_mcd.std(1), - label="Robust covariance (mcd)", color='m') -plt.errorbar(range_n_outliers[:(x_size / 5 + 1)], - err_cov_emp_full.mean(1)[:(x_size / 5 + 1)], - yerr=err_cov_emp_full.std(1)[:(x_size / 5 + 1)], - label="Full data set empirical covariance", color='green') -plt.plot(range_n_outliers[(x_size / 5):(x_size / 2 - 1)], - err_cov_emp_full.mean(1)[(x_size / 5):(x_size / 2 - 1)], color='green', - ls='--') -plt.errorbar(range_n_outliers, err_cov_emp_pure.mean(1), - yerr=err_cov_emp_pure.std(1), - label="Pure data set empirical covariance", color='black') -plt.title("Influence of outliers on the covariance estimation") -plt.xlabel("Amount of contamination (%)") -plt.ylabel("RMSE") -plt.legend(loc="upper center", prop=font_prop) - -plt.show() diff --git a/0.15/_downloads/plot_roc.py b/0.15/_downloads/plot_roc.py deleted file mode 100644 index 49ae4b5fe5ce7..0000000000000 --- a/0.15/_downloads/plot_roc.py +++ /dev/null @@ -1,104 +0,0 @@ -""" -======================================= -Receiver Operating Characteristic (ROC) -======================================= - -Example of Receiver Operating Characteristic (ROC) metric to evaluate -classifier output quality. - -ROC curves typically feature true positive rate on the Y axis, and false -positive rate on the X axis. This means that the top left corner of the plot is -the "ideal" point - a false positive rate of zero, and a true positive rate of -one. This is not very realistic, but it does mean that a larger area under the -curve (AUC) is usually better. - -The "steepness" of ROC curves is also important, since it is ideal to maximize -the true positive rate while minimizing the false positive rate. - -ROC curves are typically used in binary classification to study the output of -a classifier. In order to extend ROC curve and ROC area to multi-class -or multi-label classification, it is necessary to binarize the output. One ROC -curve can be drawn per label, but one can also draw a ROC curve by considering -each element of the label indicator matrix as a binary prediction -(micro-averaging). - -.. note:: - - See also :func:`sklearn.metrics.roc_auc_score`, - :ref:`example_model_selection_plot_roc_crossval.py`. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm, datasets -from sklearn.metrics import roc_curve, auc -from sklearn.cross_validation import train_test_split -from sklearn.preprocessing import label_binarize -from sklearn.multiclass import OneVsRestClassifier - -# Import some data to play with -iris = datasets.load_iris() -X = iris.data -y = iris.target - -# Binarize the output -y = label_binarize(y, classes=[0, 1, 2]) -n_classes = y.shape[1] - -# Add noisy features to make the problem harder -random_state = np.random.RandomState(0) -n_samples, n_features = X.shape -X = np.c_[X, random_state.randn(n_samples, 200 * n_features)] - -# shuffle and split training and test sets -X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.5, - random_state=0) - -# Learn to predict each class against the other -classifier = OneVsRestClassifier(svm.SVC(kernel='linear', probability=True, - random_state=random_state)) -y_score = classifier.fit(X_train, y_train).decision_function(X_test) - -# Compute ROC curve and ROC area for each class -fpr = dict() -tpr = dict() -roc_auc = dict() -for i in range(n_classes): - fpr[i], tpr[i], _ = roc_curve(y_test[:, i], y_score[:, i]) - roc_auc[i] = auc(fpr[i], tpr[i]) - -# Compute micro-average ROC curve and ROC area -fpr["micro"], tpr["micro"], _ = roc_curve(y_test.ravel(), y_score.ravel()) -roc_auc["micro"] = auc(fpr["micro"], tpr["micro"]) - -# Plot of a ROC curve for a specific class -plt.figure() -plt.plot(fpr[2], tpr[2], label='ROC curve (area = %0.2f)' % roc_auc[2]) -plt.plot([0, 1], [0, 1], 'k--') -plt.xlim([0.0, 1.0]) -plt.ylim([0.0, 1.05]) -plt.xlabel('False Positive Rate') -plt.ylabel('True Positive Rate') -plt.title('Receiver operating characteristic example') -plt.legend(loc="lower right") -plt.show() - -# Plot ROC curve -plt.figure() -plt.plot(fpr["micro"], tpr["micro"], - label='micro-average ROC curve (area = {0:0.2f})' - ''.format(roc_auc["micro"])) -for i in range(n_classes): - plt.plot(fpr[i], tpr[i], label='ROC curve of class {0} (area = {1:0.2f})' - ''.format(i, roc_auc[i])) - -plt.plot([0, 1], [0, 1], 'k--') -plt.xlim([0.0, 1.0]) -plt.ylim([0.0, 1.05]) -plt.xlabel('False Positive Rate') -plt.ylabel('True Positive Rate') -plt.title('Some extension of Receiver operating characteristic to multi-class') -plt.legend(loc="lower right") -plt.show() diff --git a/0.15/_downloads/plot_roc1.py b/0.15/_downloads/plot_roc1.py deleted file mode 100644 index 884aaa84cd6c2..0000000000000 --- a/0.15/_downloads/plot_roc1.py +++ /dev/null @@ -1,104 +0,0 @@ -""" -======================================= -Receiver Operating Characteristic (ROC) -======================================= - -Example of Receiver Operating Characteristic (ROC) metric to evaluate -classifier output quality. - -ROC curves typically feature true positive rate on the Y axis, and false -positive rate on the X axis. This means that the top left corner of the plot is -the "ideal" point - a false positive rate of zero, and a true positive rate of -one. This is not very realistic, but it does mean that a larger area under the -curve (AUC) is usually better. - -The "steepness" of ROC curves is also important, since it is ideal to maximize -the true positive rate while minimizing the false positive rate. - -ROC curves are typically used in binary classification to study the output of -a classifier. In order to extend ROC curve and ROC area to multi-class -or multi-label classification, it is necessary to binarize the output. One ROC -curve can be drawn per label, but one can also draw a ROC curve by considering -each element of the label indicator matrix as a binary prediction -(micro-averaging). - -.. note:: - - See also :func:`sklearn.metrics.roc_auc_score`, - :ref:`example_plot_roc_crossval.py`. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm, datasets -from sklearn.metrics import roc_curve, auc -from sklearn.cross_validation import train_test_split -from sklearn.preprocessing import label_binarize -from sklearn.multiclass import OneVsRestClassifier - -# Import some data to play with -iris = datasets.load_iris() -X = iris.data -y = iris.target - -# Binarize the output -y = label_binarize(y, classes=[0, 1, 2]) -n_classes = y.shape[1] - -# Add noisy features to make the problem harder -random_state = np.random.RandomState(0) -n_samples, n_features = X.shape -X = np.c_[X, random_state.randn(n_samples, 200 * n_features)] - -# shuffle and split training and test sets -X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.5, - random_state=0) - -# Learn to predict each class against the other -classifier = OneVsRestClassifier(svm.SVC(kernel='linear', probability=True, - random_state=random_state)) -y_score = classifier.fit(X_train, y_train).decision_function(X_test) - -# Compute ROC curve and ROC area for each class -fpr = dict() -tpr = dict() -roc_auc = dict() -for i in range(n_classes): - fpr[i], tpr[i], _ = roc_curve(y_test[:, i], y_score[:, i]) - roc_auc[i] = auc(fpr[i], tpr[i]) - -# Compute micro-average ROC curve and ROC area -fpr["micro"], tpr["micro"], _ = roc_curve(y_test.ravel(), y_score.ravel()) -roc_auc["micro"] = auc(fpr["micro"], tpr["micro"]) - -# Plot of a ROC curve for a specific class -plt.figure() -plt.plot(fpr[2], tpr[2], label='ROC curve (area = %0.2f)' % roc_auc[2]) -plt.plot([0, 1], [0, 1], 'k--') -plt.xlim([0.0, 1.0]) -plt.ylim([0.0, 1.05]) -plt.xlabel('False Positive Rate') -plt.ylabel('True Positive Rate') -plt.title('Receiver operating characteristic example') -plt.legend(loc="lower right") -plt.show() - -# Plot ROC curve -plt.figure() -plt.plot(fpr["micro"], tpr["micro"], - label='micro-average ROC curve (area = {0:0.2f})' - ''.format(roc_auc["micro"])) -for i in range(n_classes): - plt.plot(fpr[i], tpr[i], label='ROC curve of class {0} (area = {1:0.2f})' - ''.format(i, roc_auc[i])) - -plt.plot([0, 1], [0, 1], 'k--') -plt.xlim([0.0, 1.0]) -plt.ylim([0.0, 1.05]) -plt.xlabel('False Positive Rate') -plt.ylabel('True Positive Rate') -plt.title('Some extension of Receiver operating characteristic to multi-class') -plt.legend(loc="lower right") -plt.show() diff --git a/0.15/_downloads/plot_roc_crossval.py b/0.15/_downloads/plot_roc_crossval.py deleted file mode 100644 index 0599813653640..0000000000000 --- a/0.15/_downloads/plot_roc_crossval.py +++ /dev/null @@ -1,91 +0,0 @@ -""" -============================================================= -Receiver Operating Characteristic (ROC) with cross validation -============================================================= - -Example of Receiver Operating Characteristic (ROC) metric to evaluate -classifier output quality using cross-validation. - -ROC curves typically feature true positive rate on the Y axis, and false -positive rate on the X axis. This means that the top left corner of the plot is -the "ideal" point - a false positive rate of zero, and a true positive rate of -one. This is not very realistic, but it does mean that a larger area under the -curve (AUC) is usually better. - -The "steepness" of ROC curves is also important, since it is ideal to maximize -the true positive rate while minimizing the false positive rate. - -This example shows the ROC response of different datasets, created from K-fold -cross-validation. Taking all of these curves, it is possible to calculate the -mean area under curve, and see the variance of the curve when the -training set is split into different subsets. This roughly shows how the -classifier output is affected by changes in the training data, and how -different the splits generated by K-fold cross-validation are from one another. - -.. note:: - - See also :func:`sklearn.metrics.auc_score`, - :func:`sklearn.cross_validation.cross_val_score`, - :ref:`example_model_selection_plot_roc.py`, - -""" -print(__doc__) - -import numpy as np -from scipy import interp -import matplotlib.pyplot as plt - -from sklearn import svm, datasets -from sklearn.metrics import roc_curve, auc -from sklearn.cross_validation import StratifiedKFold - -############################################################################### -# Data IO and generation - -# import some data to play with -iris = datasets.load_iris() -X = iris.data -y = iris.target -X, y = X[y != 2], y[y != 2] -n_samples, n_features = X.shape - -# Add noisy features -random_state = np.random.RandomState(0) -X = np.c_[X, random_state.randn(n_samples, 200 * n_features)] - -############################################################################### -# Classification and ROC analysis - -# Run classifier with cross-validation and plot ROC curves -cv = StratifiedKFold(y, n_folds=6) -classifier = svm.SVC(kernel='linear', probability=True, - random_state=random_state) - -mean_tpr = 0.0 -mean_fpr = np.linspace(0, 1, 100) -all_tpr = [] - -for i, (train, test) in enumerate(cv): - probas_ = classifier.fit(X[train], y[train]).predict_proba(X[test]) - # Compute ROC curve and area the curve - fpr, tpr, thresholds = roc_curve(y[test], probas_[:, 1]) - mean_tpr += interp(mean_fpr, fpr, tpr) - mean_tpr[0] = 0.0 - roc_auc = auc(fpr, tpr) - plt.plot(fpr, tpr, lw=1, label='ROC fold %d (area = %0.2f)' % (i, roc_auc)) - -plt.plot([0, 1], [0, 1], '--', color=(0.6, 0.6, 0.6), label='Luck') - -mean_tpr /= len(cv) -mean_tpr[-1] = 1.0 -mean_auc = auc(mean_fpr, mean_tpr) -plt.plot(mean_fpr, mean_tpr, 'k--', - label='Mean ROC (area = %0.2f)' % mean_auc, lw=2) - -plt.xlim([-0.05, 1.05]) -plt.ylim([-0.05, 1.05]) -plt.xlabel('False Positive Rate') -plt.ylabel('True Positive Rate') -plt.title('Receiver operating characteristic example') -plt.legend(loc="lower right") -plt.show() diff --git a/0.15/_downloads/plot_roc_crossval1.py b/0.15/_downloads/plot_roc_crossval1.py deleted file mode 100644 index 9557334ccd943..0000000000000 --- a/0.15/_downloads/plot_roc_crossval1.py +++ /dev/null @@ -1,91 +0,0 @@ -""" -============================================================= -Receiver Operating Characteristic (ROC) with cross validation -============================================================= - -Example of Receiver Operating Characteristic (ROC) metric to evaluate -classifier output quality using cross-validation. - -ROC curves typically feature true positive rate on the Y axis, and false -positive rate on the X axis. This means that the top left corner of the plot is -the "ideal" point - a false positive rate of zero, and a true positive rate of -one. This is not very realistic, but it does mean that a larger area under the -curve (AUC) is usually better. - -The "steepness" of ROC curves is also important, since it is ideal to maximize -the true positive rate while minimizing the false positive rate. - -This example shows the ROC response of different datasets, created from K-fold -cross-validation. Taking all of these curves, it is possible to calculate the -mean area under curve, and see the variance of the curve when the -training set is split into different subsets. This roughly shows how the -classifier output is affected by changes in the training data, and how -different the splits generated by K-fold cross-validation are from one another. - -.. note:: - - See also :func:`sklearn.metrics.auc_score`, - :func:`sklearn.cross_validation.cross_val_score`, - :ref:`example_plot_roc.py`, - -""" -print(__doc__) - -import numpy as np -from scipy import interp -import matplotlib.pyplot as plt - -from sklearn import svm, datasets -from sklearn.metrics import roc_curve, auc -from sklearn.cross_validation import StratifiedKFold - -############################################################################### -# Data IO and generation - -# import some data to play with -iris = datasets.load_iris() -X = iris.data -y = iris.target -X, y = X[y != 2], y[y != 2] -n_samples, n_features = X.shape - -# Add noisy features -random_state = np.random.RandomState(0) -X = np.c_[X, random_state.randn(n_samples, 200 * n_features)] - -############################################################################### -# Classification and ROC analysis - -# Run classifier with cross-validation and plot ROC curves -cv = StratifiedKFold(y, n_folds=6) -classifier = svm.SVC(kernel='linear', probability=True, - random_state=random_state) - -mean_tpr = 0.0 -mean_fpr = np.linspace(0, 1, 100) -all_tpr = [] - -for i, (train, test) in enumerate(cv): - probas_ = classifier.fit(X[train], y[train]).predict_proba(X[test]) - # Compute ROC curve and area the curve - fpr, tpr, thresholds = roc_curve(y[test], probas_[:, 1]) - mean_tpr += interp(mean_fpr, fpr, tpr) - mean_tpr[0] = 0.0 - roc_auc = auc(fpr, tpr) - plt.plot(fpr, tpr, lw=1, label='ROC fold %d (area = %0.2f)' % (i, roc_auc)) - -plt.plot([0, 1], [0, 1], '--', color=(0.6, 0.6, 0.6), label='Luck') - -mean_tpr /= len(cv) -mean_tpr[-1] = 1.0 -mean_auc = auc(mean_fpr, mean_tpr) -plt.plot(mean_fpr, mean_tpr, 'k--', - label='Mean ROC (area = %0.2f)' % mean_auc, lw=2) - -plt.xlim([-0.05, 1.05]) -plt.ylim([-0.05, 1.05]) -plt.xlabel('False Positive Rate') -plt.ylabel('True Positive Rate') -plt.title('Receiver operating characteristic example') -plt.legend(loc="lower right") -plt.show() diff --git a/0.15/_downloads/plot_segmentation_toy.py b/0.15/_downloads/plot_segmentation_toy.py deleted file mode 100644 index fec049d183656..0000000000000 --- a/0.15/_downloads/plot_segmentation_toy.py +++ /dev/null @@ -1,98 +0,0 @@ -""" -=========================================== -Spectral clustering for image segmentation -=========================================== - -In this example, an image with connected circles is generated and -spectral clustering is used to separate the circles. - -In these settings, the :ref:`spectral_clustering` approach solves the problem -know as 'normalized graph cuts': the image is seen as a graph of -connected voxels, and the spectral clustering algorithm amounts to -choosing graph cuts defining regions while minimizing the ratio of the -gradient along the cut, and the volume of the region. - -As the algorithm tries to balance the volume (ie balance the region -sizes), if we take circles with different sizes, the segmentation fails. - -In addition, as there is no useful information in the intensity of the image, -or its gradient, we choose to perform the spectral clustering on a graph -that is only weakly informed by the gradient. This is close to performing -a Voronoi partition of the graph. - -In addition, we use the mask of the objects to restrict the graph to the -outline of the objects. In this example, we are interested in -separating the objects one from the other, and not from the background. -""" -print(__doc__) - -# Authors: Emmanuelle Gouillart -# Gael Varoquaux -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.feature_extraction import image -from sklearn.cluster import spectral_clustering - -############################################################################### -l = 100 -x, y = np.indices((l, l)) - -center1 = (28, 24) -center2 = (40, 50) -center3 = (67, 58) -center4 = (24, 70) - -radius1, radius2, radius3, radius4 = 16, 14, 15, 14 - -circle1 = (x - center1[0]) ** 2 + (y - center1[1]) ** 2 < radius1 ** 2 -circle2 = (x - center2[0]) ** 2 + (y - center2[1]) ** 2 < radius2 ** 2 -circle3 = (x - center3[0]) ** 2 + (y - center3[1]) ** 2 < radius3 ** 2 -circle4 = (x - center4[0]) ** 2 + (y - center4[1]) ** 2 < radius4 ** 2 - -############################################################################### -# 4 circles -img = circle1 + circle2 + circle3 + circle4 -mask = img.astype(bool) -img = img.astype(float) - -img += 1 + 0.2 * np.random.randn(*img.shape) - -# Convert the image into a graph with the value of the gradient on the -# edges. -graph = image.img_to_graph(img, mask=mask) - -# Take a decreasing function of the gradient: we take it weakly -# dependent from the gradient the segmentation is close to a voronoi -graph.data = np.exp(-graph.data / graph.data.std()) - -# Force the solver to be arpack, since amg is numerically -# unstable on this example -labels = spectral_clustering(graph, n_clusters=4, eigen_solver='arpack') -label_im = -np.ones(mask.shape) -label_im[mask] = labels - -plt.matshow(img) -plt.matshow(label_im) - -############################################################################### -# 2 circles -img = circle1 + circle2 -mask = img.astype(bool) -img = img.astype(float) - -img += 1 + 0.2 * np.random.randn(*img.shape) - -graph = image.img_to_graph(img, mask=mask) -graph.data = np.exp(-graph.data / graph.data.std()) - -labels = spectral_clustering(graph, n_clusters=2, eigen_solver='arpack') -label_im = -np.ones(mask.shape) -label_im[mask] = labels - -plt.matshow(img) -plt.matshow(label_im) - -plt.show() diff --git a/0.15/_downloads/plot_separating_hyperplane.py b/0.15/_downloads/plot_separating_hyperplane.py deleted file mode 100644 index 254368fb421d4..0000000000000 --- a/0.15/_downloads/plot_separating_hyperplane.py +++ /dev/null @@ -1,48 +0,0 @@ -""" -========================================= -SVM: Maximum margin separating hyperplane -========================================= - -Plot the maximum margin separating hyperplane within a two-class -separable dataset using a Support Vector Machines classifier with -linear kernel. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm - -# we create 40 separable points -np.random.seed(0) -X = np.r_[np.random.randn(20, 2) - [2, 2], np.random.randn(20, 2) + [2, 2]] -Y = [0] * 20 + [1] * 20 - -# fit the model -clf = svm.SVC(kernel='linear') -clf.fit(X, Y) - -# get the separating hyperplane -w = clf.coef_[0] -a = -w[0] / w[1] -xx = np.linspace(-5, 5) -yy = a * xx - (clf.intercept_[0]) / w[1] - -# plot the parallels to the separating hyperplane that pass through the -# support vectors -b = clf.support_vectors_[0] -yy_down = a * xx + (b[1] - a * b[0]) -b = clf.support_vectors_[-1] -yy_up = a * xx + (b[1] - a * b[0]) - -# plot the line, the points, and the nearest vectors to the plane -plt.plot(xx, yy, 'k-') -plt.plot(xx, yy_down, 'k--') -plt.plot(xx, yy_up, 'k--') - -plt.scatter(clf.support_vectors_[:, 0], clf.support_vectors_[:, 1], - s=80, facecolors='none') -plt.scatter(X[:, 0], X[:, 1], c=Y, cmap=plt.cm.Paired) - -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_separating_hyperplane_unbalanced.py b/0.15/_downloads/plot_separating_hyperplane_unbalanced.py deleted file mode 100644 index f7278004acfca..0000000000000 --- a/0.15/_downloads/plot_separating_hyperplane_unbalanced.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -================================================= -SVM: Separating hyperplane for unbalanced classes -================================================= - -Find the optimal separating hyperplane using an SVC for classes that -are unbalanced. - -We first find the separating plane with a plain SVC and then plot -(dashed) the separating hyperplane with automatically correction for -unbalanced classes. - -.. currentmodule:: sklearn.linear_model - -.. note:: - - This example will also work by replacing ``SVC(kernel="linear")`` - with ``SGDClassifier(loss="hinge")``. Setting the ``loss`` parameter - of the :class:`SGDClassifier` equal to ``hinge`` will yield behaviour - such as that of a SVC with a linear kernel. - - For example try instead of the ``SVC``:: - - clf = SGDClassifier(n_iter=100, alpha=0.01) - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm -#from sklearn.linear_model import SGDClassifier - -# we create 40 separable points -rng = np.random.RandomState(0) -n_samples_1 = 1000 -n_samples_2 = 100 -X = np.r_[1.5 * rng.randn(n_samples_1, 2), - 0.5 * rng.randn(n_samples_2, 2) + [2, 2]] -y = [0] * (n_samples_1) + [1] * (n_samples_2) - -# fit the model and get the separating hyperplane -clf = svm.SVC(kernel='linear', C=1.0) -clf.fit(X, y) - -w = clf.coef_[0] -a = -w[0] / w[1] -xx = np.linspace(-5, 5) -yy = a * xx - clf.intercept_[0] / w[1] - - -# get the separating hyperplane using weighted classes -wclf = svm.SVC(kernel='linear', class_weight={1: 10}) -wclf.fit(X, y) - -ww = wclf.coef_[0] -wa = -ww[0] / ww[1] -wyy = wa * xx - wclf.intercept_[0] / ww[1] - -# plot separating hyperplanes and samples -h0 = plt.plot(xx, yy, 'k-', label='no weights') -h1 = plt.plot(xx, wyy, 'k--', label='with weights') -plt.scatter(X[:, 0], X[:, 1], c=y, cmap=plt.cm.Paired) -plt.legend() - -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_sgd_comparison.py b/0.15/_downloads/plot_sgd_comparison.py deleted file mode 100644 index 9db6bc994538a..0000000000000 --- a/0.15/_downloads/plot_sgd_comparison.py +++ /dev/null @@ -1,51 +0,0 @@ -""" -================================== -Comparing various online solvers -================================== - -An example showing how different online solvers perform -on the hand-written digits dataset. - -""" -# Author: Rob Zinkov -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import datasets -from sklearn.cross_validation import train_test_split -from sklearn.linear_model import SGDClassifier, Perceptron -from sklearn.linear_model import PassiveAggressiveClassifier - -heldout = [0.95, 0.90, 0.75, 0.50, 0.01] -rounds = 20 -digits = datasets.load_digits() - -classifiers = [ - ("SGD", SGDClassifier()), - ("Perceptron", Perceptron()), - ("Passive-Aggressive I", PassiveAggressiveClassifier(loss='hinge', - C=1.0)), - ("Passive-Aggressive II", PassiveAggressiveClassifier(loss='squared_hinge', - C=1.0)), -] - -xx = 1 - np.array(heldout) -for name, clf in classifiers: - yy = [] - for i in heldout: - yy_ = [] - for r in range(rounds): - X_train, X_test, y_train, y_test = train_test_split(digits.data, - digits.target, - test_size=i) - clf.fit(X_train, y_train) - y_pred = clf.predict(X_test) - yy_.append(1 - np.mean(y_pred == y_test)) - yy.append(np.mean(yy_)) - plt.plot(xx, yy, label=name) - -plt.legend(loc="upper right") -plt.xlabel("Proportion train") -plt.ylabel("Test Error Rate") -plt.show() diff --git a/0.15/_downloads/plot_sgd_iris.py b/0.15/_downloads/plot_sgd_iris.py deleted file mode 100644 index cd2c8dd6b03f5..0000000000000 --- a/0.15/_downloads/plot_sgd_iris.py +++ /dev/null @@ -1,80 +0,0 @@ -""" -======================================== -Plot multi-class SGD on the iris dataset -======================================== - -Plot decision surface of multi-class SGD on iris dataset. -The hyperplanes corresponding to the three one-versus-all (OVA) classifiers -are represented by the dashed lines. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import datasets -from sklearn.linear_model import SGDClassifier - -# import some data to play with -iris = datasets.load_iris() -X = iris.data[:, :2] # we only take the first two features. We could - # avoid this ugly slicing by using a two-dim dataset -y = iris.target -colors = "bry" - -# shuffle -idx = np.arange(X.shape[0]) -np.random.seed(13) -np.random.shuffle(idx) -X = X[idx] -y = y[idx] - -# standardize -mean = X.mean(axis=0) -std = X.std(axis=0) -X = (X - mean) / std - -h = .02 # step size in the mesh - -clf = SGDClassifier(alpha=0.001, n_iter=100).fit(X, y) - -# create a mesh to plot in -x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 -y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 -xx, yy = np.meshgrid(np.arange(x_min, x_max, h), - np.arange(y_min, y_max, h)) - -# Plot the decision boundary. For that, we will assign a color to each -# point in the mesh [x_min, m_max]x[y_min, y_max]. -Z = clf.predict(np.c_[xx.ravel(), yy.ravel()]) -# Put the result into a color plot -Z = Z.reshape(xx.shape) -cs = plt.contourf(xx, yy, Z, cmap=plt.cm.Paired) -plt.axis('tight') - -# Plot also the training points -for i, color in zip(clf.classes_, colors): - idx = np.where(y == i) - plt.scatter(X[idx, 0], X[idx, 1], c=color, label=iris.target_names[i], - cmap=plt.cm.Paired) -plt.title("Decision surface of multi-class SGD") -plt.axis('tight') - -# Plot the three one-against-all classifiers -xmin, xmax = plt.xlim() -ymin, ymax = plt.ylim() -coef = clf.coef_ -intercept = clf.intercept_ - - -def plot_hyperplane(c, color): - def line(x0): - return (-(x0 * coef[c, 0]) - intercept[c]) / coef[c, 1] - - plt.plot([xmin, xmax], [line(xmin), line(xmax)], - ls="--", color=color) - -for i, color in zip(clf.classes_, colors): - plot_hyperplane(i, color) -plt.legend() -plt.show() diff --git a/0.15/_downloads/plot_sgd_loss_functions.py b/0.15/_downloads/plot_sgd_loss_functions.py deleted file mode 100644 index c2668dd6d760b..0000000000000 --- a/0.15/_downloads/plot_sgd_loss_functions.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -========================== -SGD: convex loss functions -========================== - -A plot that compares the various convex loss functions supported by -:class:`sklearn.linear_model.SGDClassifier` . -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - - -def modified_huber_loss(y_true, y_pred): - z = y_pred * y_true - loss = -4 * z - loss[z >= -1] = (1 - z[z >= -1]) ** 2 - loss[z >= 1.] = 0 - return loss - - -xmin, xmax = -4, 4 -xx = np.linspace(xmin, xmax, 100) -plt.plot([xmin, 0, 0, xmax], [1, 1, 0, 0], 'k-', - label="Zero-one loss") -plt.plot(xx, np.where(xx < 1, 1 - xx, 0), 'g-', - label="Hinge loss") -plt.plot(xx, -np.minimum(xx, 0), 'm-', - label="Perceptron loss") -plt.plot(xx, np.log2(1 + np.exp(-xx)), 'r-', - label="Log loss") -plt.plot(xx, np.where(xx < 1, 1 - xx, 0) ** 2, 'b-', - label="Squared hinge loss") -plt.plot(xx, modified_huber_loss(xx, 1), 'y--', - label="Modified Huber loss") -plt.ylim((0, 8)) -plt.legend(loc="upper right") -plt.xlabel(r"Decision function $f(x)$") -plt.ylabel("$L(y, f(x))$") -plt.show() diff --git a/0.15/_downloads/plot_sgd_penalties.py b/0.15/_downloads/plot_sgd_penalties.py deleted file mode 100644 index 077ee62823f3c..0000000000000 --- a/0.15/_downloads/plot_sgd_penalties.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -============== -SGD: Penalties -============== - -Plot the contours of the three penalties. - -All of the above are supported by -:class:`sklearn.linear_model.stochastic_gradient`. - -""" -from __future__ import division -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - - -def l1(xs): - return np.array([np.sqrt((1 - np.sqrt(x ** 2.0)) ** 2.0) for x in xs]) - - -def l2(xs): - return np.array([np.sqrt(1.0 - x ** 2.0) for x in xs]) - - -def el(xs, z): - return np.array([(2 - 2 * x - 2 * z + 4 * x * z - - (4 * z ** 2 - - 8 * x * z ** 2 - + 8 * x ** 2 * z ** 2 - - 16 * x ** 2 * z ** 3 - + 8 * x * z ** 3 + 4 * x ** 2 * z ** 4) ** (1. / 2) - - 2 * x * z ** 2) / (2 - 4 * z) for x in xs]) - - -def cross(ext): - plt.plot([-ext, ext], [0, 0], "k-") - plt.plot([0, 0], [-ext, ext], "k-") - -xs = np.linspace(0, 1, 100) - -alpha = 0.501 # 0.5 division throuh zero - -cross(1.2) - -plt.plot(xs, l1(xs), "r-", label="L1") -plt.plot(xs, -1.0 * l1(xs), "r-") -plt.plot(-1 * xs, l1(xs), "r-") -plt.plot(-1 * xs, -1.0 * l1(xs), "r-") - -plt.plot(xs, l2(xs), "b-", label="L2") -plt.plot(xs, -1.0 * l2(xs), "b-") -plt.plot(-1 * xs, l2(xs), "b-") -plt.plot(-1 * xs, -1.0 * l2(xs), "b-") - -plt.plot(xs, el(xs, alpha), "y-", label="Elastic Net") -plt.plot(xs, -1.0 * el(xs, alpha), "y-") -plt.plot(-1 * xs, el(xs, alpha), "y-") -plt.plot(-1 * xs, -1.0 * el(xs, alpha), "y-") - -plt.xlabel(r"$w_0$") -plt.ylabel(r"$w_1$") -plt.legend() - -plt.axis("equal") -plt.show() diff --git a/0.15/_downloads/plot_sgd_separating_hyperplane.py b/0.15/_downloads/plot_sgd_separating_hyperplane.py deleted file mode 100644 index f3a7d9a53bce2..0000000000000 --- a/0.15/_downloads/plot_sgd_separating_hyperplane.py +++ /dev/null @@ -1,42 +0,0 @@ -""" -========================================= -SGD: Maximum margin separating hyperplane -========================================= - -Plot the maximum margin separating hyperplane within a two-class -separable dataset using a linear Support Vector Machines classifier -trained using SGD. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn.linear_model import SGDClassifier -from sklearn.datasets.samples_generator import make_blobs - -# we create 50 separable points -X, Y = make_blobs(n_samples=50, centers=2, random_state=0, cluster_std=0.60) - -# fit the model -clf = SGDClassifier(loss="hinge", alpha=0.01, n_iter=200, fit_intercept=True) -clf.fit(X, Y) - -# plot the line, the points, and the nearest vectors to the plane -xx = np.linspace(-1, 5, 10) -yy = np.linspace(-1, 5, 10) - -X1, X2 = np.meshgrid(xx, yy) -Z = np.empty(X1.shape) -for (i, j), val in np.ndenumerate(X1): - x1 = val - x2 = X2[i, j] - p = clf.decision_function([x1, x2]) - Z[i, j] = p[0] -levels = [-1.0, 0.0, 1.0] -linestyles = ['dashed', 'solid', 'dashed'] -colors = 'k' -plt.contour(X1, X2, Z, levels, colors=colors, linestyles=linestyles) -plt.scatter(X[:, 0], X[:, 1], c=Y, cmap=plt.cm.Paired) - -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_sgd_weighted_samples.py b/0.15/_downloads/plot_sgd_weighted_samples.py deleted file mode 100644 index 15dd72866f4df..0000000000000 --- a/0.15/_downloads/plot_sgd_weighted_samples.py +++ /dev/null @@ -1,48 +0,0 @@ -""" -===================== -SGD: Weighted samples -===================== - -Plot decision function of a weighted dataset, where the size of points -is proportional to its weight. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import linear_model - -# we create 20 points -np.random.seed(0) -X = np.r_[np.random.randn(10, 2) + [1, 1], np.random.randn(10, 2)] -y = [1] * 10 + [-1] * 10 -sample_weight = 100 * np.abs(np.random.randn(20)) -# and assign a bigger weight to the last 10 samples -sample_weight[:10] *= 10 - -# plot the weighted data points -xx, yy = np.meshgrid(np.linspace(-4, 5, 500), np.linspace(-4, 5, 500)) -plt.figure() -plt.scatter(X[:, 0], X[:, 1], c=y, s=sample_weight, alpha=0.9, - cmap=plt.cm.bone) - -## fit the unweighted model -clf = linear_model.SGDClassifier(alpha=0.01, n_iter=100) -clf.fit(X, y) -Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) -Z = Z.reshape(xx.shape) -no_weights = plt.contour(xx, yy, Z, levels=[0], linestyles=['solid']) - -## fit the weighted model -clf = linear_model.SGDClassifier(alpha=0.01, n_iter=100) -clf.fit(X, y, sample_weight=sample_weight) -Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) -Z = Z.reshape(xx.shape) -samples_weights = plt.contour(xx, yy, Z, levels=[0], linestyles=['dashed']) - -plt.legend([no_weights.collections[0], samples_weights.collections[0]], - ["no weights", "with weights"], loc="lower left") - -plt.xticks(()) -plt.yticks(()) -plt.show() diff --git a/0.15/_downloads/plot_sparse_coding.py b/0.15/_downloads/plot_sparse_coding.py deleted file mode 100644 index e0e0fe1a73624..0000000000000 --- a/0.15/_downloads/plot_sparse_coding.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -=========================================== -Sparse coding with a precomputed dictionary -=========================================== - -Transform a signal as a sparse combination of Ricker wavelets. This example -visually compares different sparse coding methods using the -:class:`sklearn.decomposition.SparseCoder` estimator. The Ricker (also known -as Mexican hat or the second derivative of a Gaussian) is not a particularly -good kernel to represent piecewise constant signals like this one. It can -therefore be seen how much adding different widths of atoms matters and it -therefore motivates learning the dictionary to best fit your type of signals. - -The richer dictionary on the right is not larger in size, heavier subsampling -is performed in order to stay on the same order of magnitude. -""" -print(__doc__) - -import numpy as np -import matplotlib.pylab as pl - -from sklearn.decomposition import SparseCoder - - -def ricker_function(resolution, center, width): - """Discrete sub-sampled Ricker (Mexican hat) wavelet""" - x = np.linspace(0, resolution - 1, resolution) - x = ((2 / ((np.sqrt(3 * width) * np.pi ** 1 / 4))) - * (1 - ((x - center) ** 2 / width ** 2)) - * np.exp((-(x - center) ** 2) / (2 * width ** 2))) - return x - - -def ricker_matrix(width, resolution, n_components): - """Dictionary of Ricker (Mexican hat) wavelets""" - centers = np.linspace(0, resolution - 1, n_components) - D = np.empty((n_components, resolution)) - for i, center in enumerate(centers): - D[i] = ricker_function(resolution, center, width) - D /= np.sqrt(np.sum(D ** 2, axis=1))[:, np.newaxis] - return D - - -resolution = 1024 -subsampling = 3 # subsampling factor -width = 100 -n_components = resolution / subsampling - -# Compute a wavelet dictionary -D_fixed = ricker_matrix(width=width, resolution=resolution, - n_components=n_components) -D_multi = np.r_[tuple(ricker_matrix(width=w, resolution=resolution, - n_components=np.floor(n_components / 5)) - for w in (10, 50, 100, 500, 1000))] - -# Generate a signal -y = np.linspace(0, resolution - 1, resolution) -first_quarter = y < resolution / 4 -y[first_quarter] = 3. -y[np.logical_not(first_quarter)] = -1. - -# List the different sparse coding methods in the following format: -# (title, transform_algorithm, transform_alpha, transform_n_nozero_coefs) -estimators = [('OMP', 'omp', None, 15), ('Lasso', 'lasso_cd', 2, None), ] - -pl.figure(figsize=(13, 6)) -for subplot, (D, title) in enumerate(zip((D_fixed, D_multi), - ('fixed width', 'multiple widths'))): - pl.subplot(1, 2, subplot + 1) - pl.title('Sparse coding against %s dictionary' % title) - pl.plot(y, ls='dotted', label='Original signal') - # Do a wavelet approximation - for title, algo, alpha, n_nonzero in estimators: - coder = SparseCoder(dictionary=D, transform_n_nonzero_coefs=n_nonzero, - transform_alpha=alpha, transform_algorithm=algo) - x = coder.transform(y) - density = len(np.flatnonzero(x)) - x = np.ravel(np.dot(x, D)) - squared_error = np.sum((y - x) ** 2) - pl.plot(x, label='%s: %s nonzero coefs,\n%.2f error' - % (title, density, squared_error)) - - # Soft thresholding debiasing - coder = SparseCoder(dictionary=D, transform_algorithm='threshold', - transform_alpha=20) - x = coder.transform(y) - _, idx = np.where(x != 0) - x[0, idx], _, _, _ = np.linalg.lstsq(D[idx, :].T, y) - x = np.ravel(np.dot(x, D)) - squared_error = np.sum((y - x) ** 2) - pl.plot(x, - label='Thresholding w/ debiasing:\n%d nonzero coefs, %.2f error' % - (len(idx), squared_error)) - pl.axis('tight') - pl.legend() -pl.subplots_adjust(.04, .07, .97, .90, .09, .2) -pl.show() diff --git a/0.15/_downloads/plot_sparse_cov.py b/0.15/_downloads/plot_sparse_cov.py deleted file mode 100644 index 237b33a9ba1b9..0000000000000 --- a/0.15/_downloads/plot_sparse_cov.py +++ /dev/null @@ -1,135 +0,0 @@ -""" -====================================== -Sparse inverse covariance estimation -====================================== - -Using the GraphLasso estimator to learn a covariance and sparse precision -from a small number of samples. - -To estimate a probabilistic model (e.g. a Gaussian model), estimating the -precision matrix, that is the inverse covariance matrix, is as important -as estimating the covariance matrix. Indeed a Gaussian model is -parametrized by the precision matrix. - -To be in favorable recovery conditions, we sample the data from a model -with a sparse inverse covariance matrix. In addition, we ensure that the -data is not too much correlated (limiting the largest coefficient of the -precision matrix) and that there a no small coefficients in the -precision matrix that cannot be recovered. In addition, with a small -number of observations, it is easier to recover a correlation matrix -rather than a covariance, thus we scale the time series. - -Here, the number of samples is slightly larger than the number of -dimensions, thus the empirical covariance is still invertible. However, -as the observations are strongly correlated, the empirical covariance -matrix is ill-conditioned and as a result its inverse --the empirical -precision matrix-- is very far from the ground truth. - -If we use l2 shrinkage, as with the Ledoit-Wolf estimator, as the number -of samples is small, we need to shrink a lot. As a result, the -Ledoit-Wolf precision is fairly close to the ground truth precision, that -is not far from being diagonal, but the off-diagonal structure is lost. - -The l1-penalized estimator can recover part of this off-diagonal -structure. It learns a sparse precision. It is not able to -recover the exact sparsity pattern: it detects too many non-zero -coefficients. However, the highest non-zero coefficients of the l1 -estimated correspond to the non-zero coefficients in the ground truth. -Finally, the coefficients of the l1 precision estimate are biased toward -zero: because of the penalty, they are all smaller than the corresponding -ground truth value, as can be seen on the figure. - -Note that, the color range of the precision matrices is tweeked to -improve readibility of the figure. The full range of values of the -empirical precision is not displayed. - -The alpha parameter of the GraphLasso setting the sparsity of the model is -set by internal cross-validation in the GraphLassoCV. As can be -seen on figure 2, the grid to compute the cross-validation score is -iteratively refined in the neighborhood of the maximum. -""" -print(__doc__) -# author: Gael Varoquaux -# License: BSD 3 clause -# Copyright: INRIA - -import numpy as np -from scipy import linalg -from sklearn.datasets import make_sparse_spd_matrix -from sklearn.covariance import GraphLassoCV, ledoit_wolf -import matplotlib.pyplot as plt - -############################################################################## -# Generate the data -n_samples = 60 -n_features = 20 - -prng = np.random.RandomState(1) -prec = make_sparse_spd_matrix(n_features, alpha=.98, - smallest_coef=.4, - largest_coef=.7, - random_state=prng) -cov = linalg.inv(prec) -d = np.sqrt(np.diag(cov)) -cov /= d -cov /= d[:, np.newaxis] -prec *= d -prec *= d[:, np.newaxis] -X = prng.multivariate_normal(np.zeros(n_features), cov, size=n_samples) -X -= X.mean(axis=0) -X /= X.std(axis=0) - -############################################################################## -# Estimate the covariance -emp_cov = np.dot(X.T, X) / n_samples - -model = GraphLassoCV() -model.fit(X) -cov_ = model.covariance_ -prec_ = model.precision_ - -lw_cov_, _ = ledoit_wolf(X) -lw_prec_ = linalg.inv(lw_cov_) - -############################################################################## -# Plot the results -plt.figure(figsize=(10, 6)) -plt.subplots_adjust(left=0.02, right=0.98) - -# plot the covariances -covs = [('Empirical', emp_cov), ('Ledoit-Wolf', lw_cov_), - ('GraphLasso', cov_), ('True', cov)] -vmax = cov_.max() -for i, (name, this_cov) in enumerate(covs): - plt.subplot(2, 4, i + 1) - plt.imshow(this_cov, interpolation='nearest', vmin=-vmax, vmax=vmax, - cmap=plt.cm.RdBu_r) - plt.xticks(()) - plt.yticks(()) - plt.title('%s covariance' % name) - - -# plot the precisions -precs = [('Empirical', linalg.inv(emp_cov)), ('Ledoit-Wolf', lw_prec_), - ('GraphLasso', prec_), ('True', prec)] -vmax = .9 * prec_.max() -for i, (name, this_prec) in enumerate(precs): - ax = plt.subplot(2, 4, i + 5) - plt.imshow(np.ma.masked_equal(this_prec, 0), - interpolation='nearest', vmin=-vmax, vmax=vmax, - cmap=plt.cm.RdBu_r) - plt.xticks(()) - plt.yticks(()) - plt.title('%s precision' % name) - ax.set_axis_bgcolor('.7') - -# plot the model selection metric -plt.figure(figsize=(4, 3)) -plt.axes([.2, .15, .75, .7]) -plt.plot(model.cv_alphas_, np.mean(model.grid_scores, axis=1), 'o-') -plt.axvline(model.alpha_, color='.5') -plt.title('Model selection') -plt.ylabel('Cross-validation score') -plt.xlabel('alpha') - -plt.show() diff --git a/0.15/_downloads/plot_sparse_recovery.py b/0.15/_downloads/plot_sparse_recovery.py deleted file mode 100644 index 00bb5cd7ef8ff..0000000000000 --- a/0.15/_downloads/plot_sparse_recovery.py +++ /dev/null @@ -1,174 +0,0 @@ -""" -============================================================ -Sparse recovery: feature selection for sparse linear models -============================================================ - -Given a small number of observations, we want to recover which features -of X are relevant to explain y. For this :ref:`sparse linear models -` can outperform standard statistical tests if the -true model is sparse, i.e. if a small fraction of the features are -relevant. - -As detailed in :ref:`the compressive sensing notes -`, the ability of L1-based approach to identify the -relevant variables depends on the sparsity of the ground truth, the -number of samples, the number of features, the conditioning of the -design matrix on the signal subspace, the amount of noise, and the -absolute value of the smallest non-zero coefficient [Wainwright2006] -(http://statistics.berkeley.edu/tech-reports/709.pdf). - -Here we keep all parameters constant and vary the conditioning of the -design matrix. For a well-conditioned design matrix (small mutual -incoherence) we are exactly in compressive sensing conditions (i.i.d -Gaussian sensing matrix), and L1-recovery with the Lasso performs very -well. For an ill-conditioned matrix (high mutual incoherence), -regressors are very correlated, and the Lasso randomly selects one. -However, randomized-Lasso can recover the ground truth well. - -In each situation, we first vary the alpha parameter setting the sparsity -of the estimated model and look at the stability scores of the randomized -Lasso. This analysis, knowing the ground truth, shows an optimal regime -in which relevant features stand out from the irrelevant ones. If alpha -is chosen too small, non-relevant variables enter the model. On the -opposite, if alpha is selected too large, the Lasso is equivalent to -stepwise regression, and thus brings no advantage over a univariate -F-test. - -In a second time, we set alpha and compare the performance of different -feature selection methods, using the area under curve (AUC) of the -precision-recall. -""" -print(__doc__) - -# Author: Alexandre Gramfort and Gael Varoquaux -# License: BSD 3 clause - -import warnings - -import matplotlib.pyplot as plt -import numpy as np -from scipy import linalg - -from sklearn.linear_model import (RandomizedLasso, lasso_stability_path, - LassoLarsCV) -from sklearn.feature_selection import f_regression -from sklearn.preprocessing import StandardScaler -from sklearn.metrics import auc, precision_recall_curve -from sklearn.ensemble import ExtraTreesRegressor -from sklearn.utils.extmath import pinvh -from sklearn.utils import ConvergenceWarning - - -def mutual_incoherence(X_relevant, X_irelevant): - """Mutual incoherence, as defined by formula (26a) of [Wainwright2006]. - """ - projector = np.dot(np.dot(X_irelevant.T, X_relevant), - pinvh(np.dot(X_relevant.T, X_relevant))) - return np.max(np.abs(projector).sum(axis=1)) - - -for conditioning in (1, 1e-4): - ########################################################################### - # Simulate regression data with a correlated design - n_features = 501 - n_relevant_features = 3 - noise_level = .2 - coef_min = .2 - # The Donoho-Tanner phase transition is around n_samples=25: below we - # will completely fail to recover in the well-conditioned case - n_samples = 25 - block_size = n_relevant_features - - rng = np.random.RandomState(42) - - # The coefficients of our model - coef = np.zeros(n_features) - coef[:n_relevant_features] = coef_min + rng.rand(n_relevant_features) - - # The correlation of our design: variables correlated by blocs of 3 - corr = np.zeros((n_features, n_features)) - for i in range(0, n_features, block_size): - corr[i:i + block_size, i:i + block_size] = 1 - conditioning - corr.flat[::n_features + 1] = 1 - corr = linalg.cholesky(corr) - - # Our design - X = rng.normal(size=(n_samples, n_features)) - X = np.dot(X, corr) - # Keep [Wainwright2006] (26c) constant - X[:n_relevant_features] /= np.abs( - linalg.svdvals(X[:n_relevant_features])).max() - X = StandardScaler().fit_transform(X.copy()) - - # The output variable - y = np.dot(X, coef) - y /= np.std(y) - # We scale the added noise as a function of the average correlation - # between the design and the output variable - y += noise_level * rng.normal(size=n_samples) - mi = mutual_incoherence(X[:, :n_relevant_features], - X[:, n_relevant_features:]) - - ########################################################################### - # Plot stability selection path, using a high eps for early stopping - # of the path, to save computation time - alpha_grid, scores_path = lasso_stability_path(X, y, random_state=42, - eps=0.05) - - plt.figure() - # We plot the path as a function of alpha/alpha_max to the power 1/3: the - # power 1/3 scales the path less brutally than the log, and enables to - # see the progression along the path - hg = plt.plot(alpha_grid[1:] ** .333, scores_path[coef != 0].T[1:], 'r') - hb = plt.plot(alpha_grid[1:] ** .333, scores_path[coef == 0].T[1:], 'k') - ymin, ymax = plt.ylim() - plt.xlabel(r'$(\alpha / \alpha_{max})^{1/3}$') - plt.ylabel('Stability score: proportion of times selected') - plt.title('Stability Scores Path - Mutual incoherence: %.1f' % mi) - plt.axis('tight') - plt.legend((hg[0], hb[0]), ('relevant features', 'irrelevant features'), - loc='best') - - ########################################################################### - # Plot the estimated stability scores for a given alpha - - # Use 6-fold cross-validation rather than the default 3-fold: it leads to - # a better choice of alpha: - # Stop the user warnings outputs- they are not necessary for the example - # as it is specifically set up to be challenging. - with warnings.catch_warnings(): - warnings.simplefilter('ignore', UserWarning) - warnings.simplefilter('ignore', ConvergenceWarning) - lars_cv = LassoLarsCV(cv=6).fit(X, y) - - # Run the RandomizedLasso: we use a paths going down to .1*alpha_max - # to avoid exploring the regime in which very noisy variables enter - # the model - alphas = np.linspace(lars_cv.alphas_[0], .1 * lars_cv.alphas_[0], 6) - clf = RandomizedLasso(alpha=alphas, random_state=42).fit(X, y) - trees = ExtraTreesRegressor(100).fit(X, y) - # Compare with F-score - F, _ = f_regression(X, y) - - plt.figure() - for name, score in [('F-test', F), - ('Stability selection', clf.scores_), - ('Lasso coefs', np.abs(lars_cv.coef_)), - ('Trees', trees.feature_importances_), - ]: - precision, recall, thresholds = precision_recall_curve(coef != 0, - score) - plt.semilogy(np.maximum(score / np.max(score), 1e-4), - label="%s. AUC: %.3f" % (name, auc(recall, precision))) - - plt.plot(np.where(coef != 0)[0], [2e-4] * n_relevant_features, 'mo', - label="Ground truth") - plt.xlabel("Features") - plt.ylabel("Score") - # Plot only the 100 first coefficients - plt.xlim(0, 100) - plt.legend(loc='best') - plt.title('Feature selection scores - Mutual incoherence: %.1f' - % mi) - -plt.show() diff --git a/0.15/_downloads/plot_species_distribution_modeling.py b/0.15/_downloads/plot_species_distribution_modeling.py deleted file mode 100644 index 9e589d0c39c0e..0000000000000 --- a/0.15/_downloads/plot_species_distribution_modeling.py +++ /dev/null @@ -1,208 +0,0 @@ -""" -============================= -Species distribution modeling -============================= - -Modeling species' geographic distributions is an important -problem in conservation biology. In this example we -model the geographic distribution of two south american -mammals given past observations and 14 environmental -variables. Since we have only positive examples (there are -no unsuccessful observations), we cast this problem as a -density estimation problem and use the `OneClassSVM` provided -by the package `sklearn.svm` as our modeling tool. -The dataset is provided by Phillips et. al. (2006). -If available, the example uses -`basemap `_ -to plot the coast lines and national boundaries of South America. - -The two species are: - - - `"Bradypus variegatus" - `_ , - the Brown-throated Sloth. - - - `"Microryzomys minutus" - `_ , - also known as the Forest Small Rice Rat, a rodent that lives in Peru, - Colombia, Ecuador, Peru, and Venezuela. - -References ----------- - - * `"Maximum entropy modeling of species geographic distributions" - `_ - S. J. Phillips, R. P. Anderson, R. E. Schapire - Ecological Modelling, - 190:231-259, 2006. -""" - -# Authors: Peter Prettenhofer -# Jake Vanderplas -# -# License: BSD 3 clause - -from __future__ import print_function - -from time import time - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.datasets.base import Bunch -from sklearn.datasets import fetch_species_distributions -from sklearn.datasets.species_distributions import construct_grids -from sklearn import svm, metrics - -# if basemap is available, we'll use it. -# otherwise, we'll improvise later... -try: - from mpl_toolkits.basemap import Basemap - basemap = True -except ImportError: - basemap = False - -print(__doc__) - - -def create_species_bunch(species_name, train, test, coverages, xgrid, ygrid): - """Create a bunch with information about a particular organism - - This will use the test/train record arrays to extract the - data specific to the given species name. - """ - bunch = Bunch(name=' '.join(species_name.split("_")[:2])) - species_name = species_name.encode('ascii') - points = dict(test=test, train=train) - - for label, pts in points.items(): - # choose points associated with the desired species - pts = pts[pts['species'] == species_name] - bunch['pts_%s' % label] = pts - - # determine coverage values for each of the training & testing points - ix = np.searchsorted(xgrid, pts['dd long']) - iy = np.searchsorted(ygrid, pts['dd lat']) - bunch['cov_%s' % label] = coverages[:, -iy, ix].T - - return bunch - - -def plot_species_distribution(species=["bradypus_variegatus_0", - "microryzomys_minutus_0"]): - """ - Plot the species distribution. - """ - if len(species) > 2: - print("Note: when more than two species are provided," - " only the first two will be used") - - t0 = time() - - # Load the compressed data - data = fetch_species_distributions() - - # Set up the data grid - xgrid, ygrid = construct_grids(data) - - # The grid in x,y coordinates - X, Y = np.meshgrid(xgrid, ygrid[::-1]) - - # create a bunch for each species - BV_bunch = create_species_bunch(species[0], - data.train, data.test, - data.coverages, xgrid, ygrid) - MM_bunch = create_species_bunch(species[1], - data.train, data.test, - data.coverages, xgrid, ygrid) - - # background points (grid coordinates) for evaluation - np.random.seed(13) - background_points = np.c_[np.random.randint(low=0, high=data.Ny, - size=10000), - np.random.randint(low=0, high=data.Nx, - size=10000)].T - - # We'll make use of the fact that coverages[6] has measurements at all - # land points. This will help us decide between land and water. - land_reference = data.coverages[6] - - # Fit, predict, and plot for each species. - for i, species in enumerate([BV_bunch, MM_bunch]): - print("_" * 80) - print("Modeling distribution of species '%s'" % species.name) - - # Standardize features - mean = species.cov_train.mean(axis=0) - std = species.cov_train.std(axis=0) - train_cover_std = (species.cov_train - mean) / std - - # Fit OneClassSVM - print(" - fit OneClassSVM ... ", end='') - clf = svm.OneClassSVM(nu=0.1, kernel="rbf", gamma=0.5) - clf.fit(train_cover_std) - print("done.") - - # Plot map of South America - plt.subplot(1, 2, i + 1) - if basemap: - print(" - plot coastlines using basemap") - m = Basemap(projection='cyl', llcrnrlat=Y.min(), - urcrnrlat=Y.max(), llcrnrlon=X.min(), - urcrnrlon=X.max(), resolution='c') - m.drawcoastlines() - m.drawcountries() - else: - print(" - plot coastlines from coverage") - plt.contour(X, Y, land_reference, - levels=[-9999], colors="k", - linestyles="solid") - plt.xticks([]) - plt.yticks([]) - - print(" - predict species distribution") - - # Predict species distribution using the training data - Z = np.ones((data.Ny, data.Nx), dtype=np.float64) - - # We'll predict only for the land points. - idx = np.where(land_reference > -9999) - coverages_land = data.coverages[:, idx[0], idx[1]].T - - pred = clf.decision_function((coverages_land - mean) / std)[:, 0] - Z *= pred.min() - Z[idx[0], idx[1]] = pred - - levels = np.linspace(Z.min(), Z.max(), 25) - Z[land_reference == -9999] = -9999 - - # plot contours of the prediction - plt.contourf(X, Y, Z, levels=levels, cmap=plt.cm.Reds) - plt.colorbar(format='%.2f') - - # scatter training/testing points - plt.scatter(species.pts_train['dd long'], species.pts_train['dd lat'], - s=2 ** 2, c='black', - marker='^', label='train') - plt.scatter(species.pts_test['dd long'], species.pts_test['dd lat'], - s=2 ** 2, c='black', - marker='x', label='test') - plt.legend() - plt.title(species.name) - plt.axis('equal') - - # Compute AUC with regards to background points - pred_background = Z[background_points[0], background_points[1]] - pred_test = clf.decision_function((species.cov_test - mean) - / std)[:, 0] - scores = np.r_[pred_test, pred_background] - y = np.r_[np.ones(pred_test.shape), np.zeros(pred_background.shape)] - fpr, tpr, thresholds = metrics.roc_curve(y, scores) - roc_auc = metrics.auc(fpr, tpr) - plt.text(-35, -70, "AUC: %.3f" % roc_auc, ha="right") - print("\n Area under the ROC curve : %f" % roc_auc) - - print("\ntime elapsed: %.2fs" % (time() - t0)) - - -plot_species_distribution() -plt.show() diff --git a/0.15/_downloads/plot_species_kde.py b/0.15/_downloads/plot_species_kde.py deleted file mode 100644 index 95f4417ce1bca..0000000000000 --- a/0.15/_downloads/plot_species_kde.py +++ /dev/null @@ -1,115 +0,0 @@ -""" -================================================ -Kernel Density Estimate of Species Distributions -================================================ -This shows an example of a neighbors-based query (in particular a kernel -density estimate) on geospatial data, using a Ball Tree built upon the -Haversine distance metric -- i.e. distances over points in latitude/longitude. -The dataset is provided by Phillips et. al. (2006). -If available, the example uses -`basemap `_ -to plot the coast lines and national boundaries of South America. - -This example does not perform any learning over the data -(see :ref:`example_applications_plot_species_distribution_modeling.py` for -an example of classification based on the attributes in this dataset). It -simply shows the kernel density estimate of observed data points in -geospatial coordinates. - -The two species are: - - - `"Bradypus variegatus" - `_ , - the Brown-throated Sloth. - - - `"Microryzomys minutus" - `_ , - also known as the Forest Small Rice Rat, a rodent that lives in Peru, - Colombia, Ecuador, Peru, and Venezuela. - -References ----------- - - * `"Maximum entropy modeling of species geographic distributions" - `_ - S. J. Phillips, R. P. Anderson, R. E. Schapire - Ecological Modelling, - 190:231-259, 2006. -""" -# Author: Jake Vanderplas -# -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from sklearn.datasets import fetch_species_distributions -from sklearn.datasets.species_distributions import construct_grids -from sklearn.neighbors import KernelDensity - -# if basemap is available, we'll use it. -# otherwise, we'll improvise later... -try: - from mpl_toolkits.basemap import Basemap - basemap = True -except ImportError: - basemap = False - -# Get matrices/arrays of species IDs and locations -data = fetch_species_distributions() -species_names = ['Bradypus Variegatus', 'Microryzomys Minutus'] - -Xtrain = np.vstack([data['train']['dd lat'], - data['train']['dd long']]).T -ytrain = np.array([d.decode('ascii').startswith('micro') - for d in data['train']['species']], dtype='int') -Xtrain *= np.pi / 180. # Convert lat/long to radians - -# Set up the data grid for the contour plot -xgrid, ygrid = construct_grids(data) -X, Y = np.meshgrid(xgrid[::5], ygrid[::5][::-1]) -land_reference = data.coverages[6][::5, ::5] -land_mask = (land_reference > -9999).ravel() - -xy = np.vstack([Y.ravel(), X.ravel()]).T -xy = xy[land_mask] -xy *= np.pi / 180. - -# Plot map of South America with distributions of each species -fig = plt.figure() -fig.subplots_adjust(left=0.05, right=0.95, wspace=0.05) - -for i in range(2): - plt.subplot(1, 2, i + 1) - - # construct a kernel density estimate of the distribution - print(" - computing KDE in spherical coordinates") - kde = KernelDensity(bandwidth=0.04, metric='haversine', - kernel='gaussian', algorithm='ball_tree') - kde.fit(Xtrain[ytrain == i]) - - # evaluate only on the land: -9999 indicates ocean - Z = -9999 + np.zeros(land_mask.shape[0]) - Z[land_mask] = np.exp(kde.score_samples(xy)) - Z = Z.reshape(X.shape) - - # plot contours of the density - levels = np.linspace(0, Z.max(), 25) - plt.contourf(X, Y, Z, levels=levels, cmap=plt.cm.Reds) - - if basemap: - print(" - plot coastlines using basemap") - m = Basemap(projection='cyl', llcrnrlat=Y.min(), - urcrnrlat=Y.max(), llcrnrlon=X.min(), - urcrnrlon=X.max(), resolution='c') - m.drawcoastlines() - m.drawcountries() - else: - print(" - plot coastlines from coverage") - plt.contour(X, Y, land_reference, - levels=[-9999], colors="k", - linestyles="solid") - plt.xticks([]) - plt.yticks([]) - - plt.title(species_names[i]) - -plt.show() diff --git a/0.15/_downloads/plot_spectral_biclustering.py b/0.15/_downloads/plot_spectral_biclustering.py deleted file mode 100644 index fdcbfcdcf7fc5..0000000000000 --- a/0.15/_downloads/plot_spectral_biclustering.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -============================================= -A demo of the Spectral Biclustering algorithm -============================================= - -This example demonstrates how to generate a checkerboard dataset and -bicluster it using the Spectral Biclustering algorithm. - -The data is generated with the ``make_checkerboard`` function, then -shuffled and passed to the Spectral Biclustering algorithm. The rows -and columns of the shuffled matrix are rearranged to show the -biclusters found by the algorithm. - -The outer product of the row and column label vectors shows a -representation of the checkerboard structure. - -""" -print(__doc__) - -# Author: Kemal Eren -# License: BSD 3 clause - -import numpy as np -from matplotlib import pyplot as plt - -from sklearn.datasets import make_checkerboard -from sklearn.datasets import samples_generator as sg -from sklearn.cluster.bicluster import SpectralBiclustering -from sklearn.metrics import consensus_score - -n_clusters = (4, 3) -data, rows, columns = make_checkerboard( - shape=(300, 300), n_clusters=n_clusters, noise=10, - shuffle=False, random_state=0) - -plt.matshow(data, cmap=plt.cm.Blues) -plt.title("Original dataset") - -data, row_idx, col_idx = sg._shuffle(data, random_state=0) -plt.matshow(data, cmap=plt.cm.Blues) -plt.title("Shuffled dataset") - -model = SpectralBiclustering(n_clusters=n_clusters, method='log', - random_state=0) -model.fit(data) -score = consensus_score(model.biclusters_, - (rows[:, row_idx], columns[:, col_idx])) - -print("consensus score: {:.1f}".format(score)) - -fit_data = data[np.argsort(model.row_labels_)] -fit_data = fit_data[:, np.argsort(model.column_labels_)] - -plt.matshow(fit_data, cmap=plt.cm.Blues) -plt.title("After biclustering; rearranged to show biclusters") - -plt.matshow(np.outer(np.sort(model.row_labels_) + 1, - np.sort(model.column_labels_) + 1), - cmap=plt.cm.Blues) -plt.title("Checkerboard structure of rearranged data") - -plt.show() diff --git a/0.15/_downloads/plot_spectral_coclustering.py b/0.15/_downloads/plot_spectral_coclustering.py deleted file mode 100644 index dbf53f269835e..0000000000000 --- a/0.15/_downloads/plot_spectral_coclustering.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -============================================== -A demo of the Spectral Co-Clustering algorithm -============================================== - -This example demonstrates how to generate a dataset and bicluster it -using the the Spectral Co-Clustering algorithm. - -The dataset is generated using the ``make_biclusters`` function, which -creates a matrix of small values and implants bicluster with large -values. The rows and columns are then shuffled and passed to the -Spectral Co-Clustering algorithm. Rearranging the shuffled matrix to -make biclusters contiguous shows how accurately the algorithm found -the biclusters. - -""" -print(__doc__) - -# Author: Kemal Eren -# License: BSD 3 clause - -import numpy as np -from matplotlib import pyplot as plt - -from sklearn.datasets import make_biclusters -from sklearn.datasets import samples_generator as sg -from sklearn.cluster.bicluster import SpectralCoclustering -from sklearn.metrics import consensus_score - -data, rows, columns = make_biclusters( - shape=(300, 300), n_clusters=5, noise=5, - shuffle=False, random_state=0) - -plt.matshow(data, cmap=plt.cm.Blues) -plt.title("Original dataset") - -data, row_idx, col_idx = sg._shuffle(data, random_state=0) -plt.matshow(data, cmap=plt.cm.Blues) -plt.title("Shuffled dataset") - -model = SpectralCoclustering(n_clusters=5, random_state=0) -model.fit(data) -score = consensus_score(model.biclusters_, - (rows[:, row_idx], columns[:, col_idx])) - -print("consensus score: {:.3f}".format(score)) - -fit_data = data[np.argsort(model.row_labels_)] -fit_data = fit_data[:, np.argsort(model.column_labels_)] - -plt.matshow(fit_data, cmap=plt.cm.Blues) -plt.title("After biclustering; rearranged to show biclusters") - -plt.show() diff --git a/0.15/_downloads/plot_stock_market.py b/0.15/_downloads/plot_stock_market.py deleted file mode 100644 index 6d88cd17e31d8..0000000000000 --- a/0.15/_downloads/plot_stock_market.py +++ /dev/null @@ -1,256 +0,0 @@ -""" -======================================= -Visualizing the stock market structure -======================================= - -This example employs several unsupervised learning techniques to extract -the stock market structure from variations in historical quotes. - -The quantity that we use is the daily variation in quote price: quotes -that are linked tend to cofluctuate during a day. - -.. _stock_market: - -Learning a graph structure --------------------------- - -We use sparse inverse covariance estimation to find which quotes are -correlated conditionally on the others. Specifically, sparse inverse -covariance gives us a graph, that is a list of connection. For each -symbol, the symbols that it is connected too are those useful to explain -its fluctuations. - -Clustering ----------- - -We use clustering to group together quotes that behave similarly. Here, -amongst the :ref:`various clustering techniques ` available -in the scikit-learn, we use :ref:`affinity_propagation` as it does -not enforce equal-size clusters, and it can choose automatically the -number of clusters from the data. - -Note that this gives us a different indication than the graph, as the -graph reflects conditional relations between variables, while the -clustering reflects marginal properties: variables clustered together can -be considered as having a similar impact at the level of the full stock -market. - -Embedding in 2D space ---------------------- - -For visualization purposes, we need to lay out the different symbols on a -2D canvas. For this we use :ref:`manifold` techniques to retrieve 2D -embedding. - - -Visualization -------------- - -The output of the 3 models are combined in a 2D graph where nodes -represents the stocks and edges the: - -- cluster labels are used to define the color of the nodes -- the sparse covariance model is used to display the strength of the edges -- the 2D embedding is used to position the nodes in the plan - -This example has a fair amount of visualization-related code, as -visualization is crucial here to display the graph. One of the challenge -is to position the labels minimizing overlap. For this we use an -heuristic based on the direction of the nearest neighbor along each -axis. -""" -print(__doc__) - -# Author: Gael Varoquaux gael.varoquaux@normalesup.org -# License: BSD 3 clause - -import datetime - -import numpy as np -import matplotlib.pyplot as plt -from matplotlib import finance -from matplotlib.collections import LineCollection - -from sklearn import cluster, covariance, manifold - -############################################################################### -# Retrieve the data from Internet - -# Choose a time period reasonnably calm (not too long ago so that we get -# high-tech firms, and before the 2008 crash) -d1 = datetime.datetime(2003, 1, 1) -d2 = datetime.datetime(2008, 1, 1) - -# kraft symbol has now changed from KFT to MDLZ in yahoo -symbol_dict = { - 'TOT': 'Total', - 'XOM': 'Exxon', - 'CVX': 'Chevron', - 'COP': 'ConocoPhillips', - 'VLO': 'Valero Energy', - 'MSFT': 'Microsoft', - 'IBM': 'IBM', - 'TWX': 'Time Warner', - 'CMCSA': 'Comcast', - 'CVC': 'Cablevision', - 'YHOO': 'Yahoo', - 'DELL': 'Dell', - 'HPQ': 'HP', - 'AMZN': 'Amazon', - 'TM': 'Toyota', - 'CAJ': 'Canon', - 'MTU': 'Mitsubishi', - 'SNE': 'Sony', - 'F': 'Ford', - 'HMC': 'Honda', - 'NAV': 'Navistar', - 'NOC': 'Northrop Grumman', - 'BA': 'Boeing', - 'KO': 'Coca Cola', - 'MMM': '3M', - 'MCD': 'Mc Donalds', - 'PEP': 'Pepsi', - 'MDLZ': 'Kraft Foods', - 'K': 'Kellogg', - 'UN': 'Unilever', - 'MAR': 'Marriott', - 'PG': 'Procter Gamble', - 'CL': 'Colgate-Palmolive', - 'GE': 'General Electrics', - 'WFC': 'Wells Fargo', - 'JPM': 'JPMorgan Chase', - 'AIG': 'AIG', - 'AXP': 'American express', - 'BAC': 'Bank of America', - 'GS': 'Goldman Sachs', - 'AAPL': 'Apple', - 'SAP': 'SAP', - 'CSCO': 'Cisco', - 'TXN': 'Texas instruments', - 'XRX': 'Xerox', - 'LMT': 'Lookheed Martin', - 'WMT': 'Wal-Mart', - 'WAG': 'Walgreen', - 'HD': 'Home Depot', - 'GSK': 'GlaxoSmithKline', - 'PFE': 'Pfizer', - 'SNY': 'Sanofi-Aventis', - 'NVS': 'Novartis', - 'KMB': 'Kimberly-Clark', - 'R': 'Ryder', - 'GD': 'General Dynamics', - 'RTN': 'Raytheon', - 'CVS': 'CVS', - 'CAT': 'Caterpillar', - 'DD': 'DuPont de Nemours'} - -symbols, names = np.array(list(symbol_dict.items())).T - -quotes = [finance.quotes_historical_yahoo(symbol, d1, d2, asobject=True) - for symbol in symbols] - -open = np.array([q.open for q in quotes]).astype(np.float) -close = np.array([q.close for q in quotes]).astype(np.float) - -# The daily variations of the quotes are what carry most information -variation = close - open - -############################################################################### -# Learn a graphical structure from the correlations -edge_model = covariance.GraphLassoCV() - -# standardize the time series: using correlations rather than covariance -# is more efficient for structure recovery -X = variation.copy().T -X /= X.std(axis=0) -edge_model.fit(X) - -############################################################################### -# Cluster using affinity propagation - -_, labels = cluster.affinity_propagation(edge_model.covariance_) -n_labels = labels.max() - -for i in range(n_labels + 1): - print('Cluster %i: %s' % ((i + 1), ', '.join(names[labels == i]))) - -############################################################################### -# Find a low-dimension embedding for visualization: find the best position of -# the nodes (the stocks) on a 2D plane - -# We use a dense eigen_solver to achieve reproducibility (arpack is -# initiated with random vectors that we don't control). In addition, we -# use a large number of neighbors to capture the large-scale structure. -node_position_model = manifold.LocallyLinearEmbedding( - n_components=2, eigen_solver='dense', n_neighbors=6) - -embedding = node_position_model.fit_transform(X.T).T - -############################################################################### -# Visualization -plt.figure(1, facecolor='w', figsize=(10, 8)) -plt.clf() -ax = plt.axes([0., 0., 1., 1.]) -plt.axis('off') - -# Display a graph of the partial correlations -partial_correlations = edge_model.precision_.copy() -d = 1 / np.sqrt(np.diag(partial_correlations)) -partial_correlations *= d -partial_correlations *= d[:, np.newaxis] -non_zero = (np.abs(np.triu(partial_correlations, k=1)) > 0.02) - -# Plot the nodes using the coordinates of our embedding -plt.scatter(embedding[0], embedding[1], s=100 * d ** 2, c=labels, - cmap=plt.cm.spectral) - -# Plot the edges -start_idx, end_idx = np.where(non_zero) -#a sequence of (*line0*, *line1*, *line2*), where:: -# linen = (x0, y0), (x1, y1), ... (xm, ym) -segments = [[embedding[:, start], embedding[:, stop]] - for start, stop in zip(start_idx, end_idx)] -values = np.abs(partial_correlations[non_zero]) -lc = LineCollection(segments, - zorder=0, cmap=plt.cm.hot_r, - norm=plt.Normalize(0, .7 * values.max())) -lc.set_array(values) -lc.set_linewidths(15 * values) -ax.add_collection(lc) - -# Add a label to each node. The challenge here is that we want to -# position the labels to avoid overlap with other labels -for index, (name, label, (x, y)) in enumerate( - zip(names, labels, embedding.T)): - - dx = x - embedding[0] - dx[index] = 1 - dy = y - embedding[1] - dy[index] = 1 - this_dx = dx[np.argmin(np.abs(dy))] - this_dy = dy[np.argmin(np.abs(dx))] - if this_dx > 0: - horizontalalignment = 'left' - x = x + .002 - else: - horizontalalignment = 'right' - x = x - .002 - if this_dy > 0: - verticalalignment = 'bottom' - y = y + .002 - else: - verticalalignment = 'top' - y = y - .002 - plt.text(x, y, name, size=10, - horizontalalignment=horizontalalignment, - verticalalignment=verticalalignment, - bbox=dict(facecolor='w', - edgecolor=plt.cm.spectral(label / float(n_labels)), - alpha=.6)) - -plt.xlim(embedding[0].min() - .15 * embedding[0].ptp(), - embedding[0].max() + .10 * embedding[0].ptp(),) -plt.ylim(embedding[1].min() - .03 * embedding[1].ptp(), - embedding[1].max() + .03 * embedding[1].ptp()) - -plt.show() diff --git a/0.15/_downloads/plot_svm_anova.py b/0.15/_downloads/plot_svm_anova.py deleted file mode 100644 index 9ce225bf980e5..0000000000000 --- a/0.15/_downloads/plot_svm_anova.py +++ /dev/null @@ -1,57 +0,0 @@ -""" -================================================= -SVM-Anova: SVM with univariate feature selection -================================================= - -This example shows how to perform univariate feature before running a SVC -(support vector classifier) to improve the classification scores. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm, datasets, feature_selection, cross_validation -from sklearn.pipeline import Pipeline - -############################################################################### -# Import some data to play with -digits = datasets.load_digits() -y = digits.target -# Throw away data, to be in the curse of dimension settings -y = y[:200] -X = digits.data[:200] -n_samples = len(y) -X = X.reshape((n_samples, -1)) -# add 200 non-informative features -X = np.hstack((X, 2 * np.random.random((n_samples, 200)))) - -############################################################################### -# Create a feature-selection transform and an instance of SVM that we -# combine together to have an full-blown estimator - -transform = feature_selection.SelectPercentile(feature_selection.f_classif) - -clf = Pipeline([('anova', transform), ('svc', svm.SVC(C=1.0))]) - -############################################################################### -# Plot the cross-validation score as a function of percentile of features -score_means = list() -score_stds = list() -percentiles = (1, 3, 6, 10, 15, 20, 30, 40, 60, 80, 100) - -for percentile in percentiles: - clf.set_params(anova__percentile=percentile) - # Compute cross-validation score using all CPUs - this_scores = cross_validation.cross_val_score(clf, X, y, n_jobs=1) - score_means.append(this_scores.mean()) - score_stds.append(this_scores.std()) - -plt.errorbar(percentiles, score_means, np.array(score_stds)) - -plt.title( - 'Performance of the SVM-Anova varying the percentile of features selected') -plt.xlabel('Percentile') -plt.ylabel('Prediction rate') - -plt.axis('tight') -plt.show() diff --git a/0.15/_downloads/plot_svm_kernels.py b/0.15/_downloads/plot_svm_kernels.py deleted file mode 100644 index f0d06dd7968a6..0000000000000 --- a/0.15/_downloads/plot_svm_kernels.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -SVM-Kernels -========================================================= - -Three different types of SVM-Kernels are displayed below. -The polynomial and RBF are especially useful when the -data-points are not linearly separable. - - -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm - - -# Our dataset and targets -X = np.c_[(.4, -.7), - (-1.5, -1), - (-1.4, -.9), - (-1.3, -1.2), - (-1.1, -.2), - (-1.2, -.4), - (-.5, 1.2), - (-1.5, 2.1), - (1, 1), - # -- - (1.3, .8), - (1.2, .5), - (.2, -2), - (.5, -2.4), - (.2, -2.3), - (0, -2.7), - (1.3, 2.1)].T -Y = [0] * 8 + [1] * 8 - -# figure number -fignum = 1 - -# fit the model -for kernel in ('linear', 'poly', 'rbf'): - clf = svm.SVC(kernel=kernel, gamma=2) - clf.fit(X, Y) - - # plot the line, the points, and the nearest vectors to the plane - plt.figure(fignum, figsize=(4, 3)) - plt.clf() - - plt.scatter(clf.support_vectors_[:, 0], clf.support_vectors_[:, 1], s=80, - facecolors='none', zorder=10) - plt.scatter(X[:, 0], X[:, 1], c=Y, zorder=10, cmap=plt.cm.Paired) - - plt.axis('tight') - x_min = -3 - x_max = 3 - y_min = -3 - y_max = 3 - - XX, YY = np.mgrid[x_min:x_max:200j, y_min:y_max:200j] - Z = clf.decision_function(np.c_[XX.ravel(), YY.ravel()]) - - # Put the result into a color plot - Z = Z.reshape(XX.shape) - plt.figure(fignum, figsize=(4, 3)) - plt.pcolormesh(XX, YY, Z > 0, cmap=plt.cm.Paired) - plt.contour(XX, YY, Z, colors=['k', 'k', 'k'], linestyles=['--', '-', '--'], - levels=[-.5, 0, .5]) - - plt.xlim(x_min, x_max) - plt.ylim(y_min, y_max) - - plt.xticks(()) - plt.yticks(()) - fignum = fignum + 1 -plt.show() diff --git a/0.15/_downloads/plot_svm_margin.py b/0.15/_downloads/plot_svm_margin.py deleted file mode 100644 index a999ea34d33e2..0000000000000 --- a/0.15/_downloads/plot_svm_margin.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -""" -========================================================= -SVM Margins Example -========================================================= -The plots below illustrate the effect the parameter `C` has -on the separation line. A large value of `C` basically tells -our model that we do not have that much faith in our data's -distribution, and will only consider points close to line -of separation. - -A small value of `C` includes more/all the observations, allowing -the margins to be calculated using all the data in the area. - -""" -print(__doc__) - - -# Code source: Gaël Varoquaux -# Modified for documentation by Jaques Grobler -# License: BSD 3 clause - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm - -# we create 40 separable points -np.random.seed(0) -X = np.r_[np.random.randn(20, 2) - [2, 2], np.random.randn(20, 2) + [2, 2]] -Y = [0] * 20 + [1] * 20 - -# figure number -fignum = 1 - -# fit the model -for name, penalty in (('unreg', 1), ('reg', 0.05)): - - clf = svm.SVC(kernel='linear', C=penalty) - clf.fit(X, Y) - - # get the separating hyperplane - w = clf.coef_[0] - a = -w[0] / w[1] - xx = np.linspace(-5, 5) - yy = a * xx - (clf.intercept_[0]) / w[1] - - # plot the parallels to the separating hyperplane that pass through the - # support vectors - margin = 1 / np.sqrt(np.sum(clf.coef_ ** 2)) - yy_down = yy + a * margin - yy_up = yy - a * margin - - # plot the line, the points, and the nearest vectors to the plane - plt.figure(fignum, figsize=(4, 3)) - plt.clf() - plt.plot(xx, yy, 'k-') - plt.plot(xx, yy_down, 'k--') - plt.plot(xx, yy_up, 'k--') - - plt.scatter(clf.support_vectors_[:, 0], clf.support_vectors_[:, 1], s=80, - facecolors='none', zorder=10) - plt.scatter(X[:, 0], X[:, 1], c=Y, zorder=10, cmap=plt.cm.Paired) - - plt.axis('tight') - x_min = -4.8 - x_max = 4.2 - y_min = -6 - y_max = 6 - - XX, YY = np.mgrid[x_min:x_max:200j, y_min:y_max:200j] - Z = clf.predict(np.c_[XX.ravel(), YY.ravel()]) - - # Put the result into a color plot - Z = Z.reshape(XX.shape) - plt.figure(fignum, figsize=(4, 3)) - plt.pcolormesh(XX, YY, Z, cmap=plt.cm.Paired) - - plt.xlim(x_min, x_max) - plt.ylim(y_min, y_max) - - plt.xticks(()) - plt.yticks(()) - fignum = fignum + 1 - -plt.show() diff --git a/0.15/_downloads/plot_svm_nonlinear.py b/0.15/_downloads/plot_svm_nonlinear.py deleted file mode 100644 index 672a19d30705b..0000000000000 --- a/0.15/_downloads/plot_svm_nonlinear.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -============== -Non-linear SVM -============== - -Perform binary classification using non-linear SVC -with RBF kernel. The target to predict is a XOR of the -inputs. - -The color map illustrates the decision function learn by the SVC. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm - -xx, yy = np.meshgrid(np.linspace(-3, 3, 500), - np.linspace(-3, 3, 500)) -np.random.seed(0) -X = np.random.randn(300, 2) -Y = np.logical_xor(X[:, 0] > 0, X[:, 1] > 0) - -# fit the model -clf = svm.NuSVC() -clf.fit(X, Y) - -# plot the decision function for each datapoint on the grid -Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) -Z = Z.reshape(xx.shape) - -plt.imshow(Z, interpolation='nearest', - extent=(xx.min(), xx.max(), yy.min(), yy.max()), aspect='auto', - origin='lower', cmap=plt.cm.PuOr_r) -contours = plt.contour(xx, yy, Z, levels=[0], linewidths=2, - linetypes='--') -plt.scatter(X[:, 0], X[:, 1], s=30, c=Y, cmap=plt.cm.Paired) -plt.xticks(()) -plt.yticks(()) -plt.axis([-3, 3, -3, 3]) -plt.show() diff --git a/0.15/_downloads/plot_svm_regression.py b/0.15/_downloads/plot_svm_regression.py deleted file mode 100644 index a507bce38ec2a..0000000000000 --- a/0.15/_downloads/plot_svm_regression.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -=================================================================== -Support Vector Regression (SVR) using linear and non-linear kernels -=================================================================== - -Toy example of 1D regression using linear, polynomial and RBF kernels. - -""" -print(__doc__) - -import numpy as np -from sklearn.svm import SVR -import matplotlib.pyplot as plt - -############################################################################### -# Generate sample data -X = np.sort(5 * np.random.rand(40, 1), axis=0) -y = np.sin(X).ravel() - -############################################################################### -# Add noise to targets -y[::5] += 3 * (0.5 - np.random.rand(8)) - -############################################################################### -# Fit regression model -svr_rbf = SVR(kernel='rbf', C=1e3, gamma=0.1) -svr_lin = SVR(kernel='linear', C=1e3) -svr_poly = SVR(kernel='poly', C=1e3, degree=2) -y_rbf = svr_rbf.fit(X, y).predict(X) -y_lin = svr_lin.fit(X, y).predict(X) -y_poly = svr_poly.fit(X, y).predict(X) - -############################################################################### -# look at the results -plt.scatter(X, y, c='k', label='data') -plt.hold('on') -plt.plot(X, y_rbf, c='g', label='RBF model') -plt.plot(X, y_lin, c='r', label='Linear model') -plt.plot(X, y_poly, c='b', label='Polynomial model') -plt.xlabel('data') -plt.ylabel('target') -plt.title('Support Vector Regression') -plt.legend() -plt.show() diff --git a/0.15/_downloads/plot_svm_scale_c.py b/0.15/_downloads/plot_svm_scale_c.py deleted file mode 100644 index bd3fd69deb41e..0000000000000 --- a/0.15/_downloads/plot_svm_scale_c.py +++ /dev/null @@ -1,151 +0,0 @@ -""" -============================================== -Scaling the regularization parameter for SVCs -============================================== - -The following example illustrates the effect of scaling the -regularization parameter when using :ref:`svm` for -:ref:`classification `. -For SVC classification, we are interested in a risk minimization for the -equation: - - -.. math:: - - C \sum_{i=1, n} \mathcal{L} (f(x_i), y_i) + \Omega (w) - -where - - - :math:`C` is used to set the amount of regularization - - :math:`\mathcal{L}` is a `loss` function of our samples - and our model parameters. - - :math:`\Omega` is a `penalty` function of our model parameters - -If we consider the loss function to be the individual error per -sample, then the data-fit term, or the sum of the error for each sample, will -increase as we add more samples. The penalization term, however, will not -increase. - -When using, for example, :ref:`cross validation `, to -set the amount of regularization with `C`, there will be a -different amount of samples between the main problem and the smaller problems -within the folds of the cross validation. - -Since our loss function is dependent on the amount of samples, the latter -will influence the selected value of `C`. -The question that arises is `How do we optimally adjust C to -account for the different amount of training samples?` - -The figures below are used to illustrate the effect of scaling our -`C` to compensate for the change in the number of samples, in the -case of using an `L1` penalty, as well as the `L2` penalty. - -L1-penalty case ------------------ -In the `L1` case, theory says that prediction consistency -(i.e. that under given hypothesis, the estimator -learned predicts as well as a model knowing the true distribution) -is not possible because of the bias of the `L1`. It does say, however, -that model consistency, in terms of finding the right set of non-zero -parameters as well as their signs, can be achieved by scaling -`C1`. - -L2-penalty case ------------------ -The theory says that in order to achieve prediction consistency, the -penalty parameter should be kept constant -as the number of samples grow. - -Simulations ------------- - -The two figures below plot the values of `C` on the `x-axis` and the -corresponding cross-validation scores on the `y-axis`, for several different -fractions of a generated data-set. - -In the `L1` penalty case, the cross-validation-error correlates best with -the test-error, when scaling our `C` with the number of samples, `n`, -which can be seen in the first figure. - -For the `L2` penalty case, the best result comes from the case where `C` -is not scaled. - -.. topic:: Note: - - Two separate datasets are used for the two different plots. The reason - behind this is the `L1` case works better on sparse data, while `L2` - is better suited to the non-sparse case. -""" -print(__doc__) - - -# Author: Andreas Mueller -# Jaques Grobler -# License: BSD 3 clause - - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.svm import LinearSVC -from sklearn.cross_validation import ShuffleSplit -from sklearn.grid_search import GridSearchCV -from sklearn.utils import check_random_state -from sklearn import datasets - - -rnd = check_random_state(1) - -# set up dataset -n_samples = 100 -n_features = 300 - -# L1 data (only 5 informative features) -X_1, y_1 = datasets.make_classification(n_samples=n_samples, - n_features=n_features, n_informative=5, - random_state=1) - -# L2 data: non sparse, but less features -y_2 = np.sign(.5 - rnd.rand(n_samples)) -X_2 = rnd.randn(n_samples, n_features / 5) + y_2[:, np.newaxis] -X_2 += 5 * rnd.randn(n_samples, n_features / 5) - -clf_sets = [(LinearSVC(penalty='L1', loss='L2', dual=False, - tol=1e-3), - np.logspace(-2.3, -1.3, 10), X_1, y_1), - (LinearSVC(penalty='L2', loss='L2', dual=True, - tol=1e-4), - np.logspace(-4.5, -2, 10), X_2, y_2)] - -colors = ['b', 'g', 'r', 'c'] - -for fignum, (clf, cs, X, y) in enumerate(clf_sets): - # set up the plot for each regressor - plt.figure(fignum, figsize=(9, 10)) - - for k, train_size in enumerate(np.linspace(0.3, 0.7, 3)[::-1]): - param_grid = dict(C=cs) - # To get nice curve, we need a large number of iterations to - # reduce the variance - grid = GridSearchCV(clf, refit=False, param_grid=param_grid, - cv=ShuffleSplit(n=n_samples, train_size=train_size, - n_iter=250, random_state=1)) - grid.fit(X, y) - scores = [x[1] for x in grid.grid_scores_] - - scales = [(1, 'No scaling'), - ((n_samples * train_size), '1/n_samples'), - ] - - for subplotnum, (scaler, name) in enumerate(scales): - plt.subplot(2, 1, subplotnum + 1) - plt.xlabel('C') - plt.ylabel('CV Score') - grid_cs = cs * float(scaler) # scale the C's - plt.semilogx(grid_cs, scores, label="fraction %.2f" % - train_size) - plt.title('scaling=%s, penalty=%s, loss=%s' % - (name, clf.penalty, clf.loss)) - - plt.legend(loc="best") -plt.show() diff --git a/0.15/_downloads/plot_swissroll.py b/0.15/_downloads/plot_swissroll.py deleted file mode 100644 index 17c318cab7093..0000000000000 --- a/0.15/_downloads/plot_swissroll.py +++ /dev/null @@ -1,50 +0,0 @@ -""" -=================================== -Swiss Roll reduction with LLE -=================================== - -An illustration of Swiss Roll reduction -with locally linear embedding -""" - -# Author: Fabian Pedregosa -- -# License: BSD 3 clause (C) INRIA 2011 - -print(__doc__) - -import matplotlib.pyplot as plt - -# This import is needed to modify the way figure behaves -from mpl_toolkits.mplot3d import Axes3D -Axes3D - -#---------------------------------------------------------------------- -# Locally linear embedding of the swiss roll - -from sklearn import manifold, datasets -X, color = datasets.samples_generator.make_swiss_roll(n_samples=1500) - -print("Computing LLE embedding") -X_r, err = manifold.locally_linear_embedding(X, n_neighbors=12, - n_components=2) -print("Done. Reconstruction error: %g" % err) - -#---------------------------------------------------------------------- -# Plot result - -fig = plt.figure() -try: - # compatibility matplotlib < 1.0 - ax = fig.add_subplot(211, projection='3d') - ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=color, cmap=plt.cm.Spectral) -except: - ax = fig.add_subplot(211) - ax.scatter(X[:, 0], X[:, 2], c=color, cmap=plt.cm.Spectral) - -ax.set_title("Original data") -ax = fig.add_subplot(212) -ax.scatter(X_r[:, 0], X_r[:, 1], c=color, cmap=plt.cm.Spectral) -plt.axis('tight') -plt.xticks([]), plt.yticks([]) -plt.title('Projected data') -plt.show() diff --git a/0.15/_downloads/plot_theilsen.py b/0.15/_downloads/plot_theilsen.py deleted file mode 100644 index fc0ba571cc76f..0000000000000 --- a/0.15/_downloads/plot_theilsen.py +++ /dev/null @@ -1,108 +0,0 @@ -""" -==================== -Theil-Sen Regression -==================== - -Computes a Theil-Sen Regression on a synthetic dataset. - -See :ref:`theil_sen_regression` for more information on the regressor. - -Compared to the OLS (ordinary least squares) estimator, the Theil-Sen -estimator is robust against outliers. It has a breakdown point of about 29.3% -in case of a simple linear regression which means that it can tolerate -arbitrary corrupted data (outliers) of up to 29.3% in the two-dimensional -case. - -The estimation of the model is done by calculating the slopes and intercepts -of a subpopulation of all possible combinations of p subsample points. If an -intercept is fitted, p must be greater than or equal to n_features + 1. The -final slope and intercept is then defined as the spatial median of these -slopes and intercepts. - -In certain cases Theil-Sen performs better than :ref:`RANSAC -` which is also a robust method. This is illustrated in the -second example below where outliers with respect to the x-axis perturb RANSAC. -Tuning the ``residual_threshold`` parameter of RANSAC remedies this but in -general a priori knowledge about the data and the nature of the outliers is -needed. -Due to the computational complexity of Theil-Sen it is recommended to use it -only for small problems in terms of number of samples and features. For larger -problems the ``max_subpopulation`` parameter restricts the magnitude of all -possible combinations of p subsample points to a randomly chosen subset and -therefore also limits the runtime. Therefore, Theil-Sen is applicable to larger -problems with the drawback of losing some of its mathematical properties since -it then works on a random subset. -""" - -# Author: Florian Wilhelm -- -# License: BSD 3 clause - -import time -import numpy as np -import matplotlib.pyplot as plt -from sklearn.linear_model import LinearRegression, TheilSenRegressor -from sklearn.linear_model import RANSACRegressor - -print(__doc__) - -estimators = [('OLS', LinearRegression()), - ('Theil-Sen', TheilSenRegressor(random_state=42)), - ('RANSAC', RANSACRegressor(random_state=42)), ] - -############################################################################## -# Outliers only in the y direction - -np.random.seed(0) -n_samples = 200 -# Linear model y = 3*x + N(2, 0.1**2) -x = np.random.randn(n_samples) -w = 3. -c = 2. -noise = 0.1 * np.random.randn(n_samples) -y = w * x + c + noise -# 10% outliers -y[-20:] += -20 * x[-20:] -X = x[:, np.newaxis] - -plt.plot(x, y, 'k+', mew=2, ms=8) -line_x = np.array([-3, 3]) -for name, estimator in estimators: - t0 = time.time() - estimator.fit(X, y) - elapsed_time = time.time() - t0 - y_pred = estimator.predict(line_x.reshape(2, 1)) - plt.plot(line_x, y_pred, - label='%s (fit time: %.2fs)' % (name, elapsed_time)) - -plt.axis('tight') -plt.legend(loc='upper left') - - -############################################################################## -# Outliers in the X direction - -np.random.seed(0) -# Linear model y = 3*x + N(2, 0.1**2) -x = np.random.randn(n_samples) -noise = 0.1 * np.random.randn(n_samples) -y = 3 * x + 2 + noise -# 10% outliers -x[-20:] = 9.9 -y[-20:] += 22 -X = x[:, np.newaxis] - -plt.figure() -plt.plot(x, y, 'k+', mew=2, ms=8) - -line_x = np.array([-3, 10]) -for name, estimator in estimators: - t0 = time.time() - estimator.fit(X, y) - elapsed_time = time.time() - t0 - y_pred = estimator.predict(line_x.reshape(2, 1)) - plt.plot(line_x, y_pred, - label='%s (fit time: %.2fs)' % (name, elapsed_time)) - -plt.axis('tight') -plt.legend(loc='upper left') -plt.show() diff --git a/0.15/_downloads/plot_tomography_l1_reconstruction.py b/0.15/_downloads/plot_tomography_l1_reconstruction.py deleted file mode 100644 index 676b4cdedf863..0000000000000 --- a/0.15/_downloads/plot_tomography_l1_reconstruction.py +++ /dev/null @@ -1,150 +0,0 @@ -""" -====================================================================== -Compressive sensing: tomography reconstruction with L1 prior (Lasso) -====================================================================== - -This example shows the reconstruction of an image from a set of parallel -projections, acquired along different angles. Such a dataset is acquired in -**computed tomography** (CT). - -Without any prior information on the sample, the number of projections -required to reconstruct the image is of the order of the linear size -``l`` of the image (in pixels). For simplicity we consider here a sparse -image, where only pixels on the boundary of objects have a non-zero -value. Such data could correspond for example to a cellular material. -Note however that most images are sparse in a different basis, such as -the Haar wavelets. Only ``l/7`` projections are acquired, therefore it is -necessary to use prior information available on the sample (its -sparsity): this is an example of **compressive sensing**. - -The tomography projection operation is a linear transformation. In -addition to the data-fidelity term corresponding to a linear regression, -we penalize the L1 norm of the image to account for its sparsity. The -resulting optimization problem is called the :ref:`lasso`. We use the -class :class:`sklearn.linear_model.Lasso`, that uses the coordinate descent -algorithm. Importantly, this implementation is more computationally efficient -on a sparse matrix, than the projection operator used here. - -The reconstruction with L1 penalization gives a result with zero error -(all pixels are successfully labeled with 0 or 1), even if noise was -added to the projections. In comparison, an L2 penalization -(:class:`sklearn.linear_model.Ridge`) produces a large number of labeling -errors for the pixels. Important artifacts are observed on the -reconstructed image, contrary to the L1 penalization. Note in particular -the circular artifact separating the pixels in the corners, that have -contributed to fewer projections than the central disk. -""" - -print(__doc__) - -# Author: Emmanuelle Gouillart -# License: BSD 3 clause - -import numpy as np -from scipy import sparse -from scipy import ndimage -from sklearn.linear_model import Lasso -from sklearn.linear_model import Ridge -import matplotlib.pyplot as plt - - -def _weights(x, dx=1, orig=0): - x = np.ravel(x) - floor_x = np.floor((x - orig) / dx) - alpha = (x - orig - floor_x * dx) / dx - return np.hstack((floor_x, floor_x + 1)), np.hstack((1 - alpha, alpha)) - - -def _generate_center_coordinates(l_x): - l_x = float(l_x) - X, Y = np.mgrid[:l_x, :l_x] - center = l_x / 2. - X += 0.5 - center - Y += 0.5 - center - return X, Y - - -def build_projection_operator(l_x, n_dir): - """ Compute the tomography design matrix. - - Parameters - ---------- - - l_x : int - linear size of image array - - n_dir : int - number of angles at which projections are acquired. - - Returns - ------- - p : sparse matrix of shape (n_dir l_x, l_x**2) - """ - X, Y = _generate_center_coordinates(l_x) - angles = np.linspace(0, np.pi, n_dir, endpoint=False) - data_inds, weights, camera_inds = [], [], [] - data_unravel_indices = np.arange(l_x ** 2) - data_unravel_indices = np.hstack((data_unravel_indices, - data_unravel_indices)) - for i, angle in enumerate(angles): - Xrot = np.cos(angle) * X - np.sin(angle) * Y - inds, w = _weights(Xrot, dx=1, orig=X.min()) - mask = np.logical_and(inds >= 0, inds < l_x) - weights += list(w[mask]) - camera_inds += list(inds[mask] + i * l_x) - data_inds += list(data_unravel_indices[mask]) - proj_operator = sparse.coo_matrix((weights, (camera_inds, data_inds))) - return proj_operator - - -def generate_synthetic_data(): - """ Synthetic binary data """ - rs = np.random.RandomState(0) - n_pts = 36. - x, y = np.ogrid[0:l, 0:l] - mask_outer = (x - l / 2) ** 2 + (y - l / 2) ** 2 < (l / 2) ** 2 - mask = np.zeros((l, l)) - points = l * rs.rand(2, n_pts) - mask[(points[0]).astype(np.int), (points[1]).astype(np.int)] = 1 - mask = ndimage.gaussian_filter(mask, sigma=l / n_pts) - res = np.logical_and(mask > mask.mean(), mask_outer) - return res - ndimage.binary_erosion(res) - - -# Generate synthetic images, and projections -l = 128 -proj_operator = build_projection_operator(l, l / 7.) -data = generate_synthetic_data() -proj = proj_operator * data.ravel()[:, np.newaxis] -proj += 0.15 * np.random.randn(*proj.shape) - -# Reconstruction with L2 (Ridge) penalization -rgr_ridge = Ridge(alpha=0.2) -rgr_ridge.fit(proj_operator, proj.ravel()) -rec_l2 = rgr_ridge.coef_.reshape(l, l) - -# Reconstruction with L1 (Lasso) penalization -# the best value of alpha was determined using cross validation -# with LassoCV -rgr_lasso = Lasso(alpha=0.001) -rgr_lasso.fit(proj_operator, proj.ravel()) -rec_l1 = rgr_lasso.coef_.reshape(l, l) - -plt.figure(figsize=(8, 3.3)) -plt.subplot(131) -plt.imshow(data, cmap=plt.cm.gray, interpolation='nearest') -plt.axis('off') -plt.title('original image') -plt.subplot(132) -plt.imshow(rec_l2, cmap=plt.cm.gray, interpolation='nearest') -plt.title('L2 penalization') -plt.axis('off') -plt.subplot(133) -plt.imshow(rec_l1, cmap=plt.cm.gray, interpolation='nearest') -plt.title('L1 penalization') -plt.axis('off') - -plt.subplots_adjust(hspace=0.01, wspace=0.01, top=1, bottom=0, left=0, - right=1) - -plt.show() diff --git a/0.15/_downloads/plot_train_error_vs_test_error.py b/0.15/_downloads/plot_train_error_vs_test_error.py deleted file mode 100644 index 9002a0a3a5f30..0000000000000 --- a/0.15/_downloads/plot_train_error_vs_test_error.py +++ /dev/null @@ -1,75 +0,0 @@ -""" -========================= -Train error vs Test error -========================= - -Illustration of how the performance of an estimator on unseen data (test data) -is not the same as the performance on training data. As the regularization -increases the performance on train decreases while the performance on test -is optimal within a range of values of the regularization parameter. -The example with an Elastic-Net regression model and the performance is -measured using the explained variance a.k.a. R^2. - -""" -print(__doc__) - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -import numpy as np -from sklearn import linear_model - -############################################################################### -# Generate sample data -n_samples_train, n_samples_test, n_features = 75, 150, 500 -np.random.seed(0) -coef = np.random.randn(n_features) -coef[50:] = 0.0 # only the top 10 features are impacting the model -X = np.random.randn(n_samples_train + n_samples_test, n_features) -y = np.dot(X, coef) - -# Split train and test data -X_train, X_test = X[:n_samples_train], X[n_samples_train:] -y_train, y_test = y[:n_samples_train], y[n_samples_train:] - -############################################################################### -# Compute train and test errors -alphas = np.logspace(-5, 1, 60) -enet = linear_model.ElasticNet(l1_ratio=0.7) -train_errors = list() -test_errors = list() -for alpha in alphas: - enet.set_params(alpha=alpha) - enet.fit(X_train, y_train) - train_errors.append(enet.score(X_train, y_train)) - test_errors.append(enet.score(X_test, y_test)) - -i_alpha_optim = np.argmax(test_errors) -alpha_optim = alphas[i_alpha_optim] -print("Optimal regularization parameter : %s" % alpha_optim) - -# Estimate the coef_ on full data with optimal regularization parameter -enet.set_params(alpha=alpha_optim) -coef_ = enet.fit(X, y).coef_ - -############################################################################### -# Plot results functions - -import matplotlib.pyplot as plt -plt.subplot(2, 1, 1) -plt.semilogx(alphas, train_errors, label='Train') -plt.semilogx(alphas, test_errors, label='Test') -plt.vlines(alpha_optim, plt.ylim()[0], np.max(test_errors), color='k', - linewidth=3, label='Optimum on test') -plt.legend(loc='lower left') -plt.ylim([0, 1.2]) -plt.xlabel('Regularization parameter') -plt.ylabel('Performance') - -# Show estimated coef_ vs true coef -plt.subplot(2, 1, 2) -plt.plot(coef, label='True coef') -plt.plot(coef_, label='Estimated coef') -plt.legend() -plt.subplots_adjust(0.09, 0.04, 0.94, 0.94, 0.26, 0.26) -plt.show() diff --git a/0.15/_downloads/plot_train_error_vs_test_error1.py b/0.15/_downloads/plot_train_error_vs_test_error1.py deleted file mode 100644 index 9002a0a3a5f30..0000000000000 --- a/0.15/_downloads/plot_train_error_vs_test_error1.py +++ /dev/null @@ -1,75 +0,0 @@ -""" -========================= -Train error vs Test error -========================= - -Illustration of how the performance of an estimator on unseen data (test data) -is not the same as the performance on training data. As the regularization -increases the performance on train decreases while the performance on test -is optimal within a range of values of the regularization parameter. -The example with an Elastic-Net regression model and the performance is -measured using the explained variance a.k.a. R^2. - -""" -print(__doc__) - -# Author: Alexandre Gramfort -# License: BSD 3 clause - -import numpy as np -from sklearn import linear_model - -############################################################################### -# Generate sample data -n_samples_train, n_samples_test, n_features = 75, 150, 500 -np.random.seed(0) -coef = np.random.randn(n_features) -coef[50:] = 0.0 # only the top 10 features are impacting the model -X = np.random.randn(n_samples_train + n_samples_test, n_features) -y = np.dot(X, coef) - -# Split train and test data -X_train, X_test = X[:n_samples_train], X[n_samples_train:] -y_train, y_test = y[:n_samples_train], y[n_samples_train:] - -############################################################################### -# Compute train and test errors -alphas = np.logspace(-5, 1, 60) -enet = linear_model.ElasticNet(l1_ratio=0.7) -train_errors = list() -test_errors = list() -for alpha in alphas: - enet.set_params(alpha=alpha) - enet.fit(X_train, y_train) - train_errors.append(enet.score(X_train, y_train)) - test_errors.append(enet.score(X_test, y_test)) - -i_alpha_optim = np.argmax(test_errors) -alpha_optim = alphas[i_alpha_optim] -print("Optimal regularization parameter : %s" % alpha_optim) - -# Estimate the coef_ on full data with optimal regularization parameter -enet.set_params(alpha=alpha_optim) -coef_ = enet.fit(X, y).coef_ - -############################################################################### -# Plot results functions - -import matplotlib.pyplot as plt -plt.subplot(2, 1, 1) -plt.semilogx(alphas, train_errors, label='Train') -plt.semilogx(alphas, test_errors, label='Test') -plt.vlines(alpha_optim, plt.ylim()[0], np.max(test_errors), color='k', - linewidth=3, label='Optimum on test') -plt.legend(loc='lower left') -plt.ylim([0, 1.2]) -plt.xlabel('Regularization parameter') -plt.ylabel('Performance') - -# Show estimated coef_ vs true coef -plt.subplot(2, 1, 2) -plt.plot(coef, label='True coef') -plt.plot(coef_, label='Estimated coef') -plt.legend() -plt.subplots_adjust(0.09, 0.04, 0.94, 0.94, 0.26, 0.26) -plt.show() diff --git a/0.15/_downloads/plot_tree_regression.py b/0.15/_downloads/plot_tree_regression.py deleted file mode 100644 index 63ff810ec7d2c..0000000000000 --- a/0.15/_downloads/plot_tree_regression.py +++ /dev/null @@ -1,50 +0,0 @@ -""" -=================================================================== -Decision Tree Regression -=================================================================== - -A 1D regression with decision tree. - -The :ref:`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 numpy as np - -# Create a random dataset -rng = np.random.RandomState(1) -X = np.sort(5 * rng.rand(80, 1), axis=0) -y = np.sin(X).ravel() -y[::5] += 3 * (0.5 - rng.rand(16)) - -# Fit regression model -from sklearn.tree import DecisionTreeRegressor - -clf_1 = DecisionTreeRegressor(max_depth=2) -clf_2 = DecisionTreeRegressor(max_depth=5) -clf_1.fit(X, y) -clf_2.fit(X, y) - -# Predict -X_test = np.arange(0.0, 5.0, 0.01)[:, np.newaxis] -y_1 = clf_1.predict(X_test) -y_2 = clf_2.predict(X_test) - -# Plot the results -import matplotlib.pyplot as plt - -plt.figure() -plt.scatter(X, y, c="k", label="data") -plt.plot(X_test, y_1, c="g", label="max_depth=2", linewidth=2) -plt.plot(X_test, y_2, c="r", label="max_depth=5", linewidth=2) -plt.xlabel("data") -plt.ylabel("target") -plt.title("Decision Tree Regression") -plt.legend() -plt.show() diff --git a/0.15/_downloads/plot_tree_regression_multioutput.py b/0.15/_downloads/plot_tree_regression_multioutput.py deleted file mode 100644 index e3130e128dc56..0000000000000 --- a/0.15/_downloads/plot_tree_regression_multioutput.py +++ /dev/null @@ -1,55 +0,0 @@ -""" -=================================================================== -Multi-output Decision Tree Regression -=================================================================== - -An example to illustrate multi-output regression with decision tree. - -The :ref:`decision trees ` -is used to predict simultaneously the noisy x and y observations of a circle -given a single underlying feature. As a result, it learns local linear -regressions approximating the circle. - -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 numpy as np -import matplotlib.pyplot as plt -from sklearn.tree import DecisionTreeRegressor - -# Create a random dataset -rng = np.random.RandomState(1) -X = np.sort(200 * rng.rand(100, 1) - 100, axis=0) -y = np.array([np.pi * np.sin(X).ravel(), np.pi * np.cos(X).ravel()]).T -y[::5, :] += (0.5 - rng.rand(20, 2)) - -# Fit regression model -clf_1 = DecisionTreeRegressor(max_depth=2) -clf_2 = DecisionTreeRegressor(max_depth=5) -clf_3 = DecisionTreeRegressor(max_depth=8) -clf_1.fit(X, y) -clf_2.fit(X, y) -clf_3.fit(X, y) - -# Predict -X_test = np.arange(-100.0, 100.0, 0.01)[:, np.newaxis] -y_1 = clf_1.predict(X_test) -y_2 = clf_2.predict(X_test) -y_3 = clf_3.predict(X_test) - -# Plot the results -plt.figure() -plt.scatter(y[:, 0], y[:, 1], c="k", label="data") -plt.scatter(y_1[:, 0], y_1[:, 1], c="g", label="max_depth=2") -plt.scatter(y_2[:, 0], y_2[:, 1], c="r", label="max_depth=5") -plt.scatter(y_3[:, 0], y_3[:, 1], c="b", label="max_depth=8") -plt.xlim([-6, 6]) -plt.ylim([-6, 6]) -plt.xlabel("data") -plt.ylabel("target") -plt.title("Multi-output Decision Tree Regression") -plt.legend() -plt.show() diff --git a/0.15/_downloads/plot_underfitting_overfitting.py b/0.15/_downloads/plot_underfitting_overfitting.py deleted file mode 100644 index f8958cbffe21b..0000000000000 --- a/0.15/_downloads/plot_underfitting_overfitting.py +++ /dev/null @@ -1,68 +0,0 @@ -""" -============================ -Underfitting vs. Overfitting -============================ - -This example demonstrates the problems of underfitting and overfitting and -how we can use linear regression with polynomial features to approximate -nonlinear functions. The plot shows the function that we want to approximate, -which is a part of the cosine function. In addition, the samples from the -real function and the approximations of different models are displayed. The -models have polynomial features of different degrees. We can see that a -linear function (polynomial with degree 1) is not sufficient to fit the -training samples. This is called **underfitting**. A polynomial of degree 4 -approximates the true function almost perfectly. However, for higher degrees -the model will **overfit** the training data, i.e. it learns the noise of the -training data. -We evaluate quantitatively **overfitting** / **underfitting** by using -cross-validation. We calculate the mean squared error (MSE) on the validation -set, the higher, the less likely the model generalizes correctly from the -training data. -""" - -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn.pipeline import Pipeline -from sklearn.preprocessing import PolynomialFeatures -from sklearn.linear_model import LinearRegression -from sklearn import cross_validation - -np.random.seed(0) - -n_samples = 30 -degrees = [1, 4, 15] - -true_fun = lambda X: np.cos(1.5 * np.pi * X) -X = np.sort(np.random.rand(n_samples)) -y = true_fun(X) + np.random.randn(n_samples) * 0.1 - -plt.figure(figsize=(14, 5)) -for i in range(len(degrees)): - ax = plt.subplot(1, len(degrees), i + 1) - plt.setp(ax, xticks=(), yticks=()) - - polynomial_features = PolynomialFeatures(degree=degrees[i], - include_bias=False) - linear_regression = LinearRegression() - pipeline = Pipeline([("polynomial_features", polynomial_features), - ("linear_regression", linear_regression)]) - pipeline.fit(X[:, np.newaxis], y) - - # Evaluate the models using crossvalidation - scores = cross_validation.cross_val_score(pipeline, - X[:, np.newaxis], y, scoring="mean_squared_error", cv=10) - - X_test = np.linspace(0, 1, 100) - plt.plot(X_test, pipeline.predict(X_test[:, np.newaxis]), label="Model") - plt.plot(X_test, true_fun(X_test), label="True function") - plt.scatter(X, y, label="Samples") - plt.xlabel("x") - plt.ylabel("y") - plt.xlim((0, 1)) - plt.ylim((-2, 2)) - plt.legend(loc="best") - plt.title("Degree {}\nMSE = {:.2e}(+/- {:.2e})".format( - degrees[i], -scores.mean(), scores.std())) -plt.show() diff --git a/0.15/_downloads/plot_underfitting_overfitting1.py b/0.15/_downloads/plot_underfitting_overfitting1.py deleted file mode 100644 index 10a7d9466ba95..0000000000000 --- a/0.15/_downloads/plot_underfitting_overfitting1.py +++ /dev/null @@ -1,58 +0,0 @@ -""" -============================ -Underfitting vs. Overfitting -============================ - -This example demonstrates the problems of underfitting and overfitting and -how we can use linear regression with polynomial features to approximate -nonlinear functions. The plot shows the function that we want to approximate, -which is a part of the cosine function. In addition, the samples from the -real function and the approximations of different models are displayed. The -models have polynomial features of different degrees. We can see that a -linear function (polynomial with degree 1) is not sufficient to fit the -training samples. This is called **underfitting**. A polynomial of degree 4 -approximates the true function almost perfectly. However, for higher degrees -the model will **overfit** the training data, i.e. it learns the noise of the -training data. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn.pipeline import Pipeline -from sklearn.preprocessing import PolynomialFeatures -from sklearn.linear_model import LinearRegression - - -np.random.seed(0) - -n_samples = 30 -degrees = [1, 4, 15] - -true_fun = lambda X: np.cos(1.5 * np.pi * X) -X = np.sort(np.random.rand(n_samples)) -y = true_fun(X) + np.random.randn(n_samples) * 0.1 - -plt.figure(figsize=(14, 4)) -for i in range(len(degrees)): - ax = plt.subplot(1, len(degrees), i+1) - plt.setp(ax, xticks=(), yticks=()) - - polynomial_features = PolynomialFeatures(degree=degrees[i], - include_bias=False) - linear_regression = LinearRegression() - pipeline = Pipeline([("polynomial_features", polynomial_features), - ("linear_regression", linear_regression)]) - pipeline.fit(X[:, np.newaxis], y) - - X_test = np.linspace(0, 1, 100) - plt.plot(X_test, pipeline.predict(X_test[:, np.newaxis]), label="Model") - plt.plot(X_test, true_fun(X_test), label="True function") - plt.scatter(X, y, label="Samples") - plt.xlabel("x") - plt.ylabel("y") - plt.xlim((0, 1)) - plt.ylim((-2, 2)) - plt.legend(loc="best") - plt.title("Degree %d" % degrees[i]) -plt.show() diff --git a/0.15/_downloads/plot_validation_curve.py b/0.15/_downloads/plot_validation_curve.py deleted file mode 100644 index 336e0349eacbf..0000000000000 --- a/0.15/_downloads/plot_validation_curve.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -========================== -Plotting Validation Curves -========================== - -In this plot you can see the training scores and validation scores of an SVM -for different values of the kernel parameter gamma. For very low values of -gamma, you can see that both the training score and the validation score are -low. This is called underfitting. Medium values of gamma will result in high -values for both scores, i.e. the classifier is performing fairly well. If gamma -is too high, the classifier will overfit, which means that the training score -is good but the validation score is poor. -""" -print(__doc__) - -import matplotlib.pyplot as plt -import numpy as np -from sklearn.datasets import load_digits -from sklearn.svm import SVC -from sklearn.learning_curve import validation_curve - -digits = load_digits() -X, y = digits.data, digits.target - -param_range = np.logspace(-6, -1, 5) -train_scores, test_scores = validation_curve( - SVC(), X, y, param_name="gamma", param_range=param_range, - cv=10, scoring="accuracy", n_jobs=1) -train_scores_mean = np.mean(train_scores, axis=1) -train_scores_std = np.std(train_scores, axis=1) -test_scores_mean = np.mean(test_scores, axis=1) -test_scores_std = np.std(test_scores, axis=1) - -plt.title("Validation Curve with SVM") -plt.xlabel("$\gamma$") -plt.ylabel("Score") -plt.ylim(0.0, 1.1) -plt.semilogx(param_range, train_scores_mean, label="Training score", color="r") -plt.fill_between(param_range, train_scores_mean - train_scores_std, - train_scores_mean + train_scores_std, alpha=0.2, color="r") -plt.semilogx(param_range, test_scores_mean, label="Cross-validation score", - color="g") -plt.fill_between(param_range, test_scores_mean - test_scores_std, - test_scores_mean + test_scores_std, alpha=0.2, color="g") -plt.legend(loc="best") -plt.show() diff --git a/0.15/_downloads/plot_validation_curve1.py b/0.15/_downloads/plot_validation_curve1.py deleted file mode 100644 index 7b5f05050183a..0000000000000 --- a/0.15/_downloads/plot_validation_curve1.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -========================== -Plotting Validation Curves -========================== - -In this plot you can see the training scores and validation scores of an SVM -for different values of the kernel parameter gamma. For very low values of -gamma, you can see that both the training score and the validation score are -low. This is called underfitting. Medium values of gamma will result in high -values for both scores, i.e. the classifier is perfoming fairly well. If gamma -is too high, the classifier will overfit, which means that the training score -is good but the validation score is poor. -""" -print(__doc__) - -import matplotlib.pyplot as plt -import numpy as np -from sklearn.datasets import load_digits -from sklearn.svm import SVC -from sklearn.learning_curve import validation_curve - -digits = load_digits() -X, y = digits.data, digits.target - -param_range = np.logspace(-6, -1, 5) -train_scores, test_scores = validation_curve( - SVC(), X, y, param_name="gamma", param_range=param_range, - cv=10, scoring="accuracy", n_jobs=1) -train_scores_mean = np.mean(train_scores, axis=1) -train_scores_std = np.std(train_scores, axis=1) -test_scores_mean = np.mean(test_scores, axis=1) -test_scores_std = np.std(test_scores, axis=1) - -plt.title("Validation Curve with SVM") -plt.xlabel("$\gamma$") -plt.ylabel("Score") -plt.ylim(0.0, 1.1) -plt.semilogx(param_range, train_scores_mean, label="Training score", color="r") -plt.fill_between(param_range, train_scores_mean - train_scores_std, - train_scores_mean + train_scores_std, alpha=0.2, color="r") -plt.semilogx(param_range, test_scores_mean, label="Cross-validation score", - color="g") -plt.fill_between(param_range, test_scores_mean - test_scores_std, - test_scores_mean + test_scores_std, alpha=0.2, color="g") -plt.legend(loc="best") -plt.show() diff --git a/0.15/_downloads/plot_voting_decision_regions.py b/0.15/_downloads/plot_voting_decision_regions.py deleted file mode 100644 index 13a763e2bba13..0000000000000 --- a/0.15/_downloads/plot_voting_decision_regions.py +++ /dev/null @@ -1,72 +0,0 @@ -""" -================================================== -Plot the decision boundaries of a VotingClassifier -================================================== - -Plot the decision boundaries of a `VotingClassifier` for -two features of the Iris dataset. - -Plot the class probabilities of the first sample in a toy dataset -predicted by three different classifiers and averaged by the -`VotingClassifier`. - -First, three examplary classifiers are initialized (`DecisionTreeClassifier`, -`KNeighborsClassifier`, and `SVC`) and used to initialize a -soft-voting `VotingClassifier` with weights `[2, 1, 2]`, which means that -the predicted probabilities of the `DecisionTreeClassifier` and `SVC` -count 5 times as much as the weights of the `KNeighborsClassifier` classifier -when the averaged probability is calculated. - -""" -print(__doc__) - -from itertools import product - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn import datasets -from sklearn.tree import DecisionTreeClassifier -from sklearn.neighbors import KNeighborsClassifier -from sklearn.svm import SVC -from sklearn.ensemble import VotingClassifier - -# Loading some example data -iris = datasets.load_iris() -X = iris.data[:, [0, 2]] -y = iris.target - -# Training classifiers -clf1 = DecisionTreeClassifier(max_depth=4) -clf2 = KNeighborsClassifier(n_neighbors=7) -clf3 = SVC(kernel='rbf', probability=True) -eclf = VotingClassifier(estimators=[('dt', clf1), ('knn', clf2), - ('svc', clf3)], - voting='soft', weights=[2, 1, 2]) - -clf1.fit(X, y) -clf2.fit(X, y) -clf3.fit(X, y) -eclf.fit(X, y) - -# Plotting decision regions -x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 -y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 -xx, yy = np.meshgrid(np.arange(x_min, x_max, 0.1), - np.arange(y_min, y_max, 0.1)) - -f, axarr = plt.subplots(2, 2, sharex='col', sharey='row', figsize=(10, 8)) - -for idx, clf, tt in zip(product([0, 1], [0, 1]), - [clf1, clf2, clf3, eclf], - ['Decision Tree (depth=4)', 'KNN (k=7)', - 'Kernel SVM', 'Soft Voting']): - - Z = clf.predict(np.c_[xx.ravel(), yy.ravel()]) - Z = Z.reshape(xx.shape) - - axarr[idx[0], idx[1]].contourf(xx, yy, Z, alpha=0.4) - axarr[idx[0], idx[1]].scatter(X[:, 0], X[:, 1], c=y, alpha=0.8) - axarr[idx[0], idx[1]].set_title(tt) - -plt.show() diff --git a/0.15/_downloads/plot_voting_probas.py b/0.15/_downloads/plot_voting_probas.py deleted file mode 100644 index 038a288132f27..0000000000000 --- a/0.15/_downloads/plot_voting_probas.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -=========================================================== -Plot class probabilities calculated by the VotingClassifier -=========================================================== - -Plot the class probabilities of the first sample in a toy dataset -predicted by three different classifiers and averaged by the -`VotingClassifier`. - -First, three examplary classifiers are initialized (`LogisticRegression`, -`GaussianNB`, and `RandomForestClassifier`) and used to initialize a -soft-voting `VotingClassifier` with weights `[1, 1, 5]`, which means that -the predicted probabilities of the `RandomForestClassifier` count 5 times -as much as the weights of the other classifiers when the averaged probability -is calculated. - -To visualize the probability weighting, we fit each classifier on the training -set and plot the predicted class probabilities for the first sample in this -example dataset. - -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt - -from sklearn.linear_model import LogisticRegression -from sklearn.naive_bayes import GaussianNB -from sklearn.ensemble import RandomForestClassifier -from sklearn.ensemble import VotingClassifier - -clf1 = LogisticRegression(random_state=123) -clf2 = RandomForestClassifier(random_state=123) -clf3 = GaussianNB() -X = np.array([[-1.0, -1.0], [-1.2, -1.4], [-3.4, -2.2], [1.1, 1.2]]) -y = np.array([1, 1, 2, 2]) - -eclf = VotingClassifier(estimators=[('lr', clf1), ('rf', clf2), ('gnb', clf3)], - voting='soft', - weights=[1, 1, 5]) - -# predict class probabilities for all classifiers -probas = [c.fit(X, y).predict_proba(X) for c in (clf1, clf2, clf3, eclf)] - -# get class probabilities for the first sample in the dataset -class1_1 = [pr[0, 0] for pr in probas] -class2_1 = [pr[0, 1] for pr in probas] - - -# plotting - -N = 4 # number of groups -ind = np.arange(N) # group positions -width = 0.35 # bar width - -fig, ax = plt.subplots() - -# bars for classifier 1-3 -p1 = ax.bar(ind, np.hstack(([class1_1[:-1], [0]])), width, color='green') -p2 = ax.bar(ind + width, np.hstack(([class2_1[:-1], [0]])), width, color='lightgreen') - -# bars for VotingClassifier -p3 = ax.bar(ind, [0, 0, 0, class1_1[-1]], width, color='blue') -p4 = ax.bar(ind + width, [0, 0, 0, class2_1[-1]], width, color='steelblue') - -# plot annotations -plt.axvline(2.8, color='k', linestyle='dashed') -ax.set_xticks(ind + width) -ax.set_xticklabels(['LogisticRegression\nweight 1', - 'GaussianNB\nweight 1', - 'RandomForestClassifier\nweight 5', - 'VotingClassifier\n(average probabilities)'], - rotation=40, - ha='right') -plt.ylim([0, 1]) -plt.title('Class probabilities for sample 1 by different classifiers') -plt.legend([p1[0], p2[0]], ['class 1', 'class 2'], loc='upper left') -plt.show() diff --git a/0.15/_downloads/plot_ward_structured_vs_unstructured.py b/0.15/_downloads/plot_ward_structured_vs_unstructured.py deleted file mode 100644 index e2be1b0953948..0000000000000 --- a/0.15/_downloads/plot_ward_structured_vs_unstructured.py +++ /dev/null @@ -1,91 +0,0 @@ -""" -=========================================================== -Hierarchical clustering: structured vs unstructured ward -=========================================================== - -Example builds a swiss roll dataset and runs -hierarchical clustering on their position. - -For more information, see :ref:`hierarchical_clustering`. - -In a first step, the hierarchical clustering is performed without connectivity -constraints on the structure and is solely based on distance, whereas in -a second step the clustering is restricted to the k-Nearest Neighbors -graph: it's a hierarchical clustering with structure prior. - -Some of the clusters learned without connectivity constraints do not -respect the structure of the swiss roll and extend across different folds of -the manifolds. On the opposite, when opposing connectivity constraints, -the clusters form a nice parcellation of the swiss roll. -""" - -# Authors : Vincent Michel, 2010 -# Alexandre Gramfort, 2010 -# Gael Varoquaux, 2010 -# License: BSD 3 clause - -print(__doc__) - -import time as time -import numpy as np -import matplotlib.pyplot as plt -import mpl_toolkits.mplot3d.axes3d as p3 -from sklearn.cluster import AgglomerativeClustering -from sklearn.datasets.samples_generator import make_swiss_roll - -############################################################################### -# Generate data (swiss roll dataset) -n_samples = 1500 -noise = 0.05 -X, _ = make_swiss_roll(n_samples, noise) -# Make it thinner -X[:, 1] *= .5 - -############################################################################### -# Compute clustering -print("Compute unstructured hierarchical clustering...") -st = time.time() -ward = AgglomerativeClustering(n_clusters=6, linkage='ward').fit(X) -elapsed_time = time.time() - st -label = ward.labels_ -print("Elapsed time: %.2fs" % elapsed_time) -print("Number of points: %i" % label.size) - -############################################################################### -# Plot result -fig = plt.figure() -ax = p3.Axes3D(fig) -ax.view_init(7, -80) -for l in np.unique(label): - ax.plot3D(X[label == l, 0], X[label == l, 1], X[label == l, 2], - 'o', color=plt.cm.jet(np.float(l) / np.max(label + 1))) -plt.title('Without connectivity constraints (time %.2fs)' % elapsed_time) - - -############################################################################### -# Define the structure A of the data. Here a 10 nearest neighbors -from sklearn.neighbors import kneighbors_graph -connectivity = kneighbors_graph(X, n_neighbors=10) - -############################################################################### -# Compute clustering -print("Compute structured hierarchical clustering...") -st = time.time() -ward = AgglomerativeClustering(n_clusters=6, connectivity=connectivity, - linkage='ward').fit(X) -elapsed_time = time.time() - st -label = ward.labels_ -print("Elapsed time: %.2fs" % elapsed_time) -print("Number of points: %i" % label.size) - -############################################################################### -# Plot result -fig = plt.figure() -ax = p3.Axes3D(fig) -ax.view_init(7, -80) -for l in np.unique(label): - ax.plot3D(X[label == l, 0], X[label == l, 1], X[label == l, 2], - 'o', color=plt.cm.jet(float(l) / np.max(label + 1))) -plt.title('With connectivity constraints (time %.2fs)' % elapsed_time) - -plt.show() diff --git a/0.15/_downloads/plot_weighted_samples.py b/0.15/_downloads/plot_weighted_samples.py deleted file mode 100644 index ac9207838b034..0000000000000 --- a/0.15/_downloads/plot_weighted_samples.py +++ /dev/null @@ -1,63 +0,0 @@ -""" -===================== -SVM: Weighted samples -===================== - -Plot decision function of a weighted dataset, where the size of points -is proportional to its weight. - -The sample weighting rescales the C parameter, which means that the classifier -puts more emphasis on getting these points right. The effect might often be -subtle. -To emphasis the effect here, we particularly weight outliers, making the -deformation of the decision boundary very visible. -""" -print(__doc__) - -import numpy as np -import matplotlib.pyplot as plt -from sklearn import svm - - -def plot_decision_function(classifier, sample_weight, axis, title): - # plot the decision function - xx, yy = np.meshgrid(np.linspace(-4, 5, 500), np.linspace(-4, 5, 500)) - - Z = classifier.decision_function(np.c_[xx.ravel(), yy.ravel()]) - Z = Z.reshape(xx.shape) - - # plot the line, the points, and the nearest vectors to the plane - axis.contourf(xx, yy, Z, alpha=0.75, cmap=plt.cm.bone) - axis.scatter(X[:, 0], X[:, 1], c=Y, s=100 * sample_weight, alpha=0.9, - cmap=plt.cm.bone) - - axis.axis('off') - axis.set_title(title) - - -# we create 20 points -np.random.seed(0) -X = np.r_[np.random.randn(10, 2) + [1, 1], np.random.randn(10, 2)] -Y = [1] * 10 + [-1] * 10 -sample_weight_last_ten = abs(np.random.randn(len(X))) -sample_weight_constant = np.ones(len(X)) -# and bigger weights to some outliers -sample_weight_last_ten[15:] *= 5 -sample_weight_last_ten[9] *= 15 - -# for reference, first fit without class weights - -# fit the model -clf_weights = svm.SVC() -clf_weights.fit(X, Y, sample_weight=sample_weight_last_ten) - -clf_no_weights = svm.SVC() -clf_no_weights.fit(X, Y) - -fig, axes = plt.subplots(1, 2, figsize=(14, 6)) -plot_decision_function(clf_no_weights, sample_weight_constant, axes[0], - "Constant weights") -plot_decision_function(clf_weights, sample_weight_last_ten, axes[1], - "Modified weights") - -plt.show() diff --git a/0.15/_downloads/randomized_search.py b/0.15/_downloads/randomized_search.py deleted file mode 100644 index 14a15139448d0..0000000000000 --- a/0.15/_downloads/randomized_search.py +++ /dev/null @@ -1,87 +0,0 @@ -""" -========================================================================= -Comparing randomized search and grid search for hyperparameter estimation -========================================================================= - -Compare randomized search and grid search for optimizing hyperparameters of a -random forest. -All parameters that influence the learning are searched simultaneously -(except for the number of estimators, which poses a time / quality tradeoff). - -The randomized search and the grid search explore exactly the same space of -parameters. The result in parameter settings is quite similar, while the run -time for randomized search is drastically lower. - -The performance is slightly worse for the randomized search, though this -is most likely a noise effect and would not carry over to a held-out test set. - -Note that in practice, one would not search over this many different parameters -simultaneously using grid search, but pick only the ones deemed most important. -""" -print(__doc__) - -import numpy as np - -from time import time -from operator import itemgetter -from scipy.stats import randint as sp_randint - -from sklearn.grid_search import GridSearchCV, RandomizedSearchCV -from sklearn.datasets import load_digits -from sklearn.ensemble import RandomForestClassifier - -# get some data -iris = load_digits() -X, y = iris.data, iris.target - -# build a classifier -clf = RandomForestClassifier(n_estimators=20) - - -# Utility function to report best scores -def report(grid_scores, n_top=3): - top_scores = sorted(grid_scores, key=itemgetter(1), reverse=True)[:n_top] - for i, score in enumerate(top_scores): - print("Model with rank: {0}".format(i + 1)) - print("Mean validation score: {0:.3f} (std: {1:.3f})".format( - score.mean_validation_score, - np.std(score.cv_validation_scores))) - print("Parameters: {0}".format(score.parameters)) - print("") - - -# specify parameters and distributions to sample from -param_dist = {"max_depth": [3, None], - "max_features": sp_randint(1, 11), - "min_samples_split": sp_randint(1, 11), - "min_samples_leaf": sp_randint(1, 11), - "bootstrap": [True, False], - "criterion": ["gini", "entropy"]} - -# run randomized search -n_iter_search = 20 -random_search = RandomizedSearchCV(clf, param_distributions=param_dist, - n_iter=n_iter_search) - -start = time() -random_search.fit(X, y) -print("RandomizedSearchCV took %.2f seconds for %d candidates" - " parameter settings." % ((time() - start), n_iter_search)) -report(random_search.grid_scores_) - -# use a full grid over all parameters -param_grid = {"max_depth": [3, None], - "max_features": [1, 3, 10], - "min_samples_split": [1, 3, 10], - "min_samples_leaf": [1, 3, 10], - "bootstrap": [True, False], - "criterion": ["gini", "entropy"]} - -# run grid search -grid_search = GridSearchCV(clf, param_grid=param_grid) -start = time() -grid_search.fit(X, y) - -print("GridSearchCV took %.2f seconds for %d candidate parameter settings." - % (time() - start, len(grid_search.grid_scores_))) -report(grid_search.grid_scores_) diff --git a/0.15/_downloads/randomized_search1.py b/0.15/_downloads/randomized_search1.py deleted file mode 100644 index 14a15139448d0..0000000000000 --- a/0.15/_downloads/randomized_search1.py +++ /dev/null @@ -1,87 +0,0 @@ -""" -========================================================================= -Comparing randomized search and grid search for hyperparameter estimation -========================================================================= - -Compare randomized search and grid search for optimizing hyperparameters of a -random forest. -All parameters that influence the learning are searched simultaneously -(except for the number of estimators, which poses a time / quality tradeoff). - -The randomized search and the grid search explore exactly the same space of -parameters. The result in parameter settings is quite similar, while the run -time for randomized search is drastically lower. - -The performance is slightly worse for the randomized search, though this -is most likely a noise effect and would not carry over to a held-out test set. - -Note that in practice, one would not search over this many different parameters -simultaneously using grid search, but pick only the ones deemed most important. -""" -print(__doc__) - -import numpy as np - -from time import time -from operator import itemgetter -from scipy.stats import randint as sp_randint - -from sklearn.grid_search import GridSearchCV, RandomizedSearchCV -from sklearn.datasets import load_digits -from sklearn.ensemble import RandomForestClassifier - -# get some data -iris = load_digits() -X, y = iris.data, iris.target - -# build a classifier -clf = RandomForestClassifier(n_estimators=20) - - -# Utility function to report best scores -def report(grid_scores, n_top=3): - top_scores = sorted(grid_scores, key=itemgetter(1), reverse=True)[:n_top] - for i, score in enumerate(top_scores): - print("Model with rank: {0}".format(i + 1)) - print("Mean validation score: {0:.3f} (std: {1:.3f})".format( - score.mean_validation_score, - np.std(score.cv_validation_scores))) - print("Parameters: {0}".format(score.parameters)) - print("") - - -# specify parameters and distributions to sample from -param_dist = {"max_depth": [3, None], - "max_features": sp_randint(1, 11), - "min_samples_split": sp_randint(1, 11), - "min_samples_leaf": sp_randint(1, 11), - "bootstrap": [True, False], - "criterion": ["gini", "entropy"]} - -# run randomized search -n_iter_search = 20 -random_search = RandomizedSearchCV(clf, param_distributions=param_dist, - n_iter=n_iter_search) - -start = time() -random_search.fit(X, y) -print("RandomizedSearchCV took %.2f seconds for %d candidates" - " parameter settings." % ((time() - start), n_iter_search)) -report(random_search.grid_scores_) - -# use a full grid over all parameters -param_grid = {"max_depth": [3, None], - "max_features": [1, 3, 10], - "min_samples_split": [1, 3, 10], - "min_samples_leaf": [1, 3, 10], - "bootstrap": [True, False], - "criterion": ["gini", "entropy"]} - -# run grid search -grid_search = GridSearchCV(clf, param_grid=param_grid) -start = time() -grid_search.fit(X, y) - -print("GridSearchCV took %.2f seconds for %d candidate parameter settings." - % (time() - start, len(grid_search.grid_scores_))) -report(grid_search.grid_scores_) diff --git a/0.15/_downloads/svm_gui.py b/0.15/_downloads/svm_gui.py deleted file mode 100644 index 998dcb4ccb22a..0000000000000 --- a/0.15/_downloads/svm_gui.py +++ /dev/null @@ -1,330 +0,0 @@ -""" -========== -Libsvm GUI -========== - -A simple graphical frontend for Libsvm mainly intended for didactic -purposes. You can create data points by point and click and visualize -the decision region induced by different kernels and parameter settings. - -To create positive examples click the left mouse button; to create -negative examples click the right button. - -If all examples are from the same class, it uses a one-class SVM. - -""" -from __future__ import division, print_function - -print(__doc__) - -# Author: Peter Prettenhoer -# -# License: BSD 3 clause - -import matplotlib -matplotlib.use('TkAgg') - -from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg -from matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg -from matplotlib.figure import Figure -from matplotlib.contour import ContourSet - -import Tkinter as Tk -import sys -import numpy as np - -from sklearn import svm -from sklearn.datasets import dump_svmlight_file -from sklearn.externals.six.moves import xrange - -y_min, y_max = -50, 50 -x_min, x_max = -50, 50 - - -class Model(object): - """The Model which hold the data. It implements the - observable in the observer pattern and notifies the - registered observers on change event. - """ - - def __init__(self): - self.observers = [] - self.surface = None - self.data = [] - self.cls = None - self.surface_type = 0 - - def changed(self, event): - """Notify the observers. """ - for observer in self.observers: - observer.update(event, self) - - def add_observer(self, observer): - """Register an observer. """ - self.observers.append(observer) - - def set_surface(self, surface): - self.surface = surface - - def dump_svmlight_file(self, file): - data = np.array(self.data) - X = data[:, 0:2] - y = data[:, 2] - dump_svmlight_file(X, y, file) - - -class Controller(object): - def __init__(self, model): - self.model = model - self.kernel = Tk.IntVar() - self.surface_type = Tk.IntVar() - # Whether or not a model has been fitted - self.fitted = False - - def fit(self): - print("fit the model") - train = np.array(self.model.data) - X = train[:, 0:2] - y = train[:, 2] - - C = float(self.complexity.get()) - gamma = float(self.gamma.get()) - coef0 = float(self.coef0.get()) - degree = int(self.degree.get()) - kernel_map = {0: "linear", 1: "rbf", 2: "poly"} - if len(np.unique(y)) == 1: - clf = svm.OneClassSVM(kernel=kernel_map[self.kernel.get()], - gamma=gamma, coef0=coef0, degree=degree) - clf.fit(X) - else: - clf = svm.SVC(kernel=kernel_map[self.kernel.get()], C=C, - gamma=gamma, coef0=coef0, degree=degree) - clf.fit(X, y) - if hasattr(clf, 'score'): - print("Accuracy:", clf.score(X, y) * 100) - X1, X2, Z = self.decision_surface(clf) - self.model.clf = clf - self.model.set_surface((X1, X2, Z)) - self.model.surface_type = self.surface_type.get() - self.fitted = True - self.model.changed("surface") - - def decision_surface(self, cls): - delta = 1 - x = np.arange(x_min, x_max + delta, delta) - y = np.arange(y_min, y_max + delta, delta) - X1, X2 = np.meshgrid(x, y) - Z = cls.decision_function(np.c_[X1.ravel(), X2.ravel()]) - Z = Z.reshape(X1.shape) - return X1, X2, Z - - def clear_data(self): - self.model.data = [] - self.fitted = False - self.model.changed("clear") - - def add_example(self, x, y, label): - self.model.data.append((x, y, label)) - self.model.changed("example_added") - - # update decision surface if already fitted. - self.refit() - - def refit(self): - """Refit the model if already fitted. """ - if self.fitted: - self.fit() - - -class View(object): - """Test docstring. """ - def __init__(self, root, controller): - f = Figure() - ax = f.add_subplot(111) - ax.set_xticks([]) - ax.set_yticks([]) - ax.set_xlim((x_min, x_max)) - ax.set_ylim((y_min, y_max)) - canvas = FigureCanvasTkAgg(f, master=root) - canvas.show() - canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) - canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) - canvas.mpl_connect('button_press_event', self.onclick) - toolbar = NavigationToolbar2TkAgg(canvas, root) - toolbar.update() - self.controllbar = ControllBar(root, controller) - self.f = f - self.ax = ax - self.canvas = canvas - self.controller = controller - self.contours = [] - self.c_labels = None - self.plot_kernels() - - def plot_kernels(self): - self.ax.text(-50, -60, "Linear: $u^T v$") - self.ax.text(-20, -60, "RBF: $\exp (-\gamma \| u-v \|^2)$") - self.ax.text(10, -60, "Poly: $(\gamma \, u^T v + r)^d$") - - def onclick(self, event): - if event.xdata and event.ydata: - if event.button == 1: - self.controller.add_example(event.xdata, event.ydata, 1) - elif event.button == 3: - self.controller.add_example(event.xdata, event.ydata, -1) - - def update_example(self, model, idx): - x, y, l = model.data[idx] - if l == 1: - color = 'w' - elif l == -1: - color = 'k' - self.ax.plot([x], [y], "%so" % color, scalex=0.0, scaley=0.0) - - def update(self, event, model): - if event == "examples_loaded": - for i in xrange(len(model.data)): - self.update_example(model, i) - - if event == "example_added": - self.update_example(model, -1) - - if event == "clear": - self.ax.clear() - self.ax.set_xticks([]) - self.ax.set_yticks([]) - self.contours = [] - self.c_labels = None - self.plot_kernels() - - if event == "surface": - self.remove_surface() - self.plot_support_vectors(model.clf.support_vectors_) - self.plot_decision_surface(model.surface, model.surface_type) - - self.canvas.draw() - - def remove_surface(self): - """Remove old decision surface.""" - if len(self.contours) > 0: - for contour in self.contours: - if isinstance(contour, ContourSet): - for lineset in contour.collections: - lineset.remove() - else: - contour.remove() - self.contours = [] - - def plot_support_vectors(self, support_vectors): - """Plot the support vectors by placing circles over the - corresponding data points and adds the circle collection - to the contours list.""" - cs = self.ax.scatter(support_vectors[:, 0], support_vectors[:, 1], - s=80, edgecolors="k", facecolors="none") - self.contours.append(cs) - - def plot_decision_surface(self, surface, type): - X1, X2, Z = surface - if type == 0: - levels = [-1.0, 0.0, 1.0] - linestyles = ['dashed', 'solid', 'dashed'] - colors = 'k' - self.contours.append(self.ax.contour(X1, X2, Z, levels, - colors=colors, - linestyles=linestyles)) - elif type == 1: - self.contours.append(self.ax.contourf(X1, X2, Z, 10, - cmap=matplotlib.cm.bone, - origin='lower', alpha=0.85)) - self.contours.append(self.ax.contour(X1, X2, Z, [0.0], colors='k', - linestyles=['solid'])) - else: - raise ValueError("surface type unknown") - - -class ControllBar(object): - def __init__(self, root, controller): - fm = Tk.Frame(root) - kernel_group = Tk.Frame(fm) - Tk.Radiobutton(kernel_group, text="Linear", variable=controller.kernel, - value=0, command=controller.refit).pack(anchor=Tk.W) - Tk.Radiobutton(kernel_group, text="RBF", variable=controller.kernel, - value=1, command=controller.refit).pack(anchor=Tk.W) - Tk.Radiobutton(kernel_group, text="Poly", variable=controller.kernel, - value=2, command=controller.refit).pack(anchor=Tk.W) - kernel_group.pack(side=Tk.LEFT) - - valbox = Tk.Frame(fm) - controller.complexity = Tk.StringVar() - controller.complexity.set("1.0") - c = Tk.Frame(valbox) - Tk.Label(c, text="C:", anchor="e", width=7).pack(side=Tk.LEFT) - Tk.Entry(c, width=6, textvariable=controller.complexity).pack( - side=Tk.LEFT) - c.pack() - - controller.gamma = Tk.StringVar() - controller.gamma.set("0.01") - g = Tk.Frame(valbox) - Tk.Label(g, text="gamma:", anchor="e", width=7).pack(side=Tk.LEFT) - Tk.Entry(g, width=6, textvariable=controller.gamma).pack(side=Tk.LEFT) - g.pack() - - controller.degree = Tk.StringVar() - controller.degree.set("3") - d = Tk.Frame(valbox) - Tk.Label(d, text="degree:", anchor="e", width=7).pack(side=Tk.LEFT) - Tk.Entry(d, width=6, textvariable=controller.degree).pack(side=Tk.LEFT) - d.pack() - - controller.coef0 = Tk.StringVar() - controller.coef0.set("0") - r = Tk.Frame(valbox) - Tk.Label(r, text="coef0:", anchor="e", width=7).pack(side=Tk.LEFT) - Tk.Entry(r, width=6, textvariable=controller.coef0).pack(side=Tk.LEFT) - r.pack() - valbox.pack(side=Tk.LEFT) - - cmap_group = Tk.Frame(fm) - Tk.Radiobutton(cmap_group, text="Hyperplanes", - variable=controller.surface_type, value=0, - command=controller.refit).pack(anchor=Tk.W) - Tk.Radiobutton(cmap_group, text="Surface", - variable=controller.surface_type, value=1, - command=controller.refit).pack(anchor=Tk.W) - - cmap_group.pack(side=Tk.LEFT) - - train_button = Tk.Button(fm, text='Fit', width=5, - command=controller.fit) - train_button.pack() - fm.pack(side=Tk.LEFT) - Tk.Button(fm, text='Clear', width=5, - command=controller.clear_data).pack(side=Tk.LEFT) - - -def get_parser(): - from optparse import OptionParser - op = OptionParser() - op.add_option("--output", - action="store", type="str", dest="output", - help="Path where to dump data.") - return op - - -def main(argv): - op = get_parser() - opts, args = op.parse_args(argv[1:]) - root = Tk.Tk() - model = Model() - controller = Controller(model) - root.wm_title("Scikit-learn Libsvm GUI") - view = View(root, controller) - model.add_observer(view) - Tk.mainloop() - - if opts.output: - model.dump_svmlight_file(opts.output) - -if __name__ == "__main__": - main(sys.argv) diff --git a/0.15/_downloads/topics_extraction_with_nmf.py b/0.15/_downloads/topics_extraction_with_nmf.py deleted file mode 100644 index 48cce50fe05e6..0000000000000 --- a/0.15/_downloads/topics_extraction_with_nmf.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -======================================================== -Topics extraction with Non-Negative Matrix Factorization -======================================================== - -This is a proof of concept application of Non Negative Matrix -Factorization of the term frequency matrix of a corpus of documents so -as to extract an additive model of the topic structure of the corpus. -The output is a list of topics, each represented as a list of terms -(weights are not shown). - -The default parameters (n_samples / n_features / n_topics) should make -the example runnable in a couple of tens of seconds. You can try to -increase the dimensions of the problem, but be aware than the time complexity -is polynomial. - -""" - -# Author: Olivier Grisel -# Lars Buitinck -# License: BSD 3 clause - -from __future__ import print_function -from time import time - -from sklearn.feature_extraction.text import TfidfVectorizer -from sklearn.decomposition import NMF -from sklearn.datasets import fetch_20newsgroups - -n_samples = 2000 -n_features = 1000 -n_topics = 10 -n_top_words = 20 - -# Load the 20 newsgroups dataset and vectorize it. We use a few heuristics -# to filter out useless terms early on: the posts are stripped of headers, -# footers and quoted replies, and common English words, words occurring in -# only one document or in at least 95% of the documents are removed. - -t0 = time() -print("Loading dataset and extracting TF-IDF features...") -dataset = fetch_20newsgroups(shuffle=True, random_state=1, - remove=('headers', 'footers', 'quotes')) - -vectorizer = TfidfVectorizer(max_df=0.95, min_df=2, max_features=n_features, - stop_words='english') -tfidf = vectorizer.fit_transform(dataset.data[:n_samples]) -print("done in %0.3fs." % (time() - t0)) - -# Fit the NMF model -print("Fitting the NMF model with n_samples=%d and n_features=%d..." - % (n_samples, n_features)) -nmf = NMF(n_components=n_topics, random_state=1).fit(tfidf) -print("done in %0.3fs." % (time() - t0)) - -feature_names = vectorizer.get_feature_names() - -for topic_idx, topic in enumerate(nmf.components_): - print("Topic #%d:" % topic_idx) - print(" ".join([feature_names[i] - for i in topic.argsort()[:-n_top_words - 1:-1]])) - print() diff --git a/0.15/_downloads/wikipedia_principal_eigenvector.py b/0.15/_downloads/wikipedia_principal_eigenvector.py deleted file mode 100644 index 951e07ab7638a..0000000000000 --- a/0.15/_downloads/wikipedia_principal_eigenvector.py +++ /dev/null @@ -1,229 +0,0 @@ -""" -=============================== -Wikipedia principal eigenvector -=============================== - -A classical way to assert the relative importance of vertices in a -graph is to compute the principal eigenvector of the adjacency matrix -so as to assign to each vertex the values of the components of the first -eigenvector as a centrality score: - - http://en.wikipedia.org/wiki/Eigenvector_centrality - -On the graph of webpages and links those values are called the PageRank -scores by Google. - -The goal of this example is to analyze the graph of links inside -wikipedia articles to rank articles by relative importance according to -this eigenvector centrality. - -The traditional way to compute the principal eigenvector is to use the -power iteration method: - - http://en.wikipedia.org/wiki/Power_iteration - -Here the computation is achieved thanks to Martinsson's Randomized SVD -algorithm implemented in the scikit. - -The graph data is fetched from the DBpedia dumps. DBpedia is an extraction -of the latent structured data of the Wikipedia content. -""" - -# Author: Olivier Grisel -# License: BSD 3 clause - -from __future__ import print_function - -from bz2 import BZ2File -import os -from datetime import datetime -from pprint import pprint -from time import time - -import numpy as np - -from scipy import sparse - -from sklearn.decomposition import randomized_svd -from sklearn.externals.joblib import Memory - - -print(__doc__) - -############################################################################### -# Where to download the data, if not already on disk -redirects_url = "http://downloads.dbpedia.org/3.5.1/en/redirects_en.nt.bz2" -redirects_filename = redirects_url.rsplit("/", 1)[1] - -page_links_url = "http://downloads.dbpedia.org/3.5.1/en/page_links_en.nt.bz2" -page_links_filename = page_links_url.rsplit("/", 1)[1] - -resources = [ - (redirects_url, redirects_filename), - (page_links_url, page_links_filename), -] - -for url, filename in resources: - if not os.path.exists(filename): - import urllib - print("Downloading data from '%s', please wait..." % url) - opener = urllib.urlopen(url) - open(filename, 'wb').write(opener.read()) - print() - - -############################################################################### -# Loading the redirect files - -memory = Memory(cachedir=".") - - -def index(redirects, index_map, k): - """Find the index of an article name after redirect resolution""" - k = redirects.get(k, k) - return index_map.setdefault(k, len(index_map)) - - -DBPEDIA_RESOURCE_PREFIX_LEN = len("http://dbpedia.org/resource/") -SHORTNAME_SLICE = slice(DBPEDIA_RESOURCE_PREFIX_LEN + 1, -1) - - -def short_name(nt_uri): - """Remove the < and > URI markers and the common URI prefix""" - return nt_uri[SHORTNAME_SLICE] - - -def get_redirects(redirects_filename): - """Parse the redirections and build a transitively closed map out of it""" - redirects = {} - print("Parsing the NT redirect file") - for l, line in enumerate(BZ2File(redirects_filename)): - split = line.split() - if len(split) != 4: - print("ignoring malformed line: " + line) - continue - redirects[short_name(split[0])] = short_name(split[2]) - if l % 1000000 == 0: - print("[%s] line: %08d" % (datetime.now().isoformat(), l)) - - # compute the transitive closure - print("Computing the transitive closure of the redirect relation") - for l, source in enumerate(redirects.keys()): - transitive_target = None - target = redirects[source] - seen = set([source]) - while True: - transitive_target = target - target = redirects.get(target) - if target is None or target in seen: - break - seen.add(target) - redirects[source] = transitive_target - if l % 1000000 == 0: - print("[%s] line: %08d" % (datetime.now().isoformat(), l)) - - return redirects - - -# disabling joblib as the pickling of large dicts seems much too slow -#@memory.cache -def get_adjacency_matrix(redirects_filename, page_links_filename, limit=None): - """Extract the adjacency graph as a scipy sparse matrix - - Redirects are resolved first. - - Returns X, the scipy sparse adjacency matrix, redirects as python - dict from article names to article names and index_map a python dict - from article names to python int (article indexes). - """ - - print("Computing the redirect map") - redirects = get_redirects(redirects_filename) - - print("Computing the integer index map") - index_map = dict() - links = list() - for l, line in enumerate(BZ2File(page_links_filename)): - split = line.split() - if len(split) != 4: - print("ignoring malformed line: " + line) - continue - i = index(redirects, index_map, short_name(split[0])) - j = index(redirects, index_map, short_name(split[2])) - links.append((i, j)) - if l % 1000000 == 0: - print("[%s] line: %08d" % (datetime.now().isoformat(), l)) - - if limit is not None and l >= limit - 1: - break - - print("Computing the adjacency matrix") - X = sparse.lil_matrix((len(index_map), len(index_map)), dtype=np.float32) - for i, j in links: - X[i, j] = 1.0 - del links - print("Converting to CSR representation") - X = X.tocsr() - print("CSR conversion done") - return X, redirects, index_map - - -# stop after 5M links to make it possible to work in RAM -X, redirects, index_map = get_adjacency_matrix( - redirects_filename, page_links_filename, limit=5000000) -names = dict((i, name) for name, i in index_map.iteritems()) - -print("Computing the principal singular vectors using randomized_svd") -t0 = time() -U, s, V = randomized_svd(X, 5, n_iter=3) -print("done in %0.3fs" % (time() - t0)) - -# print the names of the wikipedia related strongest compenents of the the -# principal singular vector which should be similar to the highest eigenvector -print("Top wikipedia pages according to principal singular vectors") -pprint([names[i] for i in np.abs(U.T[0]).argsort()[-10:]]) -pprint([names[i] for i in np.abs(V[0]).argsort()[-10:]]) - - -def centrality_scores(X, alpha=0.85, max_iter=100, tol=1e-10): - """Power iteration computation of the principal eigenvector - - This method is also known as Google PageRank and the implementation - is based on the one from the NetworkX project (BSD licensed too) - with copyrights by: - - Aric Hagberg - Dan Schult - Pieter Swart - """ - n = X.shape[0] - X = X.copy() - incoming_counts = np.asarray(X.sum(axis=1)).ravel() - - print("Normalizing the graph") - for i in incoming_counts.nonzero()[0]: - X.data[X.indptr[i]:X.indptr[i + 1]] *= 1.0 / incoming_counts[i] - dangle = np.asarray(np.where(X.sum(axis=1) == 0, 1.0 / n, 0)).ravel() - - scores = np.ones(n, dtype=np.float32) / n # initial guess - for i in range(max_iter): - print("power iteration #%d" % i) - prev_scores = scores - scores = (alpha * (scores * X + np.dot(dangle, prev_scores)) - + (1 - alpha) * prev_scores.sum() / n) - # check convergence: normalized l_inf norm - scores_max = np.abs(scores).max() - if scores_max == 0.0: - scores_max = 1.0 - err = np.abs(scores - prev_scores).max() / scores_max - print("error: %0.6f" % err) - if err < n * tol: - return scores - - return scores - -print("Computing principal eigenvector score using a power iteration method") -t0 = time() -scores = centrality_scores(X, max_iter=100, tol=1e-10) -print("done in %0.3fs" % (time() - t0)) -pprint([names[i] for i in np.abs(scores).argsort()[-10:]]) diff --git a/0.15/_images/aweber.png b/0.15/_images/aweber.png deleted file mode 100644 index 30b12bde483c4..0000000000000 Binary files a/0.15/_images/aweber.png and /dev/null differ diff --git a/0.15/_images/bestofmedia-logo.gif b/0.15/_images/bestofmedia-logo.gif deleted file mode 100644 index 07b5c39a1505d..0000000000000 Binary files a/0.15/_images/bestofmedia-logo.gif and /dev/null differ diff --git a/0.15/_images/bestofmedia-logo.png b/0.15/_images/bestofmedia-logo.png deleted file mode 100644 index e99cfbdf0341a..0000000000000 Binary files a/0.15/_images/bestofmedia-logo.png and /dev/null differ diff --git a/0.15/_images/bicluster_newsgroups.png b/0.15/_images/bicluster_newsgroups.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/bicluster_newsgroups.png and /dev/null differ diff --git a/0.15/_images/bicluster_newsgroups1.png b/0.15/_images/bicluster_newsgroups1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/bicluster_newsgroups1.png and /dev/null differ diff --git a/0.15/_images/birchbox.jpg b/0.15/_images/birchbox.jpg deleted file mode 100644 index 54ee5366668c6..0000000000000 Binary files a/0.15/_images/birchbox.jpg and /dev/null differ diff --git a/0.15/_images/cds-logo.png b/0.15/_images/cds-logo.png deleted file mode 100644 index 98cfea26578b1..0000000000000 Binary files a/0.15/_images/cds-logo.png and /dev/null differ diff --git a/0.15/_images/change-logo.png b/0.15/_images/change-logo.png deleted file mode 100644 index d579dd29ec8fe..0000000000000 Binary files a/0.15/_images/change-logo.png and /dev/null differ diff --git a/0.15/_images/datapublica.png b/0.15/_images/datapublica.png deleted file mode 100644 index 1aa26bf2f83fd..0000000000000 Binary files a/0.15/_images/datapublica.png and /dev/null differ diff --git a/0.15/_images/datarobot.png b/0.15/_images/datarobot.png deleted file mode 100644 index 5e53b6134613e..0000000000000 Binary files a/0.15/_images/datarobot.png and /dev/null differ diff --git a/0.15/_images/digits_classification_exercise.png b/0.15/_images/digits_classification_exercise.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/digits_classification_exercise.png and /dev/null differ diff --git a/0.15/_images/digits_classification_exercise1.png b/0.15/_images/digits_classification_exercise1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/digits_classification_exercise1.png and /dev/null differ diff --git a/0.15/_images/document_classification_20newsgroups.png b/0.15/_images/document_classification_20newsgroups.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/document_classification_20newsgroups.png and /dev/null differ diff --git a/0.15/_images/document_classification_20newsgroups1.png b/0.15/_images/document_classification_20newsgroups1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/document_classification_20newsgroups1.png and /dev/null differ diff --git a/0.15/_images/document_clustering.png b/0.15/_images/document_clustering.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/document_clustering.png and /dev/null differ diff --git a/0.15/_images/document_clustering1.png b/0.15/_images/document_clustering1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/document_clustering1.png and /dev/null differ diff --git a/0.15/_images/evernote.png b/0.15/_images/evernote.png deleted file mode 100644 index b6936727f7402..0000000000000 Binary files a/0.15/_images/evernote.png and /dev/null differ diff --git a/0.15/_images/face_recognition.png b/0.15/_images/face_recognition.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/face_recognition.png and /dev/null differ diff --git a/0.15/_images/face_recognition1.png b/0.15/_images/face_recognition1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/face_recognition1.png and /dev/null differ diff --git a/0.15/_images/feature_selection_pipeline.png b/0.15/_images/feature_selection_pipeline.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/feature_selection_pipeline.png and /dev/null differ diff --git a/0.15/_images/feature_selection_pipeline1.png b/0.15/_images/feature_selection_pipeline1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/feature_selection_pipeline1.png and /dev/null differ diff --git a/0.15/_images/feature_stacker.png b/0.15/_images/feature_stacker.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/feature_stacker.png and /dev/null differ diff --git a/0.15/_images/feature_stacker1.png b/0.15/_images/feature_stacker1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/feature_stacker1.png and /dev/null differ diff --git a/0.15/_images/gp_diabetes_dataset.png b/0.15/_images/gp_diabetes_dataset.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/gp_diabetes_dataset.png and /dev/null differ diff --git a/0.15/_images/gp_diabetes_dataset1.png b/0.15/_images/gp_diabetes_dataset1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/gp_diabetes_dataset1.png and /dev/null differ diff --git a/0.15/_images/grid_search_digits.png b/0.15/_images/grid_search_digits.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/grid_search_digits.png and /dev/null differ diff --git a/0.15/_images/grid_search_digits1.png b/0.15/_images/grid_search_digits1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/grid_search_digits1.png and /dev/null differ diff --git a/0.15/_images/grid_search_text_feature_extraction.png b/0.15/_images/grid_search_text_feature_extraction.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/grid_search_text_feature_extraction.png and /dev/null differ diff --git a/0.15/_images/grid_search_text_feature_extraction1.png b/0.15/_images/grid_search_text_feature_extraction1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/grid_search_text_feature_extraction1.png and /dev/null differ diff --git a/0.15/_images/hashing_vs_dict_vectorizer.png b/0.15/_images/hashing_vs_dict_vectorizer.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/hashing_vs_dict_vectorizer.png and /dev/null differ diff --git a/0.15/_images/hashing_vs_dict_vectorizer1.png b/0.15/_images/hashing_vs_dict_vectorizer1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/hashing_vs_dict_vectorizer1.png and /dev/null differ diff --git a/0.15/_images/hetero_feature_union.png b/0.15/_images/hetero_feature_union.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/hetero_feature_union.png and /dev/null differ diff --git a/0.15/_images/hetero_feature_union1.png b/0.15/_images/hetero_feature_union1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/hetero_feature_union1.png and /dev/null differ diff --git a/0.15/_images/howaboutwe.png b/0.15/_images/howaboutwe.png deleted file mode 100644 index 26f8f3f87f8ce..0000000000000 Binary files a/0.15/_images/howaboutwe.png and /dev/null differ diff --git a/0.15/_images/imputation.png b/0.15/_images/imputation.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/imputation.png and /dev/null differ diff --git a/0.15/_images/infonea.jpg b/0.15/_images/infonea.jpg deleted file mode 100644 index b005674a8082c..0000000000000 Binary files a/0.15/_images/infonea.jpg and /dev/null differ diff --git a/0.15/_images/inria-logo.jpg b/0.15/_images/inria-logo.jpg deleted file mode 100644 index 94446df014c38..0000000000000 Binary files a/0.15/_images/inria-logo.jpg and /dev/null differ diff --git a/0.15/_images/inria.png b/0.15/_images/inria.png deleted file mode 100644 index 228f1dfdf11ce..0000000000000 Binary files a/0.15/_images/inria.png and /dev/null differ diff --git a/0.15/_images/iris.svg b/0.15/_images/iris.svg deleted file mode 100644 index b91b3c514ad8a..0000000000000 --- a/0.15/_images/iris.svg +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - -Tree - - -0 - -X[2] <= 2.4500 -error = 0.666667 -samples = 150 -value = [ 50.  50.  50.] - - -1 - -error = 0.0 -samples = 50 -value = [ 50.   0.   0.] - - -0->1 - - - - -2 - -X[3] <= 1.7500 -error = 0.5 -samples = 100 -value = [  0.  50.  50.] - - -0->2 - - - - -3 - -X[2] <= 4.9500 -error = 0.168038 -samples = 54 -value = [  0.  49.   5.] - - -2->3 - - - - -12 - -X[2] <= 4.8500 -error = 0.0425331 -samples = 46 -value = [  0.   1.  45.] - - -2->12 - - - - -4 - -X[3] <= 1.6500 -error = 0.0407986 -samples = 48 -value = [  0.  47.   1.] - - -3->4 - - - - -7 - -X[3] <= 1.5500 -error = 0.444444 -samples = 6 -value = [ 0.  2.  4.] - - -3->7 - - - - -5 - -error = 0.0 -samples = 47 -value = [  0.  47.   0.] - - -4->5 - - - - -6 - -error = 0.0 -samples = 1 -value = [ 0.  0.  1.] - - -4->6 - - - - -8 - -error = 0.0 -samples = 3 -value = [ 0.  0.  3.] - - -7->8 - - - - -9 - -X[0] <= 6.9500 -error = 0.444444 -samples = 3 -value = [ 0.  2.  1.] - - -7->9 - - - - -10 - -error = 0.0 -samples = 2 -value = [ 0.  2.  0.] - - -9->10 - - - - -11 - -error = 0.0 -samples = 1 -value = [ 0.  0.  1.] - - -9->11 - - - - -13 - -X[0] <= 5.9500 -error = 0.444444 -samples = 3 -value = [ 0.  1.  2.] - - -12->13 - - - - -16 - -error = 0.0 -samples = 43 -value = [  0.   0.  43.] - - -12->16 - - - - -14 - -error = 0.0 -samples = 1 -value = [ 0.  1.  0.] - - -13->14 - - - - -15 - -error = 0.0 -samples = 2 -value = [ 0.  0.  2.] - - -13->15 - - - - - diff --git a/0.15/_images/lasso_dense_vs_sparse_data.png b/0.15/_images/lasso_dense_vs_sparse_data.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/lasso_dense_vs_sparse_data.png and /dev/null differ diff --git a/0.15/_images/lasso_dense_vs_sparse_data1.png b/0.15/_images/lasso_dense_vs_sparse_data1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/lasso_dense_vs_sparse_data1.png and /dev/null differ diff --git a/0.15/_images/lovely.png b/0.15/_images/lovely.png deleted file mode 100644 index 0349b861c7d85..0000000000000 Binary files a/0.15/_images/lovely.png and /dev/null differ diff --git a/0.15/_images/machinalis.png b/0.15/_images/machinalis.png deleted file mode 100644 index efb4d10e9cfac..0000000000000 Binary files a/0.15/_images/machinalis.png and /dev/null differ diff --git a/0.15/_images/math/0001d02b63ede2fe3219e05a7cd09c82ae6298b6.png b/0.15/_images/math/0001d02b63ede2fe3219e05a7cd09c82ae6298b6.png deleted file mode 100644 index 9686a085e85da..0000000000000 Binary files a/0.15/_images/math/0001d02b63ede2fe3219e05a7cd09c82ae6298b6.png and /dev/null differ diff --git a/0.15/_images/math/00534d854d26fe2a55c1065948f9b94f66255a4a.png b/0.15/_images/math/00534d854d26fe2a55c1065948f9b94f66255a4a.png deleted file mode 100644 index a53d3b8f28ee3..0000000000000 Binary files a/0.15/_images/math/00534d854d26fe2a55c1065948f9b94f66255a4a.png and /dev/null differ diff --git a/0.15/_images/math/00d9354f8f72ca984bd3104e14b4fa03eef0bf9e.png b/0.15/_images/math/00d9354f8f72ca984bd3104e14b4fa03eef0bf9e.png deleted file mode 100644 index 9605c970fc187..0000000000000 Binary files a/0.15/_images/math/00d9354f8f72ca984bd3104e14b4fa03eef0bf9e.png and /dev/null differ diff --git a/0.15/_images/math/012e7356d88340bea4c57c83c8e34a0bff43c99b.png b/0.15/_images/math/012e7356d88340bea4c57c83c8e34a0bff43c99b.png deleted file mode 100644 index d54290eb7399c..0000000000000 Binary files a/0.15/_images/math/012e7356d88340bea4c57c83c8e34a0bff43c99b.png and /dev/null differ diff --git a/0.15/_images/math/02fd9261058a79736b1df19af192c584f222eb3a.png b/0.15/_images/math/02fd9261058a79736b1df19af192c584f222eb3a.png deleted file mode 100644 index 9e34c1e36c29b..0000000000000 Binary files a/0.15/_images/math/02fd9261058a79736b1df19af192c584f222eb3a.png and /dev/null differ diff --git a/0.15/_images/math/03d3d364bd2e391e05067b1741b2f2b4912f4acd.png b/0.15/_images/math/03d3d364bd2e391e05067b1741b2f2b4912f4acd.png deleted file mode 100644 index 690c03c478ba0..0000000000000 Binary files a/0.15/_images/math/03d3d364bd2e391e05067b1741b2f2b4912f4acd.png and /dev/null differ diff --git a/0.15/_images/math/046a9803ee7eed69db4338f56ae9794e00961cb1.png b/0.15/_images/math/046a9803ee7eed69db4338f56ae9794e00961cb1.png deleted file mode 100644 index 5f255d1bd9877..0000000000000 Binary files a/0.15/_images/math/046a9803ee7eed69db4338f56ae9794e00961cb1.png and /dev/null differ diff --git a/0.15/_images/math/04d0112aa0308b04992746d5020cf9a2940fc1a1.png b/0.15/_images/math/04d0112aa0308b04992746d5020cf9a2940fc1a1.png deleted file mode 100644 index a20c2df36f0fc..0000000000000 Binary files a/0.15/_images/math/04d0112aa0308b04992746d5020cf9a2940fc1a1.png and /dev/null differ diff --git a/0.15/_images/math/0516d06a9c644cd6f93d73c8151f4206a52496c0.png b/0.15/_images/math/0516d06a9c644cd6f93d73c8151f4206a52496c0.png deleted file mode 100644 index 03e0b0b698933..0000000000000 Binary files a/0.15/_images/math/0516d06a9c644cd6f93d73c8151f4206a52496c0.png and /dev/null differ diff --git a/0.15/_images/math/05f6967941388299e26ac610d9660d3b6e7d1c33.png b/0.15/_images/math/05f6967941388299e26ac610d9660d3b6e7d1c33.png deleted file mode 100644 index 52b3d0beb16b9..0000000000000 Binary files a/0.15/_images/math/05f6967941388299e26ac610d9660d3b6e7d1c33.png and /dev/null differ diff --git a/0.15/_images/math/0723f27d3533f4a89b5383cf6055db6fa3f1d91a.png b/0.15/_images/math/0723f27d3533f4a89b5383cf6055db6fa3f1d91a.png deleted file mode 100644 index efb17aad8df5a..0000000000000 Binary files a/0.15/_images/math/0723f27d3533f4a89b5383cf6055db6fa3f1d91a.png and /dev/null differ diff --git a/0.15/_images/math/07b943c6dd1061bde470bebfa3e9b5e373216870.png b/0.15/_images/math/07b943c6dd1061bde470bebfa3e9b5e373216870.png deleted file mode 100644 index 624fcd8dbf808..0000000000000 Binary files a/0.15/_images/math/07b943c6dd1061bde470bebfa3e9b5e373216870.png and /dev/null differ diff --git a/0.15/_images/math/07c10ca9581adc1e9563003d046a47e32a36d902.png b/0.15/_images/math/07c10ca9581adc1e9563003d046a47e32a36d902.png deleted file mode 100644 index b17a8068bdcc2..0000000000000 Binary files a/0.15/_images/math/07c10ca9581adc1e9563003d046a47e32a36d902.png and /dev/null differ diff --git a/0.15/_images/math/08208315dbc033b6692eab4e29cffaabe301b72c.png b/0.15/_images/math/08208315dbc033b6692eab4e29cffaabe301b72c.png deleted file mode 100644 index 30642ded44e36..0000000000000 Binary files a/0.15/_images/math/08208315dbc033b6692eab4e29cffaabe301b72c.png and /dev/null differ diff --git a/0.15/_images/math/088138d180d3b322617921d408597bf140875237.png b/0.15/_images/math/088138d180d3b322617921d408597bf140875237.png deleted file mode 100644 index d3862398a26a5..0000000000000 Binary files a/0.15/_images/math/088138d180d3b322617921d408597bf140875237.png and /dev/null differ diff --git a/0.15/_images/math/08b2238649d4005da6c6591a962c50452243ab30.png b/0.15/_images/math/08b2238649d4005da6c6591a962c50452243ab30.png deleted file mode 100644 index 06621bb975c41..0000000000000 Binary files a/0.15/_images/math/08b2238649d4005da6c6591a962c50452243ab30.png and /dev/null differ diff --git a/0.15/_images/math/08c0a64f82c8a1bcf792aa6ffc9fda4281353e77.png b/0.15/_images/math/08c0a64f82c8a1bcf792aa6ffc9fda4281353e77.png deleted file mode 100644 index fa7e24e9e1d0e..0000000000000 Binary files a/0.15/_images/math/08c0a64f82c8a1bcf792aa6ffc9fda4281353e77.png and /dev/null differ diff --git a/0.15/_images/math/08fe58960982174a36d8a65ef1af0d3acf7ace5a.png b/0.15/_images/math/08fe58960982174a36d8a65ef1af0d3acf7ace5a.png deleted file mode 100644 index aeda3952722bd..0000000000000 Binary files a/0.15/_images/math/08fe58960982174a36d8a65ef1af0d3acf7ace5a.png and /dev/null differ diff --git a/0.15/_images/math/093edac7548ff6dcb81cfbee5ef2249fb8295d23.png b/0.15/_images/math/093edac7548ff6dcb81cfbee5ef2249fb8295d23.png deleted file mode 100644 index 3ce2c5a0f6128..0000000000000 Binary files a/0.15/_images/math/093edac7548ff6dcb81cfbee5ef2249fb8295d23.png and /dev/null differ diff --git a/0.15/_images/math/09e53d7a8fb63ae416b161ae68bb19b686e99e6c.png b/0.15/_images/math/09e53d7a8fb63ae416b161ae68bb19b686e99e6c.png deleted file mode 100644 index d03ec7e488ad1..0000000000000 Binary files a/0.15/_images/math/09e53d7a8fb63ae416b161ae68bb19b686e99e6c.png and /dev/null differ diff --git a/0.15/_images/math/0a5711c7a37994043b2bc3bb374adca232491762.png b/0.15/_images/math/0a5711c7a37994043b2bc3bb374adca232491762.png deleted file mode 100644 index cf74218e18c20..0000000000000 Binary files a/0.15/_images/math/0a5711c7a37994043b2bc3bb374adca232491762.png and /dev/null differ diff --git a/0.15/_images/math/0ab947efff917018af673e579b1da0b06abe7216.png b/0.15/_images/math/0ab947efff917018af673e579b1da0b06abe7216.png deleted file mode 100644 index 6e0a9046c5ddf..0000000000000 Binary files a/0.15/_images/math/0ab947efff917018af673e579b1da0b06abe7216.png and /dev/null differ diff --git a/0.15/_images/math/0acafa529182e79b4f56165ec677554fba7fcf98.png b/0.15/_images/math/0acafa529182e79b4f56165ec677554fba7fcf98.png deleted file mode 100644 index 6757b36a8e171..0000000000000 Binary files a/0.15/_images/math/0acafa529182e79b4f56165ec677554fba7fcf98.png and /dev/null differ diff --git a/0.15/_images/math/0b5a7fd2f2dd52ffb51438669d9acff8026a2db9.png b/0.15/_images/math/0b5a7fd2f2dd52ffb51438669d9acff8026a2db9.png deleted file mode 100644 index 4acd110f0ae20..0000000000000 Binary files a/0.15/_images/math/0b5a7fd2f2dd52ffb51438669d9acff8026a2db9.png and /dev/null differ diff --git a/0.15/_images/math/0c23542ac8b511252ba44a5ce8d0767b977699a8.png b/0.15/_images/math/0c23542ac8b511252ba44a5ce8d0767b977699a8.png deleted file mode 100644 index 64cd3ad7c3b87..0000000000000 Binary files a/0.15/_images/math/0c23542ac8b511252ba44a5ce8d0767b977699a8.png and /dev/null differ diff --git a/0.15/_images/math/0c9b8c78a7a049eca8f2168d0691afc6a65a9dad.png b/0.15/_images/math/0c9b8c78a7a049eca8f2168d0691afc6a65a9dad.png deleted file mode 100644 index 7b72ea068ffc8..0000000000000 Binary files a/0.15/_images/math/0c9b8c78a7a049eca8f2168d0691afc6a65a9dad.png and /dev/null differ diff --git a/0.15/_images/math/0d465b7bdcd3a05ac865614ffa50bcced017fefe.png b/0.15/_images/math/0d465b7bdcd3a05ac865614ffa50bcced017fefe.png deleted file mode 100644 index 546b298d6ce01..0000000000000 Binary files a/0.15/_images/math/0d465b7bdcd3a05ac865614ffa50bcced017fefe.png and /dev/null differ diff --git a/0.15/_images/math/0dbee5337af83bf741686fc31304d338fb560e24.png b/0.15/_images/math/0dbee5337af83bf741686fc31304d338fb560e24.png deleted file mode 100644 index cdf8a9bf6fe15..0000000000000 Binary files a/0.15/_images/math/0dbee5337af83bf741686fc31304d338fb560e24.png and /dev/null differ diff --git a/0.15/_images/math/0ddb6f5c7faa5f769117e3268fae9f895b095b34.png b/0.15/_images/math/0ddb6f5c7faa5f769117e3268fae9f895b095b34.png deleted file mode 100644 index 13e62124b7327..0000000000000 Binary files a/0.15/_images/math/0ddb6f5c7faa5f769117e3268fae9f895b095b34.png and /dev/null differ diff --git a/0.15/_images/math/0de6d1f23c5946a81cd4df860506e2d182ad36a5.png b/0.15/_images/math/0de6d1f23c5946a81cd4df860506e2d182ad36a5.png deleted file mode 100644 index 21c8cd7038a0f..0000000000000 Binary files a/0.15/_images/math/0de6d1f23c5946a81cd4df860506e2d182ad36a5.png and /dev/null differ diff --git a/0.15/_images/math/0e22076955898e6c9bb38aa079135195c24dc81e.png b/0.15/_images/math/0e22076955898e6c9bb38aa079135195c24dc81e.png deleted file mode 100644 index 59266b476cacc..0000000000000 Binary files a/0.15/_images/math/0e22076955898e6c9bb38aa079135195c24dc81e.png and /dev/null differ diff --git a/0.15/_images/math/0ebb67342b546ca42a1c634b1ef03c893c4cdedb.png b/0.15/_images/math/0ebb67342b546ca42a1c634b1ef03c893c4cdedb.png deleted file mode 100644 index 3c86ea892cbaa..0000000000000 Binary files a/0.15/_images/math/0ebb67342b546ca42a1c634b1ef03c893c4cdedb.png and /dev/null differ diff --git a/0.15/_images/math/106c968682dbc48c2e3c7b95f4c5e5928ad93589.png b/0.15/_images/math/106c968682dbc48c2e3c7b95f4c5e5928ad93589.png deleted file mode 100644 index 5f8ce176341a0..0000000000000 Binary files a/0.15/_images/math/106c968682dbc48c2e3c7b95f4c5e5928ad93589.png and /dev/null differ diff --git a/0.15/_images/math/10825eb55b44e9ab80b14555820128116d47b0ad.png b/0.15/_images/math/10825eb55b44e9ab80b14555820128116d47b0ad.png deleted file mode 100644 index b9b4bbe103311..0000000000000 Binary files a/0.15/_images/math/10825eb55b44e9ab80b14555820128116d47b0ad.png and /dev/null differ diff --git a/0.15/_images/math/10c1145cd86665e4b73a65a7e9175b18fa65bebc.png b/0.15/_images/math/10c1145cd86665e4b73a65a7e9175b18fa65bebc.png deleted file mode 100644 index a0dbfe48fd5d5..0000000000000 Binary files a/0.15/_images/math/10c1145cd86665e4b73a65a7e9175b18fa65bebc.png and /dev/null differ diff --git a/0.15/_images/math/10e009bdb83f96c5f47c58b34d5d4b12ef268d5b.png b/0.15/_images/math/10e009bdb83f96c5f47c58b34d5d4b12ef268d5b.png deleted file mode 100644 index f3a22a0366ef2..0000000000000 Binary files a/0.15/_images/math/10e009bdb83f96c5f47c58b34d5d4b12ef268d5b.png and /dev/null differ diff --git a/0.15/_images/math/110fea905d9ed71ce598e82f51bf26a1661f8f5c.png b/0.15/_images/math/110fea905d9ed71ce598e82f51bf26a1661f8f5c.png deleted file mode 100644 index b41f8ac6c96a8..0000000000000 Binary files a/0.15/_images/math/110fea905d9ed71ce598e82f51bf26a1661f8f5c.png and /dev/null differ diff --git a/0.15/_images/math/111ee5b0009a7d22900d39da34dd082f6b4433a4.png b/0.15/_images/math/111ee5b0009a7d22900d39da34dd082f6b4433a4.png deleted file mode 100644 index c973332309cbc..0000000000000 Binary files a/0.15/_images/math/111ee5b0009a7d22900d39da34dd082f6b4433a4.png and /dev/null differ diff --git a/0.15/_images/math/1149cb226589a7b7d18f15d51c492e99da4fae4c.png b/0.15/_images/math/1149cb226589a7b7d18f15d51c492e99da4fae4c.png deleted file mode 100644 index 83989efd448b7..0000000000000 Binary files a/0.15/_images/math/1149cb226589a7b7d18f15d51c492e99da4fae4c.png and /dev/null differ diff --git a/0.15/_images/math/11a85f3c69ae6702cb1d99d3de451913b8f84c04.png b/0.15/_images/math/11a85f3c69ae6702cb1d99d3de451913b8f84c04.png deleted file mode 100644 index 7241618c7806a..0000000000000 Binary files a/0.15/_images/math/11a85f3c69ae6702cb1d99d3de451913b8f84c04.png and /dev/null differ diff --git a/0.15/_images/math/11f0787a645f4b5f2b810c0d00618785b58ff574.png b/0.15/_images/math/11f0787a645f4b5f2b810c0d00618785b58ff574.png deleted file mode 100644 index f065966ae00f5..0000000000000 Binary files a/0.15/_images/math/11f0787a645f4b5f2b810c0d00618785b58ff574.png and /dev/null differ diff --git a/0.15/_images/math/126e84ba38f7dece5f0ad64e929b9588b20f6440.png b/0.15/_images/math/126e84ba38f7dece5f0ad64e929b9588b20f6440.png deleted file mode 100644 index b6796f0740f5c..0000000000000 Binary files a/0.15/_images/math/126e84ba38f7dece5f0ad64e929b9588b20f6440.png and /dev/null differ diff --git a/0.15/_images/math/126ebec962b92ea636c9a03b9cb9c6bd2672a1f5.png b/0.15/_images/math/126ebec962b92ea636c9a03b9cb9c6bd2672a1f5.png deleted file mode 100644 index 4f88a78ea3f19..0000000000000 Binary files a/0.15/_images/math/126ebec962b92ea636c9a03b9cb9c6bd2672a1f5.png and /dev/null differ diff --git a/0.15/_images/math/12934fe0b6fd78ffdbf076ed359cc8fb9a103848.png b/0.15/_images/math/12934fe0b6fd78ffdbf076ed359cc8fb9a103848.png deleted file mode 100644 index a07b434160674..0000000000000 Binary files a/0.15/_images/math/12934fe0b6fd78ffdbf076ed359cc8fb9a103848.png and /dev/null differ diff --git a/0.15/_images/math/12a7743572f61fae6a99a07bc1117776e819981d.png b/0.15/_images/math/12a7743572f61fae6a99a07bc1117776e819981d.png deleted file mode 100644 index a1d357c0feac1..0000000000000 Binary files a/0.15/_images/math/12a7743572f61fae6a99a07bc1117776e819981d.png and /dev/null differ diff --git a/0.15/_images/math/132dd1872743cc6a09b7224a438f031de75f935d.png b/0.15/_images/math/132dd1872743cc6a09b7224a438f031de75f935d.png deleted file mode 100644 index 7f8d20addbf4a..0000000000000 Binary files a/0.15/_images/math/132dd1872743cc6a09b7224a438f031de75f935d.png and /dev/null differ diff --git a/0.15/_images/math/1376e8e59ba3b59ff5f4f9e7dd475684017ea210.png b/0.15/_images/math/1376e8e59ba3b59ff5f4f9e7dd475684017ea210.png deleted file mode 100644 index d9b7f314658b3..0000000000000 Binary files a/0.15/_images/math/1376e8e59ba3b59ff5f4f9e7dd475684017ea210.png and /dev/null differ diff --git a/0.15/_images/math/138a8dd99b6da12de6f02b76afeda6e5885a7f7c.png b/0.15/_images/math/138a8dd99b6da12de6f02b76afeda6e5885a7f7c.png deleted file mode 100644 index 2c05935d5739c..0000000000000 Binary files a/0.15/_images/math/138a8dd99b6da12de6f02b76afeda6e5885a7f7c.png and /dev/null differ diff --git a/0.15/_images/math/13f995fd0de4d863d93b62211954f6da80bde589.png b/0.15/_images/math/13f995fd0de4d863d93b62211954f6da80bde589.png deleted file mode 100644 index b31a81c878573..0000000000000 Binary files a/0.15/_images/math/13f995fd0de4d863d93b62211954f6da80bde589.png and /dev/null differ diff --git a/0.15/_images/math/14022777bcd4f1efe5389ef6f4f3a76ff95cc6ed.png b/0.15/_images/math/14022777bcd4f1efe5389ef6f4f3a76ff95cc6ed.png deleted file mode 100644 index 87bed09ada526..0000000000000 Binary files a/0.15/_images/math/14022777bcd4f1efe5389ef6f4f3a76ff95cc6ed.png and /dev/null differ diff --git a/0.15/_images/math/14546c27a7b929642f7840acca5f851c503ea109.png b/0.15/_images/math/14546c27a7b929642f7840acca5f851c503ea109.png deleted file mode 100644 index ef3cdd22c6a24..0000000000000 Binary files a/0.15/_images/math/14546c27a7b929642f7840acca5f851c503ea109.png and /dev/null differ diff --git a/0.15/_images/math/15c553f2cfb7fa130f468d1a1bf31553d617f0fc.png b/0.15/_images/math/15c553f2cfb7fa130f468d1a1bf31553d617f0fc.png deleted file mode 100644 index edb700626f371..0000000000000 Binary files a/0.15/_images/math/15c553f2cfb7fa130f468d1a1bf31553d617f0fc.png and /dev/null differ diff --git a/0.15/_images/math/168b41d971e0e2e6d9bf8b198eccfe76a5d71030.png b/0.15/_images/math/168b41d971e0e2e6d9bf8b198eccfe76a5d71030.png deleted file mode 100644 index 91b927fe010d8..0000000000000 Binary files a/0.15/_images/math/168b41d971e0e2e6d9bf8b198eccfe76a5d71030.png and /dev/null differ diff --git a/0.15/_images/math/17ed5419fbfe317f160a2be3da9c6f0ce53b5b86.png b/0.15/_images/math/17ed5419fbfe317f160a2be3da9c6f0ce53b5b86.png deleted file mode 100644 index 4624f6db1bbbb..0000000000000 Binary files a/0.15/_images/math/17ed5419fbfe317f160a2be3da9c6f0ce53b5b86.png and /dev/null differ diff --git a/0.15/_images/math/183421431fcc0a42e22f825a33dcc3c51607fa6e.png b/0.15/_images/math/183421431fcc0a42e22f825a33dcc3c51607fa6e.png deleted file mode 100644 index 558777ef5af8c..0000000000000 Binary files a/0.15/_images/math/183421431fcc0a42e22f825a33dcc3c51607fa6e.png and /dev/null differ diff --git a/0.15/_images/math/1889effe941e98e922ac75fff826fc04ef489d2d.png b/0.15/_images/math/1889effe941e98e922ac75fff826fc04ef489d2d.png deleted file mode 100644 index a9318279b455d..0000000000000 Binary files a/0.15/_images/math/1889effe941e98e922ac75fff826fc04ef489d2d.png and /dev/null differ diff --git a/0.15/_images/math/188c175aac0a8a9c22499336711b5d7256407254.png b/0.15/_images/math/188c175aac0a8a9c22499336711b5d7256407254.png deleted file mode 100644 index 2776aa5a62dbd..0000000000000 Binary files a/0.15/_images/math/188c175aac0a8a9c22499336711b5d7256407254.png and /dev/null differ diff --git a/0.15/_images/math/18cbd415b1a8e3f19977c5d04d046d41c585c7de.png b/0.15/_images/math/18cbd415b1a8e3f19977c5d04d046d41c585c7de.png deleted file mode 100644 index bed71691a0a80..0000000000000 Binary files a/0.15/_images/math/18cbd415b1a8e3f19977c5d04d046d41c585c7de.png and /dev/null differ diff --git a/0.15/_images/math/196f9e31dfd9403804db63b03de06cc584586a8c.png b/0.15/_images/math/196f9e31dfd9403804db63b03de06cc584586a8c.png deleted file mode 100644 index 4856b94521bde..0000000000000 Binary files a/0.15/_images/math/196f9e31dfd9403804db63b03de06cc584586a8c.png and /dev/null differ diff --git a/0.15/_images/math/19ac15bf260b22dcb61a1042c60259e4b0bfbd64.png b/0.15/_images/math/19ac15bf260b22dcb61a1042c60259e4b0bfbd64.png deleted file mode 100644 index 7e080fa1157a8..0000000000000 Binary files a/0.15/_images/math/19ac15bf260b22dcb61a1042c60259e4b0bfbd64.png and /dev/null differ diff --git a/0.15/_images/math/19bc0073dde1bcd1a8e6a32b251e80cced668f04.png b/0.15/_images/math/19bc0073dde1bcd1a8e6a32b251e80cced668f04.png deleted file mode 100644 index 586ca152ac34b..0000000000000 Binary files a/0.15/_images/math/19bc0073dde1bcd1a8e6a32b251e80cced668f04.png and /dev/null differ diff --git a/0.15/_images/math/19fd361492333ed7742f1adca8f3750a8c5f843b.png b/0.15/_images/math/19fd361492333ed7742f1adca8f3750a8c5f843b.png deleted file mode 100644 index 6a5b227304032..0000000000000 Binary files a/0.15/_images/math/19fd361492333ed7742f1adca8f3750a8c5f843b.png and /dev/null differ diff --git a/0.15/_images/math/1a826fd4e37c0ceccbb19369141c92a7c1743e04.png b/0.15/_images/math/1a826fd4e37c0ceccbb19369141c92a7c1743e04.png deleted file mode 100644 index 9ac5a8117f543..0000000000000 Binary files a/0.15/_images/math/1a826fd4e37c0ceccbb19369141c92a7c1743e04.png and /dev/null differ diff --git a/0.15/_images/math/1a84eaa6f87e3ed766b4b2f302564b4667ad0ba9.png b/0.15/_images/math/1a84eaa6f87e3ed766b4b2f302564b4667ad0ba9.png deleted file mode 100644 index b9540e9b117ad..0000000000000 Binary files a/0.15/_images/math/1a84eaa6f87e3ed766b4b2f302564b4667ad0ba9.png and /dev/null differ diff --git a/0.15/_images/math/1ab0134b6e0837594649c75a2ed83cfd85a2d03d.png b/0.15/_images/math/1ab0134b6e0837594649c75a2ed83cfd85a2d03d.png deleted file mode 100644 index de90245044f2c..0000000000000 Binary files a/0.15/_images/math/1ab0134b6e0837594649c75a2ed83cfd85a2d03d.png and /dev/null differ diff --git a/0.15/_images/math/1ac1b7a14866748c386ccbc41d0b4714aafe1c1e.png b/0.15/_images/math/1ac1b7a14866748c386ccbc41d0b4714aafe1c1e.png deleted file mode 100644 index 3811aecfb7c5d..0000000000000 Binary files a/0.15/_images/math/1ac1b7a14866748c386ccbc41d0b4714aafe1c1e.png and /dev/null differ diff --git a/0.15/_images/math/1ad2316c6e8615331c76273a683a0560d1e66d07.png b/0.15/_images/math/1ad2316c6e8615331c76273a683a0560d1e66d07.png deleted file mode 100644 index 6544fc30f976b..0000000000000 Binary files a/0.15/_images/math/1ad2316c6e8615331c76273a683a0560d1e66d07.png and /dev/null differ diff --git a/0.15/_images/math/1b10bb021bdcab80e9a192bc46f57eaac675bff0.png b/0.15/_images/math/1b10bb021bdcab80e9a192bc46f57eaac675bff0.png deleted file mode 100644 index c5773c7c44900..0000000000000 Binary files a/0.15/_images/math/1b10bb021bdcab80e9a192bc46f57eaac675bff0.png and /dev/null differ diff --git a/0.15/_images/math/1b6d1bfe6128c39a78cf9d03ce2b8c383af766f3.png b/0.15/_images/math/1b6d1bfe6128c39a78cf9d03ce2b8c383af766f3.png deleted file mode 100644 index 80d8b180a56e9..0000000000000 Binary files a/0.15/_images/math/1b6d1bfe6128c39a78cf9d03ce2b8c383af766f3.png and /dev/null differ diff --git a/0.15/_images/math/1ba3ffd927bbc923681949691879142eb7ddcb06.png b/0.15/_images/math/1ba3ffd927bbc923681949691879142eb7ddcb06.png deleted file mode 100644 index 96c08cf74edb6..0000000000000 Binary files a/0.15/_images/math/1ba3ffd927bbc923681949691879142eb7ddcb06.png and /dev/null differ diff --git a/0.15/_images/math/1baf28db6f115a17039f3676a3bc2a9f71705480.png b/0.15/_images/math/1baf28db6f115a17039f3676a3bc2a9f71705480.png deleted file mode 100644 index e6a550f6bc202..0000000000000 Binary files a/0.15/_images/math/1baf28db6f115a17039f3676a3bc2a9f71705480.png and /dev/null differ diff --git a/0.15/_images/math/1ce752cc0feafeca82a10347e47927f82d90254d.png b/0.15/_images/math/1ce752cc0feafeca82a10347e47927f82d90254d.png deleted file mode 100644 index 000f1e4763cf9..0000000000000 Binary files a/0.15/_images/math/1ce752cc0feafeca82a10347e47927f82d90254d.png and /dev/null differ diff --git a/0.15/_images/math/1d1dd9e089c48d7fbe33ffd8f0fc3d49f59b68df.png b/0.15/_images/math/1d1dd9e089c48d7fbe33ffd8f0fc3d49f59b68df.png deleted file mode 100644 index 7044b0e889651..0000000000000 Binary files a/0.15/_images/math/1d1dd9e089c48d7fbe33ffd8f0fc3d49f59b68df.png and /dev/null differ diff --git a/0.15/_images/math/1d77f3b3a344d15e6135bd7348a736163fa0ca8b.png b/0.15/_images/math/1d77f3b3a344d15e6135bd7348a736163fa0ca8b.png deleted file mode 100644 index cfdd4c4272435..0000000000000 Binary files a/0.15/_images/math/1d77f3b3a344d15e6135bd7348a736163fa0ca8b.png and /dev/null differ diff --git a/0.15/_images/math/1dec7af271b33c934d6c8a257256f248f83ce452.png b/0.15/_images/math/1dec7af271b33c934d6c8a257256f248f83ce452.png deleted file mode 100644 index 7fb9f9c4d4330..0000000000000 Binary files a/0.15/_images/math/1dec7af271b33c934d6c8a257256f248f83ce452.png and /dev/null differ diff --git a/0.15/_images/math/1df05e599583852d227514ff84ea614fc5159fba.png b/0.15/_images/math/1df05e599583852d227514ff84ea614fc5159fba.png deleted file mode 100644 index b8a54078d6b4a..0000000000000 Binary files a/0.15/_images/math/1df05e599583852d227514ff84ea614fc5159fba.png and /dev/null differ diff --git a/0.15/_images/math/1e6016cbca75e249f466fe617256488041db5da2.png b/0.15/_images/math/1e6016cbca75e249f466fe617256488041db5da2.png deleted file mode 100644 index cd5b2c19b4048..0000000000000 Binary files a/0.15/_images/math/1e6016cbca75e249f466fe617256488041db5da2.png and /dev/null differ diff --git a/0.15/_images/math/1e8904a391eec39276c9794f76d1b3a247e5fdf0.png b/0.15/_images/math/1e8904a391eec39276c9794f76d1b3a247e5fdf0.png deleted file mode 100644 index 9243eab0e0b6e..0000000000000 Binary files a/0.15/_images/math/1e8904a391eec39276c9794f76d1b3a247e5fdf0.png and /dev/null differ diff --git a/0.15/_images/math/1ec6f3fe56afecec546113525110fb384766829e.png b/0.15/_images/math/1ec6f3fe56afecec546113525110fb384766829e.png deleted file mode 100644 index 915bdd0e4e767..0000000000000 Binary files a/0.15/_images/math/1ec6f3fe56afecec546113525110fb384766829e.png and /dev/null differ diff --git a/0.15/_images/math/1ec89a125496001eea33264978ca18b2f28136cb.png b/0.15/_images/math/1ec89a125496001eea33264978ca18b2f28136cb.png deleted file mode 100644 index 928b10fea4973..0000000000000 Binary files a/0.15/_images/math/1ec89a125496001eea33264978ca18b2f28136cb.png and /dev/null differ diff --git a/0.15/_images/math/1f41dea8d6bdb5d736a645ff2c6179fd733c0a27.png b/0.15/_images/math/1f41dea8d6bdb5d736a645ff2c6179fd733c0a27.png deleted file mode 100644 index e0f809f568200..0000000000000 Binary files a/0.15/_images/math/1f41dea8d6bdb5d736a645ff2c6179fd733c0a27.png and /dev/null differ diff --git a/0.15/_images/math/1f6c59db664fcbf0c51e93d3fd881f74ed6881ce.png b/0.15/_images/math/1f6c59db664fcbf0c51e93d3fd881f74ed6881ce.png deleted file mode 100644 index 2bec0b1c17516..0000000000000 Binary files a/0.15/_images/math/1f6c59db664fcbf0c51e93d3fd881f74ed6881ce.png and /dev/null differ diff --git a/0.15/_images/math/1f8d6a1c6e2d5114c2d22fd2592a116661811378.png b/0.15/_images/math/1f8d6a1c6e2d5114c2d22fd2592a116661811378.png deleted file mode 100644 index e16d832cdd7e4..0000000000000 Binary files a/0.15/_images/math/1f8d6a1c6e2d5114c2d22fd2592a116661811378.png and /dev/null differ diff --git a/0.15/_images/math/201829ffee3d603b006f553725e6a844eb867a7a.png b/0.15/_images/math/201829ffee3d603b006f553725e6a844eb867a7a.png deleted file mode 100644 index b9b3f2d7b0219..0000000000000 Binary files a/0.15/_images/math/201829ffee3d603b006f553725e6a844eb867a7a.png and /dev/null differ diff --git a/0.15/_images/math/20c99f81ba0757651f17ff9b10f01f5400f989d9.png b/0.15/_images/math/20c99f81ba0757651f17ff9b10f01f5400f989d9.png deleted file mode 100644 index de4d6819adafa..0000000000000 Binary files a/0.15/_images/math/20c99f81ba0757651f17ff9b10f01f5400f989d9.png and /dev/null differ diff --git a/0.15/_images/math/20f6d07c95bbe8ddd59f1ed7bcdc3fbfd21b5559.png b/0.15/_images/math/20f6d07c95bbe8ddd59f1ed7bcdc3fbfd21b5559.png deleted file mode 100644 index 0f247fc1b943d..0000000000000 Binary files a/0.15/_images/math/20f6d07c95bbe8ddd59f1ed7bcdc3fbfd21b5559.png and /dev/null differ diff --git a/0.15/_images/math/2133ba457cf081dbcc03536c61648e52417fc80c.png b/0.15/_images/math/2133ba457cf081dbcc03536c61648e52417fc80c.png deleted file mode 100644 index 211f290b8e0a0..0000000000000 Binary files a/0.15/_images/math/2133ba457cf081dbcc03536c61648e52417fc80c.png and /dev/null differ diff --git a/0.15/_images/math/216499b7b74994c090829dbb0e24bfd8b8d177fc.png b/0.15/_images/math/216499b7b74994c090829dbb0e24bfd8b8d177fc.png deleted file mode 100644 index c8d770d8edf24..0000000000000 Binary files a/0.15/_images/math/216499b7b74994c090829dbb0e24bfd8b8d177fc.png and /dev/null differ diff --git a/0.15/_images/math/21e7f5477286a9b61105aacc47d8efb9becaad9b.png b/0.15/_images/math/21e7f5477286a9b61105aacc47d8efb9becaad9b.png deleted file mode 100644 index 05665c84dded3..0000000000000 Binary files a/0.15/_images/math/21e7f5477286a9b61105aacc47d8efb9becaad9b.png and /dev/null differ diff --git a/0.15/_images/math/2283f7ea4e07f0f115b4aaa6a817ab1810efdbea.png b/0.15/_images/math/2283f7ea4e07f0f115b4aaa6a817ab1810efdbea.png deleted file mode 100644 index 916989eb9d385..0000000000000 Binary files a/0.15/_images/math/2283f7ea4e07f0f115b4aaa6a817ab1810efdbea.png and /dev/null differ diff --git a/0.15/_images/math/2298cf1485084afe72757a9c8483af49a138d81f.png b/0.15/_images/math/2298cf1485084afe72757a9c8483af49a138d81f.png deleted file mode 100644 index d9b8167d1764c..0000000000000 Binary files a/0.15/_images/math/2298cf1485084afe72757a9c8483af49a138d81f.png and /dev/null differ diff --git a/0.15/_images/math/22f4ab6468e7a706bc27b9e5b2769965b9e2991a.png b/0.15/_images/math/22f4ab6468e7a706bc27b9e5b2769965b9e2991a.png deleted file mode 100644 index b4aa8add87f7e..0000000000000 Binary files a/0.15/_images/math/22f4ab6468e7a706bc27b9e5b2769965b9e2991a.png and /dev/null differ diff --git a/0.15/_images/math/23a80b675c45b1f775e65ae538e11c3dcad01577.png b/0.15/_images/math/23a80b675c45b1f775e65ae538e11c3dcad01577.png deleted file mode 100644 index 881a802512fd8..0000000000000 Binary files a/0.15/_images/math/23a80b675c45b1f775e65ae538e11c3dcad01577.png and /dev/null differ diff --git a/0.15/_images/math/23ca2c534b3fe41683cbc51a0948ba22563356d1.png b/0.15/_images/math/23ca2c534b3fe41683cbc51a0948ba22563356d1.png deleted file mode 100644 index 44d9c6da215c3..0000000000000 Binary files a/0.15/_images/math/23ca2c534b3fe41683cbc51a0948ba22563356d1.png and /dev/null differ diff --git a/0.15/_images/math/23f1b45408e5b4130c0f940fcbfcec54492cbdcd.png b/0.15/_images/math/23f1b45408e5b4130c0f940fcbfcec54492cbdcd.png deleted file mode 100644 index f6f26f86cdded..0000000000000 Binary files a/0.15/_images/math/23f1b45408e5b4130c0f940fcbfcec54492cbdcd.png and /dev/null differ diff --git a/0.15/_images/math/23fee98757d811d8b5ade0fd876948f60f7806d9.png b/0.15/_images/math/23fee98757d811d8b5ade0fd876948f60f7806d9.png deleted file mode 100644 index 9dbeedfe06aae..0000000000000 Binary files a/0.15/_images/math/23fee98757d811d8b5ade0fd876948f60f7806d9.png and /dev/null differ diff --git a/0.15/_images/math/24a5a6643f900bf129cdd7a03a6e161d1524ebfc.png b/0.15/_images/math/24a5a6643f900bf129cdd7a03a6e161d1524ebfc.png deleted file mode 100644 index 6d77d68ed98a0..0000000000000 Binary files a/0.15/_images/math/24a5a6643f900bf129cdd7a03a6e161d1524ebfc.png and /dev/null differ diff --git a/0.15/_images/math/24b02b1bfa811241ff9b1e8dbdbf425ef7851750.png b/0.15/_images/math/24b02b1bfa811241ff9b1e8dbdbf425ef7851750.png deleted file mode 100644 index 05efe50ab8941..0000000000000 Binary files a/0.15/_images/math/24b02b1bfa811241ff9b1e8dbdbf425ef7851750.png and /dev/null differ diff --git a/0.15/_images/math/24e745e0f9174a59c0ff6e8a6867a41ba1236a4c.png b/0.15/_images/math/24e745e0f9174a59c0ff6e8a6867a41ba1236a4c.png deleted file mode 100644 index 5771395beed5a..0000000000000 Binary files a/0.15/_images/math/24e745e0f9174a59c0ff6e8a6867a41ba1236a4c.png and /dev/null differ diff --git a/0.15/_images/math/24ebde4aa6565bb26051379bbc4bc07867b22c0d.png b/0.15/_images/math/24ebde4aa6565bb26051379bbc4bc07867b22c0d.png deleted file mode 100644 index aadc32a871a0d..0000000000000 Binary files a/0.15/_images/math/24ebde4aa6565bb26051379bbc4bc07867b22c0d.png and /dev/null differ diff --git a/0.15/_images/math/252437cd6d39a0f5b9e6dc511c0dc6ce8b4a1617.png b/0.15/_images/math/252437cd6d39a0f5b9e6dc511c0dc6ce8b4a1617.png deleted file mode 100644 index 886815a0f4a93..0000000000000 Binary files a/0.15/_images/math/252437cd6d39a0f5b9e6dc511c0dc6ce8b4a1617.png and /dev/null differ diff --git a/0.15/_images/math/25a9728b809a691ce3374eaeab6255410cbff5d9.png b/0.15/_images/math/25a9728b809a691ce3374eaeab6255410cbff5d9.png deleted file mode 100644 index 0eee5bb924b1c..0000000000000 Binary files a/0.15/_images/math/25a9728b809a691ce3374eaeab6255410cbff5d9.png and /dev/null differ diff --git a/0.15/_images/math/25bd194db6e1178144d20df4f8c42c1d4293c021.png b/0.15/_images/math/25bd194db6e1178144d20df4f8c42c1d4293c021.png deleted file mode 100644 index 739c12f7f8ed9..0000000000000 Binary files a/0.15/_images/math/25bd194db6e1178144d20df4f8c42c1d4293c021.png and /dev/null differ diff --git a/0.15/_images/math/25e9a1b2bfd74e98c96a5fe98da2d5061d12373a.png b/0.15/_images/math/25e9a1b2bfd74e98c96a5fe98da2d5061d12373a.png deleted file mode 100644 index ef5119cd0b37c..0000000000000 Binary files a/0.15/_images/math/25e9a1b2bfd74e98c96a5fe98da2d5061d12373a.png and /dev/null differ diff --git a/0.15/_images/math/25f7a3631bf2348673d2aabe91b97d43f0c96bb7.png b/0.15/_images/math/25f7a3631bf2348673d2aabe91b97d43f0c96bb7.png deleted file mode 100644 index 7e9fd0af8e37f..0000000000000 Binary files a/0.15/_images/math/25f7a3631bf2348673d2aabe91b97d43f0c96bb7.png and /dev/null differ diff --git a/0.15/_images/math/261e8d3b761ecfa15d0e95734bc90afd76b1b29c.png b/0.15/_images/math/261e8d3b761ecfa15d0e95734bc90afd76b1b29c.png deleted file mode 100644 index da86ebe0038d6..0000000000000 Binary files a/0.15/_images/math/261e8d3b761ecfa15d0e95734bc90afd76b1b29c.png and /dev/null differ diff --git a/0.15/_images/math/268201c9ebe3275932cf0c0287de32f65d316a99.png b/0.15/_images/math/268201c9ebe3275932cf0c0287de32f65d316a99.png deleted file mode 100644 index 16f3a6456a5cf..0000000000000 Binary files a/0.15/_images/math/268201c9ebe3275932cf0c0287de32f65d316a99.png and /dev/null differ diff --git a/0.15/_images/math/26bed463602b7b5764b5bdb149c6f77b40c998c3.png b/0.15/_images/math/26bed463602b7b5764b5bdb149c6f77b40c998c3.png deleted file mode 100644 index ea1405bdb548b..0000000000000 Binary files a/0.15/_images/math/26bed463602b7b5764b5bdb149c6f77b40c998c3.png and /dev/null differ diff --git a/0.15/_images/math/26bfd3bc4c5db78139d8897f9cfa5bba511a2f22.png b/0.15/_images/math/26bfd3bc4c5db78139d8897f9cfa5bba511a2f22.png deleted file mode 100644 index 02a2b18d395a7..0000000000000 Binary files a/0.15/_images/math/26bfd3bc4c5db78139d8897f9cfa5bba511a2f22.png and /dev/null differ diff --git a/0.15/_images/math/27e20bf0b2786124f8df6383493b347e6ce8586d.png b/0.15/_images/math/27e20bf0b2786124f8df6383493b347e6ce8586d.png deleted file mode 100644 index a512969436419..0000000000000 Binary files a/0.15/_images/math/27e20bf0b2786124f8df6383493b347e6ce8586d.png and /dev/null differ diff --git a/0.15/_images/math/27fb9b03759b81490d29723a983e444e58902355.png b/0.15/_images/math/27fb9b03759b81490d29723a983e444e58902355.png deleted file mode 100644 index 78f3e855516ab..0000000000000 Binary files a/0.15/_images/math/27fb9b03759b81490d29723a983e444e58902355.png and /dev/null differ diff --git a/0.15/_images/math/28c15c22a81b617c9a6e08e915236fa6ff9d7752.png b/0.15/_images/math/28c15c22a81b617c9a6e08e915236fa6ff9d7752.png deleted file mode 100644 index ed4bf028ad185..0000000000000 Binary files a/0.15/_images/math/28c15c22a81b617c9a6e08e915236fa6ff9d7752.png and /dev/null differ diff --git a/0.15/_images/math/28e003020d0ae96250b302d7d779c791f183f707.png b/0.15/_images/math/28e003020d0ae96250b302d7d779c791f183f707.png deleted file mode 100644 index 1ec5e668ff2e0..0000000000000 Binary files a/0.15/_images/math/28e003020d0ae96250b302d7d779c791f183f707.png and /dev/null differ diff --git a/0.15/_images/math/29e54135d63cd3804df6986c91488360f24008fd.png b/0.15/_images/math/29e54135d63cd3804df6986c91488360f24008fd.png deleted file mode 100644 index ee148a16341d0..0000000000000 Binary files a/0.15/_images/math/29e54135d63cd3804df6986c91488360f24008fd.png and /dev/null differ diff --git a/0.15/_images/math/2a36ca75fbd0817c7a2020f6009239a7829b1aa7.png b/0.15/_images/math/2a36ca75fbd0817c7a2020f6009239a7829b1aa7.png deleted file mode 100644 index b2295e44d3cfb..0000000000000 Binary files a/0.15/_images/math/2a36ca75fbd0817c7a2020f6009239a7829b1aa7.png and /dev/null differ diff --git a/0.15/_images/math/2a723246d7e6a9d664152e543cf908a90e100e9e.png b/0.15/_images/math/2a723246d7e6a9d664152e543cf908a90e100e9e.png deleted file mode 100644 index 9f493d8485b28..0000000000000 Binary files a/0.15/_images/math/2a723246d7e6a9d664152e543cf908a90e100e9e.png and /dev/null differ diff --git a/0.15/_images/math/2bc2d2b207f861ff1c70724ebb8a9cd6831c0d52.png b/0.15/_images/math/2bc2d2b207f861ff1c70724ebb8a9cd6831c0d52.png deleted file mode 100644 index 38353010770fd..0000000000000 Binary files a/0.15/_images/math/2bc2d2b207f861ff1c70724ebb8a9cd6831c0d52.png and /dev/null differ diff --git a/0.15/_images/math/2bcc65482aa8e15cd4c9e9f2542451fb4e971a91.png b/0.15/_images/math/2bcc65482aa8e15cd4c9e9f2542451fb4e971a91.png deleted file mode 100644 index 19123badbea19..0000000000000 Binary files a/0.15/_images/math/2bcc65482aa8e15cd4c9e9f2542451fb4e971a91.png and /dev/null differ diff --git a/0.15/_images/math/2c1db07a28fbde7396015ec811dcaf9d577f6679.png b/0.15/_images/math/2c1db07a28fbde7396015ec811dcaf9d577f6679.png deleted file mode 100644 index fa09e1e60db81..0000000000000 Binary files a/0.15/_images/math/2c1db07a28fbde7396015ec811dcaf9d577f6679.png and /dev/null differ diff --git a/0.15/_images/math/2c5d2ee447e5be49d4e3b1e7d40c49c76329e686.png b/0.15/_images/math/2c5d2ee447e5be49d4e3b1e7d40c49c76329e686.png deleted file mode 100644 index 34dd3df5d4331..0000000000000 Binary files a/0.15/_images/math/2c5d2ee447e5be49d4e3b1e7d40c49c76329e686.png and /dev/null differ diff --git a/0.15/_images/math/2c6729133de75b78dc94a410683071987e7f4c2c.png b/0.15/_images/math/2c6729133de75b78dc94a410683071987e7f4c2c.png deleted file mode 100644 index ef94fe8aa1b2a..0000000000000 Binary files a/0.15/_images/math/2c6729133de75b78dc94a410683071987e7f4c2c.png and /dev/null differ diff --git a/0.15/_images/math/2d68a3b7f2e7b7d869d407df04909c805063cca5.png b/0.15/_images/math/2d68a3b7f2e7b7d869d407df04909c805063cca5.png deleted file mode 100644 index 689974baa6562..0000000000000 Binary files a/0.15/_images/math/2d68a3b7f2e7b7d869d407df04909c805063cca5.png and /dev/null differ diff --git a/0.15/_images/math/2de38926392ba23abeac75effc66c37a5f5be5fd.png b/0.15/_images/math/2de38926392ba23abeac75effc66c37a5f5be5fd.png deleted file mode 100644 index 5271cf2604d68..0000000000000 Binary files a/0.15/_images/math/2de38926392ba23abeac75effc66c37a5f5be5fd.png and /dev/null differ diff --git a/0.15/_images/math/2e17a65c67124dc7054a7bbbf4647d336973d3d2.png b/0.15/_images/math/2e17a65c67124dc7054a7bbbf4647d336973d3d2.png deleted file mode 100644 index afeba8a246781..0000000000000 Binary files a/0.15/_images/math/2e17a65c67124dc7054a7bbbf4647d336973d3d2.png and /dev/null differ diff --git a/0.15/_images/math/2e32af6e1d375a08fe0603bf8c95696943c558b5.png b/0.15/_images/math/2e32af6e1d375a08fe0603bf8c95696943c558b5.png deleted file mode 100644 index 635727baec40c..0000000000000 Binary files a/0.15/_images/math/2e32af6e1d375a08fe0603bf8c95696943c558b5.png and /dev/null differ diff --git a/0.15/_images/math/2e3526606b55cca21af4da96b580df78d6485cb4.png b/0.15/_images/math/2e3526606b55cca21af4da96b580df78d6485cb4.png deleted file mode 100644 index 0d9c1c66f9f03..0000000000000 Binary files a/0.15/_images/math/2e3526606b55cca21af4da96b580df78d6485cb4.png and /dev/null differ diff --git a/0.15/_images/math/2e6c422c84607919c1467f3f18f81ac44daf48f2.png b/0.15/_images/math/2e6c422c84607919c1467f3f18f81ac44daf48f2.png deleted file mode 100644 index 44ba8fcaf315d..0000000000000 Binary files a/0.15/_images/math/2e6c422c84607919c1467f3f18f81ac44daf48f2.png and /dev/null differ diff --git a/0.15/_images/math/2e71c7804cd1c5edb6aa75451a295c86d3488be6.png b/0.15/_images/math/2e71c7804cd1c5edb6aa75451a295c86d3488be6.png deleted file mode 100644 index 740f4ce71579b..0000000000000 Binary files a/0.15/_images/math/2e71c7804cd1c5edb6aa75451a295c86d3488be6.png and /dev/null differ diff --git a/0.15/_images/math/2ede365ad144ab396916ec60458da03860803078.png b/0.15/_images/math/2ede365ad144ab396916ec60458da03860803078.png deleted file mode 100644 index 509daaa8a6079..0000000000000 Binary files a/0.15/_images/math/2ede365ad144ab396916ec60458da03860803078.png and /dev/null differ diff --git a/0.15/_images/math/2ffabef66048a9e67e450c89a8960d3584a342b1.png b/0.15/_images/math/2ffabef66048a9e67e450c89a8960d3584a342b1.png deleted file mode 100644 index 2a6a9a8d16107..0000000000000 Binary files a/0.15/_images/math/2ffabef66048a9e67e450c89a8960d3584a342b1.png and /dev/null differ diff --git a/0.15/_images/math/3008f01be8419b658944e0f72e439ecf100d8579.png b/0.15/_images/math/3008f01be8419b658944e0f72e439ecf100d8579.png deleted file mode 100644 index 0925246c9b8a3..0000000000000 Binary files a/0.15/_images/math/3008f01be8419b658944e0f72e439ecf100d8579.png and /dev/null differ diff --git a/0.15/_images/math/30d44ed6819278c2c798e35370b8aef1dac18924.png b/0.15/_images/math/30d44ed6819278c2c798e35370b8aef1dac18924.png deleted file mode 100644 index f543f39ffbba3..0000000000000 Binary files a/0.15/_images/math/30d44ed6819278c2c798e35370b8aef1dac18924.png and /dev/null differ diff --git a/0.15/_images/math/312a337f683f70a24fb8960a14d0aba32f4f8c0c.png b/0.15/_images/math/312a337f683f70a24fb8960a14d0aba32f4f8c0c.png deleted file mode 100644 index 91f6c156f5a33..0000000000000 Binary files a/0.15/_images/math/312a337f683f70a24fb8960a14d0aba32f4f8c0c.png and /dev/null differ diff --git a/0.15/_images/math/31b21de5d34d5d0f5e91de10aabe8c0df2d19e08.png b/0.15/_images/math/31b21de5d34d5d0f5e91de10aabe8c0df2d19e08.png deleted file mode 100644 index d06162b3c7215..0000000000000 Binary files a/0.15/_images/math/31b21de5d34d5d0f5e91de10aabe8c0df2d19e08.png and /dev/null differ diff --git a/0.15/_images/math/32028e85feb455d07503a027ba607eafc7909976.png b/0.15/_images/math/32028e85feb455d07503a027ba607eafc7909976.png deleted file mode 100644 index 7c95492740f5b..0000000000000 Binary files a/0.15/_images/math/32028e85feb455d07503a027ba607eafc7909976.png and /dev/null differ diff --git a/0.15/_images/math/3263c84783e5f5605c1c8a4a4b44320926c3d5a7.png b/0.15/_images/math/3263c84783e5f5605c1c8a4a4b44320926c3d5a7.png deleted file mode 100644 index b0150b088991d..0000000000000 Binary files a/0.15/_images/math/3263c84783e5f5605c1c8a4a4b44320926c3d5a7.png and /dev/null differ diff --git a/0.15/_images/math/333132d227ff65accd034f936b7d5a43ea7493ee.png b/0.15/_images/math/333132d227ff65accd034f936b7d5a43ea7493ee.png deleted file mode 100644 index fb16f74af8a6e..0000000000000 Binary files a/0.15/_images/math/333132d227ff65accd034f936b7d5a43ea7493ee.png and /dev/null differ diff --git a/0.15/_images/math/335d78c4b0c7514827beaf3d89b7132513a62cf8.png b/0.15/_images/math/335d78c4b0c7514827beaf3d89b7132513a62cf8.png deleted file mode 100644 index 13ad1162b429c..0000000000000 Binary files a/0.15/_images/math/335d78c4b0c7514827beaf3d89b7132513a62cf8.png and /dev/null differ diff --git a/0.15/_images/math/336a7c6814c94b6448f4bb5648e70a69432ce4df.png b/0.15/_images/math/336a7c6814c94b6448f4bb5648e70a69432ce4df.png deleted file mode 100644 index 09c08a64ece92..0000000000000 Binary files a/0.15/_images/math/336a7c6814c94b6448f4bb5648e70a69432ce4df.png and /dev/null differ diff --git a/0.15/_images/math/338694bf0978bd05178b8a7e238c866a14f3516f.png b/0.15/_images/math/338694bf0978bd05178b8a7e238c866a14f3516f.png deleted file mode 100644 index 4b3bdd48866a4..0000000000000 Binary files a/0.15/_images/math/338694bf0978bd05178b8a7e238c866a14f3516f.png and /dev/null differ diff --git a/0.15/_images/math/33dfc32d00ebd5c5791c824010a155d9e5630b6f.png b/0.15/_images/math/33dfc32d00ebd5c5791c824010a155d9e5630b6f.png deleted file mode 100644 index ea5ec276708a3..0000000000000 Binary files a/0.15/_images/math/33dfc32d00ebd5c5791c824010a155d9e5630b6f.png and /dev/null differ diff --git a/0.15/_images/math/341739768b517fe3ccf083d4b4d6938c5cd7835d.png b/0.15/_images/math/341739768b517fe3ccf083d4b4d6938c5cd7835d.png deleted file mode 100644 index 8193f58f90227..0000000000000 Binary files a/0.15/_images/math/341739768b517fe3ccf083d4b4d6938c5cd7835d.png and /dev/null differ diff --git a/0.15/_images/math/3494d6c050dcba63488def5cd4e3c183f1234306.png b/0.15/_images/math/3494d6c050dcba63488def5cd4e3c183f1234306.png deleted file mode 100644 index 783471a998220..0000000000000 Binary files a/0.15/_images/math/3494d6c050dcba63488def5cd4e3c183f1234306.png and /dev/null differ diff --git a/0.15/_images/math/34adf865a29381a6d492d1d69c2f7e1e4a01c8fa.png b/0.15/_images/math/34adf865a29381a6d492d1d69c2f7e1e4a01c8fa.png deleted file mode 100644 index 90e502d45f065..0000000000000 Binary files a/0.15/_images/math/34adf865a29381a6d492d1d69c2f7e1e4a01c8fa.png and /dev/null differ diff --git a/0.15/_images/math/34ea3b8fe46ef695984759103d7bcdecd553f321.png b/0.15/_images/math/34ea3b8fe46ef695984759103d7bcdecd553f321.png deleted file mode 100644 index ed25b0d765599..0000000000000 Binary files a/0.15/_images/math/34ea3b8fe46ef695984759103d7bcdecd553f321.png and /dev/null differ diff --git a/0.15/_images/math/3503a91884e7197e2a20381cb4722230bcc188b2.png b/0.15/_images/math/3503a91884e7197e2a20381cb4722230bcc188b2.png deleted file mode 100644 index 5bd2b94e6b24d..0000000000000 Binary files a/0.15/_images/math/3503a91884e7197e2a20381cb4722230bcc188b2.png and /dev/null differ diff --git a/0.15/_images/math/35169538be4ee2d0427ecfbc80400da2647df66b.png b/0.15/_images/math/35169538be4ee2d0427ecfbc80400da2647df66b.png deleted file mode 100644 index f0a494a508b1c..0000000000000 Binary files a/0.15/_images/math/35169538be4ee2d0427ecfbc80400da2647df66b.png and /dev/null differ diff --git a/0.15/_images/math/35aa292c643aceacdb42eb4eff352a2f5c58a710.png b/0.15/_images/math/35aa292c643aceacdb42eb4eff352a2f5c58a710.png deleted file mode 100644 index ea6f36ba73bd0..0000000000000 Binary files a/0.15/_images/math/35aa292c643aceacdb42eb4eff352a2f5c58a710.png and /dev/null differ diff --git a/0.15/_images/math/36ac45ff45741e9cb7933cec0ddf9731775f2d6e.png b/0.15/_images/math/36ac45ff45741e9cb7933cec0ddf9731775f2d6e.png deleted file mode 100644 index c42763aba219e..0000000000000 Binary files a/0.15/_images/math/36ac45ff45741e9cb7933cec0ddf9731775f2d6e.png and /dev/null differ diff --git a/0.15/_images/math/37902c51e25e9d0c4c2e966e50b252f82cfa60e1.png b/0.15/_images/math/37902c51e25e9d0c4c2e966e50b252f82cfa60e1.png deleted file mode 100644 index ca63b7204f329..0000000000000 Binary files a/0.15/_images/math/37902c51e25e9d0c4c2e966e50b252f82cfa60e1.png and /dev/null differ diff --git a/0.15/_images/math/37bd21d9bdc90aae55a42612868b7627e34e473a.png b/0.15/_images/math/37bd21d9bdc90aae55a42612868b7627e34e473a.png deleted file mode 100644 index 00e97c96debef..0000000000000 Binary files a/0.15/_images/math/37bd21d9bdc90aae55a42612868b7627e34e473a.png and /dev/null differ diff --git a/0.15/_images/math/37f1b269585e35f9d313e5218393fd9196cfc081.png b/0.15/_images/math/37f1b269585e35f9d313e5218393fd9196cfc081.png deleted file mode 100644 index b0dafaf66172e..0000000000000 Binary files a/0.15/_images/math/37f1b269585e35f9d313e5218393fd9196cfc081.png and /dev/null differ diff --git a/0.15/_images/math/38a3baf892674090e4285efd71f2305846d3d8eb.png b/0.15/_images/math/38a3baf892674090e4285efd71f2305846d3d8eb.png deleted file mode 100644 index b257c3be6f9e8..0000000000000 Binary files a/0.15/_images/math/38a3baf892674090e4285efd71f2305846d3d8eb.png and /dev/null differ diff --git a/0.15/_images/math/3908ba50237c94909083edd0295cd1c9345b0a8c.png b/0.15/_images/math/3908ba50237c94909083edd0295cd1c9345b0a8c.png deleted file mode 100644 index a2564045e1481..0000000000000 Binary files a/0.15/_images/math/3908ba50237c94909083edd0295cd1c9345b0a8c.png and /dev/null differ diff --git a/0.15/_images/math/396704acdf11cc18d2d02b32275c0ee42d76b95e.png b/0.15/_images/math/396704acdf11cc18d2d02b32275c0ee42d76b95e.png deleted file mode 100644 index dd5b658891b0a..0000000000000 Binary files a/0.15/_images/math/396704acdf11cc18d2d02b32275c0ee42d76b95e.png and /dev/null differ diff --git a/0.15/_images/math/3985035067a2795cdb42d096753adef8367c81db.png b/0.15/_images/math/3985035067a2795cdb42d096753adef8367c81db.png deleted file mode 100644 index eef122db9b66b..0000000000000 Binary files a/0.15/_images/math/3985035067a2795cdb42d096753adef8367c81db.png and /dev/null differ diff --git a/0.15/_images/math/3986f9b8ba3bd56d09ce9ff731826e829e72d8ea.png b/0.15/_images/math/3986f9b8ba3bd56d09ce9ff731826e829e72d8ea.png deleted file mode 100644 index 8e0810153f478..0000000000000 Binary files a/0.15/_images/math/3986f9b8ba3bd56d09ce9ff731826e829e72d8ea.png and /dev/null differ diff --git a/0.15/_images/math/39d979d28ea13da6cd6fe64c3a8ee5005e5cabce.png b/0.15/_images/math/39d979d28ea13da6cd6fe64c3a8ee5005e5cabce.png deleted file mode 100644 index 007e7d1b5cc69..0000000000000 Binary files a/0.15/_images/math/39d979d28ea13da6cd6fe64c3a8ee5005e5cabce.png and /dev/null differ diff --git a/0.15/_images/math/3a493378cbeee98bb66506e788ef065d9efb3e9f.png b/0.15/_images/math/3a493378cbeee98bb66506e788ef065d9efb3e9f.png deleted file mode 100644 index 56502fb03b599..0000000000000 Binary files a/0.15/_images/math/3a493378cbeee98bb66506e788ef065d9efb3e9f.png and /dev/null differ diff --git a/0.15/_images/math/3a5c29c227c4edf0fb9e66e1f3515649e95bc6c9.png b/0.15/_images/math/3a5c29c227c4edf0fb9e66e1f3515649e95bc6c9.png deleted file mode 100644 index bd27f9bdbf0c1..0000000000000 Binary files a/0.15/_images/math/3a5c29c227c4edf0fb9e66e1f3515649e95bc6c9.png and /dev/null differ diff --git a/0.15/_images/math/3b765ea6939f1eba2541e91f870cb3c078aa29be.png b/0.15/_images/math/3b765ea6939f1eba2541e91f870cb3c078aa29be.png deleted file mode 100644 index da8a690fc1d0d..0000000000000 Binary files a/0.15/_images/math/3b765ea6939f1eba2541e91f870cb3c078aa29be.png and /dev/null differ diff --git a/0.15/_images/math/3bd8e83af63059e1332f577c656fdff3e8158e74.png b/0.15/_images/math/3bd8e83af63059e1332f577c656fdff3e8158e74.png deleted file mode 100644 index 72f2b8e52f5f5..0000000000000 Binary files a/0.15/_images/math/3bd8e83af63059e1332f577c656fdff3e8158e74.png and /dev/null differ diff --git a/0.15/_images/math/3bf8e7b868ef3130ec9da58118014d89b059fd79.png b/0.15/_images/math/3bf8e7b868ef3130ec9da58118014d89b059fd79.png deleted file mode 100644 index 9c2d5b01788df..0000000000000 Binary files a/0.15/_images/math/3bf8e7b868ef3130ec9da58118014d89b059fd79.png and /dev/null differ diff --git a/0.15/_images/math/3c1bc04a0c8dc5a927a0ee5a8ac22c87f3a9dd06.png b/0.15/_images/math/3c1bc04a0c8dc5a927a0ee5a8ac22c87f3a9dd06.png deleted file mode 100644 index a53d3b8f28ee3..0000000000000 Binary files a/0.15/_images/math/3c1bc04a0c8dc5a927a0ee5a8ac22c87f3a9dd06.png and /dev/null differ diff --git a/0.15/_images/math/3c8b8b6a9aef0e43ed0a2c0772a5db285ba66de6.png b/0.15/_images/math/3c8b8b6a9aef0e43ed0a2c0772a5db285ba66de6.png deleted file mode 100644 index 80485fb509b6b..0000000000000 Binary files a/0.15/_images/math/3c8b8b6a9aef0e43ed0a2c0772a5db285ba66de6.png and /dev/null differ diff --git a/0.15/_images/math/3d0458c0468168486719c7cb3ce00ec1e847b089.png b/0.15/_images/math/3d0458c0468168486719c7cb3ce00ec1e847b089.png deleted file mode 100644 index c26e7ee08527b..0000000000000 Binary files a/0.15/_images/math/3d0458c0468168486719c7cb3ce00ec1e847b089.png and /dev/null differ diff --git a/0.15/_images/math/3d1267ec4c47329a50e586bb0a7cd5fb528a117f.png b/0.15/_images/math/3d1267ec4c47329a50e586bb0a7cd5fb528a117f.png deleted file mode 100644 index ba2ac23641047..0000000000000 Binary files a/0.15/_images/math/3d1267ec4c47329a50e586bb0a7cd5fb528a117f.png and /dev/null differ diff --git a/0.15/_images/math/3d9a1fde3ad183d72319e293ff637c7528c831a4.png b/0.15/_images/math/3d9a1fde3ad183d72319e293ff637c7528c831a4.png deleted file mode 100644 index da8a690fc1d0d..0000000000000 Binary files a/0.15/_images/math/3d9a1fde3ad183d72319e293ff637c7528c831a4.png and /dev/null differ diff --git a/0.15/_images/math/3e3f740715e6747efdfcf9b48b1f924d3e96593c.png b/0.15/_images/math/3e3f740715e6747efdfcf9b48b1f924d3e96593c.png deleted file mode 100644 index 85f4e68486414..0000000000000 Binary files a/0.15/_images/math/3e3f740715e6747efdfcf9b48b1f924d3e96593c.png and /dev/null differ diff --git a/0.15/_images/math/3eca8557203e86160952e1c0f735f7417f3285b1.png b/0.15/_images/math/3eca8557203e86160952e1c0f735f7417f3285b1.png deleted file mode 100644 index 9033f8ddb8fb0..0000000000000 Binary files a/0.15/_images/math/3eca8557203e86160952e1c0f735f7417f3285b1.png and /dev/null differ diff --git a/0.15/_images/math/3f282377e8ce2cfa70775ae54fbdb5981ec7b3cb.png b/0.15/_images/math/3f282377e8ce2cfa70775ae54fbdb5981ec7b3cb.png deleted file mode 100644 index 72643d170a74b..0000000000000 Binary files a/0.15/_images/math/3f282377e8ce2cfa70775ae54fbdb5981ec7b3cb.png and /dev/null differ diff --git a/0.15/_images/math/3fb9bab302e67df4a9f00b8df259d326e01837fd.png b/0.15/_images/math/3fb9bab302e67df4a9f00b8df259d326e01837fd.png deleted file mode 100644 index 406843f3c043f..0000000000000 Binary files a/0.15/_images/math/3fb9bab302e67df4a9f00b8df259d326e01837fd.png and /dev/null differ diff --git a/0.15/_images/math/3fc06d54f9cb1a3e988483f5bbaa2a7f3d0ccbdd.png b/0.15/_images/math/3fc06d54f9cb1a3e988483f5bbaa2a7f3d0ccbdd.png deleted file mode 100644 index eecb93c9b7dcb..0000000000000 Binary files a/0.15/_images/math/3fc06d54f9cb1a3e988483f5bbaa2a7f3d0ccbdd.png and /dev/null differ diff --git a/0.15/_images/math/3fcabd4a94b24f0fb2bd4b2bb79703cf8f5eb496.png b/0.15/_images/math/3fcabd4a94b24f0fb2bd4b2bb79703cf8f5eb496.png deleted file mode 100644 index c9971f28133aa..0000000000000 Binary files a/0.15/_images/math/3fcabd4a94b24f0fb2bd4b2bb79703cf8f5eb496.png and /dev/null differ diff --git a/0.15/_images/math/40ac35228adf99f7d4dd3647418e4701f2fb1d35.png b/0.15/_images/math/40ac35228adf99f7d4dd3647418e4701f2fb1d35.png deleted file mode 100644 index 43375dd7beb17..0000000000000 Binary files a/0.15/_images/math/40ac35228adf99f7d4dd3647418e4701f2fb1d35.png and /dev/null differ diff --git a/0.15/_images/math/40bf6097b9474ed1adaf38a69cd06ec8f8446851.png b/0.15/_images/math/40bf6097b9474ed1adaf38a69cd06ec8f8446851.png deleted file mode 100644 index 2de138e00143d..0000000000000 Binary files a/0.15/_images/math/40bf6097b9474ed1adaf38a69cd06ec8f8446851.png and /dev/null differ diff --git a/0.15/_images/math/40cdb0e5fc0c7cf6e3d3248c29f7de379c0f6abb.png b/0.15/_images/math/40cdb0e5fc0c7cf6e3d3248c29f7de379c0f6abb.png deleted file mode 100644 index 321d9f35dbb0f..0000000000000 Binary files a/0.15/_images/math/40cdb0e5fc0c7cf6e3d3248c29f7de379c0f6abb.png and /dev/null differ diff --git a/0.15/_images/math/410a65f64e2a609a2a7f544ed72f0982b719807a.png b/0.15/_images/math/410a65f64e2a609a2a7f544ed72f0982b719807a.png deleted file mode 100644 index baf2adf728562..0000000000000 Binary files a/0.15/_images/math/410a65f64e2a609a2a7f544ed72f0982b719807a.png and /dev/null differ diff --git a/0.15/_images/math/413f8a8e40062a9090d9d50b88bc7b551b314c26.png b/0.15/_images/math/413f8a8e40062a9090d9d50b88bc7b551b314c26.png deleted file mode 100644 index e34cec6abf2d1..0000000000000 Binary files a/0.15/_images/math/413f8a8e40062a9090d9d50b88bc7b551b314c26.png and /dev/null differ diff --git a/0.15/_images/math/41ea538a80e357a6b0441bd48951f24f14cf95dc.png b/0.15/_images/math/41ea538a80e357a6b0441bd48951f24f14cf95dc.png deleted file mode 100644 index 5236187e93eec..0000000000000 Binary files a/0.15/_images/math/41ea538a80e357a6b0441bd48951f24f14cf95dc.png and /dev/null differ diff --git a/0.15/_images/math/425d86ba2f2979d75b7535c2bcf92c33ed6b285a.png b/0.15/_images/math/425d86ba2f2979d75b7535c2bcf92c33ed6b285a.png deleted file mode 100644 index c98dcc10b12ae..0000000000000 Binary files a/0.15/_images/math/425d86ba2f2979d75b7535c2bcf92c33ed6b285a.png and /dev/null differ diff --git a/0.15/_images/math/42c35ac00e7da22baf37c275ae06ddb68378e57b.png b/0.15/_images/math/42c35ac00e7da22baf37c275ae06ddb68378e57b.png deleted file mode 100644 index 952ba19181ecc..0000000000000 Binary files a/0.15/_images/math/42c35ac00e7da22baf37c275ae06ddb68378e57b.png and /dev/null differ diff --git a/0.15/_images/math/42e4f1acceccb3e96c3dfd90baa3af862d076de1.png b/0.15/_images/math/42e4f1acceccb3e96c3dfd90baa3af862d076de1.png deleted file mode 100644 index e732e2f30b5c4..0000000000000 Binary files a/0.15/_images/math/42e4f1acceccb3e96c3dfd90baa3af862d076de1.png and /dev/null differ diff --git a/0.15/_images/math/42f3e1b073ed67007f6df2143280dba7738fdd69.png b/0.15/_images/math/42f3e1b073ed67007f6df2143280dba7738fdd69.png deleted file mode 100644 index 0fbd785409b86..0000000000000 Binary files a/0.15/_images/math/42f3e1b073ed67007f6df2143280dba7738fdd69.png and /dev/null differ diff --git a/0.15/_images/math/430e80b89227bed7145710b8999c77815de5ee99.png b/0.15/_images/math/430e80b89227bed7145710b8999c77815de5ee99.png deleted file mode 100644 index 8ecfc4e973d83..0000000000000 Binary files a/0.15/_images/math/430e80b89227bed7145710b8999c77815de5ee99.png and /dev/null differ diff --git a/0.15/_images/math/435990955e5bf931b5a6c2904ac75afaf4f20930.png b/0.15/_images/math/435990955e5bf931b5a6c2904ac75afaf4f20930.png deleted file mode 100644 index 57947659776e5..0000000000000 Binary files a/0.15/_images/math/435990955e5bf931b5a6c2904ac75afaf4f20930.png and /dev/null differ diff --git a/0.15/_images/math/43632e5e903214a015edb525608b1996530563d9.png b/0.15/_images/math/43632e5e903214a015edb525608b1996530563d9.png deleted file mode 100644 index a5bec94973498..0000000000000 Binary files a/0.15/_images/math/43632e5e903214a015edb525608b1996530563d9.png and /dev/null differ diff --git a/0.15/_images/math/43ef15fd04fdcd3de26ecae069395a733b1d22be.png b/0.15/_images/math/43ef15fd04fdcd3de26ecae069395a733b1d22be.png deleted file mode 100644 index c00bd0b5bcfa8..0000000000000 Binary files a/0.15/_images/math/43ef15fd04fdcd3de26ecae069395a733b1d22be.png and /dev/null differ diff --git a/0.15/_images/math/45296bf2159ba43c7e918fcf344b65490ff38b17.png b/0.15/_images/math/45296bf2159ba43c7e918fcf344b65490ff38b17.png deleted file mode 100644 index 1c6b2032e8c41..0000000000000 Binary files a/0.15/_images/math/45296bf2159ba43c7e918fcf344b65490ff38b17.png and /dev/null differ diff --git a/0.15/_images/math/4538c7d3ad3bb7fb14e3db8250fd9e4cce31d23d.png b/0.15/_images/math/4538c7d3ad3bb7fb14e3db8250fd9e4cce31d23d.png deleted file mode 100644 index 30b3f6f150cc0..0000000000000 Binary files a/0.15/_images/math/4538c7d3ad3bb7fb14e3db8250fd9e4cce31d23d.png and /dev/null differ diff --git a/0.15/_images/math/45566259f5632df57a1a4e87893103d00a4b5608.png b/0.15/_images/math/45566259f5632df57a1a4e87893103d00a4b5608.png deleted file mode 100644 index 7ae433b25f6f2..0000000000000 Binary files a/0.15/_images/math/45566259f5632df57a1a4e87893103d00a4b5608.png and /dev/null differ diff --git a/0.15/_images/math/45bc8d8261a9d85f886a998420ac78d02c660aa4.png b/0.15/_images/math/45bc8d8261a9d85f886a998420ac78d02c660aa4.png deleted file mode 100644 index 4c866a3ad7e74..0000000000000 Binary files a/0.15/_images/math/45bc8d8261a9d85f886a998420ac78d02c660aa4.png and /dev/null differ diff --git a/0.15/_images/math/46d692d4d1ab8fca2f61c846b920ab064e588a86.png b/0.15/_images/math/46d692d4d1ab8fca2f61c846b920ab064e588a86.png deleted file mode 100644 index 39726d9256d1d..0000000000000 Binary files a/0.15/_images/math/46d692d4d1ab8fca2f61c846b920ab064e588a86.png and /dev/null differ diff --git a/0.15/_images/math/47430226015a6b7a0653abed8c7d5d5e9f529404.png b/0.15/_images/math/47430226015a6b7a0653abed8c7d5d5e9f529404.png deleted file mode 100644 index f8f3315fbede4..0000000000000 Binary files a/0.15/_images/math/47430226015a6b7a0653abed8c7d5d5e9f529404.png and /dev/null differ diff --git a/0.15/_images/math/4782697c94f74995ee99624f00633bba53f5245f.png b/0.15/_images/math/4782697c94f74995ee99624f00633bba53f5245f.png deleted file mode 100644 index a4761f1ff9b13..0000000000000 Binary files a/0.15/_images/math/4782697c94f74995ee99624f00633bba53f5245f.png and /dev/null differ diff --git a/0.15/_images/math/47ed3b4a33cd152093bab738cf2002fa69c54c21.png b/0.15/_images/math/47ed3b4a33cd152093bab738cf2002fa69c54c21.png deleted file mode 100644 index 876b580ca19cb..0000000000000 Binary files a/0.15/_images/math/47ed3b4a33cd152093bab738cf2002fa69c54c21.png and /dev/null differ diff --git a/0.15/_images/math/482659e43723f207c6852fcf9ec728833d1a059c.png b/0.15/_images/math/482659e43723f207c6852fcf9ec728833d1a059c.png deleted file mode 100644 index ff5b6e9ef6f0a..0000000000000 Binary files a/0.15/_images/math/482659e43723f207c6852fcf9ec728833d1a059c.png and /dev/null differ diff --git a/0.15/_images/math/48b80c2fee19e41a529e3220199a5562ea29e35d.png b/0.15/_images/math/48b80c2fee19e41a529e3220199a5562ea29e35d.png deleted file mode 100644 index 6380f7803ca2f..0000000000000 Binary files a/0.15/_images/math/48b80c2fee19e41a529e3220199a5562ea29e35d.png and /dev/null differ diff --git a/0.15/_images/math/48f75e0b463f2fdb7fca9566cffdc439cae6967f.png b/0.15/_images/math/48f75e0b463f2fdb7fca9566cffdc439cae6967f.png deleted file mode 100644 index b192e54fc8a96..0000000000000 Binary files a/0.15/_images/math/48f75e0b463f2fdb7fca9566cffdc439cae6967f.png and /dev/null differ diff --git a/0.15/_images/math/49ab0ef6841fb842550e844d69ee90d528252557.png b/0.15/_images/math/49ab0ef6841fb842550e844d69ee90d528252557.png deleted file mode 100644 index 2a8f007676c15..0000000000000 Binary files a/0.15/_images/math/49ab0ef6841fb842550e844d69ee90d528252557.png and /dev/null differ diff --git a/0.15/_images/math/4ae960fb7de7cf651ceddc646dee4f5dcae8f897.png b/0.15/_images/math/4ae960fb7de7cf651ceddc646dee4f5dcae8f897.png deleted file mode 100644 index b9715dea53673..0000000000000 Binary files a/0.15/_images/math/4ae960fb7de7cf651ceddc646dee4f5dcae8f897.png and /dev/null differ diff --git a/0.15/_images/math/4af6492b1bf93d4be0e1f0c75f85f65170ed94c0.png b/0.15/_images/math/4af6492b1bf93d4be0e1f0c75f85f65170ed94c0.png deleted file mode 100644 index ceddb44735c41..0000000000000 Binary files a/0.15/_images/math/4af6492b1bf93d4be0e1f0c75f85f65170ed94c0.png and /dev/null differ diff --git a/0.15/_images/math/4b09797b90bcd5a2e9c4778f03073d8d9fc8ffeb.png b/0.15/_images/math/4b09797b90bcd5a2e9c4778f03073d8d9fc8ffeb.png deleted file mode 100644 index 6c769d1669d00..0000000000000 Binary files a/0.15/_images/math/4b09797b90bcd5a2e9c4778f03073d8d9fc8ffeb.png and /dev/null differ diff --git a/0.15/_images/math/4b15c4aa8feb74b435e9b7bca3afad099d18636e.png b/0.15/_images/math/4b15c4aa8feb74b435e9b7bca3afad099d18636e.png deleted file mode 100644 index 3e2bfcb9615de..0000000000000 Binary files a/0.15/_images/math/4b15c4aa8feb74b435e9b7bca3afad099d18636e.png and /dev/null differ diff --git a/0.15/_images/math/4b6fc14718fd93134fd32b08a74c8eb41f56f14b.png b/0.15/_images/math/4b6fc14718fd93134fd32b08a74c8eb41f56f14b.png deleted file mode 100644 index 83267f85e1839..0000000000000 Binary files a/0.15/_images/math/4b6fc14718fd93134fd32b08a74c8eb41f56f14b.png and /dev/null differ diff --git a/0.15/_images/math/4b7674a6a09bdceb3ea9bf44671b2c4aa6f8d262.png b/0.15/_images/math/4b7674a6a09bdceb3ea9bf44671b2c4aa6f8d262.png deleted file mode 100644 index 1685784b9689a..0000000000000 Binary files a/0.15/_images/math/4b7674a6a09bdceb3ea9bf44671b2c4aa6f8d262.png and /dev/null differ diff --git a/0.15/_images/math/4b88f1d1d8196c7bbe4ae71a937f701fee59589f.png b/0.15/_images/math/4b88f1d1d8196c7bbe4ae71a937f701fee59589f.png deleted file mode 100644 index 941e3e13907ec..0000000000000 Binary files a/0.15/_images/math/4b88f1d1d8196c7bbe4ae71a937f701fee59589f.png and /dev/null differ diff --git a/0.15/_images/math/4c7d890f85ded3bba351ce3718e3438d434638fa.png b/0.15/_images/math/4c7d890f85ded3bba351ce3718e3438d434638fa.png deleted file mode 100644 index 17d4894222110..0000000000000 Binary files a/0.15/_images/math/4c7d890f85ded3bba351ce3718e3438d434638fa.png and /dev/null differ diff --git a/0.15/_images/math/4edbd88750539c2610a7bbfcf79c33cf1ae7a36c.png b/0.15/_images/math/4edbd88750539c2610a7bbfcf79c33cf1ae7a36c.png deleted file mode 100644 index a904c57e2abea..0000000000000 Binary files a/0.15/_images/math/4edbd88750539c2610a7bbfcf79c33cf1ae7a36c.png and /dev/null differ diff --git a/0.15/_images/math/4eee6c92bbd410eec3cfc2e298c3044fbcc2d868.png b/0.15/_images/math/4eee6c92bbd410eec3cfc2e298c3044fbcc2d868.png deleted file mode 100644 index 2bda4359ae89f..0000000000000 Binary files a/0.15/_images/math/4eee6c92bbd410eec3cfc2e298c3044fbcc2d868.png and /dev/null differ diff --git a/0.15/_images/math/4efbaa7d03c4c3442a56ab89b38f426775b92b79.png b/0.15/_images/math/4efbaa7d03c4c3442a56ab89b38f426775b92b79.png deleted file mode 100644 index 1bfab253e558a..0000000000000 Binary files a/0.15/_images/math/4efbaa7d03c4c3442a56ab89b38f426775b92b79.png and /dev/null differ diff --git a/0.15/_images/math/4f53fbf22e40f593a72f3f7788bccc7f17b1136c.png b/0.15/_images/math/4f53fbf22e40f593a72f3f7788bccc7f17b1136c.png deleted file mode 100644 index cb991f87b9580..0000000000000 Binary files a/0.15/_images/math/4f53fbf22e40f593a72f3f7788bccc7f17b1136c.png and /dev/null differ diff --git a/0.15/_images/math/5006ffbc5dcfb197dae87d662a077f941e570203.png b/0.15/_images/math/5006ffbc5dcfb197dae87d662a077f941e570203.png deleted file mode 100644 index 31cde8a524dfe..0000000000000 Binary files a/0.15/_images/math/5006ffbc5dcfb197dae87d662a077f941e570203.png and /dev/null differ diff --git a/0.15/_images/math/500b1d06c41424d2ee227d6e7d133acca6a70fdc.png b/0.15/_images/math/500b1d06c41424d2ee227d6e7d133acca6a70fdc.png deleted file mode 100644 index 463c5ebd593e4..0000000000000 Binary files a/0.15/_images/math/500b1d06c41424d2ee227d6e7d133acca6a70fdc.png and /dev/null differ diff --git a/0.15/_images/math/50a77f9d6082a282e8419ed374b220f61c6e8712.png b/0.15/_images/math/50a77f9d6082a282e8419ed374b220f61c6e8712.png deleted file mode 100644 index 9dd96b91d92ec..0000000000000 Binary files a/0.15/_images/math/50a77f9d6082a282e8419ed374b220f61c6e8712.png and /dev/null differ diff --git a/0.15/_images/math/51b9aeb9655b757d685a814093e49924caee8e33.png b/0.15/_images/math/51b9aeb9655b757d685a814093e49924caee8e33.png deleted file mode 100644 index 39da06c0e9963..0000000000000 Binary files a/0.15/_images/math/51b9aeb9655b757d685a814093e49924caee8e33.png and /dev/null differ diff --git a/0.15/_images/math/51c3f634737f3900a622e86675e34390c43102a7.png b/0.15/_images/math/51c3f634737f3900a622e86675e34390c43102a7.png deleted file mode 100644 index 2e97414f9ddf9..0000000000000 Binary files a/0.15/_images/math/51c3f634737f3900a622e86675e34390c43102a7.png and /dev/null differ diff --git a/0.15/_images/math/52015b92f53f3a882ed0678cf03a59422703f6ac.png b/0.15/_images/math/52015b92f53f3a882ed0678cf03a59422703f6ac.png deleted file mode 100644 index 49b7dd18c29e3..0000000000000 Binary files a/0.15/_images/math/52015b92f53f3a882ed0678cf03a59422703f6ac.png and /dev/null differ diff --git a/0.15/_images/math/5213b21bf8b813f616076d232e710fe56e137abe.png b/0.15/_images/math/5213b21bf8b813f616076d232e710fe56e137abe.png deleted file mode 100644 index 69943508c7852..0000000000000 Binary files a/0.15/_images/math/5213b21bf8b813f616076d232e710fe56e137abe.png and /dev/null differ diff --git a/0.15/_images/math/5243a04d6927973d5106a8a447a279b6e7bc8c4e.png b/0.15/_images/math/5243a04d6927973d5106a8a447a279b6e7bc8c4e.png deleted file mode 100644 index af8b449682b29..0000000000000 Binary files a/0.15/_images/math/5243a04d6927973d5106a8a447a279b6e7bc8c4e.png and /dev/null differ diff --git a/0.15/_images/math/53b01f9fa2117421f78360d9411c0944e9dc643b.png b/0.15/_images/math/53b01f9fa2117421f78360d9411c0944e9dc643b.png deleted file mode 100644 index 2921d2adaf520..0000000000000 Binary files a/0.15/_images/math/53b01f9fa2117421f78360d9411c0944e9dc643b.png and /dev/null differ diff --git a/0.15/_images/math/53be6b6975d2852e3f88ae15c7d0140ed7f19a51.png b/0.15/_images/math/53be6b6975d2852e3f88ae15c7d0140ed7f19a51.png deleted file mode 100644 index 2722b5837a83c..0000000000000 Binary files a/0.15/_images/math/53be6b6975d2852e3f88ae15c7d0140ed7f19a51.png and /dev/null differ diff --git a/0.15/_images/math/53ebe25152a7cee2742919c6996cef9c6003a412.png b/0.15/_images/math/53ebe25152a7cee2742919c6996cef9c6003a412.png deleted file mode 100644 index 881d51bd4c9e0..0000000000000 Binary files a/0.15/_images/math/53ebe25152a7cee2742919c6996cef9c6003a412.png and /dev/null differ diff --git a/0.15/_images/math/53f2b29c5e244e289c3f2f1419cad5f5b59b7a1c.png b/0.15/_images/math/53f2b29c5e244e289c3f2f1419cad5f5b59b7a1c.png deleted file mode 100644 index 103cfbfcb7765..0000000000000 Binary files a/0.15/_images/math/53f2b29c5e244e289c3f2f1419cad5f5b59b7a1c.png and /dev/null differ diff --git a/0.15/_images/math/5456e49de4bec0eee990f7c9b98afcd14f68aad1.png b/0.15/_images/math/5456e49de4bec0eee990f7c9b98afcd14f68aad1.png deleted file mode 100644 index f51760b870d86..0000000000000 Binary files a/0.15/_images/math/5456e49de4bec0eee990f7c9b98afcd14f68aad1.png and /dev/null differ diff --git a/0.15/_images/math/5501d404995066141389603affa5de0656754bcb.png b/0.15/_images/math/5501d404995066141389603affa5de0656754bcb.png deleted file mode 100644 index fe5f62241ba7d..0000000000000 Binary files a/0.15/_images/math/5501d404995066141389603affa5de0656754bcb.png and /dev/null differ diff --git a/0.15/_images/math/552aaf9d5e8d55bbfb58a9cb38448b0e47b15ece.png b/0.15/_images/math/552aaf9d5e8d55bbfb58a9cb38448b0e47b15ece.png deleted file mode 100644 index 7474029831100..0000000000000 Binary files a/0.15/_images/math/552aaf9d5e8d55bbfb58a9cb38448b0e47b15ece.png and /dev/null differ diff --git a/0.15/_images/math/555a757d6d006f9dbbf1c4f6e016b6e7f9808a33.png b/0.15/_images/math/555a757d6d006f9dbbf1c4f6e016b6e7f9808a33.png deleted file mode 100644 index 72fe3d721e8bc..0000000000000 Binary files a/0.15/_images/math/555a757d6d006f9dbbf1c4f6e016b6e7f9808a33.png and /dev/null differ diff --git a/0.15/_images/math/55717c27d8dc9fc74a47ab9c34e12fdee568d9ba.png b/0.15/_images/math/55717c27d8dc9fc74a47ab9c34e12fdee568d9ba.png deleted file mode 100644 index 7512bea439889..0000000000000 Binary files a/0.15/_images/math/55717c27d8dc9fc74a47ab9c34e12fdee568d9ba.png and /dev/null differ diff --git a/0.15/_images/math/560f9754fb09aec60beabe312f4d9427baf0f452.png b/0.15/_images/math/560f9754fb09aec60beabe312f4d9427baf0f452.png deleted file mode 100644 index 004e06d1b6b48..0000000000000 Binary files a/0.15/_images/math/560f9754fb09aec60beabe312f4d9427baf0f452.png and /dev/null differ diff --git a/0.15/_images/math/56782c21fe4a6ef3b34912b9e13463b1e23f6719.png b/0.15/_images/math/56782c21fe4a6ef3b34912b9e13463b1e23f6719.png deleted file mode 100644 index 103b73faf09b6..0000000000000 Binary files a/0.15/_images/math/56782c21fe4a6ef3b34912b9e13463b1e23f6719.png and /dev/null differ diff --git a/0.15/_images/math/56868f91fc4163062ac1c061410c88eb585228de.png b/0.15/_images/math/56868f91fc4163062ac1c061410c88eb585228de.png deleted file mode 100644 index 293461f8e26be..0000000000000 Binary files a/0.15/_images/math/56868f91fc4163062ac1c061410c88eb585228de.png and /dev/null differ diff --git a/0.15/_images/math/57b73b19a75bba7654c1c5076915da8feca8bdb0.png b/0.15/_images/math/57b73b19a75bba7654c1c5076915da8feca8bdb0.png deleted file mode 100644 index 3878a5ebd79d3..0000000000000 Binary files a/0.15/_images/math/57b73b19a75bba7654c1c5076915da8feca8bdb0.png and /dev/null differ diff --git a/0.15/_images/math/595b517f5abeaca1806ed5650dcf153ff0473b8c.png b/0.15/_images/math/595b517f5abeaca1806ed5650dcf153ff0473b8c.png deleted file mode 100644 index 5129318215f1c..0000000000000 Binary files a/0.15/_images/math/595b517f5abeaca1806ed5650dcf153ff0473b8c.png and /dev/null differ diff --git a/0.15/_images/math/59ec4d406b308d297b0e2e908f767564cd4e64ec.png b/0.15/_images/math/59ec4d406b308d297b0e2e908f767564cd4e64ec.png deleted file mode 100644 index 2aa887a0ffa67..0000000000000 Binary files a/0.15/_images/math/59ec4d406b308d297b0e2e908f767564cd4e64ec.png and /dev/null differ diff --git a/0.15/_images/math/59ffc8fd00ae4fd9fca28fc4bcf15614e0dddea2.png b/0.15/_images/math/59ffc8fd00ae4fd9fca28fc4bcf15614e0dddea2.png deleted file mode 100644 index 19c2317a641b4..0000000000000 Binary files a/0.15/_images/math/59ffc8fd00ae4fd9fca28fc4bcf15614e0dddea2.png and /dev/null differ diff --git a/0.15/_images/math/5ace0a430e960b2040c752b137773bfc9b49e16b.png b/0.15/_images/math/5ace0a430e960b2040c752b137773bfc9b49e16b.png deleted file mode 100644 index 8313a2b24dd4f..0000000000000 Binary files a/0.15/_images/math/5ace0a430e960b2040c752b137773bfc9b49e16b.png and /dev/null differ diff --git a/0.15/_images/math/5ad6bfdf9e562f74e46b76f28df8f60b983e2a91.png b/0.15/_images/math/5ad6bfdf9e562f74e46b76f28df8f60b983e2a91.png deleted file mode 100644 index 15b0db5517bf8..0000000000000 Binary files a/0.15/_images/math/5ad6bfdf9e562f74e46b76f28df8f60b983e2a91.png and /dev/null differ diff --git a/0.15/_images/math/5b60001364caf7a350cd44edec70e2e3019dbc12.png b/0.15/_images/math/5b60001364caf7a350cd44edec70e2e3019dbc12.png deleted file mode 100644 index ff7e0d21d9a89..0000000000000 Binary files a/0.15/_images/math/5b60001364caf7a350cd44edec70e2e3019dbc12.png and /dev/null differ diff --git a/0.15/_images/math/5c35be80517ffef4a33d6d5d72e68bbdbd0aab1b.png b/0.15/_images/math/5c35be80517ffef4a33d6d5d72e68bbdbd0aab1b.png deleted file mode 100644 index 6c3749f2cec4d..0000000000000 Binary files a/0.15/_images/math/5c35be80517ffef4a33d6d5d72e68bbdbd0aab1b.png and /dev/null differ diff --git a/0.15/_images/math/5c83c0acadd3ac75ed5baf206310b9b1a2b03f3a.png b/0.15/_images/math/5c83c0acadd3ac75ed5baf206310b9b1a2b03f3a.png deleted file mode 100644 index 642a14964b7c9..0000000000000 Binary files a/0.15/_images/math/5c83c0acadd3ac75ed5baf206310b9b1a2b03f3a.png and /dev/null differ diff --git a/0.15/_images/math/5d5c5d759bbce0758c8ad4e6a6d27fb6539b597e.png b/0.15/_images/math/5d5c5d759bbce0758c8ad4e6a6d27fb6539b597e.png deleted file mode 100644 index 76caefa0f7c56..0000000000000 Binary files a/0.15/_images/math/5d5c5d759bbce0758c8ad4e6a6d27fb6539b597e.png and /dev/null differ diff --git a/0.15/_images/math/5d90819185ae56b9e0d1c08df4bd719b6aa06b03.png b/0.15/_images/math/5d90819185ae56b9e0d1c08df4bd719b6aa06b03.png deleted file mode 100644 index 1f07de83f88e1..0000000000000 Binary files a/0.15/_images/math/5d90819185ae56b9e0d1c08df4bd719b6aa06b03.png and /dev/null differ diff --git a/0.15/_images/math/5d9bdf0a568cdb9b3b32d17823bd05f5931647b1.png b/0.15/_images/math/5d9bdf0a568cdb9b3b32d17823bd05f5931647b1.png deleted file mode 100644 index 91d4324a47d26..0000000000000 Binary files a/0.15/_images/math/5d9bdf0a568cdb9b3b32d17823bd05f5931647b1.png and /dev/null differ diff --git a/0.15/_images/math/5e0afb293a769e69c218750f2c321c3f81e12fba.png b/0.15/_images/math/5e0afb293a769e69c218750f2c321c3f81e12fba.png deleted file mode 100644 index bc268acb83d93..0000000000000 Binary files a/0.15/_images/math/5e0afb293a769e69c218750f2c321c3f81e12fba.png and /dev/null differ diff --git a/0.15/_images/math/5e857aeb235a55d0250954f6f71aef2c356db1ed.png b/0.15/_images/math/5e857aeb235a55d0250954f6f71aef2c356db1ed.png deleted file mode 100644 index 268baf5634e56..0000000000000 Binary files a/0.15/_images/math/5e857aeb235a55d0250954f6f71aef2c356db1ed.png and /dev/null differ diff --git a/0.15/_images/math/5e87bf41a96deddf6cb485ff530f153f2590e9cc.png b/0.15/_images/math/5e87bf41a96deddf6cb485ff530f153f2590e9cc.png deleted file mode 100644 index be7e5fa48ae50..0000000000000 Binary files a/0.15/_images/math/5e87bf41a96deddf6cb485ff530f153f2590e9cc.png and /dev/null differ diff --git a/0.15/_images/math/5eb88e6213263550f728c06f0ee8f05270e5e55b.png b/0.15/_images/math/5eb88e6213263550f728c06f0ee8f05270e5e55b.png deleted file mode 100644 index 722f9319c3a74..0000000000000 Binary files a/0.15/_images/math/5eb88e6213263550f728c06f0ee8f05270e5e55b.png and /dev/null differ diff --git a/0.15/_images/math/5ec40441786a0fb92ebe6de43edbc7d6f5b6bab2.png b/0.15/_images/math/5ec40441786a0fb92ebe6de43edbc7d6f5b6bab2.png deleted file mode 100644 index 6467243ec35a8..0000000000000 Binary files a/0.15/_images/math/5ec40441786a0fb92ebe6de43edbc7d6f5b6bab2.png and /dev/null differ diff --git a/0.15/_images/math/5ee39cf1ba2e48363d6da03fe2d74383773ce52d.png b/0.15/_images/math/5ee39cf1ba2e48363d6da03fe2d74383773ce52d.png deleted file mode 100644 index d967df87b1afa..0000000000000 Binary files a/0.15/_images/math/5ee39cf1ba2e48363d6da03fe2d74383773ce52d.png and /dev/null differ diff --git a/0.15/_images/math/5f2d199ed595804f94edd64ed3a3ecbe9bb802e0.png b/0.15/_images/math/5f2d199ed595804f94edd64ed3a3ecbe9bb802e0.png deleted file mode 100644 index 53bf61113bab6..0000000000000 Binary files a/0.15/_images/math/5f2d199ed595804f94edd64ed3a3ecbe9bb802e0.png and /dev/null differ diff --git a/0.15/_images/math/5f5a8c7bf3426ebee66a481436596ef99a070177.png b/0.15/_images/math/5f5a8c7bf3426ebee66a481436596ef99a070177.png deleted file mode 100644 index a25127dc43b90..0000000000000 Binary files a/0.15/_images/math/5f5a8c7bf3426ebee66a481436596ef99a070177.png and /dev/null differ diff --git a/0.15/_images/math/5f8624741cd6a4e53c43692c6e4bbd56bd5b561b.png b/0.15/_images/math/5f8624741cd6a4e53c43692c6e4bbd56bd5b561b.png deleted file mode 100644 index e915031a68534..0000000000000 Binary files a/0.15/_images/math/5f8624741cd6a4e53c43692c6e4bbd56bd5b561b.png and /dev/null differ diff --git a/0.15/_images/math/5ff15825a85204658e3e5aa6e3b5952b8f709c27.png b/0.15/_images/math/5ff15825a85204658e3e5aa6e3b5952b8f709c27.png deleted file mode 100644 index 53e21f250223b..0000000000000 Binary files a/0.15/_images/math/5ff15825a85204658e3e5aa6e3b5952b8f709c27.png and /dev/null differ diff --git a/0.15/_images/math/608c7136ca0228a7d2192a536cd3ec486371ba31.png b/0.15/_images/math/608c7136ca0228a7d2192a536cd3ec486371ba31.png deleted file mode 100644 index 73d668846c0fa..0000000000000 Binary files a/0.15/_images/math/608c7136ca0228a7d2192a536cd3ec486371ba31.png and /dev/null differ diff --git a/0.15/_images/math/60a1dd0b8db1f48b70c8440f8ccfbe1ff779234b.png b/0.15/_images/math/60a1dd0b8db1f48b70c8440f8ccfbe1ff779234b.png deleted file mode 100644 index 8b4395735f80c..0000000000000 Binary files a/0.15/_images/math/60a1dd0b8db1f48b70c8440f8ccfbe1ff779234b.png and /dev/null differ diff --git a/0.15/_images/math/60dd23f78766f18d8e638f45e2d4f6643b2f31df.png b/0.15/_images/math/60dd23f78766f18d8e638f45e2d4f6643b2f31df.png deleted file mode 100644 index aab482dd9c69c..0000000000000 Binary files a/0.15/_images/math/60dd23f78766f18d8e638f45e2d4f6643b2f31df.png and /dev/null differ diff --git a/0.15/_images/math/6205f47dc46df64205ff4ed08f0e63aed02741ea.png b/0.15/_images/math/6205f47dc46df64205ff4ed08f0e63aed02741ea.png deleted file mode 100644 index 3a212a982b5a9..0000000000000 Binary files a/0.15/_images/math/6205f47dc46df64205ff4ed08f0e63aed02741ea.png and /dev/null differ diff --git a/0.15/_images/math/6227164813ffb600135aa9f69b90000ace19ba1d.png b/0.15/_images/math/6227164813ffb600135aa9f69b90000ace19ba1d.png deleted file mode 100644 index 1f4b90b7921d8..0000000000000 Binary files a/0.15/_images/math/6227164813ffb600135aa9f69b90000ace19ba1d.png and /dev/null differ diff --git a/0.15/_images/math/6249d7686a865f94d4173d4351dc919df639f900.png b/0.15/_images/math/6249d7686a865f94d4173d4351dc919df639f900.png deleted file mode 100644 index c4b90040a65fb..0000000000000 Binary files a/0.15/_images/math/6249d7686a865f94d4173d4351dc919df639f900.png and /dev/null differ diff --git a/0.15/_images/math/6261d9483c5a54dd480529d4dafa114d56359e2d.png b/0.15/_images/math/6261d9483c5a54dd480529d4dafa114d56359e2d.png deleted file mode 100644 index 448e2c91942d1..0000000000000 Binary files a/0.15/_images/math/6261d9483c5a54dd480529d4dafa114d56359e2d.png and /dev/null differ diff --git a/0.15/_images/math/62af498c85cf5772b99f66e5b493cdcba66a7b48.png b/0.15/_images/math/62af498c85cf5772b99f66e5b493cdcba66a7b48.png deleted file mode 100644 index aca371f691e19..0000000000000 Binary files a/0.15/_images/math/62af498c85cf5772b99f66e5b493cdcba66a7b48.png and /dev/null differ diff --git a/0.15/_images/math/62be32aea2502a24649da8d7cc427e3b6bb402a0.png b/0.15/_images/math/62be32aea2502a24649da8d7cc427e3b6bb402a0.png deleted file mode 100644 index c60dc9e91c91f..0000000000000 Binary files a/0.15/_images/math/62be32aea2502a24649da8d7cc427e3b6bb402a0.png and /dev/null differ diff --git a/0.15/_images/math/62c79506cd664dcdceb67df9f260f2a499265fec.png b/0.15/_images/math/62c79506cd664dcdceb67df9f260f2a499265fec.png deleted file mode 100644 index 24d0a96b6f7a0..0000000000000 Binary files a/0.15/_images/math/62c79506cd664dcdceb67df9f260f2a499265fec.png and /dev/null differ diff --git a/0.15/_images/math/62d80c06c441f97f096c5a6b5f48e6714cb071df.png b/0.15/_images/math/62d80c06c441f97f096c5a6b5f48e6714cb071df.png deleted file mode 100644 index b8f1835b4840a..0000000000000 Binary files a/0.15/_images/math/62d80c06c441f97f096c5a6b5f48e6714cb071df.png and /dev/null differ diff --git a/0.15/_images/math/630e3a780577ea7921e81ee2ac5237dd1802ec8d.png b/0.15/_images/math/630e3a780577ea7921e81ee2ac5237dd1802ec8d.png deleted file mode 100644 index 0041256a47efe..0000000000000 Binary files a/0.15/_images/math/630e3a780577ea7921e81ee2ac5237dd1802ec8d.png and /dev/null differ diff --git a/0.15/_images/math/6349652f4f3fed24cf0e66ba44b19b5c170cae96.png b/0.15/_images/math/6349652f4f3fed24cf0e66ba44b19b5c170cae96.png deleted file mode 100644 index 91a056eb48000..0000000000000 Binary files a/0.15/_images/math/6349652f4f3fed24cf0e66ba44b19b5c170cae96.png and /dev/null differ diff --git a/0.15/_images/math/63a6f23c6e8455055f6590d49baed24be96c3f2b.png b/0.15/_images/math/63a6f23c6e8455055f6590d49baed24be96c3f2b.png deleted file mode 100644 index c370eb9f149d4..0000000000000 Binary files a/0.15/_images/math/63a6f23c6e8455055f6590d49baed24be96c3f2b.png and /dev/null differ diff --git a/0.15/_images/math/6403e505161fff020c1646c088f941b9f785c787.png b/0.15/_images/math/6403e505161fff020c1646c088f941b9f785c787.png deleted file mode 100644 index 2d0b0897ea232..0000000000000 Binary files a/0.15/_images/math/6403e505161fff020c1646c088f941b9f785c787.png and /dev/null differ diff --git a/0.15/_images/math/64538044ea7c00385abadbb99a5a97a9a18a94cc.png b/0.15/_images/math/64538044ea7c00385abadbb99a5a97a9a18a94cc.png deleted file mode 100644 index 1911dcd0fe3c7..0000000000000 Binary files a/0.15/_images/math/64538044ea7c00385abadbb99a5a97a9a18a94cc.png and /dev/null differ diff --git a/0.15/_images/math/6461c5a07ba694eef0501a5b22cf9c4b7ff3a19d.png b/0.15/_images/math/6461c5a07ba694eef0501a5b22cf9c4b7ff3a19d.png deleted file mode 100644 index 02ccd08577e8c..0000000000000 Binary files a/0.15/_images/math/6461c5a07ba694eef0501a5b22cf9c4b7ff3a19d.png and /dev/null differ diff --git a/0.15/_images/math/655f884f1023466952f6bf7e40e67b655f24393b.png b/0.15/_images/math/655f884f1023466952f6bf7e40e67b655f24393b.png deleted file mode 100644 index 6f90eb05dec73..0000000000000 Binary files a/0.15/_images/math/655f884f1023466952f6bf7e40e67b655f24393b.png and /dev/null differ diff --git a/0.15/_images/math/65868d23a5bfe5b3b2d819386b19c14fa36af134.png b/0.15/_images/math/65868d23a5bfe5b3b2d819386b19c14fa36af134.png deleted file mode 100644 index 429ac723c0b84..0000000000000 Binary files a/0.15/_images/math/65868d23a5bfe5b3b2d819386b19c14fa36af134.png and /dev/null differ diff --git a/0.15/_images/math/66a8fa6b26be8656f4da5b91e93008d8ff7b617f.png b/0.15/_images/math/66a8fa6b26be8656f4da5b91e93008d8ff7b617f.png deleted file mode 100644 index e2eb1492ca848..0000000000000 Binary files a/0.15/_images/math/66a8fa6b26be8656f4da5b91e93008d8ff7b617f.png and /dev/null differ diff --git a/0.15/_images/math/66a9bcb2fb38a49967dec10ad4d7cdded003ee7d.png b/0.15/_images/math/66a9bcb2fb38a49967dec10ad4d7cdded003ee7d.png deleted file mode 100644 index bbf72cfbc5d05..0000000000000 Binary files a/0.15/_images/math/66a9bcb2fb38a49967dec10ad4d7cdded003ee7d.png and /dev/null differ diff --git a/0.15/_images/math/66e84bdb1de50d94107f6afbf65ae92a826fe3e8.png b/0.15/_images/math/66e84bdb1de50d94107f6afbf65ae92a826fe3e8.png deleted file mode 100644 index 007ee6bebfba2..0000000000000 Binary files a/0.15/_images/math/66e84bdb1de50d94107f6afbf65ae92a826fe3e8.png and /dev/null differ diff --git a/0.15/_images/math/672b8ad37aa193efaa4a26c04891131142ad96fc.png b/0.15/_images/math/672b8ad37aa193efaa4a26c04891131142ad96fc.png deleted file mode 100644 index 0a2ce4a9e20b6..0000000000000 Binary files a/0.15/_images/math/672b8ad37aa193efaa4a26c04891131142ad96fc.png and /dev/null differ diff --git a/0.15/_images/math/67de4ad7482bd9184f6b03641a563858ef06ce8d.png b/0.15/_images/math/67de4ad7482bd9184f6b03641a563858ef06ce8d.png deleted file mode 100644 index 0c74d4a7cc792..0000000000000 Binary files a/0.15/_images/math/67de4ad7482bd9184f6b03641a563858ef06ce8d.png and /dev/null differ diff --git a/0.15/_images/math/67f4714f065d485540ad40829e0717bf75e9dd85.png b/0.15/_images/math/67f4714f065d485540ad40829e0717bf75e9dd85.png deleted file mode 100644 index 74cacfb8edbfd..0000000000000 Binary files a/0.15/_images/math/67f4714f065d485540ad40829e0717bf75e9dd85.png and /dev/null differ diff --git a/0.15/_images/math/67fec6448d04cd81375dc7d6760d79a568885cda.png b/0.15/_images/math/67fec6448d04cd81375dc7d6760d79a568885cda.png deleted file mode 100644 index 1fcc040ad948d..0000000000000 Binary files a/0.15/_images/math/67fec6448d04cd81375dc7d6760d79a568885cda.png and /dev/null differ diff --git a/0.15/_images/math/6859317dd1b439cef34131bcd4bafee8393444e0.png b/0.15/_images/math/6859317dd1b439cef34131bcd4bafee8393444e0.png deleted file mode 100644 index 359a20a8d16cf..0000000000000 Binary files a/0.15/_images/math/6859317dd1b439cef34131bcd4bafee8393444e0.png and /dev/null differ diff --git a/0.15/_images/math/691f9bcf2834afe76dac2bd0c1170cd70ca13c54.png b/0.15/_images/math/691f9bcf2834afe76dac2bd0c1170cd70ca13c54.png deleted file mode 100644 index 4a2eb571f7831..0000000000000 Binary files a/0.15/_images/math/691f9bcf2834afe76dac2bd0c1170cd70ca13c54.png and /dev/null differ diff --git a/0.15/_images/math/696714a8601d918119e572ede96326acbb6b945e.png b/0.15/_images/math/696714a8601d918119e572ede96326acbb6b945e.png deleted file mode 100644 index dadd75bf7505c..0000000000000 Binary files a/0.15/_images/math/696714a8601d918119e572ede96326acbb6b945e.png and /dev/null differ diff --git a/0.15/_images/math/6b6b0c624950f60141fafc6b2bb0d46f8c4c7e60.png b/0.15/_images/math/6b6b0c624950f60141fafc6b2bb0d46f8c4c7e60.png deleted file mode 100644 index bed5dbb715cff..0000000000000 Binary files a/0.15/_images/math/6b6b0c624950f60141fafc6b2bb0d46f8c4c7e60.png and /dev/null differ diff --git a/0.15/_images/math/6bd6b69e7846992625db6cd37ca4dcec179fdbc3.png b/0.15/_images/math/6bd6b69e7846992625db6cd37ca4dcec179fdbc3.png deleted file mode 100644 index 8a524d0783b9b..0000000000000 Binary files a/0.15/_images/math/6bd6b69e7846992625db6cd37ca4dcec179fdbc3.png and /dev/null differ diff --git a/0.15/_images/math/6c7d2637152e02294a8ed8c9d3ea8405477850c7.png b/0.15/_images/math/6c7d2637152e02294a8ed8c9d3ea8405477850c7.png deleted file mode 100644 index 084e288704519..0000000000000 Binary files a/0.15/_images/math/6c7d2637152e02294a8ed8c9d3ea8405477850c7.png and /dev/null differ diff --git a/0.15/_images/math/6cfceacfbcb485240500ae7ec7c12a7a0c45a2ee.png b/0.15/_images/math/6cfceacfbcb485240500ae7ec7c12a7a0c45a2ee.png deleted file mode 100644 index 4b4dd820a64e6..0000000000000 Binary files a/0.15/_images/math/6cfceacfbcb485240500ae7ec7c12a7a0c45a2ee.png and /dev/null differ diff --git a/0.15/_images/math/6cfe4cdaf5ef73a55c04bb0fcb95103837383bc8.png b/0.15/_images/math/6cfe4cdaf5ef73a55c04bb0fcb95103837383bc8.png deleted file mode 100644 index 8d70c4bd4b8b3..0000000000000 Binary files a/0.15/_images/math/6cfe4cdaf5ef73a55c04bb0fcb95103837383bc8.png and /dev/null differ diff --git a/0.15/_images/math/6d42c88506b8da39a2a23653aecbfb7c29728063.png b/0.15/_images/math/6d42c88506b8da39a2a23653aecbfb7c29728063.png deleted file mode 100644 index 4fdac26e7b904..0000000000000 Binary files a/0.15/_images/math/6d42c88506b8da39a2a23653aecbfb7c29728063.png and /dev/null differ diff --git a/0.15/_images/math/6d48612122b8ba03b4f704429e4e7488197f328f.png b/0.15/_images/math/6d48612122b8ba03b4f704429e4e7488197f328f.png deleted file mode 100644 index 7ae78304c86be..0000000000000 Binary files a/0.15/_images/math/6d48612122b8ba03b4f704429e4e7488197f328f.png and /dev/null differ diff --git a/0.15/_images/math/6d786bc0d556134fd2cd2ff743dd4b1a711bb541.png b/0.15/_images/math/6d786bc0d556134fd2cd2ff743dd4b1a711bb541.png deleted file mode 100644 index c35255aebda3a..0000000000000 Binary files a/0.15/_images/math/6d786bc0d556134fd2cd2ff743dd4b1a711bb541.png and /dev/null differ diff --git a/0.15/_images/math/6d91696375ec8db930625a9a4c6b4a4c9c53f10d.png b/0.15/_images/math/6d91696375ec8db930625a9a4c6b4a4c9c53f10d.png deleted file mode 100644 index 5f16f07486581..0000000000000 Binary files a/0.15/_images/math/6d91696375ec8db930625a9a4c6b4a4c9c53f10d.png and /dev/null differ diff --git a/0.15/_images/math/6da4b9b5dc6b2670c9f936c72ee7ee803389523f.png b/0.15/_images/math/6da4b9b5dc6b2670c9f936c72ee7ee803389523f.png deleted file mode 100644 index 6de706d5c3b54..0000000000000 Binary files a/0.15/_images/math/6da4b9b5dc6b2670c9f936c72ee7ee803389523f.png and /dev/null differ diff --git a/0.15/_images/math/6df8231941864b21a71b8cf397f457e6c395103c.png b/0.15/_images/math/6df8231941864b21a71b8cf397f457e6c395103c.png deleted file mode 100644 index aa5d184e31a5f..0000000000000 Binary files a/0.15/_images/math/6df8231941864b21a71b8cf397f457e6c395103c.png and /dev/null differ diff --git a/0.15/_images/math/6eedd22a03d5c334159634dbc99dff67fe4e0d4a.png b/0.15/_images/math/6eedd22a03d5c334159634dbc99dff67fe4e0d4a.png deleted file mode 100644 index f7fce0c128fe3..0000000000000 Binary files a/0.15/_images/math/6eedd22a03d5c334159634dbc99dff67fe4e0d4a.png and /dev/null differ diff --git a/0.15/_images/math/6f487de9cdc05af1d24272b8f36db9f03d5abb06.png b/0.15/_images/math/6f487de9cdc05af1d24272b8f36db9f03d5abb06.png deleted file mode 100644 index 7d0556b050993..0000000000000 Binary files a/0.15/_images/math/6f487de9cdc05af1d24272b8f36db9f03d5abb06.png and /dev/null differ diff --git a/0.15/_images/math/6ffd148ba8ac7d1c1f179227ff97ad3441fdd115.png b/0.15/_images/math/6ffd148ba8ac7d1c1f179227ff97ad3441fdd115.png deleted file mode 100644 index 0f7be53a2f921..0000000000000 Binary files a/0.15/_images/math/6ffd148ba8ac7d1c1f179227ff97ad3441fdd115.png and /dev/null differ diff --git a/0.15/_images/math/715efcbd1f7148dd4d8e1b3a6a9ea03d12907d8b.png b/0.15/_images/math/715efcbd1f7148dd4d8e1b3a6a9ea03d12907d8b.png deleted file mode 100644 index ca781c211ca15..0000000000000 Binary files a/0.15/_images/math/715efcbd1f7148dd4d8e1b3a6a9ea03d12907d8b.png and /dev/null differ diff --git a/0.15/_images/math/71d730753a601237036ae37f07f70dd9756ffac5.png b/0.15/_images/math/71d730753a601237036ae37f07f70dd9756ffac5.png deleted file mode 100644 index e99df8271ad20..0000000000000 Binary files a/0.15/_images/math/71d730753a601237036ae37f07f70dd9756ffac5.png and /dev/null differ diff --git a/0.15/_images/math/71faab2506ab54143f7deda2b7b00c75a836b5b8.png b/0.15/_images/math/71faab2506ab54143f7deda2b7b00c75a836b5b8.png deleted file mode 100644 index 6b95cca51ffb1..0000000000000 Binary files a/0.15/_images/math/71faab2506ab54143f7deda2b7b00c75a836b5b8.png and /dev/null differ diff --git a/0.15/_images/math/727079e94cba45402e70f16b80f7228bba36a12c.png b/0.15/_images/math/727079e94cba45402e70f16b80f7228bba36a12c.png deleted file mode 100644 index 25a5d84feb6f9..0000000000000 Binary files a/0.15/_images/math/727079e94cba45402e70f16b80f7228bba36a12c.png and /dev/null differ diff --git a/0.15/_images/math/7325ea0226849021035c250bebb23461ccf847dc.png b/0.15/_images/math/7325ea0226849021035c250bebb23461ccf847dc.png deleted file mode 100644 index 086e46066ff96..0000000000000 Binary files a/0.15/_images/math/7325ea0226849021035c250bebb23461ccf847dc.png and /dev/null differ diff --git a/0.15/_images/math/73565e0e02602c9b442a103dc229e5024e37ad67.png b/0.15/_images/math/73565e0e02602c9b442a103dc229e5024e37ad67.png deleted file mode 100644 index 5befa0e3bc7e1..0000000000000 Binary files a/0.15/_images/math/73565e0e02602c9b442a103dc229e5024e37ad67.png and /dev/null differ diff --git a/0.15/_images/math/7393ae52f899dd6a031b20cac4e675cd42489021.png b/0.15/_images/math/7393ae52f899dd6a031b20cac4e675cd42489021.png deleted file mode 100644 index c817d617fe11a..0000000000000 Binary files a/0.15/_images/math/7393ae52f899dd6a031b20cac4e675cd42489021.png and /dev/null differ diff --git a/0.15/_images/math/73f5e249c88b2b3068263480f576b051cb5c4f6e.png b/0.15/_images/math/73f5e249c88b2b3068263480f576b051cb5c4f6e.png deleted file mode 100644 index ac8d26696c7b1..0000000000000 Binary files a/0.15/_images/math/73f5e249c88b2b3068263480f576b051cb5c4f6e.png and /dev/null differ diff --git a/0.15/_images/math/745e55926bd59d8dbf0550af37905b8e93e38bc4.png b/0.15/_images/math/745e55926bd59d8dbf0550af37905b8e93e38bc4.png deleted file mode 100644 index 196377f04e655..0000000000000 Binary files a/0.15/_images/math/745e55926bd59d8dbf0550af37905b8e93e38bc4.png and /dev/null differ diff --git a/0.15/_images/math/749ba150f0874a6aeb9951c4d3874994bb8ce7a8.png b/0.15/_images/math/749ba150f0874a6aeb9951c4d3874994bb8ce7a8.png deleted file mode 100644 index c3ca7bd4497af..0000000000000 Binary files a/0.15/_images/math/749ba150f0874a6aeb9951c4d3874994bb8ce7a8.png and /dev/null differ diff --git a/0.15/_images/math/754ae478b77cf358d3ae841fb0b18368afdf37f1.png b/0.15/_images/math/754ae478b77cf358d3ae841fb0b18368afdf37f1.png deleted file mode 100644 index ec2220baf76bb..0000000000000 Binary files a/0.15/_images/math/754ae478b77cf358d3ae841fb0b18368afdf37f1.png and /dev/null differ diff --git a/0.15/_images/math/75e27f04188974063be3230dca208cd495b77ce1.png b/0.15/_images/math/75e27f04188974063be3230dca208cd495b77ce1.png deleted file mode 100644 index 368017c9ebac4..0000000000000 Binary files a/0.15/_images/math/75e27f04188974063be3230dca208cd495b77ce1.png and /dev/null differ diff --git a/0.15/_images/math/75ffb8a1ebecd4726c681ab02b0af9d3ce0f5388.png b/0.15/_images/math/75ffb8a1ebecd4726c681ab02b0af9d3ce0f5388.png deleted file mode 100644 index a755a55da23cd..0000000000000 Binary files a/0.15/_images/math/75ffb8a1ebecd4726c681ab02b0af9d3ce0f5388.png and /dev/null differ diff --git a/0.15/_images/math/765b4bda0ec7e64d4baa34e4f0e8cc01ca151e1a.png b/0.15/_images/math/765b4bda0ec7e64d4baa34e4f0e8cc01ca151e1a.png deleted file mode 100644 index d4d95ba788dc2..0000000000000 Binary files a/0.15/_images/math/765b4bda0ec7e64d4baa34e4f0e8cc01ca151e1a.png and /dev/null differ diff --git a/0.15/_images/math/769cd7f00a85e761d9b63fc6a6b4eec08a3a4adf.png b/0.15/_images/math/769cd7f00a85e761d9b63fc6a6b4eec08a3a4adf.png deleted file mode 100644 index f58db45aa5c7c..0000000000000 Binary files a/0.15/_images/math/769cd7f00a85e761d9b63fc6a6b4eec08a3a4adf.png and /dev/null differ diff --git a/0.15/_images/math/76fb561a7220221493e4887d6c19668c2c0009c2.png b/0.15/_images/math/76fb561a7220221493e4887d6c19668c2c0009c2.png deleted file mode 100644 index f3b4d0e491ebd..0000000000000 Binary files a/0.15/_images/math/76fb561a7220221493e4887d6c19668c2c0009c2.png and /dev/null differ diff --git a/0.15/_images/math/7708bff9659d3004788cde7bb74d8019469a289c.png b/0.15/_images/math/7708bff9659d3004788cde7bb74d8019469a289c.png deleted file mode 100644 index a8daf055cc7c0..0000000000000 Binary files a/0.15/_images/math/7708bff9659d3004788cde7bb74d8019469a289c.png and /dev/null differ diff --git a/0.15/_images/math/770bbb31758ede291297b7bd4e7b21c2163831ec.png b/0.15/_images/math/770bbb31758ede291297b7bd4e7b21c2163831ec.png deleted file mode 100644 index 7178da306832c..0000000000000 Binary files a/0.15/_images/math/770bbb31758ede291297b7bd4e7b21c2163831ec.png and /dev/null differ diff --git a/0.15/_images/math/77d50c3510468fe9b613e6302375706598dfb13d.png b/0.15/_images/math/77d50c3510468fe9b613e6302375706598dfb13d.png deleted file mode 100644 index 89bbbfe527947..0000000000000 Binary files a/0.15/_images/math/77d50c3510468fe9b613e6302375706598dfb13d.png and /dev/null differ diff --git a/0.15/_images/math/77e715cd935ec58a6793c7282b25172264dde14b.png b/0.15/_images/math/77e715cd935ec58a6793c7282b25172264dde14b.png deleted file mode 100644 index 4d2df074c41cf..0000000000000 Binary files a/0.15/_images/math/77e715cd935ec58a6793c7282b25172264dde14b.png and /dev/null differ diff --git a/0.15/_images/math/787ef8897f85416cae83d74ef5630a9c5973d996.png b/0.15/_images/math/787ef8897f85416cae83d74ef5630a9c5973d996.png deleted file mode 100644 index 0c6eaa9ff836e..0000000000000 Binary files a/0.15/_images/math/787ef8897f85416cae83d74ef5630a9c5973d996.png and /dev/null differ diff --git a/0.15/_images/math/78a38be674bdf4202a26ae17ef1935fbdbe23682.png b/0.15/_images/math/78a38be674bdf4202a26ae17ef1935fbdbe23682.png deleted file mode 100644 index dcfee9800a6a0..0000000000000 Binary files a/0.15/_images/math/78a38be674bdf4202a26ae17ef1935fbdbe23682.png and /dev/null differ diff --git a/0.15/_images/math/78ec2f9210cf8a4c33c1501f9e90b1472fe920ed.png b/0.15/_images/math/78ec2f9210cf8a4c33c1501f9e90b1472fe920ed.png deleted file mode 100644 index e46a6b8e28cfe..0000000000000 Binary files a/0.15/_images/math/78ec2f9210cf8a4c33c1501f9e90b1472fe920ed.png and /dev/null differ diff --git a/0.15/_images/math/79f68af53194633b5cdca0c04d0b3779a5751a90.png b/0.15/_images/math/79f68af53194633b5cdca0c04d0b3779a5751a90.png deleted file mode 100644 index a44bb864f1f80..0000000000000 Binary files a/0.15/_images/math/79f68af53194633b5cdca0c04d0b3779a5751a90.png and /dev/null differ diff --git a/0.15/_images/math/7a25fd8f8c271eb8d4111de5ac72044c7ae10b31.png b/0.15/_images/math/7a25fd8f8c271eb8d4111de5ac72044c7ae10b31.png deleted file mode 100644 index e34e109cac0b5..0000000000000 Binary files a/0.15/_images/math/7a25fd8f8c271eb8d4111de5ac72044c7ae10b31.png and /dev/null differ diff --git a/0.15/_images/math/7a77f92898506ef618b9aaad553cc8d0644d584a.png b/0.15/_images/math/7a77f92898506ef618b9aaad553cc8d0644d584a.png deleted file mode 100644 index a70bafdcc5d7c..0000000000000 Binary files a/0.15/_images/math/7a77f92898506ef618b9aaad553cc8d0644d584a.png and /dev/null differ diff --git a/0.15/_images/math/7a9b78bdb36f2fbd5ca087212e58fc74dde40e86.png b/0.15/_images/math/7a9b78bdb36f2fbd5ca087212e58fc74dde40e86.png deleted file mode 100644 index 899ffb83374ae..0000000000000 Binary files a/0.15/_images/math/7a9b78bdb36f2fbd5ca087212e58fc74dde40e86.png and /dev/null differ diff --git a/0.15/_images/math/7aaed5ba95d79fa52da0d2596f76ebdc25e8893f.png b/0.15/_images/math/7aaed5ba95d79fa52da0d2596f76ebdc25e8893f.png deleted file mode 100644 index bf0a81117ffad..0000000000000 Binary files a/0.15/_images/math/7aaed5ba95d79fa52da0d2596f76ebdc25e8893f.png and /dev/null differ diff --git a/0.15/_images/math/7ae6f6c99ed26cb15a6543a5b56660d3137c1b31.png b/0.15/_images/math/7ae6f6c99ed26cb15a6543a5b56660d3137c1b31.png deleted file mode 100644 index d8900d92023ea..0000000000000 Binary files a/0.15/_images/math/7ae6f6c99ed26cb15a6543a5b56660d3137c1b31.png and /dev/null differ diff --git a/0.15/_images/math/7b1816c51f7d31275cd3ad400208fb7b3ce136a0.png b/0.15/_images/math/7b1816c51f7d31275cd3ad400208fb7b3ce136a0.png deleted file mode 100644 index 757bd96e2a651..0000000000000 Binary files a/0.15/_images/math/7b1816c51f7d31275cd3ad400208fb7b3ce136a0.png and /dev/null differ diff --git a/0.15/_images/math/7b9f3442b3a233a596cbd4f46f76e7ce4f1ca6fb.png b/0.15/_images/math/7b9f3442b3a233a596cbd4f46f76e7ce4f1ca6fb.png deleted file mode 100644 index 017e8eb7a53bc..0000000000000 Binary files a/0.15/_images/math/7b9f3442b3a233a596cbd4f46f76e7ce4f1ca6fb.png and /dev/null differ diff --git a/0.15/_images/math/7c0e1e27c8c5d7802d1284be534e12e6a1136a9d.png b/0.15/_images/math/7c0e1e27c8c5d7802d1284be534e12e6a1136a9d.png deleted file mode 100644 index 12b65ea1cb088..0000000000000 Binary files a/0.15/_images/math/7c0e1e27c8c5d7802d1284be534e12e6a1136a9d.png and /dev/null differ diff --git a/0.15/_images/math/7c6369ba0b343e526d5123d7f4253109cddd4c08.png b/0.15/_images/math/7c6369ba0b343e526d5123d7f4253109cddd4c08.png deleted file mode 100644 index 7b05321c15deb..0000000000000 Binary files a/0.15/_images/math/7c6369ba0b343e526d5123d7f4253109cddd4c08.png and /dev/null differ diff --git a/0.15/_images/math/7c732f51f0f10cd327f9dcaa7d3432173d8964f0.png b/0.15/_images/math/7c732f51f0f10cd327f9dcaa7d3432173d8964f0.png deleted file mode 100644 index 294ad98335bd9..0000000000000 Binary files a/0.15/_images/math/7c732f51f0f10cd327f9dcaa7d3432173d8964f0.png and /dev/null differ diff --git a/0.15/_images/math/7c842dafc2022b137525e227b2e7703098069372.png b/0.15/_images/math/7c842dafc2022b137525e227b2e7703098069372.png deleted file mode 100644 index b7abc8ec866fa..0000000000000 Binary files a/0.15/_images/math/7c842dafc2022b137525e227b2e7703098069372.png and /dev/null differ diff --git a/0.15/_images/math/7d561a9a9dd8345676bd3937ce7c8b80fcbee852.png b/0.15/_images/math/7d561a9a9dd8345676bd3937ce7c8b80fcbee852.png deleted file mode 100644 index a748771915070..0000000000000 Binary files a/0.15/_images/math/7d561a9a9dd8345676bd3937ce7c8b80fcbee852.png and /dev/null differ diff --git a/0.15/_images/math/7d6c7ac8c23d999a54a206610dc62438dc13fd4c.png b/0.15/_images/math/7d6c7ac8c23d999a54a206610dc62438dc13fd4c.png deleted file mode 100644 index a5c86c684be3f..0000000000000 Binary files a/0.15/_images/math/7d6c7ac8c23d999a54a206610dc62438dc13fd4c.png and /dev/null differ diff --git a/0.15/_images/math/7d6e812752f434e91c490703e9983f319610933c.png b/0.15/_images/math/7d6e812752f434e91c490703e9983f319610933c.png deleted file mode 100644 index 992b87f21cf6a..0000000000000 Binary files a/0.15/_images/math/7d6e812752f434e91c490703e9983f319610933c.png and /dev/null differ diff --git a/0.15/_images/math/7dd2a5ea01fbd72ad2a58dd1f3d6ecbfde6208a1.png b/0.15/_images/math/7dd2a5ea01fbd72ad2a58dd1f3d6ecbfde6208a1.png deleted file mode 100644 index 7bfc4fc38d5d8..0000000000000 Binary files a/0.15/_images/math/7dd2a5ea01fbd72ad2a58dd1f3d6ecbfde6208a1.png and /dev/null differ diff --git a/0.15/_images/math/7e5afa68eb01a86e3fc93b26c2608df5bd10159b.png b/0.15/_images/math/7e5afa68eb01a86e3fc93b26c2608df5bd10159b.png deleted file mode 100644 index b9a1509ee77d4..0000000000000 Binary files a/0.15/_images/math/7e5afa68eb01a86e3fc93b26c2608df5bd10159b.png and /dev/null differ diff --git a/0.15/_images/math/7e75a758509bb1119e03c0e347cc3cabe5b6f6c1.png b/0.15/_images/math/7e75a758509bb1119e03c0e347cc3cabe5b6f6c1.png deleted file mode 100644 index 8d3136715551b..0000000000000 Binary files a/0.15/_images/math/7e75a758509bb1119e03c0e347cc3cabe5b6f6c1.png and /dev/null differ diff --git a/0.15/_images/math/7eab7af9a483d7c6e4e628ba496fb65c5c56faac.png b/0.15/_images/math/7eab7af9a483d7c6e4e628ba496fb65c5c56faac.png deleted file mode 100644 index 5afe5079b42cf..0000000000000 Binary files a/0.15/_images/math/7eab7af9a483d7c6e4e628ba496fb65c5c56faac.png and /dev/null differ diff --git a/0.15/_images/math/7f23349e1508ff6885cb48a5166c1722fd163a87.png b/0.15/_images/math/7f23349e1508ff6885cb48a5166c1722fd163a87.png deleted file mode 100644 index c71b9915a18d2..0000000000000 Binary files a/0.15/_images/math/7f23349e1508ff6885cb48a5166c1722fd163a87.png and /dev/null differ diff --git a/0.15/_images/math/7f2c98bf462cba6083cf18483ba9510e3c2fd3d3.png b/0.15/_images/math/7f2c98bf462cba6083cf18483ba9510e3c2fd3d3.png deleted file mode 100644 index a8442724f441e..0000000000000 Binary files a/0.15/_images/math/7f2c98bf462cba6083cf18483ba9510e3c2fd3d3.png and /dev/null differ diff --git a/0.15/_images/math/7f8a07910f19a76b1d1412bfb2db3bb26db0453d.png b/0.15/_images/math/7f8a07910f19a76b1d1412bfb2db3bb26db0453d.png deleted file mode 100644 index 632b7f4a2397c..0000000000000 Binary files a/0.15/_images/math/7f8a07910f19a76b1d1412bfb2db3bb26db0453d.png and /dev/null differ diff --git a/0.15/_images/math/804a9c8168cae2d295c66c7e62007ae903dbbd31.png b/0.15/_images/math/804a9c8168cae2d295c66c7e62007ae903dbbd31.png deleted file mode 100644 index fa1b845b7cc3f..0000000000000 Binary files a/0.15/_images/math/804a9c8168cae2d295c66c7e62007ae903dbbd31.png and /dev/null differ diff --git a/0.15/_images/math/80829f750b09d54c9b15ca3e6a11408593e75440.png b/0.15/_images/math/80829f750b09d54c9b15ca3e6a11408593e75440.png deleted file mode 100644 index 8eab3996af95e..0000000000000 Binary files a/0.15/_images/math/80829f750b09d54c9b15ca3e6a11408593e75440.png and /dev/null differ diff --git a/0.15/_images/math/80d842c5b7aabdb4c23f00d2074915d876e294f2.png b/0.15/_images/math/80d842c5b7aabdb4c23f00d2074915d876e294f2.png deleted file mode 100644 index d7a2ceff94fdc..0000000000000 Binary files a/0.15/_images/math/80d842c5b7aabdb4c23f00d2074915d876e294f2.png and /dev/null differ diff --git a/0.15/_images/math/8264a126c36284f782d9bc3a1b2f761cda0c2ea8.png b/0.15/_images/math/8264a126c36284f782d9bc3a1b2f761cda0c2ea8.png deleted file mode 100644 index b2ff3b2d5c826..0000000000000 Binary files a/0.15/_images/math/8264a126c36284f782d9bc3a1b2f761cda0c2ea8.png and /dev/null differ diff --git a/0.15/_images/math/82c2a519749bba8b5cdf13fac6f28b6645b044ab.png b/0.15/_images/math/82c2a519749bba8b5cdf13fac6f28b6645b044ab.png deleted file mode 100644 index 425526336a42a..0000000000000 Binary files a/0.15/_images/math/82c2a519749bba8b5cdf13fac6f28b6645b044ab.png and /dev/null differ diff --git a/0.15/_images/math/83956e92fcc80dee17fce864543216939a3c9da7.png b/0.15/_images/math/83956e92fcc80dee17fce864543216939a3c9da7.png deleted file mode 100644 index 379e86efe12cf..0000000000000 Binary files a/0.15/_images/math/83956e92fcc80dee17fce864543216939a3c9da7.png and /dev/null differ diff --git a/0.15/_images/math/83a6b3500cafea6d2bc19e8dc4550cfc77f8b04a.png b/0.15/_images/math/83a6b3500cafea6d2bc19e8dc4550cfc77f8b04a.png deleted file mode 100644 index 4679f247fddfc..0000000000000 Binary files a/0.15/_images/math/83a6b3500cafea6d2bc19e8dc4550cfc77f8b04a.png and /dev/null differ diff --git a/0.15/_images/math/83c93e5fdd9103cdb2a328c3dff63ebddd0fe67f.png b/0.15/_images/math/83c93e5fdd9103cdb2a328c3dff63ebddd0fe67f.png deleted file mode 100644 index 34ce0f4a821d0..0000000000000 Binary files a/0.15/_images/math/83c93e5fdd9103cdb2a328c3dff63ebddd0fe67f.png and /dev/null differ diff --git a/0.15/_images/math/845e2e1ea01544e0d335c7b2d48981e335cba4e1.png b/0.15/_images/math/845e2e1ea01544e0d335c7b2d48981e335cba4e1.png deleted file mode 100644 index e94dd53fa999f..0000000000000 Binary files a/0.15/_images/math/845e2e1ea01544e0d335c7b2d48981e335cba4e1.png and /dev/null differ diff --git a/0.15/_images/math/84d7271dd9e78c1e05d6c3c6ecb60309ef7dfc73.png b/0.15/_images/math/84d7271dd9e78c1e05d6c3c6ecb60309ef7dfc73.png deleted file mode 100644 index 697d3552a2972..0000000000000 Binary files a/0.15/_images/math/84d7271dd9e78c1e05d6c3c6ecb60309ef7dfc73.png and /dev/null differ diff --git a/0.15/_images/math/862543c637da17a6638dcc8fba6ba3eba91e19e9.png b/0.15/_images/math/862543c637da17a6638dcc8fba6ba3eba91e19e9.png deleted file mode 100644 index 622711954914e..0000000000000 Binary files a/0.15/_images/math/862543c637da17a6638dcc8fba6ba3eba91e19e9.png and /dev/null differ diff --git a/0.15/_images/math/8659700e6646cd91bc02c32affaa5ec046ee9935.png b/0.15/_images/math/8659700e6646cd91bc02c32affaa5ec046ee9935.png deleted file mode 100644 index 655f771d325cb..0000000000000 Binary files a/0.15/_images/math/8659700e6646cd91bc02c32affaa5ec046ee9935.png and /dev/null differ diff --git a/0.15/_images/math/86b53a99470bfe410dd9108afdb7a4464f2461fb.png b/0.15/_images/math/86b53a99470bfe410dd9108afdb7a4464f2461fb.png deleted file mode 100644 index e26eddc7b7e74..0000000000000 Binary files a/0.15/_images/math/86b53a99470bfe410dd9108afdb7a4464f2461fb.png and /dev/null differ diff --git a/0.15/_images/math/8752e98be9592f710cab29b07f225b6830f7d565.png b/0.15/_images/math/8752e98be9592f710cab29b07f225b6830f7d565.png deleted file mode 100644 index c1513ea9b570c..0000000000000 Binary files a/0.15/_images/math/8752e98be9592f710cab29b07f225b6830f7d565.png and /dev/null differ diff --git a/0.15/_images/math/87a0c2ec97d8b8f22868ec1242d2417f25d62240.png b/0.15/_images/math/87a0c2ec97d8b8f22868ec1242d2417f25d62240.png deleted file mode 100644 index bb53025f8296d..0000000000000 Binary files a/0.15/_images/math/87a0c2ec97d8b8f22868ec1242d2417f25d62240.png and /dev/null differ diff --git a/0.15/_images/math/87eb940f6dc61884b47853459bf0609474e91dba.png b/0.15/_images/math/87eb940f6dc61884b47853459bf0609474e91dba.png deleted file mode 100644 index 5308e91918bc0..0000000000000 Binary files a/0.15/_images/math/87eb940f6dc61884b47853459bf0609474e91dba.png and /dev/null differ diff --git a/0.15/_images/math/884901a21146169667a13d451f698cd2eaedc562.png b/0.15/_images/math/884901a21146169667a13d451f698cd2eaedc562.png deleted file mode 100644 index 3b231f0831244..0000000000000 Binary files a/0.15/_images/math/884901a21146169667a13d451f698cd2eaedc562.png and /dev/null differ diff --git a/0.15/_images/math/88a87ba701d515d4ac8c7458659e4ab62595ccbb.png b/0.15/_images/math/88a87ba701d515d4ac8c7458659e4ab62595ccbb.png deleted file mode 100644 index 332f84e2ef350..0000000000000 Binary files a/0.15/_images/math/88a87ba701d515d4ac8c7458659e4ab62595ccbb.png and /dev/null differ diff --git a/0.15/_images/math/890afd90975e17be820ce96af42fb3eb2a466d0c.png b/0.15/_images/math/890afd90975e17be820ce96af42fb3eb2a466d0c.png deleted file mode 100644 index 24275be95d4e4..0000000000000 Binary files a/0.15/_images/math/890afd90975e17be820ce96af42fb3eb2a466d0c.png and /dev/null differ diff --git a/0.15/_images/math/8912be2deda42f022bc42bf2ab30cb3c7c6f5d55.png b/0.15/_images/math/8912be2deda42f022bc42bf2ab30cb3c7c6f5d55.png deleted file mode 100644 index 2d59b7fd776ef..0000000000000 Binary files a/0.15/_images/math/8912be2deda42f022bc42bf2ab30cb3c7c6f5d55.png and /dev/null differ diff --git a/0.15/_images/math/8953d4d91d7fd620495bfa79ff5f9efe6e94ea84.png b/0.15/_images/math/8953d4d91d7fd620495bfa79ff5f9efe6e94ea84.png deleted file mode 100644 index ea01303c784f9..0000000000000 Binary files a/0.15/_images/math/8953d4d91d7fd620495bfa79ff5f9efe6e94ea84.png and /dev/null differ diff --git a/0.15/_images/math/89cdb11ac552712c9ab3dd1bcc28619b9ae30c77.png b/0.15/_images/math/89cdb11ac552712c9ab3dd1bcc28619b9ae30c77.png deleted file mode 100644 index 2f862ac7b0a0f..0000000000000 Binary files a/0.15/_images/math/89cdb11ac552712c9ab3dd1bcc28619b9ae30c77.png and /dev/null differ diff --git a/0.15/_images/math/89ff7f73e231da14014c5c4355ff5ab3ba181fec.png b/0.15/_images/math/89ff7f73e231da14014c5c4355ff5ab3ba181fec.png deleted file mode 100644 index 88fbe247e253c..0000000000000 Binary files a/0.15/_images/math/89ff7f73e231da14014c5c4355ff5ab3ba181fec.png and /dev/null differ diff --git a/0.15/_images/math/8a794bac91917159e451b8cfc65d3014cffcf45a.png b/0.15/_images/math/8a794bac91917159e451b8cfc65d3014cffcf45a.png deleted file mode 100644 index 3195a0edc340f..0000000000000 Binary files a/0.15/_images/math/8a794bac91917159e451b8cfc65d3014cffcf45a.png and /dev/null differ diff --git a/0.15/_images/math/8aaa0feea874e9e38e7a258cc59650b068dd257c.png b/0.15/_images/math/8aaa0feea874e9e38e7a258cc59650b068dd257c.png deleted file mode 100644 index 5f7d6c5040111..0000000000000 Binary files a/0.15/_images/math/8aaa0feea874e9e38e7a258cc59650b068dd257c.png and /dev/null differ diff --git a/0.15/_images/math/8ab6fd0263c1e67950fc82aacea0ec613e7d37ed.png b/0.15/_images/math/8ab6fd0263c1e67950fc82aacea0ec613e7d37ed.png deleted file mode 100644 index 6e0530536bda2..0000000000000 Binary files a/0.15/_images/math/8ab6fd0263c1e67950fc82aacea0ec613e7d37ed.png and /dev/null differ diff --git a/0.15/_images/math/8ac687edcd29efcd2489036b036bfe5f4f003527.png b/0.15/_images/math/8ac687edcd29efcd2489036b036bfe5f4f003527.png deleted file mode 100644 index 62bd7b83938f1..0000000000000 Binary files a/0.15/_images/math/8ac687edcd29efcd2489036b036bfe5f4f003527.png and /dev/null differ diff --git a/0.15/_images/math/8b0cbfdc640be5d9203f375b756bf873bc6b65e6.png b/0.15/_images/math/8b0cbfdc640be5d9203f375b756bf873bc6b65e6.png deleted file mode 100644 index 09aa3d11761b3..0000000000000 Binary files a/0.15/_images/math/8b0cbfdc640be5d9203f375b756bf873bc6b65e6.png and /dev/null differ diff --git a/0.15/_images/math/8b75b89abc229b96382c47277d6f475f634940d9.png b/0.15/_images/math/8b75b89abc229b96382c47277d6f475f634940d9.png deleted file mode 100644 index 8b440a26567a6..0000000000000 Binary files a/0.15/_images/math/8b75b89abc229b96382c47277d6f475f634940d9.png and /dev/null differ diff --git a/0.15/_images/math/8bd057dc66d00020cd35b77da7f8c9d7809c6eeb.png b/0.15/_images/math/8bd057dc66d00020cd35b77da7f8c9d7809c6eeb.png deleted file mode 100644 index 25eb4608174f0..0000000000000 Binary files a/0.15/_images/math/8bd057dc66d00020cd35b77da7f8c9d7809c6eeb.png and /dev/null differ diff --git a/0.15/_images/math/8bd0685e3bf9101859d24cf0e851651f182364c9.png b/0.15/_images/math/8bd0685e3bf9101859d24cf0e851651f182364c9.png deleted file mode 100644 index 1bc9b77b50b7b..0000000000000 Binary files a/0.15/_images/math/8bd0685e3bf9101859d24cf0e851651f182364c9.png and /dev/null differ diff --git a/0.15/_images/math/8bd3f4f4b38e127b70e57ee0d8a8f6c3f9a67560.png b/0.15/_images/math/8bd3f4f4b38e127b70e57ee0d8a8f6c3f9a67560.png deleted file mode 100644 index 0e2e300bc1eef..0000000000000 Binary files a/0.15/_images/math/8bd3f4f4b38e127b70e57ee0d8a8f6c3f9a67560.png and /dev/null differ diff --git a/0.15/_images/math/8c43465f3d8574113c7e15638bbf2fae35ee3896.png b/0.15/_images/math/8c43465f3d8574113c7e15638bbf2fae35ee3896.png deleted file mode 100644 index 3ec4f27cee92f..0000000000000 Binary files a/0.15/_images/math/8c43465f3d8574113c7e15638bbf2fae35ee3896.png and /dev/null differ diff --git a/0.15/_images/math/8c59c344ff9ba0a15e07b4bf3158a3b9d8123072.png b/0.15/_images/math/8c59c344ff9ba0a15e07b4bf3158a3b9d8123072.png deleted file mode 100644 index 16f46607b1b81..0000000000000 Binary files a/0.15/_images/math/8c59c344ff9ba0a15e07b4bf3158a3b9d8123072.png and /dev/null differ diff --git a/0.15/_images/math/8cc3251e688add3f0e6e7b349bdd82600c67ced7.png b/0.15/_images/math/8cc3251e688add3f0e6e7b349bdd82600c67ced7.png deleted file mode 100644 index ec6ee9448cd01..0000000000000 Binary files a/0.15/_images/math/8cc3251e688add3f0e6e7b349bdd82600c67ced7.png and /dev/null differ diff --git a/0.15/_images/math/8cd6937b04645af63fcf95a6a147ff833b150ace.png b/0.15/_images/math/8cd6937b04645af63fcf95a6a147ff833b150ace.png deleted file mode 100644 index 4830246b6e684..0000000000000 Binary files a/0.15/_images/math/8cd6937b04645af63fcf95a6a147ff833b150ace.png and /dev/null differ diff --git a/0.15/_images/math/8ce03f78ed945f2ef3dac87c8799b55b393527e7.png b/0.15/_images/math/8ce03f78ed945f2ef3dac87c8799b55b393527e7.png deleted file mode 100644 index 0d601b4e54811..0000000000000 Binary files a/0.15/_images/math/8ce03f78ed945f2ef3dac87c8799b55b393527e7.png and /dev/null differ diff --git a/0.15/_images/math/8dfdd5edae5a6b7ef2c77d131dfb3f8bc2ad87c6.png b/0.15/_images/math/8dfdd5edae5a6b7ef2c77d131dfb3f8bc2ad87c6.png deleted file mode 100644 index d492028deecd9..0000000000000 Binary files a/0.15/_images/math/8dfdd5edae5a6b7ef2c77d131dfb3f8bc2ad87c6.png and /dev/null differ diff --git a/0.15/_images/math/8ed7b101148182605feefc48fac92f577d32f6f2.png b/0.15/_images/math/8ed7b101148182605feefc48fac92f577d32f6f2.png deleted file mode 100644 index b8919f96b5fb4..0000000000000 Binary files a/0.15/_images/math/8ed7b101148182605feefc48fac92f577d32f6f2.png and /dev/null differ diff --git a/0.15/_images/math/8efaf51c35183f8aa1a1c4ccaefd5a49b9dbef8c.png b/0.15/_images/math/8efaf51c35183f8aa1a1c4ccaefd5a49b9dbef8c.png deleted file mode 100644 index b1d94bf36fa00..0000000000000 Binary files a/0.15/_images/math/8efaf51c35183f8aa1a1c4ccaefd5a49b9dbef8c.png and /dev/null differ diff --git a/0.15/_images/math/8f17a267c2ed49a6d7dafdf197471295f80335d2.png b/0.15/_images/math/8f17a267c2ed49a6d7dafdf197471295f80335d2.png deleted file mode 100644 index 7a978afb33add..0000000000000 Binary files a/0.15/_images/math/8f17a267c2ed49a6d7dafdf197471295f80335d2.png and /dev/null differ diff --git a/0.15/_images/math/900fb906739ae7262be75551c20a7da6940e953d.png b/0.15/_images/math/900fb906739ae7262be75551c20a7da6940e953d.png deleted file mode 100644 index 6d8b1b0b4f5ab..0000000000000 Binary files a/0.15/_images/math/900fb906739ae7262be75551c20a7da6940e953d.png and /dev/null differ diff --git a/0.15/_images/math/90669be6326baab71b695e16bd5df6e770317d81.png b/0.15/_images/math/90669be6326baab71b695e16bd5df6e770317d81.png deleted file mode 100644 index aedf7f71b2876..0000000000000 Binary files a/0.15/_images/math/90669be6326baab71b695e16bd5df6e770317d81.png and /dev/null differ diff --git a/0.15/_images/math/907f05ef53aaa4e8f4a9f2f06dd3c257f7bc9f5a.png b/0.15/_images/math/907f05ef53aaa4e8f4a9f2f06dd3c257f7bc9f5a.png deleted file mode 100644 index ca3f66c57d3c6..0000000000000 Binary files a/0.15/_images/math/907f05ef53aaa4e8f4a9f2f06dd3c257f7bc9f5a.png and /dev/null differ diff --git a/0.15/_images/math/90f2579482275c7df4d0be9364a32b8b735cb99d.png b/0.15/_images/math/90f2579482275c7df4d0be9364a32b8b735cb99d.png deleted file mode 100644 index 7cf473492fb04..0000000000000 Binary files a/0.15/_images/math/90f2579482275c7df4d0be9364a32b8b735cb99d.png and /dev/null differ diff --git a/0.15/_images/math/91269b5e38d627b1f586d3210c0fb20e902b06e5.png b/0.15/_images/math/91269b5e38d627b1f586d3210c0fb20e902b06e5.png deleted file mode 100644 index 38eb1e88e5418..0000000000000 Binary files a/0.15/_images/math/91269b5e38d627b1f586d3210c0fb20e902b06e5.png and /dev/null differ diff --git a/0.15/_images/math/9172efc523d7488d4c3ed299d0be813de01503b8.png b/0.15/_images/math/9172efc523d7488d4c3ed299d0be813de01503b8.png deleted file mode 100644 index e489780612780..0000000000000 Binary files a/0.15/_images/math/9172efc523d7488d4c3ed299d0be813de01503b8.png and /dev/null differ diff --git a/0.15/_images/math/9198560095f1f3bcb266f3b37a52ab65913a027e.png b/0.15/_images/math/9198560095f1f3bcb266f3b37a52ab65913a027e.png deleted file mode 100644 index 18f5e772f6ba5..0000000000000 Binary files a/0.15/_images/math/9198560095f1f3bcb266f3b37a52ab65913a027e.png and /dev/null differ diff --git a/0.15/_images/math/9198dc8dc8b75ef86d3a87ac1e1f07bdb681d0ac.png b/0.15/_images/math/9198dc8dc8b75ef86d3a87ac1e1f07bdb681d0ac.png deleted file mode 100644 index 0f32633e71ee7..0000000000000 Binary files a/0.15/_images/math/9198dc8dc8b75ef86d3a87ac1e1f07bdb681d0ac.png and /dev/null differ diff --git a/0.15/_images/math/91f4dc14c1f239812a1a3bcfa529692720ae8296.png b/0.15/_images/math/91f4dc14c1f239812a1a3bcfa529692720ae8296.png deleted file mode 100644 index 88a2271a98d91..0000000000000 Binary files a/0.15/_images/math/91f4dc14c1f239812a1a3bcfa529692720ae8296.png and /dev/null differ diff --git a/0.15/_images/math/92bc70f6f13ec15f8fb46a2100f7273dc8bdf993.png b/0.15/_images/math/92bc70f6f13ec15f8fb46a2100f7273dc8bdf993.png deleted file mode 100644 index 76c04aa0c4885..0000000000000 Binary files a/0.15/_images/math/92bc70f6f13ec15f8fb46a2100f7273dc8bdf993.png and /dev/null differ diff --git a/0.15/_images/math/92e92368f40b47a70de9e8c1990ed3a9bb3c8cd9.png b/0.15/_images/math/92e92368f40b47a70de9e8c1990ed3a9bb3c8cd9.png deleted file mode 100644 index c95d9aa850a95..0000000000000 Binary files a/0.15/_images/math/92e92368f40b47a70de9e8c1990ed3a9bb3c8cd9.png and /dev/null differ diff --git a/0.15/_images/math/934469f7305191f27184dffb1276b1e735050f7d.png b/0.15/_images/math/934469f7305191f27184dffb1276b1e735050f7d.png deleted file mode 100644 index 41a87f186fc09..0000000000000 Binary files a/0.15/_images/math/934469f7305191f27184dffb1276b1e735050f7d.png and /dev/null differ diff --git a/0.15/_images/math/93457a375ad774ed2e9a4d3e58e264e32f391f01.png b/0.15/_images/math/93457a375ad774ed2e9a4d3e58e264e32f391f01.png deleted file mode 100644 index 25c7b1594e2b2..0000000000000 Binary files a/0.15/_images/math/93457a375ad774ed2e9a4d3e58e264e32f391f01.png and /dev/null differ diff --git a/0.15/_images/math/93aa7f61c5ca120b643faa21a01cf5c504851f8c.png b/0.15/_images/math/93aa7f61c5ca120b643faa21a01cf5c504851f8c.png deleted file mode 100644 index fe7ed0bb506de..0000000000000 Binary files a/0.15/_images/math/93aa7f61c5ca120b643faa21a01cf5c504851f8c.png and /dev/null differ diff --git a/0.15/_images/math/93c29bfedc993de115781b4fbb7e3a8b9e8d6b51.png b/0.15/_images/math/93c29bfedc993de115781b4fbb7e3a8b9e8d6b51.png deleted file mode 100644 index 1b3b955746b26..0000000000000 Binary files a/0.15/_images/math/93c29bfedc993de115781b4fbb7e3a8b9e8d6b51.png and /dev/null differ diff --git a/0.15/_images/math/93c8c4826c6f7713528b0a263ab8b95d736366c6.png b/0.15/_images/math/93c8c4826c6f7713528b0a263ab8b95d736366c6.png deleted file mode 100644 index dcb1ebbf290cc..0000000000000 Binary files a/0.15/_images/math/93c8c4826c6f7713528b0a263ab8b95d736366c6.png and /dev/null differ diff --git a/0.15/_images/math/9409722cc2a6a7d686d6cd7011aabf9fea6197df.png b/0.15/_images/math/9409722cc2a6a7d686d6cd7011aabf9fea6197df.png deleted file mode 100644 index 09093ea082dcd..0000000000000 Binary files a/0.15/_images/math/9409722cc2a6a7d686d6cd7011aabf9fea6197df.png and /dev/null differ diff --git a/0.15/_images/math/94984f2ef131beb5a8c81144728e6858fd19573b.png b/0.15/_images/math/94984f2ef131beb5a8c81144728e6858fd19573b.png deleted file mode 100644 index b00402e8af7f5..0000000000000 Binary files a/0.15/_images/math/94984f2ef131beb5a8c81144728e6858fd19573b.png and /dev/null differ diff --git a/0.15/_images/math/949d33e11f3c86a73d4a5e620dfd1303a1a2cb33.png b/0.15/_images/math/949d33e11f3c86a73d4a5e620dfd1303a1a2cb33.png deleted file mode 100644 index fa9898fff5020..0000000000000 Binary files a/0.15/_images/math/949d33e11f3c86a73d4a5e620dfd1303a1a2cb33.png and /dev/null differ diff --git a/0.15/_images/math/9523e30d2c532ce5ce84b3c272f599e7c7b86953.png b/0.15/_images/math/9523e30d2c532ce5ce84b3c272f599e7c7b86953.png deleted file mode 100644 index 764edf911c0ed..0000000000000 Binary files a/0.15/_images/math/9523e30d2c532ce5ce84b3c272f599e7c7b86953.png and /dev/null differ diff --git a/0.15/_images/math/95247227810a3f2251f6560767129543ba6703d8.png b/0.15/_images/math/95247227810a3f2251f6560767129543ba6703d8.png deleted file mode 100644 index 2cd93caf84f34..0000000000000 Binary files a/0.15/_images/math/95247227810a3f2251f6560767129543ba6703d8.png and /dev/null differ diff --git a/0.15/_images/math/95ab6d5fe8ab264f7fdeb24242d837c278e509a6.png b/0.15/_images/math/95ab6d5fe8ab264f7fdeb24242d837c278e509a6.png deleted file mode 100644 index c6500712fc1f9..0000000000000 Binary files a/0.15/_images/math/95ab6d5fe8ab264f7fdeb24242d837c278e509a6.png and /dev/null differ diff --git a/0.15/_images/math/95ad620783283a00d6254ae9cf2a3ecdb3469e34.png b/0.15/_images/math/95ad620783283a00d6254ae9cf2a3ecdb3469e34.png deleted file mode 100644 index a1a7de0637674..0000000000000 Binary files a/0.15/_images/math/95ad620783283a00d6254ae9cf2a3ecdb3469e34.png and /dev/null differ diff --git a/0.15/_images/math/95d9d8c73551549b4dbdebf7e900f69909b2cda3.png b/0.15/_images/math/95d9d8c73551549b4dbdebf7e900f69909b2cda3.png deleted file mode 100644 index b423009152aaa..0000000000000 Binary files a/0.15/_images/math/95d9d8c73551549b4dbdebf7e900f69909b2cda3.png and /dev/null differ diff --git a/0.15/_images/math/96c49711bb53eae5b3697f1835b6eb50a9313fa8.png b/0.15/_images/math/96c49711bb53eae5b3697f1835b6eb50a9313fa8.png deleted file mode 100644 index bc9bfae86ecf9..0000000000000 Binary files a/0.15/_images/math/96c49711bb53eae5b3697f1835b6eb50a9313fa8.png and /dev/null differ diff --git a/0.15/_images/math/96fe247fe9465d26af15706141dc22e598ac7826.png b/0.15/_images/math/96fe247fe9465d26af15706141dc22e598ac7826.png deleted file mode 100644 index 1b279a588cf60..0000000000000 Binary files a/0.15/_images/math/96fe247fe9465d26af15706141dc22e598ac7826.png and /dev/null differ diff --git a/0.15/_images/math/970416fa31b015c6ef397ee8b7073af8ac18e534.png b/0.15/_images/math/970416fa31b015c6ef397ee8b7073af8ac18e534.png deleted file mode 100644 index bc577ce47d9c2..0000000000000 Binary files a/0.15/_images/math/970416fa31b015c6ef397ee8b7073af8ac18e534.png and /dev/null differ diff --git a/0.15/_images/math/971ec4565ce3998936bc77cf2f2900547f2f2d98.png b/0.15/_images/math/971ec4565ce3998936bc77cf2f2900547f2f2d98.png deleted file mode 100644 index 4b3ffa257e430..0000000000000 Binary files a/0.15/_images/math/971ec4565ce3998936bc77cf2f2900547f2f2d98.png and /dev/null differ diff --git a/0.15/_images/math/97b17ba426e816881f89900ee53da726840e79e7.png b/0.15/_images/math/97b17ba426e816881f89900ee53da726840e79e7.png deleted file mode 100644 index 939627ad59e14..0000000000000 Binary files a/0.15/_images/math/97b17ba426e816881f89900ee53da726840e79e7.png and /dev/null differ diff --git a/0.15/_images/math/984dfa7241b6cabdc9e84f69458e973887308820.png b/0.15/_images/math/984dfa7241b6cabdc9e84f69458e973887308820.png deleted file mode 100644 index b966101d6ca63..0000000000000 Binary files a/0.15/_images/math/984dfa7241b6cabdc9e84f69458e973887308820.png and /dev/null differ diff --git a/0.15/_images/math/98960fec06a81f158a2b33b6351e2e87c58861f1.png b/0.15/_images/math/98960fec06a81f158a2b33b6351e2e87c58861f1.png deleted file mode 100644 index 817531761f2b2..0000000000000 Binary files a/0.15/_images/math/98960fec06a81f158a2b33b6351e2e87c58861f1.png and /dev/null differ diff --git a/0.15/_images/math/98cdc3aed40cb93594dbaaf045ea3e1abbd8edcb.png b/0.15/_images/math/98cdc3aed40cb93594dbaaf045ea3e1abbd8edcb.png deleted file mode 100644 index 1bfbac001952f..0000000000000 Binary files a/0.15/_images/math/98cdc3aed40cb93594dbaaf045ea3e1abbd8edcb.png and /dev/null differ diff --git a/0.15/_images/math/9a43491764462185f82bac570ab9980a5a7ca43d.png b/0.15/_images/math/9a43491764462185f82bac570ab9980a5a7ca43d.png deleted file mode 100644 index fb084c3ce6aa7..0000000000000 Binary files a/0.15/_images/math/9a43491764462185f82bac570ab9980a5a7ca43d.png and /dev/null differ diff --git a/0.15/_images/math/9b0e255aaa25225287790f9c15eec0446653aae5.png b/0.15/_images/math/9b0e255aaa25225287790f9c15eec0446653aae5.png deleted file mode 100644 index 6561e2f6de23c..0000000000000 Binary files a/0.15/_images/math/9b0e255aaa25225287790f9c15eec0446653aae5.png and /dev/null differ diff --git a/0.15/_images/math/9c87339c285f85c875225faea7ee0af7107cf77b.png b/0.15/_images/math/9c87339c285f85c875225faea7ee0af7107cf77b.png deleted file mode 100644 index 72cb27755d7db..0000000000000 Binary files a/0.15/_images/math/9c87339c285f85c875225faea7ee0af7107cf77b.png and /dev/null differ diff --git a/0.15/_images/math/9caff62110bfd747fca36fe5211602f7a81d2384.png b/0.15/_images/math/9caff62110bfd747fca36fe5211602f7a81d2384.png deleted file mode 100644 index 0331dc4fc65f0..0000000000000 Binary files a/0.15/_images/math/9caff62110bfd747fca36fe5211602f7a81d2384.png and /dev/null differ diff --git a/0.15/_images/math/9cbd32f62028fc2ffd7c49bf2436bc04d5211b1c.png b/0.15/_images/math/9cbd32f62028fc2ffd7c49bf2436bc04d5211b1c.png deleted file mode 100644 index 58ed0f167a11a..0000000000000 Binary files a/0.15/_images/math/9cbd32f62028fc2ffd7c49bf2436bc04d5211b1c.png and /dev/null differ diff --git a/0.15/_images/math/9d35315304282a8e3aecf0ddd0425b046af4fef7.png b/0.15/_images/math/9d35315304282a8e3aecf0ddd0425b046af4fef7.png deleted file mode 100644 index dfa550bf13fa9..0000000000000 Binary files a/0.15/_images/math/9d35315304282a8e3aecf0ddd0425b046af4fef7.png and /dev/null differ diff --git a/0.15/_images/math/9d759be8e66ed0a164c0a65eb31389b7abf6de49.png b/0.15/_images/math/9d759be8e66ed0a164c0a65eb31389b7abf6de49.png deleted file mode 100644 index f21635d011705..0000000000000 Binary files a/0.15/_images/math/9d759be8e66ed0a164c0a65eb31389b7abf6de49.png and /dev/null differ diff --git a/0.15/_images/math/9d86170e7de539c0ff999de09621ee0c7b6c8ed0.png b/0.15/_images/math/9d86170e7de539c0ff999de09621ee0c7b6c8ed0.png deleted file mode 100644 index da3630fbdec0b..0000000000000 Binary files a/0.15/_images/math/9d86170e7de539c0ff999de09621ee0c7b6c8ed0.png and /dev/null differ diff --git a/0.15/_images/math/9dbb4af1af56391f18aa7463719c2a5173920eb4.png b/0.15/_images/math/9dbb4af1af56391f18aa7463719c2a5173920eb4.png deleted file mode 100644 index 36990e422d54d..0000000000000 Binary files a/0.15/_images/math/9dbb4af1af56391f18aa7463719c2a5173920eb4.png and /dev/null differ diff --git a/0.15/_images/math/9dcd00d73a520a96fcccfa317471aab11d8b1ce7.png b/0.15/_images/math/9dcd00d73a520a96fcccfa317471aab11d8b1ce7.png deleted file mode 100644 index d9e2bccd0a2d1..0000000000000 Binary files a/0.15/_images/math/9dcd00d73a520a96fcccfa317471aab11d8b1ce7.png and /dev/null differ diff --git a/0.15/_images/math/9dfa31437b58c0473299320aa638151cd88cf61b.png b/0.15/_images/math/9dfa31437b58c0473299320aa638151cd88cf61b.png deleted file mode 100644 index c46bd5fc9c5cc..0000000000000 Binary files a/0.15/_images/math/9dfa31437b58c0473299320aa638151cd88cf61b.png and /dev/null differ diff --git a/0.15/_images/math/9e6226cf29fbc353fca744defafbe44fee8db62b.png b/0.15/_images/math/9e6226cf29fbc353fca744defafbe44fee8db62b.png deleted file mode 100644 index 3352cf7a2cb19..0000000000000 Binary files a/0.15/_images/math/9e6226cf29fbc353fca744defafbe44fee8db62b.png and /dev/null differ diff --git a/0.15/_images/math/9e63a29c9ced920f6aae821ab3e29e01675f2f12.png b/0.15/_images/math/9e63a29c9ced920f6aae821ab3e29e01675f2f12.png deleted file mode 100644 index 8091e54c45e83..0000000000000 Binary files a/0.15/_images/math/9e63a29c9ced920f6aae821ab3e29e01675f2f12.png and /dev/null differ diff --git a/0.15/_images/math/9f6c60055c315ac425554bb304f775812a0710b9.png b/0.15/_images/math/9f6c60055c315ac425554bb304f775812a0710b9.png deleted file mode 100644 index ec9ef4dd1f4b1..0000000000000 Binary files a/0.15/_images/math/9f6c60055c315ac425554bb304f775812a0710b9.png and /dev/null differ diff --git a/0.15/_images/math/a00fe53bef8884ef1e4612c48f7fb3f6f6134b73.png b/0.15/_images/math/a00fe53bef8884ef1e4612c48f7fb3f6f6134b73.png deleted file mode 100644 index 05d5d14395886..0000000000000 Binary files a/0.15/_images/math/a00fe53bef8884ef1e4612c48f7fb3f6f6134b73.png and /dev/null differ diff --git a/0.15/_images/math/a058f7fd60c9f0b5be678d2de8bef4c2587d93b4.png b/0.15/_images/math/a058f7fd60c9f0b5be678d2de8bef4c2587d93b4.png deleted file mode 100644 index f40f1f5bd68aa..0000000000000 Binary files a/0.15/_images/math/a058f7fd60c9f0b5be678d2de8bef4c2587d93b4.png and /dev/null differ diff --git a/0.15/_images/math/a0911f10b2c581d0e1ef3237c082e1ca9a773b7c.png b/0.15/_images/math/a0911f10b2c581d0e1ef3237c082e1ca9a773b7c.png deleted file mode 100644 index 25c224450674e..0000000000000 Binary files a/0.15/_images/math/a0911f10b2c581d0e1ef3237c082e1ca9a773b7c.png and /dev/null differ diff --git a/0.15/_images/math/a1658cc847336e3efa70e0601d507a3f78cbefe8.png b/0.15/_images/math/a1658cc847336e3efa70e0601d507a3f78cbefe8.png deleted file mode 100644 index bca0574ca48b4..0000000000000 Binary files a/0.15/_images/math/a1658cc847336e3efa70e0601d507a3f78cbefe8.png and /dev/null differ diff --git a/0.15/_images/math/a16847a5124181d9b7752831345def32c7688718.png b/0.15/_images/math/a16847a5124181d9b7752831345def32c7688718.png deleted file mode 100644 index 281337a1158c8..0000000000000 Binary files a/0.15/_images/math/a16847a5124181d9b7752831345def32c7688718.png and /dev/null differ diff --git a/0.15/_images/math/a1b925a4dbbe65450fbebb81572f6222a434b9a0.png b/0.15/_images/math/a1b925a4dbbe65450fbebb81572f6222a434b9a0.png deleted file mode 100644 index 0f55d5907c0dd..0000000000000 Binary files a/0.15/_images/math/a1b925a4dbbe65450fbebb81572f6222a434b9a0.png and /dev/null differ diff --git a/0.15/_images/math/a1e3128960061808219116bfa141011127c8a202.png b/0.15/_images/math/a1e3128960061808219116bfa141011127c8a202.png deleted file mode 100644 index 2e55860b20672..0000000000000 Binary files a/0.15/_images/math/a1e3128960061808219116bfa141011127c8a202.png and /dev/null differ diff --git a/0.15/_images/math/a241b8a2a46eba6b61dc691ce26ae8372a62b861.png b/0.15/_images/math/a241b8a2a46eba6b61dc691ce26ae8372a62b861.png deleted file mode 100644 index 18c74a1d1e051..0000000000000 Binary files a/0.15/_images/math/a241b8a2a46eba6b61dc691ce26ae8372a62b861.png and /dev/null differ diff --git a/0.15/_images/math/a2a14027d15c1d9800a6f2dca234ee5a8c758c54.png b/0.15/_images/math/a2a14027d15c1d9800a6f2dca234ee5a8c758c54.png deleted file mode 100644 index 805bd0970a6a4..0000000000000 Binary files a/0.15/_images/math/a2a14027d15c1d9800a6f2dca234ee5a8c758c54.png and /dev/null differ diff --git a/0.15/_images/math/a30d171210b238748decce5260c2d9d980b14003.png b/0.15/_images/math/a30d171210b238748decce5260c2d9d980b14003.png deleted file mode 100644 index 2c51aeaff470a..0000000000000 Binary files a/0.15/_images/math/a30d171210b238748decce5260c2d9d980b14003.png and /dev/null differ diff --git a/0.15/_images/math/a31baaf9fe13c9b90c5a8091bcd00e981cd8a49f.png b/0.15/_images/math/a31baaf9fe13c9b90c5a8091bcd00e981cd8a49f.png deleted file mode 100644 index 80b7480d14767..0000000000000 Binary files a/0.15/_images/math/a31baaf9fe13c9b90c5a8091bcd00e981cd8a49f.png and /dev/null differ diff --git a/0.15/_images/math/a31e290885e74a51fa7f4d3e382e257a552587c8.png b/0.15/_images/math/a31e290885e74a51fa7f4d3e382e257a552587c8.png deleted file mode 100644 index 8bdffed85229e..0000000000000 Binary files a/0.15/_images/math/a31e290885e74a51fa7f4d3e382e257a552587c8.png and /dev/null differ diff --git a/0.15/_images/math/a332e4cd622b193f2bc6e6e3edcecd7c3ddb749a.png b/0.15/_images/math/a332e4cd622b193f2bc6e6e3edcecd7c3ddb749a.png deleted file mode 100644 index 573b507e294de..0000000000000 Binary files a/0.15/_images/math/a332e4cd622b193f2bc6e6e3edcecd7c3ddb749a.png and /dev/null differ diff --git a/0.15/_images/math/a341a320988701b208f1196fad52933d0e607cf3.png b/0.15/_images/math/a341a320988701b208f1196fad52933d0e607cf3.png deleted file mode 100644 index 491a0afbb6e59..0000000000000 Binary files a/0.15/_images/math/a341a320988701b208f1196fad52933d0e607cf3.png and /dev/null differ diff --git a/0.15/_images/math/a3723c8c34eb2d8596b820f622d120ba0bc06d21.png b/0.15/_images/math/a3723c8c34eb2d8596b820f622d120ba0bc06d21.png deleted file mode 100644 index f559eb51ec4d0..0000000000000 Binary files a/0.15/_images/math/a3723c8c34eb2d8596b820f622d120ba0bc06d21.png and /dev/null differ diff --git a/0.15/_images/math/a4564c53a065f88d31b097b1b15a2db01e72bfd5.png b/0.15/_images/math/a4564c53a065f88d31b097b1b15a2db01e72bfd5.png deleted file mode 100644 index c444916534a25..0000000000000 Binary files a/0.15/_images/math/a4564c53a065f88d31b097b1b15a2db01e72bfd5.png and /dev/null differ diff --git a/0.15/_images/math/a581f053bbfa5115f42c13094857cdd12a37ec49.png b/0.15/_images/math/a581f053bbfa5115f42c13094857cdd12a37ec49.png deleted file mode 100644 index 08a70647802d6..0000000000000 Binary files a/0.15/_images/math/a581f053bbfa5115f42c13094857cdd12a37ec49.png and /dev/null differ diff --git a/0.15/_images/math/a5d4acd46eac5a9653d37ccf95f57497a20322c5.png b/0.15/_images/math/a5d4acd46eac5a9653d37ccf95f57497a20322c5.png deleted file mode 100644 index 28259ebbd2c5f..0000000000000 Binary files a/0.15/_images/math/a5d4acd46eac5a9653d37ccf95f57497a20322c5.png and /dev/null differ diff --git a/0.15/_images/math/a645d3806f9b2ede11f714ac9fd34fd142bb30d8.png b/0.15/_images/math/a645d3806f9b2ede11f714ac9fd34fd142bb30d8.png deleted file mode 100644 index 5ee927a1b950b..0000000000000 Binary files a/0.15/_images/math/a645d3806f9b2ede11f714ac9fd34fd142bb30d8.png and /dev/null differ diff --git a/0.15/_images/math/a684a4a28d9d3b9c31da95fe0408c235c1e1961f.png b/0.15/_images/math/a684a4a28d9d3b9c31da95fe0408c235c1e1961f.png deleted file mode 100644 index 5a123d8dffbaa..0000000000000 Binary files a/0.15/_images/math/a684a4a28d9d3b9c31da95fe0408c235c1e1961f.png and /dev/null differ diff --git a/0.15/_images/math/a6c82f4798ded3445ff7923a021649b5133cc5b3.png b/0.15/_images/math/a6c82f4798ded3445ff7923a021649b5133cc5b3.png deleted file mode 100644 index 0594a57dffcad..0000000000000 Binary files a/0.15/_images/math/a6c82f4798ded3445ff7923a021649b5133cc5b3.png and /dev/null differ diff --git a/0.15/_images/math/a7ae2dd6cbafb069b9d6e59bd4f598b4f808bc77.png b/0.15/_images/math/a7ae2dd6cbafb069b9d6e59bd4f598b4f808bc77.png deleted file mode 100644 index 265d093eda81b..0000000000000 Binary files a/0.15/_images/math/a7ae2dd6cbafb069b9d6e59bd4f598b4f808bc77.png and /dev/null differ diff --git a/0.15/_images/math/a8211bc2dab4ab052a0ebe1ef9065fadcdedee1c.png b/0.15/_images/math/a8211bc2dab4ab052a0ebe1ef9065fadcdedee1c.png deleted file mode 100644 index 09f6b62307616..0000000000000 Binary files a/0.15/_images/math/a8211bc2dab4ab052a0ebe1ef9065fadcdedee1c.png and /dev/null differ diff --git a/0.15/_images/math/a906029eb7b8918858b4d8262c430f3d59b748e7.png b/0.15/_images/math/a906029eb7b8918858b4d8262c430f3d59b748e7.png deleted file mode 100644 index e20b3e6070a74..0000000000000 Binary files a/0.15/_images/math/a906029eb7b8918858b4d8262c430f3d59b748e7.png and /dev/null differ diff --git a/0.15/_images/math/a93196c3d7dc949166a2193a44426878754eaa31.png b/0.15/_images/math/a93196c3d7dc949166a2193a44426878754eaa31.png deleted file mode 100644 index f2dbb7662b888..0000000000000 Binary files a/0.15/_images/math/a93196c3d7dc949166a2193a44426878754eaa31.png and /dev/null differ diff --git a/0.15/_images/math/a9506247789928f7bdc2019910aa61bb177ff7ea.png b/0.15/_images/math/a9506247789928f7bdc2019910aa61bb177ff7ea.png deleted file mode 100644 index 1d510209ea3d3..0000000000000 Binary files a/0.15/_images/math/a9506247789928f7bdc2019910aa61bb177ff7ea.png and /dev/null differ diff --git a/0.15/_images/math/a9cfbeb8ebee1f365919e147a79e242dcb67ee5d.png b/0.15/_images/math/a9cfbeb8ebee1f365919e147a79e242dcb67ee5d.png deleted file mode 100644 index bc0de6a2df22b..0000000000000 Binary files a/0.15/_images/math/a9cfbeb8ebee1f365919e147a79e242dcb67ee5d.png and /dev/null differ diff --git a/0.15/_images/math/aa3d3ca3b6fb90c3c1e09992631c35e7f17c92e8.png b/0.15/_images/math/aa3d3ca3b6fb90c3c1e09992631c35e7f17c92e8.png deleted file mode 100644 index 92a65d6d5d2e8..0000000000000 Binary files a/0.15/_images/math/aa3d3ca3b6fb90c3c1e09992631c35e7f17c92e8.png and /dev/null differ diff --git a/0.15/_images/math/aa59228cc55fc5e2d52dc1909bfa1054b4d0d9f7.png b/0.15/_images/math/aa59228cc55fc5e2d52dc1909bfa1054b4d0d9f7.png deleted file mode 100644 index c2285208166eb..0000000000000 Binary files a/0.15/_images/math/aa59228cc55fc5e2d52dc1909bfa1054b4d0d9f7.png and /dev/null differ diff --git a/0.15/_images/math/aafc9fcef30f90e72603bb05bc157411e1c3c9c9.png b/0.15/_images/math/aafc9fcef30f90e72603bb05bc157411e1c3c9c9.png deleted file mode 100644 index b413003bef547..0000000000000 Binary files a/0.15/_images/math/aafc9fcef30f90e72603bb05bc157411e1c3c9c9.png and /dev/null differ diff --git a/0.15/_images/math/ab388f28b5239d428e1d905d42b2f60f74deaaae.png b/0.15/_images/math/ab388f28b5239d428e1d905d42b2f60f74deaaae.png deleted file mode 100644 index 52c306f1460c4..0000000000000 Binary files a/0.15/_images/math/ab388f28b5239d428e1d905d42b2f60f74deaaae.png and /dev/null differ diff --git a/0.15/_images/math/ad59b6e24a4a00ac621801f8d7513d68be654ab5.png b/0.15/_images/math/ad59b6e24a4a00ac621801f8d7513d68be654ab5.png deleted file mode 100644 index ff0a49a244d3f..0000000000000 Binary files a/0.15/_images/math/ad59b6e24a4a00ac621801f8d7513d68be654ab5.png and /dev/null differ diff --git a/0.15/_images/math/ae16e9774b173bfa6489c04d4d7b581ff31a55a5.png b/0.15/_images/math/ae16e9774b173bfa6489c04d4d7b581ff31a55a5.png deleted file mode 100644 index 55535b2c1b3ce..0000000000000 Binary files a/0.15/_images/math/ae16e9774b173bfa6489c04d4d7b581ff31a55a5.png and /dev/null differ diff --git a/0.15/_images/math/aed2154669d76a3bcac8c586953607331f0e7c59.png b/0.15/_images/math/aed2154669d76a3bcac8c586953607331f0e7c59.png deleted file mode 100644 index 04ae376fe001f..0000000000000 Binary files a/0.15/_images/math/aed2154669d76a3bcac8c586953607331f0e7c59.png and /dev/null differ diff --git a/0.15/_images/math/aee98367dcd43a9677b3447ee9c5853812db77f8.png b/0.15/_images/math/aee98367dcd43a9677b3447ee9c5853812db77f8.png deleted file mode 100644 index 5d82412b17784..0000000000000 Binary files a/0.15/_images/math/aee98367dcd43a9677b3447ee9c5853812db77f8.png and /dev/null differ diff --git a/0.15/_images/math/aff99fd5805e4be25fcb57c9a2667f8337206a66.png b/0.15/_images/math/aff99fd5805e4be25fcb57c9a2667f8337206a66.png deleted file mode 100644 index 44d9c6da215c3..0000000000000 Binary files a/0.15/_images/math/aff99fd5805e4be25fcb57c9a2667f8337206a66.png and /dev/null differ diff --git a/0.15/_images/math/b018f9153661cd702305aecc28713fd9705e7cb3.png b/0.15/_images/math/b018f9153661cd702305aecc28713fd9705e7cb3.png deleted file mode 100644 index aea31be9cfd93..0000000000000 Binary files a/0.15/_images/math/b018f9153661cd702305aecc28713fd9705e7cb3.png and /dev/null differ diff --git a/0.15/_images/math/b071ffb2ad3393f2755dfcb1741d4c138ed87532.png b/0.15/_images/math/b071ffb2ad3393f2755dfcb1741d4c138ed87532.png deleted file mode 100644 index dfafc8686499d..0000000000000 Binary files a/0.15/_images/math/b071ffb2ad3393f2755dfcb1741d4c138ed87532.png and /dev/null differ diff --git a/0.15/_images/math/b0997a6b918f5f8fc9a3615f1c8cb2d514a09296.png b/0.15/_images/math/b0997a6b918f5f8fc9a3615f1c8cb2d514a09296.png deleted file mode 100644 index 0f4ecc09ab2d2..0000000000000 Binary files a/0.15/_images/math/b0997a6b918f5f8fc9a3615f1c8cb2d514a09296.png and /dev/null differ diff --git a/0.15/_images/math/b0baabc767a659b7f59f2d65ba14cbeff17d9d6b.png b/0.15/_images/math/b0baabc767a659b7f59f2d65ba14cbeff17d9d6b.png deleted file mode 100644 index 6fad54185c5f8..0000000000000 Binary files a/0.15/_images/math/b0baabc767a659b7f59f2d65ba14cbeff17d9d6b.png and /dev/null differ diff --git a/0.15/_images/math/b0c860d08d30011cba6f6a97b98b32b8d747e51a.png b/0.15/_images/math/b0c860d08d30011cba6f6a97b98b32b8d747e51a.png deleted file mode 100644 index f48ce418a9b2d..0000000000000 Binary files a/0.15/_images/math/b0c860d08d30011cba6f6a97b98b32b8d747e51a.png and /dev/null differ diff --git a/0.15/_images/math/b124ff74afb0914bb434e8fb849eb56d734412f8.png b/0.15/_images/math/b124ff74afb0914bb434e8fb849eb56d734412f8.png deleted file mode 100644 index 07ce5a02c4f68..0000000000000 Binary files a/0.15/_images/math/b124ff74afb0914bb434e8fb849eb56d734412f8.png and /dev/null differ diff --git a/0.15/_images/math/b141ee17d93799d1b44c7ba206a859af1a21ba2e.png b/0.15/_images/math/b141ee17d93799d1b44c7ba206a859af1a21ba2e.png deleted file mode 100644 index 46ff40aa6c31f..0000000000000 Binary files a/0.15/_images/math/b141ee17d93799d1b44c7ba206a859af1a21ba2e.png and /dev/null differ diff --git a/0.15/_images/math/b151bd661258307a578723e769366bbe27f4d43e.png b/0.15/_images/math/b151bd661258307a578723e769366bbe27f4d43e.png deleted file mode 100644 index 20d5d96b50c97..0000000000000 Binary files a/0.15/_images/math/b151bd661258307a578723e769366bbe27f4d43e.png and /dev/null differ diff --git a/0.15/_images/math/b1e15f42370b4dc4c04adc704aa520e0fe45dea8.png b/0.15/_images/math/b1e15f42370b4dc4c04adc704aa520e0fe45dea8.png deleted file mode 100644 index 8ccaa0ae457d8..0000000000000 Binary files a/0.15/_images/math/b1e15f42370b4dc4c04adc704aa520e0fe45dea8.png and /dev/null differ diff --git a/0.15/_images/math/b2c9abe9dcb37c7fe576baebfcc34f1dc74d4dde.png b/0.15/_images/math/b2c9abe9dcb37c7fe576baebfcc34f1dc74d4dde.png deleted file mode 100644 index ee849942b61fe..0000000000000 Binary files a/0.15/_images/math/b2c9abe9dcb37c7fe576baebfcc34f1dc74d4dde.png and /dev/null differ diff --git a/0.15/_images/math/b2e267f8737a7dc04a95656aa5ffff5779b29de1.png b/0.15/_images/math/b2e267f8737a7dc04a95656aa5ffff5779b29de1.png deleted file mode 100644 index a49dcc9c63505..0000000000000 Binary files a/0.15/_images/math/b2e267f8737a7dc04a95656aa5ffff5779b29de1.png and /dev/null differ diff --git a/0.15/_images/math/b2e39c709bfa3fb0acea6a80914b706af361ad9a.png b/0.15/_images/math/b2e39c709bfa3fb0acea6a80914b706af361ad9a.png deleted file mode 100644 index da1b63d3e48aa..0000000000000 Binary files a/0.15/_images/math/b2e39c709bfa3fb0acea6a80914b706af361ad9a.png and /dev/null differ diff --git a/0.15/_images/math/b31b1ea8e4fe3f618dedfb0e2d8c69a3df7a391d.png b/0.15/_images/math/b31b1ea8e4fe3f618dedfb0e2d8c69a3df7a391d.png deleted file mode 100644 index eab13cbbef967..0000000000000 Binary files a/0.15/_images/math/b31b1ea8e4fe3f618dedfb0e2d8c69a3df7a391d.png and /dev/null differ diff --git a/0.15/_images/math/b39932b8cbb311eeee9815738f6be3757737b2ff.png b/0.15/_images/math/b39932b8cbb311eeee9815738f6be3757737b2ff.png deleted file mode 100644 index 112fa3fcf54b1..0000000000000 Binary files a/0.15/_images/math/b39932b8cbb311eeee9815738f6be3757737b2ff.png and /dev/null differ diff --git a/0.15/_images/math/b43ce5c3516d9440304d43ff76d96e2f227d047c.png b/0.15/_images/math/b43ce5c3516d9440304d43ff76d96e2f227d047c.png deleted file mode 100644 index 7f17edbd8c338..0000000000000 Binary files a/0.15/_images/math/b43ce5c3516d9440304d43ff76d96e2f227d047c.png and /dev/null differ diff --git a/0.15/_images/math/b456cfa6720d47f9429abe61ef7d0e4e91620b14.png b/0.15/_images/math/b456cfa6720d47f9429abe61ef7d0e4e91620b14.png deleted file mode 100644 index 3752e76df41c5..0000000000000 Binary files a/0.15/_images/math/b456cfa6720d47f9429abe61ef7d0e4e91620b14.png and /dev/null differ diff --git a/0.15/_images/math/b4c7849c2229e1474631db1284afd7a3cbf97982.png b/0.15/_images/math/b4c7849c2229e1474631db1284afd7a3cbf97982.png deleted file mode 100644 index 8198f0ab2128d..0000000000000 Binary files a/0.15/_images/math/b4c7849c2229e1474631db1284afd7a3cbf97982.png and /dev/null differ diff --git a/0.15/_images/math/b4e1bc8e2dfd2c26158273aef285b08a816f960a.png b/0.15/_images/math/b4e1bc8e2dfd2c26158273aef285b08a816f960a.png deleted file mode 100644 index 726acf9248f64..0000000000000 Binary files a/0.15/_images/math/b4e1bc8e2dfd2c26158273aef285b08a816f960a.png and /dev/null differ diff --git a/0.15/_images/math/b5c431d1ae18b076ecc008f3084eb2b02591b5e9.png b/0.15/_images/math/b5c431d1ae18b076ecc008f3084eb2b02591b5e9.png deleted file mode 100644 index 45a9654fc909f..0000000000000 Binary files a/0.15/_images/math/b5c431d1ae18b076ecc008f3084eb2b02591b5e9.png and /dev/null differ diff --git a/0.15/_images/math/b6183c8fb10498f949131f2aa67eeb1256cdc68a.png b/0.15/_images/math/b6183c8fb10498f949131f2aa67eeb1256cdc68a.png deleted file mode 100644 index 3379231f6f772..0000000000000 Binary files a/0.15/_images/math/b6183c8fb10498f949131f2aa67eeb1256cdc68a.png and /dev/null differ diff --git a/0.15/_images/math/b654eee1dcbceb1e8500e575796fbfea6f5518bb.png b/0.15/_images/math/b654eee1dcbceb1e8500e575796fbfea6f5518bb.png deleted file mode 100644 index 31670d7ddf039..0000000000000 Binary files a/0.15/_images/math/b654eee1dcbceb1e8500e575796fbfea6f5518bb.png and /dev/null differ diff --git a/0.15/_images/math/b7804eb491eb62b008f5f5d8889c82d7a383d3d8.png b/0.15/_images/math/b7804eb491eb62b008f5f5d8889c82d7a383d3d8.png deleted file mode 100644 index ef8af1d4304cf..0000000000000 Binary files a/0.15/_images/math/b7804eb491eb62b008f5f5d8889c82d7a383d3d8.png and /dev/null differ diff --git a/0.15/_images/math/b808030270971971d42ec8e62398634b513667c3.png b/0.15/_images/math/b808030270971971d42ec8e62398634b513667c3.png deleted file mode 100644 index 0e07c9591c364..0000000000000 Binary files a/0.15/_images/math/b808030270971971d42ec8e62398634b513667c3.png and /dev/null differ diff --git a/0.15/_images/math/b8b7b5e99e95c584ec8d88d0bcf69748bfe4554a.png b/0.15/_images/math/b8b7b5e99e95c584ec8d88d0bcf69748bfe4554a.png deleted file mode 100644 index b96441c9e1580..0000000000000 Binary files a/0.15/_images/math/b8b7b5e99e95c584ec8d88d0bcf69748bfe4554a.png and /dev/null differ diff --git a/0.15/_images/math/b8ce75ac275fbe7a9cc88f535e164ba2397d3a85.png b/0.15/_images/math/b8ce75ac275fbe7a9cc88f535e164ba2397d3a85.png deleted file mode 100644 index 9073daf4740fa..0000000000000 Binary files a/0.15/_images/math/b8ce75ac275fbe7a9cc88f535e164ba2397d3a85.png and /dev/null differ diff --git a/0.15/_images/math/b926c4c22838402b5d2fb45a6b4acc024adf44ee.png b/0.15/_images/math/b926c4c22838402b5d2fb45a6b4acc024adf44ee.png deleted file mode 100644 index 184ce28016224..0000000000000 Binary files a/0.15/_images/math/b926c4c22838402b5d2fb45a6b4acc024adf44ee.png and /dev/null differ diff --git a/0.15/_images/math/b92c09a649305a0aef3239729d93cdf941e0e5cf.png b/0.15/_images/math/b92c09a649305a0aef3239729d93cdf941e0e5cf.png deleted file mode 100644 index 658d44102acee..0000000000000 Binary files a/0.15/_images/math/b92c09a649305a0aef3239729d93cdf941e0e5cf.png and /dev/null differ diff --git a/0.15/_images/math/b976f412fc0dadd1d15a1f865e4fea9278b4058a.png b/0.15/_images/math/b976f412fc0dadd1d15a1f865e4fea9278b4058a.png deleted file mode 100644 index 07a0525f47e43..0000000000000 Binary files a/0.15/_images/math/b976f412fc0dadd1d15a1f865e4fea9278b4058a.png and /dev/null differ diff --git a/0.15/_images/math/baa709da88ecdd56290056e3c38fabe588997875.png b/0.15/_images/math/baa709da88ecdd56290056e3c38fabe588997875.png deleted file mode 100644 index 5202265e83c9b..0000000000000 Binary files a/0.15/_images/math/baa709da88ecdd56290056e3c38fabe588997875.png and /dev/null differ diff --git a/0.15/_images/math/bacdaf2f979238c05ec1690cd4777be7056b07d7.png b/0.15/_images/math/bacdaf2f979238c05ec1690cd4777be7056b07d7.png deleted file mode 100644 index b348ad26ec3c8..0000000000000 Binary files a/0.15/_images/math/bacdaf2f979238c05ec1690cd4777be7056b07d7.png and /dev/null differ diff --git a/0.15/_images/math/bb1961efcad95a40ed49cc64a9b9ca681e06720a.png b/0.15/_images/math/bb1961efcad95a40ed49cc64a9b9ca681e06720a.png deleted file mode 100644 index c2dc8069179f7..0000000000000 Binary files a/0.15/_images/math/bb1961efcad95a40ed49cc64a9b9ca681e06720a.png and /dev/null differ diff --git a/0.15/_images/math/bb280b0cec96f69df3ad1c8befd46a0a95e843ac.png b/0.15/_images/math/bb280b0cec96f69df3ad1c8befd46a0a95e843ac.png deleted file mode 100644 index ba3eae3537da8..0000000000000 Binary files a/0.15/_images/math/bb280b0cec96f69df3ad1c8befd46a0a95e843ac.png and /dev/null differ diff --git a/0.15/_images/math/bcc380de2952077d4d650c00bf936484d23bb854.png b/0.15/_images/math/bcc380de2952077d4d650c00bf936484d23bb854.png deleted file mode 100644 index 5eedca549c1da..0000000000000 Binary files a/0.15/_images/math/bcc380de2952077d4d650c00bf936484d23bb854.png and /dev/null differ diff --git a/0.15/_images/math/bd57e55d2d30899c92d7ecbce6b8434274c10f9c.png b/0.15/_images/math/bd57e55d2d30899c92d7ecbce6b8434274c10f9c.png deleted file mode 100644 index 8de78186b083f..0000000000000 Binary files a/0.15/_images/math/bd57e55d2d30899c92d7ecbce6b8434274c10f9c.png and /dev/null differ diff --git a/0.15/_images/math/bd92becc4053aee90a86f9e9fcef56900578d7b4.png b/0.15/_images/math/bd92becc4053aee90a86f9e9fcef56900578d7b4.png deleted file mode 100644 index a11e2316ba783..0000000000000 Binary files a/0.15/_images/math/bd92becc4053aee90a86f9e9fcef56900578d7b4.png and /dev/null differ diff --git a/0.15/_images/math/bd97e9ef746c640b7f0161994e85c8268d44d523.png b/0.15/_images/math/bd97e9ef746c640b7f0161994e85c8268d44d523.png deleted file mode 100644 index a50c1feed3d70..0000000000000 Binary files a/0.15/_images/math/bd97e9ef746c640b7f0161994e85c8268d44d523.png and /dev/null differ diff --git a/0.15/_images/math/be320c6c188b9e67dff4244e742aa9f5d56be255.png b/0.15/_images/math/be320c6c188b9e67dff4244e742aa9f5d56be255.png deleted file mode 100644 index 1db240aa6c264..0000000000000 Binary files a/0.15/_images/math/be320c6c188b9e67dff4244e742aa9f5d56be255.png and /dev/null differ diff --git a/0.15/_images/math/be3af7176ad2ca37f3a410143de52cb9cd626423.png b/0.15/_images/math/be3af7176ad2ca37f3a410143de52cb9cd626423.png deleted file mode 100644 index 7e6f5d604e31c..0000000000000 Binary files a/0.15/_images/math/be3af7176ad2ca37f3a410143de52cb9cd626423.png and /dev/null differ diff --git a/0.15/_images/math/be3d951d311311b8ef38c7362db122debcb9fa88.png b/0.15/_images/math/be3d951d311311b8ef38c7362db122debcb9fa88.png deleted file mode 100644 index 50f4b2e72f725..0000000000000 Binary files a/0.15/_images/math/be3d951d311311b8ef38c7362db122debcb9fa88.png and /dev/null differ diff --git a/0.15/_images/math/be86b90721dc7d39d2f4479c4f7094d1a416002b.png b/0.15/_images/math/be86b90721dc7d39d2f4479c4f7094d1a416002b.png deleted file mode 100644 index 9ca622225915f..0000000000000 Binary files a/0.15/_images/math/be86b90721dc7d39d2f4479c4f7094d1a416002b.png and /dev/null differ diff --git a/0.15/_images/math/c00101721e617799d0a33df0fc692cabc456044e.png b/0.15/_images/math/c00101721e617799d0a33df0fc692cabc456044e.png deleted file mode 100644 index d107ecd994343..0000000000000 Binary files a/0.15/_images/math/c00101721e617799d0a33df0fc692cabc456044e.png and /dev/null differ diff --git a/0.15/_images/math/c03af9de0e9abcf81b8a4a530020c46f4db8174b.png b/0.15/_images/math/c03af9de0e9abcf81b8a4a530020c46f4db8174b.png deleted file mode 100644 index bf57ab7bafeab..0000000000000 Binary files a/0.15/_images/math/c03af9de0e9abcf81b8a4a530020c46f4db8174b.png and /dev/null differ diff --git a/0.15/_images/math/c0514e2296e129756835e46f72bf5f3da5aefaf4.png b/0.15/_images/math/c0514e2296e129756835e46f72bf5f3da5aefaf4.png deleted file mode 100644 index 8b5ece98dcec4..0000000000000 Binary files a/0.15/_images/math/c0514e2296e129756835e46f72bf5f3da5aefaf4.png and /dev/null differ diff --git a/0.15/_images/math/c069a67de13134f8bd4878ac7ceb2574cb5731e2.png b/0.15/_images/math/c069a67de13134f8bd4878ac7ceb2574cb5731e2.png deleted file mode 100644 index 92ab1398f884a..0000000000000 Binary files a/0.15/_images/math/c069a67de13134f8bd4878ac7ceb2574cb5731e2.png and /dev/null differ diff --git a/0.15/_images/math/c071d5b7948b79b8bd2232aae2939399a487a24c.png b/0.15/_images/math/c071d5b7948b79b8bd2232aae2939399a487a24c.png deleted file mode 100644 index d3246e6cc0af6..0000000000000 Binary files a/0.15/_images/math/c071d5b7948b79b8bd2232aae2939399a487a24c.png and /dev/null differ diff --git a/0.15/_images/math/c12181d671649ed5892696252202bba516d28d3a.png b/0.15/_images/math/c12181d671649ed5892696252202bba516d28d3a.png deleted file mode 100644 index af5d5384d85e4..0000000000000 Binary files a/0.15/_images/math/c12181d671649ed5892696252202bba516d28d3a.png and /dev/null differ diff --git a/0.15/_images/math/c198beefcd66ade24e26b1063e3cc5fc0fb9e66d.png b/0.15/_images/math/c198beefcd66ade24e26b1063e3cc5fc0fb9e66d.png deleted file mode 100644 index 719332f1d9edc..0000000000000 Binary files a/0.15/_images/math/c198beefcd66ade24e26b1063e3cc5fc0fb9e66d.png and /dev/null differ diff --git a/0.15/_images/math/c20b076757f2c84dbfba8d79beeb264442324609.png b/0.15/_images/math/c20b076757f2c84dbfba8d79beeb264442324609.png deleted file mode 100644 index bf7b8983ff6f8..0000000000000 Binary files a/0.15/_images/math/c20b076757f2c84dbfba8d79beeb264442324609.png and /dev/null differ diff --git a/0.15/_images/math/c34989568355a992a60ae7f83f7ae46889fb64c4.png b/0.15/_images/math/c34989568355a992a60ae7f83f7ae46889fb64c4.png deleted file mode 100644 index 92b2eb611453d..0000000000000 Binary files a/0.15/_images/math/c34989568355a992a60ae7f83f7ae46889fb64c4.png and /dev/null differ diff --git a/0.15/_images/math/c3781294d5c6e5d98a8962119c79f072d498d31f.png b/0.15/_images/math/c3781294d5c6e5d98a8962119c79f072d498d31f.png deleted file mode 100644 index 2a5629f06e4a4..0000000000000 Binary files a/0.15/_images/math/c3781294d5c6e5d98a8962119c79f072d498d31f.png and /dev/null differ diff --git a/0.15/_images/math/c3a1ea1c5ef9f9923d99db023a65c73d4b6dbc94.png b/0.15/_images/math/c3a1ea1c5ef9f9923d99db023a65c73d4b6dbc94.png deleted file mode 100644 index e3bf60c012a29..0000000000000 Binary files a/0.15/_images/math/c3a1ea1c5ef9f9923d99db023a65c73d4b6dbc94.png and /dev/null differ diff --git a/0.15/_images/math/c3c1c05532d6913308cac959d27d21be5abed0d5.png b/0.15/_images/math/c3c1c05532d6913308cac959d27d21be5abed0d5.png deleted file mode 100644 index 6de5370bf5707..0000000000000 Binary files a/0.15/_images/math/c3c1c05532d6913308cac959d27d21be5abed0d5.png and /dev/null differ diff --git a/0.15/_images/math/c4563e7ecec2336a3934447a6c10ef8519b0b452.png b/0.15/_images/math/c4563e7ecec2336a3934447a6c10ef8519b0b452.png deleted file mode 100644 index d5468db663a4f..0000000000000 Binary files a/0.15/_images/math/c4563e7ecec2336a3934447a6c10ef8519b0b452.png and /dev/null differ diff --git a/0.15/_images/math/c4a8a2957d6d5970fef35cce3e86d31427eaa216.png b/0.15/_images/math/c4a8a2957d6d5970fef35cce3e86d31427eaa216.png deleted file mode 100644 index 9c8b02dce1083..0000000000000 Binary files a/0.15/_images/math/c4a8a2957d6d5970fef35cce3e86d31427eaa216.png and /dev/null differ diff --git a/0.15/_images/math/c4bb40dd65eae6c11b325989b14e0b8d35e4e3ef.png b/0.15/_images/math/c4bb40dd65eae6c11b325989b14e0b8d35e4e3ef.png deleted file mode 100644 index 5236288569ef3..0000000000000 Binary files a/0.15/_images/math/c4bb40dd65eae6c11b325989b14e0b8d35e4e3ef.png and /dev/null differ diff --git a/0.15/_images/math/c570ab13e7a6725e1772f64ad76d96a957adc07d.png b/0.15/_images/math/c570ab13e7a6725e1772f64ad76d96a957adc07d.png deleted file mode 100644 index d2cee1a051a0c..0000000000000 Binary files a/0.15/_images/math/c570ab13e7a6725e1772f64ad76d96a957adc07d.png and /dev/null differ diff --git a/0.15/_images/math/c5926a04917006dc055a58af642f40f878e4fb49.png b/0.15/_images/math/c5926a04917006dc055a58af642f40f878e4fb49.png deleted file mode 100644 index b95885cead66d..0000000000000 Binary files a/0.15/_images/math/c5926a04917006dc055a58af642f40f878e4fb49.png and /dev/null differ diff --git a/0.15/_images/math/c61dad96aa06794917d7bff7d5e9962533ef8f43.png b/0.15/_images/math/c61dad96aa06794917d7bff7d5e9962533ef8f43.png deleted file mode 100644 index e81495d4eeba6..0000000000000 Binary files a/0.15/_images/math/c61dad96aa06794917d7bff7d5e9962533ef8f43.png and /dev/null differ diff --git a/0.15/_images/math/c659422e679981e7ee3a7a3bc3a7420a5c0257cb.png b/0.15/_images/math/c659422e679981e7ee3a7a3bc3a7420a5c0257cb.png deleted file mode 100644 index 92f4937d2f34d..0000000000000 Binary files a/0.15/_images/math/c659422e679981e7ee3a7a3bc3a7420a5c0257cb.png and /dev/null differ diff --git a/0.15/_images/math/c65c2d023af7f064e3391aa7678358f3ed1ff117.png b/0.15/_images/math/c65c2d023af7f064e3391aa7678358f3ed1ff117.png deleted file mode 100644 index bb021f9c6b42d..0000000000000 Binary files a/0.15/_images/math/c65c2d023af7f064e3391aa7678358f3ed1ff117.png and /dev/null differ diff --git a/0.15/_images/math/c6d6323bc6376953afef6b5b8a6689a5440357c4.png b/0.15/_images/math/c6d6323bc6376953afef6b5b8a6689a5440357c4.png deleted file mode 100644 index 12f02546d4ed7..0000000000000 Binary files a/0.15/_images/math/c6d6323bc6376953afef6b5b8a6689a5440357c4.png and /dev/null differ diff --git a/0.15/_images/math/c70c3d6c173306bc262e12d45b1572cc1b0a2d1e.png b/0.15/_images/math/c70c3d6c173306bc262e12d45b1572cc1b0a2d1e.png deleted file mode 100644 index 409542f7eb814..0000000000000 Binary files a/0.15/_images/math/c70c3d6c173306bc262e12d45b1572cc1b0a2d1e.png and /dev/null differ diff --git a/0.15/_images/math/c7c5c6adaea9b8f6e4324e8cecfefbaf3cbd3627.png b/0.15/_images/math/c7c5c6adaea9b8f6e4324e8cecfefbaf3cbd3627.png deleted file mode 100644 index c65bbebfaccf0..0000000000000 Binary files a/0.15/_images/math/c7c5c6adaea9b8f6e4324e8cecfefbaf3cbd3627.png and /dev/null differ diff --git a/0.15/_images/math/c8b8590ededc6cdd4c311a1c5584090e60b95be4.png b/0.15/_images/math/c8b8590ededc6cdd4c311a1c5584090e60b95be4.png deleted file mode 100644 index 16f3a6456a5cf..0000000000000 Binary files a/0.15/_images/math/c8b8590ededc6cdd4c311a1c5584090e60b95be4.png and /dev/null differ diff --git a/0.15/_images/math/c9069138144f82207c7a093887720188291e663a.png b/0.15/_images/math/c9069138144f82207c7a093887720188291e663a.png deleted file mode 100644 index 167290b4a8243..0000000000000 Binary files a/0.15/_images/math/c9069138144f82207c7a093887720188291e663a.png and /dev/null differ diff --git a/0.15/_images/math/c923f188c5cc014df88dc9de60d6bb69fb68ce16.png b/0.15/_images/math/c923f188c5cc014df88dc9de60d6bb69fb68ce16.png deleted file mode 100644 index 8db2ffa6b8aca..0000000000000 Binary files a/0.15/_images/math/c923f188c5cc014df88dc9de60d6bb69fb68ce16.png and /dev/null differ diff --git a/0.15/_images/math/c99df7a209495334da442b1ec998abaabfa320d8.png b/0.15/_images/math/c99df7a209495334da442b1ec998abaabfa320d8.png deleted file mode 100644 index 0fdb48881dd34..0000000000000 Binary files a/0.15/_images/math/c99df7a209495334da442b1ec998abaabfa320d8.png and /dev/null differ diff --git a/0.15/_images/math/ca017d3d38a5a935ae8bee84d8143b44f1b32c9a.png b/0.15/_images/math/ca017d3d38a5a935ae8bee84d8143b44f1b32c9a.png deleted file mode 100644 index d3610379ed58e..0000000000000 Binary files a/0.15/_images/math/ca017d3d38a5a935ae8bee84d8143b44f1b32c9a.png and /dev/null differ diff --git a/0.15/_images/math/cad8e74e7c1c5b0d5bc09c57e822de2968629308.png b/0.15/_images/math/cad8e74e7c1c5b0d5bc09c57e822de2968629308.png deleted file mode 100644 index 0533b2f96749d..0000000000000 Binary files a/0.15/_images/math/cad8e74e7c1c5b0d5bc09c57e822de2968629308.png and /dev/null differ diff --git a/0.15/_images/math/caea9921eb427449d088d91b6755d96e7cf1b214.png b/0.15/_images/math/caea9921eb427449d088d91b6755d96e7cf1b214.png deleted file mode 100644 index 7adbce6a0e2c1..0000000000000 Binary files a/0.15/_images/math/caea9921eb427449d088d91b6755d96e7cf1b214.png and /dev/null differ diff --git a/0.15/_images/math/cb131e0f1390675e9f3219554f22bec1e387f75f.png b/0.15/_images/math/cb131e0f1390675e9f3219554f22bec1e387f75f.png deleted file mode 100644 index 093e99dd673da..0000000000000 Binary files a/0.15/_images/math/cb131e0f1390675e9f3219554f22bec1e387f75f.png and /dev/null differ diff --git a/0.15/_images/math/cbb80ad77aa7a5e227d5a46bc44d235284106cfc.png b/0.15/_images/math/cbb80ad77aa7a5e227d5a46bc44d235284106cfc.png deleted file mode 100644 index 5412628654862..0000000000000 Binary files a/0.15/_images/math/cbb80ad77aa7a5e227d5a46bc44d235284106cfc.png and /dev/null differ diff --git a/0.15/_images/math/cc5745965b2b2b0e0dd6ca30020eb4fa6edfe99d.png b/0.15/_images/math/cc5745965b2b2b0e0dd6ca30020eb4fa6edfe99d.png deleted file mode 100644 index 0387300a8e77a..0000000000000 Binary files a/0.15/_images/math/cc5745965b2b2b0e0dd6ca30020eb4fa6edfe99d.png and /dev/null differ diff --git a/0.15/_images/math/cc80c6a15728d06a1349a06d1f4d6ba38de9a97c.png b/0.15/_images/math/cc80c6a15728d06a1349a06d1f4d6ba38de9a97c.png deleted file mode 100644 index 19c19641b9466..0000000000000 Binary files a/0.15/_images/math/cc80c6a15728d06a1349a06d1f4d6ba38de9a97c.png and /dev/null differ diff --git a/0.15/_images/math/cd4d8aea4c1f75783b600893b4dae07546196b46.png b/0.15/_images/math/cd4d8aea4c1f75783b600893b4dae07546196b46.png deleted file mode 100644 index 9afe08f0e6833..0000000000000 Binary files a/0.15/_images/math/cd4d8aea4c1f75783b600893b4dae07546196b46.png and /dev/null differ diff --git a/0.15/_images/math/cd59d146b51002c0025892bdc83aea45c6e577e8.png b/0.15/_images/math/cd59d146b51002c0025892bdc83aea45c6e577e8.png deleted file mode 100644 index a9b0f4e362c7b..0000000000000 Binary files a/0.15/_images/math/cd59d146b51002c0025892bdc83aea45c6e577e8.png and /dev/null differ diff --git a/0.15/_images/math/cd5f753c7065014aa75c6c7b3a40f9d614d4bba8.png b/0.15/_images/math/cd5f753c7065014aa75c6c7b3a40f9d614d4bba8.png deleted file mode 100644 index 50e12f4d46bde..0000000000000 Binary files a/0.15/_images/math/cd5f753c7065014aa75c6c7b3a40f9d614d4bba8.png and /dev/null differ diff --git a/0.15/_images/math/ce9d9ed4403f4ae56fde107c0d49755ff7b333c1.png b/0.15/_images/math/ce9d9ed4403f4ae56fde107c0d49755ff7b333c1.png deleted file mode 100644 index 9d4a22c75a40b..0000000000000 Binary files a/0.15/_images/math/ce9d9ed4403f4ae56fde107c0d49755ff7b333c1.png and /dev/null differ diff --git a/0.15/_images/math/cea4625fa5fb7540216ae99faa89608515f220ce.png b/0.15/_images/math/cea4625fa5fb7540216ae99faa89608515f220ce.png deleted file mode 100644 index ef112d20ea1bd..0000000000000 Binary files a/0.15/_images/math/cea4625fa5fb7540216ae99faa89608515f220ce.png and /dev/null differ diff --git a/0.15/_images/math/cfbc38219af5e2dddce2a3752f9ce8c7e36c74f4.png b/0.15/_images/math/cfbc38219af5e2dddce2a3752f9ce8c7e36c74f4.png deleted file mode 100644 index abafbb3aa3d24..0000000000000 Binary files a/0.15/_images/math/cfbc38219af5e2dddce2a3752f9ce8c7e36c74f4.png and /dev/null differ diff --git a/0.15/_images/math/cfe9bd9df7580025210fdf53add52cb820e6872f.png b/0.15/_images/math/cfe9bd9df7580025210fdf53add52cb820e6872f.png deleted file mode 100644 index acda870a34172..0000000000000 Binary files a/0.15/_images/math/cfe9bd9df7580025210fdf53add52cb820e6872f.png and /dev/null differ diff --git a/0.15/_images/math/d05b42f030bcd48d49e0d98cd4a2d376fc4d45b2.png b/0.15/_images/math/d05b42f030bcd48d49e0d98cd4a2d376fc4d45b2.png deleted file mode 100644 index 9804dcbe74027..0000000000000 Binary files a/0.15/_images/math/d05b42f030bcd48d49e0d98cd4a2d376fc4d45b2.png and /dev/null differ diff --git a/0.15/_images/math/d07adc1a4155b273cdcd51dabb24c19b31c436a4.png b/0.15/_images/math/d07adc1a4155b273cdcd51dabb24c19b31c436a4.png deleted file mode 100644 index 9e5feb2c9cd4b..0000000000000 Binary files a/0.15/_images/math/d07adc1a4155b273cdcd51dabb24c19b31c436a4.png and /dev/null differ diff --git a/0.15/_images/math/d07ce636ca45cc2bb6cc90fcdc208ef14e0b267d.png b/0.15/_images/math/d07ce636ca45cc2bb6cc90fcdc208ef14e0b267d.png deleted file mode 100644 index f2e717a438fab..0000000000000 Binary files a/0.15/_images/math/d07ce636ca45cc2bb6cc90fcdc208ef14e0b267d.png and /dev/null differ diff --git a/0.15/_images/math/d18ddf7dd7ca825898bbc0e7249228526f6bddea.png b/0.15/_images/math/d18ddf7dd7ca825898bbc0e7249228526f6bddea.png deleted file mode 100644 index fe01bc744797a..0000000000000 Binary files a/0.15/_images/math/d18ddf7dd7ca825898bbc0e7249228526f6bddea.png and /dev/null differ diff --git a/0.15/_images/math/d32c78b759903e3f4bd4fd2ce0b86358f7500c5d.png b/0.15/_images/math/d32c78b759903e3f4bd4fd2ce0b86358f7500c5d.png deleted file mode 100644 index aa9aacc2a0829..0000000000000 Binary files a/0.15/_images/math/d32c78b759903e3f4bd4fd2ce0b86358f7500c5d.png and /dev/null differ diff --git a/0.15/_images/math/d3a93ce5fdd86a1a6cea538e4b3ad7616156ff25.png b/0.15/_images/math/d3a93ce5fdd86a1a6cea538e4b3ad7616156ff25.png deleted file mode 100644 index c47f65530d9a0..0000000000000 Binary files a/0.15/_images/math/d3a93ce5fdd86a1a6cea538e4b3ad7616156ff25.png and /dev/null differ diff --git a/0.15/_images/math/d3dc4f3acdee37990d156185ebe2e4eb8dd6e87f.png b/0.15/_images/math/d3dc4f3acdee37990d156185ebe2e4eb8dd6e87f.png deleted file mode 100644 index 726acf9248f64..0000000000000 Binary files a/0.15/_images/math/d3dc4f3acdee37990d156185ebe2e4eb8dd6e87f.png and /dev/null differ diff --git a/0.15/_images/math/d3e169efcd9e98e56756db017b46c12b1b77fc73.png b/0.15/_images/math/d3e169efcd9e98e56756db017b46c12b1b77fc73.png deleted file mode 100644 index 7e950bf253249..0000000000000 Binary files a/0.15/_images/math/d3e169efcd9e98e56756db017b46c12b1b77fc73.png and /dev/null differ diff --git a/0.15/_images/math/d432478525db6c0e8aeb2a6fa0a8ca3bf0afe7b5.png b/0.15/_images/math/d432478525db6c0e8aeb2a6fa0a8ca3bf0afe7b5.png deleted file mode 100644 index 9bca62f7d5ab8..0000000000000 Binary files a/0.15/_images/math/d432478525db6c0e8aeb2a6fa0a8ca3bf0afe7b5.png and /dev/null differ diff --git a/0.15/_images/math/d4403c0633869f2284fcb87186bbada49ab4abae.png b/0.15/_images/math/d4403c0633869f2284fcb87186bbada49ab4abae.png deleted file mode 100644 index 59ef4f221f937..0000000000000 Binary files a/0.15/_images/math/d4403c0633869f2284fcb87186bbada49ab4abae.png and /dev/null differ diff --git a/0.15/_images/math/d4b9f7415136a81704b29ba2438c4a00f22523b4.png b/0.15/_images/math/d4b9f7415136a81704b29ba2438c4a00f22523b4.png deleted file mode 100644 index c270bcd43afd7..0000000000000 Binary files a/0.15/_images/math/d4b9f7415136a81704b29ba2438c4a00f22523b4.png and /dev/null differ diff --git a/0.15/_images/math/d5d48823181b7f7a9e96c9cbd3bb70d04abdbd9d.png b/0.15/_images/math/d5d48823181b7f7a9e96c9cbd3bb70d04abdbd9d.png deleted file mode 100644 index 42d5d119e48ea..0000000000000 Binary files a/0.15/_images/math/d5d48823181b7f7a9e96c9cbd3bb70d04abdbd9d.png and /dev/null differ diff --git a/0.15/_images/math/d637f33c37a5688da805b551083d16e7a674f7d5.png b/0.15/_images/math/d637f33c37a5688da805b551083d16e7a674f7d5.png deleted file mode 100644 index 9d973e6d3452f..0000000000000 Binary files a/0.15/_images/math/d637f33c37a5688da805b551083d16e7a674f7d5.png and /dev/null differ diff --git a/0.15/_images/math/d6449cb75b5e71751bedfc061befb29a07a51199.png b/0.15/_images/math/d6449cb75b5e71751bedfc061befb29a07a51199.png deleted file mode 100644 index a1f488f5ea3e5..0000000000000 Binary files a/0.15/_images/math/d6449cb75b5e71751bedfc061befb29a07a51199.png and /dev/null differ diff --git a/0.15/_images/math/d67fb61cfffca2cc069e083d76cb6220b4ca14c8.png b/0.15/_images/math/d67fb61cfffca2cc069e083d76cb6220b4ca14c8.png deleted file mode 100644 index 95d0ba76609ff..0000000000000 Binary files a/0.15/_images/math/d67fb61cfffca2cc069e083d76cb6220b4ca14c8.png and /dev/null differ diff --git a/0.15/_images/math/d692a352d052c59e2ea79129c89cbeae6e4571c1.png b/0.15/_images/math/d692a352d052c59e2ea79129c89cbeae6e4571c1.png deleted file mode 100644 index 3d07f6ee46aed..0000000000000 Binary files a/0.15/_images/math/d692a352d052c59e2ea79129c89cbeae6e4571c1.png and /dev/null differ diff --git a/0.15/_images/math/d69442b6ad88297bb014a0bc0c8d40dced76b707.png b/0.15/_images/math/d69442b6ad88297bb014a0bc0c8d40dced76b707.png deleted file mode 100644 index cf756b38a1070..0000000000000 Binary files a/0.15/_images/math/d69442b6ad88297bb014a0bc0c8d40dced76b707.png and /dev/null differ diff --git a/0.15/_images/math/d69c3a448102855bf3856d1c262409e073516140.png b/0.15/_images/math/d69c3a448102855bf3856d1c262409e073516140.png deleted file mode 100644 index 75757352fa1f5..0000000000000 Binary files a/0.15/_images/math/d69c3a448102855bf3856d1c262409e073516140.png and /dev/null differ diff --git a/0.15/_images/math/d6e79569893190df0327efadedba52812f6ec183.png b/0.15/_images/math/d6e79569893190df0327efadedba52812f6ec183.png deleted file mode 100644 index 9219e90f06889..0000000000000 Binary files a/0.15/_images/math/d6e79569893190df0327efadedba52812f6ec183.png and /dev/null differ diff --git a/0.15/_images/math/d6f2cf79a55e2603ecd3072518fe46b3ad452f3a.png b/0.15/_images/math/d6f2cf79a55e2603ecd3072518fe46b3ad452f3a.png deleted file mode 100644 index d0737e5ba4754..0000000000000 Binary files a/0.15/_images/math/d6f2cf79a55e2603ecd3072518fe46b3ad452f3a.png and /dev/null differ diff --git a/0.15/_images/math/d72a9aef7b3237cc3733eef2e7aef97a156230e8.png b/0.15/_images/math/d72a9aef7b3237cc3733eef2e7aef97a156230e8.png deleted file mode 100644 index 9cc3e31ff8fb0..0000000000000 Binary files a/0.15/_images/math/d72a9aef7b3237cc3733eef2e7aef97a156230e8.png and /dev/null differ diff --git a/0.15/_images/math/d768e9b981b47e886f24febd01391eeb3c2c98b6.png b/0.15/_images/math/d768e9b981b47e886f24febd01391eeb3c2c98b6.png deleted file mode 100644 index b3648b6384cd5..0000000000000 Binary files a/0.15/_images/math/d768e9b981b47e886f24febd01391eeb3c2c98b6.png and /dev/null differ diff --git a/0.15/_images/math/d7b9c9300675caab903407dce0551c0ff4e67663.png b/0.15/_images/math/d7b9c9300675caab903407dce0551c0ff4e67663.png deleted file mode 100644 index c0f4d30dd462f..0000000000000 Binary files a/0.15/_images/math/d7b9c9300675caab903407dce0551c0ff4e67663.png and /dev/null differ diff --git a/0.15/_images/math/d80d16109b367f75e59c10ae58352d93d4904c5e.png b/0.15/_images/math/d80d16109b367f75e59c10ae58352d93d4904c5e.png deleted file mode 100644 index c3860090851d1..0000000000000 Binary files a/0.15/_images/math/d80d16109b367f75e59c10ae58352d93d4904c5e.png and /dev/null differ diff --git a/0.15/_images/math/d93300e24558ddc7c23e5c2633c7f13605a41203.png b/0.15/_images/math/d93300e24558ddc7c23e5c2633c7f13605a41203.png deleted file mode 100644 index 0a1afd378afee..0000000000000 Binary files a/0.15/_images/math/d93300e24558ddc7c23e5c2633c7f13605a41203.png and /dev/null differ diff --git a/0.15/_images/math/d95f1d719cb6b6e373cb6fc65fdcf66ca50ec589.png b/0.15/_images/math/d95f1d719cb6b6e373cb6fc65fdcf66ca50ec589.png deleted file mode 100644 index 4eab7069b07f8..0000000000000 Binary files a/0.15/_images/math/d95f1d719cb6b6e373cb6fc65fdcf66ca50ec589.png and /dev/null differ diff --git a/0.15/_images/math/d976ecc77265e689f9fbe475c7464b285ede0acc.png b/0.15/_images/math/d976ecc77265e689f9fbe475c7464b285ede0acc.png deleted file mode 100644 index 7cd57a1a5f9c6..0000000000000 Binary files a/0.15/_images/math/d976ecc77265e689f9fbe475c7464b285ede0acc.png and /dev/null differ diff --git a/0.15/_images/math/d99efde75c84ef402a92cd4497530d2366fb112f.png b/0.15/_images/math/d99efde75c84ef402a92cd4497530d2366fb112f.png deleted file mode 100644 index 349cab5f4fe9a..0000000000000 Binary files a/0.15/_images/math/d99efde75c84ef402a92cd4497530d2366fb112f.png and /dev/null differ diff --git a/0.15/_images/math/d9dd0082035232cea0abaf89472b5e9e28dcbdd5.png b/0.15/_images/math/d9dd0082035232cea0abaf89472b5e9e28dcbdd5.png deleted file mode 100644 index d4525eea709a3..0000000000000 Binary files a/0.15/_images/math/d9dd0082035232cea0abaf89472b5e9e28dcbdd5.png and /dev/null differ diff --git a/0.15/_images/math/da203f970e5bbff0c0652f37b320fba12937ca36.png b/0.15/_images/math/da203f970e5bbff0c0652f37b320fba12937ca36.png deleted file mode 100644 index ca866f8c88130..0000000000000 Binary files a/0.15/_images/math/da203f970e5bbff0c0652f37b320fba12937ca36.png and /dev/null differ diff --git a/0.15/_images/math/da6935a2384c32204e1462bc2b64c3b0c02aaee0.png b/0.15/_images/math/da6935a2384c32204e1462bc2b64c3b0c02aaee0.png deleted file mode 100644 index 8b6595b02d85a..0000000000000 Binary files a/0.15/_images/math/da6935a2384c32204e1462bc2b64c3b0c02aaee0.png and /dev/null differ diff --git a/0.15/_images/math/da6d9feb881cb1b6599ef1aee85eb1131052017b.png b/0.15/_images/math/da6d9feb881cb1b6599ef1aee85eb1131052017b.png deleted file mode 100644 index 17b6120153ee5..0000000000000 Binary files a/0.15/_images/math/da6d9feb881cb1b6599ef1aee85eb1131052017b.png and /dev/null differ diff --git a/0.15/_images/math/da8ea309b3ca0582a5b848cda156da632570b2a9.png b/0.15/_images/math/da8ea309b3ca0582a5b848cda156da632570b2a9.png deleted file mode 100644 index 5515f0af26b79..0000000000000 Binary files a/0.15/_images/math/da8ea309b3ca0582a5b848cda156da632570b2a9.png and /dev/null differ diff --git a/0.15/_images/math/da8ec41d380197365d9c7cd81b18bc69a81fe837.png b/0.15/_images/math/da8ec41d380197365d9c7cd81b18bc69a81fe837.png deleted file mode 100644 index c91a7e022bef0..0000000000000 Binary files a/0.15/_images/math/da8ec41d380197365d9c7cd81b18bc69a81fe837.png and /dev/null differ diff --git a/0.15/_images/math/daf0484d7bd97c43bc8c73b35c3335345d24b8b4.png b/0.15/_images/math/daf0484d7bd97c43bc8c73b35c3335345d24b8b4.png deleted file mode 100644 index 1c78d7f275e41..0000000000000 Binary files a/0.15/_images/math/daf0484d7bd97c43bc8c73b35c3335345d24b8b4.png and /dev/null differ diff --git a/0.15/_images/math/db30f65159c0f4b2e3ec318ed09839aa42bf261a.png b/0.15/_images/math/db30f65159c0f4b2e3ec318ed09839aa42bf261a.png deleted file mode 100644 index d63af9ee358a7..0000000000000 Binary files a/0.15/_images/math/db30f65159c0f4b2e3ec318ed09839aa42bf261a.png and /dev/null differ diff --git a/0.15/_images/math/db5929be150f149215fd88053de8d36c6608bef6.png b/0.15/_images/math/db5929be150f149215fd88053de8d36c6608bef6.png deleted file mode 100644 index c065e4eefeeda..0000000000000 Binary files a/0.15/_images/math/db5929be150f149215fd88053de8d36c6608bef6.png and /dev/null differ diff --git a/0.15/_images/math/dc8ce84d85fe65b5eecda998106e0cc716dbcc60.png b/0.15/_images/math/dc8ce84d85fe65b5eecda998106e0cc716dbcc60.png deleted file mode 100644 index eb992254ea367..0000000000000 Binary files a/0.15/_images/math/dc8ce84d85fe65b5eecda998106e0cc716dbcc60.png and /dev/null differ diff --git a/0.15/_images/math/dcf8a6d5a34c9ad0b9b22f7abf78053e907e0729.png b/0.15/_images/math/dcf8a6d5a34c9ad0b9b22f7abf78053e907e0729.png deleted file mode 100644 index f458ab0e536e7..0000000000000 Binary files a/0.15/_images/math/dcf8a6d5a34c9ad0b9b22f7abf78053e907e0729.png and /dev/null differ diff --git a/0.15/_images/math/dd27ab59b712f5f48b6cd30c93b6a39511643b62.png b/0.15/_images/math/dd27ab59b712f5f48b6cd30c93b6a39511643b62.png deleted file mode 100644 index 22237602c0b9a..0000000000000 Binary files a/0.15/_images/math/dd27ab59b712f5f48b6cd30c93b6a39511643b62.png and /dev/null differ diff --git a/0.15/_images/math/dd45b04e42790a1f53f220a2e6c8d716578c922e.png b/0.15/_images/math/dd45b04e42790a1f53f220a2e6c8d716578c922e.png deleted file mode 100644 index bd6eb40b65cfb..0000000000000 Binary files a/0.15/_images/math/dd45b04e42790a1f53f220a2e6c8d716578c922e.png and /dev/null differ diff --git a/0.15/_images/math/dd6a0c79ee7e76c8e6f1310a5d171d5b3848b685.png b/0.15/_images/math/dd6a0c79ee7e76c8e6f1310a5d171d5b3848b685.png deleted file mode 100644 index c201a82bed1fe..0000000000000 Binary files a/0.15/_images/math/dd6a0c79ee7e76c8e6f1310a5d171d5b3848b685.png and /dev/null differ diff --git a/0.15/_images/math/de6f6ec55da5bff04bdf591d5bb35136eb51b579.png b/0.15/_images/math/de6f6ec55da5bff04bdf591d5bb35136eb51b579.png deleted file mode 100644 index d35704d2deb3d..0000000000000 Binary files a/0.15/_images/math/de6f6ec55da5bff04bdf591d5bb35136eb51b579.png and /dev/null differ diff --git a/0.15/_images/math/debe2ff09239bb9b81160d734bd2d97cf7058162.png b/0.15/_images/math/debe2ff09239bb9b81160d734bd2d97cf7058162.png deleted file mode 100644 index 1fb5f1538b9a0..0000000000000 Binary files a/0.15/_images/math/debe2ff09239bb9b81160d734bd2d97cf7058162.png and /dev/null differ diff --git a/0.15/_images/math/def967005305b517d635567d0537f11fe13a8b2a.png b/0.15/_images/math/def967005305b517d635567d0537f11fe13a8b2a.png deleted file mode 100644 index 903798695efcb..0000000000000 Binary files a/0.15/_images/math/def967005305b517d635567d0537f11fe13a8b2a.png and /dev/null differ diff --git a/0.15/_images/math/defc8dedc4e1c71aa65da56c385f2d8681f2ed4d.png b/0.15/_images/math/defc8dedc4e1c71aa65da56c385f2d8681f2ed4d.png deleted file mode 100644 index 596e4094b6fa2..0000000000000 Binary files a/0.15/_images/math/defc8dedc4e1c71aa65da56c385f2d8681f2ed4d.png and /dev/null differ diff --git a/0.15/_images/math/df2224db0152d27d3a57574c262924c05d06da0f.png b/0.15/_images/math/df2224db0152d27d3a57574c262924c05d06da0f.png deleted file mode 100644 index 3035f9e13d34c..0000000000000 Binary files a/0.15/_images/math/df2224db0152d27d3a57574c262924c05d06da0f.png and /dev/null differ diff --git a/0.15/_images/math/df391fc64254ea60aabeb28d65a2f40966bc23f9.png b/0.15/_images/math/df391fc64254ea60aabeb28d65a2f40966bc23f9.png deleted file mode 100644 index 13f6f0c13a7ba..0000000000000 Binary files a/0.15/_images/math/df391fc64254ea60aabeb28d65a2f40966bc23f9.png and /dev/null differ diff --git a/0.15/_images/math/df9a1b1c10cf017602623d2f63fad3f1eff48730.png b/0.15/_images/math/df9a1b1c10cf017602623d2f63fad3f1eff48730.png deleted file mode 100644 index 628180e98b229..0000000000000 Binary files a/0.15/_images/math/df9a1b1c10cf017602623d2f63fad3f1eff48730.png and /dev/null differ diff --git a/0.15/_images/math/dfdf17e3ecd9ca5506b2fbf5a7ebd70412326e81.png b/0.15/_images/math/dfdf17e3ecd9ca5506b2fbf5a7ebd70412326e81.png deleted file mode 100644 index 618cc64614335..0000000000000 Binary files a/0.15/_images/math/dfdf17e3ecd9ca5506b2fbf5a7ebd70412326e81.png and /dev/null differ diff --git a/0.15/_images/math/e04c1e6d6021997fb981328239bc866d3a3a382b.png b/0.15/_images/math/e04c1e6d6021997fb981328239bc866d3a3a382b.png deleted file mode 100644 index 08eb16de12f2d..0000000000000 Binary files a/0.15/_images/math/e04c1e6d6021997fb981328239bc866d3a3a382b.png and /dev/null differ diff --git a/0.15/_images/math/e088d1aeabf6b6f6608c43bb18829dd7a4097d7f.png b/0.15/_images/math/e088d1aeabf6b6f6608c43bb18829dd7a4097d7f.png deleted file mode 100644 index 0e2e300bc1eef..0000000000000 Binary files a/0.15/_images/math/e088d1aeabf6b6f6608c43bb18829dd7a4097d7f.png and /dev/null differ diff --git a/0.15/_images/math/e0a27d9622acbf23b21d5d5164f91dfbad5324dd.png b/0.15/_images/math/e0a27d9622acbf23b21d5d5164f91dfbad5324dd.png deleted file mode 100644 index 8cd13146ade0f..0000000000000 Binary files a/0.15/_images/math/e0a27d9622acbf23b21d5d5164f91dfbad5324dd.png and /dev/null differ diff --git a/0.15/_images/math/e0f293430b347291b63495a02f47d30e35fa7229.png b/0.15/_images/math/e0f293430b347291b63495a02f47d30e35fa7229.png deleted file mode 100644 index fc180bfcbd390..0000000000000 Binary files a/0.15/_images/math/e0f293430b347291b63495a02f47d30e35fa7229.png and /dev/null differ diff --git a/0.15/_images/math/e0f4c204f26e9afa4f5bbeda60af5262e624c148.png b/0.15/_images/math/e0f4c204f26e9afa4f5bbeda60af5262e624c148.png deleted file mode 100644 index 951fdba456335..0000000000000 Binary files a/0.15/_images/math/e0f4c204f26e9afa4f5bbeda60af5262e624c148.png and /dev/null differ diff --git a/0.15/_images/math/e123c74214ae4f01736be735291fba2cd133e623.png b/0.15/_images/math/e123c74214ae4f01736be735291fba2cd133e623.png deleted file mode 100644 index ea801801670b6..0000000000000 Binary files a/0.15/_images/math/e123c74214ae4f01736be735291fba2cd133e623.png and /dev/null differ diff --git a/0.15/_images/math/e124387baa3fb78556702e7e00266ce1954002e0.png b/0.15/_images/math/e124387baa3fb78556702e7e00266ce1954002e0.png deleted file mode 100644 index 652401b7cfede..0000000000000 Binary files a/0.15/_images/math/e124387baa3fb78556702e7e00266ce1954002e0.png and /dev/null differ diff --git a/0.15/_images/math/e1414c9f072e8b0170686043af51c3fbf387615d.png b/0.15/_images/math/e1414c9f072e8b0170686043af51c3fbf387615d.png deleted file mode 100644 index 5afe5079b42cf..0000000000000 Binary files a/0.15/_images/math/e1414c9f072e8b0170686043af51c3fbf387615d.png and /dev/null differ diff --git a/0.15/_images/math/e1ff0eb7a23a5f833a66d75d4f681fe0875e781c.png b/0.15/_images/math/e1ff0eb7a23a5f833a66d75d4f681fe0875e781c.png deleted file mode 100644 index cae59c3c00702..0000000000000 Binary files a/0.15/_images/math/e1ff0eb7a23a5f833a66d75d4f681fe0875e781c.png and /dev/null differ diff --git a/0.15/_images/math/e26798dbf37644239db0d4660e7d514993e0c293.png b/0.15/_images/math/e26798dbf37644239db0d4660e7d514993e0c293.png deleted file mode 100644 index 79892d56b6d82..0000000000000 Binary files a/0.15/_images/math/e26798dbf37644239db0d4660e7d514993e0c293.png and /dev/null differ diff --git a/0.15/_images/math/e2b10634ef5e519fb87392b69593527ad79b985d.png b/0.15/_images/math/e2b10634ef5e519fb87392b69593527ad79b985d.png deleted file mode 100644 index acba1bf4bbdbb..0000000000000 Binary files a/0.15/_images/math/e2b10634ef5e519fb87392b69593527ad79b985d.png and /dev/null differ diff --git a/0.15/_images/math/e2b7e8b7dc650f4c44705855380b100eb43e5c26.png b/0.15/_images/math/e2b7e8b7dc650f4c44705855380b100eb43e5c26.png deleted file mode 100644 index 5c238383e48ea..0000000000000 Binary files a/0.15/_images/math/e2b7e8b7dc650f4c44705855380b100eb43e5c26.png and /dev/null differ diff --git a/0.15/_images/math/e3926ddd919b12a7003dc467af57824d4f4d101c.png b/0.15/_images/math/e3926ddd919b12a7003dc467af57824d4f4d101c.png deleted file mode 100644 index 0a33fe5155e43..0000000000000 Binary files a/0.15/_images/math/e3926ddd919b12a7003dc467af57824d4f4d101c.png and /dev/null differ diff --git a/0.15/_images/math/e3c673d681b61952ea1bd482aaef51fe9f7dcd21.png b/0.15/_images/math/e3c673d681b61952ea1bd482aaef51fe9f7dcd21.png deleted file mode 100644 index 80d8b180a56e9..0000000000000 Binary files a/0.15/_images/math/e3c673d681b61952ea1bd482aaef51fe9f7dcd21.png and /dev/null differ diff --git a/0.15/_images/math/e43d9cd0fe15ae82f739a60dd2cd5be2c65c1d99.png b/0.15/_images/math/e43d9cd0fe15ae82f739a60dd2cd5be2c65c1d99.png deleted file mode 100644 index a40a36e42a3f4..0000000000000 Binary files a/0.15/_images/math/e43d9cd0fe15ae82f739a60dd2cd5be2c65c1d99.png and /dev/null differ diff --git a/0.15/_images/math/e477a6f58d3e85cc0e8c8487ff7c5b0e683ac950.png b/0.15/_images/math/e477a6f58d3e85cc0e8c8487ff7c5b0e683ac950.png deleted file mode 100644 index 2d2b9b285fd65..0000000000000 Binary files a/0.15/_images/math/e477a6f58d3e85cc0e8c8487ff7c5b0e683ac950.png and /dev/null differ diff --git a/0.15/_images/math/e5acafef51b1b67dc6d79c39f3ba645819a2d59b.png b/0.15/_images/math/e5acafef51b1b67dc6d79c39f3ba645819a2d59b.png deleted file mode 100644 index 84d724e09673a..0000000000000 Binary files a/0.15/_images/math/e5acafef51b1b67dc6d79c39f3ba645819a2d59b.png and /dev/null differ diff --git a/0.15/_images/math/e5fc41b391867da81606413e3389c7efc73abaf0.png b/0.15/_images/math/e5fc41b391867da81606413e3389c7efc73abaf0.png deleted file mode 100644 index a4371800f74f5..0000000000000 Binary files a/0.15/_images/math/e5fc41b391867da81606413e3389c7efc73abaf0.png and /dev/null differ diff --git a/0.15/_images/math/e68adc400e8570b0f58d78c16290ba9bf84f0298.png b/0.15/_images/math/e68adc400e8570b0f58d78c16290ba9bf84f0298.png deleted file mode 100644 index 858eac2cf0722..0000000000000 Binary files a/0.15/_images/math/e68adc400e8570b0f58d78c16290ba9bf84f0298.png and /dev/null differ diff --git a/0.15/_images/math/e69ebd95e385ac5c254ef15635c37b01668decbf.png b/0.15/_images/math/e69ebd95e385ac5c254ef15635c37b01668decbf.png deleted file mode 100644 index 69857dd0c1ae7..0000000000000 Binary files a/0.15/_images/math/e69ebd95e385ac5c254ef15635c37b01668decbf.png and /dev/null differ diff --git a/0.15/_images/math/e6b1d56bec7ae49bc88ca1e9fda9fc255d7fd716.png b/0.15/_images/math/e6b1d56bec7ae49bc88ca1e9fda9fc255d7fd716.png deleted file mode 100644 index dec96803d7397..0000000000000 Binary files a/0.15/_images/math/e6b1d56bec7ae49bc88ca1e9fda9fc255d7fd716.png and /dev/null differ diff --git a/0.15/_images/math/e840adff6b2c292512f5c2eb67ad2c9c401366b5.png b/0.15/_images/math/e840adff6b2c292512f5c2eb67ad2c9c401366b5.png deleted file mode 100644 index 65fc1a5e30c94..0000000000000 Binary files a/0.15/_images/math/e840adff6b2c292512f5c2eb67ad2c9c401366b5.png and /dev/null differ diff --git a/0.15/_images/math/e85e9172fdbaf56c03dced3ea4be9eb4787d0514.png b/0.15/_images/math/e85e9172fdbaf56c03dced3ea4be9eb4787d0514.png deleted file mode 100644 index 1bbd1725be718..0000000000000 Binary files a/0.15/_images/math/e85e9172fdbaf56c03dced3ea4be9eb4787d0514.png and /dev/null differ diff --git a/0.15/_images/math/e8eb12f9407362d0fc035a12094fcc7797dcb69a.png b/0.15/_images/math/e8eb12f9407362d0fc035a12094fcc7797dcb69a.png deleted file mode 100644 index d1d6a92ca5ef9..0000000000000 Binary files a/0.15/_images/math/e8eb12f9407362d0fc035a12094fcc7797dcb69a.png and /dev/null differ diff --git a/0.15/_images/math/e9203da50e1059455123460d4e716c9c7f440cc3.png b/0.15/_images/math/e9203da50e1059455123460d4e716c9c7f440cc3.png deleted file mode 100644 index 09f0ba8cf56bf..0000000000000 Binary files a/0.15/_images/math/e9203da50e1059455123460d4e716c9c7f440cc3.png and /dev/null differ diff --git a/0.15/_images/math/e99e14a0688fa0dfa34968afad0841ac5c801721.png b/0.15/_images/math/e99e14a0688fa0dfa34968afad0841ac5c801721.png deleted file mode 100644 index f792f73039f1a..0000000000000 Binary files a/0.15/_images/math/e99e14a0688fa0dfa34968afad0841ac5c801721.png and /dev/null differ diff --git a/0.15/_images/math/e9a0a758b3f36c755b18def25bea44ac9eb9c9cf.png b/0.15/_images/math/e9a0a758b3f36c755b18def25bea44ac9eb9c9cf.png deleted file mode 100644 index 632e30d7743eb..0000000000000 Binary files a/0.15/_images/math/e9a0a758b3f36c755b18def25bea44ac9eb9c9cf.png and /dev/null differ diff --git a/0.15/_images/math/ea669d9510e28549cf732e326579f743f2d9c4bb.png b/0.15/_images/math/ea669d9510e28549cf732e326579f743f2d9c4bb.png deleted file mode 100644 index 0c0bcaccc775e..0000000000000 Binary files a/0.15/_images/math/ea669d9510e28549cf732e326579f743f2d9c4bb.png and /dev/null differ diff --git a/0.15/_images/math/ea7883239d280b3403de364242bc5eaa7c043fa3.png b/0.15/_images/math/ea7883239d280b3403de364242bc5eaa7c043fa3.png deleted file mode 100644 index deebe169950b2..0000000000000 Binary files a/0.15/_images/math/ea7883239d280b3403de364242bc5eaa7c043fa3.png and /dev/null differ diff --git a/0.15/_images/math/ea8752ded7c5816c51d31d20e7d93f52fbf41f49.png b/0.15/_images/math/ea8752ded7c5816c51d31d20e7d93f52fbf41f49.png deleted file mode 100644 index 034342fb448ce..0000000000000 Binary files a/0.15/_images/math/ea8752ded7c5816c51d31d20e7d93f52fbf41f49.png and /dev/null differ diff --git a/0.15/_images/math/eaa83ad913d07b540296aa7850a0756648059da7.png b/0.15/_images/math/eaa83ad913d07b540296aa7850a0756648059da7.png deleted file mode 100644 index 42e7fb0ee8b82..0000000000000 Binary files a/0.15/_images/math/eaa83ad913d07b540296aa7850a0756648059da7.png and /dev/null differ diff --git a/0.15/_images/math/eafb759b3682cc78f395f0f31b2d1c453c61b662.png b/0.15/_images/math/eafb759b3682cc78f395f0f31b2d1c453c61b662.png deleted file mode 100644 index be1cc860e53d9..0000000000000 Binary files a/0.15/_images/math/eafb759b3682cc78f395f0f31b2d1c453c61b662.png and /dev/null differ diff --git a/0.15/_images/math/eb5886b3cf7d30d33cf985cfa3cd865d2af3ca4b.png b/0.15/_images/math/eb5886b3cf7d30d33cf985cfa3cd865d2af3ca4b.png deleted file mode 100644 index cc6fb192e6775..0000000000000 Binary files a/0.15/_images/math/eb5886b3cf7d30d33cf985cfa3cd865d2af3ca4b.png and /dev/null differ diff --git a/0.15/_images/math/eb5c3fe273ef61963ce79f9cdd519ec892e6b105.png b/0.15/_images/math/eb5c3fe273ef61963ce79f9cdd519ec892e6b105.png deleted file mode 100644 index ba609c1f5abbc..0000000000000 Binary files a/0.15/_images/math/eb5c3fe273ef61963ce79f9cdd519ec892e6b105.png and /dev/null differ diff --git a/0.15/_images/math/eb9ab421187ecd58130545c735c34483dc037fe1.png b/0.15/_images/math/eb9ab421187ecd58130545c735c34483dc037fe1.png deleted file mode 100644 index f48ce418a9b2d..0000000000000 Binary files a/0.15/_images/math/eb9ab421187ecd58130545c735c34483dc037fe1.png and /dev/null differ diff --git a/0.15/_images/math/ebb2cff7b67f3b8c4e06405d8385983efac9659c.png b/0.15/_images/math/ebb2cff7b67f3b8c4e06405d8385983efac9659c.png deleted file mode 100644 index 5db7cba0308bc..0000000000000 Binary files a/0.15/_images/math/ebb2cff7b67f3b8c4e06405d8385983efac9659c.png and /dev/null differ diff --git a/0.15/_images/math/ec6ee91dd7171da4cf7a8858d648c7537f0c02af.png b/0.15/_images/math/ec6ee91dd7171da4cf7a8858d648c7537f0c02af.png deleted file mode 100644 index 7aeac7c946d65..0000000000000 Binary files a/0.15/_images/math/ec6ee91dd7171da4cf7a8858d648c7537f0c02af.png and /dev/null differ diff --git a/0.15/_images/math/ecaf3ef86f6fd84b69074f272980febf7c6148ae.png b/0.15/_images/math/ecaf3ef86f6fd84b69074f272980febf7c6148ae.png deleted file mode 100644 index 5bc99a4ece532..0000000000000 Binary files a/0.15/_images/math/ecaf3ef86f6fd84b69074f272980febf7c6148ae.png and /dev/null differ diff --git a/0.15/_images/math/ed1224e5faf752a5cd66f7e2468ecc4f14208cf9.png b/0.15/_images/math/ed1224e5faf752a5cd66f7e2468ecc4f14208cf9.png deleted file mode 100644 index 7864fe4272139..0000000000000 Binary files a/0.15/_images/math/ed1224e5faf752a5cd66f7e2468ecc4f14208cf9.png and /dev/null differ diff --git a/0.15/_images/math/ed7238746ec0fb27be38187ff0576c83ecc0df8f.png b/0.15/_images/math/ed7238746ec0fb27be38187ff0576c83ecc0df8f.png deleted file mode 100644 index 149691d738336..0000000000000 Binary files a/0.15/_images/math/ed7238746ec0fb27be38187ff0576c83ecc0df8f.png and /dev/null differ diff --git a/0.15/_images/math/ee71d9a60992887aa4b7a1e010886633661a7ada.png b/0.15/_images/math/ee71d9a60992887aa4b7a1e010886633661a7ada.png deleted file mode 100644 index 0cfff4e4c1da9..0000000000000 Binary files a/0.15/_images/math/ee71d9a60992887aa4b7a1e010886633661a7ada.png and /dev/null differ diff --git a/0.15/_images/math/eea94c9618bb0685a05392b6f58fdf99abd1bb8e.png b/0.15/_images/math/eea94c9618bb0685a05392b6f58fdf99abd1bb8e.png deleted file mode 100644 index edada9bf553d6..0000000000000 Binary files a/0.15/_images/math/eea94c9618bb0685a05392b6f58fdf99abd1bb8e.png and /dev/null differ diff --git a/0.15/_images/math/eee75f0de1ffa68af07e423cdc89f87dd4a0c32a.png b/0.15/_images/math/eee75f0de1ffa68af07e423cdc89f87dd4a0c32a.png deleted file mode 100644 index 8359e79983de4..0000000000000 Binary files a/0.15/_images/math/eee75f0de1ffa68af07e423cdc89f87dd4a0c32a.png and /dev/null differ diff --git a/0.15/_images/math/eeed3159db3c4592236053169e26a6aa2cbca30d.png b/0.15/_images/math/eeed3159db3c4592236053169e26a6aa2cbca30d.png deleted file mode 100644 index 40c37a167edcc..0000000000000 Binary files a/0.15/_images/math/eeed3159db3c4592236053169e26a6aa2cbca30d.png and /dev/null differ diff --git a/0.15/_images/math/ef3b1509f6875e9429212166fde17194086bdd4e.png b/0.15/_images/math/ef3b1509f6875e9429212166fde17194086bdd4e.png deleted file mode 100644 index 9141c3ad2b574..0000000000000 Binary files a/0.15/_images/math/ef3b1509f6875e9429212166fde17194086bdd4e.png and /dev/null differ diff --git a/0.15/_images/math/ef45beaabfa8af02547f3cc68b4cb6c812bbb73b.png b/0.15/_images/math/ef45beaabfa8af02547f3cc68b4cb6c812bbb73b.png deleted file mode 100644 index 34dd0a8cddc1e..0000000000000 Binary files a/0.15/_images/math/ef45beaabfa8af02547f3cc68b4cb6c812bbb73b.png and /dev/null differ diff --git a/0.15/_images/math/ef9270877405055756d345facd044e4ab297f858.png b/0.15/_images/math/ef9270877405055756d345facd044e4ab297f858.png deleted file mode 100644 index b4285320d666d..0000000000000 Binary files a/0.15/_images/math/ef9270877405055756d345facd044e4ab297f858.png and /dev/null differ diff --git a/0.15/_images/math/efa692abc46aba225adbe774bd88586d30d62ab6.png b/0.15/_images/math/efa692abc46aba225adbe774bd88586d30d62ab6.png deleted file mode 100644 index 6a7ac1c2e44e6..0000000000000 Binary files a/0.15/_images/math/efa692abc46aba225adbe774bd88586d30d62ab6.png and /dev/null differ diff --git a/0.15/_images/math/efcf8324302d900d3e5d02f6b1215ebdb19c56a1.png b/0.15/_images/math/efcf8324302d900d3e5d02f6b1215ebdb19c56a1.png deleted file mode 100644 index 4b526d4aa45e7..0000000000000 Binary files a/0.15/_images/math/efcf8324302d900d3e5d02f6b1215ebdb19c56a1.png and /dev/null differ diff --git a/0.15/_images/math/f026aecf11ec7f6141ab863f260d395f94b10f51.png b/0.15/_images/math/f026aecf11ec7f6141ab863f260d395f94b10f51.png deleted file mode 100644 index 3de12b5f52b7f..0000000000000 Binary files a/0.15/_images/math/f026aecf11ec7f6141ab863f260d395f94b10f51.png and /dev/null differ diff --git a/0.15/_images/math/f03033722e159f6786afc42a9fd41401988ead89.png b/0.15/_images/math/f03033722e159f6786afc42a9fd41401988ead89.png deleted file mode 100644 index 84c5f7afabd80..0000000000000 Binary files a/0.15/_images/math/f03033722e159f6786afc42a9fd41401988ead89.png and /dev/null differ diff --git a/0.15/_images/math/f053df68f37ffa28944fe80c99adea2c99593e38.png b/0.15/_images/math/f053df68f37ffa28944fe80c99adea2c99593e38.png deleted file mode 100644 index 40df642e939cb..0000000000000 Binary files a/0.15/_images/math/f053df68f37ffa28944fe80c99adea2c99593e38.png and /dev/null differ diff --git a/0.15/_images/math/f12f7e91b0d9d96b5e417194a1a348c718b981b1.png b/0.15/_images/math/f12f7e91b0d9d96b5e417194a1a348c718b981b1.png deleted file mode 100644 index 5e80e6185154c..0000000000000 Binary files a/0.15/_images/math/f12f7e91b0d9d96b5e417194a1a348c718b981b1.png and /dev/null differ diff --git a/0.15/_images/math/f17f00ba8893fd3ea1e8cc7870ba73a12f031c08.png b/0.15/_images/math/f17f00ba8893fd3ea1e8cc7870ba73a12f031c08.png deleted file mode 100644 index 495ad56a277bf..0000000000000 Binary files a/0.15/_images/math/f17f00ba8893fd3ea1e8cc7870ba73a12f031c08.png and /dev/null differ diff --git a/0.15/_images/math/f185d30ec52427801782cc5d5d810d04577604d9.png b/0.15/_images/math/f185d30ec52427801782cc5d5d810d04577604d9.png deleted file mode 100644 index f3940a3ceb401..0000000000000 Binary files a/0.15/_images/math/f185d30ec52427801782cc5d5d810d04577604d9.png and /dev/null differ diff --git a/0.15/_images/math/f26b81fda0dc2a941a15a041e21408577e7f5480.png b/0.15/_images/math/f26b81fda0dc2a941a15a041e21408577e7f5480.png deleted file mode 100644 index 3d07f6ee46aed..0000000000000 Binary files a/0.15/_images/math/f26b81fda0dc2a941a15a041e21408577e7f5480.png and /dev/null differ diff --git a/0.15/_images/math/f2f07f15055990c760c0ab754000b97bed50c917.png b/0.15/_images/math/f2f07f15055990c760c0ab754000b97bed50c917.png deleted file mode 100644 index 45c3f591d31c0..0000000000000 Binary files a/0.15/_images/math/f2f07f15055990c760c0ab754000b97bed50c917.png and /dev/null differ diff --git a/0.15/_images/math/f3091884c27e435e5d5ae644973e48870caa9cd7.png b/0.15/_images/math/f3091884c27e435e5d5ae644973e48870caa9cd7.png deleted file mode 100644 index 73c1f94d811e9..0000000000000 Binary files a/0.15/_images/math/f3091884c27e435e5d5ae644973e48870caa9cd7.png and /dev/null differ diff --git a/0.15/_images/math/f3162c5a338569e895ef9e8200a5a69bef9c7dfa.png b/0.15/_images/math/f3162c5a338569e895ef9e8200a5a69bef9c7dfa.png deleted file mode 100644 index b245c4dd41254..0000000000000 Binary files a/0.15/_images/math/f3162c5a338569e895ef9e8200a5a69bef9c7dfa.png and /dev/null differ diff --git a/0.15/_images/math/f348c73e654151e416e3c525b2ff7803590754ce.png b/0.15/_images/math/f348c73e654151e416e3c525b2ff7803590754ce.png deleted file mode 100644 index 69132cb3ad224..0000000000000 Binary files a/0.15/_images/math/f348c73e654151e416e3c525b2ff7803590754ce.png and /dev/null differ diff --git a/0.15/_images/math/f48b617185733d8dd6712643f1ab17c736661a06.png b/0.15/_images/math/f48b617185733d8dd6712643f1ab17c736661a06.png deleted file mode 100644 index e1ba6e458d685..0000000000000 Binary files a/0.15/_images/math/f48b617185733d8dd6712643f1ab17c736661a06.png and /dev/null differ diff --git a/0.15/_images/math/f50254c0b168d61d990acac162a65694626dd16f.png b/0.15/_images/math/f50254c0b168d61d990acac162a65694626dd16f.png deleted file mode 100644 index 20209c113aceb..0000000000000 Binary files a/0.15/_images/math/f50254c0b168d61d990acac162a65694626dd16f.png and /dev/null differ diff --git a/0.15/_images/math/f517ce4e0d7328c27b2820bb5259535d3e1d8aa7.png b/0.15/_images/math/f517ce4e0d7328c27b2820bb5259535d3e1d8aa7.png deleted file mode 100644 index b0859c2fbd449..0000000000000 Binary files a/0.15/_images/math/f517ce4e0d7328c27b2820bb5259535d3e1d8aa7.png and /dev/null differ diff --git a/0.15/_images/math/f574498915fa9e02eeb5141c24835d077eba3e75.png b/0.15/_images/math/f574498915fa9e02eeb5141c24835d077eba3e75.png deleted file mode 100644 index b97eade05ce06..0000000000000 Binary files a/0.15/_images/math/f574498915fa9e02eeb5141c24835d077eba3e75.png and /dev/null differ diff --git a/0.15/_images/math/f5edd8e9205dfc62dfbaa2de49e1b86a2e076038.png b/0.15/_images/math/f5edd8e9205dfc62dfbaa2de49e1b86a2e076038.png deleted file mode 100644 index 744813c3afc60..0000000000000 Binary files a/0.15/_images/math/f5edd8e9205dfc62dfbaa2de49e1b86a2e076038.png and /dev/null differ diff --git a/0.15/_images/math/f5ee3e6dd2b03108b0874de08173a2312a061e0c.png b/0.15/_images/math/f5ee3e6dd2b03108b0874de08173a2312a061e0c.png deleted file mode 100644 index 34ce0f4a821d0..0000000000000 Binary files a/0.15/_images/math/f5ee3e6dd2b03108b0874de08173a2312a061e0c.png and /dev/null differ diff --git a/0.15/_images/math/f639c61c3322f48687bf08827b851de13d220c0d.png b/0.15/_images/math/f639c61c3322f48687bf08827b851de13d220c0d.png deleted file mode 100644 index 3335097d44c88..0000000000000 Binary files a/0.15/_images/math/f639c61c3322f48687bf08827b851de13d220c0d.png and /dev/null differ diff --git a/0.15/_images/math/f683a5dcec20d2e17aea5cbe6836d64e05107cb2.png b/0.15/_images/math/f683a5dcec20d2e17aea5cbe6836d64e05107cb2.png deleted file mode 100644 index 0b5a364cae7c7..0000000000000 Binary files a/0.15/_images/math/f683a5dcec20d2e17aea5cbe6836d64e05107cb2.png and /dev/null differ diff --git a/0.15/_images/math/f69de20a51ef33260d6ce693d077cfb3a1c68f1c.png b/0.15/_images/math/f69de20a51ef33260d6ce693d077cfb3a1c68f1c.png deleted file mode 100644 index b7a44e7c482d3..0000000000000 Binary files a/0.15/_images/math/f69de20a51ef33260d6ce693d077cfb3a1c68f1c.png and /dev/null differ diff --git a/0.15/_images/math/f6c463bfc8a99bc816f44ceaf875e0ec258397da.png b/0.15/_images/math/f6c463bfc8a99bc816f44ceaf875e0ec258397da.png deleted file mode 100644 index 18bc4e0fbef8c..0000000000000 Binary files a/0.15/_images/math/f6c463bfc8a99bc816f44ceaf875e0ec258397da.png and /dev/null differ diff --git a/0.15/_images/math/f7c20d233f3b81c6c4a72366352f7029d73a2eb3.png b/0.15/_images/math/f7c20d233f3b81c6c4a72366352f7029d73a2eb3.png deleted file mode 100644 index 1f3194c638c07..0000000000000 Binary files a/0.15/_images/math/f7c20d233f3b81c6c4a72366352f7029d73a2eb3.png and /dev/null differ diff --git a/0.15/_images/math/f8029f7b6c8fc80db737d850ed8e10ea8f27e410.png b/0.15/_images/math/f8029f7b6c8fc80db737d850ed8e10ea8f27e410.png deleted file mode 100644 index f88f9983bc197..0000000000000 Binary files a/0.15/_images/math/f8029f7b6c8fc80db737d850ed8e10ea8f27e410.png and /dev/null differ diff --git a/0.15/_images/math/f812188f63141acf67e13dca94938ea66c93d8b3.png b/0.15/_images/math/f812188f63141acf67e13dca94938ea66c93d8b3.png deleted file mode 100644 index 3ac8743cd1802..0000000000000 Binary files a/0.15/_images/math/f812188f63141acf67e13dca94938ea66c93d8b3.png and /dev/null differ diff --git a/0.15/_images/math/f83bbb89a735c6e2de5fed05a31ac683d1c20699.png b/0.15/_images/math/f83bbb89a735c6e2de5fed05a31ac683d1c20699.png deleted file mode 100644 index 296ad8684bb5c..0000000000000 Binary files a/0.15/_images/math/f83bbb89a735c6e2de5fed05a31ac683d1c20699.png and /dev/null differ diff --git a/0.15/_images/math/f8afca83661dfb09c017881fb7253c825b3f0bf5.png b/0.15/_images/math/f8afca83661dfb09c017881fb7253c825b3f0bf5.png deleted file mode 100644 index 6575bd1dce2e3..0000000000000 Binary files a/0.15/_images/math/f8afca83661dfb09c017881fb7253c825b3f0bf5.png and /dev/null differ diff --git a/0.15/_images/math/f8c970d4708d48881c2bd5a79a7fc062153f3e6d.png b/0.15/_images/math/f8c970d4708d48881c2bd5a79a7fc062153f3e6d.png deleted file mode 100644 index 4a2eb571f7831..0000000000000 Binary files a/0.15/_images/math/f8c970d4708d48881c2bd5a79a7fc062153f3e6d.png and /dev/null differ diff --git a/0.15/_images/math/f8d5d8d5e7d9ea881f1b65e56a38ae02156a773f.png b/0.15/_images/math/f8d5d8d5e7d9ea881f1b65e56a38ae02156a773f.png deleted file mode 100644 index aa29d7e034606..0000000000000 Binary files a/0.15/_images/math/f8d5d8d5e7d9ea881f1b65e56a38ae02156a773f.png and /dev/null differ diff --git a/0.15/_images/math/f8f4f6c615ba73bfa56ee8121d9e72708924c579.png b/0.15/_images/math/f8f4f6c615ba73bfa56ee8121d9e72708924c579.png deleted file mode 100644 index cc7c2601982e1..0000000000000 Binary files a/0.15/_images/math/f8f4f6c615ba73bfa56ee8121d9e72708924c579.png and /dev/null differ diff --git a/0.15/_images/math/f92ab7ae092a16eac5c7423d7c5446623447d724.png b/0.15/_images/math/f92ab7ae092a16eac5c7423d7c5446623447d724.png deleted file mode 100644 index 3d94cbd88a71c..0000000000000 Binary files a/0.15/_images/math/f92ab7ae092a16eac5c7423d7c5446623447d724.png and /dev/null differ diff --git a/0.15/_images/math/fa34489cf430b7630b30f28b2eb050e2489e3523.png b/0.15/_images/math/fa34489cf430b7630b30f28b2eb050e2489e3523.png deleted file mode 100644 index 66befbb866137..0000000000000 Binary files a/0.15/_images/math/fa34489cf430b7630b30f28b2eb050e2489e3523.png and /dev/null differ diff --git a/0.15/_images/math/fa783a40c941809a86798f349af56396e15c1394.png b/0.15/_images/math/fa783a40c941809a86798f349af56396e15c1394.png deleted file mode 100644 index 47d7e1a54e3d7..0000000000000 Binary files a/0.15/_images/math/fa783a40c941809a86798f349af56396e15c1394.png and /dev/null differ diff --git a/0.15/_images/math/fabb5cd5dc86de2c0afb132798404b7646fa72eb.png b/0.15/_images/math/fabb5cd5dc86de2c0afb132798404b7646fa72eb.png deleted file mode 100644 index e9af7fdc5d8c3..0000000000000 Binary files a/0.15/_images/math/fabb5cd5dc86de2c0afb132798404b7646fa72eb.png and /dev/null differ diff --git a/0.15/_images/math/fb542518f2c3338d27234e14932fd1ab5a311d8b.png b/0.15/_images/math/fb542518f2c3338d27234e14932fd1ab5a311d8b.png deleted file mode 100644 index 43c276ed70745..0000000000000 Binary files a/0.15/_images/math/fb542518f2c3338d27234e14932fd1ab5a311d8b.png and /dev/null differ diff --git a/0.15/_images/math/fb761c2e199ad45ccf14767f48b88169479d840f.png b/0.15/_images/math/fb761c2e199ad45ccf14767f48b88169479d840f.png deleted file mode 100644 index 4417f7c107d06..0000000000000 Binary files a/0.15/_images/math/fb761c2e199ad45ccf14767f48b88169479d840f.png and /dev/null differ diff --git a/0.15/_images/math/fbef4da83706299daf2d9e8ac762cb70fae90a64.png b/0.15/_images/math/fbef4da83706299daf2d9e8ac762cb70fae90a64.png deleted file mode 100644 index 9f4ea8d161950..0000000000000 Binary files a/0.15/_images/math/fbef4da83706299daf2d9e8ac762cb70fae90a64.png and /dev/null differ diff --git a/0.15/_images/math/fc01155981c5427ca134c16d49045303cd94fb1d.png b/0.15/_images/math/fc01155981c5427ca134c16d49045303cd94fb1d.png deleted file mode 100644 index 25c224450674e..0000000000000 Binary files a/0.15/_images/math/fc01155981c5427ca134c16d49045303cd94fb1d.png and /dev/null differ diff --git a/0.15/_images/math/fc0152f5f19bbdb955220f96cd6c05612e57ac07.png b/0.15/_images/math/fc0152f5f19bbdb955220f96cd6c05612e57ac07.png deleted file mode 100644 index ae41c6644954d..0000000000000 Binary files a/0.15/_images/math/fc0152f5f19bbdb955220f96cd6c05612e57ac07.png and /dev/null differ diff --git a/0.15/_images/math/fc84de1d23be724722d5ac285c78f4c77b780b36.png b/0.15/_images/math/fc84de1d23be724722d5ac285c78f4c77b780b36.png deleted file mode 100644 index 2ab948221e75d..0000000000000 Binary files a/0.15/_images/math/fc84de1d23be724722d5ac285c78f4c77b780b36.png and /dev/null differ diff --git a/0.15/_images/math/fc9b39d13c288347abb9aef1e1591a4ea3b85b00.png b/0.15/_images/math/fc9b39d13c288347abb9aef1e1591a4ea3b85b00.png deleted file mode 100644 index 792aa7ebbab68..0000000000000 Binary files a/0.15/_images/math/fc9b39d13c288347abb9aef1e1591a4ea3b85b00.png and /dev/null differ diff --git a/0.15/_images/math/fcd6f632794fa15a93253fc5edddb129eae8d43e.png b/0.15/_images/math/fcd6f632794fa15a93253fc5edddb129eae8d43e.png deleted file mode 100644 index 5026297528bf9..0000000000000 Binary files a/0.15/_images/math/fcd6f632794fa15a93253fc5edddb129eae8d43e.png and /dev/null differ diff --git a/0.15/_images/math/fd50496ee4e6ec416aa56ab293a06437daeb350f.png b/0.15/_images/math/fd50496ee4e6ec416aa56ab293a06437daeb350f.png deleted file mode 100644 index c7ef8adf76c3b..0000000000000 Binary files a/0.15/_images/math/fd50496ee4e6ec416aa56ab293a06437daeb350f.png and /dev/null differ diff --git a/0.15/_images/math/fe970e16ff695918dee492901a03d3d94e3d3573.png b/0.15/_images/math/fe970e16ff695918dee492901a03d3d94e3d3573.png deleted file mode 100644 index 5ce5f1da123fa..0000000000000 Binary files a/0.15/_images/math/fe970e16ff695918dee492901a03d3d94e3d3573.png and /dev/null differ diff --git a/0.15/_images/math/feb3126b0fb5781eda481cb843d0fa9944c4b4c1.png b/0.15/_images/math/feb3126b0fb5781eda481cb843d0fa9944c4b4c1.png deleted file mode 100644 index fbb263f8d6dd7..0000000000000 Binary files a/0.15/_images/math/feb3126b0fb5781eda481cb843d0fa9944c4b4c1.png and /dev/null differ diff --git a/0.15/_images/math/ff9da5d2add368dd1270ed207ae10e8ca80b4620.png b/0.15/_images/math/ff9da5d2add368dd1270ed207ae10e8ca80b4620.png deleted file mode 100644 index bf52800bedb4f..0000000000000 Binary files a/0.15/_images/math/ff9da5d2add368dd1270ed207ae10e8ca80b4620.png and /dev/null differ diff --git a/0.15/_images/math/ffc7ed353dab8e432d5438f675003c661b61c118.png b/0.15/_images/math/ffc7ed353dab8e432d5438f675003c661b61c118.png deleted file mode 100644 index 5b9994dd9545d..0000000000000 Binary files a/0.15/_images/math/ffc7ed353dab8e432d5438f675003c661b61c118.png and /dev/null differ diff --git a/0.15/_images/math/ffc7ffb023543eb9d03dcba0d162e0a193f460fe.png b/0.15/_images/math/ffc7ffb023543eb9d03dcba0d162e0a193f460fe.png deleted file mode 100644 index b5efe3860e5a5..0000000000000 Binary files a/0.15/_images/math/ffc7ffb023543eb9d03dcba0d162e0a193f460fe.png and /dev/null differ diff --git a/0.15/_images/missing_values.png b/0.15/_images/missing_values.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/missing_values.png and /dev/null differ diff --git a/0.15/_images/missing_values1.png b/0.15/_images/missing_values1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/missing_values1.png and /dev/null differ diff --git a/0.15/_images/mlcomp_sparse_document_classification.png b/0.15/_images/mlcomp_sparse_document_classification.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/mlcomp_sparse_document_classification.png and /dev/null differ diff --git a/0.15/_images/mlcomp_sparse_document_classification1.png b/0.15/_images/mlcomp_sparse_document_classification1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/mlcomp_sparse_document_classification1.png and /dev/null differ diff --git a/0.15/_images/okcupid.png b/0.15/_images/okcupid.png deleted file mode 100644 index f73de3cdf6d63..0000000000000 Binary files a/0.15/_images/okcupid.png and /dev/null differ diff --git a/0.15/_images/peerindex.png b/0.15/_images/peerindex.png deleted file mode 100644 index 1538dadfe46c5..0000000000000 Binary files a/0.15/_images/peerindex.png and /dev/null differ diff --git a/0.15/_images/phimeca.png b/0.15/_images/phimeca.png deleted file mode 100644 index 3f8d5d3aa492b..0000000000000 Binary files a/0.15/_images/phimeca.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_hastie_10_2.png b/0.15/_images/plot_adaboost_hastie_10_2.png deleted file mode 100644 index 2f8cc71123a06..0000000000000 Binary files a/0.15/_images/plot_adaboost_hastie_10_2.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_hastie_10_21.png b/0.15/_images/plot_adaboost_hastie_10_21.png deleted file mode 100644 index 2f8cc71123a06..0000000000000 Binary files a/0.15/_images/plot_adaboost_hastie_10_21.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_hastie_10_2_001.png b/0.15/_images/plot_adaboost_hastie_10_2_001.png deleted file mode 100644 index 77ee344046210..0000000000000 Binary files a/0.15/_images/plot_adaboost_hastie_10_2_001.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_hastie_10_2_0011.png b/0.15/_images/plot_adaboost_hastie_10_2_0011.png deleted file mode 100644 index 77ee344046210..0000000000000 Binary files a/0.15/_images/plot_adaboost_hastie_10_2_0011.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_multiclass.png b/0.15/_images/plot_adaboost_multiclass.png deleted file mode 100644 index 5e02524907cd4..0000000000000 Binary files a/0.15/_images/plot_adaboost_multiclass.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_multiclass1.png b/0.15/_images/plot_adaboost_multiclass1.png deleted file mode 100644 index 5e02524907cd4..0000000000000 Binary files a/0.15/_images/plot_adaboost_multiclass1.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_multiclass_001.png b/0.15/_images/plot_adaboost_multiclass_001.png deleted file mode 100644 index 18ca6a15cb467..0000000000000 Binary files a/0.15/_images/plot_adaboost_multiclass_001.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_regression.png b/0.15/_images/plot_adaboost_regression.png deleted file mode 100644 index dfdf93efd458b..0000000000000 Binary files a/0.15/_images/plot_adaboost_regression.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_regression1.png b/0.15/_images/plot_adaboost_regression1.png deleted file mode 100644 index dfdf93efd458b..0000000000000 Binary files a/0.15/_images/plot_adaboost_regression1.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_regression_001.png b/0.15/_images/plot_adaboost_regression_001.png deleted file mode 100644 index 3152428d6728d..0000000000000 Binary files a/0.15/_images/plot_adaboost_regression_001.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_twoclass.png b/0.15/_images/plot_adaboost_twoclass.png deleted file mode 100644 index 890d43fb19366..0000000000000 Binary files a/0.15/_images/plot_adaboost_twoclass.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_twoclass1.png b/0.15/_images/plot_adaboost_twoclass1.png deleted file mode 100644 index 890d43fb19366..0000000000000 Binary files a/0.15/_images/plot_adaboost_twoclass1.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_twoclass_001.png b/0.15/_images/plot_adaboost_twoclass_001.png deleted file mode 100644 index 81ddff0f82ff5..0000000000000 Binary files a/0.15/_images/plot_adaboost_twoclass_001.png and /dev/null differ diff --git a/0.15/_images/plot_adaboost_twoclass_carousel.png b/0.15/_images/plot_adaboost_twoclass_carousel.png deleted file mode 100644 index ed9226484a1fe..0000000000000 Binary files a/0.15/_images/plot_adaboost_twoclass_carousel.png and /dev/null differ diff --git a/0.15/_images/plot_adjusted_for_chance_measures.png b/0.15/_images/plot_adjusted_for_chance_measures.png deleted file mode 100644 index 2239e53a0216d..0000000000000 Binary files a/0.15/_images/plot_adjusted_for_chance_measures.png and /dev/null differ diff --git a/0.15/_images/plot_adjusted_for_chance_measures1.png b/0.15/_images/plot_adjusted_for_chance_measures1.png deleted file mode 100644 index 2239e53a0216d..0000000000000 Binary files a/0.15/_images/plot_adjusted_for_chance_measures1.png and /dev/null differ diff --git a/0.15/_images/plot_adjusted_for_chance_measures_001.png b/0.15/_images/plot_adjusted_for_chance_measures_001.png deleted file mode 100644 index a218f530dfad1..0000000000000 Binary files a/0.15/_images/plot_adjusted_for_chance_measures_001.png and /dev/null differ diff --git a/0.15/_images/plot_adjusted_for_chance_measures_0011.png b/0.15/_images/plot_adjusted_for_chance_measures_0011.png deleted file mode 100644 index a218f530dfad1..0000000000000 Binary files a/0.15/_images/plot_adjusted_for_chance_measures_0011.png and /dev/null differ diff --git a/0.15/_images/plot_adjusted_for_chance_measures_002.png b/0.15/_images/plot_adjusted_for_chance_measures_002.png deleted file mode 100644 index a3bbb0e0ba208..0000000000000 Binary files a/0.15/_images/plot_adjusted_for_chance_measures_002.png and /dev/null differ diff --git a/0.15/_images/plot_affinity_propagation.png b/0.15/_images/plot_affinity_propagation.png deleted file mode 100644 index 72a7e827a875a..0000000000000 Binary files a/0.15/_images/plot_affinity_propagation.png and /dev/null differ diff --git a/0.15/_images/plot_affinity_propagation1.png b/0.15/_images/plot_affinity_propagation1.png deleted file mode 100644 index 72a7e827a875a..0000000000000 Binary files a/0.15/_images/plot_affinity_propagation1.png and /dev/null differ diff --git a/0.15/_images/plot_affinity_propagation_001.png b/0.15/_images/plot_affinity_propagation_001.png deleted file mode 100644 index d7a68c0c656ec..0000000000000 Binary files a/0.15/_images/plot_affinity_propagation_001.png and /dev/null differ diff --git a/0.15/_images/plot_affinity_propagation_0011.png b/0.15/_images/plot_affinity_propagation_0011.png deleted file mode 100644 index d7a68c0c656ec..0000000000000 Binary files a/0.15/_images/plot_affinity_propagation_0011.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering.png b/0.15/_images/plot_agglomerative_clustering.png deleted file mode 100644 index c9c4dd8e6335d..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering1.png b/0.15/_images/plot_agglomerative_clustering1.png deleted file mode 100644 index c9c4dd8e6335d..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering1.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_001.png b/0.15/_images/plot_agglomerative_clustering_001.png deleted file mode 100644 index 07347e5161c5b..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_001.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_0011.png b/0.15/_images/plot_agglomerative_clustering_0011.png deleted file mode 100644 index 07347e5161c5b..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_0011.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_002.png b/0.15/_images/plot_agglomerative_clustering_002.png deleted file mode 100644 index 3f2123f52f944..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_002.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_0021.png b/0.15/_images/plot_agglomerative_clustering_0021.png deleted file mode 100644 index 3f2123f52f944..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_0021.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_003.png b/0.15/_images/plot_agglomerative_clustering_003.png deleted file mode 100644 index 019ff24f6b5ea..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_003.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_0031.png b/0.15/_images/plot_agglomerative_clustering_0031.png deleted file mode 100644 index 019ff24f6b5ea..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_0031.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_004.png b/0.15/_images/plot_agglomerative_clustering_004.png deleted file mode 100644 index 90c53d471b90e..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_004.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_0041.png b/0.15/_images/plot_agglomerative_clustering_0041.png deleted file mode 100644 index 90c53d471b90e..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_0041.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics.png b/0.15/_images/plot_agglomerative_clustering_metrics.png deleted file mode 100644 index 4b384488c26ac..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics1.png b/0.15/_images/plot_agglomerative_clustering_metrics1.png deleted file mode 100644 index 4b384488c26ac..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics1.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_001.png b/0.15/_images/plot_agglomerative_clustering_metrics_001.png deleted file mode 100644 index 554a503d5e2b7..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_001.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_002.png b/0.15/_images/plot_agglomerative_clustering_metrics_002.png deleted file mode 100644 index 42fba3f4faba8..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_002.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_003.png b/0.15/_images/plot_agglomerative_clustering_metrics_003.png deleted file mode 100644 index 365f8bc80b76a..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_003.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_004.png b/0.15/_images/plot_agglomerative_clustering_metrics_004.png deleted file mode 100644 index 86afcb3369d4e..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_004.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_005.png b/0.15/_images/plot_agglomerative_clustering_metrics_005.png deleted file mode 100644 index e4a94e4eae693..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_005.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_0051.png b/0.15/_images/plot_agglomerative_clustering_metrics_0051.png deleted file mode 100644 index e4a94e4eae693..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_0051.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_006.png b/0.15/_images/plot_agglomerative_clustering_metrics_006.png deleted file mode 100644 index 2bbe7c63962c2..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_006.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_0061.png b/0.15/_images/plot_agglomerative_clustering_metrics_0061.png deleted file mode 100644 index 2bbe7c63962c2..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_0061.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_007.png b/0.15/_images/plot_agglomerative_clustering_metrics_007.png deleted file mode 100644 index afc8cd18d7dc1..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_007.png and /dev/null differ diff --git a/0.15/_images/plot_agglomerative_clustering_metrics_0071.png b/0.15/_images/plot_agglomerative_clustering_metrics_0071.png deleted file mode 100644 index afc8cd18d7dc1..0000000000000 Binary files a/0.15/_images/plot_agglomerative_clustering_metrics_0071.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters.png b/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters.png deleted file mode 100644 index e46b0867866bf..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters1.png b/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters1.png deleted file mode 100644 index e46b0867866bf..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters1.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_001.png b/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_001.png deleted file mode 100644 index c5767674bd4ee..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_001.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_0011.png b/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_0011.png deleted file mode 100644 index c5767674bd4ee..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_0011.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_002.png b/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_002.png deleted file mode 100644 index 3b3310ae5c3b1..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_002.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_0021.png b/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_0021.png deleted file mode 100644 index 3b3310ae5c3b1..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_hyperparameters_0021.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_scalability.png b/0.15/_images/plot_approximate_nearest_neighbors_scalability.png deleted file mode 100644 index 7cd76fd2d9846..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_scalability.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_scalability1.png b/0.15/_images/plot_approximate_nearest_neighbors_scalability1.png deleted file mode 100644 index 7cd76fd2d9846..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_scalability1.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_scalability_001.png b/0.15/_images/plot_approximate_nearest_neighbors_scalability_001.png deleted file mode 100644 index 27674b4b2d0f1..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_scalability_001.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_scalability_0011.png b/0.15/_images/plot_approximate_nearest_neighbors_scalability_0011.png deleted file mode 100644 index 27674b4b2d0f1..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_scalability_0011.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_scalability_002.png b/0.15/_images/plot_approximate_nearest_neighbors_scalability_002.png deleted file mode 100644 index 8e3402f8d51e9..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_scalability_002.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_scalability_0021.png b/0.15/_images/plot_approximate_nearest_neighbors_scalability_0021.png deleted file mode 100644 index 8e3402f8d51e9..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_scalability_0021.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_scalability_003.png b/0.15/_images/plot_approximate_nearest_neighbors_scalability_003.png deleted file mode 100644 index 6f3d08b86325e..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_scalability_003.png and /dev/null differ diff --git a/0.15/_images/plot_approximate_nearest_neighbors_scalability_0031.png b/0.15/_images/plot_approximate_nearest_neighbors_scalability_0031.png deleted file mode 100644 index 6f3d08b86325e..0000000000000 Binary files a/0.15/_images/plot_approximate_nearest_neighbors_scalability_0031.png and /dev/null differ diff --git a/0.15/_images/plot_ard.png b/0.15/_images/plot_ard.png deleted file mode 100644 index 32a8f60356c1f..0000000000000 Binary files a/0.15/_images/plot_ard.png and /dev/null differ diff --git a/0.15/_images/plot_ard1.png b/0.15/_images/plot_ard1.png deleted file mode 100644 index 32a8f60356c1f..0000000000000 Binary files a/0.15/_images/plot_ard1.png and /dev/null differ diff --git a/0.15/_images/plot_ard_001.png b/0.15/_images/plot_ard_001.png deleted file mode 100644 index 4366ba1a8864d..0000000000000 Binary files a/0.15/_images/plot_ard_001.png and /dev/null differ diff --git a/0.15/_images/plot_ard_0011.png b/0.15/_images/plot_ard_0011.png deleted file mode 100644 index 4366ba1a8864d..0000000000000 Binary files a/0.15/_images/plot_ard_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ard_002.png b/0.15/_images/plot_ard_002.png deleted file mode 100644 index 3ef5c6796a19a..0000000000000 Binary files a/0.15/_images/plot_ard_002.png and /dev/null differ diff --git a/0.15/_images/plot_ard_003.png b/0.15/_images/plot_ard_003.png deleted file mode 100644 index f1191e862303a..0000000000000 Binary files a/0.15/_images/plot_ard_003.png and /dev/null differ diff --git a/0.15/_images/plot_bayesian_ridge.png b/0.15/_images/plot_bayesian_ridge.png deleted file mode 100644 index 398938984a684..0000000000000 Binary files a/0.15/_images/plot_bayesian_ridge.png and /dev/null differ diff --git a/0.15/_images/plot_bayesian_ridge1.png b/0.15/_images/plot_bayesian_ridge1.png deleted file mode 100644 index 398938984a684..0000000000000 Binary files a/0.15/_images/plot_bayesian_ridge1.png and /dev/null differ diff --git a/0.15/_images/plot_bayesian_ridge_001.png b/0.15/_images/plot_bayesian_ridge_001.png deleted file mode 100644 index 97fdbad84d743..0000000000000 Binary files a/0.15/_images/plot_bayesian_ridge_001.png and /dev/null differ diff --git a/0.15/_images/plot_bayesian_ridge_0011.png b/0.15/_images/plot_bayesian_ridge_0011.png deleted file mode 100644 index 97fdbad84d743..0000000000000 Binary files a/0.15/_images/plot_bayesian_ridge_0011.png and /dev/null differ diff --git a/0.15/_images/plot_bayesian_ridge_002.png b/0.15/_images/plot_bayesian_ridge_002.png deleted file mode 100644 index 0279de3e246ee..0000000000000 Binary files a/0.15/_images/plot_bayesian_ridge_002.png and /dev/null differ diff --git a/0.15/_images/plot_bayesian_ridge_003.png b/0.15/_images/plot_bayesian_ridge_003.png deleted file mode 100644 index 8d55d429d86ab..0000000000000 Binary files a/0.15/_images/plot_bayesian_ridge_003.png and /dev/null differ diff --git a/0.15/_images/plot_bias_variance.png b/0.15/_images/plot_bias_variance.png deleted file mode 100644 index 464e98933a1f3..0000000000000 Binary files a/0.15/_images/plot_bias_variance.png and /dev/null differ diff --git a/0.15/_images/plot_bias_variance1.png b/0.15/_images/plot_bias_variance1.png deleted file mode 100644 index 464e98933a1f3..0000000000000 Binary files a/0.15/_images/plot_bias_variance1.png and /dev/null differ diff --git a/0.15/_images/plot_bias_variance_001.png b/0.15/_images/plot_bias_variance_001.png deleted file mode 100644 index c82fa37d62c3b..0000000000000 Binary files a/0.15/_images/plot_bias_variance_001.png and /dev/null differ diff --git a/0.15/_images/plot_birch_vs_minibatchkmeans.png b/0.15/_images/plot_birch_vs_minibatchkmeans.png deleted file mode 100644 index 1e26f801a0ddf..0000000000000 Binary files a/0.15/_images/plot_birch_vs_minibatchkmeans.png and /dev/null differ diff --git a/0.15/_images/plot_birch_vs_minibatchkmeans1.png b/0.15/_images/plot_birch_vs_minibatchkmeans1.png deleted file mode 100644 index 1e26f801a0ddf..0000000000000 Binary files a/0.15/_images/plot_birch_vs_minibatchkmeans1.png and /dev/null differ diff --git a/0.15/_images/plot_birch_vs_minibatchkmeans_001.png b/0.15/_images/plot_birch_vs_minibatchkmeans_001.png deleted file mode 100644 index 6fcd1c9addb3b..0000000000000 Binary files a/0.15/_images/plot_birch_vs_minibatchkmeans_001.png and /dev/null differ diff --git a/0.15/_images/plot_birch_vs_minibatchkmeans_0011.png b/0.15/_images/plot_birch_vs_minibatchkmeans_0011.png deleted file mode 100644 index 6fcd1c9addb3b..0000000000000 Binary files a/0.15/_images/plot_birch_vs_minibatchkmeans_0011.png and /dev/null differ diff --git a/0.15/_images/plot_calibration.png b/0.15/_images/plot_calibration.png deleted file mode 100644 index 56ad72cd6ba91..0000000000000 Binary files a/0.15/_images/plot_calibration.png and /dev/null differ diff --git a/0.15/_images/plot_calibration1.png b/0.15/_images/plot_calibration1.png deleted file mode 100644 index 56ad72cd6ba91..0000000000000 Binary files a/0.15/_images/plot_calibration1.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_001.png b/0.15/_images/plot_calibration_001.png deleted file mode 100644 index d5e4977bafd56..0000000000000 Binary files a/0.15/_images/plot_calibration_001.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_0011.png b/0.15/_images/plot_calibration_0011.png deleted file mode 100644 index d5e4977bafd56..0000000000000 Binary files a/0.15/_images/plot_calibration_0011.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_002.png b/0.15/_images/plot_calibration_002.png deleted file mode 100644 index 604bcf78296c6..0000000000000 Binary files a/0.15/_images/plot_calibration_002.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_0021.png b/0.15/_images/plot_calibration_0021.png deleted file mode 100644 index 604bcf78296c6..0000000000000 Binary files a/0.15/_images/plot_calibration_0021.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_curve.png b/0.15/_images/plot_calibration_curve.png deleted file mode 100644 index 15360a5298ffb..0000000000000 Binary files a/0.15/_images/plot_calibration_curve.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_curve1.png b/0.15/_images/plot_calibration_curve1.png deleted file mode 100644 index 15360a5298ffb..0000000000000 Binary files a/0.15/_images/plot_calibration_curve1.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_curve_001.png b/0.15/_images/plot_calibration_curve_001.png deleted file mode 100644 index f393aa89bad03..0000000000000 Binary files a/0.15/_images/plot_calibration_curve_001.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_curve_0011.png b/0.15/_images/plot_calibration_curve_0011.png deleted file mode 100644 index f393aa89bad03..0000000000000 Binary files a/0.15/_images/plot_calibration_curve_0011.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_curve_002.png b/0.15/_images/plot_calibration_curve_002.png deleted file mode 100644 index e0aba4ce60d3d..0000000000000 Binary files a/0.15/_images/plot_calibration_curve_002.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_curve_0021.png b/0.15/_images/plot_calibration_curve_0021.png deleted file mode 100644 index e0aba4ce60d3d..0000000000000 Binary files a/0.15/_images/plot_calibration_curve_0021.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_multiclass.png b/0.15/_images/plot_calibration_multiclass.png deleted file mode 100644 index 18d209cf4daee..0000000000000 Binary files a/0.15/_images/plot_calibration_multiclass.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_multiclass1.png b/0.15/_images/plot_calibration_multiclass1.png deleted file mode 100644 index 18d209cf4daee..0000000000000 Binary files a/0.15/_images/plot_calibration_multiclass1.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_multiclass_000.png b/0.15/_images/plot_calibration_multiclass_000.png deleted file mode 100644 index 75b8f1c53e7c0..0000000000000 Binary files a/0.15/_images/plot_calibration_multiclass_000.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_multiclass_0001.png b/0.15/_images/plot_calibration_multiclass_0001.png deleted file mode 100644 index 75b8f1c53e7c0..0000000000000 Binary files a/0.15/_images/plot_calibration_multiclass_0001.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_multiclass_001.png b/0.15/_images/plot_calibration_multiclass_001.png deleted file mode 100644 index 5614612fe8292..0000000000000 Binary files a/0.15/_images/plot_calibration_multiclass_001.png and /dev/null differ diff --git a/0.15/_images/plot_calibration_multiclass_0011.png b/0.15/_images/plot_calibration_multiclass_0011.png deleted file mode 100644 index 5614612fe8292..0000000000000 Binary files a/0.15/_images/plot_calibration_multiclass_0011.png and /dev/null differ diff --git a/0.15/_images/plot_classification.png b/0.15/_images/plot_classification.png deleted file mode 100644 index 1218bb74e8d67..0000000000000 Binary files a/0.15/_images/plot_classification.png and /dev/null differ diff --git a/0.15/_images/plot_classification1.png b/0.15/_images/plot_classification1.png deleted file mode 100644 index 1218bb74e8d67..0000000000000 Binary files a/0.15/_images/plot_classification1.png and /dev/null differ diff --git a/0.15/_images/plot_classification_001.png b/0.15/_images/plot_classification_001.png deleted file mode 100644 index ba5aa41ec4a10..0000000000000 Binary files a/0.15/_images/plot_classification_001.png and /dev/null differ diff --git a/0.15/_images/plot_classification_0011.png b/0.15/_images/plot_classification_0011.png deleted file mode 100644 index ba5aa41ec4a10..0000000000000 Binary files a/0.15/_images/plot_classification_0011.png and /dev/null differ diff --git a/0.15/_images/plot_classification_0012.png b/0.15/_images/plot_classification_0012.png deleted file mode 100644 index ba5aa41ec4a10..0000000000000 Binary files a/0.15/_images/plot_classification_0012.png and /dev/null differ diff --git a/0.15/_images/plot_classification_002.png b/0.15/_images/plot_classification_002.png deleted file mode 100644 index 931bedd5ad641..0000000000000 Binary files a/0.15/_images/plot_classification_002.png and /dev/null differ diff --git a/0.15/_images/plot_classification_0021.png b/0.15/_images/plot_classification_0021.png deleted file mode 100644 index 931bedd5ad641..0000000000000 Binary files a/0.15/_images/plot_classification_0021.png and /dev/null differ diff --git a/0.15/_images/plot_classification_probability.png b/0.15/_images/plot_classification_probability.png deleted file mode 100644 index 7b110431c3d87..0000000000000 Binary files a/0.15/_images/plot_classification_probability.png and /dev/null differ diff --git a/0.15/_images/plot_classification_probability1.png b/0.15/_images/plot_classification_probability1.png deleted file mode 100644 index 9d21b143d52b7..0000000000000 Binary files a/0.15/_images/plot_classification_probability1.png and /dev/null differ diff --git a/0.15/_images/plot_classification_probability_001.png b/0.15/_images/plot_classification_probability_001.png deleted file mode 100644 index af26cc159a3e8..0000000000000 Binary files a/0.15/_images/plot_classification_probability_001.png and /dev/null differ diff --git a/0.15/_images/plot_classification_probability_0011.png b/0.15/_images/plot_classification_probability_0011.png deleted file mode 100644 index d3747e9a4319a..0000000000000 Binary files a/0.15/_images/plot_classification_probability_0011.png and /dev/null differ diff --git a/0.15/_images/plot_classifier_comparison.png b/0.15/_images/plot_classifier_comparison.png deleted file mode 100644 index 2e9225d55b0a4..0000000000000 Binary files a/0.15/_images/plot_classifier_comparison.png and /dev/null differ diff --git a/0.15/_images/plot_classifier_comparison1.png b/0.15/_images/plot_classifier_comparison1.png deleted file mode 100644 index f93e9c5375d7f..0000000000000 Binary files a/0.15/_images/plot_classifier_comparison1.png and /dev/null differ diff --git a/0.15/_images/plot_classifier_comparison_001.png b/0.15/_images/plot_classifier_comparison_001.png deleted file mode 100644 index 946835abd8c94..0000000000000 Binary files a/0.15/_images/plot_classifier_comparison_001.png and /dev/null differ diff --git a/0.15/_images/plot_classifier_comparison_0011.png b/0.15/_images/plot_classifier_comparison_0011.png deleted file mode 100644 index 36ad525e0a255..0000000000000 Binary files a/0.15/_images/plot_classifier_comparison_0011.png and /dev/null differ diff --git a/0.15/_images/plot_classifier_comparison_carousel.png b/0.15/_images/plot_classifier_comparison_carousel.png deleted file mode 100644 index 23d791aded58c..0000000000000 Binary files a/0.15/_images/plot_classifier_comparison_carousel.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_comparison.png b/0.15/_images/plot_cluster_comparison.png deleted file mode 100644 index bf3ba2c3e939e..0000000000000 Binary files a/0.15/_images/plot_cluster_comparison.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_comparison1.png b/0.15/_images/plot_cluster_comparison1.png deleted file mode 100644 index bf3ba2c3e939e..0000000000000 Binary files a/0.15/_images/plot_cluster_comparison1.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_comparison_001.png b/0.15/_images/plot_cluster_comparison_001.png deleted file mode 100644 index 56aa80e72a78a..0000000000000 Binary files a/0.15/_images/plot_cluster_comparison_001.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_comparison_0011.png b/0.15/_images/plot_cluster_comparison_0011.png deleted file mode 100644 index 56aa80e72a78a..0000000000000 Binary files a/0.15/_images/plot_cluster_comparison_0011.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris.png b/0.15/_images/plot_cluster_iris.png deleted file mode 100644 index 67c4d712dc156..0000000000000 Binary files a/0.15/_images/plot_cluster_iris.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris1.png b/0.15/_images/plot_cluster_iris1.png deleted file mode 100644 index 67c4d712dc156..0000000000000 Binary files a/0.15/_images/plot_cluster_iris1.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris_001.png b/0.15/_images/plot_cluster_iris_001.png deleted file mode 100644 index 408e1f60d18ac..0000000000000 Binary files a/0.15/_images/plot_cluster_iris_001.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris_0011.png b/0.15/_images/plot_cluster_iris_0011.png deleted file mode 100644 index 408e1f60d18ac..0000000000000 Binary files a/0.15/_images/plot_cluster_iris_0011.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris_002.png b/0.15/_images/plot_cluster_iris_002.png deleted file mode 100644 index c6d1dea69edb4..0000000000000 Binary files a/0.15/_images/plot_cluster_iris_002.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris_0021.png b/0.15/_images/plot_cluster_iris_0021.png deleted file mode 100644 index c6d1dea69edb4..0000000000000 Binary files a/0.15/_images/plot_cluster_iris_0021.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris_003.png b/0.15/_images/plot_cluster_iris_003.png deleted file mode 100644 index 836cfb9ee2e81..0000000000000 Binary files a/0.15/_images/plot_cluster_iris_003.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris_0031.png b/0.15/_images/plot_cluster_iris_0031.png deleted file mode 100644 index 836cfb9ee2e81..0000000000000 Binary files a/0.15/_images/plot_cluster_iris_0031.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris_004.png b/0.15/_images/plot_cluster_iris_004.png deleted file mode 100644 index 08a1782fc7979..0000000000000 Binary files a/0.15/_images/plot_cluster_iris_004.png and /dev/null differ diff --git a/0.15/_images/plot_cluster_iris_0041.png b/0.15/_images/plot_cluster_iris_0041.png deleted file mode 100644 index 08a1782fc7979..0000000000000 Binary files a/0.15/_images/plot_cluster_iris_0041.png and /dev/null differ diff --git a/0.15/_images/plot_color_quantization.png b/0.15/_images/plot_color_quantization.png deleted file mode 100644 index 1528977bf5632..0000000000000 Binary files a/0.15/_images/plot_color_quantization.png and /dev/null differ diff --git a/0.15/_images/plot_color_quantization1.png b/0.15/_images/plot_color_quantization1.png deleted file mode 100644 index 1528977bf5632..0000000000000 Binary files a/0.15/_images/plot_color_quantization1.png and /dev/null differ diff --git a/0.15/_images/plot_color_quantization_001.png b/0.15/_images/plot_color_quantization_001.png deleted file mode 100644 index 343e217424022..0000000000000 Binary files a/0.15/_images/plot_color_quantization_001.png and /dev/null differ diff --git a/0.15/_images/plot_color_quantization_0011.png b/0.15/_images/plot_color_quantization_0011.png deleted file mode 100644 index 343e217424022..0000000000000 Binary files a/0.15/_images/plot_color_quantization_0011.png and /dev/null differ diff --git a/0.15/_images/plot_color_quantization_002.png b/0.15/_images/plot_color_quantization_002.png deleted file mode 100644 index 615ee107fdbe9..0000000000000 Binary files a/0.15/_images/plot_color_quantization_002.png and /dev/null differ diff --git a/0.15/_images/plot_color_quantization_003.png b/0.15/_images/plot_color_quantization_003.png deleted file mode 100644 index e99a35d17d7d1..0000000000000 Binary files a/0.15/_images/plot_color_quantization_003.png and /dev/null differ diff --git a/0.15/_images/plot_compare_calibration.png b/0.15/_images/plot_compare_calibration.png deleted file mode 100644 index 38bdfe7017af6..0000000000000 Binary files a/0.15/_images/plot_compare_calibration.png and /dev/null differ diff --git a/0.15/_images/plot_compare_calibration1.png b/0.15/_images/plot_compare_calibration1.png deleted file mode 100644 index 38bdfe7017af6..0000000000000 Binary files a/0.15/_images/plot_compare_calibration1.png and /dev/null differ diff --git a/0.15/_images/plot_compare_calibration_001.png b/0.15/_images/plot_compare_calibration_001.png deleted file mode 100644 index fbd4a331b6708..0000000000000 Binary files a/0.15/_images/plot_compare_calibration_001.png and /dev/null differ diff --git a/0.15/_images/plot_compare_calibration_0011.png b/0.15/_images/plot_compare_calibration_0011.png deleted file mode 100644 index fbd4a331b6708..0000000000000 Binary files a/0.15/_images/plot_compare_calibration_0011.png and /dev/null differ diff --git a/0.15/_images/plot_compare_cross_decomposition.png b/0.15/_images/plot_compare_cross_decomposition.png deleted file mode 100644 index 849677e3fa344..0000000000000 Binary files a/0.15/_images/plot_compare_cross_decomposition.png and /dev/null differ diff --git a/0.15/_images/plot_compare_cross_decomposition1.png b/0.15/_images/plot_compare_cross_decomposition1.png deleted file mode 100644 index 849677e3fa344..0000000000000 Binary files a/0.15/_images/plot_compare_cross_decomposition1.png and /dev/null differ diff --git a/0.15/_images/plot_compare_cross_decomposition_001.png b/0.15/_images/plot_compare_cross_decomposition_001.png deleted file mode 100644 index 8f7d2948faaaf..0000000000000 Binary files a/0.15/_images/plot_compare_cross_decomposition_001.png and /dev/null differ diff --git a/0.15/_images/plot_compare_cross_decomposition_0011.png b/0.15/_images/plot_compare_cross_decomposition_0011.png deleted file mode 100644 index 8f7d2948faaaf..0000000000000 Binary files a/0.15/_images/plot_compare_cross_decomposition_0011.png and /dev/null differ diff --git a/0.15/_images/plot_compare_methods.png b/0.15/_images/plot_compare_methods.png deleted file mode 100644 index 2c93b62df20df..0000000000000 Binary files a/0.15/_images/plot_compare_methods.png and /dev/null differ diff --git a/0.15/_images/plot_compare_methods1.png b/0.15/_images/plot_compare_methods1.png deleted file mode 100644 index 2c93b62df20df..0000000000000 Binary files a/0.15/_images/plot_compare_methods1.png and /dev/null differ diff --git a/0.15/_images/plot_compare_methods2.png b/0.15/_images/plot_compare_methods2.png deleted file mode 100644 index 2c93b62df20df..0000000000000 Binary files a/0.15/_images/plot_compare_methods2.png and /dev/null differ diff --git a/0.15/_images/plot_compare_methods_001.png b/0.15/_images/plot_compare_methods_001.png deleted file mode 100644 index f532c231223a2..0000000000000 Binary files a/0.15/_images/plot_compare_methods_001.png and /dev/null differ diff --git a/0.15/_images/plot_compare_methods_0011.png b/0.15/_images/plot_compare_methods_0011.png deleted file mode 100644 index f532c231223a2..0000000000000 Binary files a/0.15/_images/plot_compare_methods_0011.png and /dev/null differ diff --git a/0.15/_images/plot_compare_methods_carousel.png b/0.15/_images/plot_compare_methods_carousel.png deleted file mode 100644 index 9535b72eb85b3..0000000000000 Binary files a/0.15/_images/plot_compare_methods_carousel.png and /dev/null differ diff --git a/0.15/_images/plot_confusion_matrix.png b/0.15/_images/plot_confusion_matrix.png deleted file mode 100644 index 87de88bcb05ba..0000000000000 Binary files a/0.15/_images/plot_confusion_matrix.png and /dev/null differ diff --git a/0.15/_images/plot_confusion_matrix1.png b/0.15/_images/plot_confusion_matrix1.png deleted file mode 100644 index 522ac6757414c..0000000000000 Binary files a/0.15/_images/plot_confusion_matrix1.png and /dev/null differ diff --git a/0.15/_images/plot_confusion_matrix_001.png b/0.15/_images/plot_confusion_matrix_001.png deleted file mode 100644 index 443e6cd1e4420..0000000000000 Binary files a/0.15/_images/plot_confusion_matrix_001.png and /dev/null differ diff --git a/0.15/_images/plot_confusion_matrix_0011.png b/0.15/_images/plot_confusion_matrix_0011.png deleted file mode 100644 index a699e788bf12c..0000000000000 Binary files a/0.15/_images/plot_confusion_matrix_0011.png and /dev/null differ diff --git a/0.15/_images/plot_confusion_matrix_0012.png b/0.15/_images/plot_confusion_matrix_0012.png deleted file mode 100644 index a699e788bf12c..0000000000000 Binary files a/0.15/_images/plot_confusion_matrix_0012.png and /dev/null differ diff --git a/0.15/_images/plot_confusion_matrix_002.png b/0.15/_images/plot_confusion_matrix_002.png deleted file mode 100644 index 259106a879da3..0000000000000 Binary files a/0.15/_images/plot_confusion_matrix_002.png and /dev/null differ diff --git a/0.15/_images/plot_covariance_estimation.png b/0.15/_images/plot_covariance_estimation.png deleted file mode 100644 index 8498cd222dab4..0000000000000 Binary files a/0.15/_images/plot_covariance_estimation.png and /dev/null differ diff --git a/0.15/_images/plot_covariance_estimation1.png b/0.15/_images/plot_covariance_estimation1.png deleted file mode 100644 index 8498cd222dab4..0000000000000 Binary files a/0.15/_images/plot_covariance_estimation1.png and /dev/null differ diff --git a/0.15/_images/plot_covariance_estimation_001.png b/0.15/_images/plot_covariance_estimation_001.png deleted file mode 100644 index fc90a6dcc4946..0000000000000 Binary files a/0.15/_images/plot_covariance_estimation_001.png and /dev/null differ diff --git a/0.15/_images/plot_covariance_estimation_0011.png b/0.15/_images/plot_covariance_estimation_0011.png deleted file mode 100644 index fc90a6dcc4946..0000000000000 Binary files a/0.15/_images/plot_covariance_estimation_0011.png and /dev/null differ diff --git a/0.15/_images/plot_custom_kernel.png b/0.15/_images/plot_custom_kernel.png deleted file mode 100644 index 0e7346ba32e31..0000000000000 Binary files a/0.15/_images/plot_custom_kernel.png and /dev/null differ diff --git a/0.15/_images/plot_custom_kernel1.png b/0.15/_images/plot_custom_kernel1.png deleted file mode 100644 index 0e7346ba32e31..0000000000000 Binary files a/0.15/_images/plot_custom_kernel1.png and /dev/null differ diff --git a/0.15/_images/plot_custom_kernel_001.png b/0.15/_images/plot_custom_kernel_001.png deleted file mode 100644 index c2f9cc8549cda..0000000000000 Binary files a/0.15/_images/plot_custom_kernel_001.png and /dev/null differ diff --git a/0.15/_images/plot_cv_diabetes.png b/0.15/_images/plot_cv_diabetes.png deleted file mode 100644 index da47ae77a5ef0..0000000000000 Binary files a/0.15/_images/plot_cv_diabetes.png and /dev/null differ diff --git a/0.15/_images/plot_cv_diabetes1.png b/0.15/_images/plot_cv_diabetes1.png deleted file mode 100644 index da47ae77a5ef0..0000000000000 Binary files a/0.15/_images/plot_cv_diabetes1.png and /dev/null differ diff --git a/0.15/_images/plot_cv_diabetes_001.png b/0.15/_images/plot_cv_diabetes_001.png deleted file mode 100644 index 60eb175488f8f..0000000000000 Binary files a/0.15/_images/plot_cv_diabetes_001.png and /dev/null differ diff --git a/0.15/_images/plot_cv_digits.png b/0.15/_images/plot_cv_digits.png deleted file mode 100644 index e3a004af9c412..0000000000000 Binary files a/0.15/_images/plot_cv_digits.png and /dev/null differ diff --git a/0.15/_images/plot_cv_digits1.png b/0.15/_images/plot_cv_digits1.png deleted file mode 100644 index e3a004af9c412..0000000000000 Binary files a/0.15/_images/plot_cv_digits1.png and /dev/null differ diff --git a/0.15/_images/plot_cv_digits_001.png b/0.15/_images/plot_cv_digits_001.png deleted file mode 100644 index ade0683613de9..0000000000000 Binary files a/0.15/_images/plot_cv_digits_001.png and /dev/null differ diff --git a/0.15/_images/plot_cv_digits_0011.png b/0.15/_images/plot_cv_digits_0011.png deleted file mode 100644 index ade0683613de9..0000000000000 Binary files a/0.15/_images/plot_cv_digits_0011.png and /dev/null differ diff --git a/0.15/_images/plot_cv_predict.png b/0.15/_images/plot_cv_predict.png deleted file mode 100644 index c4f22b6721db9..0000000000000 Binary files a/0.15/_images/plot_cv_predict.png and /dev/null differ diff --git a/0.15/_images/plot_cv_predict1.png b/0.15/_images/plot_cv_predict1.png deleted file mode 100644 index c4f22b6721db9..0000000000000 Binary files a/0.15/_images/plot_cv_predict1.png and /dev/null differ diff --git a/0.15/_images/plot_cv_predict_001.png b/0.15/_images/plot_cv_predict_001.png deleted file mode 100644 index 8314cf3fe68eb..0000000000000 Binary files a/0.15/_images/plot_cv_predict_001.png and /dev/null differ diff --git a/0.15/_images/plot_dbscan.png b/0.15/_images/plot_dbscan.png deleted file mode 100644 index ecefe5a00b811..0000000000000 Binary files a/0.15/_images/plot_dbscan.png and /dev/null differ diff --git a/0.15/_images/plot_dbscan1.png b/0.15/_images/plot_dbscan1.png deleted file mode 100644 index ecefe5a00b811..0000000000000 Binary files a/0.15/_images/plot_dbscan1.png and /dev/null differ diff --git a/0.15/_images/plot_dbscan_001.png b/0.15/_images/plot_dbscan_001.png deleted file mode 100644 index b5ef3558f8647..0000000000000 Binary files a/0.15/_images/plot_dbscan_001.png and /dev/null differ diff --git a/0.15/_images/plot_dbscan_0011.png b/0.15/_images/plot_dbscan_0011.png deleted file mode 100644 index b5ef3558f8647..0000000000000 Binary files a/0.15/_images/plot_dbscan_0011.png and /dev/null differ diff --git a/0.15/_images/plot_dict_face_patches.png b/0.15/_images/plot_dict_face_patches.png deleted file mode 100644 index fdc9a02cbef90..0000000000000 Binary files a/0.15/_images/plot_dict_face_patches.png and /dev/null differ diff --git a/0.15/_images/plot_dict_face_patches1.png b/0.15/_images/plot_dict_face_patches1.png deleted file mode 100644 index fdc9a02cbef90..0000000000000 Binary files a/0.15/_images/plot_dict_face_patches1.png and /dev/null differ diff --git a/0.15/_images/plot_dict_face_patches_001.png b/0.15/_images/plot_dict_face_patches_001.png deleted file mode 100644 index 2616c8f8e1eb7..0000000000000 Binary files a/0.15/_images/plot_dict_face_patches_001.png and /dev/null differ diff --git a/0.15/_images/plot_dict_face_patches_0011.png b/0.15/_images/plot_dict_face_patches_0011.png deleted file mode 100644 index 2616c8f8e1eb7..0000000000000 Binary files a/0.15/_images/plot_dict_face_patches_0011.png and /dev/null differ diff --git a/0.15/_images/plot_digits_agglomeration.png b/0.15/_images/plot_digits_agglomeration.png deleted file mode 100644 index fbc3560e2f2c7..0000000000000 Binary files a/0.15/_images/plot_digits_agglomeration.png and /dev/null differ diff --git a/0.15/_images/plot_digits_agglomeration1.png b/0.15/_images/plot_digits_agglomeration1.png deleted file mode 100644 index fbc3560e2f2c7..0000000000000 Binary files a/0.15/_images/plot_digits_agglomeration1.png and /dev/null differ diff --git a/0.15/_images/plot_digits_agglomeration_001.png b/0.15/_images/plot_digits_agglomeration_001.png deleted file mode 100644 index 9c8580ada3f1f..0000000000000 Binary files a/0.15/_images/plot_digits_agglomeration_001.png and /dev/null differ diff --git a/0.15/_images/plot_digits_agglomeration_0011.png b/0.15/_images/plot_digits_agglomeration_0011.png deleted file mode 100644 index 9c8580ada3f1f..0000000000000 Binary files a/0.15/_images/plot_digits_agglomeration_0011.png and /dev/null differ diff --git a/0.15/_images/plot_digits_classification.png b/0.15/_images/plot_digits_classification.png deleted file mode 100644 index 5a19f36e46036..0000000000000 Binary files a/0.15/_images/plot_digits_classification.png and /dev/null differ diff --git a/0.15/_images/plot_digits_classification1.png b/0.15/_images/plot_digits_classification1.png deleted file mode 100644 index 5a19f36e46036..0000000000000 Binary files a/0.15/_images/plot_digits_classification1.png and /dev/null differ diff --git a/0.15/_images/plot_digits_classification_001.png b/0.15/_images/plot_digits_classification_001.png deleted file mode 100644 index 9463b59b8c672..0000000000000 Binary files a/0.15/_images/plot_digits_classification_001.png and /dev/null differ diff --git a/0.15/_images/plot_digits_classification_0011.png b/0.15/_images/plot_digits_classification_0011.png deleted file mode 100644 index 9463b59b8c672..0000000000000 Binary files a/0.15/_images/plot_digits_classification_0011.png and /dev/null differ diff --git a/0.15/_images/plot_digits_kde_sampling.png b/0.15/_images/plot_digits_kde_sampling.png deleted file mode 100644 index d2777617e87c2..0000000000000 Binary files a/0.15/_images/plot_digits_kde_sampling.png and /dev/null differ diff --git a/0.15/_images/plot_digits_kde_sampling1.png b/0.15/_images/plot_digits_kde_sampling1.png deleted file mode 100644 index d2777617e87c2..0000000000000 Binary files a/0.15/_images/plot_digits_kde_sampling1.png and /dev/null differ diff --git a/0.15/_images/plot_digits_kde_sampling_001.png b/0.15/_images/plot_digits_kde_sampling_001.png deleted file mode 100644 index 821ab12451ac4..0000000000000 Binary files a/0.15/_images/plot_digits_kde_sampling_001.png and /dev/null differ diff --git a/0.15/_images/plot_digits_kde_sampling_0011.png b/0.15/_images/plot_digits_kde_sampling_0011.png deleted file mode 100644 index 821ab12451ac4..0000000000000 Binary files a/0.15/_images/plot_digits_kde_sampling_0011.png and /dev/null differ diff --git a/0.15/_images/plot_digits_last_image.png b/0.15/_images/plot_digits_last_image.png deleted file mode 100644 index 13bef194b4acd..0000000000000 Binary files a/0.15/_images/plot_digits_last_image.png and /dev/null differ diff --git a/0.15/_images/plot_digits_last_image1.png b/0.15/_images/plot_digits_last_image1.png deleted file mode 100644 index 13bef194b4acd..0000000000000 Binary files a/0.15/_images/plot_digits_last_image1.png and /dev/null differ diff --git a/0.15/_images/plot_digits_last_image_001.png b/0.15/_images/plot_digits_last_image_001.png deleted file mode 100644 index 5d55fabf75369..0000000000000 Binary files a/0.15/_images/plot_digits_last_image_001.png and /dev/null differ diff --git a/0.15/_images/plot_digits_last_image_0011.png b/0.15/_images/plot_digits_last_image_0011.png deleted file mode 100644 index 5d55fabf75369..0000000000000 Binary files a/0.15/_images/plot_digits_last_image_0011.png and /dev/null differ diff --git a/0.15/_images/plot_digits_last_image_0012.png b/0.15/_images/plot_digits_last_image_0012.png deleted file mode 100644 index 5d55fabf75369..0000000000000 Binary files a/0.15/_images/plot_digits_last_image_0012.png and /dev/null differ diff --git a/0.15/_images/plot_digits_linkage.png b/0.15/_images/plot_digits_linkage.png deleted file mode 100644 index 13031e30926c7..0000000000000 Binary files a/0.15/_images/plot_digits_linkage.png and /dev/null differ diff --git a/0.15/_images/plot_digits_linkage1.png b/0.15/_images/plot_digits_linkage1.png deleted file mode 100644 index 13031e30926c7..0000000000000 Binary files a/0.15/_images/plot_digits_linkage1.png and /dev/null differ diff --git a/0.15/_images/plot_digits_linkage_001.png b/0.15/_images/plot_digits_linkage_001.png deleted file mode 100644 index 5e01f4378cae2..0000000000000 Binary files a/0.15/_images/plot_digits_linkage_001.png and /dev/null differ diff --git a/0.15/_images/plot_digits_linkage_0011.png b/0.15/_images/plot_digits_linkage_0011.png deleted file mode 100644 index 5e01f4378cae2..0000000000000 Binary files a/0.15/_images/plot_digits_linkage_0011.png and /dev/null differ diff --git a/0.15/_images/plot_digits_linkage_002.png b/0.15/_images/plot_digits_linkage_002.png deleted file mode 100644 index 3a8fec9f37f1d..0000000000000 Binary files a/0.15/_images/plot_digits_linkage_002.png and /dev/null differ diff --git a/0.15/_images/plot_digits_linkage_0021.png b/0.15/_images/plot_digits_linkage_0021.png deleted file mode 100644 index 3a8fec9f37f1d..0000000000000 Binary files a/0.15/_images/plot_digits_linkage_0021.png and /dev/null differ diff --git a/0.15/_images/plot_digits_linkage_003.png b/0.15/_images/plot_digits_linkage_003.png deleted file mode 100644 index 81ea734cda8c6..0000000000000 Binary files a/0.15/_images/plot_digits_linkage_003.png and /dev/null differ diff --git a/0.15/_images/plot_digits_linkage_0031.png b/0.15/_images/plot_digits_linkage_0031.png deleted file mode 100644 index 81ea734cda8c6..0000000000000 Binary files a/0.15/_images/plot_digits_linkage_0031.png and /dev/null differ diff --git a/0.15/_images/plot_digits_pipe.png b/0.15/_images/plot_digits_pipe.png deleted file mode 100644 index 0187bb63a1058..0000000000000 Binary files a/0.15/_images/plot_digits_pipe.png and /dev/null differ diff --git a/0.15/_images/plot_digits_pipe1.png b/0.15/_images/plot_digits_pipe1.png deleted file mode 100644 index 0187bb63a1058..0000000000000 Binary files a/0.15/_images/plot_digits_pipe1.png and /dev/null differ diff --git a/0.15/_images/plot_digits_pipe_001.png b/0.15/_images/plot_digits_pipe_001.png deleted file mode 100644 index 698a9efb2062d..0000000000000 Binary files a/0.15/_images/plot_digits_pipe_001.png and /dev/null differ diff --git a/0.15/_images/plot_digits_pipe_0011.png b/0.15/_images/plot_digits_pipe_0011.png deleted file mode 100644 index 698a9efb2062d..0000000000000 Binary files a/0.15/_images/plot_digits_pipe_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ensemble_oob.png b/0.15/_images/plot_ensemble_oob.png deleted file mode 100644 index c12487a670b01..0000000000000 Binary files a/0.15/_images/plot_ensemble_oob.png and /dev/null differ diff --git a/0.15/_images/plot_ensemble_oob1.png b/0.15/_images/plot_ensemble_oob1.png deleted file mode 100644 index c12487a670b01..0000000000000 Binary files a/0.15/_images/plot_ensemble_oob1.png and /dev/null differ diff --git a/0.15/_images/plot_ensemble_oob_001.png b/0.15/_images/plot_ensemble_oob_001.png deleted file mode 100644 index 012fa31b27866..0000000000000 Binary files a/0.15/_images/plot_ensemble_oob_001.png and /dev/null differ diff --git a/0.15/_images/plot_face_recognition_1.png b/0.15/_images/plot_face_recognition_1.png deleted file mode 100644 index c523fd1b40190..0000000000000 Binary files a/0.15/_images/plot_face_recognition_1.png and /dev/null differ diff --git a/0.15/_images/plot_face_recognition_2.png b/0.15/_images/plot_face_recognition_2.png deleted file mode 100644 index 9d9435d57112d..0000000000000 Binary files a/0.15/_images/plot_face_recognition_2.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition.png b/0.15/_images/plot_faces_decomposition.png deleted file mode 100644 index a4dbc27509aab..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition1.png b/0.15/_images/plot_faces_decomposition1.png deleted file mode 100644 index a4dbc27509aab..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition1.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_001.png b/0.15/_images/plot_faces_decomposition_001.png deleted file mode 100644 index 89372a24b0ee0..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_001.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_0011.png b/0.15/_images/plot_faces_decomposition_0011.png deleted file mode 100644 index 89372a24b0ee0..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_0011.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_002.png b/0.15/_images/plot_faces_decomposition_002.png deleted file mode 100644 index e2ed5b8021d15..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_002.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_0021.png b/0.15/_images/plot_faces_decomposition_0021.png deleted file mode 100644 index e2ed5b8021d15..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_0021.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_003.png b/0.15/_images/plot_faces_decomposition_003.png deleted file mode 100644 index 3aa562251b5b7..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_003.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_0031.png b/0.15/_images/plot_faces_decomposition_0031.png deleted file mode 100644 index 3aa562251b5b7..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_0031.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_004.png b/0.15/_images/plot_faces_decomposition_004.png deleted file mode 100644 index d6e9444c21ce2..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_004.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_0041.png b/0.15/_images/plot_faces_decomposition_0041.png deleted file mode 100644 index d6e9444c21ce2..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_0041.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_005.png b/0.15/_images/plot_faces_decomposition_005.png deleted file mode 100644 index 06afc944e360c..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_005.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_0051.png b/0.15/_images/plot_faces_decomposition_0051.png deleted file mode 100644 index 06afc944e360c..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_0051.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_006.png b/0.15/_images/plot_faces_decomposition_006.png deleted file mode 100644 index 8f07194d3d6d6..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_006.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_0061.png b/0.15/_images/plot_faces_decomposition_0061.png deleted file mode 100644 index 8f07194d3d6d6..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_0061.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_007.png b/0.15/_images/plot_faces_decomposition_007.png deleted file mode 100644 index e9dbb943561ab..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_007.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_008.png b/0.15/_images/plot_faces_decomposition_008.png deleted file mode 100644 index 0b713a8b757dc..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_008.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_0081.png b/0.15/_images/plot_faces_decomposition_0081.png deleted file mode 100644 index 0b713a8b757dc..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_0081.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_009.png b/0.15/_images/plot_faces_decomposition_009.png deleted file mode 100644 index 197763e0f8070..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_009.png and /dev/null differ diff --git a/0.15/_images/plot_faces_decomposition_0091.png b/0.15/_images/plot_faces_decomposition_0091.png deleted file mode 100644 index 197763e0f8070..0000000000000 Binary files a/0.15/_images/plot_faces_decomposition_0091.png and /dev/null differ diff --git a/0.15/_images/plot_feature_agglomeration_vs_univariate_selection.png b/0.15/_images/plot_feature_agglomeration_vs_univariate_selection.png deleted file mode 100644 index 0e53334334314..0000000000000 Binary files a/0.15/_images/plot_feature_agglomeration_vs_univariate_selection.png and /dev/null differ diff --git a/0.15/_images/plot_feature_agglomeration_vs_univariate_selection1.png b/0.15/_images/plot_feature_agglomeration_vs_univariate_selection1.png deleted file mode 100644 index 0e53334334314..0000000000000 Binary files a/0.15/_images/plot_feature_agglomeration_vs_univariate_selection1.png and /dev/null differ diff --git a/0.15/_images/plot_feature_agglomeration_vs_univariate_selection_001.png b/0.15/_images/plot_feature_agglomeration_vs_univariate_selection_001.png deleted file mode 100644 index 7cf2406b86bcd..0000000000000 Binary files a/0.15/_images/plot_feature_agglomeration_vs_univariate_selection_001.png and /dev/null differ diff --git a/0.15/_images/plot_feature_selection.png b/0.15/_images/plot_feature_selection.png deleted file mode 100644 index b2596ba17c33a..0000000000000 Binary files a/0.15/_images/plot_feature_selection.png and /dev/null differ diff --git a/0.15/_images/plot_feature_selection1.png b/0.15/_images/plot_feature_selection1.png deleted file mode 100644 index 0eae04d72bd84..0000000000000 Binary files a/0.15/_images/plot_feature_selection1.png and /dev/null differ diff --git a/0.15/_images/plot_feature_selection_001.png b/0.15/_images/plot_feature_selection_001.png deleted file mode 100644 index 57f5fe3aadfba..0000000000000 Binary files a/0.15/_images/plot_feature_selection_001.png and /dev/null differ diff --git a/0.15/_images/plot_feature_selection_0011.png b/0.15/_images/plot_feature_selection_0011.png deleted file mode 100644 index 47b5ebde23bcd..0000000000000 Binary files a/0.15/_images/plot_feature_selection_0011.png and /dev/null differ diff --git a/0.15/_images/plot_forest_importances.png b/0.15/_images/plot_forest_importances.png deleted file mode 100644 index 0b55925b9a7bc..0000000000000 Binary files a/0.15/_images/plot_forest_importances.png and /dev/null differ diff --git a/0.15/_images/plot_forest_importances1.png b/0.15/_images/plot_forest_importances1.png deleted file mode 100644 index 0b55925b9a7bc..0000000000000 Binary files a/0.15/_images/plot_forest_importances1.png and /dev/null differ diff --git a/0.15/_images/plot_forest_importances_001.png b/0.15/_images/plot_forest_importances_001.png deleted file mode 100644 index 2a3fa6c874acb..0000000000000 Binary files a/0.15/_images/plot_forest_importances_001.png and /dev/null differ diff --git a/0.15/_images/plot_forest_importances_faces.png b/0.15/_images/plot_forest_importances_faces.png deleted file mode 100644 index e6fa5d0a87876..0000000000000 Binary files a/0.15/_images/plot_forest_importances_faces.png and /dev/null differ diff --git a/0.15/_images/plot_forest_importances_faces1.png b/0.15/_images/plot_forest_importances_faces1.png deleted file mode 100644 index e6fa5d0a87876..0000000000000 Binary files a/0.15/_images/plot_forest_importances_faces1.png and /dev/null differ diff --git a/0.15/_images/plot_forest_importances_faces_001.png b/0.15/_images/plot_forest_importances_faces_001.png deleted file mode 100644 index ee9ee842e207a..0000000000000 Binary files a/0.15/_images/plot_forest_importances_faces_001.png and /dev/null differ diff --git a/0.15/_images/plot_forest_importances_faces_0011.png b/0.15/_images/plot_forest_importances_faces_0011.png deleted file mode 100644 index ee9ee842e207a..0000000000000 Binary files a/0.15/_images/plot_forest_importances_faces_0011.png and /dev/null differ diff --git a/0.15/_images/plot_forest_iris.png b/0.15/_images/plot_forest_iris.png deleted file mode 100644 index fa29c1302bdb7..0000000000000 Binary files a/0.15/_images/plot_forest_iris.png and /dev/null differ diff --git a/0.15/_images/plot_forest_iris1.png b/0.15/_images/plot_forest_iris1.png deleted file mode 100644 index fa29c1302bdb7..0000000000000 Binary files a/0.15/_images/plot_forest_iris1.png and /dev/null differ diff --git a/0.15/_images/plot_forest_iris_001.png b/0.15/_images/plot_forest_iris_001.png deleted file mode 100644 index 322fe72e53e1f..0000000000000 Binary files a/0.15/_images/plot_forest_iris_001.png and /dev/null differ diff --git a/0.15/_images/plot_forest_iris_0011.png b/0.15/_images/plot_forest_iris_0011.png deleted file mode 100644 index 322fe72e53e1f..0000000000000 Binary files a/0.15/_images/plot_forest_iris_0011.png and /dev/null differ diff --git a/0.15/_images/plot_gmm.png b/0.15/_images/plot_gmm.png deleted file mode 100644 index 93f4fc9371f9c..0000000000000 Binary files a/0.15/_images/plot_gmm.png and /dev/null differ diff --git a/0.15/_images/plot_gmm1.png b/0.15/_images/plot_gmm1.png deleted file mode 100644 index 93f4fc9371f9c..0000000000000 Binary files a/0.15/_images/plot_gmm1.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_001.png b/0.15/_images/plot_gmm_001.png deleted file mode 100644 index 3aff54ba6d7ae..0000000000000 Binary files a/0.15/_images/plot_gmm_001.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_0011.png b/0.15/_images/plot_gmm_0011.png deleted file mode 100644 index 3aff54ba6d7ae..0000000000000 Binary files a/0.15/_images/plot_gmm_0011.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_classifier.png b/0.15/_images/plot_gmm_classifier.png deleted file mode 100644 index 5a791a4d7d2e2..0000000000000 Binary files a/0.15/_images/plot_gmm_classifier.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_classifier1.png b/0.15/_images/plot_gmm_classifier1.png deleted file mode 100644 index 5a791a4d7d2e2..0000000000000 Binary files a/0.15/_images/plot_gmm_classifier1.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_classifier_001.png b/0.15/_images/plot_gmm_classifier_001.png deleted file mode 100644 index 33d2f9a4e1ac7..0000000000000 Binary files a/0.15/_images/plot_gmm_classifier_001.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_classifier_0011.png b/0.15/_images/plot_gmm_classifier_0011.png deleted file mode 100644 index 33d2f9a4e1ac7..0000000000000 Binary files a/0.15/_images/plot_gmm_classifier_0011.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_pdf.png b/0.15/_images/plot_gmm_pdf.png deleted file mode 100644 index 7843d79699acb..0000000000000 Binary files a/0.15/_images/plot_gmm_pdf.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_pdf1.png b/0.15/_images/plot_gmm_pdf1.png deleted file mode 100644 index 7843d79699acb..0000000000000 Binary files a/0.15/_images/plot_gmm_pdf1.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_pdf_001.png b/0.15/_images/plot_gmm_pdf_001.png deleted file mode 100644 index 7db445317793a..0000000000000 Binary files a/0.15/_images/plot_gmm_pdf_001.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_pdf_0011.png b/0.15/_images/plot_gmm_pdf_0011.png deleted file mode 100644 index 7db445317793a..0000000000000 Binary files a/0.15/_images/plot_gmm_pdf_0011.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_selection.png b/0.15/_images/plot_gmm_selection.png deleted file mode 100644 index cb79be31f423c..0000000000000 Binary files a/0.15/_images/plot_gmm_selection.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_selection1.png b/0.15/_images/plot_gmm_selection1.png deleted file mode 100644 index cb79be31f423c..0000000000000 Binary files a/0.15/_images/plot_gmm_selection1.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_selection_001.png b/0.15/_images/plot_gmm_selection_001.png deleted file mode 100644 index 67f1a4fc79447..0000000000000 Binary files a/0.15/_images/plot_gmm_selection_001.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_selection_0011.png b/0.15/_images/plot_gmm_selection_0011.png deleted file mode 100644 index 67f1a4fc79447..0000000000000 Binary files a/0.15/_images/plot_gmm_selection_0011.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_sin.png b/0.15/_images/plot_gmm_sin.png deleted file mode 100644 index 6aea297d0d121..0000000000000 Binary files a/0.15/_images/plot_gmm_sin.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_sin1.png b/0.15/_images/plot_gmm_sin1.png deleted file mode 100644 index 6aea297d0d121..0000000000000 Binary files a/0.15/_images/plot_gmm_sin1.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_sin_001.png b/0.15/_images/plot_gmm_sin_001.png deleted file mode 100644 index cf102e52a3327..0000000000000 Binary files a/0.15/_images/plot_gmm_sin_001.png and /dev/null differ diff --git a/0.15/_images/plot_gmm_sin_0011.png b/0.15/_images/plot_gmm_sin_0011.png deleted file mode 100644 index cf102e52a3327..0000000000000 Binary files a/0.15/_images/plot_gmm_sin_0011.png and /dev/null differ diff --git a/0.15/_images/plot_gp_probabilistic_classification_after_regression.png b/0.15/_images/plot_gp_probabilistic_classification_after_regression.png deleted file mode 100644 index fb3a4d3edcbb5..0000000000000 Binary files a/0.15/_images/plot_gp_probabilistic_classification_after_regression.png and /dev/null differ diff --git a/0.15/_images/plot_gp_probabilistic_classification_after_regression1.png b/0.15/_images/plot_gp_probabilistic_classification_after_regression1.png deleted file mode 100644 index fb3a4d3edcbb5..0000000000000 Binary files a/0.15/_images/plot_gp_probabilistic_classification_after_regression1.png and /dev/null differ diff --git a/0.15/_images/plot_gp_probabilistic_classification_after_regression_001.png b/0.15/_images/plot_gp_probabilistic_classification_after_regression_001.png deleted file mode 100644 index 919bc64e453cc..0000000000000 Binary files a/0.15/_images/plot_gp_probabilistic_classification_after_regression_001.png and /dev/null differ diff --git a/0.15/_images/plot_gp_regression.png b/0.15/_images/plot_gp_regression.png deleted file mode 100644 index 9c76ca835f0dc..0000000000000 Binary files a/0.15/_images/plot_gp_regression.png and /dev/null differ diff --git a/0.15/_images/plot_gp_regression1.png b/0.15/_images/plot_gp_regression1.png deleted file mode 100644 index 9c76ca835f0dc..0000000000000 Binary files a/0.15/_images/plot_gp_regression1.png and /dev/null differ diff --git a/0.15/_images/plot_gp_regression_001.png b/0.15/_images/plot_gp_regression_001.png deleted file mode 100644 index 44267daf8d8c1..0000000000000 Binary files a/0.15/_images/plot_gp_regression_001.png and /dev/null differ diff --git a/0.15/_images/plot_gp_regression_0011.png b/0.15/_images/plot_gp_regression_0011.png deleted file mode 100644 index 44267daf8d8c1..0000000000000 Binary files a/0.15/_images/plot_gp_regression_0011.png and /dev/null differ diff --git a/0.15/_images/plot_gp_regression_002.png b/0.15/_images/plot_gp_regression_002.png deleted file mode 100644 index 4247b160522ab..0000000000000 Binary files a/0.15/_images/plot_gp_regression_002.png and /dev/null differ diff --git a/0.15/_images/plot_gp_regression_0021.png b/0.15/_images/plot_gp_regression_0021.png deleted file mode 100644 index 4247b160522ab..0000000000000 Binary files a/0.15/_images/plot_gp_regression_0021.png and /dev/null differ diff --git a/0.15/_images/plot_gp_regression_carousel.png b/0.15/_images/plot_gp_regression_carousel.png deleted file mode 100644 index 9b9d1d2fb5a6b..0000000000000 Binary files a/0.15/_images/plot_gp_regression_carousel.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_oob.png b/0.15/_images/plot_gradient_boosting_oob.png deleted file mode 100644 index 1d2e36a0b0a59..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_oob.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_oob1.png b/0.15/_images/plot_gradient_boosting_oob1.png deleted file mode 100644 index 1d2e36a0b0a59..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_oob1.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_oob_001.png b/0.15/_images/plot_gradient_boosting_oob_001.png deleted file mode 100644 index 5c732e035ad90..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_oob_001.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_quantile.png b/0.15/_images/plot_gradient_boosting_quantile.png deleted file mode 100644 index 4da7081497b59..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_quantile.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_quantile1.png b/0.15/_images/plot_gradient_boosting_quantile1.png deleted file mode 100644 index 4da7081497b59..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_quantile1.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_quantile_001.png b/0.15/_images/plot_gradient_boosting_quantile_001.png deleted file mode 100644 index 72519ba06ab7a..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_quantile_001.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_regression.png b/0.15/_images/plot_gradient_boosting_regression.png deleted file mode 100644 index 21ed24bba95d8..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_regression.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_regression1.png b/0.15/_images/plot_gradient_boosting_regression1.png deleted file mode 100644 index 21ed24bba95d8..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_regression1.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_regression_001.png b/0.15/_images/plot_gradient_boosting_regression_001.png deleted file mode 100644 index 63e329afff7aa..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_regression_001.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_regression_0011.png b/0.15/_images/plot_gradient_boosting_regression_0011.png deleted file mode 100644 index 63e329afff7aa..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_regression_0011.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_regularization.png b/0.15/_images/plot_gradient_boosting_regularization.png deleted file mode 100644 index 92926d22622a3..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_regularization.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_regularization1.png b/0.15/_images/plot_gradient_boosting_regularization1.png deleted file mode 100644 index 92926d22622a3..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_regularization1.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_regularization_001.png b/0.15/_images/plot_gradient_boosting_regularization_001.png deleted file mode 100644 index 001664f43c3ca..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_regularization_001.png and /dev/null differ diff --git a/0.15/_images/plot_gradient_boosting_regularization_0011.png b/0.15/_images/plot_gradient_boosting_regularization_0011.png deleted file mode 100644 index 001664f43c3ca..0000000000000 Binary files a/0.15/_images/plot_gradient_boosting_regularization_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ica_blind_source_separation.png b/0.15/_images/plot_ica_blind_source_separation.png deleted file mode 100644 index f5042039a3212..0000000000000 Binary files a/0.15/_images/plot_ica_blind_source_separation.png and /dev/null differ diff --git a/0.15/_images/plot_ica_blind_source_separation1.png b/0.15/_images/plot_ica_blind_source_separation1.png deleted file mode 100644 index f5042039a3212..0000000000000 Binary files a/0.15/_images/plot_ica_blind_source_separation1.png and /dev/null differ diff --git a/0.15/_images/plot_ica_blind_source_separation_001.png b/0.15/_images/plot_ica_blind_source_separation_001.png deleted file mode 100644 index 22bac495bfb51..0000000000000 Binary files a/0.15/_images/plot_ica_blind_source_separation_001.png and /dev/null differ diff --git a/0.15/_images/plot_ica_blind_source_separation_0011.png b/0.15/_images/plot_ica_blind_source_separation_0011.png deleted file mode 100644 index 22bac495bfb51..0000000000000 Binary files a/0.15/_images/plot_ica_blind_source_separation_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ica_blind_source_separation_0012.png b/0.15/_images/plot_ica_blind_source_separation_0012.png deleted file mode 100644 index 22bac495bfb51..0000000000000 Binary files a/0.15/_images/plot_ica_blind_source_separation_0012.png and /dev/null differ diff --git a/0.15/_images/plot_ica_vs_pca.png b/0.15/_images/plot_ica_vs_pca.png deleted file mode 100644 index ec8a8f6c445fe..0000000000000 Binary files a/0.15/_images/plot_ica_vs_pca.png and /dev/null differ diff --git a/0.15/_images/plot_ica_vs_pca1.png b/0.15/_images/plot_ica_vs_pca1.png deleted file mode 100644 index ec8a8f6c445fe..0000000000000 Binary files a/0.15/_images/plot_ica_vs_pca1.png and /dev/null differ diff --git a/0.15/_images/plot_ica_vs_pca_001.png b/0.15/_images/plot_ica_vs_pca_001.png deleted file mode 100644 index ed7d60348095a..0000000000000 Binary files a/0.15/_images/plot_ica_vs_pca_001.png and /dev/null differ diff --git a/0.15/_images/plot_image_denoising.png b/0.15/_images/plot_image_denoising.png deleted file mode 100644 index bbaf5469a06a5..0000000000000 Binary files a/0.15/_images/plot_image_denoising.png and /dev/null differ diff --git a/0.15/_images/plot_image_denoising1.png b/0.15/_images/plot_image_denoising1.png deleted file mode 100644 index bbaf5469a06a5..0000000000000 Binary files a/0.15/_images/plot_image_denoising1.png and /dev/null differ diff --git a/0.15/_images/plot_image_denoising_001.png b/0.15/_images/plot_image_denoising_001.png deleted file mode 100644 index 11464652db844..0000000000000 Binary files a/0.15/_images/plot_image_denoising_001.png and /dev/null differ diff --git a/0.15/_images/plot_image_denoising_0011.png b/0.15/_images/plot_image_denoising_0011.png deleted file mode 100644 index 11464652db844..0000000000000 Binary files a/0.15/_images/plot_image_denoising_0011.png and /dev/null differ diff --git a/0.15/_images/plot_image_denoising_002.png b/0.15/_images/plot_image_denoising_002.png deleted file mode 100644 index 775b07a16b000..0000000000000 Binary files a/0.15/_images/plot_image_denoising_002.png and /dev/null differ diff --git a/0.15/_images/plot_image_denoising_003.png b/0.15/_images/plot_image_denoising_003.png deleted file mode 100644 index 99340e0e22651..0000000000000 Binary files a/0.15/_images/plot_image_denoising_003.png and /dev/null differ diff --git a/0.15/_images/plot_image_denoising_004.png b/0.15/_images/plot_image_denoising_004.png deleted file mode 100644 index 81d02db55daa2..0000000000000 Binary files a/0.15/_images/plot_image_denoising_004.png and /dev/null differ diff --git a/0.15/_images/plot_image_denoising_005.png b/0.15/_images/plot_image_denoising_005.png deleted file mode 100644 index 6fba921172b40..0000000000000 Binary files a/0.15/_images/plot_image_denoising_005.png and /dev/null differ diff --git a/0.15/_images/plot_image_denoising_006.png b/0.15/_images/plot_image_denoising_006.png deleted file mode 100644 index 6c7937bf21311..0000000000000 Binary files a/0.15/_images/plot_image_denoising_006.png and /dev/null differ diff --git a/0.15/_images/plot_incremental_pca.png b/0.15/_images/plot_incremental_pca.png deleted file mode 100644 index ba3ec999f1dd3..0000000000000 Binary files a/0.15/_images/plot_incremental_pca.png and /dev/null differ diff --git a/0.15/_images/plot_incremental_pca1.png b/0.15/_images/plot_incremental_pca1.png deleted file mode 100644 index ba3ec999f1dd3..0000000000000 Binary files a/0.15/_images/plot_incremental_pca1.png and /dev/null differ diff --git a/0.15/_images/plot_incremental_pca_001.png b/0.15/_images/plot_incremental_pca_001.png deleted file mode 100644 index 055a1a5be1620..0000000000000 Binary files a/0.15/_images/plot_incremental_pca_001.png and /dev/null differ diff --git a/0.15/_images/plot_incremental_pca_0011.png b/0.15/_images/plot_incremental_pca_0011.png deleted file mode 100644 index 055a1a5be1620..0000000000000 Binary files a/0.15/_images/plot_incremental_pca_0011.png and /dev/null differ diff --git a/0.15/_images/plot_incremental_pca_002.png b/0.15/_images/plot_incremental_pca_002.png deleted file mode 100644 index 32185c666dd00..0000000000000 Binary files a/0.15/_images/plot_incremental_pca_002.png and /dev/null differ diff --git a/0.15/_images/plot_incremental_pca_0021.png b/0.15/_images/plot_incremental_pca_0021.png deleted file mode 100644 index 32185c666dd00..0000000000000 Binary files a/0.15/_images/plot_incremental_pca_0021.png and /dev/null differ diff --git a/0.15/_images/plot_iris.png b/0.15/_images/plot_iris.png deleted file mode 100644 index 57533cbf89137..0000000000000 Binary files a/0.15/_images/plot_iris.png and /dev/null differ diff --git a/0.15/_images/plot_iris1.png b/0.15/_images/plot_iris1.png deleted file mode 100644 index bca6cab19f20b..0000000000000 Binary files a/0.15/_images/plot_iris1.png and /dev/null differ diff --git a/0.15/_images/plot_iris2.png b/0.15/_images/plot_iris2.png deleted file mode 100644 index 57533cbf89137..0000000000000 Binary files a/0.15/_images/plot_iris2.png and /dev/null differ diff --git a/0.15/_images/plot_iris3.png b/0.15/_images/plot_iris3.png deleted file mode 100644 index bca6cab19f20b..0000000000000 Binary files a/0.15/_images/plot_iris3.png and /dev/null differ diff --git a/0.15/_images/plot_iris_001.png b/0.15/_images/plot_iris_001.png deleted file mode 100644 index 80034e59e0ea4..0000000000000 Binary files a/0.15/_images/plot_iris_001.png and /dev/null differ diff --git a/0.15/_images/plot_iris_0011.png b/0.15/_images/plot_iris_0011.png deleted file mode 100644 index 3cdbef8aad82c..0000000000000 Binary files a/0.15/_images/plot_iris_0011.png and /dev/null differ diff --git a/0.15/_images/plot_iris_0012.png b/0.15/_images/plot_iris_0012.png deleted file mode 100644 index 80034e59e0ea4..0000000000000 Binary files a/0.15/_images/plot_iris_0012.png and /dev/null differ diff --git a/0.15/_images/plot_iris_0013.png b/0.15/_images/plot_iris_0013.png deleted file mode 100644 index 3cdbef8aad82c..0000000000000 Binary files a/0.15/_images/plot_iris_0013.png and /dev/null differ diff --git a/0.15/_images/plot_iris_dataset.png b/0.15/_images/plot_iris_dataset.png deleted file mode 100644 index f9fbc71a1bc19..0000000000000 Binary files a/0.15/_images/plot_iris_dataset.png and /dev/null differ diff --git a/0.15/_images/plot_iris_dataset1.png b/0.15/_images/plot_iris_dataset1.png deleted file mode 100644 index f9fbc71a1bc19..0000000000000 Binary files a/0.15/_images/plot_iris_dataset1.png and /dev/null differ diff --git a/0.15/_images/plot_iris_dataset_001.png b/0.15/_images/plot_iris_dataset_001.png deleted file mode 100644 index eec26c80df660..0000000000000 Binary files a/0.15/_images/plot_iris_dataset_001.png and /dev/null differ diff --git a/0.15/_images/plot_iris_dataset_0011.png b/0.15/_images/plot_iris_dataset_0011.png deleted file mode 100644 index eec26c80df660..0000000000000 Binary files a/0.15/_images/plot_iris_dataset_0011.png and /dev/null differ diff --git a/0.15/_images/plot_iris_dataset_002.png b/0.15/_images/plot_iris_dataset_002.png deleted file mode 100644 index 168b7727c52a1..0000000000000 Binary files a/0.15/_images/plot_iris_dataset_002.png and /dev/null differ diff --git a/0.15/_images/plot_iris_exercise.png b/0.15/_images/plot_iris_exercise.png deleted file mode 100644 index d67726883cae1..0000000000000 Binary files a/0.15/_images/plot_iris_exercise.png and /dev/null differ diff --git a/0.15/_images/plot_iris_exercise1.png b/0.15/_images/plot_iris_exercise1.png deleted file mode 100644 index d67726883cae1..0000000000000 Binary files a/0.15/_images/plot_iris_exercise1.png and /dev/null differ diff --git a/0.15/_images/plot_iris_exercise_000.png b/0.15/_images/plot_iris_exercise_000.png deleted file mode 100644 index cf4a2819bb1b3..0000000000000 Binary files a/0.15/_images/plot_iris_exercise_000.png and /dev/null differ diff --git a/0.15/_images/plot_iris_exercise_001.png b/0.15/_images/plot_iris_exercise_001.png deleted file mode 100644 index e4185b195b4d6..0000000000000 Binary files a/0.15/_images/plot_iris_exercise_001.png and /dev/null differ diff --git a/0.15/_images/plot_iris_exercise_002.png b/0.15/_images/plot_iris_exercise_002.png deleted file mode 100644 index 29dd51a066bd6..0000000000000 Binary files a/0.15/_images/plot_iris_exercise_002.png and /dev/null differ diff --git a/0.15/_images/plot_iris_logistic.png b/0.15/_images/plot_iris_logistic.png deleted file mode 100644 index f67a43a0990b8..0000000000000 Binary files a/0.15/_images/plot_iris_logistic.png and /dev/null differ diff --git a/0.15/_images/plot_iris_logistic1.png b/0.15/_images/plot_iris_logistic1.png deleted file mode 100644 index f67a43a0990b8..0000000000000 Binary files a/0.15/_images/plot_iris_logistic1.png and /dev/null differ diff --git a/0.15/_images/plot_iris_logistic_001.png b/0.15/_images/plot_iris_logistic_001.png deleted file mode 100644 index 7411d68d38949..0000000000000 Binary files a/0.15/_images/plot_iris_logistic_001.png and /dev/null differ diff --git a/0.15/_images/plot_iris_logistic_0011.png b/0.15/_images/plot_iris_logistic_0011.png deleted file mode 100644 index 7411d68d38949..0000000000000 Binary files a/0.15/_images/plot_iris_logistic_0011.png and /dev/null differ diff --git a/0.15/_images/plot_isotonic_regression.png b/0.15/_images/plot_isotonic_regression.png deleted file mode 100644 index 4dbb11fe26690..0000000000000 Binary files a/0.15/_images/plot_isotonic_regression.png and /dev/null differ diff --git a/0.15/_images/plot_isotonic_regression1.png b/0.15/_images/plot_isotonic_regression1.png deleted file mode 100644 index 4dbb11fe26690..0000000000000 Binary files a/0.15/_images/plot_isotonic_regression1.png and /dev/null differ diff --git a/0.15/_images/plot_isotonic_regression_001.png b/0.15/_images/plot_isotonic_regression_001.png deleted file mode 100644 index 138d75bde90b8..0000000000000 Binary files a/0.15/_images/plot_isotonic_regression_001.png and /dev/null differ diff --git a/0.15/_images/plot_isotonic_regression_0011.png b/0.15/_images/plot_isotonic_regression_0011.png deleted file mode 100644 index 138d75bde90b8..0000000000000 Binary files a/0.15/_images/plot_isotonic_regression_0011.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound.png b/0.15/_images/plot_johnson_lindenstrauss_bound.png deleted file mode 100644 index 7530436d7cf97..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound1.png b/0.15/_images/plot_johnson_lindenstrauss_bound1.png deleted file mode 100644 index 7530436d7cf97..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound1.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_001.png b/0.15/_images/plot_johnson_lindenstrauss_bound_001.png deleted file mode 100644 index 3bfabf3943d88..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_001.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_0011.png b/0.15/_images/plot_johnson_lindenstrauss_bound_0011.png deleted file mode 100644 index 3bfabf3943d88..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_0011.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_002.png b/0.15/_images/plot_johnson_lindenstrauss_bound_002.png deleted file mode 100644 index e754d0769e0fb..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_002.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_0021.png b/0.15/_images/plot_johnson_lindenstrauss_bound_0021.png deleted file mode 100644 index e754d0769e0fb..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_0021.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_003.png b/0.15/_images/plot_johnson_lindenstrauss_bound_003.png deleted file mode 100644 index cfdc01ea9139f..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_003.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_004.png b/0.15/_images/plot_johnson_lindenstrauss_bound_004.png deleted file mode 100644 index cacc0d1e5ec98..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_004.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_005.png b/0.15/_images/plot_johnson_lindenstrauss_bound_005.png deleted file mode 100644 index 3d25e716747ea..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_005.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_006.png b/0.15/_images/plot_johnson_lindenstrauss_bound_006.png deleted file mode 100644 index 0fd68051ce6f9..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_006.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_007.png b/0.15/_images/plot_johnson_lindenstrauss_bound_007.png deleted file mode 100644 index fe019adb52b7c..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_007.png and /dev/null differ diff --git a/0.15/_images/plot_johnson_lindenstrauss_bound_008.png b/0.15/_images/plot_johnson_lindenstrauss_bound_008.png deleted file mode 100644 index fbe5e9ddf0c19..0000000000000 Binary files a/0.15/_images/plot_johnson_lindenstrauss_bound_008.png and /dev/null differ diff --git a/0.15/_images/plot_kde_1d.png b/0.15/_images/plot_kde_1d.png deleted file mode 100644 index 986e5def4e7d3..0000000000000 Binary files a/0.15/_images/plot_kde_1d.png and /dev/null differ diff --git a/0.15/_images/plot_kde_1d1.png b/0.15/_images/plot_kde_1d1.png deleted file mode 100644 index 986e5def4e7d3..0000000000000 Binary files a/0.15/_images/plot_kde_1d1.png and /dev/null differ diff --git a/0.15/_images/plot_kde_1d_001.png b/0.15/_images/plot_kde_1d_001.png deleted file mode 100644 index 9b7e75aaf0a03..0000000000000 Binary files a/0.15/_images/plot_kde_1d_001.png and /dev/null differ diff --git a/0.15/_images/plot_kde_1d_0011.png b/0.15/_images/plot_kde_1d_0011.png deleted file mode 100644 index 9b7e75aaf0a03..0000000000000 Binary files a/0.15/_images/plot_kde_1d_0011.png and /dev/null differ diff --git a/0.15/_images/plot_kde_1d_002.png b/0.15/_images/plot_kde_1d_002.png deleted file mode 100644 index 6e5ea7b0262a3..0000000000000 Binary files a/0.15/_images/plot_kde_1d_002.png and /dev/null differ diff --git a/0.15/_images/plot_kde_1d_0021.png b/0.15/_images/plot_kde_1d_0021.png deleted file mode 100644 index 6e5ea7b0262a3..0000000000000 Binary files a/0.15/_images/plot_kde_1d_0021.png and /dev/null differ diff --git a/0.15/_images/plot_kde_1d_003.png b/0.15/_images/plot_kde_1d_003.png deleted file mode 100644 index 96098d8d7187e..0000000000000 Binary files a/0.15/_images/plot_kde_1d_003.png and /dev/null differ diff --git a/0.15/_images/plot_kde_1d_0031.png b/0.15/_images/plot_kde_1d_0031.png deleted file mode 100644 index 96098d8d7187e..0000000000000 Binary files a/0.15/_images/plot_kde_1d_0031.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_approximation.png b/0.15/_images/plot_kernel_approximation.png deleted file mode 100644 index d09d7e3c8b44e..0000000000000 Binary files a/0.15/_images/plot_kernel_approximation.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_approximation1.png b/0.15/_images/plot_kernel_approximation1.png deleted file mode 100644 index d09d7e3c8b44e..0000000000000 Binary files a/0.15/_images/plot_kernel_approximation1.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_approximation_001.png b/0.15/_images/plot_kernel_approximation_001.png deleted file mode 100644 index b8ddac5ce76c9..0000000000000 Binary files a/0.15/_images/plot_kernel_approximation_001.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_approximation_002.png b/0.15/_images/plot_kernel_approximation_002.png deleted file mode 100644 index 673b90a3d2abe..0000000000000 Binary files a/0.15/_images/plot_kernel_approximation_002.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_approximation_0021.png b/0.15/_images/plot_kernel_approximation_0021.png deleted file mode 100644 index 673b90a3d2abe..0000000000000 Binary files a/0.15/_images/plot_kernel_approximation_0021.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_pca.png b/0.15/_images/plot_kernel_pca.png deleted file mode 100644 index 5d8580d8fad05..0000000000000 Binary files a/0.15/_images/plot_kernel_pca.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_pca1.png b/0.15/_images/plot_kernel_pca1.png deleted file mode 100644 index 5d8580d8fad05..0000000000000 Binary files a/0.15/_images/plot_kernel_pca1.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_pca2.png b/0.15/_images/plot_kernel_pca2.png deleted file mode 100644 index 5d8580d8fad05..0000000000000 Binary files a/0.15/_images/plot_kernel_pca2.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_pca_001.png b/0.15/_images/plot_kernel_pca_001.png deleted file mode 100644 index 180b5c884343d..0000000000000 Binary files a/0.15/_images/plot_kernel_pca_001.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_pca_0011.png b/0.15/_images/plot_kernel_pca_0011.png deleted file mode 100644 index 180b5c884343d..0000000000000 Binary files a/0.15/_images/plot_kernel_pca_0011.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_ridge_regression.png b/0.15/_images/plot_kernel_ridge_regression.png deleted file mode 100644 index 635fa03548246..0000000000000 Binary files a/0.15/_images/plot_kernel_ridge_regression.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_ridge_regression1.png b/0.15/_images/plot_kernel_ridge_regression1.png deleted file mode 100644 index 635fa03548246..0000000000000 Binary files a/0.15/_images/plot_kernel_ridge_regression1.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_ridge_regression_001.png b/0.15/_images/plot_kernel_ridge_regression_001.png deleted file mode 100644 index 30f2c140260b5..0000000000000 Binary files a/0.15/_images/plot_kernel_ridge_regression_001.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_ridge_regression_0011.png b/0.15/_images/plot_kernel_ridge_regression_0011.png deleted file mode 100644 index 30f2c140260b5..0000000000000 Binary files a/0.15/_images/plot_kernel_ridge_regression_0011.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_ridge_regression_002.png b/0.15/_images/plot_kernel_ridge_regression_002.png deleted file mode 100644 index 742f99c1eebbc..0000000000000 Binary files a/0.15/_images/plot_kernel_ridge_regression_002.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_ridge_regression_0021.png b/0.15/_images/plot_kernel_ridge_regression_0021.png deleted file mode 100644 index 742f99c1eebbc..0000000000000 Binary files a/0.15/_images/plot_kernel_ridge_regression_0021.png and /dev/null differ diff --git a/0.15/_images/plot_kernel_ridge_regression_003.png b/0.15/_images/plot_kernel_ridge_regression_003.png deleted file mode 100644 index 33a6571c64397..0000000000000 Binary files a/0.15/_images/plot_kernel_ridge_regression_003.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_digits.png b/0.15/_images/plot_kmeans_digits.png deleted file mode 100644 index 4fed42e72991b..0000000000000 Binary files a/0.15/_images/plot_kmeans_digits.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_digits1.png b/0.15/_images/plot_kmeans_digits1.png deleted file mode 100644 index 4fed42e72991b..0000000000000 Binary files a/0.15/_images/plot_kmeans_digits1.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_digits_001.png b/0.15/_images/plot_kmeans_digits_001.png deleted file mode 100644 index 269ca234c1186..0000000000000 Binary files a/0.15/_images/plot_kmeans_digits_001.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_digits_0011.png b/0.15/_images/plot_kmeans_digits_0011.png deleted file mode 100644 index 269ca234c1186..0000000000000 Binary files a/0.15/_images/plot_kmeans_digits_0011.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_silhouette_analysis.png b/0.15/_images/plot_kmeans_silhouette_analysis.png deleted file mode 100644 index 1723e2f408187..0000000000000 Binary files a/0.15/_images/plot_kmeans_silhouette_analysis.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_silhouette_analysis1.png b/0.15/_images/plot_kmeans_silhouette_analysis1.png deleted file mode 100644 index 1723e2f408187..0000000000000 Binary files a/0.15/_images/plot_kmeans_silhouette_analysis1.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_silhouette_analysis_001.png b/0.15/_images/plot_kmeans_silhouette_analysis_001.png deleted file mode 100644 index 4ccf51d6ac1b7..0000000000000 Binary files a/0.15/_images/plot_kmeans_silhouette_analysis_001.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_silhouette_analysis_002.png b/0.15/_images/plot_kmeans_silhouette_analysis_002.png deleted file mode 100644 index a389bcf915121..0000000000000 Binary files a/0.15/_images/plot_kmeans_silhouette_analysis_002.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_silhouette_analysis_003.png b/0.15/_images/plot_kmeans_silhouette_analysis_003.png deleted file mode 100644 index 288ba8a0e4a5a..0000000000000 Binary files a/0.15/_images/plot_kmeans_silhouette_analysis_003.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_silhouette_analysis_004.png b/0.15/_images/plot_kmeans_silhouette_analysis_004.png deleted file mode 100644 index bcb3ef18ad977..0000000000000 Binary files a/0.15/_images/plot_kmeans_silhouette_analysis_004.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_silhouette_analysis_005.png b/0.15/_images/plot_kmeans_silhouette_analysis_005.png deleted file mode 100644 index 89c040f8b6b5f..0000000000000 Binary files a/0.15/_images/plot_kmeans_silhouette_analysis_005.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_stability_low_dim_dense.png b/0.15/_images/plot_kmeans_stability_low_dim_dense.png deleted file mode 100644 index 9f45bde0ab8f8..0000000000000 Binary files a/0.15/_images/plot_kmeans_stability_low_dim_dense.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_stability_low_dim_dense1.png b/0.15/_images/plot_kmeans_stability_low_dim_dense1.png deleted file mode 100644 index 9f45bde0ab8f8..0000000000000 Binary files a/0.15/_images/plot_kmeans_stability_low_dim_dense1.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_stability_low_dim_dense_001.png b/0.15/_images/plot_kmeans_stability_low_dim_dense_001.png deleted file mode 100644 index f711b940f1a3b..0000000000000 Binary files a/0.15/_images/plot_kmeans_stability_low_dim_dense_001.png and /dev/null differ diff --git a/0.15/_images/plot_kmeans_stability_low_dim_dense_002.png b/0.15/_images/plot_kmeans_stability_low_dim_dense_002.png deleted file mode 100644 index f9fccdca2cabb..0000000000000 Binary files a/0.15/_images/plot_kmeans_stability_low_dim_dense_002.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_digits.png b/0.15/_images/plot_label_propagation_digits.png deleted file mode 100644 index 789ba748c0a47..0000000000000 Binary files a/0.15/_images/plot_label_propagation_digits.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_digits1.png b/0.15/_images/plot_label_propagation_digits1.png deleted file mode 100644 index 789ba748c0a47..0000000000000 Binary files a/0.15/_images/plot_label_propagation_digits1.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_digits_001.png b/0.15/_images/plot_label_propagation_digits_001.png deleted file mode 100644 index cdf391c64b6c5..0000000000000 Binary files a/0.15/_images/plot_label_propagation_digits_001.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_digits_active_learning.png b/0.15/_images/plot_label_propagation_digits_active_learning.png deleted file mode 100644 index 821e21bd2f20e..0000000000000 Binary files a/0.15/_images/plot_label_propagation_digits_active_learning.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_digits_active_learning1.png b/0.15/_images/plot_label_propagation_digits_active_learning1.png deleted file mode 100644 index 821e21bd2f20e..0000000000000 Binary files a/0.15/_images/plot_label_propagation_digits_active_learning1.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_digits_active_learning_001.png b/0.15/_images/plot_label_propagation_digits_active_learning_001.png deleted file mode 100644 index a47d97e7db56f..0000000000000 Binary files a/0.15/_images/plot_label_propagation_digits_active_learning_001.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_structure.png b/0.15/_images/plot_label_propagation_structure.png deleted file mode 100644 index 9c5b18a1ba84c..0000000000000 Binary files a/0.15/_images/plot_label_propagation_structure.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_structure1.png b/0.15/_images/plot_label_propagation_structure1.png deleted file mode 100644 index 9c5b18a1ba84c..0000000000000 Binary files a/0.15/_images/plot_label_propagation_structure1.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_structure_001.png b/0.15/_images/plot_label_propagation_structure_001.png deleted file mode 100644 index f6634e3f4e458..0000000000000 Binary files a/0.15/_images/plot_label_propagation_structure_001.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_structure_0011.png b/0.15/_images/plot_label_propagation_structure_0011.png deleted file mode 100644 index f6634e3f4e458..0000000000000 Binary files a/0.15/_images/plot_label_propagation_structure_0011.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_versus_svm_iris.png b/0.15/_images/plot_label_propagation_versus_svm_iris.png deleted file mode 100644 index 34f61d61a85df..0000000000000 Binary files a/0.15/_images/plot_label_propagation_versus_svm_iris.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_versus_svm_iris1.png b/0.15/_images/plot_label_propagation_versus_svm_iris1.png deleted file mode 100644 index 34f61d61a85df..0000000000000 Binary files a/0.15/_images/plot_label_propagation_versus_svm_iris1.png and /dev/null differ diff --git a/0.15/_images/plot_label_propagation_versus_svm_iris_001.png b/0.15/_images/plot_label_propagation_versus_svm_iris_001.png deleted file mode 100644 index 9f93063ca8212..0000000000000 Binary files a/0.15/_images/plot_label_propagation_versus_svm_iris_001.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_and_elasticnet.png b/0.15/_images/plot_lasso_and_elasticnet.png deleted file mode 100644 index e90163a9b2e0d..0000000000000 Binary files a/0.15/_images/plot_lasso_and_elasticnet.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_and_elasticnet1.png b/0.15/_images/plot_lasso_and_elasticnet1.png deleted file mode 100644 index e90163a9b2e0d..0000000000000 Binary files a/0.15/_images/plot_lasso_and_elasticnet1.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_and_elasticnet_001.png b/0.15/_images/plot_lasso_and_elasticnet_001.png deleted file mode 100644 index a73941abf395f..0000000000000 Binary files a/0.15/_images/plot_lasso_and_elasticnet_001.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_coordinate_descent_path.png b/0.15/_images/plot_lasso_coordinate_descent_path.png deleted file mode 100644 index 0d2c40eb015dd..0000000000000 Binary files a/0.15/_images/plot_lasso_coordinate_descent_path.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_coordinate_descent_path1.png b/0.15/_images/plot_lasso_coordinate_descent_path1.png deleted file mode 100644 index 0d2c40eb015dd..0000000000000 Binary files a/0.15/_images/plot_lasso_coordinate_descent_path1.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_coordinate_descent_path_001.png b/0.15/_images/plot_lasso_coordinate_descent_path_001.png deleted file mode 100644 index 845cfff951f16..0000000000000 Binary files a/0.15/_images/plot_lasso_coordinate_descent_path_001.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_coordinate_descent_path_0011.png b/0.15/_images/plot_lasso_coordinate_descent_path_0011.png deleted file mode 100644 index 845cfff951f16..0000000000000 Binary files a/0.15/_images/plot_lasso_coordinate_descent_path_0011.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_coordinate_descent_path_002.png b/0.15/_images/plot_lasso_coordinate_descent_path_002.png deleted file mode 100644 index 4536d0375d927..0000000000000 Binary files a/0.15/_images/plot_lasso_coordinate_descent_path_002.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_coordinate_descent_path_003.png b/0.15/_images/plot_lasso_coordinate_descent_path_003.png deleted file mode 100644 index 35c8ea52dcfdd..0000000000000 Binary files a/0.15/_images/plot_lasso_coordinate_descent_path_003.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_lars.png b/0.15/_images/plot_lasso_lars.png deleted file mode 100644 index 0e4f1efbbd1bd..0000000000000 Binary files a/0.15/_images/plot_lasso_lars.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_lars1.png b/0.15/_images/plot_lasso_lars1.png deleted file mode 100644 index 0e4f1efbbd1bd..0000000000000 Binary files a/0.15/_images/plot_lasso_lars1.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_lars_001.png b/0.15/_images/plot_lasso_lars_001.png deleted file mode 100644 index fb230941e1e39..0000000000000 Binary files a/0.15/_images/plot_lasso_lars_001.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_lars_0011.png b/0.15/_images/plot_lasso_lars_0011.png deleted file mode 100644 index fb230941e1e39..0000000000000 Binary files a/0.15/_images/plot_lasso_lars_0011.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_model_selection.png b/0.15/_images/plot_lasso_model_selection.png deleted file mode 100644 index 069ed6379fe52..0000000000000 Binary files a/0.15/_images/plot_lasso_model_selection.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_model_selection1.png b/0.15/_images/plot_lasso_model_selection1.png deleted file mode 100644 index 069ed6379fe52..0000000000000 Binary files a/0.15/_images/plot_lasso_model_selection1.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_model_selection_001.png b/0.15/_images/plot_lasso_model_selection_001.png deleted file mode 100644 index 6febf0a8bb2cd..0000000000000 Binary files a/0.15/_images/plot_lasso_model_selection_001.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_model_selection_0011.png b/0.15/_images/plot_lasso_model_selection_0011.png deleted file mode 100644 index 6febf0a8bb2cd..0000000000000 Binary files a/0.15/_images/plot_lasso_model_selection_0011.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_model_selection_002.png b/0.15/_images/plot_lasso_model_selection_002.png deleted file mode 100644 index 425930ead7567..0000000000000 Binary files a/0.15/_images/plot_lasso_model_selection_002.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_model_selection_0021.png b/0.15/_images/plot_lasso_model_selection_0021.png deleted file mode 100644 index 425930ead7567..0000000000000 Binary files a/0.15/_images/plot_lasso_model_selection_0021.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_model_selection_003.png b/0.15/_images/plot_lasso_model_selection_003.png deleted file mode 100644 index 06a82270f2bda..0000000000000 Binary files a/0.15/_images/plot_lasso_model_selection_003.png and /dev/null differ diff --git a/0.15/_images/plot_lasso_model_selection_0031.png b/0.15/_images/plot_lasso_model_selection_0031.png deleted file mode 100644 index 06a82270f2bda..0000000000000 Binary files a/0.15/_images/plot_lasso_model_selection_0031.png and /dev/null differ diff --git a/0.15/_images/plot_lda.png b/0.15/_images/plot_lda.png deleted file mode 100644 index 23b32bd53c1e0..0000000000000 Binary files a/0.15/_images/plot_lda.png and /dev/null differ diff --git a/0.15/_images/plot_lda1.png b/0.15/_images/plot_lda1.png deleted file mode 100644 index 23b32bd53c1e0..0000000000000 Binary files a/0.15/_images/plot_lda1.png and /dev/null differ diff --git a/0.15/_images/plot_lda_001.png b/0.15/_images/plot_lda_001.png deleted file mode 100644 index e240014f2b349..0000000000000 Binary files a/0.15/_images/plot_lda_001.png and /dev/null differ diff --git a/0.15/_images/plot_lda_0011.png b/0.15/_images/plot_lda_0011.png deleted file mode 100644 index e240014f2b349..0000000000000 Binary files a/0.15/_images/plot_lda_0011.png and /dev/null differ diff --git a/0.15/_images/plot_lda_qda.png b/0.15/_images/plot_lda_qda.png deleted file mode 100644 index 8e9ab620df08b..0000000000000 Binary files a/0.15/_images/plot_lda_qda.png and /dev/null differ diff --git a/0.15/_images/plot_lda_qda1.png b/0.15/_images/plot_lda_qda1.png deleted file mode 100644 index 8c89abb27a14e..0000000000000 Binary files a/0.15/_images/plot_lda_qda1.png and /dev/null differ diff --git a/0.15/_images/plot_lda_qda_001.png b/0.15/_images/plot_lda_qda_001.png deleted file mode 100644 index 93dec4b3d2d9e..0000000000000 Binary files a/0.15/_images/plot_lda_qda_001.png and /dev/null differ diff --git a/0.15/_images/plot_lda_qda_0011.png b/0.15/_images/plot_lda_qda_0011.png deleted file mode 100644 index c19c140915b15..0000000000000 Binary files a/0.15/_images/plot_lda_qda_0011.png and /dev/null differ diff --git a/0.15/_images/plot_lda_qda_0012.png b/0.15/_images/plot_lda_qda_0012.png deleted file mode 100644 index c19c140915b15..0000000000000 Binary files a/0.15/_images/plot_lda_qda_0012.png and /dev/null differ diff --git a/0.15/_images/plot_learning_curve.png b/0.15/_images/plot_learning_curve.png deleted file mode 100644 index 744d31bef3da0..0000000000000 Binary files a/0.15/_images/plot_learning_curve.png and /dev/null differ diff --git a/0.15/_images/plot_learning_curve1.png b/0.15/_images/plot_learning_curve1.png deleted file mode 100644 index 4e4aba1aea000..0000000000000 Binary files a/0.15/_images/plot_learning_curve1.png and /dev/null differ diff --git a/0.15/_images/plot_learning_curve_001.png b/0.15/_images/plot_learning_curve_001.png deleted file mode 100644 index 9abe0432c79b5..0000000000000 Binary files a/0.15/_images/plot_learning_curve_001.png and /dev/null differ diff --git a/0.15/_images/plot_learning_curve_0011.png b/0.15/_images/plot_learning_curve_0011.png deleted file mode 100644 index 29a95782ce919..0000000000000 Binary files a/0.15/_images/plot_learning_curve_0011.png and /dev/null differ diff --git a/0.15/_images/plot_learning_curve_0012.png b/0.15/_images/plot_learning_curve_0012.png deleted file mode 100644 index 29a95782ce919..0000000000000 Binary files a/0.15/_images/plot_learning_curve_0012.png and /dev/null differ diff --git a/0.15/_images/plot_learning_curve_002.png b/0.15/_images/plot_learning_curve_002.png deleted file mode 100644 index c0086d31b2dc0..0000000000000 Binary files a/0.15/_images/plot_learning_curve_002.png and /dev/null differ diff --git a/0.15/_images/plot_learning_curve_0021.png b/0.15/_images/plot_learning_curve_0021.png deleted file mode 100644 index d274bf312422c..0000000000000 Binary files a/0.15/_images/plot_learning_curve_0021.png and /dev/null differ diff --git a/0.15/_images/plot_learning_curve_0022.png b/0.15/_images/plot_learning_curve_0022.png deleted file mode 100644 index d274bf312422c..0000000000000 Binary files a/0.15/_images/plot_learning_curve_0022.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress.png b/0.15/_images/plot_lena_compress.png deleted file mode 100644 index 437a18ceec5b9..0000000000000 Binary files a/0.15/_images/plot_lena_compress.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress1.png b/0.15/_images/plot_lena_compress1.png deleted file mode 100644 index 437a18ceec5b9..0000000000000 Binary files a/0.15/_images/plot_lena_compress1.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress_001.png b/0.15/_images/plot_lena_compress_001.png deleted file mode 100644 index 085229a2d063b..0000000000000 Binary files a/0.15/_images/plot_lena_compress_001.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress_0011.png b/0.15/_images/plot_lena_compress_0011.png deleted file mode 100644 index 085229a2d063b..0000000000000 Binary files a/0.15/_images/plot_lena_compress_0011.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress_002.png b/0.15/_images/plot_lena_compress_002.png deleted file mode 100644 index 1305e260e56bb..0000000000000 Binary files a/0.15/_images/plot_lena_compress_002.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress_0021.png b/0.15/_images/plot_lena_compress_0021.png deleted file mode 100644 index 1305e260e56bb..0000000000000 Binary files a/0.15/_images/plot_lena_compress_0021.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress_003.png b/0.15/_images/plot_lena_compress_003.png deleted file mode 100644 index 9a45aaf7c50b7..0000000000000 Binary files a/0.15/_images/plot_lena_compress_003.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress_0031.png b/0.15/_images/plot_lena_compress_0031.png deleted file mode 100644 index 9a45aaf7c50b7..0000000000000 Binary files a/0.15/_images/plot_lena_compress_0031.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress_004.png b/0.15/_images/plot_lena_compress_004.png deleted file mode 100644 index 78307b8b0ad44..0000000000000 Binary files a/0.15/_images/plot_lena_compress_004.png and /dev/null differ diff --git a/0.15/_images/plot_lena_compress_0041.png b/0.15/_images/plot_lena_compress_0041.png deleted file mode 100644 index 78307b8b0ad44..0000000000000 Binary files a/0.15/_images/plot_lena_compress_0041.png and /dev/null differ diff --git a/0.15/_images/plot_lena_segmentation.png b/0.15/_images/plot_lena_segmentation.png deleted file mode 100644 index c8ff52a91e385..0000000000000 Binary files a/0.15/_images/plot_lena_segmentation.png and /dev/null differ diff --git a/0.15/_images/plot_lena_segmentation1.png b/0.15/_images/plot_lena_segmentation1.png deleted file mode 100644 index c8ff52a91e385..0000000000000 Binary files a/0.15/_images/plot_lena_segmentation1.png and /dev/null differ diff --git a/0.15/_images/plot_lena_segmentation_001.png b/0.15/_images/plot_lena_segmentation_001.png deleted file mode 100644 index 365ac866c6dcc..0000000000000 Binary files a/0.15/_images/plot_lena_segmentation_001.png and /dev/null differ diff --git a/0.15/_images/plot_lena_segmentation_0011.png b/0.15/_images/plot_lena_segmentation_0011.png deleted file mode 100644 index 365ac866c6dcc..0000000000000 Binary files a/0.15/_images/plot_lena_segmentation_0011.png and /dev/null differ diff --git a/0.15/_images/plot_lena_segmentation_002.png b/0.15/_images/plot_lena_segmentation_002.png deleted file mode 100644 index d131798f8d915..0000000000000 Binary files a/0.15/_images/plot_lena_segmentation_002.png and /dev/null differ diff --git a/0.15/_images/plot_lena_segmentation_0021.png b/0.15/_images/plot_lena_segmentation_0021.png deleted file mode 100644 index d131798f8d915..0000000000000 Binary files a/0.15/_images/plot_lena_segmentation_0021.png and /dev/null differ diff --git a/0.15/_images/plot_lena_ward_segmentation.png b/0.15/_images/plot_lena_ward_segmentation.png deleted file mode 100644 index 5542b3ba3bd41..0000000000000 Binary files a/0.15/_images/plot_lena_ward_segmentation.png and /dev/null differ diff --git a/0.15/_images/plot_lena_ward_segmentation1.png b/0.15/_images/plot_lena_ward_segmentation1.png deleted file mode 100644 index 5542b3ba3bd41..0000000000000 Binary files a/0.15/_images/plot_lena_ward_segmentation1.png and /dev/null differ diff --git a/0.15/_images/plot_lena_ward_segmentation_001.png b/0.15/_images/plot_lena_ward_segmentation_001.png deleted file mode 100644 index a57b72b96e32e..0000000000000 Binary files a/0.15/_images/plot_lena_ward_segmentation_001.png and /dev/null differ diff --git a/0.15/_images/plot_lena_ward_segmentation_0011.png b/0.15/_images/plot_lena_ward_segmentation_0011.png deleted file mode 100644 index a57b72b96e32e..0000000000000 Binary files a/0.15/_images/plot_lena_ward_segmentation_0011.png and /dev/null differ diff --git a/0.15/_images/plot_lena_ward_segmentation_0012.png b/0.15/_images/plot_lena_ward_segmentation_0012.png deleted file mode 100644 index a57b72b96e32e..0000000000000 Binary files a/0.15/_images/plot_lena_ward_segmentation_0012.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits.png b/0.15/_images/plot_lle_digits.png deleted file mode 100644 index f4204ad97efc4..0000000000000 Binary files a/0.15/_images/plot_lle_digits.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits1.png b/0.15/_images/plot_lle_digits1.png deleted file mode 100644 index f4204ad97efc4..0000000000000 Binary files a/0.15/_images/plot_lle_digits1.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_001.png b/0.15/_images/plot_lle_digits_001.png deleted file mode 100644 index 414d713cfce81..0000000000000 Binary files a/0.15/_images/plot_lle_digits_001.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0011.png b/0.15/_images/plot_lle_digits_0011.png deleted file mode 100644 index 414d713cfce81..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0011.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_002.png b/0.15/_images/plot_lle_digits_002.png deleted file mode 100644 index 712204e7fba98..0000000000000 Binary files a/0.15/_images/plot_lle_digits_002.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0021.png b/0.15/_images/plot_lle_digits_0021.png deleted file mode 100644 index 712204e7fba98..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0021.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_003.png b/0.15/_images/plot_lle_digits_003.png deleted file mode 100644 index f10d2f8b32814..0000000000000 Binary files a/0.15/_images/plot_lle_digits_003.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0031.png b/0.15/_images/plot_lle_digits_0031.png deleted file mode 100644 index f10d2f8b32814..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0031.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_004.png b/0.15/_images/plot_lle_digits_004.png deleted file mode 100644 index 54446b77f5967..0000000000000 Binary files a/0.15/_images/plot_lle_digits_004.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0041.png b/0.15/_images/plot_lle_digits_0041.png deleted file mode 100644 index 54446b77f5967..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0041.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_005.png b/0.15/_images/plot_lle_digits_005.png deleted file mode 100644 index a0ca2b803d0f2..0000000000000 Binary files a/0.15/_images/plot_lle_digits_005.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0051.png b/0.15/_images/plot_lle_digits_0051.png deleted file mode 100644 index a0ca2b803d0f2..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0051.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_006.png b/0.15/_images/plot_lle_digits_006.png deleted file mode 100644 index 2f02c7e017dd4..0000000000000 Binary files a/0.15/_images/plot_lle_digits_006.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0061.png b/0.15/_images/plot_lle_digits_0061.png deleted file mode 100644 index 2f02c7e017dd4..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0061.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_007.png b/0.15/_images/plot_lle_digits_007.png deleted file mode 100644 index 2fe1280606818..0000000000000 Binary files a/0.15/_images/plot_lle_digits_007.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0071.png b/0.15/_images/plot_lle_digits_0071.png deleted file mode 100644 index 2fe1280606818..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0071.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_008.png b/0.15/_images/plot_lle_digits_008.png deleted file mode 100644 index c5e49f0837bd3..0000000000000 Binary files a/0.15/_images/plot_lle_digits_008.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0081.png b/0.15/_images/plot_lle_digits_0081.png deleted file mode 100644 index c5e49f0837bd3..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0081.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_009.png b/0.15/_images/plot_lle_digits_009.png deleted file mode 100644 index ef87b8ffd19b1..0000000000000 Binary files a/0.15/_images/plot_lle_digits_009.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0091.png b/0.15/_images/plot_lle_digits_0091.png deleted file mode 100644 index ef87b8ffd19b1..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0091.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_010.png b/0.15/_images/plot_lle_digits_010.png deleted file mode 100644 index 362654919c29c..0000000000000 Binary files a/0.15/_images/plot_lle_digits_010.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0101.png b/0.15/_images/plot_lle_digits_0101.png deleted file mode 100644 index 362654919c29c..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0101.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_011.png b/0.15/_images/plot_lle_digits_011.png deleted file mode 100644 index 3d1cb3753d57b..0000000000000 Binary files a/0.15/_images/plot_lle_digits_011.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_012.png b/0.15/_images/plot_lle_digits_012.png deleted file mode 100644 index 3d71c75672f35..0000000000000 Binary files a/0.15/_images/plot_lle_digits_012.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_013.png b/0.15/_images/plot_lle_digits_013.png deleted file mode 100644 index 80d546867cdb0..0000000000000 Binary files a/0.15/_images/plot_lle_digits_013.png and /dev/null differ diff --git a/0.15/_images/plot_lle_digits_0131.png b/0.15/_images/plot_lle_digits_0131.png deleted file mode 100644 index 80d546867cdb0..0000000000000 Binary files a/0.15/_images/plot_lle_digits_0131.png and /dev/null differ diff --git a/0.15/_images/plot_logistic.png b/0.15/_images/plot_logistic.png deleted file mode 100644 index 869089e763f7a..0000000000000 Binary files a/0.15/_images/plot_logistic.png and /dev/null differ diff --git a/0.15/_images/plot_logistic1.png b/0.15/_images/plot_logistic1.png deleted file mode 100644 index 869089e763f7a..0000000000000 Binary files a/0.15/_images/plot_logistic1.png and /dev/null differ diff --git a/0.15/_images/plot_logistic_001.png b/0.15/_images/plot_logistic_001.png deleted file mode 100644 index be70feb1a91b5..0000000000000 Binary files a/0.15/_images/plot_logistic_001.png and /dev/null differ diff --git a/0.15/_images/plot_logistic_0011.png b/0.15/_images/plot_logistic_0011.png deleted file mode 100644 index be70feb1a91b5..0000000000000 Binary files a/0.15/_images/plot_logistic_0011.png and /dev/null differ diff --git a/0.15/_images/plot_logistic_l1_l2_sparsity.png b/0.15/_images/plot_logistic_l1_l2_sparsity.png deleted file mode 100644 index 8780b1021392c..0000000000000 Binary files a/0.15/_images/plot_logistic_l1_l2_sparsity.png and /dev/null differ diff --git a/0.15/_images/plot_logistic_l1_l2_sparsity1.png b/0.15/_images/plot_logistic_l1_l2_sparsity1.png deleted file mode 100644 index 8780b1021392c..0000000000000 Binary files a/0.15/_images/plot_logistic_l1_l2_sparsity1.png and /dev/null differ diff --git a/0.15/_images/plot_logistic_l1_l2_sparsity_001.png b/0.15/_images/plot_logistic_l1_l2_sparsity_001.png deleted file mode 100644 index 26dd83d1c3760..0000000000000 Binary files a/0.15/_images/plot_logistic_l1_l2_sparsity_001.png and /dev/null differ diff --git a/0.15/_images/plot_logistic_path.png b/0.15/_images/plot_logistic_path.png deleted file mode 100644 index 9edd34862db5b..0000000000000 Binary files a/0.15/_images/plot_logistic_path.png and /dev/null differ diff --git a/0.15/_images/plot_logistic_path1.png b/0.15/_images/plot_logistic_path1.png deleted file mode 100644 index 9edd34862db5b..0000000000000 Binary files a/0.15/_images/plot_logistic_path1.png and /dev/null differ diff --git a/0.15/_images/plot_logistic_path_001.png b/0.15/_images/plot_logistic_path_001.png deleted file mode 100644 index b0231b6acf662..0000000000000 Binary files a/0.15/_images/plot_logistic_path_001.png and /dev/null differ diff --git a/0.15/_images/plot_lw_vs_oas.png b/0.15/_images/plot_lw_vs_oas.png deleted file mode 100644 index c1861acb43547..0000000000000 Binary files a/0.15/_images/plot_lw_vs_oas.png and /dev/null differ diff --git a/0.15/_images/plot_lw_vs_oas1.png b/0.15/_images/plot_lw_vs_oas1.png deleted file mode 100644 index c1861acb43547..0000000000000 Binary files a/0.15/_images/plot_lw_vs_oas1.png and /dev/null differ diff --git a/0.15/_images/plot_lw_vs_oas_001.png b/0.15/_images/plot_lw_vs_oas_001.png deleted file mode 100644 index 2fdfab0038a4d..0000000000000 Binary files a/0.15/_images/plot_lw_vs_oas_001.png and /dev/null differ diff --git a/0.15/_images/plot_lw_vs_oas_0011.png b/0.15/_images/plot_lw_vs_oas_0011.png deleted file mode 100644 index 2fdfab0038a4d..0000000000000 Binary files a/0.15/_images/plot_lw_vs_oas_0011.png and /dev/null differ diff --git a/0.15/_images/plot_mahalanobis_distances.png b/0.15/_images/plot_mahalanobis_distances.png deleted file mode 100644 index cccc7e35967cc..0000000000000 Binary files a/0.15/_images/plot_mahalanobis_distances.png and /dev/null differ diff --git a/0.15/_images/plot_mahalanobis_distances1.png b/0.15/_images/plot_mahalanobis_distances1.png deleted file mode 100644 index cccc7e35967cc..0000000000000 Binary files a/0.15/_images/plot_mahalanobis_distances1.png and /dev/null differ diff --git a/0.15/_images/plot_mahalanobis_distances_001.png b/0.15/_images/plot_mahalanobis_distances_001.png deleted file mode 100644 index d1c096ca23e8a..0000000000000 Binary files a/0.15/_images/plot_mahalanobis_distances_001.png and /dev/null differ diff --git a/0.15/_images/plot_mahalanobis_distances_0011.png b/0.15/_images/plot_mahalanobis_distances_0011.png deleted file mode 100644 index d1c096ca23e8a..0000000000000 Binary files a/0.15/_images/plot_mahalanobis_distances_0011.png and /dev/null differ diff --git a/0.15/_images/plot_manifold_sphere.png b/0.15/_images/plot_manifold_sphere.png deleted file mode 100644 index 08e93dc60c56d..0000000000000 Binary files a/0.15/_images/plot_manifold_sphere.png and /dev/null differ diff --git a/0.15/_images/plot_manifold_sphere1.png b/0.15/_images/plot_manifold_sphere1.png deleted file mode 100644 index 08e93dc60c56d..0000000000000 Binary files a/0.15/_images/plot_manifold_sphere1.png and /dev/null differ diff --git a/0.15/_images/plot_manifold_sphere_001.png b/0.15/_images/plot_manifold_sphere_001.png deleted file mode 100644 index fa34a1fac8cbc..0000000000000 Binary files a/0.15/_images/plot_manifold_sphere_001.png and /dev/null differ diff --git a/0.15/_images/plot_mds.png b/0.15/_images/plot_mds.png deleted file mode 100644 index 51da10e410e76..0000000000000 Binary files a/0.15/_images/plot_mds.png and /dev/null differ diff --git a/0.15/_images/plot_mds1.png b/0.15/_images/plot_mds1.png deleted file mode 100644 index 51da10e410e76..0000000000000 Binary files a/0.15/_images/plot_mds1.png and /dev/null differ diff --git a/0.15/_images/plot_mds_001.png b/0.15/_images/plot_mds_001.png deleted file mode 100644 index b903157635752..0000000000000 Binary files a/0.15/_images/plot_mds_001.png and /dev/null differ diff --git a/0.15/_images/plot_mds_0011.png b/0.15/_images/plot_mds_0011.png deleted file mode 100644 index b903157635752..0000000000000 Binary files a/0.15/_images/plot_mds_0011.png and /dev/null differ diff --git a/0.15/_images/plot_mean_shift.png b/0.15/_images/plot_mean_shift.png deleted file mode 100644 index 7d57ff10da3ba..0000000000000 Binary files a/0.15/_images/plot_mean_shift.png and /dev/null differ diff --git a/0.15/_images/plot_mean_shift1.png b/0.15/_images/plot_mean_shift1.png deleted file mode 100644 index 7d57ff10da3ba..0000000000000 Binary files a/0.15/_images/plot_mean_shift1.png and /dev/null differ diff --git a/0.15/_images/plot_mean_shift_001.png b/0.15/_images/plot_mean_shift_001.png deleted file mode 100644 index 6df8f3b8c7f33..0000000000000 Binary files a/0.15/_images/plot_mean_shift_001.png and /dev/null differ diff --git a/0.15/_images/plot_mean_shift_0011.png b/0.15/_images/plot_mean_shift_0011.png deleted file mode 100644 index 6df8f3b8c7f33..0000000000000 Binary files a/0.15/_images/plot_mean_shift_0011.png and /dev/null differ diff --git a/0.15/_images/plot_mini_batch_kmeans.png b/0.15/_images/plot_mini_batch_kmeans.png deleted file mode 100644 index 2c597f132a9a4..0000000000000 Binary files a/0.15/_images/plot_mini_batch_kmeans.png and /dev/null differ diff --git a/0.15/_images/plot_mini_batch_kmeans1.png b/0.15/_images/plot_mini_batch_kmeans1.png deleted file mode 100644 index 2c597f132a9a4..0000000000000 Binary files a/0.15/_images/plot_mini_batch_kmeans1.png and /dev/null differ diff --git a/0.15/_images/plot_mini_batch_kmeans_001.png b/0.15/_images/plot_mini_batch_kmeans_001.png deleted file mode 100644 index 43973c0859f14..0000000000000 Binary files a/0.15/_images/plot_mini_batch_kmeans_001.png and /dev/null differ diff --git a/0.15/_images/plot_mini_batch_kmeans_0011.png b/0.15/_images/plot_mini_batch_kmeans_0011.png deleted file mode 100644 index 43973c0859f14..0000000000000 Binary files a/0.15/_images/plot_mini_batch_kmeans_0011.png and /dev/null differ diff --git a/0.15/_images/plot_model_complexity_influence.png b/0.15/_images/plot_model_complexity_influence.png deleted file mode 100644 index 8c2150417446c..0000000000000 Binary files a/0.15/_images/plot_model_complexity_influence.png and /dev/null differ diff --git a/0.15/_images/plot_model_complexity_influence1.png b/0.15/_images/plot_model_complexity_influence1.png deleted file mode 100644 index 8c2150417446c..0000000000000 Binary files a/0.15/_images/plot_model_complexity_influence1.png and /dev/null differ diff --git a/0.15/_images/plot_model_complexity_influence_001.png b/0.15/_images/plot_model_complexity_influence_001.png deleted file mode 100644 index 88bfc197d83df..0000000000000 Binary files a/0.15/_images/plot_model_complexity_influence_001.png and /dev/null differ diff --git a/0.15/_images/plot_model_complexity_influence_0011.png b/0.15/_images/plot_model_complexity_influence_0011.png deleted file mode 100644 index 88bfc197d83df..0000000000000 Binary files a/0.15/_images/plot_model_complexity_influence_0011.png and /dev/null differ diff --git a/0.15/_images/plot_model_complexity_influence_002.png b/0.15/_images/plot_model_complexity_influence_002.png deleted file mode 100644 index ddd5b75ab44f1..0000000000000 Binary files a/0.15/_images/plot_model_complexity_influence_002.png and /dev/null differ diff --git a/0.15/_images/plot_model_complexity_influence_0021.png b/0.15/_images/plot_model_complexity_influence_0021.png deleted file mode 100644 index ddd5b75ab44f1..0000000000000 Binary files a/0.15/_images/plot_model_complexity_influence_0021.png and /dev/null differ diff --git a/0.15/_images/plot_model_complexity_influence_003.png b/0.15/_images/plot_model_complexity_influence_003.png deleted file mode 100644 index c23b95b206521..0000000000000 Binary files a/0.15/_images/plot_model_complexity_influence_003.png and /dev/null differ diff --git a/0.15/_images/plot_model_complexity_influence_0031.png b/0.15/_images/plot_model_complexity_influence_0031.png deleted file mode 100644 index c23b95b206521..0000000000000 Binary files a/0.15/_images/plot_model_complexity_influence_0031.png and /dev/null differ diff --git a/0.15/_images/plot_multi_task_lasso_support.png b/0.15/_images/plot_multi_task_lasso_support.png deleted file mode 100644 index a1716d6b24718..0000000000000 Binary files a/0.15/_images/plot_multi_task_lasso_support.png and /dev/null differ diff --git a/0.15/_images/plot_multi_task_lasso_support1.png b/0.15/_images/plot_multi_task_lasso_support1.png deleted file mode 100644 index a1716d6b24718..0000000000000 Binary files a/0.15/_images/plot_multi_task_lasso_support1.png and /dev/null differ diff --git a/0.15/_images/plot_multi_task_lasso_support_001.png b/0.15/_images/plot_multi_task_lasso_support_001.png deleted file mode 100644 index f071e0a17cebc..0000000000000 Binary files a/0.15/_images/plot_multi_task_lasso_support_001.png and /dev/null differ diff --git a/0.15/_images/plot_multi_task_lasso_support_0011.png b/0.15/_images/plot_multi_task_lasso_support_0011.png deleted file mode 100644 index f071e0a17cebc..0000000000000 Binary files a/0.15/_images/plot_multi_task_lasso_support_0011.png and /dev/null differ diff --git a/0.15/_images/plot_multi_task_lasso_support_002.png b/0.15/_images/plot_multi_task_lasso_support_002.png deleted file mode 100644 index 2086c659edb5d..0000000000000 Binary files a/0.15/_images/plot_multi_task_lasso_support_002.png and /dev/null differ diff --git a/0.15/_images/plot_multi_task_lasso_support_0021.png b/0.15/_images/plot_multi_task_lasso_support_0021.png deleted file mode 100644 index 2086c659edb5d..0000000000000 Binary files a/0.15/_images/plot_multi_task_lasso_support_0021.png and /dev/null differ diff --git a/0.15/_images/plot_multilabel.png b/0.15/_images/plot_multilabel.png deleted file mode 100644 index 10a4d2cb17abd..0000000000000 Binary files a/0.15/_images/plot_multilabel.png and /dev/null differ diff --git a/0.15/_images/plot_multilabel1.png b/0.15/_images/plot_multilabel1.png deleted file mode 100644 index 10a4d2cb17abd..0000000000000 Binary files a/0.15/_images/plot_multilabel1.png and /dev/null differ diff --git a/0.15/_images/plot_multilabel_001.png b/0.15/_images/plot_multilabel_001.png deleted file mode 100644 index 708f937115428..0000000000000 Binary files a/0.15/_images/plot_multilabel_001.png and /dev/null differ diff --git a/0.15/_images/plot_multilabel_0011.png b/0.15/_images/plot_multilabel_0011.png deleted file mode 100644 index 708f937115428..0000000000000 Binary files a/0.15/_images/plot_multilabel_0011.png and /dev/null differ diff --git a/0.15/_images/plot_multioutput_face_completion.png b/0.15/_images/plot_multioutput_face_completion.png deleted file mode 100644 index 4cb4070105e9d..0000000000000 Binary files a/0.15/_images/plot_multioutput_face_completion.png and /dev/null differ diff --git a/0.15/_images/plot_multioutput_face_completion1.png b/0.15/_images/plot_multioutput_face_completion1.png deleted file mode 100644 index 4cb4070105e9d..0000000000000 Binary files a/0.15/_images/plot_multioutput_face_completion1.png and /dev/null differ diff --git a/0.15/_images/plot_multioutput_face_completion_001.png b/0.15/_images/plot_multioutput_face_completion_001.png deleted file mode 100644 index e3ee43d9a907c..0000000000000 Binary files a/0.15/_images/plot_multioutput_face_completion_001.png and /dev/null differ diff --git a/0.15/_images/plot_multioutput_face_completion_0011.png b/0.15/_images/plot_multioutput_face_completion_0011.png deleted file mode 100644 index e3ee43d9a907c..0000000000000 Binary files a/0.15/_images/plot_multioutput_face_completion_0011.png and /dev/null differ diff --git a/0.15/_images/plot_nearest_centroid.png b/0.15/_images/plot_nearest_centroid.png deleted file mode 100644 index 7aa338be81692..0000000000000 Binary files a/0.15/_images/plot_nearest_centroid.png and /dev/null differ diff --git a/0.15/_images/plot_nearest_centroid1.png b/0.15/_images/plot_nearest_centroid1.png deleted file mode 100644 index 7aa338be81692..0000000000000 Binary files a/0.15/_images/plot_nearest_centroid1.png and /dev/null differ diff --git a/0.15/_images/plot_nearest_centroid_001.png b/0.15/_images/plot_nearest_centroid_001.png deleted file mode 100644 index 53c8e556b2b0b..0000000000000 Binary files a/0.15/_images/plot_nearest_centroid_001.png and /dev/null differ diff --git a/0.15/_images/plot_nearest_centroid_0011.png b/0.15/_images/plot_nearest_centroid_0011.png deleted file mode 100644 index 53c8e556b2b0b..0000000000000 Binary files a/0.15/_images/plot_nearest_centroid_0011.png and /dev/null differ diff --git a/0.15/_images/plot_nearest_centroid_002.png b/0.15/_images/plot_nearest_centroid_002.png deleted file mode 100644 index 72fd962d9c432..0000000000000 Binary files a/0.15/_images/plot_nearest_centroid_002.png and /dev/null differ diff --git a/0.15/_images/plot_nearest_centroid_0021.png b/0.15/_images/plot_nearest_centroid_0021.png deleted file mode 100644 index 72fd962d9c432..0000000000000 Binary files a/0.15/_images/plot_nearest_centroid_0021.png and /dev/null differ diff --git a/0.15/_images/plot_ols.png b/0.15/_images/plot_ols.png deleted file mode 100644 index 9a26bdf92daab..0000000000000 Binary files a/0.15/_images/plot_ols.png and /dev/null differ diff --git a/0.15/_images/plot_ols1.png b/0.15/_images/plot_ols1.png deleted file mode 100644 index 9a26bdf92daab..0000000000000 Binary files a/0.15/_images/plot_ols1.png and /dev/null differ diff --git a/0.15/_images/plot_ols_001.png b/0.15/_images/plot_ols_001.png deleted file mode 100644 index ad576c51fe501..0000000000000 Binary files a/0.15/_images/plot_ols_001.png and /dev/null differ diff --git a/0.15/_images/plot_ols_0011.png b/0.15/_images/plot_ols_0011.png deleted file mode 100644 index ad576c51fe501..0000000000000 Binary files a/0.15/_images/plot_ols_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ols_0012.png b/0.15/_images/plot_ols_0012.png deleted file mode 100644 index ad576c51fe501..0000000000000 Binary files a/0.15/_images/plot_ols_0012.png and /dev/null differ diff --git a/0.15/_images/plot_ols_3d.png b/0.15/_images/plot_ols_3d.png deleted file mode 100644 index 4a814f4322ead..0000000000000 Binary files a/0.15/_images/plot_ols_3d.png and /dev/null differ diff --git a/0.15/_images/plot_ols_3d1.png b/0.15/_images/plot_ols_3d1.png deleted file mode 100644 index 4a814f4322ead..0000000000000 Binary files a/0.15/_images/plot_ols_3d1.png and /dev/null differ diff --git a/0.15/_images/plot_ols_3d_001.png b/0.15/_images/plot_ols_3d_001.png deleted file mode 100644 index 099cfa2361aaf..0000000000000 Binary files a/0.15/_images/plot_ols_3d_001.png and /dev/null differ diff --git a/0.15/_images/plot_ols_3d_0011.png b/0.15/_images/plot_ols_3d_0011.png deleted file mode 100644 index 099cfa2361aaf..0000000000000 Binary files a/0.15/_images/plot_ols_3d_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ols_3d_002.png b/0.15/_images/plot_ols_3d_002.png deleted file mode 100644 index ac6b6f3575ce1..0000000000000 Binary files a/0.15/_images/plot_ols_3d_002.png and /dev/null differ diff --git a/0.15/_images/plot_ols_3d_0021.png b/0.15/_images/plot_ols_3d_0021.png deleted file mode 100644 index ac6b6f3575ce1..0000000000000 Binary files a/0.15/_images/plot_ols_3d_0021.png and /dev/null differ diff --git a/0.15/_images/plot_ols_3d_003.png b/0.15/_images/plot_ols_3d_003.png deleted file mode 100644 index c7e613e42f7be..0000000000000 Binary files a/0.15/_images/plot_ols_3d_003.png and /dev/null differ diff --git a/0.15/_images/plot_ols_3d_0031.png b/0.15/_images/plot_ols_3d_0031.png deleted file mode 100644 index c7e613e42f7be..0000000000000 Binary files a/0.15/_images/plot_ols_3d_0031.png and /dev/null differ diff --git a/0.15/_images/plot_ols_ridge_variance.png b/0.15/_images/plot_ols_ridge_variance.png deleted file mode 100644 index c403949ec20b5..0000000000000 Binary files a/0.15/_images/plot_ols_ridge_variance.png and /dev/null differ diff --git a/0.15/_images/plot_ols_ridge_variance1.png b/0.15/_images/plot_ols_ridge_variance1.png deleted file mode 100644 index c403949ec20b5..0000000000000 Binary files a/0.15/_images/plot_ols_ridge_variance1.png and /dev/null differ diff --git a/0.15/_images/plot_ols_ridge_variance_001.png b/0.15/_images/plot_ols_ridge_variance_001.png deleted file mode 100644 index 45dc3401f443b..0000000000000 Binary files a/0.15/_images/plot_ols_ridge_variance_001.png and /dev/null differ diff --git a/0.15/_images/plot_ols_ridge_variance_0011.png b/0.15/_images/plot_ols_ridge_variance_0011.png deleted file mode 100644 index 45dc3401f443b..0000000000000 Binary files a/0.15/_images/plot_ols_ridge_variance_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ols_ridge_variance_002.png b/0.15/_images/plot_ols_ridge_variance_002.png deleted file mode 100644 index bc8acc6b53adb..0000000000000 Binary files a/0.15/_images/plot_ols_ridge_variance_002.png and /dev/null differ diff --git a/0.15/_images/plot_ols_ridge_variance_0021.png b/0.15/_images/plot_ols_ridge_variance_0021.png deleted file mode 100644 index bc8acc6b53adb..0000000000000 Binary files a/0.15/_images/plot_ols_ridge_variance_0021.png and /dev/null differ diff --git a/0.15/_images/plot_omp.png b/0.15/_images/plot_omp.png deleted file mode 100644 index bd80f68bed26a..0000000000000 Binary files a/0.15/_images/plot_omp.png and /dev/null differ diff --git a/0.15/_images/plot_omp1.png b/0.15/_images/plot_omp1.png deleted file mode 100644 index bd80f68bed26a..0000000000000 Binary files a/0.15/_images/plot_omp1.png and /dev/null differ diff --git a/0.15/_images/plot_omp2.png b/0.15/_images/plot_omp2.png deleted file mode 100644 index bd80f68bed26a..0000000000000 Binary files a/0.15/_images/plot_omp2.png and /dev/null differ diff --git a/0.15/_images/plot_omp_001.png b/0.15/_images/plot_omp_001.png deleted file mode 100644 index 4fe3240c4f4db..0000000000000 Binary files a/0.15/_images/plot_omp_001.png and /dev/null differ diff --git a/0.15/_images/plot_oneclass.png b/0.15/_images/plot_oneclass.png deleted file mode 100644 index f63917b7084d8..0000000000000 Binary files a/0.15/_images/plot_oneclass.png and /dev/null differ diff --git a/0.15/_images/plot_oneclass1.png b/0.15/_images/plot_oneclass1.png deleted file mode 100644 index f63917b7084d8..0000000000000 Binary files a/0.15/_images/plot_oneclass1.png and /dev/null differ diff --git a/0.15/_images/plot_oneclass_001.png b/0.15/_images/plot_oneclass_001.png deleted file mode 100644 index da1314c18b0e5..0000000000000 Binary files a/0.15/_images/plot_oneclass_001.png and /dev/null differ diff --git a/0.15/_images/plot_oneclass_0011.png b/0.15/_images/plot_oneclass_0011.png deleted file mode 100644 index da1314c18b0e5..0000000000000 Binary files a/0.15/_images/plot_oneclass_0011.png and /dev/null differ diff --git a/0.15/_images/plot_out_of_core_classification.png b/0.15/_images/plot_out_of_core_classification.png deleted file mode 100644 index 9af19693a1877..0000000000000 Binary files a/0.15/_images/plot_out_of_core_classification.png and /dev/null differ diff --git a/0.15/_images/plot_out_of_core_classification1.png b/0.15/_images/plot_out_of_core_classification1.png deleted file mode 100644 index 9af19693a1877..0000000000000 Binary files a/0.15/_images/plot_out_of_core_classification1.png and /dev/null differ diff --git a/0.15/_images/plot_out_of_core_classification_001.png b/0.15/_images/plot_out_of_core_classification_001.png deleted file mode 100644 index 67fdd1b3e1c69..0000000000000 Binary files a/0.15/_images/plot_out_of_core_classification_001.png and /dev/null differ diff --git a/0.15/_images/plot_out_of_core_classification_0011.png b/0.15/_images/plot_out_of_core_classification_0011.png deleted file mode 100644 index 67fdd1b3e1c69..0000000000000 Binary files a/0.15/_images/plot_out_of_core_classification_0011.png and /dev/null differ diff --git a/0.15/_images/plot_out_of_core_classification_002.png b/0.15/_images/plot_out_of_core_classification_002.png deleted file mode 100644 index 17d248a4641df..0000000000000 Binary files a/0.15/_images/plot_out_of_core_classification_002.png and /dev/null differ diff --git a/0.15/_images/plot_out_of_core_classification_003.png b/0.15/_images/plot_out_of_core_classification_003.png deleted file mode 100644 index 8ba8f533d4651..0000000000000 Binary files a/0.15/_images/plot_out_of_core_classification_003.png and /dev/null differ diff --git a/0.15/_images/plot_out_of_core_classification_0031.png b/0.15/_images/plot_out_of_core_classification_0031.png deleted file mode 100644 index 8ba8f533d4651..0000000000000 Binary files a/0.15/_images/plot_out_of_core_classification_0031.png and /dev/null differ diff --git a/0.15/_images/plot_out_of_core_classification_004.png b/0.15/_images/plot_out_of_core_classification_004.png deleted file mode 100644 index f119a709a8011..0000000000000 Binary files a/0.15/_images/plot_out_of_core_classification_004.png and /dev/null differ diff --git a/0.15/_images/plot_out_of_core_classification_0041.png b/0.15/_images/plot_out_of_core_classification_0041.png deleted file mode 100644 index f119a709a8011..0000000000000 Binary files a/0.15/_images/plot_out_of_core_classification_0041.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection.png b/0.15/_images/plot_outlier_detection.png deleted file mode 100644 index c281fd0921ad0..0000000000000 Binary files a/0.15/_images/plot_outlier_detection.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection1.png b/0.15/_images/plot_outlier_detection1.png deleted file mode 100644 index c281fd0921ad0..0000000000000 Binary files a/0.15/_images/plot_outlier_detection1.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_001.png b/0.15/_images/plot_outlier_detection_001.png deleted file mode 100644 index cc04594b88c60..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_001.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_0011.png b/0.15/_images/plot_outlier_detection_0011.png deleted file mode 100644 index cc04594b88c60..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_0011.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_002.png b/0.15/_images/plot_outlier_detection_002.png deleted file mode 100644 index 74e5df078eb3f..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_002.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_0021.png b/0.15/_images/plot_outlier_detection_0021.png deleted file mode 100644 index 74e5df078eb3f..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_0021.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_003.png b/0.15/_images/plot_outlier_detection_003.png deleted file mode 100644 index 68d3390de19d3..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_003.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_0031.png b/0.15/_images/plot_outlier_detection_0031.png deleted file mode 100644 index 68d3390de19d3..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_0031.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_carousel.png b/0.15/_images/plot_outlier_detection_carousel.png deleted file mode 100644 index e600a6ddd55f9..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_carousel.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_housing.png b/0.15/_images/plot_outlier_detection_housing.png deleted file mode 100644 index 02a369b81b154..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_housing.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_housing1.png b/0.15/_images/plot_outlier_detection_housing1.png deleted file mode 100644 index 02a369b81b154..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_housing1.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_housing_001.png b/0.15/_images/plot_outlier_detection_housing_001.png deleted file mode 100644 index e30a61f2c9337..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_housing_001.png and /dev/null differ diff --git a/0.15/_images/plot_outlier_detection_housing_002.png b/0.15/_images/plot_outlier_detection_housing_002.png deleted file mode 100644 index e579faa2d05a8..0000000000000 Binary files a/0.15/_images/plot_outlier_detection_housing_002.png and /dev/null differ diff --git a/0.15/_images/plot_partial_dependence.png b/0.15/_images/plot_partial_dependence.png deleted file mode 100644 index 0f6e7696fffba..0000000000000 Binary files a/0.15/_images/plot_partial_dependence.png and /dev/null differ diff --git a/0.15/_images/plot_partial_dependence1.png b/0.15/_images/plot_partial_dependence1.png deleted file mode 100644 index 0f6e7696fffba..0000000000000 Binary files a/0.15/_images/plot_partial_dependence1.png and /dev/null differ diff --git a/0.15/_images/plot_partial_dependence_001.png b/0.15/_images/plot_partial_dependence_001.png deleted file mode 100644 index 97671cde36297..0000000000000 Binary files a/0.15/_images/plot_partial_dependence_001.png and /dev/null differ diff --git a/0.15/_images/plot_partial_dependence_0011.png b/0.15/_images/plot_partial_dependence_0011.png deleted file mode 100644 index 97671cde36297..0000000000000 Binary files a/0.15/_images/plot_partial_dependence_0011.png and /dev/null differ diff --git a/0.15/_images/plot_partial_dependence_002.png b/0.15/_images/plot_partial_dependence_002.png deleted file mode 100644 index 7d62f87df0a50..0000000000000 Binary files a/0.15/_images/plot_partial_dependence_002.png and /dev/null differ diff --git a/0.15/_images/plot_pca_3d.png b/0.15/_images/plot_pca_3d.png deleted file mode 100644 index 2e1409fded632..0000000000000 Binary files a/0.15/_images/plot_pca_3d.png and /dev/null differ diff --git a/0.15/_images/plot_pca_3d1.png b/0.15/_images/plot_pca_3d1.png deleted file mode 100644 index 2e1409fded632..0000000000000 Binary files a/0.15/_images/plot_pca_3d1.png and /dev/null differ diff --git a/0.15/_images/plot_pca_3d_001.png b/0.15/_images/plot_pca_3d_001.png deleted file mode 100644 index ad3e3415aeefc..0000000000000 Binary files a/0.15/_images/plot_pca_3d_001.png and /dev/null differ diff --git a/0.15/_images/plot_pca_3d_0011.png b/0.15/_images/plot_pca_3d_0011.png deleted file mode 100644 index ad3e3415aeefc..0000000000000 Binary files a/0.15/_images/plot_pca_3d_0011.png and /dev/null differ diff --git a/0.15/_images/plot_pca_3d_002.png b/0.15/_images/plot_pca_3d_002.png deleted file mode 100644 index 892e71bef0256..0000000000000 Binary files a/0.15/_images/plot_pca_3d_002.png and /dev/null differ diff --git a/0.15/_images/plot_pca_3d_0021.png b/0.15/_images/plot_pca_3d_0021.png deleted file mode 100644 index 892e71bef0256..0000000000000 Binary files a/0.15/_images/plot_pca_3d_0021.png and /dev/null differ diff --git a/0.15/_images/plot_pca_iris.png b/0.15/_images/plot_pca_iris.png deleted file mode 100644 index 3a2debac4312b..0000000000000 Binary files a/0.15/_images/plot_pca_iris.png and /dev/null differ diff --git a/0.15/_images/plot_pca_iris1.png b/0.15/_images/plot_pca_iris1.png deleted file mode 100644 index 3a2debac4312b..0000000000000 Binary files a/0.15/_images/plot_pca_iris1.png and /dev/null differ diff --git a/0.15/_images/plot_pca_iris_001.png b/0.15/_images/plot_pca_iris_001.png deleted file mode 100644 index dd0a560732d44..0000000000000 Binary files a/0.15/_images/plot_pca_iris_001.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_fa_model_selection.png b/0.15/_images/plot_pca_vs_fa_model_selection.png deleted file mode 100644 index 048fe6a6911d4..0000000000000 Binary files a/0.15/_images/plot_pca_vs_fa_model_selection.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_fa_model_selection1.png b/0.15/_images/plot_pca_vs_fa_model_selection1.png deleted file mode 100644 index 048fe6a6911d4..0000000000000 Binary files a/0.15/_images/plot_pca_vs_fa_model_selection1.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_fa_model_selection_001.png b/0.15/_images/plot_pca_vs_fa_model_selection_001.png deleted file mode 100644 index 9020d12a8cf76..0000000000000 Binary files a/0.15/_images/plot_pca_vs_fa_model_selection_001.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_fa_model_selection_0011.png b/0.15/_images/plot_pca_vs_fa_model_selection_0011.png deleted file mode 100644 index 9020d12a8cf76..0000000000000 Binary files a/0.15/_images/plot_pca_vs_fa_model_selection_0011.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_fa_model_selection_002.png b/0.15/_images/plot_pca_vs_fa_model_selection_002.png deleted file mode 100644 index 3ccf87fcf4289..0000000000000 Binary files a/0.15/_images/plot_pca_vs_fa_model_selection_002.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_fa_model_selection_0021.png b/0.15/_images/plot_pca_vs_fa_model_selection_0021.png deleted file mode 100644 index 3ccf87fcf4289..0000000000000 Binary files a/0.15/_images/plot_pca_vs_fa_model_selection_0021.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_lda.png b/0.15/_images/plot_pca_vs_lda.png deleted file mode 100644 index 3e9ff889ceb13..0000000000000 Binary files a/0.15/_images/plot_pca_vs_lda.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_lda1.png b/0.15/_images/plot_pca_vs_lda1.png deleted file mode 100644 index 3e9ff889ceb13..0000000000000 Binary files a/0.15/_images/plot_pca_vs_lda1.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_lda_001.png b/0.15/_images/plot_pca_vs_lda_001.png deleted file mode 100644 index a7e2a882af2ef..0000000000000 Binary files a/0.15/_images/plot_pca_vs_lda_001.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_lda_0011.png b/0.15/_images/plot_pca_vs_lda_0011.png deleted file mode 100644 index a7e2a882af2ef..0000000000000 Binary files a/0.15/_images/plot_pca_vs_lda_0011.png and /dev/null differ diff --git a/0.15/_images/plot_pca_vs_lda_002.png b/0.15/_images/plot_pca_vs_lda_002.png deleted file mode 100644 index 45095fe550234..0000000000000 Binary files a/0.15/_images/plot_pca_vs_lda_002.png and /dev/null differ diff --git a/0.15/_images/plot_permutation_test_for_classification.png b/0.15/_images/plot_permutation_test_for_classification.png deleted file mode 100644 index ab60441621330..0000000000000 Binary files a/0.15/_images/plot_permutation_test_for_classification.png and /dev/null differ diff --git a/0.15/_images/plot_permutation_test_for_classification1.png b/0.15/_images/plot_permutation_test_for_classification1.png deleted file mode 100644 index cd2aeb81cfc2c..0000000000000 Binary files a/0.15/_images/plot_permutation_test_for_classification1.png and /dev/null differ diff --git a/0.15/_images/plot_permutation_test_for_classification_001.png b/0.15/_images/plot_permutation_test_for_classification_001.png deleted file mode 100644 index 4760df19cc58d..0000000000000 Binary files a/0.15/_images/plot_permutation_test_for_classification_001.png and /dev/null differ diff --git a/0.15/_images/plot_permutation_test_for_classification_0011.png b/0.15/_images/plot_permutation_test_for_classification_0011.png deleted file mode 100644 index c997e62c5dc91..0000000000000 Binary files a/0.15/_images/plot_permutation_test_for_classification_0011.png and /dev/null differ diff --git a/0.15/_images/plot_polynomial_interpolation.png b/0.15/_images/plot_polynomial_interpolation.png deleted file mode 100644 index d14f6113c4a58..0000000000000 Binary files a/0.15/_images/plot_polynomial_interpolation.png and /dev/null differ diff --git a/0.15/_images/plot_polynomial_interpolation1.png b/0.15/_images/plot_polynomial_interpolation1.png deleted file mode 100644 index d14f6113c4a58..0000000000000 Binary files a/0.15/_images/plot_polynomial_interpolation1.png and /dev/null differ diff --git a/0.15/_images/plot_polynomial_interpolation_001.png b/0.15/_images/plot_polynomial_interpolation_001.png deleted file mode 100644 index e3c47c6a39b8f..0000000000000 Binary files a/0.15/_images/plot_polynomial_interpolation_001.png and /dev/null differ diff --git a/0.15/_images/plot_polynomial_interpolation_0011.png b/0.15/_images/plot_polynomial_interpolation_0011.png deleted file mode 100644 index e3c47c6a39b8f..0000000000000 Binary files a/0.15/_images/plot_polynomial_interpolation_0011.png and /dev/null differ diff --git a/0.15/_images/plot_precision_recall.png b/0.15/_images/plot_precision_recall.png deleted file mode 100644 index 951ea848bf032..0000000000000 Binary files a/0.15/_images/plot_precision_recall.png and /dev/null differ diff --git a/0.15/_images/plot_precision_recall1.png b/0.15/_images/plot_precision_recall1.png deleted file mode 100644 index ee1c8faa1142b..0000000000000 Binary files a/0.15/_images/plot_precision_recall1.png and /dev/null differ diff --git a/0.15/_images/plot_precision_recall_001.png b/0.15/_images/plot_precision_recall_001.png deleted file mode 100644 index f3318dc2815ef..0000000000000 Binary files a/0.15/_images/plot_precision_recall_001.png and /dev/null differ diff --git a/0.15/_images/plot_precision_recall_0011.png b/0.15/_images/plot_precision_recall_0011.png deleted file mode 100644 index 552afae5647b7..0000000000000 Binary files a/0.15/_images/plot_precision_recall_0011.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency.png b/0.15/_images/plot_prediction_latency.png deleted file mode 100644 index fdd1fe9703ae5..0000000000000 Binary files a/0.15/_images/plot_prediction_latency.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency1.png b/0.15/_images/plot_prediction_latency1.png deleted file mode 100644 index fdd1fe9703ae5..0000000000000 Binary files a/0.15/_images/plot_prediction_latency1.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency_001.png b/0.15/_images/plot_prediction_latency_001.png deleted file mode 100644 index 36239030327f1..0000000000000 Binary files a/0.15/_images/plot_prediction_latency_001.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency_0011.png b/0.15/_images/plot_prediction_latency_0011.png deleted file mode 100644 index 36239030327f1..0000000000000 Binary files a/0.15/_images/plot_prediction_latency_0011.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency_002.png b/0.15/_images/plot_prediction_latency_002.png deleted file mode 100644 index 63c1b423394c8..0000000000000 Binary files a/0.15/_images/plot_prediction_latency_002.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency_0021.png b/0.15/_images/plot_prediction_latency_0021.png deleted file mode 100644 index 63c1b423394c8..0000000000000 Binary files a/0.15/_images/plot_prediction_latency_0021.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency_003.png b/0.15/_images/plot_prediction_latency_003.png deleted file mode 100644 index 23aee23012859..0000000000000 Binary files a/0.15/_images/plot_prediction_latency_003.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency_0031.png b/0.15/_images/plot_prediction_latency_0031.png deleted file mode 100644 index 23aee23012859..0000000000000 Binary files a/0.15/_images/plot_prediction_latency_0031.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency_004.png b/0.15/_images/plot_prediction_latency_004.png deleted file mode 100644 index b3ad1f46102e0..0000000000000 Binary files a/0.15/_images/plot_prediction_latency_004.png and /dev/null differ diff --git a/0.15/_images/plot_prediction_latency_0041.png b/0.15/_images/plot_prediction_latency_0041.png deleted file mode 100644 index b3ad1f46102e0..0000000000000 Binary files a/0.15/_images/plot_prediction_latency_0041.png and /dev/null differ diff --git a/0.15/_images/plot_random_dataset.png b/0.15/_images/plot_random_dataset.png deleted file mode 100644 index e57537b1d544c..0000000000000 Binary files a/0.15/_images/plot_random_dataset.png and /dev/null differ diff --git a/0.15/_images/plot_random_dataset1.png b/0.15/_images/plot_random_dataset1.png deleted file mode 100644 index e57537b1d544c..0000000000000 Binary files a/0.15/_images/plot_random_dataset1.png and /dev/null differ diff --git a/0.15/_images/plot_random_dataset_001.png b/0.15/_images/plot_random_dataset_001.png deleted file mode 100644 index c7a5953dac378..0000000000000 Binary files a/0.15/_images/plot_random_dataset_001.png and /dev/null differ diff --git a/0.15/_images/plot_random_dataset_0011.png b/0.15/_images/plot_random_dataset_0011.png deleted file mode 100644 index c7a5953dac378..0000000000000 Binary files a/0.15/_images/plot_random_dataset_0011.png and /dev/null differ diff --git a/0.15/_images/plot_random_forest_embedding.png b/0.15/_images/plot_random_forest_embedding.png deleted file mode 100644 index 5830c0d3da2fa..0000000000000 Binary files a/0.15/_images/plot_random_forest_embedding.png and /dev/null differ diff --git a/0.15/_images/plot_random_forest_embedding1.png b/0.15/_images/plot_random_forest_embedding1.png deleted file mode 100644 index 5830c0d3da2fa..0000000000000 Binary files a/0.15/_images/plot_random_forest_embedding1.png and /dev/null differ diff --git a/0.15/_images/plot_random_forest_embedding_001.png b/0.15/_images/plot_random_forest_embedding_001.png deleted file mode 100644 index f68f0bae70cdd..0000000000000 Binary files a/0.15/_images/plot_random_forest_embedding_001.png and /dev/null differ diff --git a/0.15/_images/plot_random_multilabel_dataset.png b/0.15/_images/plot_random_multilabel_dataset.png deleted file mode 100644 index ce9c5ca8a57c6..0000000000000 Binary files a/0.15/_images/plot_random_multilabel_dataset.png and /dev/null differ diff --git a/0.15/_images/plot_random_multilabel_dataset1.png b/0.15/_images/plot_random_multilabel_dataset1.png deleted file mode 100644 index ce9c5ca8a57c6..0000000000000 Binary files a/0.15/_images/plot_random_multilabel_dataset1.png and /dev/null differ diff --git a/0.15/_images/plot_random_multilabel_dataset_001.png b/0.15/_images/plot_random_multilabel_dataset_001.png deleted file mode 100644 index 48e06225735ab..0000000000000 Binary files a/0.15/_images/plot_random_multilabel_dataset_001.png and /dev/null differ diff --git a/0.15/_images/plot_random_multilabel_dataset_0011.png b/0.15/_images/plot_random_multilabel_dataset_0011.png deleted file mode 100644 index 48e06225735ab..0000000000000 Binary files a/0.15/_images/plot_random_multilabel_dataset_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ransac.png b/0.15/_images/plot_ransac.png deleted file mode 100644 index 961a8500c856f..0000000000000 Binary files a/0.15/_images/plot_ransac.png and /dev/null differ diff --git a/0.15/_images/plot_ransac1.png b/0.15/_images/plot_ransac1.png deleted file mode 100644 index 961a8500c856f..0000000000000 Binary files a/0.15/_images/plot_ransac1.png and /dev/null differ diff --git a/0.15/_images/plot_ransac_001.png b/0.15/_images/plot_ransac_001.png deleted file mode 100644 index d370435ed48e4..0000000000000 Binary files a/0.15/_images/plot_ransac_001.png and /dev/null differ diff --git a/0.15/_images/plot_ransac_0011.png b/0.15/_images/plot_ransac_0011.png deleted file mode 100644 index d370435ed48e4..0000000000000 Binary files a/0.15/_images/plot_ransac_0011.png and /dev/null differ diff --git a/0.15/_images/plot_rbf_parameters.png b/0.15/_images/plot_rbf_parameters.png deleted file mode 100644 index eb1cb1533c7d0..0000000000000 Binary files a/0.15/_images/plot_rbf_parameters.png and /dev/null differ diff --git a/0.15/_images/plot_rbf_parameters1.png b/0.15/_images/plot_rbf_parameters1.png deleted file mode 100644 index eb1cb1533c7d0..0000000000000 Binary files a/0.15/_images/plot_rbf_parameters1.png and /dev/null differ diff --git a/0.15/_images/plot_rbf_parameters_001.png b/0.15/_images/plot_rbf_parameters_001.png deleted file mode 100644 index 9cd2291f607ef..0000000000000 Binary files a/0.15/_images/plot_rbf_parameters_001.png and /dev/null differ diff --git a/0.15/_images/plot_rbf_parameters_002.png b/0.15/_images/plot_rbf_parameters_002.png deleted file mode 100644 index 0b78d5abd89ff..0000000000000 Binary files a/0.15/_images/plot_rbf_parameters_002.png and /dev/null differ diff --git a/0.15/_images/plot_rbm_logistic_classification.png b/0.15/_images/plot_rbm_logistic_classification.png deleted file mode 100644 index ab4421132f291..0000000000000 Binary files a/0.15/_images/plot_rbm_logistic_classification.png and /dev/null differ diff --git a/0.15/_images/plot_rbm_logistic_classification1.png b/0.15/_images/plot_rbm_logistic_classification1.png deleted file mode 100644 index ab4421132f291..0000000000000 Binary files a/0.15/_images/plot_rbm_logistic_classification1.png and /dev/null differ diff --git a/0.15/_images/plot_rbm_logistic_classification_001.png b/0.15/_images/plot_rbm_logistic_classification_001.png deleted file mode 100644 index bedc30cfb6259..0000000000000 Binary files a/0.15/_images/plot_rbm_logistic_classification_001.png and /dev/null differ diff --git a/0.15/_images/plot_rbm_logistic_classification_0011.png b/0.15/_images/plot_rbm_logistic_classification_0011.png deleted file mode 100644 index bedc30cfb6259..0000000000000 Binary files a/0.15/_images/plot_rbm_logistic_classification_0011.png and /dev/null differ diff --git a/0.15/_images/plot_rbm_logistic_classification_0012.png b/0.15/_images/plot_rbm_logistic_classification_0012.png deleted file mode 100644 index bedc30cfb6259..0000000000000 Binary files a/0.15/_images/plot_rbm_logistic_classification_0012.png and /dev/null differ diff --git a/0.15/_images/plot_regression.png b/0.15/_images/plot_regression.png deleted file mode 100644 index 04070cbfe86f3..0000000000000 Binary files a/0.15/_images/plot_regression.png and /dev/null differ diff --git a/0.15/_images/plot_regression1.png b/0.15/_images/plot_regression1.png deleted file mode 100644 index 04070cbfe86f3..0000000000000 Binary files a/0.15/_images/plot_regression1.png and /dev/null differ diff --git a/0.15/_images/plot_regression_001.png b/0.15/_images/plot_regression_001.png deleted file mode 100644 index ead5528b5b905..0000000000000 Binary files a/0.15/_images/plot_regression_001.png and /dev/null differ diff --git a/0.15/_images/plot_regression_0011.png b/0.15/_images/plot_regression_0011.png deleted file mode 100644 index ead5528b5b905..0000000000000 Binary files a/0.15/_images/plot_regression_0011.png and /dev/null differ diff --git a/0.15/_images/plot_rfe_digits.png b/0.15/_images/plot_rfe_digits.png deleted file mode 100644 index 7db77aaee5978..0000000000000 Binary files a/0.15/_images/plot_rfe_digits.png and /dev/null differ diff --git a/0.15/_images/plot_rfe_digits1.png b/0.15/_images/plot_rfe_digits1.png deleted file mode 100644 index 7db77aaee5978..0000000000000 Binary files a/0.15/_images/plot_rfe_digits1.png and /dev/null differ diff --git a/0.15/_images/plot_rfe_digits_001.png b/0.15/_images/plot_rfe_digits_001.png deleted file mode 100644 index cb0fb64acff19..0000000000000 Binary files a/0.15/_images/plot_rfe_digits_001.png and /dev/null differ diff --git a/0.15/_images/plot_rfe_digits_0011.png b/0.15/_images/plot_rfe_digits_0011.png deleted file mode 100644 index cb0fb64acff19..0000000000000 Binary files a/0.15/_images/plot_rfe_digits_0011.png and /dev/null differ diff --git a/0.15/_images/plot_rfe_with_cross_validation.png b/0.15/_images/plot_rfe_with_cross_validation.png deleted file mode 100644 index f8eeb1c337e85..0000000000000 Binary files a/0.15/_images/plot_rfe_with_cross_validation.png and /dev/null differ diff --git a/0.15/_images/plot_rfe_with_cross_validation1.png b/0.15/_images/plot_rfe_with_cross_validation1.png deleted file mode 100644 index f8eeb1c337e85..0000000000000 Binary files a/0.15/_images/plot_rfe_with_cross_validation1.png and /dev/null differ diff --git a/0.15/_images/plot_rfe_with_cross_validation_001.png b/0.15/_images/plot_rfe_with_cross_validation_001.png deleted file mode 100644 index 41cc73a5664ed..0000000000000 Binary files a/0.15/_images/plot_rfe_with_cross_validation_001.png and /dev/null differ diff --git a/0.15/_images/plot_rfe_with_cross_validation_0011.png b/0.15/_images/plot_rfe_with_cross_validation_0011.png deleted file mode 100644 index 41cc73a5664ed..0000000000000 Binary files a/0.15/_images/plot_rfe_with_cross_validation_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ridge_path.png b/0.15/_images/plot_ridge_path.png deleted file mode 100644 index 3788f93ff326d..0000000000000 Binary files a/0.15/_images/plot_ridge_path.png and /dev/null differ diff --git a/0.15/_images/plot_ridge_path1.png b/0.15/_images/plot_ridge_path1.png deleted file mode 100644 index 3788f93ff326d..0000000000000 Binary files a/0.15/_images/plot_ridge_path1.png and /dev/null differ diff --git a/0.15/_images/plot_ridge_path_001.png b/0.15/_images/plot_ridge_path_001.png deleted file mode 100644 index 19dd1e7d1fa60..0000000000000 Binary files a/0.15/_images/plot_ridge_path_001.png and /dev/null differ diff --git a/0.15/_images/plot_ridge_path_0011.png b/0.15/_images/plot_ridge_path_0011.png deleted file mode 100644 index 19dd1e7d1fa60..0000000000000 Binary files a/0.15/_images/plot_ridge_path_0011.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit.png b/0.15/_images/plot_robust_fit.png deleted file mode 100644 index a615fa71da0a4..0000000000000 Binary files a/0.15/_images/plot_robust_fit.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit1.png b/0.15/_images/plot_robust_fit1.png deleted file mode 100644 index a615fa71da0a4..0000000000000 Binary files a/0.15/_images/plot_robust_fit1.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit_001.png b/0.15/_images/plot_robust_fit_001.png deleted file mode 100644 index 5b4682b844d69..0000000000000 Binary files a/0.15/_images/plot_robust_fit_001.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit_002.png b/0.15/_images/plot_robust_fit_002.png deleted file mode 100644 index 7be3ea6fd79b9..0000000000000 Binary files a/0.15/_images/plot_robust_fit_002.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit_0021.png b/0.15/_images/plot_robust_fit_0021.png deleted file mode 100644 index 7be3ea6fd79b9..0000000000000 Binary files a/0.15/_images/plot_robust_fit_0021.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit_003.png b/0.15/_images/plot_robust_fit_003.png deleted file mode 100644 index 64fd70bfff3fd..0000000000000 Binary files a/0.15/_images/plot_robust_fit_003.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit_0031.png b/0.15/_images/plot_robust_fit_0031.png deleted file mode 100644 index 64fd70bfff3fd..0000000000000 Binary files a/0.15/_images/plot_robust_fit_0031.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit_004.png b/0.15/_images/plot_robust_fit_004.png deleted file mode 100644 index e9bb3b7458600..0000000000000 Binary files a/0.15/_images/plot_robust_fit_004.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit_005.png b/0.15/_images/plot_robust_fit_005.png deleted file mode 100644 index 69c414a1448b0..0000000000000 Binary files a/0.15/_images/plot_robust_fit_005.png and /dev/null differ diff --git a/0.15/_images/plot_robust_fit_0051.png b/0.15/_images/plot_robust_fit_0051.png deleted file mode 100644 index 69c414a1448b0..0000000000000 Binary files a/0.15/_images/plot_robust_fit_0051.png and /dev/null differ diff --git a/0.15/_images/plot_robust_scaling.png b/0.15/_images/plot_robust_scaling.png deleted file mode 100644 index d3adc88bd540f..0000000000000 Binary files a/0.15/_images/plot_robust_scaling.png and /dev/null differ diff --git a/0.15/_images/plot_robust_scaling1.png b/0.15/_images/plot_robust_scaling1.png deleted file mode 100644 index d3adc88bd540f..0000000000000 Binary files a/0.15/_images/plot_robust_scaling1.png and /dev/null differ diff --git a/0.15/_images/plot_robust_scaling_001.png b/0.15/_images/plot_robust_scaling_001.png deleted file mode 100644 index 94c87d6c53044..0000000000000 Binary files a/0.15/_images/plot_robust_scaling_001.png and /dev/null differ diff --git a/0.15/_images/plot_robust_vs_empirical_covariance.png b/0.15/_images/plot_robust_vs_empirical_covariance.png deleted file mode 100644 index ff5d9ba684947..0000000000000 Binary files a/0.15/_images/plot_robust_vs_empirical_covariance.png and /dev/null differ diff --git a/0.15/_images/plot_robust_vs_empirical_covariance1.png b/0.15/_images/plot_robust_vs_empirical_covariance1.png deleted file mode 100644 index ff5d9ba684947..0000000000000 Binary files a/0.15/_images/plot_robust_vs_empirical_covariance1.png and /dev/null differ diff --git a/0.15/_images/plot_robust_vs_empirical_covariance_001.png b/0.15/_images/plot_robust_vs_empirical_covariance_001.png deleted file mode 100644 index 022a11ac8f065..0000000000000 Binary files a/0.15/_images/plot_robust_vs_empirical_covariance_001.png and /dev/null differ diff --git a/0.15/_images/plot_robust_vs_empirical_covariance_0011.png b/0.15/_images/plot_robust_vs_empirical_covariance_0011.png deleted file mode 100644 index 022a11ac8f065..0000000000000 Binary files a/0.15/_images/plot_robust_vs_empirical_covariance_0011.png and /dev/null differ diff --git a/0.15/_images/plot_roc.png b/0.15/_images/plot_roc.png deleted file mode 100644 index 002fb17b55f57..0000000000000 Binary files a/0.15/_images/plot_roc.png and /dev/null differ diff --git a/0.15/_images/plot_roc1.png b/0.15/_images/plot_roc1.png deleted file mode 100644 index d20e1ca3e530c..0000000000000 Binary files a/0.15/_images/plot_roc1.png and /dev/null differ diff --git a/0.15/_images/plot_roc_001.png b/0.15/_images/plot_roc_001.png deleted file mode 100644 index 6fd621f3e5d6c..0000000000000 Binary files a/0.15/_images/plot_roc_001.png and /dev/null differ diff --git a/0.15/_images/plot_roc_0011.png b/0.15/_images/plot_roc_0011.png deleted file mode 100644 index 239e2a0370156..0000000000000 Binary files a/0.15/_images/plot_roc_0011.png and /dev/null differ diff --git a/0.15/_images/plot_roc_0012.png b/0.15/_images/plot_roc_0012.png deleted file mode 100644 index 239e2a0370156..0000000000000 Binary files a/0.15/_images/plot_roc_0012.png and /dev/null differ diff --git a/0.15/_images/plot_roc_002.png b/0.15/_images/plot_roc_002.png deleted file mode 100644 index 079831f8ad331..0000000000000 Binary files a/0.15/_images/plot_roc_002.png and /dev/null differ diff --git a/0.15/_images/plot_roc_0021.png b/0.15/_images/plot_roc_0021.png deleted file mode 100644 index 02f64061c3ddc..0000000000000 Binary files a/0.15/_images/plot_roc_0021.png and /dev/null differ diff --git a/0.15/_images/plot_roc_0022.png b/0.15/_images/plot_roc_0022.png deleted file mode 100644 index 02f64061c3ddc..0000000000000 Binary files a/0.15/_images/plot_roc_0022.png and /dev/null differ diff --git a/0.15/_images/plot_roc_crossval.png b/0.15/_images/plot_roc_crossval.png deleted file mode 100644 index 01b56417d9e03..0000000000000 Binary files a/0.15/_images/plot_roc_crossval.png and /dev/null differ diff --git a/0.15/_images/plot_roc_crossval1.png b/0.15/_images/plot_roc_crossval1.png deleted file mode 100644 index d03569c41411e..0000000000000 Binary files a/0.15/_images/plot_roc_crossval1.png and /dev/null differ diff --git a/0.15/_images/plot_roc_crossval_001.png b/0.15/_images/plot_roc_crossval_001.png deleted file mode 100644 index 4a4adc8d8da32..0000000000000 Binary files a/0.15/_images/plot_roc_crossval_001.png and /dev/null differ diff --git a/0.15/_images/plot_roc_crossval_0011.png b/0.15/_images/plot_roc_crossval_0011.png deleted file mode 100644 index 92537c52f1307..0000000000000 Binary files a/0.15/_images/plot_roc_crossval_0011.png and /dev/null differ diff --git a/0.15/_images/plot_segmentation_toy.png b/0.15/_images/plot_segmentation_toy.png deleted file mode 100644 index c35e014266327..0000000000000 Binary files a/0.15/_images/plot_segmentation_toy.png and /dev/null differ diff --git a/0.15/_images/plot_segmentation_toy1.png b/0.15/_images/plot_segmentation_toy1.png deleted file mode 100644 index c35e014266327..0000000000000 Binary files a/0.15/_images/plot_segmentation_toy1.png and /dev/null differ diff --git a/0.15/_images/plot_segmentation_toy_001.png b/0.15/_images/plot_segmentation_toy_001.png deleted file mode 100644 index ad71058cd09a1..0000000000000 Binary files a/0.15/_images/plot_segmentation_toy_001.png and /dev/null differ diff --git a/0.15/_images/plot_segmentation_toy_0011.png b/0.15/_images/plot_segmentation_toy_0011.png deleted file mode 100644 index ad71058cd09a1..0000000000000 Binary files a/0.15/_images/plot_segmentation_toy_0011.png and /dev/null differ diff --git a/0.15/_images/plot_segmentation_toy_002.png b/0.15/_images/plot_segmentation_toy_002.png deleted file mode 100644 index c501757449e9c..0000000000000 Binary files a/0.15/_images/plot_segmentation_toy_002.png and /dev/null differ diff --git a/0.15/_images/plot_segmentation_toy_0021.png b/0.15/_images/plot_segmentation_toy_0021.png deleted file mode 100644 index c501757449e9c..0000000000000 Binary files a/0.15/_images/plot_segmentation_toy_0021.png and /dev/null differ diff --git a/0.15/_images/plot_segmentation_toy_003.png b/0.15/_images/plot_segmentation_toy_003.png deleted file mode 100644 index 00359f281ad65..0000000000000 Binary files a/0.15/_images/plot_segmentation_toy_003.png and /dev/null differ diff --git a/0.15/_images/plot_segmentation_toy_004.png b/0.15/_images/plot_segmentation_toy_004.png deleted file mode 100644 index f9da990888de2..0000000000000 Binary files a/0.15/_images/plot_segmentation_toy_004.png and /dev/null differ diff --git a/0.15/_images/plot_separating_hyperplane.png b/0.15/_images/plot_separating_hyperplane.png deleted file mode 100644 index aa9f591dd4e33..0000000000000 Binary files a/0.15/_images/plot_separating_hyperplane.png and /dev/null differ diff --git a/0.15/_images/plot_separating_hyperplane1.png b/0.15/_images/plot_separating_hyperplane1.png deleted file mode 100644 index aa9f591dd4e33..0000000000000 Binary files a/0.15/_images/plot_separating_hyperplane1.png and /dev/null differ diff --git a/0.15/_images/plot_separating_hyperplane_001.png b/0.15/_images/plot_separating_hyperplane_001.png deleted file mode 100644 index 11920ea0cc032..0000000000000 Binary files a/0.15/_images/plot_separating_hyperplane_001.png and /dev/null differ diff --git a/0.15/_images/plot_separating_hyperplane_0011.png b/0.15/_images/plot_separating_hyperplane_0011.png deleted file mode 100644 index 11920ea0cc032..0000000000000 Binary files a/0.15/_images/plot_separating_hyperplane_0011.png and /dev/null differ diff --git a/0.15/_images/plot_separating_hyperplane_unbalanced.png b/0.15/_images/plot_separating_hyperplane_unbalanced.png deleted file mode 100644 index 23ef644594a47..0000000000000 Binary files a/0.15/_images/plot_separating_hyperplane_unbalanced.png and /dev/null differ diff --git a/0.15/_images/plot_separating_hyperplane_unbalanced1.png b/0.15/_images/plot_separating_hyperplane_unbalanced1.png deleted file mode 100644 index 23ef644594a47..0000000000000 Binary files a/0.15/_images/plot_separating_hyperplane_unbalanced1.png and /dev/null differ diff --git a/0.15/_images/plot_separating_hyperplane_unbalanced_001.png b/0.15/_images/plot_separating_hyperplane_unbalanced_001.png deleted file mode 100644 index 5ba678a9780c8..0000000000000 Binary files a/0.15/_images/plot_separating_hyperplane_unbalanced_001.png and /dev/null differ diff --git a/0.15/_images/plot_separating_hyperplane_unbalanced_0011.png b/0.15/_images/plot_separating_hyperplane_unbalanced_0011.png deleted file mode 100644 index 5ba678a9780c8..0000000000000 Binary files a/0.15/_images/plot_separating_hyperplane_unbalanced_0011.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_comparison.png b/0.15/_images/plot_sgd_comparison.png deleted file mode 100644 index 82bb4e4f89b7f..0000000000000 Binary files a/0.15/_images/plot_sgd_comparison.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_comparison1.png b/0.15/_images/plot_sgd_comparison1.png deleted file mode 100644 index 82bb4e4f89b7f..0000000000000 Binary files a/0.15/_images/plot_sgd_comparison1.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_comparison_001.png b/0.15/_images/plot_sgd_comparison_001.png deleted file mode 100644 index 70645e9b30ffb..0000000000000 Binary files a/0.15/_images/plot_sgd_comparison_001.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_iris.png b/0.15/_images/plot_sgd_iris.png deleted file mode 100644 index b4e2b869876a2..0000000000000 Binary files a/0.15/_images/plot_sgd_iris.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_iris1.png b/0.15/_images/plot_sgd_iris1.png deleted file mode 100644 index b4e2b869876a2..0000000000000 Binary files a/0.15/_images/plot_sgd_iris1.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_iris_001.png b/0.15/_images/plot_sgd_iris_001.png deleted file mode 100644 index 8afe11088c4a1..0000000000000 Binary files a/0.15/_images/plot_sgd_iris_001.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_iris_0011.png b/0.15/_images/plot_sgd_iris_0011.png deleted file mode 100644 index 8afe11088c4a1..0000000000000 Binary files a/0.15/_images/plot_sgd_iris_0011.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_loss_functions.png b/0.15/_images/plot_sgd_loss_functions.png deleted file mode 100644 index 8e5b76e351843..0000000000000 Binary files a/0.15/_images/plot_sgd_loss_functions.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_loss_functions_001.png b/0.15/_images/plot_sgd_loss_functions_001.png deleted file mode 100644 index 17d49bc910f35..0000000000000 Binary files a/0.15/_images/plot_sgd_loss_functions_001.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_loss_functions_0011.png b/0.15/_images/plot_sgd_loss_functions_0011.png deleted file mode 100644 index 17d49bc910f35..0000000000000 Binary files a/0.15/_images/plot_sgd_loss_functions_0011.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_penalties.png b/0.15/_images/plot_sgd_penalties.png deleted file mode 100644 index 5a674370c4198..0000000000000 Binary files a/0.15/_images/plot_sgd_penalties.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_penalties_001.png b/0.15/_images/plot_sgd_penalties_001.png deleted file mode 100644 index cd2aa85e67861..0000000000000 Binary files a/0.15/_images/plot_sgd_penalties_001.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_penalties_0011.png b/0.15/_images/plot_sgd_penalties_0011.png deleted file mode 100644 index cd2aa85e67861..0000000000000 Binary files a/0.15/_images/plot_sgd_penalties_0011.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_separating_hyperplane.png b/0.15/_images/plot_sgd_separating_hyperplane.png deleted file mode 100644 index 8b1e12e0a3f45..0000000000000 Binary files a/0.15/_images/plot_sgd_separating_hyperplane.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_separating_hyperplane1.png b/0.15/_images/plot_sgd_separating_hyperplane1.png deleted file mode 100644 index 8b1e12e0a3f45..0000000000000 Binary files a/0.15/_images/plot_sgd_separating_hyperplane1.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_separating_hyperplane_001.png b/0.15/_images/plot_sgd_separating_hyperplane_001.png deleted file mode 100644 index 0932ed02e3895..0000000000000 Binary files a/0.15/_images/plot_sgd_separating_hyperplane_001.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_separating_hyperplane_0011.png b/0.15/_images/plot_sgd_separating_hyperplane_0011.png deleted file mode 100644 index 0932ed02e3895..0000000000000 Binary files a/0.15/_images/plot_sgd_separating_hyperplane_0011.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_weighted_samples.png b/0.15/_images/plot_sgd_weighted_samples.png deleted file mode 100644 index a97848229f8b7..0000000000000 Binary files a/0.15/_images/plot_sgd_weighted_samples.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_weighted_samples1.png b/0.15/_images/plot_sgd_weighted_samples1.png deleted file mode 100644 index a97848229f8b7..0000000000000 Binary files a/0.15/_images/plot_sgd_weighted_samples1.png and /dev/null differ diff --git a/0.15/_images/plot_sgd_weighted_samples_001.png b/0.15/_images/plot_sgd_weighted_samples_001.png deleted file mode 100644 index bac96bb87110f..0000000000000 Binary files a/0.15/_images/plot_sgd_weighted_samples_001.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_coding.png b/0.15/_images/plot_sparse_coding.png deleted file mode 100644 index 38b67d82a3c32..0000000000000 Binary files a/0.15/_images/plot_sparse_coding.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_coding1.png b/0.15/_images/plot_sparse_coding1.png deleted file mode 100644 index 38b67d82a3c32..0000000000000 Binary files a/0.15/_images/plot_sparse_coding1.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_coding_001.png b/0.15/_images/plot_sparse_coding_001.png deleted file mode 100644 index af2513027e7a4..0000000000000 Binary files a/0.15/_images/plot_sparse_coding_001.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_cov.png b/0.15/_images/plot_sparse_cov.png deleted file mode 100644 index 58f9262ebbaeb..0000000000000 Binary files a/0.15/_images/plot_sparse_cov.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_cov1.png b/0.15/_images/plot_sparse_cov1.png deleted file mode 100644 index 58f9262ebbaeb..0000000000000 Binary files a/0.15/_images/plot_sparse_cov1.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_cov_001.png b/0.15/_images/plot_sparse_cov_001.png deleted file mode 100644 index b47923f1ab33f..0000000000000 Binary files a/0.15/_images/plot_sparse_cov_001.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_cov_0011.png b/0.15/_images/plot_sparse_cov_0011.png deleted file mode 100644 index b47923f1ab33f..0000000000000 Binary files a/0.15/_images/plot_sparse_cov_0011.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_cov_002.png b/0.15/_images/plot_sparse_cov_002.png deleted file mode 100644 index 8e2958ca074e4..0000000000000 Binary files a/0.15/_images/plot_sparse_cov_002.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_recovery.png b/0.15/_images/plot_sparse_recovery.png deleted file mode 100644 index ec341b8780922..0000000000000 Binary files a/0.15/_images/plot_sparse_recovery.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_recovery1.png b/0.15/_images/plot_sparse_recovery1.png deleted file mode 100644 index ec341b8780922..0000000000000 Binary files a/0.15/_images/plot_sparse_recovery1.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_recovery_001.png b/0.15/_images/plot_sparse_recovery_001.png deleted file mode 100644 index 2406e7c278efa..0000000000000 Binary files a/0.15/_images/plot_sparse_recovery_001.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_recovery_002.png b/0.15/_images/plot_sparse_recovery_002.png deleted file mode 100644 index c4274831f51f8..0000000000000 Binary files a/0.15/_images/plot_sparse_recovery_002.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_recovery_0021.png b/0.15/_images/plot_sparse_recovery_0021.png deleted file mode 100644 index c4274831f51f8..0000000000000 Binary files a/0.15/_images/plot_sparse_recovery_0021.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_recovery_003.png b/0.15/_images/plot_sparse_recovery_003.png deleted file mode 100644 index 352200905e805..0000000000000 Binary files a/0.15/_images/plot_sparse_recovery_003.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_recovery_0031.png b/0.15/_images/plot_sparse_recovery_0031.png deleted file mode 100644 index 352200905e805..0000000000000 Binary files a/0.15/_images/plot_sparse_recovery_0031.png and /dev/null differ diff --git a/0.15/_images/plot_sparse_recovery_004.png b/0.15/_images/plot_sparse_recovery_004.png deleted file mode 100644 index 6c9f968878cb3..0000000000000 Binary files a/0.15/_images/plot_sparse_recovery_004.png and /dev/null differ diff --git a/0.15/_images/plot_species_distribution_modeling.png b/0.15/_images/plot_species_distribution_modeling.png deleted file mode 100644 index 4b68623e822c8..0000000000000 Binary files a/0.15/_images/plot_species_distribution_modeling.png and /dev/null differ diff --git a/0.15/_images/plot_species_distribution_modeling1.png b/0.15/_images/plot_species_distribution_modeling1.png deleted file mode 100644 index 4b68623e822c8..0000000000000 Binary files a/0.15/_images/plot_species_distribution_modeling1.png and /dev/null differ diff --git a/0.15/_images/plot_species_distribution_modeling_001.png b/0.15/_images/plot_species_distribution_modeling_001.png deleted file mode 100644 index 0c7704eeae206..0000000000000 Binary files a/0.15/_images/plot_species_distribution_modeling_001.png and /dev/null differ diff --git a/0.15/_images/plot_species_kde.png b/0.15/_images/plot_species_kde.png deleted file mode 100644 index a514c42d6cc20..0000000000000 Binary files a/0.15/_images/plot_species_kde.png and /dev/null differ diff --git a/0.15/_images/plot_species_kde1.png b/0.15/_images/plot_species_kde1.png deleted file mode 100644 index a514c42d6cc20..0000000000000 Binary files a/0.15/_images/plot_species_kde1.png and /dev/null differ diff --git a/0.15/_images/plot_species_kde_001.png b/0.15/_images/plot_species_kde_001.png deleted file mode 100644 index ad4eac7063787..0000000000000 Binary files a/0.15/_images/plot_species_kde_001.png and /dev/null differ diff --git a/0.15/_images/plot_species_kde_0011.png b/0.15/_images/plot_species_kde_0011.png deleted file mode 100644 index ad4eac7063787..0000000000000 Binary files a/0.15/_images/plot_species_kde_0011.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_biclustering.png b/0.15/_images/plot_spectral_biclustering.png deleted file mode 100644 index deb60dbbf2237..0000000000000 Binary files a/0.15/_images/plot_spectral_biclustering.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_biclustering1.png b/0.15/_images/plot_spectral_biclustering1.png deleted file mode 100644 index deb60dbbf2237..0000000000000 Binary files a/0.15/_images/plot_spectral_biclustering1.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_biclustering_001.png b/0.15/_images/plot_spectral_biclustering_001.png deleted file mode 100644 index cbec1ed7d4350..0000000000000 Binary files a/0.15/_images/plot_spectral_biclustering_001.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_biclustering_002.png b/0.15/_images/plot_spectral_biclustering_002.png deleted file mode 100644 index 5663ab76f0329..0000000000000 Binary files a/0.15/_images/plot_spectral_biclustering_002.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_biclustering_003.png b/0.15/_images/plot_spectral_biclustering_003.png deleted file mode 100644 index a41a7177dc556..0000000000000 Binary files a/0.15/_images/plot_spectral_biclustering_003.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_biclustering_0031.png b/0.15/_images/plot_spectral_biclustering_0031.png deleted file mode 100644 index a41a7177dc556..0000000000000 Binary files a/0.15/_images/plot_spectral_biclustering_0031.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_biclustering_004.png b/0.15/_images/plot_spectral_biclustering_004.png deleted file mode 100644 index 110c755b81d0c..0000000000000 Binary files a/0.15/_images/plot_spectral_biclustering_004.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_coclustering.png b/0.15/_images/plot_spectral_coclustering.png deleted file mode 100644 index cf78a1de8086d..0000000000000 Binary files a/0.15/_images/plot_spectral_coclustering.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_coclustering1.png b/0.15/_images/plot_spectral_coclustering1.png deleted file mode 100644 index cf78a1de8086d..0000000000000 Binary files a/0.15/_images/plot_spectral_coclustering1.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_coclustering_001.png b/0.15/_images/plot_spectral_coclustering_001.png deleted file mode 100644 index 49de5a892a350..0000000000000 Binary files a/0.15/_images/plot_spectral_coclustering_001.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_coclustering_002.png b/0.15/_images/plot_spectral_coclustering_002.png deleted file mode 100644 index ba96a207c5bc3..0000000000000 Binary files a/0.15/_images/plot_spectral_coclustering_002.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_coclustering_003.png b/0.15/_images/plot_spectral_coclustering_003.png deleted file mode 100644 index d15eb83189ab8..0000000000000 Binary files a/0.15/_images/plot_spectral_coclustering_003.png and /dev/null differ diff --git a/0.15/_images/plot_spectral_coclustering_0031.png b/0.15/_images/plot_spectral_coclustering_0031.png deleted file mode 100644 index d15eb83189ab8..0000000000000 Binary files a/0.15/_images/plot_spectral_coclustering_0031.png and /dev/null differ diff --git a/0.15/_images/plot_stock_market.png b/0.15/_images/plot_stock_market.png deleted file mode 100644 index 3a785bef131d7..0000000000000 Binary files a/0.15/_images/plot_stock_market.png and /dev/null differ diff --git a/0.15/_images/plot_stock_market1.png b/0.15/_images/plot_stock_market1.png deleted file mode 100644 index 3a785bef131d7..0000000000000 Binary files a/0.15/_images/plot_stock_market1.png and /dev/null differ diff --git a/0.15/_images/plot_stock_market_001.png b/0.15/_images/plot_stock_market_001.png deleted file mode 100644 index 2ba9b9d40a698..0000000000000 Binary files a/0.15/_images/plot_stock_market_001.png and /dev/null differ diff --git a/0.15/_images/plot_svm_anova.png b/0.15/_images/plot_svm_anova.png deleted file mode 100644 index 7e867141ec0d6..0000000000000 Binary files a/0.15/_images/plot_svm_anova.png and /dev/null differ diff --git a/0.15/_images/plot_svm_anova1.png b/0.15/_images/plot_svm_anova1.png deleted file mode 100644 index 7e867141ec0d6..0000000000000 Binary files a/0.15/_images/plot_svm_anova1.png and /dev/null differ diff --git a/0.15/_images/plot_svm_anova_001.png b/0.15/_images/plot_svm_anova_001.png deleted file mode 100644 index 6a73c0e26f041..0000000000000 Binary files a/0.15/_images/plot_svm_anova_001.png and /dev/null differ diff --git a/0.15/_images/plot_svm_kernels.png b/0.15/_images/plot_svm_kernels.png deleted file mode 100644 index 73992f4ad3a51..0000000000000 Binary files a/0.15/_images/plot_svm_kernels.png and /dev/null differ diff --git a/0.15/_images/plot_svm_kernels1.png b/0.15/_images/plot_svm_kernels1.png deleted file mode 100644 index 73992f4ad3a51..0000000000000 Binary files a/0.15/_images/plot_svm_kernels1.png and /dev/null differ diff --git a/0.15/_images/plot_svm_kernels_001.png b/0.15/_images/plot_svm_kernels_001.png deleted file mode 100644 index 0c7925bf199f1..0000000000000 Binary files a/0.15/_images/plot_svm_kernels_001.png and /dev/null differ diff --git a/0.15/_images/plot_svm_kernels_0011.png b/0.15/_images/plot_svm_kernels_0011.png deleted file mode 100644 index 0c7925bf199f1..0000000000000 Binary files a/0.15/_images/plot_svm_kernels_0011.png and /dev/null differ diff --git a/0.15/_images/plot_svm_kernels_002.png b/0.15/_images/plot_svm_kernels_002.png deleted file mode 100644 index 754cf7714e168..0000000000000 Binary files a/0.15/_images/plot_svm_kernels_002.png and /dev/null differ diff --git a/0.15/_images/plot_svm_kernels_0021.png b/0.15/_images/plot_svm_kernels_0021.png deleted file mode 100644 index 754cf7714e168..0000000000000 Binary files a/0.15/_images/plot_svm_kernels_0021.png and /dev/null differ diff --git a/0.15/_images/plot_svm_kernels_003.png b/0.15/_images/plot_svm_kernels_003.png deleted file mode 100644 index ffc0830460522..0000000000000 Binary files a/0.15/_images/plot_svm_kernels_003.png and /dev/null differ diff --git a/0.15/_images/plot_svm_kernels_0031.png b/0.15/_images/plot_svm_kernels_0031.png deleted file mode 100644 index ffc0830460522..0000000000000 Binary files a/0.15/_images/plot_svm_kernels_0031.png and /dev/null differ diff --git a/0.15/_images/plot_svm_margin.png b/0.15/_images/plot_svm_margin.png deleted file mode 100644 index da1d424f24f3d..0000000000000 Binary files a/0.15/_images/plot_svm_margin.png and /dev/null differ diff --git a/0.15/_images/plot_svm_margin1.png b/0.15/_images/plot_svm_margin1.png deleted file mode 100644 index da1d424f24f3d..0000000000000 Binary files a/0.15/_images/plot_svm_margin1.png and /dev/null differ diff --git a/0.15/_images/plot_svm_margin_001.png b/0.15/_images/plot_svm_margin_001.png deleted file mode 100644 index ef2a11d29b138..0000000000000 Binary files a/0.15/_images/plot_svm_margin_001.png and /dev/null differ diff --git a/0.15/_images/plot_svm_margin_0011.png b/0.15/_images/plot_svm_margin_0011.png deleted file mode 100644 index ef2a11d29b138..0000000000000 Binary files a/0.15/_images/plot_svm_margin_0011.png and /dev/null differ diff --git a/0.15/_images/plot_svm_margin_002.png b/0.15/_images/plot_svm_margin_002.png deleted file mode 100644 index 8104624903b07..0000000000000 Binary files a/0.15/_images/plot_svm_margin_002.png and /dev/null differ diff --git a/0.15/_images/plot_svm_margin_0021.png b/0.15/_images/plot_svm_margin_0021.png deleted file mode 100644 index 8104624903b07..0000000000000 Binary files a/0.15/_images/plot_svm_margin_0021.png and /dev/null differ diff --git a/0.15/_images/plot_svm_nonlinear.png b/0.15/_images/plot_svm_nonlinear.png deleted file mode 100644 index f917e92eacec4..0000000000000 Binary files a/0.15/_images/plot_svm_nonlinear.png and /dev/null differ diff --git a/0.15/_images/plot_svm_nonlinear1.png b/0.15/_images/plot_svm_nonlinear1.png deleted file mode 100644 index f917e92eacec4..0000000000000 Binary files a/0.15/_images/plot_svm_nonlinear1.png and /dev/null differ diff --git a/0.15/_images/plot_svm_nonlinear_001.png b/0.15/_images/plot_svm_nonlinear_001.png deleted file mode 100644 index 5a6ad5be241cb..0000000000000 Binary files a/0.15/_images/plot_svm_nonlinear_001.png and /dev/null differ diff --git a/0.15/_images/plot_svm_regression.png b/0.15/_images/plot_svm_regression.png deleted file mode 100644 index dbe1f4da6758c..0000000000000 Binary files a/0.15/_images/plot_svm_regression.png and /dev/null differ diff --git a/0.15/_images/plot_svm_regression1.png b/0.15/_images/plot_svm_regression1.png deleted file mode 100644 index dbe1f4da6758c..0000000000000 Binary files a/0.15/_images/plot_svm_regression1.png and /dev/null differ diff --git a/0.15/_images/plot_svm_regression_001.png b/0.15/_images/plot_svm_regression_001.png deleted file mode 100644 index 0672d98a93c39..0000000000000 Binary files a/0.15/_images/plot_svm_regression_001.png and /dev/null differ diff --git a/0.15/_images/plot_svm_scale_c.png b/0.15/_images/plot_svm_scale_c.png deleted file mode 100644 index a9639b0dc6160..0000000000000 Binary files a/0.15/_images/plot_svm_scale_c.png and /dev/null differ diff --git a/0.15/_images/plot_svm_scale_c1.png b/0.15/_images/plot_svm_scale_c1.png deleted file mode 100644 index a9639b0dc6160..0000000000000 Binary files a/0.15/_images/plot_svm_scale_c1.png and /dev/null differ diff --git a/0.15/_images/plot_svm_scale_c_000.png b/0.15/_images/plot_svm_scale_c_000.png deleted file mode 100644 index 6abb6bc56101a..0000000000000 Binary files a/0.15/_images/plot_svm_scale_c_000.png and /dev/null differ diff --git a/0.15/_images/plot_svm_scale_c_001.png b/0.15/_images/plot_svm_scale_c_001.png deleted file mode 100644 index 2ccfcb6c96fbe..0000000000000 Binary files a/0.15/_images/plot_svm_scale_c_001.png and /dev/null differ diff --git a/0.15/_images/plot_swissroll.png b/0.15/_images/plot_swissroll.png deleted file mode 100644 index 8cb9fa01d3283..0000000000000 Binary files a/0.15/_images/plot_swissroll.png and /dev/null differ diff --git a/0.15/_images/plot_swissroll1.png b/0.15/_images/plot_swissroll1.png deleted file mode 100644 index 8cb9fa01d3283..0000000000000 Binary files a/0.15/_images/plot_swissroll1.png and /dev/null differ diff --git a/0.15/_images/plot_swissroll_001.png b/0.15/_images/plot_swissroll_001.png deleted file mode 100644 index 27650a0ecd23e..0000000000000 Binary files a/0.15/_images/plot_swissroll_001.png and /dev/null differ diff --git a/0.15/_images/plot_theilsen.png b/0.15/_images/plot_theilsen.png deleted file mode 100644 index e5451bf39bfc1..0000000000000 Binary files a/0.15/_images/plot_theilsen.png and /dev/null differ diff --git a/0.15/_images/plot_theilsen1.png b/0.15/_images/plot_theilsen1.png deleted file mode 100644 index e5451bf39bfc1..0000000000000 Binary files a/0.15/_images/plot_theilsen1.png and /dev/null differ diff --git a/0.15/_images/plot_theilsen_001.png b/0.15/_images/plot_theilsen_001.png deleted file mode 100644 index 0881a48487f6b..0000000000000 Binary files a/0.15/_images/plot_theilsen_001.png and /dev/null differ diff --git a/0.15/_images/plot_theilsen_0011.png b/0.15/_images/plot_theilsen_0011.png deleted file mode 100644 index 0881a48487f6b..0000000000000 Binary files a/0.15/_images/plot_theilsen_0011.png and /dev/null differ diff --git a/0.15/_images/plot_theilsen_002.png b/0.15/_images/plot_theilsen_002.png deleted file mode 100644 index 5206bb9565328..0000000000000 Binary files a/0.15/_images/plot_theilsen_002.png and /dev/null differ diff --git a/0.15/_images/plot_tomography_l1_reconstruction.png b/0.15/_images/plot_tomography_l1_reconstruction.png deleted file mode 100644 index 5704adfa629da..0000000000000 Binary files a/0.15/_images/plot_tomography_l1_reconstruction.png and /dev/null differ diff --git a/0.15/_images/plot_tomography_l1_reconstruction1.png b/0.15/_images/plot_tomography_l1_reconstruction1.png deleted file mode 100644 index 5704adfa629da..0000000000000 Binary files a/0.15/_images/plot_tomography_l1_reconstruction1.png and /dev/null differ diff --git a/0.15/_images/plot_tomography_l1_reconstruction_001.png b/0.15/_images/plot_tomography_l1_reconstruction_001.png deleted file mode 100644 index 8aa01effd471e..0000000000000 Binary files a/0.15/_images/plot_tomography_l1_reconstruction_001.png and /dev/null differ diff --git a/0.15/_images/plot_train_error_vs_test_error.png b/0.15/_images/plot_train_error_vs_test_error.png deleted file mode 100644 index c9c126b96194e..0000000000000 Binary files a/0.15/_images/plot_train_error_vs_test_error.png and /dev/null differ diff --git a/0.15/_images/plot_train_error_vs_test_error1.png b/0.15/_images/plot_train_error_vs_test_error1.png deleted file mode 100644 index 3d4050027d2ec..0000000000000 Binary files a/0.15/_images/plot_train_error_vs_test_error1.png and /dev/null differ diff --git a/0.15/_images/plot_train_error_vs_test_error_001.png b/0.15/_images/plot_train_error_vs_test_error_001.png deleted file mode 100644 index 4998fa3bb9964..0000000000000 Binary files a/0.15/_images/plot_train_error_vs_test_error_001.png and /dev/null differ diff --git a/0.15/_images/plot_train_error_vs_test_error_0011.png b/0.15/_images/plot_train_error_vs_test_error_0011.png deleted file mode 100644 index cea2b34abe17e..0000000000000 Binary files a/0.15/_images/plot_train_error_vs_test_error_0011.png and /dev/null differ diff --git a/0.15/_images/plot_tree_regression.png b/0.15/_images/plot_tree_regression.png deleted file mode 100644 index 89acacc1dafc0..0000000000000 Binary files a/0.15/_images/plot_tree_regression.png and /dev/null differ diff --git a/0.15/_images/plot_tree_regression1.png b/0.15/_images/plot_tree_regression1.png deleted file mode 100644 index 89acacc1dafc0..0000000000000 Binary files a/0.15/_images/plot_tree_regression1.png and /dev/null differ diff --git a/0.15/_images/plot_tree_regression_001.png b/0.15/_images/plot_tree_regression_001.png deleted file mode 100644 index c5aca0d3edffe..0000000000000 Binary files a/0.15/_images/plot_tree_regression_001.png and /dev/null differ diff --git a/0.15/_images/plot_tree_regression_0011.png b/0.15/_images/plot_tree_regression_0011.png deleted file mode 100644 index c5aca0d3edffe..0000000000000 Binary files a/0.15/_images/plot_tree_regression_0011.png and /dev/null differ diff --git a/0.15/_images/plot_tree_regression_multioutput.png b/0.15/_images/plot_tree_regression_multioutput.png deleted file mode 100644 index a2321dfac9638..0000000000000 Binary files a/0.15/_images/plot_tree_regression_multioutput.png and /dev/null differ diff --git a/0.15/_images/plot_tree_regression_multioutput1.png b/0.15/_images/plot_tree_regression_multioutput1.png deleted file mode 100644 index a2321dfac9638..0000000000000 Binary files a/0.15/_images/plot_tree_regression_multioutput1.png and /dev/null differ diff --git a/0.15/_images/plot_tree_regression_multioutput_001.png b/0.15/_images/plot_tree_regression_multioutput_001.png deleted file mode 100644 index 7e9fe1d5bf690..0000000000000 Binary files a/0.15/_images/plot_tree_regression_multioutput_001.png and /dev/null differ diff --git a/0.15/_images/plot_tree_regression_multioutput_0011.png b/0.15/_images/plot_tree_regression_multioutput_0011.png deleted file mode 100644 index 7e9fe1d5bf690..0000000000000 Binary files a/0.15/_images/plot_tree_regression_multioutput_0011.png and /dev/null differ diff --git a/0.15/_images/plot_underfitting_overfitting.png b/0.15/_images/plot_underfitting_overfitting.png deleted file mode 100644 index cd265c51de755..0000000000000 Binary files a/0.15/_images/plot_underfitting_overfitting.png and /dev/null differ diff --git a/0.15/_images/plot_underfitting_overfitting1.png b/0.15/_images/plot_underfitting_overfitting1.png deleted file mode 100644 index b3f97128822a1..0000000000000 Binary files a/0.15/_images/plot_underfitting_overfitting1.png and /dev/null differ diff --git a/0.15/_images/plot_underfitting_overfitting_001.png b/0.15/_images/plot_underfitting_overfitting_001.png deleted file mode 100644 index 776af40dbd734..0000000000000 Binary files a/0.15/_images/plot_underfitting_overfitting_001.png and /dev/null differ diff --git a/0.15/_images/plot_underfitting_overfitting_0011.png b/0.15/_images/plot_underfitting_overfitting_0011.png deleted file mode 100644 index e82d5e53d8c0a..0000000000000 Binary files a/0.15/_images/plot_underfitting_overfitting_0011.png and /dev/null differ diff --git a/0.15/_images/plot_underfitting_overfitting_0012.png b/0.15/_images/plot_underfitting_overfitting_0012.png deleted file mode 100644 index e82d5e53d8c0a..0000000000000 Binary files a/0.15/_images/plot_underfitting_overfitting_0012.png and /dev/null differ diff --git a/0.15/_images/plot_validation_curve.png b/0.15/_images/plot_validation_curve.png deleted file mode 100644 index 771744e99166a..0000000000000 Binary files a/0.15/_images/plot_validation_curve.png and /dev/null differ diff --git a/0.15/_images/plot_validation_curve1.png b/0.15/_images/plot_validation_curve1.png deleted file mode 100644 index 5c03423cc0f97..0000000000000 Binary files a/0.15/_images/plot_validation_curve1.png and /dev/null differ diff --git a/0.15/_images/plot_validation_curve_001.png b/0.15/_images/plot_validation_curve_001.png deleted file mode 100644 index 02b917bc89ec7..0000000000000 Binary files a/0.15/_images/plot_validation_curve_001.png and /dev/null differ diff --git a/0.15/_images/plot_validation_curve_0011.png b/0.15/_images/plot_validation_curve_0011.png deleted file mode 100644 index 4e70862a4e875..0000000000000 Binary files a/0.15/_images/plot_validation_curve_0011.png and /dev/null differ diff --git a/0.15/_images/plot_validation_curve_0012.png b/0.15/_images/plot_validation_curve_0012.png deleted file mode 100644 index 4e70862a4e875..0000000000000 Binary files a/0.15/_images/plot_validation_curve_0012.png and /dev/null differ diff --git a/0.15/_images/plot_voting_decision_regions.png b/0.15/_images/plot_voting_decision_regions.png deleted file mode 100644 index 40f068fd1494e..0000000000000 Binary files a/0.15/_images/plot_voting_decision_regions.png and /dev/null differ diff --git a/0.15/_images/plot_voting_decision_regions1.png b/0.15/_images/plot_voting_decision_regions1.png deleted file mode 100644 index 40f068fd1494e..0000000000000 Binary files a/0.15/_images/plot_voting_decision_regions1.png and /dev/null differ diff --git a/0.15/_images/plot_voting_decision_regions_001.png b/0.15/_images/plot_voting_decision_regions_001.png deleted file mode 100644 index 8dc96aa99ca2d..0000000000000 Binary files a/0.15/_images/plot_voting_decision_regions_001.png and /dev/null differ diff --git a/0.15/_images/plot_voting_decision_regions_0011.png b/0.15/_images/plot_voting_decision_regions_0011.png deleted file mode 100644 index 8dc96aa99ca2d..0000000000000 Binary files a/0.15/_images/plot_voting_decision_regions_0011.png and /dev/null differ diff --git a/0.15/_images/plot_voting_probas.png b/0.15/_images/plot_voting_probas.png deleted file mode 100644 index 05b4bb6f2fef9..0000000000000 Binary files a/0.15/_images/plot_voting_probas.png and /dev/null differ diff --git a/0.15/_images/plot_voting_probas1.png b/0.15/_images/plot_voting_probas1.png deleted file mode 100644 index 05b4bb6f2fef9..0000000000000 Binary files a/0.15/_images/plot_voting_probas1.png and /dev/null differ diff --git a/0.15/_images/plot_voting_probas_001.png b/0.15/_images/plot_voting_probas_001.png deleted file mode 100644 index d544a2a54c70f..0000000000000 Binary files a/0.15/_images/plot_voting_probas_001.png and /dev/null differ diff --git a/0.15/_images/plot_ward_structured_vs_unstructured.png b/0.15/_images/plot_ward_structured_vs_unstructured.png deleted file mode 100644 index 4be24a3534798..0000000000000 Binary files a/0.15/_images/plot_ward_structured_vs_unstructured.png and /dev/null differ diff --git a/0.15/_images/plot_ward_structured_vs_unstructured1.png b/0.15/_images/plot_ward_structured_vs_unstructured1.png deleted file mode 100644 index 4be24a3534798..0000000000000 Binary files a/0.15/_images/plot_ward_structured_vs_unstructured1.png and /dev/null differ diff --git a/0.15/_images/plot_ward_structured_vs_unstructured_001.png b/0.15/_images/plot_ward_structured_vs_unstructured_001.png deleted file mode 100644 index 14fe78d680220..0000000000000 Binary files a/0.15/_images/plot_ward_structured_vs_unstructured_001.png and /dev/null differ diff --git a/0.15/_images/plot_ward_structured_vs_unstructured_0011.png b/0.15/_images/plot_ward_structured_vs_unstructured_0011.png deleted file mode 100644 index 14fe78d680220..0000000000000 Binary files a/0.15/_images/plot_ward_structured_vs_unstructured_0011.png and /dev/null differ diff --git a/0.15/_images/plot_ward_structured_vs_unstructured_002.png b/0.15/_images/plot_ward_structured_vs_unstructured_002.png deleted file mode 100644 index ac8e885721ce0..0000000000000 Binary files a/0.15/_images/plot_ward_structured_vs_unstructured_002.png and /dev/null differ diff --git a/0.15/_images/plot_ward_structured_vs_unstructured_0021.png b/0.15/_images/plot_ward_structured_vs_unstructured_0021.png deleted file mode 100644 index ac8e885721ce0..0000000000000 Binary files a/0.15/_images/plot_ward_structured_vs_unstructured_0021.png and /dev/null differ diff --git a/0.15/_images/plot_weighted_samples.png b/0.15/_images/plot_weighted_samples.png deleted file mode 100644 index da6b8ae414a13..0000000000000 Binary files a/0.15/_images/plot_weighted_samples.png and /dev/null differ diff --git a/0.15/_images/plot_weighted_samples1.png b/0.15/_images/plot_weighted_samples1.png deleted file mode 100644 index da6b8ae414a13..0000000000000 Binary files a/0.15/_images/plot_weighted_samples1.png and /dev/null differ diff --git a/0.15/_images/plot_weighted_samples_001.png b/0.15/_images/plot_weighted_samples_001.png deleted file mode 100644 index 1a023da73e624..0000000000000 Binary files a/0.15/_images/plot_weighted_samples_001.png and /dev/null differ diff --git a/0.15/_images/plot_weighted_samples_0011.png b/0.15/_images/plot_weighted_samples_0011.png deleted file mode 100644 index 1a023da73e624..0000000000000 Binary files a/0.15/_images/plot_weighted_samples_0011.png and /dev/null differ diff --git a/0.15/_images/randomized_search.png b/0.15/_images/randomized_search.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/randomized_search.png and /dev/null differ diff --git a/0.15/_images/randomized_search1.png b/0.15/_images/randomized_search1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/randomized_search1.png and /dev/null differ diff --git a/0.15/_images/rangespan.png b/0.15/_images/rangespan.png deleted file mode 100644 index 272c17077cef6..0000000000000 Binary files a/0.15/_images/rangespan.png and /dev/null differ diff --git a/0.15/_images/rbm_graph.png b/0.15/_images/rbm_graph.png deleted file mode 100644 index 27c0dd32a2dd0..0000000000000 Binary files a/0.15/_images/rbm_graph.png and /dev/null differ diff --git a/0.15/_images/scikit-learn-logo-notext.png b/0.15/_images/scikit-learn-logo-notext.png deleted file mode 100644 index ce1e1056c66a6..0000000000000 Binary files a/0.15/_images/scikit-learn-logo-notext.png and /dev/null differ diff --git a/0.15/_images/solido_logo.png b/0.15/_images/solido_logo.png deleted file mode 100644 index 0bbb47a1093e5..0000000000000 Binary files a/0.15/_images/solido_logo.png and /dev/null differ diff --git a/0.15/_images/spotify.png b/0.15/_images/spotify.png deleted file mode 100644 index 13ed314c3c910..0000000000000 Binary files a/0.15/_images/spotify.png and /dev/null differ diff --git a/0.15/_images/svm_gui.png b/0.15/_images/svm_gui.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/svm_gui.png and /dev/null differ diff --git a/0.15/_images/svm_gui1.png b/0.15/_images/svm_gui1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/svm_gui1.png and /dev/null differ diff --git a/0.15/_images/telecomparistech.jpg b/0.15/_images/telecomparistech.jpg deleted file mode 100644 index ddf35ebdc3e4e..0000000000000 Binary files a/0.15/_images/telecomparistech.jpg and /dev/null differ diff --git a/0.15/_images/topics_extraction_with_nmf.png b/0.15/_images/topics_extraction_with_nmf.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/topics_extraction_with_nmf.png and /dev/null differ diff --git a/0.15/_images/topics_extraction_with_nmf1.png b/0.15/_images/topics_extraction_with_nmf1.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/topics_extraction_with_nmf1.png and /dev/null differ diff --git a/0.15/_images/wikipedia_principal_eigenvector.png b/0.15/_images/wikipedia_principal_eigenvector.png deleted file mode 100644 index cbc8e0f356711..0000000000000 Binary files a/0.15/_images/wikipedia_principal_eigenvector.png and /dev/null differ diff --git a/0.15/_images/yhat.png b/0.15/_images/yhat.png deleted file mode 100644 index 148c381f09f77..0000000000000 Binary files a/0.15/_images/yhat.png and /dev/null differ diff --git a/0.15/_sources/about.txt b/0.15/_sources/about.txt deleted file mode 100644 index d3ab063e4ccaf..0000000000000 --- a/0.15/_sources/about.txt +++ /dev/null @@ -1,177 +0,0 @@ - - -About us -======== - -.. include:: ../AUTHORS.rst - -.. _citing-scikit-learn: - -Citing scikit-learn -------------------- - -If you use scikit-learn in scientific publication, we would appreciate -citations to the following paper: - - `Scikit-learn: Machine Learning in Python - `_, Pedregosa - *et al.*, JMLR 12, pp. 2825-2830, 2011. - - Bibtex entry:: - - @article{scikit-learn, - title={Scikit-learn: Machine Learning in {P}ython}, - author={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V. - and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P. - and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and - Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.}, - journal={Journal of Machine Learning Research}, - volume={12}, - pages={2825--2830}, - year={2011} - } - -Artwork -------- - -High quality PNG and SVG logos are available in the `doc/logos/ `_ source directory. - -.. image:: images/scikit-learn-logo-notext.png - :align: center - -Funding -------- - -`INRIA `_ actively supports this project. It has -provided funding for Fabian Pedregosa to work on this project full -time in the period 2010-2012. It also hosts coding sprints and other -events. - -.. image:: images/inria-logo.jpg - :align: center - - -`Google `_ sponsored David -Cournapeau with a Summer of Code Scholarship in the summer of 2007, -`Vlad Niculae`_ in 2011, and `Vlad Niculae`_ and Immanuel Bayer in 2012 . It also provided funding for sprints and events -around scikit-learn. If -you would like to participate in the next Google Summer of code -program, please see `this page -`_ - -The `NeuroDebian `_ project providing `Debian -`_ packaging and contributions is supported by -`Dr. James V. Haxby `_ (`Dartmouth -College `_). - -The `PSF `_ helped find and manage funding for our -2011 Granada sprint. More information can be found `here -`_ - -`tinyclues `_ funded the 2011 international Granada -sprint. - - -Donating to the project -~~~~~~~~~~~~~~~~~~~~~~~ - -If you are interested in donating to the project or to one of our code-sprints, you can use -the *Paypal* button below or the `NumFOCUS Donations Page `_ (if you use the latter, please indicate that you are donating for the scikit-learn project). - -All donations will be handled by `NumFOCUS -`_, a non-profit-organization which is -managed by a board of `Scipy community members -`_. NumFOCUS's mission is to foster -scientific computing software, in particular in Python. As a fiscal home -of scikit-learn, it ensures that money is available when needed to keep -the project funded and available while in compliance with tax regulations. - -The received donations for the scikit-learn project mostly will go towards covering travel-expenses -for code sprints, as well as towards the organization budget of the project [#f1]_. - -.. raw :: html - -

-
- - - - -
-
- -.. rubric:: Notes - -.. [#f1] Regarding the organization budget in particular, we might use some of the donated funds to pay for other project expenses such as DNS, hosting or continuous integration services. - - -The 2013' Paris international sprint -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -|center-div| |telecom| |tinyclues| |afpy| |FNRS| - - |end-div| - - - -.. |center-div| raw:: html - -
- - -.. |telecom| image:: http://f.hypotheses.org/wp-content/blogs.dir/331/files/2011/03/Logo-TPT.jpg - :width: 150px - :target: http://www.telecom-paristech.fr/ - - -.. |tinyclues| image:: http://www.tinyclues.com/item/50b77d01e4b0bff132989dfd?format=original - :width: 150px - :target: http://www.tinyclues.fr - - -.. |afpy| image:: http://www.afpy.org/logo.png - :width: 150px - :target: http://www.afpy.org - - -.. |SGR| image:: http://www.svi.cnrs-bellevue.fr/wikimedia/images/Logo_svi_inp.png - :width: 150px - :target: http://www.svi.cnrs-bellevue.fr - -.. |FNRS| image:: http://www.fnrs.be/uploaddocs/images/COMMUNIQUER/FRS-FNRS_rose_transp.png - :width: 150px - :target: http://www.frs-fnrs.be/ - -.. figure:: http://sites.uclouvain.be/dysco/pmwiki/uploads/Main/dysco.gif - :width: 150px - :target: http://sites.uclouvain.be/dysco/ - - IAP VII/19 - DYSCO - -.. |end-div| raw:: html - -
- -*For more information on this sprint, see* `here `_ - - -Infrastructure support ----------------------- - -- We would like to thank `Rackspace `_ for providing - us with a free `Rackspace Cloud `_ account to - automatically build the documentation and the example gallery from for the - development version of scikit-learn using `this tool - `_. - -- We would also like to thank `Shining Panda - `_ for free CPU time on their Continuous - Integration server. - diff --git a/0.15/_sources/auto_examples/applications/face_recognition.txt b/0.15/_sources/auto_examples/applications/face_recognition.txt deleted file mode 100644 index 92e55e233f0ff..0000000000000 --- a/0.15/_sources/auto_examples/applications/face_recognition.txt +++ /dev/null @@ -1,37 +0,0 @@ - - -.. _example_applications_face_recognition.py: - - -=================================================== -Faces recognition example using eigenfaces and SVMs -=================================================== - -The dataset used in this example is a preprocessed excerpt of the -"Labeled Faces in the Wild", aka LFW_: - - http://vis-www.cs.umass.edu/lfw/lfw-funneled.tgz (233MB) - -.. _LFW: http://vis-www.cs.umass.edu/lfw/ - -Expected results for the top 5 most represented people in the dataset:: - - precision recall f1-score support - - Gerhard_Schroeder 0.91 0.75 0.82 28 - Donald_Rumsfeld 0.84 0.82 0.83 33 - Tony_Blair 0.65 0.82 0.73 34 - Colin_Powell 0.78 0.88 0.83 58 - George_W_Bush 0.93 0.86 0.90 129 - - avg / total 0.86 0.84 0.85 282 - - - - - -**Python source code:** :download:`face_recognition.py ` - -.. literalinclude:: face_recognition.py - :lines: 28- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/plot_model_complexity_influence.txt b/0.15/_sources/auto_examples/applications/plot_model_complexity_influence.txt deleted file mode 100644 index c437a1861c406..0000000000000 --- a/0.15/_sources/auto_examples/applications/plot_model_complexity_influence.txt +++ /dev/null @@ -1,135 +0,0 @@ - - -.. _example_applications_plot_model_complexity_influence.py: - - -========================== -Model Complexity Influence -========================== - -Demonstrate how model complexity influences both prediction accuracy and -computational performance. - -The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for -regression (resp. classification). - -For each class of models we make the model complexity vary through the choice -of relevant model parameters and measure the influence on both computational -performance (latency) and predictive power (MSE or Hamming Loss). - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_model_complexity_influence_001.png - :scale: 47 - - * - - .. image:: images/plot_model_complexity_influence_002.png - :scale: 47 - - * - - .. image:: images/plot_model_complexity_influence_003.png - :scale: 47 - - -**Script output**:: - - Benchmarking SGDClassifier(alpha=0.001, class_weight=None, epsilon=0.1, eta0=0.0, - fit_intercept=True, l1_ratio=0.25, learning_rate='optimal', - loss='modified_huber', n_iter=5, n_jobs=1, penalty='elasticnet', - power_t=0.5, random_state=None, shuffle=False, verbose=0, - warm_start=False) - Complexity: 4538 | Hamming Loss (Misclassification Ratio): 0.2554 | Pred. Time: 0.027533s - - Benchmarking SGDClassifier(alpha=0.001, class_weight=None, epsilon=0.1, eta0=0.0, - fit_intercept=True, l1_ratio=0.5, learning_rate='optimal', - loss='modified_huber', n_iter=5, n_jobs=1, penalty='elasticnet', - power_t=0.5, random_state=None, shuffle=False, verbose=0, - warm_start=False) - Complexity: 1666 | Hamming Loss (Misclassification Ratio): 0.2920 | Pred. Time: 0.019870s - - Benchmarking SGDClassifier(alpha=0.001, class_weight=None, epsilon=0.1, eta0=0.0, - fit_intercept=True, l1_ratio=0.75, learning_rate='optimal', - loss='modified_huber', n_iter=5, n_jobs=1, penalty='elasticnet', - power_t=0.5, random_state=None, shuffle=False, verbose=0, - warm_start=False) - Complexity: 890 | Hamming Loss (Misclassification Ratio): 0.3175 | Pred. Time: 0.015984s - - Benchmarking SGDClassifier(alpha=0.001, class_weight=None, epsilon=0.1, eta0=0.0, - fit_intercept=True, l1_ratio=0.9, learning_rate='optimal', - loss='modified_huber', n_iter=5, n_jobs=1, penalty='elasticnet', - power_t=0.5, random_state=None, shuffle=False, verbose=0, - warm_start=False) - Complexity: 674 | Hamming Loss (Misclassification Ratio): 0.3334 | Pred. Time: 0.014499s - - Benchmarking NuSVR(C=1000.0, cache_size=200, coef0=0.0, degree=3, gamma=3.0517578125e-05, - kernel='rbf', max_iter=-1, nu=0.1, probability=False, random_state=None, - shrinking=True, tol=0.001, verbose=False) - Complexity: 69 | MSE: 31.8133 | Pred. Time: 0.000393s - - Benchmarking NuSVR(C=1000.0, cache_size=200, coef0=0.0, degree=3, gamma=3.0517578125e-05, - kernel='rbf', max_iter=-1, nu=0.25, probability=False, - random_state=None, shrinking=True, tol=0.001, verbose=False) - Complexity: 136 | MSE: 25.6140 | Pred. Time: 0.000726s - - Benchmarking NuSVR(C=1000.0, cache_size=200, coef0=0.0, degree=3, gamma=3.0517578125e-05, - kernel='rbf', max_iter=-1, nu=0.5, probability=False, random_state=None, - shrinking=True, tol=0.001, verbose=False) - Complexity: 243 | MSE: 22.3315 | Pred. Time: 0.001269s - - Benchmarking NuSVR(C=1000.0, cache_size=200, coef0=0.0, degree=3, gamma=3.0517578125e-05, - kernel='rbf', max_iter=-1, nu=0.75, probability=False, - random_state=None, shrinking=True, tol=0.001, verbose=False) - Complexity: 350 | MSE: 21.3679 | Pred. Time: 0.001808s - - Benchmarking NuSVR(C=1000.0, cache_size=200, coef0=0.0, degree=3, gamma=3.0517578125e-05, - kernel='rbf', max_iter=-1, nu=0.9, probability=False, random_state=None, - shrinking=True, tol=0.001, verbose=False) - Complexity: 404 | MSE: 21.0915 | Pred. Time: 0.002309s - - Benchmarking GradientBoostingRegressor(alpha=0.9, init=None, learning_rate=0.1, loss='ls', - max_depth=3, max_features=None, max_leaf_nodes=None, - min_samples_leaf=1, min_samples_split=2, n_estimators=10, - random_state=None, subsample=1.0, verbose=0, warm_start=False) - Complexity: 10 | MSE: 27.9672 | Pred. Time: 0.000061s - - Benchmarking GradientBoostingRegressor(alpha=0.9, init=None, learning_rate=0.1, loss='ls', - max_depth=3, max_features=None, max_leaf_nodes=None, - min_samples_leaf=1, min_samples_split=2, n_estimators=50, - random_state=None, subsample=1.0, verbose=0, warm_start=False) - Complexity: 50 | MSE: 8.0288 | Pred. Time: 0.000145s - - Benchmarking GradientBoostingRegressor(alpha=0.9, init=None, learning_rate=0.1, loss='ls', - max_depth=3, max_features=None, max_leaf_nodes=None, - min_samples_leaf=1, min_samples_split=2, n_estimators=100, - random_state=None, subsample=1.0, verbose=0, warm_start=False) - Complexity: 100 | MSE: 6.7578 | Pred. Time: 0.000241s - - Benchmarking GradientBoostingRegressor(alpha=0.9, init=None, learning_rate=0.1, loss='ls', - max_depth=3, max_features=None, max_leaf_nodes=None, - min_samples_leaf=1, min_samples_split=2, n_estimators=200, - random_state=None, subsample=1.0, verbose=0, warm_start=False) - Complexity: 200 | MSE: 5.8592 | Pred. Time: 0.000423s - - Benchmarking GradientBoostingRegressor(alpha=0.9, init=None, learning_rate=0.1, loss='ls', - max_depth=3, max_features=None, max_leaf_nodes=None, - min_samples_leaf=1, min_samples_split=2, n_estimators=500, - random_state=None, subsample=1.0, verbose=0, warm_start=False) - Complexity: 500 | MSE: 6.0492 | Pred. Time: 0.001017s - - - -**Python source code:** :download:`plot_model_complexity_influence.py ` - -.. literalinclude:: plot_model_complexity_influence.py - :lines: 16- - -**Total running time of the example:** 20.01 seconds -( 0 minutes 20.01 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/plot_out_of_core_classification.txt b/0.15/_sources/auto_examples/applications/plot_out_of_core_classification.txt deleted file mode 100644 index 387a39458faae..0000000000000 --- a/0.15/_sources/auto_examples/applications/plot_out_of_core_classification.txt +++ /dev/null @@ -1,108 +0,0 @@ - - -.. _example_applications_plot_out_of_core_classification.py: - - -====================================================== -Out-of-core classification of text documents -====================================================== - -This is an example showing how scikit-learn can be used for classification -using an out-of-core approach: learning from data that doesn't fit into main -memory. We make use of an online classifier, i.e., one that supports the -partial_fit method, that will be fed with batches of examples. To guarantee -that the features space remains the same over time we leverage a -HashingVectorizer that will project each example into the same feature space. -This is especially useful in the case of text classification where new -features (words) may appear in each batch. - -The dataset used in this example is Reuters-21578 as provided by the UCI ML -repository. It will be automatically downloaded and uncompressed on first run. - -The plot represents the learning curve of the classifier: the evolution -of classification accuracy over the course of the mini-batches. Accuracy is -measured on the first 1000 samples, held out as a validation set. - -To limit the memory consumption, we queue examples up to a fixed amount before -feeding them to the learner. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_out_of_core_classification_001.png - :scale: 47 - - * - - .. image:: images/plot_out_of_core_classification_002.png - :scale: 47 - - * - - .. image:: images/plot_out_of_core_classification_003.png - :scale: 47 - - * - - .. image:: images/plot_out_of_core_classification_004.png - :scale: 47 - - -**Script output**:: - - Test set is 469 documents (49 positive) - Passive-Aggressive classifier : 870 train docs ( 58 positive) 469 test docs ( 49 positive) accuracy: 0.932 in 1.48s ( 588 docs/s) - Perceptron classifier : 870 train docs ( 58 positive) 469 test docs ( 49 positive) accuracy: 0.906 in 1.48s ( 587 docs/s) - SGD classifier : 870 train docs ( 58 positive) 469 test docs ( 49 positive) accuracy: 0.932 in 1.48s ( 585 docs/s) - NB Multinomial classifier : 870 train docs ( 58 positive) 469 test docs ( 49 positive) accuracy: 0.896 in 1.51s ( 574 docs/s) - - - Passive-Aggressive classifier : 3643 train docs ( 461 positive) 469 test docs ( 49 positive) accuracy: 0.964 in 4.42s ( 824 docs/s) - Perceptron classifier : 3643 train docs ( 461 positive) 469 test docs ( 49 positive) accuracy: 0.951 in 4.42s ( 823 docs/s) - SGD classifier : 3643 train docs ( 461 positive) 469 test docs ( 49 positive) accuracy: 0.959 in 4.43s ( 823 docs/s) - NB Multinomial classifier : 3643 train docs ( 461 positive) 469 test docs ( 49 positive) accuracy: 0.908 in 4.45s ( 817 docs/s) - - - Passive-Aggressive classifier : 6571 train docs ( 829 positive) 469 test docs ( 49 positive) accuracy: 0.966 in 7.19s ( 913 docs/s) - Perceptron classifier : 6571 train docs ( 829 positive) 469 test docs ( 49 positive) accuracy: 0.951 in 7.19s ( 913 docs/s) - SGD classifier : 6571 train docs ( 829 positive) 469 test docs ( 49 positive) accuracy: 0.953 in 7.20s ( 912 docs/s) - NB Multinomial classifier : 6571 train docs ( 829 positive) 469 test docs ( 49 positive) accuracy: 0.915 in 7.23s ( 909 docs/s) - - - Passive-Aggressive classifier : 9481 train docs ( 1176 positive) 469 test docs ( 49 positive) accuracy: 0.955 in 10.11s ( 937 docs/s) - Perceptron classifier : 9481 train docs ( 1176 positive) 469 test docs ( 49 positive) accuracy: 0.938 in 10.12s ( 937 docs/s) - SGD classifier : 9481 train docs ( 1176 positive) 469 test docs ( 49 positive) accuracy: 0.940 in 10.12s ( 936 docs/s) - NB Multinomial classifier : 9481 train docs ( 1176 positive) 469 test docs ( 49 positive) accuracy: 0.928 in 10.15s ( 934 docs/s) - - - Passive-Aggressive classifier : 11856 train docs ( 1454 positive) 469 test docs ( 49 positive) accuracy: 0.962 in 12.76s ( 928 docs/s) - Perceptron classifier : 11856 train docs ( 1454 positive) 469 test docs ( 49 positive) accuracy: 0.934 in 12.77s ( 928 docs/s) - SGD classifier : 11856 train docs ( 1454 positive) 469 test docs ( 49 positive) accuracy: 0.966 in 12.77s ( 928 docs/s) - NB Multinomial classifier : 11856 train docs ( 1454 positive) 469 test docs ( 49 positive) accuracy: 0.930 in 12.80s ( 926 docs/s) - - - Passive-Aggressive classifier : 14769 train docs ( 1827 positive) 469 test docs ( 49 positive) accuracy: 0.957 in 15.61s ( 946 docs/s) - Perceptron classifier : 14769 train docs ( 1827 positive) 469 test docs ( 49 positive) accuracy: 0.945 in 15.61s ( 946 docs/s) - SGD classifier : 14769 train docs ( 1827 positive) 469 test docs ( 49 positive) accuracy: 0.951 in 15.61s ( 945 docs/s) - NB Multinomial classifier : 14769 train docs ( 1827 positive) 469 test docs ( 49 positive) accuracy: 0.945 in 15.64s ( 944 docs/s) - - - Passive-Aggressive classifier : 17700 train docs ( 2188 positive) 469 test docs ( 49 positive) accuracy: 0.962 in 19.14s ( 924 docs/s) - Perceptron classifier : 17700 train docs ( 2188 positive) 469 test docs ( 49 positive) accuracy: 0.951 in 19.14s ( 924 docs/s) - SGD classifier : 17700 train docs ( 2188 positive) 469 test docs ( 49 positive) accuracy: 0.964 in 19.14s ( 924 docs/s) - NB Multinomial classifier : 17700 train docs ( 2188 positive) 469 test docs ( 49 positive) accuracy: 0.947 in 19.19s ( 922 docs/s) - - - -**Python source code:** :download:`plot_out_of_core_classification.py ` - -.. literalinclude:: plot_out_of_core_classification.py - :lines: 25- - -**Total running time of the example:** 20.98 seconds -( 0 minutes 20.98 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/plot_outlier_detection_housing.txt b/0.15/_sources/auto_examples/applications/plot_outlier_detection_housing.txt deleted file mode 100644 index b080d6e868fe5..0000000000000 --- a/0.15/_sources/auto_examples/applications/plot_outlier_detection_housing.txt +++ /dev/null @@ -1,77 +0,0 @@ - - -.. _example_applications_plot_outlier_detection_housing.py: - - -==================================== -Outlier detection on a real data set -==================================== - -This example illustrates the need for robust covariance estimation -on a real data set. It is useful both for outlier detection and for -a better understanding of the data structure. - -We selected two sets of two variables from the boston housing data set -as an illustration of what kind of analysis can be done with several -outlier detection tools. For the purpose of visualization, we are working -with two-dimensional examples, but one should be aware that things are -not so trivial in high-dimension, as it will be pointed out. - -In both examples below, the main result is that the empirical covariance -estimate, as a non-robust one, is highly influenced by the heterogeneous -structure of the observations. Although the robust covariance estimate is -able to focus on the main mode of the data distribution, it sticks to the -assumption that the data should be Gaussian distributed, yielding some biased -estimation of the data structure, but yet accurate to some extent. -The One-Class SVM algorithm - -First example -------------- -The first example illustrates how robust covariance estimation can help -concentrating on a relevant cluster when another one exists. Here, many -observations are confounded into one and break down the empirical covariance -estimation. -Of course, some screening tools would have pointed out the presence of two -clusters (Support Vector Machines, Gaussian Mixture Models, univariate -outlier detection, ...). But had it been a high-dimensional example, none -of these could be applied that easily. - -Second example --------------- -The second example shows the ability of the Minimum Covariance Determinant -robust estimator of covariance to concentrate on the main mode of the data -distribution: the location seems to be well estimated, although the covariance -is hard to estimate due to the banana-shaped distribution. Anyway, we can -get rid of some outlying observations. -The One-Class SVM is able to capture the real data structure, but the -difficulty is to adjust its kernel bandwidth parameter so as to obtain -a good compromise between the shape of the data scatter matrix and the -risk of over-fitting the data. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_outlier_detection_housing_001.png - :scale: 47 - - * - - .. image:: images/plot_outlier_detection_housing_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_outlier_detection_housing.py ` - -.. literalinclude:: plot_outlier_detection_housing.py - :lines: 48- - -**Total running time of the example:** 4.38 seconds -( 0 minutes 4.38 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/plot_prediction_latency.txt b/0.15/_sources/auto_examples/applications/plot_prediction_latency.txt deleted file mode 100644 index f9115f7aa610c..0000000000000 --- a/0.15/_sources/auto_examples/applications/plot_prediction_latency.txt +++ /dev/null @@ -1,155 +0,0 @@ - - -.. _example_applications_plot_prediction_latency.py: - - -================== -Prediction Latency -================== - -This is an example showing the prediction latency of various scikit-learn -estimators. - -The goal is to measure the latency one can expect when doing predictions -either in bulk or atomic (i.e. one by one) mode. - -The plots represent the distribution of the prediction latency as a boxplot. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_prediction_latency_001.png - :scale: 47 - - * - - .. image:: images/plot_prediction_latency_002.png - :scale: 47 - - * - - .. image:: images/plot_prediction_latency_003.png - :scale: 47 - - * - - .. image:: images/plot_prediction_latency_004.png - :scale: 47 - - -**Script output**:: - - Benchmarking SGDRegressor(alpha=0.01, epsilon=0.1, eta0=0.01, fit_intercept=True, - l1_ratio=0.25, learning_rate='invscaling', loss='squared_loss', - n_iter=5, penalty='elasticnet', power_t=0.25, random_state=None, - shuffle=False, verbose=0, warm_start=False) - Benchmarking RandomForestRegressor(bootstrap=True, compute_importances=None, - criterion='mse', max_depth=None, max_features='auto', - max_leaf_nodes=None, min_density=None, min_samples_leaf=1, - min_samples_split=2, n_estimators=10, n_jobs=1, oob_score=False, - random_state=None, verbose=0) - Benchmarking SVR(C=1.0, cache_size=200, coef0=0.0, degree=3, epsilon=0.1, gamma=0.0, - kernel='rbf', max_iter=-1, probability=False, random_state=None, - shrinking=True, tol=0.001, verbose=False) - agg_filter: unknown - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - axes: an :class:`~matplotlib.axes.Axes` instance - backgroundcolor: any matplotlib color - bbox: rectangle prop dict - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color: any matplotlib color - contains: a callable function - family or fontfamily or fontname or name: [FONTNAME | 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ] - figure: a :class:`matplotlib.figure.Figure` instance - fontproperties or font_properties: a :class:`matplotlib.font_manager.FontProperties` instance - gid: an id string - horizontalalignment or ha: [ 'center' | 'right' | 'left' ] - label: string or anything printable with '%s' conversion. - linespacing: float (multiple of font size) - lod: [True | False] - multialignment: ['left' | 'right' | 'center' ] - path_effects: unknown - picker: [None|float|boolean|callable] - position: (x,y) - rasterized: [True | False | None] - rotation: [ angle in degrees | 'vertical' | 'horizontal' ] - rotation_mode: unknown - size or fontsize: [size in points | 'xx-small' | 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large' ] - sketch_params: unknown - snap: unknown - stretch or fontstretch: [a numeric value in range 0-1000 | 'ultra-condensed' | 'extra-condensed' | 'condensed' | 'semi-condensed' | 'normal' | 'semi-expanded' | 'expanded' | 'extra-expanded' | 'ultra-expanded' ] - style or fontstyle: [ 'normal' | 'italic' | 'oblique'] - text: string or anything printable with '%s' conversion. - transform: :class:`~matplotlib.transforms.Transform` instance - url: a url string - variant or fontvariant: [ 'normal' | 'small-caps' ] - verticalalignment or va or ma: [ 'center' | 'top' | 'bottom' | 'baseline' ] - visible: [True | False] - weight or fontweight: [a numeric value in range 0-1000 | 'ultralight' | 'light' | 'normal' | 'regular' | 'book' | 'medium' | 'roman' | 'semibold' | 'demibold' | 'demi' | 'bold' | 'heavy' | 'extra bold' | 'black' ] - x: float - y: float - zorder: any number - agg_filter: unknown - alpha: float (0.0 transparent through 1.0 opaque) - animated: [True | False] - axes: an :class:`~matplotlib.axes.Axes` instance - backgroundcolor: any matplotlib color - bbox: rectangle prop dict - clip_box: a :class:`matplotlib.transforms.Bbox` instance - clip_on: [True | False] - clip_path: [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ] - color: any matplotlib color - contains: a callable function - family or fontfamily or fontname or name: [FONTNAME | 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ] - figure: a :class:`matplotlib.figure.Figure` instance - fontproperties or font_properties: a :class:`matplotlib.font_manager.FontProperties` instance - gid: an id string - horizontalalignment or ha: [ 'center' | 'right' | 'left' ] - label: string or anything printable with '%s' conversion. - linespacing: float (multiple of font size) - lod: [True | False] - multialignment: ['left' | 'right' | 'center' ] - path_effects: unknown - picker: [None|float|boolean|callable] - position: (x,y) - rasterized: [True | False | None] - rotation: [ angle in degrees | 'vertical' | 'horizontal' ] - rotation_mode: unknown - size or fontsize: [size in points | 'xx-small' | 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large' ] - sketch_params: unknown - snap: unknown - stretch or fontstretch: [a numeric value in range 0-1000 | 'ultra-condensed' | 'extra-condensed' | 'condensed' | 'semi-condensed' | 'normal' | 'semi-expanded' | 'expanded' | 'extra-expanded' | 'ultra-expanded' ] - style or fontstyle: [ 'normal' | 'italic' | 'oblique'] - text: string or anything printable with '%s' conversion. - transform: :class:`~matplotlib.transforms.Transform` instance - url: a url string - variant or fontvariant: [ 'normal' | 'small-caps' ] - verticalalignment or va or ma: [ 'center' | 'top' | 'bottom' | 'baseline' ] - visible: [True | False] - weight or fontweight: [a numeric value in range 0-1000 | 'ultralight' | 'light' | 'normal' | 'regular' | 'book' | 'medium' | 'roman' | 'semibold' | 'demibold' | 'demi' | 'bold' | 'heavy' | 'extra bold' | 'black' ] - x: float - y: float - zorder: any number - benchmarking with 100 features - benchmarking with 250 features - benchmarking with 500 features - example run in 4.42s - - - -**Python source code:** :download:`plot_prediction_latency.py ` - -.. literalinclude:: plot_prediction_latency.py - :lines: 15- - -**Total running time of the example:** 4.50 seconds -( 0 minutes 4.50 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/plot_species_distribution_modeling.txt b/0.15/_sources/auto_examples/applications/plot_species_distribution_modeling.txt deleted file mode 100644 index 2879c43a611bc..0000000000000 --- a/0.15/_sources/auto_examples/applications/plot_species_distribution_modeling.txt +++ /dev/null @@ -1,76 +0,0 @@ - - -.. _example_applications_plot_species_distribution_modeling.py: - - -============================= -Species distribution modeling -============================= - -Modeling species' geographic distributions is an important -problem in conservation biology. In this example we -model the geographic distribution of two south american -mammals given past observations and 14 environmental -variables. Since we have only positive examples (there are -no unsuccessful observations), we cast this problem as a -density estimation problem and use the `OneClassSVM` provided -by the package `sklearn.svm` as our modeling tool. -The dataset is provided by Phillips et. al. (2006). -If available, the example uses -`basemap `_ -to plot the coast lines and national boundaries of South America. - -The two species are: - - - `"Bradypus variegatus" - `_ , - the Brown-throated Sloth. - - - `"Microryzomys minutus" - `_ , - also known as the Forest Small Rice Rat, a rodent that lives in Peru, - Colombia, Ecuador, Peru, and Venezuela. - -References ----------- - - * `"Maximum entropy modeling of species geographic distributions" - `_ - S. J. Phillips, R. P. Anderson, R. E. Schapire - Ecological Modelling, - 190:231-259, 2006. - - - -.. image:: images/plot_species_distribution_modeling_001.png - :align: center - - -**Script output**:: - - ________________________________________________________________________________ - Modeling distribution of species 'bradypus variegatus' - - fit OneClassSVM ... done. - - plot coastlines from coverage - - predict species distribution - - Area under the ROC curve : 0.865253 - ________________________________________________________________________________ - Modeling distribution of species 'microryzomys minutus' - - fit OneClassSVM ... done. - - plot coastlines from coverage - - predict species distribution - - Area under the ROC curve : 0.993919 - - time elapsed: 6.30s - - - -**Python source code:** :download:`plot_species_distribution_modeling.py ` - -.. literalinclude:: plot_species_distribution_modeling.py - :lines: 38- - -**Total running time of the example:** 6.37 seconds -( 0 minutes 6.37 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/plot_stock_market.txt b/0.15/_sources/auto_examples/applications/plot_stock_market.txt deleted file mode 100644 index 72ccd9b999a2f..0000000000000 --- a/0.15/_sources/auto_examples/applications/plot_stock_market.txt +++ /dev/null @@ -1,96 +0,0 @@ - - -.. _example_applications_plot_stock_market.py: - - -======================================= -Visualizing the stock market structure -======================================= - -This example employs several unsupervised learning techniques to extract -the stock market structure from variations in historical quotes. - -The quantity that we use is the daily variation in quote price: quotes -that are linked tend to cofluctuate during a day. - -.. _stock_market: - -Learning a graph structure --------------------------- - -We use sparse inverse covariance estimation to find which quotes are -correlated conditionally on the others. Specifically, sparse inverse -covariance gives us a graph, that is a list of connection. For each -symbol, the symbols that it is connected too are those useful to explain -its fluctuations. - -Clustering ----------- - -We use clustering to group together quotes that behave similarly. Here, -amongst the :ref:`various clustering techniques ` available -in the scikit-learn, we use :ref:`affinity_propagation` as it does -not enforce equal-size clusters, and it can choose automatically the -number of clusters from the data. - -Note that this gives us a different indication than the graph, as the -graph reflects conditional relations between variables, while the -clustering reflects marginal properties: variables clustered together can -be considered as having a similar impact at the level of the full stock -market. - -Embedding in 2D space ---------------------- - -For visualization purposes, we need to lay out the different symbols on a -2D canvas. For this we use :ref:`manifold` techniques to retrieve 2D -embedding. - - -Visualization -------------- - -The output of the 3 models are combined in a 2D graph where nodes -represents the stocks and edges the: - -- cluster labels are used to define the color of the nodes -- the sparse covariance model is used to display the strength of the edges -- the 2D embedding is used to position the nodes in the plan - -This example has a fair amount of visualization-related code, as -visualization is crucial here to display the graph. One of the challenge -is to position the labels minimizing overlap. For this we use an -heuristic based on the direction of the nearest neighbor along each -axis. - - - -.. image:: images/plot_stock_market_001.png - :align: center - - -**Script output**:: - - Cluster 1: Pepsi, Coca Cola, Kellogg - Cluster 2: Apple, Amazon, Yahoo - Cluster 3: GlaxoSmithKline, Novartis, Sanofi-Aventis - Cluster 4: Comcast, Time Warner, Cablevision - Cluster 5: ConocoPhillips, Chevron, Total, Valero Energy, Exxon - Cluster 6: Walgreen, CVS - Cluster 7: Navistar, Sony, Marriott, Caterpillar, Canon, Toyota, Honda, Mitsubishi, Xerox, Unilever - Cluster 8: Kimberly-Clark, Colgate-Palmolive, Procter Gamble - Cluster 9: American express, Ryder, Goldman Sachs, Wal-Mart, General Electrics, Pfizer, Wells Fargo, DuPont de Nemours, Bank of America, AIG, Home Depot, Ford, JPMorgan Chase, Mc Donalds - Cluster 10: Microsoft, SAP, 3M, IBM, Texas instruments, HP, Dell, Cisco - Cluster 11: Raytheon, Boeing, Lookheed Martin, General Dynamics, Northrop Grumman - Cluster 12: Kraft Foods - - - -**Python source code:** :download:`plot_stock_market.py ` - -.. literalinclude:: plot_stock_market.py - :lines: 62- - -**Total running time of the example:** 3.31 seconds -( 0 minutes 3.31 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/plot_tomography_l1_reconstruction.txt b/0.15/_sources/auto_examples/applications/plot_tomography_l1_reconstruction.txt deleted file mode 100644 index 1021789b1817d..0000000000000 --- a/0.15/_sources/auto_examples/applications/plot_tomography_l1_reconstruction.txt +++ /dev/null @@ -1,56 +0,0 @@ - - -.. _example_applications_plot_tomography_l1_reconstruction.py: - - -====================================================================== -Compressive sensing: tomography reconstruction with L1 prior (Lasso) -====================================================================== - -This example shows the reconstruction of an image from a set of parallel -projections, acquired along different angles. Such a dataset is acquired in -**computed tomography** (CT). - -Without any prior information on the sample, the number of projections -required to reconstruct the image is of the order of the linear size -``l`` of the image (in pixels). For simplicity we consider here a sparse -image, where only pixels on the boundary of objects have a non-zero -value. Such data could correspond for example to a cellular material. -Note however that most images are sparse in a different basis, such as -the Haar wavelets. Only ``l/7`` projections are acquired, therefore it is -necessary to use prior information available on the sample (its -sparsity): this is an example of **compressive sensing**. - -The tomography projection operation is a linear transformation. In -addition to the data-fidelity term corresponding to a linear regression, -we penalize the L1 norm of the image to account for its sparsity. The -resulting optimization problem is called the :ref:`lasso`. We use the -class :class:`sklearn.linear_model.Lasso`, that uses the coordinate descent -algorithm. Importantly, this implementation is more computationally efficient -on a sparse matrix, than the projection operator used here. - -The reconstruction with L1 penalization gives a result with zero error -(all pixels are successfully labeled with 0 or 1), even if noise was -added to the projections. In comparison, an L2 penalization -(:class:`sklearn.linear_model.Ridge`) produces a large number of labeling -errors for the pixels. Important artifacts are observed on the -reconstructed image, contrary to the L1 penalization. Note in particular -the circular artifact separating the pixels in the corners, that have -contributed to fewer projections than the central disk. - - - -.. image:: images/plot_tomography_l1_reconstruction_001.png - :align: center - - - - -**Python source code:** :download:`plot_tomography_l1_reconstruction.py ` - -.. literalinclude:: plot_tomography_l1_reconstruction.py - :lines: 37- - -**Total running time of the example:** 9.50 seconds -( 0 minutes 9.50 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/svm_gui.txt b/0.15/_sources/auto_examples/applications/svm_gui.txt deleted file mode 100644 index ace07cc0cce0f..0000000000000 --- a/0.15/_sources/auto_examples/applications/svm_gui.txt +++ /dev/null @@ -1,25 +0,0 @@ - - -.. _example_applications_svm_gui.py: - - -========== -Libsvm GUI -========== - -A simple graphical frontend for Libsvm mainly intended for didactic -purposes. You can create data points by point and click and visualize -the decision region induced by different kernels and parameter settings. - -To create positive examples click the left mouse button; to create -negative examples click the right button. - -If all examples are from the same class, it uses a one-class SVM. - - - -**Python source code:** :download:`svm_gui.py ` - -.. literalinclude:: svm_gui.py - :lines: 16- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/topics_extraction_with_nmf.txt b/0.15/_sources/auto_examples/applications/topics_extraction_with_nmf.txt deleted file mode 100644 index 857e6d445294c..0000000000000 --- a/0.15/_sources/auto_examples/applications/topics_extraction_with_nmf.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -.. _example_applications_topics_extraction_with_nmf.py: - - -======================================================== -Topics extraction with Non-Negative Matrix Factorization -======================================================== - -This is a proof of concept application of Non Negative Matrix -Factorization of the term frequency matrix of a corpus of documents so -as to extract an additive model of the topic structure of the corpus. -The output is a list of topics, each represented as a list of terms -(weights are not shown). - -The default parameters (n_samples / n_features / n_topics) should make -the example runnable in a couple of tens of seconds. You can try to -increase the dimensions of the problem, but be aware than the time complexity -is polynomial. - - - -**Python source code:** :download:`topics_extraction_with_nmf.py ` - -.. literalinclude:: topics_extraction_with_nmf.py - :lines: 18- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/applications/wikipedia_principal_eigenvector.txt b/0.15/_sources/auto_examples/applications/wikipedia_principal_eigenvector.txt deleted file mode 100644 index 4772eb3b0a794..0000000000000 --- a/0.15/_sources/auto_examples/applications/wikipedia_principal_eigenvector.txt +++ /dev/null @@ -1,40 +0,0 @@ - - -.. _example_applications_wikipedia_principal_eigenvector.py: - - -=============================== -Wikipedia principal eigenvector -=============================== - -A classical way to assert the relative importance of vertices in a -graph is to compute the principal eigenvector of the adjacency matrix -so as to assign to each vertex the values of the components of the first -eigenvector as a centrality score: - - http://en.wikipedia.org/wiki/Eigenvector_centrality - -On the graph of webpages and links those values are called the PageRank -scores by Google. - -The goal of this example is to analyze the graph of links inside -wikipedia articles to rank articles by relative importance according to -this eigenvector centrality. - -The traditional way to compute the principal eigenvector is to use the -power iteration method: - - http://en.wikipedia.org/wiki/Power_iteration - -Here the computation is achieved thanks to Martinsson's Randomized SVD -algorithm implemented in the scikit. - -The graph data is fetched from the DBpedia dumps. DBpedia is an extraction -of the latent structured data of the Wikipedia content. - - -**Python source code:** :download:`wikipedia_principal_eigenvector.py ` - -.. literalinclude:: wikipedia_principal_eigenvector.py - :lines: 31- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/bicluster/bicluster_newsgroups.txt b/0.15/_sources/auto_examples/bicluster/bicluster_newsgroups.txt deleted file mode 100644 index 935d86bd23525..0000000000000 --- a/0.15/_sources/auto_examples/bicluster/bicluster_newsgroups.txt +++ /dev/null @@ -1,64 +0,0 @@ - - -.. _example_bicluster_bicluster_newsgroups.py: - - -================================================================ -Biclustering documents with the Spectral Co-clustering algorithm -================================================================ - -This example demonstrates the Spectral Co-clustering algorithm on the -twenty newsgroups dataset. The 'comp.os.ms-windows.misc' category is -excluded because it contains many posts containing nothing but data. - -The TF-IDF vectorized posts form a word frequency matrix, which is -then biclustered using Dhillon's Spectral Co-Clustering algorithm. The -resulting document-word biclusters indicate subsets words used more -often in those subsets documents. - -For a few of the best biclusters, its most common document categories -and its ten most important words get printed. The best biclusters are -determined by their normalized cut. The best words are determined by -comparing their sums inside and outside the bicluster. - -For comparison, the documents are also clustered using -MiniBatchKMeans. The document clusters derived from the biclusters -achieve a better V-measure than clusters found by MiniBatchKMeans. - -Output:: - - Vectorizing... - Coclustering... - Done in 9.53s. V-measure: 0.4455 - MiniBatchKMeans... - Done in 12.00s. V-measure: 0.3309 - - Best biclusters: - ---------------- - bicluster 0 : 1951 documents, 4373 words - categories : 23% talk.politics.guns, 19% talk.politics.misc, 14% sci.med - words : gun, guns, geb, banks, firearms, drugs, gordon, clinton, cdt, amendment - - bicluster 1 : 1165 documents, 3304 words - categories : 29% talk.politics.mideast, 26% soc.religion.christian, 25% alt.atheism - words : god, jesus, christians, atheists, kent, sin, morality, belief, resurrection, marriage - - bicluster 2 : 2219 documents, 2830 words - categories : 18% comp.sys.mac.hardware, 16% comp.sys.ibm.pc.hardware, 16% comp.graphics - words : voltage, dsp, board, receiver, circuit, shipping, packages, stereo, compression, package - - bicluster 3 : 1860 documents, 2745 words - categories : 26% rec.motorcycles, 23% rec.autos, 13% misc.forsale - words : bike, car, dod, engine, motorcycle, ride, honda, cars, bmw, bikes - - bicluster 4 : 12 documents, 155 words - categories : 100% rec.sport.hockey - words : scorer, unassisted, reichel, semak, sweeney, kovalenko, ricci, audette, momesso, nedved - - - -**Python source code:** :download:`bicluster_newsgroups.py ` - -.. literalinclude:: bicluster_newsgroups.py - :lines: 55- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/bicluster/plot_spectral_biclustering.txt b/0.15/_sources/auto_examples/bicluster/plot_spectral_biclustering.txt deleted file mode 100644 index fcbcb940cb2fd..0000000000000 --- a/0.15/_sources/auto_examples/bicluster/plot_spectral_biclustering.txt +++ /dev/null @@ -1,61 +0,0 @@ - - -.. _example_bicluster_plot_spectral_biclustering.py: - - -============================================= -A demo of the Spectral Biclustering algorithm -============================================= - -This example demonstrates how to generate a checkerboard dataset and -bicluster it using the Spectral Biclustering algorithm. - -The data is generated with the ``make_checkerboard`` function, then -shuffled and passed to the Spectral Biclustering algorithm. The rows -and columns of the shuffled matrix are rearranged to show the -biclusters found by the algorithm. - -The outer product of the row and column label vectors shows a -representation of the checkerboard structure. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_spectral_biclustering_001.png - :scale: 47 - - * - - .. image:: images/plot_spectral_biclustering_002.png - :scale: 47 - - * - - .. image:: images/plot_spectral_biclustering_003.png - :scale: 47 - - * - - .. image:: images/plot_spectral_biclustering_004.png - :scale: 47 - - -**Script output**:: - - consensus score: 1.0 - - - -**Python source code:** :download:`plot_spectral_biclustering.py ` - -.. literalinclude:: plot_spectral_biclustering.py - :lines: 18- - -**Total running time of the example:** 0.54 seconds -( 0 minutes 0.54 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/bicluster/plot_spectral_coclustering.txt b/0.15/_sources/auto_examples/bicluster/plot_spectral_coclustering.txt deleted file mode 100644 index 440148a43ea74..0000000000000 --- a/0.15/_sources/auto_examples/bicluster/plot_spectral_coclustering.txt +++ /dev/null @@ -1,55 +0,0 @@ - - -.. _example_bicluster_plot_spectral_coclustering.py: - - -============================================== -A demo of the Spectral Co-Clustering algorithm -============================================== - -This example demonstrates how to generate a dataset and bicluster it -using the the Spectral Co-Clustering algorithm. - -The dataset is generated using the ``make_biclusters`` function, which -creates a matrix of small values and implants bicluster with large -values. The rows and columns are then shuffled and passed to the -Spectral Co-Clustering algorithm. Rearranging the shuffled matrix to -make biclusters contiguous shows how accurately the algorithm found -the biclusters. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_spectral_coclustering_001.png - :scale: 47 - - * - - .. image:: images/plot_spectral_coclustering_002.png - :scale: 47 - - * - - .. image:: images/plot_spectral_coclustering_003.png - :scale: 47 - - -**Script output**:: - - consensus score: 1.000 - - - -**Python source code:** :download:`plot_spectral_coclustering.py ` - -.. literalinclude:: plot_spectral_coclustering.py - :lines: 17- - -**Total running time of the example:** 0.19 seconds -( 0 minutes 0.19 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/calibration/plot_calibration.txt b/0.15/_sources/auto_examples/calibration/plot_calibration.txt deleted file mode 100644 index 47342a30ab26d..0000000000000 --- a/0.15/_sources/auto_examples/calibration/plot_calibration.txt +++ /dev/null @@ -1,59 +0,0 @@ - - -.. _example_calibration_plot_calibration.py: - - -====================================== -Probability calibration of classifiers -====================================== - -When performing classification you often want to predict not only -the class label, but also the associated probability. This probability -gives you some kind of confidence on the prediction. However, not all -classifiers provide well-calibrated probabilities, some being over-confident -while others being under-confident. Thus, a separate calibration of predicted -probabilities is often desirable as a postprocessing. This example illustrates -two different methods for this calibration and evaluates the quality of the -returned probabilities using Brier's score -(see http://en.wikipedia.org/wiki/Brier_score). - -Compared are the estimated probability using a Gaussian naive Bayes classifier -without calibration, with a sigmoid calibration, and with a non-parametric -isotonic calibration. One can observe that only the non-parametric model is able -to provide a probability calibration that returns probabilities close to the -expected 0.5 for most of the samples belonging to the middle cluster with -heterogeneous labels. This results in a significantly improved Brier score. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_calibration_001.png - :scale: 47 - - * - - .. image:: images/plot_calibration_002.png - :scale: 47 - - -**Script output**:: - - Brier scores: (the smaller the better) - No calibration: 0.104 - With isotonic calibration: 0.084 - With sigmoid calibration: 0.109 - - - -**Python source code:** :download:`plot_calibration.py ` - -.. literalinclude:: plot_calibration.py - :lines: 23- - -**Total running time of the example:** 0.40 seconds -( 0 minutes 0.40 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/calibration/plot_calibration_curve.txt b/0.15/_sources/auto_examples/calibration/plot_calibration_curve.txt deleted file mode 100644 index c9605d20197cc..0000000000000 --- a/0.15/_sources/auto_examples/calibration/plot_calibration_curve.txt +++ /dev/null @@ -1,123 +0,0 @@ - - -.. _example_calibration_plot_calibration_curve.py: - - -============================== -Probability Calibration curves -============================== - -When performing classification one often wants to predict not only the class -label, but also the associated probability. This probability gives some -kind of confidence on the prediction. This example demonstrates how to display -how well calibrated the predicted probabilities are and how to calibrate an -uncalibrated classifier. - -The experiment is performed on an artificial dataset for binary classification -with 100.000 samples (1.000 of them are used for model fitting) with 20 -features. Of the 20 features, only 2 are informative and 10 are redundant. The -first figure shows the estimated probabilities obtained with logistic -regression, Gaussian naive Bayes, and Gaussian naive Bayes with both isotonic -calibration and sigmoid calibration. The calibration performance is evaluated -with Brier score, reported in the legend (the smaller the better). One can -observe here that logistic regression is well calibrated while raw Gaussian -naive Bayes performs very badly. This is because of the redundant features -which violate the assumption of feature-independence and result in an overly -confident classifier, which is indicated by the typical transposed-sigmoid -curve. - -Calibration of the probabilities of Gaussian naive Bayes with isotonic -regression can fix this issue as can be seen from the nearly diagonal -calibration curve. Sigmoid calibration also improves the brier score slightly, -albeit not as strongly as the non-parametric isotonic regression. This can be -attributed to the fact that we have plenty of calibration data such that the -greater flexibility of the non-parametric model can be exploited. - -The second figure shows the calibration curve of a linear support-vector -classifier (LinearSVC). LinearSVC shows the opposite behavior as Gaussian -naive Bayes: the calibration curve has a sigmoid curve, which is typical for -an under-confident classifier. In the case of LinearSVC, this is caused by the -margin property of the hinge loss, which lets the model focus on hard samples -that are close to the decision boundary (the support vectors). - -Both kinds of calibration can fix this issue and yield nearly identical -results. This shows that sigmoid calibration can deal with situations where -the calibration curve of the base classifier is sigmoid (e.g., for LinearSVC) -but not where it is transposed-sigmoid (e.g., Gaussian naive Bayes). - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_calibration_curve_001.png - :scale: 47 - - * - - .. image:: images/plot_calibration_curve_002.png - :scale: 47 - - -**Script output**:: - - Logistic: - Brier: 0.099 - Precision: 0.872 - Recall: 0.851 - F1: 0.862 - - Naive Bayes: - Brier: 0.118 - Precision: 0.857 - Recall: 0.876 - F1: 0.867 - - Naive Bayes + Isotonic: - Brier: 0.098 - Precision: 0.883 - Recall: 0.836 - F1: 0.859 - - Naive Bayes + Sigmoid: - Brier: 0.109 - Precision: 0.861 - Recall: 0.871 - F1: 0.866 - - Logistic: - Brier: 0.099 - Precision: 0.872 - Recall: 0.851 - F1: 0.862 - - SVC: - Brier: 0.163 - Precision: 0.872 - Recall: 0.852 - F1: 0.862 - - SVC + Isotonic: - Brier: 0.100 - Precision: 0.853 - Recall: 0.878 - F1: 0.865 - - SVC + Sigmoid: - Brier: 0.099 - Precision: 0.874 - Recall: 0.849 - F1: 0.861 - - - -**Python source code:** :download:`plot_calibration_curve.py ` - -.. literalinclude:: plot_calibration_curve.py - :lines: 44- - -**Total running time of the example:** 2.28 seconds -( 0 minutes 2.28 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/calibration/plot_calibration_multiclass.txt b/0.15/_sources/auto_examples/calibration/plot_calibration_multiclass.txt deleted file mode 100644 index ba595a5942e30..0000000000000 --- a/0.15/_sources/auto_examples/calibration/plot_calibration_multiclass.txt +++ /dev/null @@ -1,59 +0,0 @@ - - -.. _example_calibration_plot_calibration_multiclass.py: - - -================================================== -Probability Calibration for 3-class classification -================================================== - -This example illustrates how sigmoid calibration changes predicted -probabilities for a 3-class classification problem. Illustrated is the -standard 2-simplex, where the three corners correspond to the three classes. -Arrows point from the probability vectors predicted by an uncalibrated -classifier to the probability vectors predicted by the same classifier after -sigmoid calibration on a hold-out validation set. Colors indicate the true -class of an instance (red: class 1, green: class 2, blue: class 3). - -The base classifier is a random forest classifier with 25 base estimators -(trees). If this classifier is trained on all 800 training datapoints, it is -overly confident in its predictions and thus incurs a large log-loss. -Calibrating an identical classifier, which was trained on 600 datapoints, with -method='sigmoid' on the remaining 200 datapoints reduces the confidence of the -predictions, i.e., moves the probability vectors from the edges of the simplex -towards the center. This calibration results in a lower log-loss. Note that an -alternative would have been to increase the number of base estimators which -would have resulted in a similar decrease in log-loss. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_calibration_multiclass_000.png - :scale: 47 - - * - - .. image:: images/plot_calibration_multiclass_001.png - :scale: 47 - - -**Script output**:: - - Log-loss of - * uncalibrated classifier trained on 800 datapoints: 1.280 - * classifier trained on 600 datapoints and calibrated on 200 datapoint: 0.536 - - - -**Python source code:** :download:`plot_calibration_multiclass.py ` - -.. literalinclude:: plot_calibration_multiclass.py - :lines: 24- - -**Total running time of the example:** 0.44 seconds -( 0 minutes 0.44 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/calibration/plot_compare_calibration.txt b/0.15/_sources/auto_examples/calibration/plot_compare_calibration.txt deleted file mode 100644 index f047a89eaf56d..0000000000000 --- a/0.15/_sources/auto_examples/calibration/plot_compare_calibration.txt +++ /dev/null @@ -1,69 +0,0 @@ - - -.. _example_calibration_plot_compare_calibration.py: - - -======================================== -Comparison of Calibration of Classifiers -======================================== - -Well calibrated classifiers are probabilistic classifiers for which the output -of the predict_proba method can be directly interpreted as a confidence level. -For instance a well calibrated (binary) classifier should classify the samples -such that among the samples to which it gave a predict_proba value close to -0.8, approx. 80% actually belong to the positive class. - -LogisticRegression returns well calibrated predictions as it directly -optimizes log-loss. In contrast, the other methods return biased probilities, -with different biases per method: - -* GaussianNaiveBayes tends to push probabilties to 0 or 1 (note the counts in - the histograms). This is mainly because it makes the assumption that features - are conditionally independent given the class, which is not the case in this - dataset which contains 2 redundant features. - -* RandomForestClassifier shows the opposite behavior: the histograms show - peaks at approx. 0.2 and 0.9 probability, while probabilities close to 0 or 1 - are very rare. An explanation for this is given by Niculescu-Mizil and Caruana - [1]: "Methods such as bagging and random forests that average predictions from - a base set of models can have difficulty making predictions near 0 and 1 - because variance in the underlying base models will bias predictions that - should be near zero or one away from these values. Because predictions are - restricted to the interval [0,1], errors caused by variance tend to be one- - sided near zero and one. For example, if a model should predict p = 0 for a - case, the only way bagging can achieve this is if all bagged trees predict - zero. If we add noise to the trees that bagging is averaging over, this noise - will cause some trees to predict values larger than 0 for this case, thus - moving the average prediction of the bagged ensemble away from 0. We observe - this effect most strongly with random forests because the base-level trees - trained with random forests have relatively high variance due to feature - subseting." As a result, the calibration curve shows a characteristic sigmoid - shape, indicating that the classifier could trust its "intuition" more and - return probabilties closer to 0 or 1 typically. - -* Support Vector Classification (SVC) shows an even more sigmoid curve as - the RandomForestClassifier, which is typical for maximum-margin methods - (compare Niculescu-Mizil and Caruana [1]), which focus on hard samples - that are close to the decision boundary (the support vectors). - -.. topic:: References: - - .. [1] Predicting Good Probabilities with Supervised Learning, - A. Niculescu-Mizil & R. Caruana, ICML 2005 - - - -.. image:: images/plot_compare_calibration_001.png - :align: center - - - - -**Python source code:** :download:`plot_compare_calibration.py ` - -.. literalinclude:: plot_compare_calibration.py - :lines: 50- - -**Total running time of the example:** 1.27 seconds -( 0 minutes 1.27 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/classification/plot_classification_probability.txt b/0.15/_sources/auto_examples/classification/plot_classification_probability.txt deleted file mode 100644 index d7fb7f432dc91..0000000000000 --- a/0.15/_sources/auto_examples/classification/plot_classification_probability.txt +++ /dev/null @@ -1,40 +0,0 @@ - - -.. _example_classification_plot_classification_probability.py: - - -=============================== -Plot classification probability -=============================== - -Plot the classification probability for different classifiers. We use a 3 -class dataset, and we classify it with a Support Vector classifier, L1 -and L2 penalized logistic regression with either a One-Vs-Rest or multinomial -setting. - -The logistic regression is not a multiclass classifier out of the box. As -a result it can identify only the first class. - - - -.. image:: images/plot_classification_probability_001.png - :align: center - - -**Script output**:: - - classif_rate for L2 logistic (OvR) : 76.666667 - classif_rate for L1 logistic : 79.333333 - classif_rate for Linear SVC : 82.000000 - classif_rate for L2 logistic (Multinomial) : 82.000000 - - - -**Python source code:** :download:`plot_classification_probability.py ` - -.. literalinclude:: plot_classification_probability.py - :lines: 14- - -**Total running time of the example:** 0.61 seconds -( 0 minutes 0.61 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/classification/plot_classifier_comparison.txt b/0.15/_sources/auto_examples/classification/plot_classifier_comparison.txt deleted file mode 100644 index 9ab8325d3da1c..0000000000000 --- a/0.15/_sources/auto_examples/classification/plot_classifier_comparison.txt +++ /dev/null @@ -1,39 +0,0 @@ - - -.. _example_classification_plot_classifier_comparison.py: - - -===================== -Classifier comparison -===================== - -A comparison of a several classifiers in scikit-learn on synthetic datasets. -The point of this example is to illustrate the nature of decision boundaries -of different classifiers. -This should be taken with a grain of salt, as the intuition conveyed by -these examples does not necessarily carry over to real datasets. - -Particularly in high-dimensional spaces, data can more easily be separated -linearly and the simplicity of classifiers such as naive Bayes and linear SVMs -might lead to better generalization than is achieved by other classifiers. - -The plots show training points in solid colors and testing points -semi-transparent. The lower right shows the classification accuracy on the test -set. - - - -.. image:: images/plot_classifier_comparison_001.png - :align: center - - - - -**Python source code:** :download:`plot_classifier_comparison.py ` - -.. literalinclude:: plot_classifier_comparison.py - :lines: 23- - -**Total running time of the example:** 4.21 seconds -( 0 minutes 4.21 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/classification/plot_digits_classification.txt b/0.15/_sources/auto_examples/classification/plot_digits_classification.txt deleted file mode 100644 index 4a40655595d16..0000000000000 --- a/0.15/_sources/auto_examples/classification/plot_digits_classification.txt +++ /dev/null @@ -1,66 +0,0 @@ - - -.. _example_classification_plot_digits_classification.py: - - -================================ -Recognizing hand-written digits -================================ - -An example showing how the scikit-learn can be used to recognize images of -hand-written digits. - -This example is commented in the -:ref:`tutorial section of the user manual `. - - - - -.. image:: images/plot_digits_classification_001.png - :align: center - - -**Script output**:: - - Classification report for classifier SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, - decision_function_shape=None, degree=3, gamma=0.001, kernel='rbf', - max_iter=-1, probability=False, random_state=None, shrinking=True, - tol=0.001, verbose=False): - precision recall f1-score support - - 0 1.00 0.99 0.99 88 - 1 0.99 0.97 0.98 91 - 2 0.99 0.99 0.99 86 - 3 0.98 0.87 0.92 91 - 4 0.99 0.96 0.97 92 - 5 0.95 0.97 0.96 91 - 6 0.99 0.99 0.99 91 - 7 0.96 0.99 0.97 89 - 8 0.94 1.00 0.97 88 - 9 0.93 0.98 0.95 92 - - avg / total 0.97 0.97 0.97 899 - - - Confusion matrix: - [[87 0 0 0 1 0 0 0 0 0] - [ 0 88 1 0 0 0 0 0 1 1] - [ 0 0 85 1 0 0 0 0 0 0] - [ 0 0 0 79 0 3 0 4 5 0] - [ 0 0 0 0 88 0 0 0 0 4] - [ 0 0 0 0 0 88 1 0 0 2] - [ 0 1 0 0 0 0 90 0 0 0] - [ 0 0 0 0 0 1 0 88 0 0] - [ 0 0 0 0 0 0 0 0 88 0] - [ 0 0 0 1 0 1 0 0 0 90]] - - - -**Python source code:** :download:`plot_digits_classification.py ` - -.. literalinclude:: plot_digits_classification.py - :lines: 13- - -**Total running time of the example:** 0.54 seconds -( 0 minutes 0.54 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/classification/plot_lda.txt b/0.15/_sources/auto_examples/classification/plot_lda.txt deleted file mode 100644 index 3e63adc819607..0000000000000 --- a/0.15/_sources/auto_examples/classification/plot_lda.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -.. _example_classification_plot_lda.py: - - -==================================================================== -Normal and Shrinkage Linear Discriminant Analysis for classification -==================================================================== - -Shows how shrinkage improves classification. - - - -.. image:: images/plot_lda_001.png - :align: center - - - - -**Python source code:** :download:`plot_lda.py ` - -.. literalinclude:: plot_lda.py - :lines: 8- - -**Total running time of the example:** 5.42 seconds -( 0 minutes 5.42 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/classification/plot_lda_qda.txt b/0.15/_sources/auto_examples/classification/plot_lda_qda.txt deleted file mode 100644 index 4392b25f430b2..0000000000000 --- a/0.15/_sources/auto_examples/classification/plot_lda_qda.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -.. _example_classification_plot_lda_qda.py: - - -==================================================================== -Linear and Quadratic Discriminant Analysis with confidence ellipsoid -==================================================================== - -Plot the confidence ellipsoids of each class and decision boundary - - - -.. image:: images/plot_lda_qda_001.png - :align: center - - - - -**Python source code:** :download:`plot_lda_qda.py ` - -.. literalinclude:: plot_lda_qda.py - :lines: 8- - -**Total running time of the example:** 0.43 seconds -( 0 minutes 0.43 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_adjusted_for_chance_measures.txt b/0.15/_sources/auto_examples/cluster/plot_adjusted_for_chance_measures.txt deleted file mode 100644 index 80b8720d438de..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_adjusted_for_chance_measures.txt +++ /dev/null @@ -1,71 +0,0 @@ - - -.. _example_cluster_plot_adjusted_for_chance_measures.py: - - -========================================================== -Adjustment for chance in clustering performance evaluation -========================================================== - -The following plots demonstrate the impact of the number of clusters and -number of samples on various clustering performance evaluation metrics. - -Non-adjusted measures such as the V-Measure show a dependency between -the number of clusters and the number of samples: the mean V-Measure -of random labeling increases significantly as the number of clusters is -closer to the total number of samples used to compute the measure. - -Adjusted for chance measure such as ARI display some random variations -centered around a mean score of 0.0 for any number of samples and -clusters. - -Only adjusted measures can hence safely be used as a consensus index -to evaluate the average stability of clustering algorithms for a given -value of k on various overlapping sub-samples of the dataset. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_adjusted_for_chance_measures_001.png - :scale: 47 - - * - - .. image:: images/plot_adjusted_for_chance_measures_002.png - :scale: 47 - - -**Script output**:: - - Computing adjusted_rand_score for 10 values of n_clusters and n_samples=100 - done in 0.075s - Computing v_measure_score for 10 values of n_clusters and n_samples=100 - done in 0.025s - Computing adjusted_mutual_info_score for 10 values of n_clusters and n_samples=100 - done in 0.469s - Computing mutual_info_score for 10 values of n_clusters and n_samples=100 - done in 0.017s - Computing adjusted_rand_score for 10 values of n_clusters and n_samples=1000 - done in 0.075s - Computing v_measure_score for 10 values of n_clusters and n_samples=1000 - done in 0.048s - Computing adjusted_mutual_info_score for 10 values of n_clusters and n_samples=1000 - done in 0.291s - Computing mutual_info_score for 10 values of n_clusters and n_samples=1000 - done in 0.031s - - - -**Python source code:** :download:`plot_adjusted_for_chance_measures.py ` - -.. literalinclude:: plot_adjusted_for_chance_measures.py - :lines: 23- - -**Total running time of the example:** 1.20 seconds -( 0 minutes 1.20 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_affinity_propagation.txt b/0.15/_sources/auto_examples/cluster/plot_affinity_propagation.txt deleted file mode 100644 index d343f36e4c4e2..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_affinity_propagation.txt +++ /dev/null @@ -1,40 +0,0 @@ - - -.. _example_cluster_plot_affinity_propagation.py: - - -================================================= -Demo of affinity propagation clustering algorithm -================================================= - -Reference: -Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages -Between Data Points", Science Feb. 2007 - - - - -.. image:: images/plot_affinity_propagation_001.png - :align: center - - -**Script output**:: - - Estimated number of clusters: 3 - Homogeneity: 0.872 - Completeness: 0.872 - V-measure: 0.872 - Adjusted Rand Index: 0.912 - Adjusted Mutual Information: 0.871 - Silhouette Coefficient: 0.753 - - - -**Python source code:** :download:`plot_affinity_propagation.py ` - -.. literalinclude:: plot_affinity_propagation.py - :lines: 11- - -**Total running time of the example:** 0.58 seconds -( 0 minutes 0.58 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_agglomerative_clustering.txt b/0.15/_sources/auto_examples/cluster/plot_agglomerative_clustering.txt deleted file mode 100644 index 5617f5d10e80f..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_agglomerative_clustering.txt +++ /dev/null @@ -1,62 +0,0 @@ - - -.. _example_cluster_plot_agglomerative_clustering.py: - - -Agglomerative clustering with and without structure -=================================================== - -This example shows the effect of imposing a connectivity graph to capture -local structure in the data. The graph is simply the graph of 20 nearest -neighbors. - -Two consequences of imposing a connectivity can be seen. First clustering -with a connectivity matrix is much faster. - -Second, when using a connectivity matrix, average and complete linkage are -unstable and tend to create a few clusters that grow very quickly. Indeed, -average and complete linkage fight this percolation behavior by considering all -the distances between two clusters when merging them. The connectivity -graph breaks this mechanism. This effect is more pronounced for very -sparse graphs (try decreasing the number of neighbors in -kneighbors_graph) and with complete linkage. In particular, having a very -small number of neighbors in the graph, imposes a geometry that is -close to that of single linkage, which is well known to have this -percolation instability. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_agglomerative_clustering_001.png - :scale: 47 - - * - - .. image:: images/plot_agglomerative_clustering_002.png - :scale: 47 - - * - - .. image:: images/plot_agglomerative_clustering_003.png - :scale: 47 - - * - - .. image:: images/plot_agglomerative_clustering_004.png - :scale: 47 - - - - -**Python source code:** :download:`plot_agglomerative_clustering.py ` - -.. literalinclude:: plot_agglomerative_clustering.py - :lines: 23- - -**Total running time of the example:** 27.58 seconds -( 0 minutes 27.58 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_agglomerative_clustering_metrics.txt b/0.15/_sources/auto_examples/cluster/plot_agglomerative_clustering_metrics.txt deleted file mode 100644 index 03fe7c40a8b02..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_agglomerative_clustering_metrics.txt +++ /dev/null @@ -1,89 +0,0 @@ - - -.. _example_cluster_plot_agglomerative_clustering_metrics.py: - - -Agglomerative clustering with different metrics -=============================================== - -Demonstrates the effect of different metrics on the hierarchical clustering. - -The example is engineered to show the effect of the choice of different -metrics. It is applied to waveforms, which can be seen as -high-dimensional vector. Indeed, the difference between metrics is -usually more pronounced in high dimension (in particular for euclidean -and cityblock). - -We generate data from three groups of waveforms. Two of the waveforms -(waveform 1 and waveform 2) are proportional one to the other. The cosine -distance is invariant to a scaling of the data, as a result, it cannot -distinguish these two waveforms. Thus even with no noise, clustering -using this distance will not separate out waveform 1 and 2. - -We add observation noise to these waveforms. We generate very sparse -noise: only 6% of the time points contain noise. As a result, the -l1 norm of this noise (ie "cityblock" distance) is much smaller than it's -l2 norm ("euclidean" distance). This can be seen on the inter-class -distance matrices: the values on the diagonal, that caracterize the -spread of the class, are much bigger for the Euclidean distance than for -the cityblock distance. - -When we apply clustering to the data, we find that the clustering -reflects what was in the distance matrices. Indeed, for the Euclidean -distance, the classes are ill-separated because of the noise, and thus -the clustering does not separate the waveforms. For the cityblock -distance, the separation is good and the waveform classes are recovered. -Finally, the cosine distance does not separate at all waveform 1 and 2, -thus the clustering puts them in the same cluster. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_agglomerative_clustering_metrics_001.png - :scale: 47 - - * - - .. image:: images/plot_agglomerative_clustering_metrics_002.png - :scale: 47 - - * - - .. image:: images/plot_agglomerative_clustering_metrics_003.png - :scale: 47 - - * - - .. image:: images/plot_agglomerative_clustering_metrics_004.png - :scale: 47 - - * - - .. image:: images/plot_agglomerative_clustering_metrics_005.png - :scale: 47 - - * - - .. image:: images/plot_agglomerative_clustering_metrics_006.png - :scale: 47 - - * - - .. image:: images/plot_agglomerative_clustering_metrics_007.png - :scale: 47 - - - - -**Python source code:** :download:`plot_agglomerative_clustering_metrics.py ` - -.. literalinclude:: plot_agglomerative_clustering_metrics.py - :lines: 35- - -**Total running time of the example:** 0.94 seconds -( 0 minutes 0.94 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_birch_vs_minibatchkmeans.txt b/0.15/_sources/auto_examples/cluster/plot_birch_vs_minibatchkmeans.txt deleted file mode 100644 index e986eedf5e6fd..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_birch_vs_minibatchkmeans.txt +++ /dev/null @@ -1,42 +0,0 @@ - - -.. _example_cluster_plot_birch_vs_minibatchkmeans.py: - - -================================= -Compare BIRCH and MiniBatchKMeans -================================= - -This example compares the timing of Birch (with and without the global -clustering step) and MiniBatchKMeans on a synthetic dataset having -100,000 samples and 2 features generated using make_blobs. - -If ``n_clusters`` is set to None, the data is reduced from 100,000 -samples to a set of 158 clusters. This can be viewed as a preprocessing -step before the final (global) clustering step that further reduces these -158 clusters to 100 clusters. - - - -.. image:: images/plot_birch_vs_minibatchkmeans_001.png - :align: center - - -**Script output**:: - - Birch without global clustering as the final step took 4.52 seconds - n_clusters : 158 - Birch with global clustering as the final step took 4.34 seconds - n_clusters : 100 - Time taken to run MiniBatchKMeans 5.52 seconds - - - -**Python source code:** :download:`plot_birch_vs_minibatchkmeans.py ` - -.. literalinclude:: plot_birch_vs_minibatchkmeans.py - :lines: 15- - -**Total running time of the example:** 15.70 seconds -( 0 minutes 15.70 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_cluster_comparison.txt b/0.15/_sources/auto_examples/cluster/plot_cluster_comparison.txt deleted file mode 100644 index 4c3ed279fbe99..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_cluster_comparison.txt +++ /dev/null @@ -1,42 +0,0 @@ - - -.. _example_cluster_plot_cluster_comparison.py: - - -========================================================= -Comparing different clustering algorithms on toy datasets -========================================================= - -This example aims at showing characteristics of different -clustering algorithms on datasets that are "interesting" -but still in 2D. The last dataset is an example of a 'null' -situation for clustering: the data is homogeneous, and -there is no good clustering. - -While these examples give some intuition about the algorithms, -this intuition might not apply to very high dimensional data. - -The results could be improved by tweaking the parameters for -each clustering strategy, for instance setting the number of -clusters for the methods that needs this parameter -specified. Note that affinity propagation has a tendency to -create many clusters. Thus in this example its two parameters -(damping and per-point preference) were set to to mitigate this -behavior. - - - -.. image:: images/plot_cluster_comparison_001.png - :align: center - - - - -**Python source code:** :download:`plot_cluster_comparison.py ` - -.. literalinclude:: plot_cluster_comparison.py - :lines: 23- - -**Total running time of the example:** 26.51 seconds -( 0 minutes 26.51 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_cluster_iris.txt b/0.15/_sources/auto_examples/cluster/plot_cluster_iris.txt deleted file mode 100644 index ed31cfb484e0f..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_cluster_iris.txt +++ /dev/null @@ -1,55 +0,0 @@ - - -.. _example_cluster_plot_cluster_iris.py: - - -========================================================= -K-means Clustering -========================================================= - -The plots display firstly what a K-means algorithm would yield -using three clusters. It is then shown what the effect of a bad -initialization is on the classification process: -By setting n_init to only 1 (default is 10), the amount of -times that the algorithm will be run with different centroid -seeds is reduced. -The next plot displays what using eight clusters would deliver -and finally the ground truth. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_cluster_iris_001.png - :scale: 47 - - * - - .. image:: images/plot_cluster_iris_002.png - :scale: 47 - - * - - .. image:: images/plot_cluster_iris_003.png - :scale: 47 - - * - - .. image:: images/plot_cluster_iris_004.png - :scale: 47 - - - - -**Python source code:** :download:`plot_cluster_iris.py ` - -.. literalinclude:: plot_cluster_iris.py - :lines: 19- - -**Total running time of the example:** 0.36 seconds -( 0 minutes 0.36 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_color_quantization.txt b/0.15/_sources/auto_examples/cluster/plot_color_quantization.txt deleted file mode 100644 index cb379307d42e5..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_color_quantization.txt +++ /dev/null @@ -1,63 +0,0 @@ - - -.. _example_cluster_plot_color_quantization.py: - - -================================== -Color Quantization using K-Means -================================== - -Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace -(China), reducing the number of colors required to show the image from 96,615 -unique colors to 64, while preserving the overall appearance quality. - -In this example, pixels are represented in a 3D-space and K-means is used to -find 64 color clusters. In the image processing literature, the codebook -obtained from K-means (the cluster centers) is called the color palette. Using -a single byte, up to 256 colors can be addressed, whereas an RGB encoding -requires 3 bytes per pixel. The GIF file format, for example, uses such a -palette. - -For comparison, a quantized image using a random codebook (colors picked up -randomly) is also shown. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_color_quantization_001.png - :scale: 47 - - * - - .. image:: images/plot_color_quantization_002.png - :scale: 47 - - * - - .. image:: images/plot_color_quantization_003.png - :scale: 47 - - -**Script output**:: - - Fitting model on a small sub-sample of the data - done in 0.404s. - Predicting color indices on the full image (k-means) - done in 0.346s. - Predicting color indices on the full image (random) - done in 0.334s. - - - -**Python source code:** :download:`plot_color_quantization.py ` - -.. literalinclude:: plot_color_quantization.py - :lines: 21- - -**Total running time of the example:** 2.36 seconds -( 0 minutes 2.36 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_dbscan.txt b/0.15/_sources/auto_examples/cluster/plot_dbscan.txt deleted file mode 100644 index 3d7597f204880..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_dbscan.txt +++ /dev/null @@ -1,38 +0,0 @@ - - -.. _example_cluster_plot_dbscan.py: - - -=================================== -Demo of DBSCAN clustering algorithm -=================================== - -Finds core samples of high density and expands clusters from them. - - - - -.. image:: images/plot_dbscan_001.png - :align: center - - -**Script output**:: - - Estimated number of clusters: 3 - Homogeneity: 0.953 - Completeness: 0.883 - V-measure: 0.917 - Adjusted Rand Index: 0.952 - Adjusted Mutual Information: 0.883 - Silhouette Coefficient: 0.626 - - - -**Python source code:** :download:`plot_dbscan.py ` - -.. literalinclude:: plot_dbscan.py - :lines: 10- - -**Total running time of the example:** 0.28 seconds -( 0 minutes 0.28 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_dict_face_patches.txt b/0.15/_sources/auto_examples/cluster/plot_dict_face_patches.txt deleted file mode 100644 index d95aefdeaa8c0..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_dict_face_patches.txt +++ /dev/null @@ -1,70 +0,0 @@ - - -.. _example_cluster_plot_dict_face_patches.py: - - -Online learning of a dictionary of parts of faces -================================================== - -This example uses a large dataset of faces to learn a set of 20 x 20 -images patches that constitute faces. - -From the programming standpoint, it is interesting because it shows how -to use the online API of the scikit-learn to process a very large -dataset by chunks. The way we proceed is that we load an image at a time -and extract randomly 15 patches from this image. Once we have accumulated -750 of these patches (using 50 images), we run the `partial_fit` method -of the online KMeans object, MiniBatchKMeans. - -The verbose setting on the MiniBatchKMeans enables us to see that some -clusters are reassigned during the successive calls to -partial-fit. This is because the number of patches that they represent -has become too low, and it is better to choose a random new -cluster. - - - -.. image:: images/plot_dict_face_patches_001.png - :align: center - - -**Script output**:: - - Learning the dictionary... - Partial fit of 100 out of 2400 - Partial fit of 200 out of 2400 - [MiniBatchKMeans] Reassigning 16 cluster centers. - Partial fit of 300 out of 2400 - Partial fit of 400 out of 2400 - Partial fit of 500 out of 2400 - Partial fit of 600 out of 2400 - Partial fit of 700 out of 2400 - Partial fit of 800 out of 2400 - Partial fit of 900 out of 2400 - Partial fit of 1000 out of 2400 - Partial fit of 1100 out of 2400 - Partial fit of 1200 out of 2400 - Partial fit of 1300 out of 2400 - Partial fit of 1400 out of 2400 - Partial fit of 1500 out of 2400 - Partial fit of 1600 out of 2400 - Partial fit of 1700 out of 2400 - Partial fit of 1800 out of 2400 - Partial fit of 1900 out of 2400 - Partial fit of 2000 out of 2400 - Partial fit of 2100 out of 2400 - Partial fit of 2200 out of 2400 - Partial fit of 2300 out of 2400 - Partial fit of 2400 out of 2400 - done in 11.69s. - - - -**Python source code:** :download:`plot_dict_face_patches.py ` - -.. literalinclude:: plot_dict_face_patches.py - :lines: 21- - -**Total running time of the example:** 15.18 seconds -( 0 minutes 15.18 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_digits_agglomeration.txt b/0.15/_sources/auto_examples/cluster/plot_digits_agglomeration.txt deleted file mode 100644 index b15484a94a315..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_digits_agglomeration.txt +++ /dev/null @@ -1,28 +0,0 @@ - - -.. _example_cluster_plot_digits_agglomeration.py: - - -========================================================= -Feature agglomeration -========================================================= - -These images how similar features are merged together using -feature agglomeration. - - - -.. image:: images/plot_digits_agglomeration_001.png - :align: center - - - - -**Python source code:** :download:`plot_digits_agglomeration.py ` - -.. literalinclude:: plot_digits_agglomeration.py - :lines: 12- - -**Total running time of the example:** 0.43 seconds -( 0 minutes 0.43 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_digits_linkage.txt b/0.15/_sources/auto_examples/cluster/plot_digits_linkage.txt deleted file mode 100644 index c2034ebb5841b..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_digits_linkage.txt +++ /dev/null @@ -1,60 +0,0 @@ - - -.. _example_cluster_plot_digits_linkage.py: - - -============================================================================= -Various Agglomerative Clustering on a 2D embedding of digits -============================================================================= - -An illustration of various linkage option for agglomerative clustering on -a 2D embedding of the digits dataset. - -The goal of this example is to show intuitively how the metrics behave, and -not to find good clusters for the digits. This is why the example works on a -2D embedding. - -What this example shows us is the behavior "rich getting richer" of -agglomerative clustering that tends to create uneven cluster sizes. -This behavior is especially pronounced for the average linkage strategy, -that ends up with a couple of singleton clusters. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_digits_linkage_001.png - :scale: 47 - - * - - .. image:: images/plot_digits_linkage_002.png - :scale: 47 - - * - - .. image:: images/plot_digits_linkage_003.png - :scale: 47 - - -**Script output**:: - - Computing embedding - Done. - ward : 41.25s - average : 31.28s - complete : 26.34s - - - -**Python source code:** :download:`plot_digits_linkage.py ` - -.. literalinclude:: plot_digits_linkage.py - :lines: 18- - -**Total running time of the example:** 117.36 seconds -( 1 minutes 57.36 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_feature_agglomeration_vs_univariate_selection.txt b/0.15/_sources/auto_examples/cluster/plot_feature_agglomeration_vs_univariate_selection.txt deleted file mode 100644 index cbe00ff3a57d9..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_feature_agglomeration_vs_univariate_selection.txt +++ /dev/null @@ -1,114 +0,0 @@ - - -.. _example_cluster_plot_feature_agglomeration_vs_univariate_selection.py: - - -============================================== -Feature agglomeration vs. univariate selection -============================================== - -This example compares 2 dimensionality reduction strategies: - -- univariate feature selection with Anova - -- feature agglomeration with Ward hierarchical clustering - -Both methods are compared in a regression problem using -a BayesianRidge as supervised estimator. - - - -.. image:: images/plot_feature_agglomeration_vs_univariate_selection_001.png - :align: center - - -**Script output**:: - - ________________________________________________________________________________ - [Memory] Calling sklearn.cluster.hierarchical.ward_tree... - ward_tree(array([[-0.451933, ..., -0.675318], - ..., - [ 0.275706, ..., -1.085711]]), - <1600x1600 sparse matrix of type '' - with 7840 stored elements in COOrdinate format>, n_components=1, n_clusters=10) - ________________________________________________________ward_tree - 0.1s, 0.0min - ________________________________________________________________________________ - [Memory] Calling sklearn.cluster.hierarchical.ward_tree... - ward_tree(array([[ 0.905206, ..., 0.161245], - ..., - [-0.849835, ..., -1.091621]]), - <1600x1600 sparse matrix of type '' - with 7840 stored elements in COOrdinate format>, n_components=1, n_clusters=10) - ________________________________________________________ward_tree - 0.1s, 0.0min - ________________________________________________________________________________ - [Memory] Calling sklearn.cluster.hierarchical.ward_tree... - ward_tree(array([[-0.451933, ..., -0.675318], - ..., - [ 0.275706, ..., -1.085711]]), - <1600x1600 sparse matrix of type '' - with 7840 stored elements in COOrdinate format>, n_components=1, n_clusters=20) - ________________________________________________________ward_tree - 0.1s, 0.0min - ________________________________________________________________________________ - [Memory] Calling sklearn.cluster.hierarchical.ward_tree... - ward_tree(array([[ 0.905206, ..., 0.161245], - ..., - [-0.849835, ..., -1.091621]]), - <1600x1600 sparse matrix of type '' - with 7840 stored elements in COOrdinate format>, n_components=1, n_clusters=20) - ________________________________________________________ward_tree - 0.1s, 0.0min - ________________________________________________________________________________ - [Memory] Calling sklearn.cluster.hierarchical.ward_tree... - ward_tree(array([[-0.451933, ..., -0.675318], - ..., - [ 0.275706, ..., -1.085711]]), - <1600x1600 sparse matrix of type '' - with 7840 stored elements in COOrdinate format>, n_components=1, n_clusters=30) - ________________________________________________________ward_tree - 0.1s, 0.0min - ________________________________________________________________________________ - [Memory] Calling sklearn.cluster.hierarchical.ward_tree... - ward_tree(array([[ 0.905206, ..., 0.161245], - ..., - [-0.849835, ..., -1.091621]]), - <1600x1600 sparse matrix of type '' - with 7840 stored elements in COOrdinate format>, n_components=1, n_clusters=30) - ________________________________________________________ward_tree - 0.1s, 0.0min - ________________________________________________________________________________ - [Memory] Calling sklearn.cluster.hierarchical.ward_tree... - ward_tree(array([[ 0.905206, ..., -0.675318], - ..., - [-0.849835, ..., -1.085711]]), - <1600x1600 sparse matrix of type '' - with 7840 stored elements in COOrdinate format>, n_components=1, n_clusters=20) - ________________________________________________________ward_tree - 0.1s, 0.0min - ________________________________________________________________________________ - [Memory] Calling sklearn.feature_selection.univariate_selection.f_regression... - f_regression(array([[-0.451933, ..., 0.275706], - ..., - [-0.675318, ..., -1.085711]]), - array([ 25.267703, ..., -25.026711])) - _____________________________________________________f_regression - 0.0s, 0.0min - ________________________________________________________________________________ - [Memory] Calling sklearn.feature_selection.univariate_selection.f_regression... - f_regression(array([[ 0.905206, ..., -0.849835], - ..., - [ 0.161245, ..., -1.091621]]), - array([ -27.447268, ..., -112.638768])) - _____________________________________________________f_regression - 0.0s, 0.0min - ________________________________________________________________________________ - [Memory] Calling sklearn.feature_selection.univariate_selection.f_regression... - f_regression(array([[ 0.905206, ..., -0.849835], - ..., - [-0.675318, ..., -1.085711]]), - array([-27.447268, ..., -25.026711])) - _____________________________________________________f_regression - 0.0s, 0.0min - - - -**Python source code:** :download:`plot_feature_agglomeration_vs_univariate_selection.py ` - -.. literalinclude:: plot_feature_agglomeration_vs_univariate_selection.py - :lines: 15- - -**Total running time of the example:** 2.73 seconds -( 0 minutes 2.73 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_kmeans_digits.txt b/0.15/_sources/auto_examples/cluster/plot_kmeans_digits.txt deleted file mode 100644 index 546feb7b236b8..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_kmeans_digits.txt +++ /dev/null @@ -1,57 +0,0 @@ - - -.. _example_cluster_plot_kmeans_digits.py: - - -=========================================================== -A demo of K-Means clustering on the handwritten digits data -=========================================================== - -In this example we compare the various initialization strategies for -K-means in terms of runtime and quality of the results. - -As the ground truth is known here, we also apply different cluster -quality metrics to judge the goodness of fit of the cluster labels to the -ground truth. - -Cluster quality metrics evaluated (see :ref:`clustering_evaluation` for -definitions and discussions of the metrics): - -=========== ======================================================== -Shorthand full name -=========== ======================================================== -homo homogeneity score -compl completeness score -v-meas V measure -ARI adjusted Rand index -AMI adjusted mutual information -silhouette silhouette coefficient -=========== ======================================================== - - - - -.. image:: images/plot_kmeans_digits_001.png - :align: center - - -**Script output**:: - - n_digits: 10, n_samples 1797, n_features 64 - _______________________________________________________________________________ - init time inertia homo compl v-meas ARI AMI silhouette - k-means++ 0.64s 69432 0.602 0.650 0.625 0.465 0.598 0.146 - random 0.58s 69694 0.669 0.710 0.689 0.553 0.666 0.147 - PCA-based 0.05s 71820 0.673 0.715 0.693 0.567 0.670 0.150 - _______________________________________________________________________________ - - - -**Python source code:** :download:`plot_kmeans_digits.py ` - -.. literalinclude:: plot_kmeans_digits.py - :lines: 28- - -**Total running time of the example:** 2.04 seconds -( 0 minutes 2.04 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_kmeans_silhouette_analysis.txt b/0.15/_sources/auto_examples/cluster/plot_kmeans_silhouette_analysis.txt deleted file mode 100644 index 6ef469db8f092..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_kmeans_silhouette_analysis.txt +++ /dev/null @@ -1,84 +0,0 @@ - - -.. _example_cluster_plot_kmeans_silhouette_analysis.py: - - -=============================================================================== -Selecting the number of clusters with silhouette analysis on KMeans clustering -=============================================================================== - -Silhouette analysis can be used to study the separation distance between the -resulting clusters. The silhouette plot displays a measure of how close each -point in one cluster is to points in the neighboring clusters and thus provides -a way to assess parameters like number of clusters visually. This measure has a -range of [-1, 1]. - -Silhoette coefficients (as these values are referred to as) near +1 indicate -that the sample is far away from the neighboring clusters. A value of 0 -indicates that the sample is on or very close to the decision boundary between -two neighboring clusters and negative values indicate that those samples might -have been assigned to the wrong cluster. - -In this example the silhouette analysis is used to choose an optimal value for -``n_clusters``. The silhouette plot shows that the ``n_clusters`` value of 3, 5 -and 6 are a bad pick for the given data due to the presence of clusters with -below average silhouette scores and also due to wide fluctuations in the size -of the silhouette plots. Silhouette analysis is more ambivalent in deciding -between 2 and 4. - -Also from the thickness of the silhouette plot the cluster size can be -visualized. The silhouette plot for cluster 0 when ``n_clusters`` is equal to -2, is bigger in size owing to the grouping of the 3 sub clusters into one big -cluster. However when the ``n_clusters`` is equal to 4, all the plots are more -or less of similar thickness and hence are of similar sizes as can be also -verified from the labelled scatter plot on the right. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_kmeans_silhouette_analysis_001.png - :scale: 47 - - * - - .. image:: images/plot_kmeans_silhouette_analysis_002.png - :scale: 47 - - * - - .. image:: images/plot_kmeans_silhouette_analysis_003.png - :scale: 47 - - * - - .. image:: images/plot_kmeans_silhouette_analysis_004.png - :scale: 47 - - * - - .. image:: images/plot_kmeans_silhouette_analysis_005.png - :scale: 47 - - -**Script output**:: - - For n_clusters = 2 The average silhouette_score is : 0.704978749608 - For n_clusters = 3 The average silhouette_score is : 0.588200401213 - For n_clusters = 4 The average silhouette_score is : 0.650518663273 - For n_clusters = 5 The average silhouette_score is : 0.563764690262 - For n_clusters = 6 The average silhouette_score is : 0.450301208266 - - - -**Python source code:** :download:`plot_kmeans_silhouette_analysis.py ` - -.. literalinclude:: plot_kmeans_silhouette_analysis.py - :lines: 32- - -**Total running time of the example:** 1.62 seconds -( 0 minutes 1.62 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_kmeans_stability_low_dim_dense.txt b/0.15/_sources/auto_examples/cluster/plot_kmeans_stability_low_dim_dense.txt deleted file mode 100644 index e67f1a70aac38..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_kmeans_stability_low_dim_dense.txt +++ /dev/null @@ -1,60 +0,0 @@ - - -.. _example_cluster_plot_kmeans_stability_low_dim_dense.py: - - -============================================================ -Empirical evaluation of the impact of k-means initialization -============================================================ - -Evaluate the ability of k-means initializations strategies to make -the algorithm convergence robust as measured by the relative standard -deviation of the inertia of the clustering (i.e. the sum of distances -to the nearest cluster center). - -The first plot shows the best inertia reached for each combination -of the model (``KMeans`` or ``MiniBatchKMeans``) and the init method -(``init="random"`` or ``init="kmeans++"``) for increasing values of the -``n_init`` parameter that controls the number of initializations. - -The second plot demonstrate one single run of the ``MiniBatchKMeans`` -estimator using a ``init="random"`` and ``n_init=1``. This run leads to -a bad convergence (local optimum) with estimated centers between stucked -between ground truth clusters. - -The dataset used for evaluation is a 2D grid of isotropic Gaussian -clusters widely spaced. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_kmeans_stability_low_dim_dense_001.png - :scale: 47 - - * - - .. image:: images/plot_kmeans_stability_low_dim_dense_002.png - :scale: 47 - - -**Script output**:: - - Evaluation of KMeans with k-means++ init - Evaluation of KMeans with random init - Evaluation of MiniBatchKMeans with k-means++ init - Evaluation of MiniBatchKMeans with random init - - - -**Python source code:** :download:`plot_kmeans_stability_low_dim_dense.py ` - -.. literalinclude:: plot_kmeans_stability_low_dim_dense.py - :lines: 24- - -**Total running time of the example:** 3.13 seconds -( 0 minutes 3.13 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_lena_compress.txt b/0.15/_sources/auto_examples/cluster/plot_lena_compress.txt deleted file mode 100644 index 1fd5b162c2220..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_lena_compress.txt +++ /dev/null @@ -1,50 +0,0 @@ - - -.. _example_cluster_plot_lena_compress.py: - - -========================================================= -Vector Quantization Example -========================================================= - -The classic image processing example, Lena, an 8-bit grayscale -bit-depth, 512 x 512 sized image, is used here to illustrate -how `k`-means is used for vector quantization. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_lena_compress_001.png - :scale: 47 - - * - - .. image:: images/plot_lena_compress_002.png - :scale: 47 - - * - - .. image:: images/plot_lena_compress_003.png - :scale: 47 - - * - - .. image:: images/plot_lena_compress_004.png - :scale: 47 - - - - -**Python source code:** :download:`plot_lena_compress.py ` - -.. literalinclude:: plot_lena_compress.py - :lines: 14- - -**Total running time of the example:** 1.91 seconds -( 0 minutes 1.91 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_lena_segmentation.txt b/0.15/_sources/auto_examples/cluster/plot_lena_segmentation.txt deleted file mode 100644 index 7cc9024e82280..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_lena_segmentation.txt +++ /dev/null @@ -1,49 +0,0 @@ - - -.. _example_cluster_plot_lena_segmentation.py: - - -========================================= -Segmenting the picture of Lena in regions -========================================= - -This example uses :ref:`spectral_clustering` on a graph created from -voxel-to-voxel difference on an image to break this image into multiple -partly-homogeneous regions. - -This procedure (spectral clustering on an image) is an efficient -approximate solution for finding normalized graph cuts. - -There are two options to assign labels: - -* with 'kmeans' spectral clustering will cluster samples in the embedding space - using a kmeans algorithm -* whereas 'discrete' will iteratively search for the closest partition - space to the embedding space. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_lena_segmentation_001.png - :scale: 47 - - * - - .. image:: images/plot_lena_segmentation_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_lena_segmentation.py ` - -.. literalinclude:: plot_lena_segmentation.py - :lines: 20- - -**Total running time of the example:** 60.48 seconds -( 1 minutes 0.48 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_lena_ward_segmentation.txt b/0.15/_sources/auto_examples/cluster/plot_lena_ward_segmentation.txt deleted file mode 100644 index 91cdda442c4b2..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_lena_ward_segmentation.txt +++ /dev/null @@ -1,36 +0,0 @@ - - -.. _example_cluster_plot_lena_ward_segmentation.py: - - -=============================================================== -A demo of structured Ward hierarchical clustering on Lena image -=============================================================== - -Compute the segmentation of a 2D image with Ward hierarchical -clustering. The clustering is spatially constrained in order -for each segmented region to be in one piece. - - - -.. image:: images/plot_lena_ward_segmentation_001.png - :align: center - - -**Script output**:: - - Compute structured hierarchical clustering... - Elapsed time: 7.05330491066 - Number of pixels: 65536 - Number of clusters: 15 - - - -**Python source code:** :download:`plot_lena_ward_segmentation.py ` - -.. literalinclude:: plot_lena_ward_segmentation.py - :lines: 10- - -**Total running time of the example:** 7.59 seconds -( 0 minutes 7.59 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_mean_shift.txt b/0.15/_sources/auto_examples/cluster/plot_mean_shift.txt deleted file mode 100644 index 5bb301bc329a6..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_mean_shift.txt +++ /dev/null @@ -1,36 +0,0 @@ - - -.. _example_cluster_plot_mean_shift.py: - - -============================================= -A demo of the mean-shift clustering algorithm -============================================= - -Reference: - -Dorin Comaniciu and Peter Meer, "Mean Shift: A robust approach toward -feature space analysis". IEEE Transactions on Pattern Analysis and -Machine Intelligence. 2002. pp. 603-619. - - - - -.. image:: images/plot_mean_shift_001.png - :align: center - - -**Script output**:: - - number of estimated clusters : 3 - - - -**Python source code:** :download:`plot_mean_shift.py ` - -.. literalinclude:: plot_mean_shift.py - :lines: 13- - -**Total running time of the example:** 0.47 seconds -( 0 minutes 0.47 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_mini_batch_kmeans.txt b/0.15/_sources/auto_examples/cluster/plot_mini_batch_kmeans.txt deleted file mode 100644 index 853b35176a771..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_mini_batch_kmeans.txt +++ /dev/null @@ -1,34 +0,0 @@ - - -.. _example_cluster_plot_mini_batch_kmeans.py: - - -==================================================================== -Comparison of the K-Means and MiniBatchKMeans clustering algorithms -==================================================================== - -We want to compare the performance of the MiniBatchKMeans and KMeans: -the MiniBatchKMeans is faster, but gives slightly different results (see -:ref:`mini_batch_kmeans`). - -We will cluster a set of data, first with KMeans and then with -MiniBatchKMeans, and plot the results. -We will also plot the points that are labelled differently between the two -algorithms. - - - -.. image:: images/plot_mini_batch_kmeans_001.png - :align: center - - - - -**Python source code:** :download:`plot_mini_batch_kmeans.py ` - -.. literalinclude:: plot_mini_batch_kmeans.py - :lines: 15- - -**Total running time of the example:** 0.30 seconds -( 0 minutes 0.30 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_segmentation_toy.txt b/0.15/_sources/auto_examples/cluster/plot_segmentation_toy.txt deleted file mode 100644 index 2df5d6cb2aac2..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_segmentation_toy.txt +++ /dev/null @@ -1,66 +0,0 @@ - - -.. _example_cluster_plot_segmentation_toy.py: - - -=========================================== -Spectral clustering for image segmentation -=========================================== - -In this example, an image with connected circles is generated and -spectral clustering is used to separate the circles. - -In these settings, the :ref:`spectral_clustering` approach solves the problem -know as 'normalized graph cuts': the image is seen as a graph of -connected voxels, and the spectral clustering algorithm amounts to -choosing graph cuts defining regions while minimizing the ratio of the -gradient along the cut, and the volume of the region. - -As the algorithm tries to balance the volume (ie balance the region -sizes), if we take circles with different sizes, the segmentation fails. - -In addition, as there is no useful information in the intensity of the image, -or its gradient, we choose to perform the spectral clustering on a graph -that is only weakly informed by the gradient. This is close to performing -a Voronoi partition of the graph. - -In addition, we use the mask of the objects to restrict the graph to the -outline of the objects. In this example, we are interested in -separating the objects one from the other, and not from the background. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_segmentation_toy_001.png - :scale: 47 - - * - - .. image:: images/plot_segmentation_toy_002.png - :scale: 47 - - * - - .. image:: images/plot_segmentation_toy_003.png - :scale: 47 - - * - - .. image:: images/plot_segmentation_toy_004.png - :scale: 47 - - - - -**Python source code:** :download:`plot_segmentation_toy.py ` - -.. literalinclude:: plot_segmentation_toy.py - :lines: 27- - -**Total running time of the example:** 1.06 seconds -( 0 minutes 1.06 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cluster/plot_ward_structured_vs_unstructured.txt b/0.15/_sources/auto_examples/cluster/plot_ward_structured_vs_unstructured.txt deleted file mode 100644 index e45c50d4285e1..0000000000000 --- a/0.15/_sources/auto_examples/cluster/plot_ward_structured_vs_unstructured.txt +++ /dev/null @@ -1,59 +0,0 @@ - - -.. _example_cluster_plot_ward_structured_vs_unstructured.py: - - -=========================================================== -Hierarchical clustering: structured vs unstructured ward -=========================================================== - -Example builds a swiss roll dataset and runs -hierarchical clustering on their position. - -For more information, see :ref:`hierarchical_clustering`. - -In a first step, the hierarchical clustering is performed without connectivity -constraints on the structure and is solely based on distance, whereas in -a second step the clustering is restricted to the k-Nearest Neighbors -graph: it's a hierarchical clustering with structure prior. - -Some of the clusters learned without connectivity constraints do not -respect the structure of the swiss roll and extend across different folds of -the manifolds. On the opposite, when opposing connectivity constraints, -the clusters form a nice parcellation of the swiss roll. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_ward_structured_vs_unstructured_001.png - :scale: 47 - - * - - .. image:: images/plot_ward_structured_vs_unstructured_002.png - :scale: 47 - - -**Script output**:: - - Compute unstructured hierarchical clustering... - Elapsed time: 1.91s - Number of points: 1500 - Compute structured hierarchical clustering... - Elapsed time: 0.12s - Number of points: 1500 - - - -**Python source code:** :download:`plot_ward_structured_vs_unstructured.py ` - -.. literalinclude:: plot_ward_structured_vs_unstructured.py - :lines: 21- - -**Total running time of the example:** 2.32 seconds -( 0 minutes 2.32 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/covariance/plot_covariance_estimation.txt b/0.15/_sources/auto_examples/covariance/plot_covariance_estimation.txt deleted file mode 100644 index 647c9be4ffd62..0000000000000 --- a/0.15/_sources/auto_examples/covariance/plot_covariance_estimation.txt +++ /dev/null @@ -1,63 +0,0 @@ - - -.. _example_covariance_plot_covariance_estimation.py: - - -======================================================================= -Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood -======================================================================= - -When working with covariance estimation, the usual approach is to use -a maximum likelihood estimator, such as the -:class:`sklearn.covariance.EmpiricalCovariance`. It is unbiased, i.e. it -converges to the true (population) covariance when given many -observations. However, it can also be beneficial to regularize it, in -order to reduce its variance; this, in turn, introduces some bias. This -example illustrates the simple regularization used in -:ref:`shrunk_covariance` estimators. In particular, it focuses on how to -set the amount of regularization, i.e. how to choose the bias-variance -trade-off. - -Here we compare 3 approaches: - -* Setting the parameter by cross-validating the likelihood on three folds - according to a grid of potential shrinkage parameters. - -* A close formula proposed by Ledoit and Wolf to compute - the asymptotically optimal regularization parameter (minimizing a MSE - criterion), yielding the :class:`sklearn.covariance.LedoitWolf` - covariance estimate. - -* An improvement of the Ledoit-Wolf shrinkage, the - :class:`sklearn.covariance.OAS`, proposed by Chen et al. Its - convergence is significantly better under the assumption that the data - are Gaussian, in particular for small samples. - -To quantify estimation error, we plot the likelihood of unseen data for -different values of the shrinkage parameter. We also show the choices by -cross-validation, or with the LedoitWolf and OAS estimates. - -Note that the maximum likelihood estimate corresponds to no shrinkage, -and thus performs poorly. The Ledoit-Wolf estimate performs really well, -as it is close to the optimal and is computational not costly. In this -example, the OAS estimate is a bit further away. Interestingly, both -approaches outperform cross-validation, which is significantly most -computationally costly. - - - - -.. image:: images/plot_covariance_estimation_001.png - :align: center - - - - -**Python source code:** :download:`plot_covariance_estimation.py ` - -.. literalinclude:: plot_covariance_estimation.py - :lines: 44- - -**Total running time of the example:** 0.25 seconds -( 0 minutes 0.25 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/covariance/plot_lw_vs_oas.txt b/0.15/_sources/auto_examples/covariance/plot_lw_vs_oas.txt deleted file mode 100644 index e0c4b98ccdb72..0000000000000 --- a/0.15/_sources/auto_examples/covariance/plot_lw_vs_oas.txt +++ /dev/null @@ -1,42 +0,0 @@ - - -.. _example_covariance_plot_lw_vs_oas.py: - - -============================= -Ledoit-Wolf vs OAS estimation -============================= - -The usual covariance maximum likelihood estimate can be regularized -using shrinkage. Ledoit and Wolf proposed a close formula to compute -the asymptotically optimal shrinkage parameter (minimizing a MSE -criterion), yielding the Ledoit-Wolf covariance estimate. - -Chen et al. proposed an improvement of the Ledoit-Wolf shrinkage -parameter, the OAS coefficient, whose convergence is significantly -better under the assumption that the data are Gaussian. - -This example, inspired from Chen's publication [1], shows a comparison -of the estimated MSE of the LW and OAS methods, using Gaussian -distributed data. - -[1] "Shrinkage Algorithms for MMSE Covariance Estimation" -Chen et al., IEEE Trans. on Sign. Proc., Volume 58, Issue 10, October 2010. - - - - -.. image:: images/plot_lw_vs_oas_001.png - :align: center - - - - -**Python source code:** :download:`plot_lw_vs_oas.py ` - -.. literalinclude:: plot_lw_vs_oas.py - :lines: 23- - -**Total running time of the example:** 5.12 seconds -( 0 minutes 5.12 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/covariance/plot_mahalanobis_distances.txt b/0.15/_sources/auto_examples/covariance/plot_mahalanobis_distances.txt deleted file mode 100644 index c96cc345e85bc..0000000000000 --- a/0.15/_sources/auto_examples/covariance/plot_mahalanobis_distances.txt +++ /dev/null @@ -1,74 +0,0 @@ - - -.. _example_covariance_plot_mahalanobis_distances.py: - - -================================================================ -Robust covariance estimation and Mahalanobis distances relevance -================================================================ - -An example to show covariance estimation with the Mahalanobis -distances on Gaussian distributed data. - -For Gaussian distributed data, the distance of an observation -:math:`x_i` to the mode of the distribution can be computed using its -Mahalanobis distance: :math:`d_{(\mu,\Sigma)}(x_i)^2 = (x_i - -\mu)'\Sigma^{-1}(x_i - \mu)` where :math:`\mu` and :math:`\Sigma` are -the location and the covariance of the underlying Gaussian -distribution. - -In practice, :math:`\mu` and :math:`\Sigma` are replaced by some -estimates. The usual covariance maximum likelihood estimate is very -sensitive to the presence of outliers in the data set and therefor, -the corresponding Mahalanobis distances are. One would better have to -use a robust estimator of covariance to guarantee that the estimation is -resistant to "erroneous" observations in the data set and that the -associated Mahalanobis distances accurately reflect the true -organisation of the observations. - -The Minimum Covariance Determinant estimator is a robust, -high-breakdown point (i.e. it can be used to estimate the covariance -matrix of highly contaminated datasets, up to -:math:`\frac{n_\text{samples}-n_\text{features}-1}{2}` outliers) -estimator of covariance. The idea is to find -:math:`\frac{n_\text{samples}+n_\text{features}+1}{2}` -observations whose empirical covariance has the smallest determinant, -yielding a "pure" subset of observations from which to compute -standards estimates of location and covariance. - -The Minimum Covariance Determinant estimator (MCD) has been introduced -by P.J.Rousseuw in [1]. - -This example illustrates how the Mahalanobis distances are affected by -outlying data: observations drawn from a contaminating distribution -are not distinguishable from the observations coming from the real, -Gaussian distribution that one may want to work with. Using MCD-based -Mahalanobis distances, the two populations become -distinguishable. Associated applications are outliers detection, -observations ranking, clustering, ... -For visualization purpose, the cubic root of the Mahalanobis distances -are represented in the boxplot, as Wilson and Hilferty suggest [2] - -[1] P. J. Rousseeuw. Least median of squares regression. J. Am - Stat Ass, 79:871, 1984. -[2] Wilson, E. B., & Hilferty, M. M. (1931). The distribution of chi-square. - Proceedings of the National Academy of Sciences of the United States - of America, 17, 684-688. - - - - -.. image:: images/plot_mahalanobis_distances_001.png - :align: center - - - - -**Python source code:** :download:`plot_mahalanobis_distances.py ` - -.. literalinclude:: plot_mahalanobis_distances.py - :lines: 55- - -**Total running time of the example:** 0.25 seconds -( 0 minutes 0.25 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/covariance/plot_outlier_detection.txt b/0.15/_sources/auto_examples/covariance/plot_outlier_detection.txt deleted file mode 100644 index 17dc4a096ac2c..0000000000000 --- a/0.15/_sources/auto_examples/covariance/plot_outlier_detection.txt +++ /dev/null @@ -1,60 +0,0 @@ - - -.. _example_covariance_plot_outlier_detection.py: - - -========================================== -Outlier detection with several methods. -========================================== - -When the amount of contamination is known, this example illustrates two -different ways of performing :ref:`outlier_detection`: - -- based on a robust estimator of covariance, which is assuming that the - data are Gaussian distributed and performs better than the One-Class SVM - in that case. - -- using the One-Class SVM and its ability to capture the shape of the - data set, hence performing better when the data is strongly - non-Gaussian, i.e. with two well-separated clusters; - -The ground truth about inliers and outliers is given by the points colors -while the orange-filled area indicates which points are reported as outliers -by each method. - -Here, we assume that we know the fraction of outliers in the datasets. -Thus rather than using the 'predict' method of the objects, we set the -threshold on the decision_function to separate out the corresponding -fraction. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_outlier_detection_001.png - :scale: 47 - - * - - .. image:: images/plot_outlier_detection_002.png - :scale: 47 - - * - - .. image:: images/plot_outlier_detection_003.png - :scale: 47 - - - - -**Python source code:** :download:`plot_outlier_detection.py ` - -.. literalinclude:: plot_outlier_detection.py - :lines: 26- - -**Total running time of the example:** 2.35 seconds -( 0 minutes 2.35 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/covariance/plot_robust_vs_empirical_covariance.txt b/0.15/_sources/auto_examples/covariance/plot_robust_vs_empirical_covariance.txt deleted file mode 100644 index f19cd77f36814..0000000000000 --- a/0.15/_sources/auto_examples/covariance/plot_robust_vs_empirical_covariance.txt +++ /dev/null @@ -1,73 +0,0 @@ - - -.. _example_covariance_plot_robust_vs_empirical_covariance.py: - - -======================================= -Robust vs Empirical covariance estimate -======================================= - -The usual covariance maximum likelihood estimate is very sensitive to the -presence of outliers in the data set. In such a case, it would be better to -use a robust estimator of covariance to guarantee that the estimation is -resistant to "erroneous" observations in the data set. - -Minimum Covariance Determinant Estimator ----------------------------------------- -The Minimum Covariance Determinant estimator is a robust, high-breakdown point -(i.e. it can be used to estimate the covariance matrix of highly contaminated -datasets, up to -:math:`\frac{n_\text{samples} - n_\text{features}-1}{2}` outliers) estimator of -covariance. The idea is to find -:math:`\frac{n_\text{samples} + n_\text{features}+1}{2}` -observations whose empirical covariance has the smallest determinant, yielding -a "pure" subset of observations from which to compute standards estimates of -location and covariance. After a correction step aiming at compensating the -fact that the estimates were learned from only a portion of the initial data, -we end up with robust estimates of the data set location and covariance. - -The Minimum Covariance Determinant estimator (MCD) has been introduced by -P.J.Rousseuw in [1]_. - -Evaluation ----------- -In this example, we compare the estimation errors that are made when using -various types of location and covariance estimates on contaminated Gaussian -distributed data sets: - -- The mean and the empirical covariance of the full dataset, which break - down as soon as there are outliers in the data set -- The robust MCD, that has a low error provided - :math:`n_\text{samples} > 5n_\text{features}` -- The mean and the empirical covariance of the observations that are known - to be good ones. This can be considered as a "perfect" MCD estimation, - so one can trust our implementation by comparing to this case. - - -References ----------- -.. [1] P. J. Rousseeuw. Least median of squares regression. J. Am - Stat Ass, 79:871, 1984. -.. [2] Johanna Hardin, David M Rocke. Journal of Computational and - Graphical Statistics. December 1, 2005, 14(4): 928-946. -.. [3] Zoubir A., Koivunen V., Chakhchoukh Y. and Muma M. (2012). Robust - estimation in signal processing: A tutorial-style treatment of - fundamental concepts. IEEE Signal Processing Magazine 29(4), 61-80. - - - - -.. image:: images/plot_robust_vs_empirical_covariance_001.png - :align: center - - - - -**Python source code:** :download:`plot_robust_vs_empirical_covariance.py ` - -.. literalinclude:: plot_robust_vs_empirical_covariance.py - :lines: 54- - -**Total running time of the example:** 2.65 seconds -( 0 minutes 2.65 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/covariance/plot_sparse_cov.txt b/0.15/_sources/auto_examples/covariance/plot_sparse_cov.txt deleted file mode 100644 index 2405d3d9ebec6..0000000000000 --- a/0.15/_sources/auto_examples/covariance/plot_sparse_cov.txt +++ /dev/null @@ -1,80 +0,0 @@ - - -.. _example_covariance_plot_sparse_cov.py: - - -====================================== -Sparse inverse covariance estimation -====================================== - -Using the GraphLasso estimator to learn a covariance and sparse precision -from a small number of samples. - -To estimate a probabilistic model (e.g. a Gaussian model), estimating the -precision matrix, that is the inverse covariance matrix, is as important -as estimating the covariance matrix. Indeed a Gaussian model is -parametrized by the precision matrix. - -To be in favorable recovery conditions, we sample the data from a model -with a sparse inverse covariance matrix. In addition, we ensure that the -data is not too much correlated (limiting the largest coefficient of the -precision matrix) and that there a no small coefficients in the -precision matrix that cannot be recovered. In addition, with a small -number of observations, it is easier to recover a correlation matrix -rather than a covariance, thus we scale the time series. - -Here, the number of samples is slightly larger than the number of -dimensions, thus the empirical covariance is still invertible. However, -as the observations are strongly correlated, the empirical covariance -matrix is ill-conditioned and as a result its inverse --the empirical -precision matrix-- is very far from the ground truth. - -If we use l2 shrinkage, as with the Ledoit-Wolf estimator, as the number -of samples is small, we need to shrink a lot. As a result, the -Ledoit-Wolf precision is fairly close to the ground truth precision, that -is not far from being diagonal, but the off-diagonal structure is lost. - -The l1-penalized estimator can recover part of this off-diagonal -structure. It learns a sparse precision. It is not able to -recover the exact sparsity pattern: it detects too many non-zero -coefficients. However, the highest non-zero coefficients of the l1 -estimated correspond to the non-zero coefficients in the ground truth. -Finally, the coefficients of the l1 precision estimate are biased toward -zero: because of the penalty, they are all smaller than the corresponding -ground truth value, as can be seen on the figure. - -Note that, the color range of the precision matrices is tweeked to -improve readibility of the figure. The full range of values of the -empirical precision is not displayed. - -The alpha parameter of the GraphLasso setting the sparsity of the model is -set by internal cross-validation in the GraphLassoCV. As can be -seen on figure 2, the grid to compute the cross-validation score is -iteratively refined in the neighborhood of the maximum. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_sparse_cov_001.png - :scale: 47 - - * - - .. image:: images/plot_sparse_cov_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_sparse_cov.py ` - -.. literalinclude:: plot_sparse_cov.py - :lines: 51- - -**Total running time of the example:** 0.80 seconds -( 0 minutes 0.80 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/cross_decomposition/plot_compare_cross_decomposition.txt b/0.15/_sources/auto_examples/cross_decomposition/plot_compare_cross_decomposition.txt deleted file mode 100644 index 4aad4e910f552..0000000000000 --- a/0.15/_sources/auto_examples/cross_decomposition/plot_compare_cross_decomposition.txt +++ /dev/null @@ -1,86 +0,0 @@ - - -.. _example_cross_decomposition_plot_compare_cross_decomposition.py: - - -=================================== -Compare cross decomposition methods -=================================== - -Simple usage of various cross decomposition algorithms: -- PLSCanonical -- PLSRegression, with multivariate response, a.k.a. PLS2 -- PLSRegression, with univariate response, a.k.a. PLS1 -- CCA - -Given 2 multivariate covarying two-dimensional datasets, X, and Y, -PLS extracts the 'directions of covariance', i.e. the components of each -datasets that explain the most shared variance between both datasets. -This is apparent on the **scatterplot matrix** display: components 1 in -dataset X and dataset Y are maximally correlated (points lie around the -first diagonal). This is also true for components 2 in both dataset, -however, the correlation across datasets for different components is -weak: the point cloud is very spherical. - - - -.. image:: images/plot_compare_cross_decomposition_001.png - :align: center - - -**Script output**:: - - Corr(X) - [[ 1. 0.52 -0.08 -0.09] - [ 0.52 1. -0.04 -0.09] - [-0.08 -0.04 1. 0.52] - [-0.09 -0.09 0.52 1. ]] - Corr(Y) - [[ 1. 0.49 -0.09 -0.07] - [ 0.49 1. -0.08 -0.07] - [-0.09 -0.08 1. 0.48] - [-0.07 -0.07 0.48 1. ]] - True B (such that: Y = XB + Err) - [[1 1 1] - [2 2 2] - [0 0 0] - [0 0 0] - [0 0 0] - [0 0 0] - [0 0 0] - [0 0 0] - [0 0 0] - [0 0 0]] - Estimated B - [[ 1. 1. 0.9] - [ 2. 2. 2. ] - [ 0. -0. -0. ] - [-0. -0. -0. ] - [ 0. -0. 0. ] - [-0. -0. 0. ] - [ 0. -0. -0. ] - [-0. -0. -0. ] - [ 0. 0. -0. ] - [ 0. -0. 0. ]] - Estimated betas - [[ 1. ] - [ 2. ] - [-0. ] - [-0.1] - [ 0.1] - [ 0. ] - [ 0. ] - [ 0. ] - [-0. ] - [ 0. ]] - - - -**Python source code:** :download:`plot_compare_cross_decomposition.py ` - -.. literalinclude:: plot_compare_cross_decomposition.py - :lines: 21- - -**Total running time of the example:** 0.28 seconds -( 0 minutes 0.28 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/datasets/plot_digits_last_image.txt b/0.15/_sources/auto_examples/datasets/plot_digits_last_image.txt deleted file mode 100644 index 00e4245fee411..0000000000000 --- a/0.15/_sources/auto_examples/datasets/plot_digits_last_image.txt +++ /dev/null @@ -1,34 +0,0 @@ - - -.. _example_datasets_plot_digits_last_image.py: - - -========================================================= -The Digit Dataset -========================================================= - -This dataset is made up of 1797 8x8 images. Each image, -like the one shown below, is of a hand-written digit. -In order to utilize an 8x8 figure like this, we'd have to -first transform it into a feature vector with length 64. - -See `here -`_ -for more information about this dataset. - - - -.. image:: images/plot_digits_last_image_001.png - :align: center - - - - -**Python source code:** :download:`plot_digits_last_image.py ` - -.. literalinclude:: plot_digits_last_image.py - :lines: 18- - -**Total running time of the example:** 0.13 seconds -( 0 minutes 0.13 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/datasets/plot_iris_dataset.txt b/0.15/_sources/auto_examples/datasets/plot_iris_dataset.txt deleted file mode 100644 index a9cea7b88ba6b..0000000000000 --- a/0.15/_sources/auto_examples/datasets/plot_iris_dataset.txt +++ /dev/null @@ -1,45 +0,0 @@ - - -.. _example_datasets_plot_iris_dataset.py: - - -========================================================= -The Iris Dataset -========================================================= -This data sets consists of 3 different types of irises' -(Setosa, Versicolour, and Virginica) petal and sepal -length, stored in a 150x4 numpy.ndarray - -The rows being the samples and the columns being: -Sepal Length, Sepal Width, Petal Length and Petal Width. - -The below plot uses the first two features. -See `here `_ for more -information on this dataset. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_iris_dataset_001.png - :scale: 47 - - * - - .. image:: images/plot_iris_dataset_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_iris_dataset.py ` - -.. literalinclude:: plot_iris_dataset.py - :lines: 19- - -**Total running time of the example:** 0.15 seconds -( 0 minutes 0.15 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/datasets/plot_random_dataset.txt b/0.15/_sources/auto_examples/datasets/plot_random_dataset.txt deleted file mode 100644 index 67e2b6fd04bf2..0000000000000 --- a/0.15/_sources/auto_examples/datasets/plot_random_dataset.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_datasets_plot_random_dataset.py: - - -============================================== -Plot randomly generated classification dataset -============================================== - -Plot several randomly generated 2D classification datasets. -This example illustrates the `datasets.make_classification` -function. - -Three binary and two multi-class classification datasets -are generated, with different numbers of informative -features and clusters per class. - - - -.. image:: images/plot_random_dataset_001.png - :align: center - - - - -**Python source code:** :download:`plot_random_dataset.py ` - -.. literalinclude:: plot_random_dataset.py - :lines: 14- - -**Total running time of the example:** 0.24 seconds -( 0 minutes 0.24 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/datasets/plot_random_multilabel_dataset.txt b/0.15/_sources/auto_examples/datasets/plot_random_multilabel_dataset.txt deleted file mode 100644 index 5accc2ec26ad5..0000000000000 --- a/0.15/_sources/auto_examples/datasets/plot_random_multilabel_dataset.txt +++ /dev/null @@ -1,63 +0,0 @@ - - -.. _example_datasets_plot_random_multilabel_dataset.py: - - -============================================== -Plot randomly generated multilabel dataset -============================================== - -This illustrates the `datasets.make_multilabel_classification` dataset -generator. Each sample consists of counts of two features (up to 50 in -total), which are differently distributed in each of two classes. - -Points are labeled as follows, where Y means the class is present: - - ===== ===== ===== ====== - 1 2 3 Color - ===== ===== ===== ====== - Y N N Red - N Y N Blue - N N Y Yellow - Y Y N Purple - Y N Y Orange - Y Y N Green - Y Y Y Brown - ===== ===== ===== ====== - -A star marks the expected sample for each class; its size reflects the -probability of selecting that class label. - -The left and right examples highlight the ``n_labels`` parameter: -more of the samples in the right plot have 2 or 3 labels. - -Note that this two-dimensional example is very degenerate: -generally the number of features would be much greater than the -"document length", while here we have much larger documents than vocabulary. -Similarly, with ``n_classes > n_features``, it is much less likely that a -feature distinguishes a particular class. - - - -.. image:: images/plot_random_multilabel_dataset_001.png - :align: center - - -**Script output**:: - - The data was generated from (random_state=229): - Class P(C) P(w0|C) P(w1|C) - red 0.06 0.40 0.60 - blue 0.49 0.54 0.46 - yellow 0.45 0.57 0.43 - - - -**Python source code:** :download:`plot_random_multilabel_dataset.py ` - -.. literalinclude:: plot_random_multilabel_dataset.py - :lines: 36- - -**Total running time of the example:** 0.18 seconds -( 0 minutes 0.18 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_faces_decomposition.txt b/0.15/_sources/auto_examples/decomposition/plot_faces_decomposition.txt deleted file mode 100644 index d9b64f5be3a3b..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_faces_decomposition.txt +++ /dev/null @@ -1,94 +0,0 @@ - - -.. _example_decomposition_plot_faces_decomposition.py: - - -============================ -Faces dataset decompositions -============================ - -This example applies to :ref:`olivetti_faces` different unsupervised -matrix decomposition (dimension reduction) methods from the module -:py:mod:`sklearn.decomposition` (see the documentation chapter -:ref:`decompositions`) . - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_faces_decomposition_001.png - :scale: 47 - - * - - .. image:: images/plot_faces_decomposition_002.png - :scale: 47 - - * - - .. image:: images/plot_faces_decomposition_003.png - :scale: 47 - - * - - .. image:: images/plot_faces_decomposition_004.png - :scale: 47 - - * - - .. image:: images/plot_faces_decomposition_005.png - :scale: 47 - - * - - .. image:: images/plot_faces_decomposition_006.png - :scale: 47 - - * - - .. image:: images/plot_faces_decomposition_007.png - :scale: 47 - - * - - .. image:: images/plot_faces_decomposition_008.png - :scale: 47 - - * - - .. image:: images/plot_faces_decomposition_009.png - :scale: 47 - - -**Script output**:: - - Dataset consists of 400 faces - Extracting the top 6 Eigenfaces - RandomizedPCA... - done in 1.427s - Extracting the top 6 Non-negative components - NMF... - done in 2.924s - Extracting the top 6 Independent components - FastICA... - done in 0.575s - Extracting the top 6 Sparse comp. - MiniBatchSparsePCA... - done in 1.358s - Extracting the top 6 MiniBatchDictionaryLearning... - done in 1.811s - Extracting the top 6 Cluster centers - MiniBatchKMeans... - done in 0.094s - Extracting the top 6 Factor Analysis components - FA... - done in 2.773s - - - -**Python source code:** :download:`plot_faces_decomposition.py ` - -.. literalinclude:: plot_faces_decomposition.py - :lines: 12- - -**Total running time of the example:** 12.96 seconds -( 0 minutes 12.96 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_ica_blind_source_separation.txt b/0.15/_sources/auto_examples/decomposition/plot_ica_blind_source_separation.txt deleted file mode 100644 index 418a029d4373f..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_ica_blind_source_separation.txt +++ /dev/null @@ -1,35 +0,0 @@ - - -.. _example_decomposition_plot_ica_blind_source_separation.py: - - -===================================== -Blind source separation using FastICA -===================================== - -An example of estimating sources from noisy data. - -:ref:`ICA` is used to estimate sources given noisy measurements. -Imagine 3 instruments playing simultaneously and 3 microphones -recording the mixed signals. ICA is used to recover the sources -ie. what is played by each instrument. Importantly, PCA fails -at recovering our `instruments` since the related signals reflect -non-Gaussian processes. - - - - -.. image:: images/plot_ica_blind_source_separation_001.png - :align: center - - - - -**Python source code:** :download:`plot_ica_blind_source_separation.py ` - -.. literalinclude:: plot_ica_blind_source_separation.py - :lines: 16- - -**Total running time of the example:** 0.21 seconds -( 0 minutes 0.21 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_ica_vs_pca.txt b/0.15/_sources/auto_examples/decomposition/plot_ica_vs_pca.txt deleted file mode 100644 index ccd8ebeb2d2a3..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_ica_vs_pca.txt +++ /dev/null @@ -1,49 +0,0 @@ - - -.. _example_decomposition_plot_ica_vs_pca.py: - - -========================== -FastICA on 2D point clouds -========================== - -This example illustrates visually in the feature space a comparison by -results using two different component analysis techniques. - -:ref:`ICA` vs :ref:`PCA`. - -Representing ICA in the feature space gives the view of 'geometric ICA': -ICA is an algorithm that finds directions in the feature space -corresponding to projections with high non-Gaussianity. These directions -need not be orthogonal in the original feature space, but they are -orthogonal in the whitened feature space, in which all directions -correspond to the same variance. - -PCA, on the other hand, finds orthogonal directions in the raw feature -space that correspond to directions accounting for maximum variance. - -Here we simulate independent sources using a highly non-Gaussian -process, 2 student T with a low number of degrees of freedom (top left -figure). We mix them to create observations (top right figure). -In this raw observation space, directions identified by PCA are -represented by orange vectors. We represent the signal in the PCA space, -after whitening by the variance corresponding to the PCA vectors (lower -left). Running ICA corresponds to finding a rotation in this space to -identify the directions of largest non-Gaussianity (lower right). - - - -.. image:: images/plot_ica_vs_pca_001.png - :align: center - - - - -**Python source code:** :download:`plot_ica_vs_pca.py ` - -.. literalinclude:: plot_ica_vs_pca.py - :lines: 30- - -**Total running time of the example:** 0.67 seconds -( 0 minutes 0.67 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_image_denoising.txt b/0.15/_sources/auto_examples/decomposition/plot_image_denoising.txt deleted file mode 100644 index 2595400c9420d..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_image_denoising.txt +++ /dev/null @@ -1,105 +0,0 @@ - - -.. _example_decomposition_plot_image_denoising.py: - - -========================================= -Image denoising using dictionary learning -========================================= - -An example comparing the effect of reconstructing noisy fragments -of the Lena image using firstly online :ref:`DictionaryLearning` and -various transform methods. - -The dictionary is fitted on the distorted left half of the image, and -subsequently used to reconstruct the right half. Note that even better -performance could be achieved by fitting to an undistorted (i.e. -noiseless) image, but here we start from the assumption that it is not -available. - -A common practice for evaluating the results of image denoising is by looking -at the difference between the reconstruction and the original image. If the -reconstruction is perfect this will look like Gaussian noise. - -It can be seen from the plots that the results of :ref:`omp` with two -non-zero coefficients is a bit less biased than when keeping only one -(the edges look less prominent). It is in addition closer from the ground -truth in Frobenius norm. - -The result of :ref:`least_angle_regression` is much more strongly biased: the -difference is reminiscent of the local intensity value of the original image. - -Thresholding is clearly not useful for denoising, but it is here to show that -it can produce a suggestive output with very high speed, and thus be useful -for other tasks such as object classification, where performance is not -necessarily related to visualisation. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_image_denoising_001.png - :scale: 47 - - * - - .. image:: images/plot_image_denoising_002.png - :scale: 47 - - * - - .. image:: images/plot_image_denoising_003.png - :scale: 47 - - * - - .. image:: images/plot_image_denoising_004.png - :scale: 47 - - * - - .. image:: images/plot_image_denoising_005.png - :scale: 47 - - * - - .. image:: images/plot_image_denoising_006.png - :scale: 47 - - -**Script output**:: - - Distorting image... - Extracting reference patches... - done in 0.02s. - Learning the dictionary... - done in 6.76s. - Extracting noisy patches... - done in 0.01s. - Orthogonal Matching Pursuit - 1 atom... - done in 3.64s. - Orthogonal Matching Pursuit - 2 atoms... - done in 10.89s. - Least-angle regression - 5 atoms... - done in 27.84s. - Thresholding - alpha=0.1... - done in 0.70s. - - - -**Python source code:** :download:`plot_image_denoising.py ` - -.. literalinclude:: plot_image_denoising.py - :lines: 34- - -**Total running time of the example:** 55.30 seconds -( 0 minutes 55.30 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_incremental_pca.txt b/0.15/_sources/auto_examples/decomposition/plot_incremental_pca.txt deleted file mode 100644 index f6b24b0a5fabb..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_incremental_pca.txt +++ /dev/null @@ -1,50 +0,0 @@ - - -.. _example_decomposition_plot_incremental_pca.py: - - - -=============== -Incremental PCA -=============== - -Incremental principal component analysis (IPCA) is typically used as a -replacement for principal component analysis (PCA) when the dataset to be -decomposed is too large to fit in memory. IPCA builds a low-rank approximation -for the input data using an amount of memory which is independent of the -number of input data samples. It is still dependent on the input data features, -but changing the batch size allows for control of memory usage. - -This example serves as a visual check that IPCA is able to find a similar -projection of the data to PCA (to a sign flip), while only processing a -few samples at a time. This can be considered a "toy example", as IPCA is -intended for large datasets which do not fit in main memory, requiring -incremental approaches. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_incremental_pca_001.png - :scale: 47 - - * - - .. image:: images/plot_incremental_pca_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_incremental_pca.py ` - -.. literalinclude:: plot_incremental_pca.py - :lines: 21- - -**Total running time of the example:** 0.14 seconds -( 0 minutes 0.14 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_kernel_pca.txt b/0.15/_sources/auto_examples/decomposition/plot_kernel_pca.txt deleted file mode 100644 index 579c2b44fe024..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_kernel_pca.txt +++ /dev/null @@ -1,28 +0,0 @@ - - -.. _example_decomposition_plot_kernel_pca.py: - - -========== -Kernel PCA -========== - -This example shows that Kernel PCA is able to find a projection of the data -that makes data linearly separable. - - - -.. image:: images/plot_kernel_pca_001.png - :align: center - - - - -**Python source code:** :download:`plot_kernel_pca.py ` - -.. literalinclude:: plot_kernel_pca.py - :lines: 9- - -**Total running time of the example:** 1.78 seconds -( 0 minutes 1.78 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_pca_3d.txt b/0.15/_sources/auto_examples/decomposition/plot_pca_3d.txt deleted file mode 100644 index d3d84f1328ef6..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_pca_3d.txt +++ /dev/null @@ -1,40 +0,0 @@ - - -.. _example_decomposition_plot_pca_3d.py: - - -========================================================= -Principal components analysis (PCA) -========================================================= - -These figures aid in illustrating how a point cloud -can be very flat in one direction--which is where PCA -comes in to choose a direction that is not flat. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_pca_3d_001.png - :scale: 47 - - * - - .. image:: images/plot_pca_3d_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_pca_3d.py ` - -.. literalinclude:: plot_pca_3d.py - :lines: 14- - -**Total running time of the example:** 0.23 seconds -( 0 minutes 0.23 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_pca_iris.txt b/0.15/_sources/auto_examples/decomposition/plot_pca_iris.txt deleted file mode 100644 index a66eb274ee65c..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_pca_iris.txt +++ /dev/null @@ -1,31 +0,0 @@ - - -.. _example_decomposition_plot_pca_iris.py: - - -========================================================= -PCA example with Iris Data-set -========================================================= - -Principal Component Analysis applied to the Iris dataset. - -See `here `_ for more -information on this dataset. - - - - -.. image:: images/plot_pca_iris_001.png - :align: center - - - - -**Python source code:** :download:`plot_pca_iris.py ` - -.. literalinclude:: plot_pca_iris.py - :lines: 15- - -**Total running time of the example:** 0.11 seconds -( 0 minutes 0.11 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_pca_vs_fa_model_selection.txt b/0.15/_sources/auto_examples/decomposition/plot_pca_vs_fa_model_selection.txt deleted file mode 100644 index 453c42fbe9846..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_pca_vs_fa_model_selection.txt +++ /dev/null @@ -1,64 +0,0 @@ - - -.. _example_decomposition_plot_pca_vs_fa_model_selection.py: - - -================================================================= -Model selection with Probabilistic (PCA) and Factor Analysis (FA) -================================================================= - -Probabilistic PCA and Factor Analysis are probabilistic models. -The consequence is that the likelihood of new data can be used -for model selection and covariance estimation. -Here we compare PCA and FA with cross-validation on low rank data corrupted -with homoscedastic noise (noise variance -is the same for each feature) or heteroscedastic noise (noise variance -is the different for each feature). In a second step we compare the model -likelihood to the likelihoods obtained from shrinkage covariance estimators. - -One can observe that with homoscedastic noise both FA and PCA succeed -in recovering the size of the low rank subspace. The likelihood with PCA -is higher than FA in this case. However PCA fails and overestimates -the rank when heteroscedastic noise is present. Under appropriate -circumstances the low rank models are more likely than shrinkage models. - -The automatic estimation from -Automatic Choice of Dimensionality for PCA. NIPS 2000: 598-604 -by Thomas P. Minka is also compared. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_pca_vs_fa_model_selection_001.png - :scale: 47 - - * - - .. image:: images/plot_pca_vs_fa_model_selection_002.png - :scale: 47 - - -**Script output**:: - - best n_components by PCA CV = 10 - best n_components by FactorAnalysis CV = 10 - best n_components by PCA MLE = 10 - best n_components by PCA CV = 40 - best n_components by FactorAnalysis CV = 10 - best n_components by PCA MLE = 38 - - - -**Python source code:** :download:`plot_pca_vs_fa_model_selection.py ` - -.. literalinclude:: plot_pca_vs_fa_model_selection.py - :lines: 29- - -**Total running time of the example:** 44.82 seconds -( 0 minutes 44.82 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_pca_vs_lda.txt b/0.15/_sources/auto_examples/decomposition/plot_pca_vs_lda.txt deleted file mode 100644 index 18d4c70a2eea0..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_pca_vs_lda.txt +++ /dev/null @@ -1,52 +0,0 @@ - - -.. _example_decomposition_plot_pca_vs_lda.py: - - -======================================================= -Comparison of LDA and PCA 2D projection of Iris dataset -======================================================= - -The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour -and Virginica) with 4 attributes: sepal length, sepal width, petal length -and petal width. - -Principal Component Analysis (PCA) applied to this data identifies the -combination of attributes (principal components, or directions in the -feature space) that account for the most variance in the data. Here we -plot the different samples on the 2 first principal components. - -Linear Discriminant Analysis (LDA) tries to identify attributes that -account for the most variance *between classes*. In particular, -LDA, in contrast to PCA, is a supervised method, using known class labels. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_pca_vs_lda_001.png - :scale: 47 - - * - - .. image:: images/plot_pca_vs_lda_002.png - :scale: 47 - - -**Script output**:: - - explained variance ratio (first two components): [ 0.92461621 0.05301557] - - - -**Python source code:** :download:`plot_pca_vs_lda.py ` - -.. literalinclude:: plot_pca_vs_lda.py - :lines: 19- - -**Total running time of the example:** 0.13 seconds -( 0 minutes 0.13 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/decomposition/plot_sparse_coding.txt b/0.15/_sources/auto_examples/decomposition/plot_sparse_coding.txt deleted file mode 100644 index fe7ef7a60b16f..0000000000000 --- a/0.15/_sources/auto_examples/decomposition/plot_sparse_coding.txt +++ /dev/null @@ -1,36 +0,0 @@ - - -.. _example_decomposition_plot_sparse_coding.py: - - -=========================================== -Sparse coding with a precomputed dictionary -=========================================== - -Transform a signal as a sparse combination of Ricker wavelets. This example -visually compares different sparse coding methods using the -:class:`sklearn.decomposition.SparseCoder` estimator. The Ricker (also known -as Mexican hat or the second derivative of a Gaussian) is not a particularly -good kernel to represent piecewise constant signals like this one. It can -therefore be seen how much adding different widths of atoms matters and it -therefore motivates learning the dictionary to best fit your type of signals. - -The richer dictionary on the right is not larger in size, heavier subsampling -is performed in order to stay on the same order of magnitude. - - - -.. image:: images/plot_sparse_coding_001.png - :align: center - - - - -**Python source code:** :download:`plot_sparse_coding.py ` - -.. literalinclude:: plot_sparse_coding.py - :lines: 17- - -**Total running time of the example:** 1.04 seconds -( 0 minutes 1.04 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/document_classification_20newsgroups.txt b/0.15/_sources/auto_examples/document_classification_20newsgroups.txt deleted file mode 100644 index 5921107e43a93..0000000000000 --- a/0.15/_sources/auto_examples/document_classification_20newsgroups.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -.. _example_document_classification_20newsgroups.py: - - -====================================================== -Classification of text documents using sparse features -====================================================== - -This is an example showing how scikit-learn can be used to classify documents -by topics using a bag-of-words approach. This example uses a scipy.sparse -matrix to store the features and demonstrates various classifiers that can -efficiently handle sparse matrices. - -The dataset used in this example is the 20 newsgroups dataset. It will be -automatically downloaded, then cached. - -The bar plot indicates the accuracy, training time (normalized) and test time -(normalized) of each classifier. - - - -**Python source code:** :download:`document_classification_20newsgroups.py ` - -.. literalinclude:: document_classification_20newsgroups.py - :lines: 18- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/document_clustering.txt b/0.15/_sources/auto_examples/document_clustering.txt deleted file mode 100644 index 8379ffd4cee5f..0000000000000 --- a/0.15/_sources/auto_examples/document_clustering.txt +++ /dev/null @@ -1,57 +0,0 @@ - - -.. _example_document_clustering.py: - - -======================================= -Clustering text documents using k-means -======================================= - -This is an example showing how the scikit-learn can be used to cluster -documents by topics using a bag-of-words approach. This example uses -a scipy.sparse matrix to store the features instead of standard numpy arrays. - -Two feature extraction methods can be used in this example: - - - TfidfVectorizer uses a in-memory vocabulary (a python dict) to map the most - frequent words to features indices and hence compute a word occurrence - frequency (sparse) matrix. The word frequencies are then reweighted using - the Inverse Document Frequency (IDF) vector collected feature-wise over - the corpus. - - - HashingVectorizer hashes word occurrences to a fixed dimensional space, - possibly with collisions. The word count vectors are then normalized to - each have l2-norm equal to one (projected to the euclidean unit-ball) which - seems to be important for k-means to work in high dimensional space. - - HashingVectorizer does not provide IDF weighting as this is a stateless - model (the fit method does nothing). When IDF weighting is needed it can - be added by pipelining its output to a TfidfTransformer instance. - -Two algorithms are demoed: ordinary k-means and its more scalable cousin -minibatch k-means. - -It can be noted that k-means (and minibatch k-means) are very sensitive to -feature scaling and that in this case the IDF weighting helps improve the -quality of the clustering by quite a lot as measured against the "ground truth" -provided by the class label assignments of the 20 newsgroups dataset. - -This improvement is not visible in the Silhouette Coefficient which is small -for both as this measure seem to suffer from the phenomenon called -"Concentration of Measure" or "Curse of Dimensionality" for high dimensional -datasets such as text data. Other measures such as V-measure and Adjusted Rand -Index are information theoretic based evaluation scores: as they are only based -on cluster assignments rather than distances, hence not affected by the curse -of dimensionality. - -Note: as k-means is optimizing a non-convex objective function, it will likely -end up in a local optimum. Several runs with independent random init might be -necessary to get a good convergence. - - - -**Python source code:** :download:`document_clustering.py ` - -.. literalinclude:: document_clustering.py - :lines: 48- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_adaboost_hastie_10_2.txt b/0.15/_sources/auto_examples/ensemble/plot_adaboost_hastie_10_2.txt deleted file mode 100644 index 1cbb89ea2634c..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_adaboost_hastie_10_2.txt +++ /dev/null @@ -1,40 +0,0 @@ - - -.. _example_ensemble_plot_adaboost_hastie_10_2.py: - - -============================= -Discrete versus Real AdaBoost -============================= - -This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates -the difference in performance between the discrete SAMME [2] boosting -algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluated -on a binary classification task where the target Y is a non-linear function -of 10 input features. - -Discrete SAMME AdaBoost adapts based on errors in predicted class labels -whereas real SAMME.R uses the predicted class probabilities. - -.. [1] T. Hastie, R. Tibshirani and J. Friedman, "Elements of Statistical - Learning Ed. 2", Springer, 2009. - -.. [2] J. Zhu, H. Zou, S. Rosset, T. Hastie, "Multi-class AdaBoost", 2009. - - - - -.. image:: images/plot_adaboost_hastie_10_2_001.png - :align: center - - - - -**Python source code:** :download:`plot_adaboost_hastie_10_2.py ` - -.. literalinclude:: plot_adaboost_hastie_10_2.py - :lines: 21- - -**Total running time of the example:** 5.43 seconds -( 0 minutes 5.43 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_adaboost_multiclass.txt b/0.15/_sources/auto_examples/ensemble/plot_adaboost_multiclass.txt deleted file mode 100644 index 1b571088236eb..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_adaboost_multiclass.txt +++ /dev/null @@ -1,45 +0,0 @@ - - -.. _example_ensemble_plot_adaboost_multiclass.py: - - -===================================== -Multi-class AdaBoosted Decision Trees -===================================== - -This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can -improve prediction accuracy on a multi-class problem. The classification -dataset is constructed by taking a ten-dimensional standard normal distribution -and defining three classes separated by nested concentric ten-dimensional -spheres such that roughly equal numbers of samples are in each class (quantiles -of the :math:`\chi^2` distribution). - -The performance of the SAMME and SAMME.R [1] algorithms are compared. SAMME.R -uses the probability estimates to update the additive model, while SAMME uses -the classifications only. As the example illustrates, the SAMME.R algorithm -typically converges faster than SAMME, achieving a lower test error with fewer -boosting iterations. The error of each algorithm on the test set after each -boosting iteration is shown on the left, the classification error on the test -set of each tree is shown in the middle, and the boost weight of each tree is -shown on the right. All trees have a weight of one in the SAMME.R algorithm and -therefore are not shown. - -.. [1] J. Zhu, H. Zou, S. Rosset, T. Hastie, "Multi-class AdaBoost", 2009. - - - - -.. image:: images/plot_adaboost_multiclass_001.png - :align: center - - - - -**Python source code:** :download:`plot_adaboost_multiclass.py ` - -.. literalinclude:: plot_adaboost_multiclass.py - :lines: 26- - -**Total running time of the example:** 15.13 seconds -( 0 minutes 15.13 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_adaboost_regression.txt b/0.15/_sources/auto_examples/ensemble/plot_adaboost_regression.txt deleted file mode 100644 index 5060ee04dfaf9..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_adaboost_regression.txt +++ /dev/null @@ -1,34 +0,0 @@ - - -.. _example_ensemble_plot_adaboost_regression.py: - - -====================================== -Decision Tree Regression with AdaBoost -====================================== - -A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D -sinusoidal dataset with a small amount of Gaussian noise. -299 boosts (300 decision trees) is compared with a single decision tree -regressor. As the number of boosts is increased the regressor can fit more -detail. - -.. [1] H. Drucker, "Improving Regressors using Boosting Techniques", 1997. - - - - -.. image:: images/plot_adaboost_regression_001.png - :align: center - - - - -**Python source code:** :download:`plot_adaboost_regression.py ` - -.. literalinclude:: plot_adaboost_regression.py - :lines: 15- - -**Total running time of the example:** 0.29 seconds -( 0 minutes 0.29 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_adaboost_twoclass.txt b/0.15/_sources/auto_examples/ensemble/plot_adaboost_twoclass.txt deleted file mode 100644 index 2908c26ff70fb..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_adaboost_twoclass.txt +++ /dev/null @@ -1,38 +0,0 @@ - - -.. _example_ensemble_plot_adaboost_twoclass.py: - - -================== -Two-class AdaBoost -================== - -This example fits an AdaBoosted decision stump on a non-linearly separable -classification dataset composed of two "Gaussian quantiles" clusters -(see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision -boundary and decision scores. The distributions of decision scores are shown -separately for samples of class A and B. The predicted class label for each -sample is determined by the sign of the decision score. Samples with decision -scores greater than zero are classified as B, and are otherwise classified -as A. The magnitude of a decision score determines the degree of likeness with -the predicted class label. Additionally, a new dataset could be constructed -containing a desired purity of class B, for example, by only selecting samples -with a decision score above some value. - - - - -.. image:: images/plot_adaboost_twoclass_001.png - :align: center - - - - -**Python source code:** :download:`plot_adaboost_twoclass.py ` - -.. literalinclude:: plot_adaboost_twoclass.py - :lines: 19- - -**Total running time of the example:** 2.84 seconds -( 0 minutes 2.84 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_bias_variance.txt b/0.15/_sources/auto_examples/ensemble/plot_bias_variance.txt deleted file mode 100644 index 374f6a7662ff5..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_bias_variance.txt +++ /dev/null @@ -1,88 +0,0 @@ - - -.. _example_ensemble_plot_bias_variance.py: - - -============================================================ -Single estimator versus bagging: bias-variance decomposition -============================================================ - -This example illustrates and compares the bias-variance decomposition of the -expected mean squared error of a single estimator against a bagging ensemble. - -In regression, the expected mean squared error of an estimator can be -decomposed in terms of bias, variance and noise. On average over datasets of -the regression problem, the bias term measures the average amount by which the -predictions of the estimator differ from the predictions of the best possible -estimator for the problem (i.e., the Bayes model). The variance term measures -the variability of the predictions of the estimator when fit over different -instances LS of the problem. Finally, the noise measures the irreducible part -of the error which is due the variability in the data. - -The upper left figure illustrates the predictions (in dark red) of a single -decision tree trained over a random dataset LS (the blue dots) of a toy 1d -regression problem. It also illustrates the predictions (in light red) of other -single decision trees trained over other (and different) randomly drawn -instances LS of the problem. Intuitively, the variance term here corresponds to -the width of the beam of predictions (in light red) of the individual -estimators. The larger the variance, the more sensitive are the predictions for -`x` to small changes in the training set. The bias term corresponds to the -difference between the average prediction of the estimator (in cyan) and the -best possible model (in dark blue). On this problem, we can thus observe that -the bias is quite low (both the cyan and the blue curves are close to each -other) while the variance is large (the red beam is rather wide). - -The lower left figure plots the pointwise decomposition of the expected mean -squared error of a single decision tree. It confirms that the bias term (in -blue) is low while the variance is large (in green). It also illustrates the -noise part of the error which, as expected, appears to be constant and around -`0.01`. - -The right figures correspond to the same plots but using instead a bagging -ensemble of decision trees. In both figures, we can observe that the bias term -is larger than in the previous case. In the upper right figure, the difference -between the average prediction (in cyan) and the best possible model is larger -(e.g., notice the offset around `x=2`). In the lower right figure, the bias -curve is also slightly higher than in the lower left figure. In terms of -variance however, the beam of predictions is narrower, which suggests that the -variance is lower. Indeed, as the lower right figure confirms, the variance -term (in green) is lower than for single decision trees. Overall, the bias- -variance decomposition is therefore no longer the same. The tradeoff is better -for bagging: averaging several decision trees fit on bootstrap copies of the -dataset slightly increases the bias term but allows for a larger reduction of -the variance, which results in a lower overall mean squared error (compare the -red curves int the lower figures). The script output also confirms this -intuition. The total error of the bagging ensemble is lower than the total -error of a single decision tree, and this difference indeed mainly stems from a -reduced variance. - -For further details on bias-variance decomposition, see section 7.3 of [1]_. - -References ----------- - -.. [1] T. Hastie, R. Tibshirani and J. Friedman, - "Elements of Statistical Learning", Springer, 2009. - - - - -.. image:: images/plot_bias_variance_001.png - :align: center - - -**Script output**:: - - Tree: 0.0255 (error) = 0.0003 (bias^2) + 0.0152 (var) + 0.0098 (noise) - Bagging(Tree): 0.0196 (error) = 0.0004 (bias^2) + 0.0092 (var) + 0.0098 (noise) - - - -**Python source code:** :download:`plot_bias_variance.py ` - -.. literalinclude:: plot_bias_variance.py - :lines: 64- - -**Total running time of the example:** 0.88 seconds -( 0 minutes 0.88 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_ensemble_oob.txt b/0.15/_sources/auto_examples/ensemble/plot_ensemble_oob.txt deleted file mode 100644 index f36643ccbb36f..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_ensemble_oob.txt +++ /dev/null @@ -1,41 +0,0 @@ - - -.. _example_ensemble_plot_ensemble_oob.py: - - -============================= -OOB Errors for Random Forests -============================= - -The ``RandomForestClassifier`` is trained using *bootstrap aggregation*, where -each new tree is fit from a bootstrap sample of the training observations -:math:`z_i = (x_i, y_i)`. The *out-of-bag* (OOB) error is the average error for -each :math:`z_i` calculated using predictions from the trees that do not -contain :math:`z_i` in their respective bootstrap sample. This allows the -``RandomForestClassifier`` to be fit and validated whilst being trained [1]. - -The example below demonstrates how the OOB error can be measured at the -addition of each new tree during training. The resulting plot allows a -practitioner to approximate a suitable value of ``n_estimators`` at which the -error stabilizes. - -.. [1] T. Hastie, R. Tibshirani and J. Friedman, "Elements of Statistical - Learning Ed. 2", p592-593, Springer, 2009. - - - - -.. image:: images/plot_ensemble_oob_001.png - :align: center - - - - -**Python source code:** :download:`plot_ensemble_oob.py ` - -.. literalinclude:: plot_ensemble_oob.py - :lines: 22- - -**Total running time of the example:** 8.06 seconds -( 0 minutes 8.06 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_forest_importances.txt b/0.15/_sources/auto_examples/ensemble/plot_forest_importances.txt deleted file mode 100644 index aaeade5b8a92a..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_forest_importances.txt +++ /dev/null @@ -1,46 +0,0 @@ - - -.. _example_ensemble_plot_forest_importances.py: - - -========================================= -Feature importances with forests of trees -========================================= - -This examples shows the use of forests of trees to evaluate the importance of -features on an artificial classification task. The red bars are the feature -importances of the forest, along with their inter-trees variability. - -As expected, the plot suggests that 3 features are informative, while the -remaining are not. - - - -.. image:: images/plot_forest_importances_001.png - :align: center - - -**Script output**:: - - Feature ranking: - 1. feature 0 (0.250398) - 2. feature 1 (0.232397) - 3. feature 2 (0.148898) - 4. feature 3 (0.055363) - 5. feature 8 (0.054010) - 6. feature 5 (0.053878) - 7. feature 6 (0.052583) - 8. feature 9 (0.051020) - 9. feature 7 (0.050963) - 10. feature 4 (0.050489) - - - -**Python source code:** :download:`plot_forest_importances.py ` - -.. literalinclude:: plot_forest_importances.py - :lines: 13- - -**Total running time of the example:** 0.67 seconds -( 0 minutes 0.67 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_forest_importances_faces.txt b/0.15/_sources/auto_examples/ensemble/plot_forest_importances_faces.txt deleted file mode 100644 index a6fd8b3504de6..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_forest_importances_faces.txt +++ /dev/null @@ -1,37 +0,0 @@ - - -.. _example_ensemble_plot_forest_importances_faces.py: - - -================================================= -Pixel importances with a parallel forest of trees -================================================= - -This example shows the use of forests of trees to evaluate the importance -of the pixels in an image classification task (faces). The hotter the pixel, -the more important. - -The code below also illustrates how the construction and the computation -of the predictions can be parallelized within multiple jobs. - - - -.. image:: images/plot_forest_importances_faces_001.png - :align: center - - -**Script output**:: - - Fitting ExtraTreesClassifier on faces data with 1 cores... - done in 0.981s - - - -**Python source code:** :download:`plot_forest_importances_faces.py ` - -.. literalinclude:: plot_forest_importances_faces.py - :lines: 13- - -**Total running time of the example:** 1.41 seconds -( 0 minutes 1.41 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_forest_iris.txt b/0.15/_sources/auto_examples/ensemble/plot_forest_iris.txt deleted file mode 100644 index 6bba2dda7d1c7..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_forest_iris.txt +++ /dev/null @@ -1,75 +0,0 @@ - - -.. _example_ensemble_plot_forest_iris.py: - - -==================================================================== -Plot the decision surfaces of ensembles of trees on the iris dataset -==================================================================== - -Plot the decision surfaces of forests of randomized trees trained on pairs of -features of the iris dataset. - -This plot compares the decision surfaces learned by a decision tree classifier -(first column), by a random forest classifier (second column), by an extra- -trees classifier (third column) and by an AdaBoost classifier (fourth column). - -In the first row, the classifiers are built using the sepal width and the sepal -length features only, on the second row using the petal length and sepal length -only, and on the third row using the petal width and the petal length only. - -In descending order of quality, when trained (outside of this example) on all -4 features using 30 estimators and scored using 10 fold cross validation, we see:: - - ExtraTreesClassifier() # 0.95 score - RandomForestClassifier() # 0.94 score - AdaBoost(DecisionTree(max_depth=3)) # 0.94 score - DecisionTree(max_depth=None) # 0.94 score - -Increasing `max_depth` for AdaBoost lowers the standard deviation of the scores (but -the average score does not improve). - -See the console's output for further details about each model. - -In this example you might try to: - -1) vary the ``max_depth`` for the ``DecisionTreeClassifier`` and - ``AdaBoostClassifier``, perhaps try ``max_depth=3`` for the - ``DecisionTreeClassifier`` or ``max_depth=None`` for ``AdaBoostClassifier`` -2) vary ``n_estimators`` - -It is worth noting that RandomForests and ExtraTrees can be fitted in parallel -on many cores as each tree is built independently of the others. AdaBoost's -samples are built sequentially and so do not use multiple cores. - - - -.. image:: images/plot_forest_iris_001.png - :align: center - - -**Script output**:: - - DecisionTree with features [0, 1] has a score of 0.926666666667 - RandomForest with 30 estimators with features [0, 1] has a score of 0.926666666667 - ExtraTrees with 30 estimators with features [0, 1] has a score of 0.926666666667 - AdaBoost with 30 estimators with features [0, 1] has a score of 0.86 - DecisionTree with features [0, 2] has a score of 0.993333333333 - RandomForest with 30 estimators with features [0, 2] has a score of 0.993333333333 - ExtraTrees with 30 estimators with features [0, 2] has a score of 0.993333333333 - AdaBoost with 30 estimators with features [0, 2] has a score of 0.993333333333 - DecisionTree with features [2, 3] has a score of 0.993333333333 - RandomForest with 30 estimators with features [2, 3] has a score of 0.993333333333 - ExtraTrees with 30 estimators with features [2, 3] has a score of 0.993333333333 - AdaBoost with 30 estimators with features [2, 3] has a score of 0.993333333333 - - - -**Python source code:** :download:`plot_forest_iris.py ` - -.. literalinclude:: plot_forest_iris.py - :lines: 41- - -**Total running time of the example:** 6.76 seconds -( 0 minutes 6.76 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_oob.txt b/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_oob.txt deleted file mode 100644 index 398cea23c2378..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_oob.txt +++ /dev/null @@ -1,49 +0,0 @@ - - -.. _example_ensemble_plot_gradient_boosting_oob.py: - - -====================================== -Gradient Boosting Out-of-Bag estimates -====================================== - -Out-of-bag (OOB) estimates can be a useful heuristic to estimate -the "optimal" number of boosting iterations. -OOB estimates are almost identical to cross-validation estimates but -they can be computed on-the-fly without the need for repeated model -fitting. -OOB estimates are only available for Stochastic Gradient Boosting -(i.e. ``subsample < 1.0``), the estimates are derived from the improvement -in loss based on the examples not included in the boostrap sample -(the so-called out-of-bag examples). -The OOB estimator is a pessimistic estimator of the true -test loss, but remains a fairly good approximation for a small number of trees. - -The figure shows the cumulative sum of the negative OOB improvements -as a function of the boosting iteration. As you can see, it tracks the test -loss for the first hundred iterations but then diverges in a -pessimistic way. -The figure also shows the performance of 3-fold cross validation which -usually gives a better estimate of the test loss -but is computationally more demanding. - - - -.. image:: images/plot_gradient_boosting_oob_001.png - :align: center - - -**Script output**:: - - Accuracy: 0.6840 - - - -**Python source code:** :download:`plot_gradient_boosting_oob.py ` - -.. literalinclude:: plot_gradient_boosting_oob.py - :lines: 26- - -**Total running time of the example:** 3.79 seconds -( 0 minutes 3.79 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_quantile.txt b/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_quantile.txt deleted file mode 100644 index 6bbdb884a437a..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_quantile.txt +++ /dev/null @@ -1,28 +0,0 @@ - - -.. _example_ensemble_plot_gradient_boosting_quantile.py: - - -===================================================== -Prediction Intervals for Gradient Boosting Regression -===================================================== - -This example shows how quantile regression can be used -to create prediction intervals. - - - -.. image:: images/plot_gradient_boosting_quantile_001.png - :align: center - - - - -**Python source code:** :download:`plot_gradient_boosting_quantile.py ` - -.. literalinclude:: plot_gradient_boosting_quantile.py - :lines: 9- - -**Total running time of the example:** 0.31 seconds -( 0 minutes 0.31 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_regression.txt b/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_regression.txt deleted file mode 100644 index 00fc073e6722e..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_regression.txt +++ /dev/null @@ -1,34 +0,0 @@ - - -.. _example_ensemble_plot_gradient_boosting_regression.py: - - -============================ -Gradient Boosting regression -============================ - -Demonstrate Gradient Boosting on the boston housing dataset. - -This example fits a Gradient Boosting model with least squares loss and -500 regression trees of depth 4. - - - -.. image:: images/plot_gradient_boosting_regression_001.png - :align: center - - -**Script output**:: - - MSE: 6.4731 - - - -**Python source code:** :download:`plot_gradient_boosting_regression.py ` - -.. literalinclude:: plot_gradient_boosting_regression.py - :lines: 11- - -**Total running time of the example:** 0.91 seconds -( 0 minutes 0.91 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_regularization.txt b/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_regularization.txt deleted file mode 100644 index bff71dfea61df..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_gradient_boosting_regularization.txt +++ /dev/null @@ -1,41 +0,0 @@ - - -.. _example_ensemble_plot_gradient_boosting_regularization.py: - - -================================ -Gradient Boosting regularization -================================ - -Illustration of the effect of different regularization strategies -for Gradient Boosting. The example is taken from Hastie et al 2009. - -The loss function used is binomial deviance. Regularization via -shrinkage (``learning_rate < 1.0``) improves performance considerably. -In combination with shrinkage, stochastic gradient boosting -(``subsample < 1.0``) can produce more accurate models by reducing the -variance via bagging. -Subsampling without shrinkage usually does poorly. -Another strategy to reduce the variance is by subsampling the features -analogous to the random splits in Random Forests -(via the ``max_features`` parameter). - -.. [1] T. Hastie, R. Tibshirani and J. Friedman, "Elements of Statistical - Learning Ed. 2", Springer, 2009. - - - -.. image:: images/plot_gradient_boosting_regularization_001.png - :align: center - - - - -**Python source code:** :download:`plot_gradient_boosting_regularization.py ` - -.. literalinclude:: plot_gradient_boosting_regularization.py - :lines: 22- - -**Total running time of the example:** 24.73 seconds -( 0 minutes 24.73 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_partial_dependence.txt b/0.15/_sources/auto_examples/ensemble/plot_partial_dependence.txt deleted file mode 100644 index 98284002e7520..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_partial_dependence.txt +++ /dev/null @@ -1,86 +0,0 @@ - - -.. _example_ensemble_plot_partial_dependence.py: - - -======================== -Partial Dependence Plots -======================== - -Partial dependence plots show the dependence between the target function [1]_ -and a set of 'target' features, marginalizing over the -values of all other features (the complement features). Due to the limits -of human perception the size of the target feature set must be small (usually, -one or two) thus the target features are usually chosen among the most -important features -(see :attr:`~sklearn.ensemble.GradientBoostingRegressor.feature_importances_`). - -This example shows how to obtain partial dependence plots from a -:class:`~sklearn.ensemble.GradientBoostingRegressor` trained on the California -housing dataset. The example is taken from [HTF2009]_. - -The plot shows four one-way and one two-way partial dependence plots. -The target variables for the one-way PDP are: -median income (`MedInc`), avg. occupants per household (`AvgOccup`), -median house age (`HouseAge`), and avg. rooms per household (`AveRooms`). - -We can clearly see that the median house price shows a linear relationship -with the median income (top left) and that the house price drops when the -avg. occupants per household increases (top middle). -The top right plot shows that the house age in a district does not have -a strong influence on the (median) house price; so does the average rooms -per household. -The tick marks on the x-axis represent the deciles of the feature values -in the training data. - -Partial dependence plots with two target features enable us to visualize -interactions among them. The two-way partial dependence plot shows the -dependence of median house price on joint values of house age and avg. -occupants per household. We can clearly see an interaction between the -two features: -For an avg. occupancy greater than two, the house price is nearly independent -of the house age, whereas for values less than two there is a strong dependence -on age. - -.. [HTF2009] T. Hastie, R. Tibshirani and J. Friedman, - "Elements of Statistical Learning Ed. 2", Springer, 2009. - -.. [1] For classification you can think of it as the regression score before - the link function. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_partial_dependence_001.png - :scale: 47 - - * - - .. image:: images/plot_partial_dependence_002.png - :scale: 47 - - -**Script output**:: - - ________________________________________________________________________________ - Training GBRT... - done. - ________________________________________________________________________________ - Convenience plot with ``partial_dependence_plots`` - ________________________________________________________________________________ - Custom 3d plot via ``partial_dependence`` - - - -**Python source code:** :download:`plot_partial_dependence.py ` - -.. literalinclude:: plot_partial_dependence.py - :lines: 47- - -**Total running time of the example:** 4.65 seconds -( 0 minutes 4.65 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_random_forest_embedding.txt b/0.15/_sources/auto_examples/ensemble/plot_random_forest_embedding.txt deleted file mode 100644 index bc1b828575806..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_random_forest_embedding.txt +++ /dev/null @@ -1,46 +0,0 @@ - - -.. _example_ensemble_plot_random_forest_embedding.py: - - -========================================================= -Hashing feature transformation using Totally Random Trees -========================================================= - -RandomTreesEmbedding provides a way to map data to a -very high-dimensional, sparse representation, which might -be beneficial for classification. -The mapping is completely unsupervised and very efficient. - -This example visualizes the partitions given by several -trees and shows how the transformation can also be used for -non-linear dimensionality reduction or non-linear classification. - -Points that are neighboring often share the same leaf of a tree and therefore -share large parts of their hashed representation. This allows to -separate two concentric circles simply based on the principal components of the -transformed data. - -In high-dimensional spaces, linear classifiers often achieve -excellent accuracy. For sparse binary data, BernoulliNB -is particularly well-suited. The bottom row compares the -decision boundary obtained by BernoulliNB in the transformed -space with an ExtraTreesClassifier forests learned on the -original data. - - - -.. image:: images/plot_random_forest_embedding_001.png - :align: center - - - - -**Python source code:** :download:`plot_random_forest_embedding.py ` - -.. literalinclude:: plot_random_forest_embedding.py - :lines: 27- - -**Total running time of the example:** 0.39 seconds -( 0 minutes 0.39 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_voting_decision_regions.txt b/0.15/_sources/auto_examples/ensemble/plot_voting_decision_regions.txt deleted file mode 100644 index c2421032b0220..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_voting_decision_regions.txt +++ /dev/null @@ -1,40 +0,0 @@ - - -.. _example_ensemble_plot_voting_decision_regions.py: - - -================================================== -Plot the decision boundaries of a VotingClassifier -================================================== - -Plot the decision boundaries of a `VotingClassifier` for -two features of the Iris dataset. - -Plot the class probabilities of the first sample in a toy dataset -predicted by three different classifiers and averaged by the -`VotingClassifier`. - -First, three examplary classifiers are initialized (`DecisionTreeClassifier`, -`KNeighborsClassifier`, and `SVC`) and used to initialize a -soft-voting `VotingClassifier` with weights `[2, 1, 2]`, which means that -the predicted probabilities of the `DecisionTreeClassifier` and `SVC` -count 5 times as much as the weights of the `KNeighborsClassifier` classifier -when the averaged probability is calculated. - - - - -.. image:: images/plot_voting_decision_regions_001.png - :align: center - - - - -**Python source code:** :download:`plot_voting_decision_regions.py ` - -.. literalinclude:: plot_voting_decision_regions.py - :lines: 21- - -**Total running time of the example:** 0.42 seconds -( 0 minutes 0.42 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/ensemble/plot_voting_probas.txt b/0.15/_sources/auto_examples/ensemble/plot_voting_probas.txt deleted file mode 100644 index 56fd82134a730..0000000000000 --- a/0.15/_sources/auto_examples/ensemble/plot_voting_probas.txt +++ /dev/null @@ -1,41 +0,0 @@ - - -.. _example_ensemble_plot_voting_probas.py: - - -=========================================================== -Plot class probabilities calculated by the VotingClassifier -=========================================================== - -Plot the class probabilities of the first sample in a toy dataset -predicted by three different classifiers and averaged by the -`VotingClassifier`. - -First, three examplary classifiers are initialized (`LogisticRegression`, -`GaussianNB`, and `RandomForestClassifier`) and used to initialize a -soft-voting `VotingClassifier` with weights `[1, 1, 5]`, which means that -the predicted probabilities of the `RandomForestClassifier` count 5 times -as much as the weights of the other classifiers when the averaged probability -is calculated. - -To visualize the probability weighting, we fit each classifier on the training -set and plot the predicted class probabilities for the first sample in this -example dataset. - - - - -.. image:: images/plot_voting_probas_001.png - :align: center - - - - -**Python source code:** :download:`plot_voting_probas.py ` - -.. literalinclude:: plot_voting_probas.py - :lines: 22- - -**Total running time of the example:** 0.14 seconds -( 0 minutes 0.14 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/exercises/digits_classification_exercise.txt b/0.15/_sources/auto_examples/exercises/digits_classification_exercise.txt deleted file mode 100644 index f57ec38ea93ee..0000000000000 --- a/0.15/_sources/auto_examples/exercises/digits_classification_exercise.txt +++ /dev/null @@ -1,22 +0,0 @@ - - -.. _example_exercises_digits_classification_exercise.py: - - -================================ -Digits Classification Exercise -================================ - -A tutorial exercise regarding the use of classification techniques on -the Digits dataset. - -This exercise is used in the :ref:`clf_tut` part of the -:ref:`supervised_learning_tut` section of the -:ref:`stat_learn_tut_index`. - - -**Python source code:** :download:`digits_classification_exercise.py ` - -.. literalinclude:: digits_classification_exercise.py - :lines: 13- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/exercises/plot_cv_diabetes.txt b/0.15/_sources/auto_examples/exercises/plot_cv_diabetes.txt deleted file mode 100644 index d38e55347ebab..0000000000000 --- a/0.15/_sources/auto_examples/exercises/plot_cv_diabetes.txt +++ /dev/null @@ -1,44 +0,0 @@ - - -.. _example_exercises_plot_cv_diabetes.py: - - -=============================================== -Cross-validation on diabetes Dataset Exercise -=============================================== - -A tutorial excercise which uses cross-validation with linear models. - -This exercise is used in the :ref:`cv_estimators_tut` part of the -:ref:`model_selection_tut` section of the :ref:`stat_learn_tut_index`. - - - -.. image:: images/plot_cv_diabetes_001.png - :align: center - - -**Script output**:: - - Answer to the bonus question: how much can you trust the selection of alpha? - - Alpha parameters maximising the generalization score on different - subsets of the data: - [fold 0] alpha: 0.10405, score: 0.53573 - [fold 1] alpha: 0.05968, score: 0.16278 - [fold 2] alpha: 0.10405, score: 0.44437 - - Answer: Not very much since we obtained different alphas for different - subsets of the data and moreover, the scores for these alphas differ - quite substantially. - - - -**Python source code:** :download:`plot_cv_diabetes.py ` - -.. literalinclude:: plot_cv_diabetes.py - :lines: 11- - -**Total running time of the example:** 0.27 seconds -( 0 minutes 0.27 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/exercises/plot_cv_digits.txt b/0.15/_sources/auto_examples/exercises/plot_cv_digits.txt deleted file mode 100644 index 4e59944fc025d..0000000000000 --- a/0.15/_sources/auto_examples/exercises/plot_cv_digits.txt +++ /dev/null @@ -1,30 +0,0 @@ - - -.. _example_exercises_plot_cv_digits.py: - - -============================================= -Cross-validation on Digits Dataset Exercise -============================================= - -A tutorial excercise using Cross-validation with an SVM on the Digits dataset. - -This exercise is used in the :ref:`cv_generators_tut` part of the -:ref:`model_selection_tut` section of the :ref:`stat_learn_tut_index`. - - - -.. image:: images/plot_cv_digits_001.png - :align: center - - - - -**Python source code:** :download:`plot_cv_digits.py ` - -.. literalinclude:: plot_cv_digits.py - :lines: 11- - -**Total running time of the example:** 6.27 seconds -( 0 minutes 6.27 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/exercises/plot_iris_exercise.txt b/0.15/_sources/auto_examples/exercises/plot_iris_exercise.txt deleted file mode 100644 index e27cb7ce0eafb..0000000000000 --- a/0.15/_sources/auto_examples/exercises/plot_iris_exercise.txt +++ /dev/null @@ -1,45 +0,0 @@ - - -.. _example_exercises_plot_iris_exercise.py: - - -================================ -SVM Exercise -================================ - -A tutorial exercise for using different SVM kernels. - -This exercise is used in the :ref:`using_kernels_tut` part of the -:ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_iris_exercise_000.png - :scale: 47 - - * - - .. image:: images/plot_iris_exercise_001.png - :scale: 47 - - * - - .. image:: images/plot_iris_exercise_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_iris_exercise.py ` - -.. literalinclude:: plot_iris_exercise.py - :lines: 11- - -**Total running time of the example:** 8.48 seconds -( 0 minutes 8.48 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/feature_selection/feature_selection_pipeline.txt b/0.15/_sources/auto_examples/feature_selection/feature_selection_pipeline.txt deleted file mode 100644 index ee245fe513cd4..0000000000000 --- a/0.15/_sources/auto_examples/feature_selection/feature_selection_pipeline.txt +++ /dev/null @@ -1,18 +0,0 @@ - - -.. _example_feature_selection_feature_selection_pipeline.py: - - -================== -Pipeline Anova SVM -================== - -Simple usage of Pipeline that runs successively a univariate -feature selection with anova and then a C-SVM of the selected features. - - -**Python source code:** :download:`feature_selection_pipeline.py ` - -.. literalinclude:: feature_selection_pipeline.py - :lines: 9- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/feature_selection/plot_feature_selection.txt b/0.15/_sources/auto_examples/feature_selection/plot_feature_selection.txt deleted file mode 100644 index 1a763c7448973..0000000000000 --- a/0.15/_sources/auto_examples/feature_selection/plot_feature_selection.txt +++ /dev/null @@ -1,41 +0,0 @@ - - -.. _example_feature_selection_plot_feature_selection.py: - - -=============================== -Univariate Feature Selection -=============================== - -An example showing univariate feature selection. - -Noisy (non informative) features are added to the iris data and -univariate feature selection is applied. For each feature, we plot the -p-values for the univariate feature selection and the corresponding -weights of an SVM. We can see that univariate feature selection -selects the informative features and that these have larger SVM weights. - -In the total set of features, only the 4 first ones are significant. We -can see that they have the highest score with univariate feature -selection. The SVM assigns a large weight to one of these features, but also -Selects many of the non-informative features. -Applying univariate feature selection before the SVM -increases the SVM weight attributed to the significant features, and will -thus improve classification. - - - -.. image:: images/plot_feature_selection_001.png - :align: center - - - - -**Python source code:** :download:`plot_feature_selection.py ` - -.. literalinclude:: plot_feature_selection.py - :lines: 22- - -**Total running time of the example:** 0.14 seconds -( 0 minutes 0.14 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/feature_selection/plot_permutation_test_for_classification.txt b/0.15/_sources/auto_examples/feature_selection/plot_permutation_test_for_classification.txt deleted file mode 100644 index 73f6bfe802263..0000000000000 --- a/0.15/_sources/auto_examples/feature_selection/plot_permutation_test_for_classification.txt +++ /dev/null @@ -1,36 +0,0 @@ - - -.. _example_feature_selection_plot_permutation_test_for_classification.py: - - -================================================================= -Test with permutations the significance of a classification score -================================================================= - -In order to test if a classification score is significative a technique -in repeating the classification procedure after randomizing, permuting, -the labels. The p-value is then given by the percentage of runs for -which the score obtained is greater than the classification score -obtained in the first place. - - - - -.. image:: images/plot_permutation_test_for_classification_001.png - :align: center - - -**Script output**:: - - Classification score 0.513333333333 (pvalue : 0.00990099009901) - - - -**Python source code:** :download:`plot_permutation_test_for_classification.py ` - -.. literalinclude:: plot_permutation_test_for_classification.py - :lines: 13- - -**Total running time of the example:** 7.64 seconds -( 0 minutes 7.64 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/feature_selection/plot_rfe_digits.txt b/0.15/_sources/auto_examples/feature_selection/plot_rfe_digits.txt deleted file mode 100644 index 6695baeeec5d0..0000000000000 --- a/0.15/_sources/auto_examples/feature_selection/plot_rfe_digits.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_feature_selection_plot_rfe_digits.py: - - -============================= -Recursive feature elimination -============================= - -A recursive feature elimination example showing the relevance of pixels in -a digit classification task. - -.. note:: - - See also :ref:`example_feature_selection_plot_rfe_with_cross_validation.py` - - - - -.. image:: images/plot_rfe_digits_001.png - :align: center - - - - -**Python source code:** :download:`plot_rfe_digits.py ` - -.. literalinclude:: plot_rfe_digits.py - :lines: 14- - -**Total running time of the example:** 5.46 seconds -( 0 minutes 5.46 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/feature_selection/plot_rfe_with_cross_validation.txt b/0.15/_sources/auto_examples/feature_selection/plot_rfe_with_cross_validation.txt deleted file mode 100644 index 2985bba64c3d9..0000000000000 --- a/0.15/_sources/auto_examples/feature_selection/plot_rfe_with_cross_validation.txt +++ /dev/null @@ -1,32 +0,0 @@ - - -.. _example_feature_selection_plot_rfe_with_cross_validation.py: - - -=================================================== -Recursive feature elimination with cross-validation -=================================================== - -A recursive feature elimination example with automatic tuning of the -number of features selected with cross-validation. - - - -.. image:: images/plot_rfe_with_cross_validation_001.png - :align: center - - -**Script output**:: - - Optimal number of features : 3 - - - -**Python source code:** :download:`plot_rfe_with_cross_validation.py ` - -.. literalinclude:: plot_rfe_with_cross_validation.py - :lines: 9- - -**Total running time of the example:** 2.65 seconds -( 0 minutes 2.65 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/feature_selection_pipeline.txt b/0.15/_sources/auto_examples/feature_selection_pipeline.txt deleted file mode 100644 index 506400e652103..0000000000000 --- a/0.15/_sources/auto_examples/feature_selection_pipeline.txt +++ /dev/null @@ -1,18 +0,0 @@ - - -.. _example_feature_selection_pipeline.py: - - -================== -Pipeline Anova SVM -================== - -Simple usage of Pipeline that runs successively a univariate -feature selection with anova and then a C-SVM of the selected features. - - -**Python source code:** :download:`feature_selection_pipeline.py ` - -.. literalinclude:: feature_selection_pipeline.py - :lines: 9- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/feature_stacker.txt b/0.15/_sources/auto_examples/feature_stacker.txt deleted file mode 100644 index d7fe25ae4e8fa..0000000000000 --- a/0.15/_sources/auto_examples/feature_stacker.txt +++ /dev/null @@ -1,26 +0,0 @@ - - -.. _example_feature_stacker.py: - - -================================================= -Concatenating multiple feature extraction methods -================================================= - -In many real-world examples, there are many ways to extract features from a -dataset. Often it is beneficial to combine several methods to obtain good -performance. This example shows how to use ``FeatureUnion`` to combine -features obtained by PCA and univariate selection. - -Combining features using this transformer has the benefit that it allows -cross validation and grid searches over the whole process. - -The combination used in this example is not particularly helpful on this -dataset and is only used to illustrate the usage of FeatureUnion. - - -**Python source code:** :download:`feature_stacker.py ` - -.. literalinclude:: feature_stacker.py - :lines: 17- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/gaussian_process/gp_diabetes_dataset.txt b/0.15/_sources/auto_examples/gaussian_process/gp_diabetes_dataset.txt deleted file mode 100644 index 3be5b31fdf890..0000000000000 --- a/0.15/_sources/auto_examples/gaussian_process/gp_diabetes_dataset.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -.. _example_gaussian_process_gp_diabetes_dataset.py: - - -======================================================================== -Gaussian Processes regression: goodness-of-fit on the 'diabetes' dataset -======================================================================== - -This example consists in fitting a Gaussian Process model onto the diabetes -dataset. - -The correlation parameters are determined by means of maximum likelihood -estimation (MLE). An anisotropic squared exponential correlation model with a -constant regression model are assumed. We also used a nugget = 1e-2 in order to -account for the (strong) noise in the targets. - -We compute then compute a cross-validation estimate of the coefficient of -determination (R2) without reperforming MLE, using the set of correlation -parameters found on the whole dataset. - - -**Python source code:** :download:`gp_diabetes_dataset.py ` - -.. literalinclude:: gp_diabetes_dataset.py - :lines: 21- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.txt b/0.15/_sources/auto_examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.txt deleted file mode 100644 index 0e24113ff4e63..0000000000000 --- a/0.15/_sources/auto_examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_gaussian_process_plot_gp_probabilistic_classification_after_regression.py: - - -============================================================================== -Gaussian Processes classification example: exploiting the probabilistic output -============================================================================== - -A two-dimensional regression exercise with a post-processing allowing for -probabilistic classification thanks to the Gaussian property of the prediction. - -The figure illustrates the probability that the prediction is negative with -respect to the remaining uncertainty in the prediction. The red and blue lines -corresponds to the 95% confidence interval on the prediction of the zero level -set. - - - -.. image:: images/plot_gp_probabilistic_classification_after_regression_001.png - :align: center - - - - -**Python source code:** :download:`plot_gp_probabilistic_classification_after_regression.py ` - -.. literalinclude:: plot_gp_probabilistic_classification_after_regression.py - :lines: 17- - -**Total running time of the example:** 0.16 seconds -( 0 minutes 0.16 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/gaussian_process/plot_gp_regression.txt b/0.15/_sources/auto_examples/gaussian_process/plot_gp_regression.txt deleted file mode 100644 index 8b87c3a4cfe75..0000000000000 --- a/0.15/_sources/auto_examples/gaussian_process/plot_gp_regression.txt +++ /dev/null @@ -1,56 +0,0 @@ - - -.. _example_gaussian_process_plot_gp_regression.py: - - -========================================================= -Gaussian Processes regression: basic introductory example -========================================================= - -A simple one-dimensional regression exercise computed in two different ways: - -1. A noise-free case with a cubic correlation model -2. A noisy case with a squared Euclidean correlation model - -In both cases, the model parameters are estimated using the maximum -likelihood principle. - -The figures illustrate the interpolating property of the Gaussian Process -model as well as its probabilistic nature in the form of a pointwise 95% -confidence interval. - -Note that the parameter ``nugget`` is applied as a Tikhonov regularization -of the assumed covariance between the training points. In the special case -of the squared euclidean correlation model, nugget is mathematically equivalent -to a normalized variance: That is - -.. math:: - \mathrm{nugget}_i = \left[\frac{\sigma_i}{y_i}\right]^2 - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_gp_regression_001.png - :scale: 47 - - * - - .. image:: images/plot_gp_regression_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_gp_regression.py ` - -.. literalinclude:: plot_gp_regression.py - :lines: 30- - -**Total running time of the example:** 1.03 seconds -( 0 minutes 1.03 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/grid_search_digits.txt b/0.15/_sources/auto_examples/grid_search_digits.txt deleted file mode 100644 index c6624161fb505..0000000000000 --- a/0.15/_sources/auto_examples/grid_search_digits.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -.. _example_grid_search_digits.py: - - -============================================================ -Parameter estimation using grid search with cross-validation -============================================================ - -This examples shows how a classifier is optimized by cross-validation, -which is done using the :class:`sklearn.grid_search.GridSearchCV` object -on a development set that comprises only half of the available labeled data. - -The performance of the selected hyper-parameters and trained model is -then measured on a dedicated evaluation set that was not used during -the model selection step. - -More details on tools available for model selection can be found in the -sections on :ref:`cross_validation` and :ref:`grid_search`. - - - -**Python source code:** :download:`grid_search_digits.py ` - -.. literalinclude:: grid_search_digits.py - :lines: 18- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/grid_search_text_feature_extraction.txt b/0.15/_sources/auto_examples/grid_search_text_feature_extraction.txt deleted file mode 100644 index 30c393c768bdd..0000000000000 --- a/0.15/_sources/auto_examples/grid_search_text_feature_extraction.txt +++ /dev/null @@ -1,52 +0,0 @@ - - -.. _example_grid_search_text_feature_extraction.py: - - -========================================================== -Sample pipeline for text feature extraction and evaluation -========================================================== - -The dataset used in this example is the 20 newsgroups dataset which will be -automatically downloaded and then cached and reused for the document -classification example. - -You can adjust the number of categories by giving their names to the dataset -loader or setting them to None to get the 20 of them. - -Here is a sample output of a run on a quad-core machine:: - - Loading 20 newsgroups dataset for categories: - ['alt.atheism', 'talk.religion.misc'] - 1427 documents - 2 categories - - Performing grid search... - pipeline: ['vect', 'tfidf', 'clf'] - parameters: - {'clf__alpha': (1.0000000000000001e-05, 9.9999999999999995e-07), - 'clf__n_iter': (10, 50, 80), - 'clf__penalty': ('l2', 'elasticnet'), - 'tfidf__use_idf': (True, False), - 'vect__max_n': (1, 2), - 'vect__max_df': (0.5, 0.75, 1.0), - 'vect__max_features': (None, 5000, 10000, 50000)} - done in 1737.030s - - Best score: 0.940 - Best parameters set: - clf__alpha: 9.9999999999999995e-07 - clf__n_iter: 50 - clf__penalty: 'elasticnet' - tfidf__use_idf: True - vect__max_n: 2 - vect__max_df: 0.75 - vect__max_features: 50000 - - - -**Python source code:** :download:`grid_search_text_feature_extraction.py ` - -.. literalinclude:: grid_search_text_feature_extraction.py - :lines: 43- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/hashing_vs_dict_vectorizer.txt b/0.15/_sources/auto_examples/hashing_vs_dict_vectorizer.txt deleted file mode 100644 index 984b0f4c7bac8..0000000000000 --- a/0.15/_sources/auto_examples/hashing_vs_dict_vectorizer.txt +++ /dev/null @@ -1,26 +0,0 @@ - - -.. _example_hashing_vs_dict_vectorizer.py: - - -=========================================== -FeatureHasher and DictVectorizer Comparison -=========================================== - -Compares FeatureHasher and DictVectorizer by using both to vectorize -text documents. - -The example demonstrates syntax and speed only; it doesn't actually do -anything useful with the extracted vectors. See the example scripts -{document_classification_20newsgroups,clustering}.py for actual learning -on text documents. - -A discrepancy between the number of terms reported for DictVectorizer and -for FeatureHasher is to be expected due to hash collisions. - - -**Python source code:** :download:`hashing_vs_dict_vectorizer.py ` - -.. literalinclude:: hashing_vs_dict_vectorizer.py - :lines: 17- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/hetero_feature_union.txt b/0.15/_sources/auto_examples/hetero_feature_union.txt deleted file mode 100644 index 56366a65d6933..0000000000000 --- a/0.15/_sources/auto_examples/hetero_feature_union.txt +++ /dev/null @@ -1,34 +0,0 @@ - - -.. _example_hetero_feature_union.py: - - -============================================= -Feature Union with Heterogeneous Data Sources -============================================= - -Datasets can often contain components of that require different feature -extraction and processing pipelines. This scenario might occur when: - -1. Your dataset consists of heterogeneous data types (e.g. raster images and - text captions) -2. Your dataset is stored in a Pandas DataFrame and different columns - require different processing pipelines. - -This example demonstrates how to use -:class:`sklearn.feature_extraction.FeatureUnion` on a dataset containing -different types of features. We use the 20-newsgroups dataset and compute -standard bag-of-words features for the subject line and body in separate -pipelines as well as ad hoc features on the body. We combine them (with -weights) using a FeatureUnion and finally train a classifier on the combined -set of features. - -The choice of features is not particularly helpful, but serves to illustrate -the technique. - - -**Python source code:** :download:`hetero_feature_union.py ` - -.. literalinclude:: hetero_feature_union.py - :lines: 25- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/imputation.txt b/0.15/_sources/auto_examples/imputation.txt deleted file mode 100644 index 6a53e5c00e281..0000000000000 --- a/0.15/_sources/auto_examples/imputation.txt +++ /dev/null @@ -1,28 +0,0 @@ - - -.. _example_imputation.py: - - -====================================================== -Imputing missing values before building an estimator -====================================================== - -This example shows that imputing the missing values can give better results -than discarding the samples containing any missing value. - -Missing values can be replaced by the mean, the median or the most frequent -value using the ``strategy`` hyper-parameter. - -Script output: - - Score with the entire dataset = 0.56 - Score without the samples containing missing values = 0.48 - Score after imputation of the missing values = 0.55 - - - -**Python source code:** :download:`imputation.py ` - -.. literalinclude:: imputation.py - :lines: 19- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/index.txt b/0.15/_sources/auto_examples/index.txt deleted file mode 100644 index 6a67dbd15f6f0..0000000000000 --- a/0.15/_sources/auto_examples/index.txt +++ /dev/null @@ -1,5197 +0,0 @@ - - - -.. raw:: html - - - - - -.. raw:: html - - - - - - -Examples -======== - -.. _examples-index: - - - -.. _general_examples: - -General examples ----------------- - -General-purpose and introductory examples for the scikit. - - - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/feature_selection_pipeline.png - :target: ./feature_selection_pipeline.html - - :ref:`example_feature_selection_pipeline.py` - - -.. raw:: html - - -

Simple usage of Pipeline that runs successively a univariate feature selection with anova and t... -

-
- - -.. toctree:: - :hidden: - - ./feature_selection_pipeline - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_rfe_digits.png - :target: ./plot_rfe_digits.html - - :ref:`example_plot_rfe_digits.py` - - -.. raw:: html - - -

A recursive feature elimination example showing the relevance of pixels in a digit classificati... -

-
- - -.. toctree:: - :hidden: - - ./plot_rfe_digits - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_rfe_with_cross_validation.png - :target: ./plot_rfe_with_cross_validation.html - - :ref:`example_plot_rfe_with_cross_validation.py` - - -.. raw:: html - - -

A recursive feature elimination example with automatic tuning of the number of features selecte... -

-
- - -.. toctree:: - :hidden: - - ./plot_rfe_with_cross_validation - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_confusion_matrix.png - :target: ./plot_confusion_matrix.html - - :ref:`example_plot_confusion_matrix.py` - - -.. raw:: html - - -

Example of confusion matrix usage to evaluate the quality of the output of a classifier on the ... -

-
- - -.. toctree:: - :hidden: - - ./plot_confusion_matrix - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_validation_curve.png - :target: ./plot_validation_curve.html - - :ref:`example_plot_validation_curve.py` - - -.. raw:: html - - -

In this plot you can see the training scores and validation scores of an SVM for different valu... -

-
- - -.. toctree:: - :hidden: - - ./plot_validation_curve - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_underfitting_overfitting.png - :target: ./plot_underfitting_overfitting.html - - :ref:`example_plot_underfitting_overfitting.py` - - -.. raw:: html - - -

This example demonstrates the problems of underfitting and overfitting and how we can use linea... -

-
- - -.. toctree:: - :hidden: - - ./plot_underfitting_overfitting - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/feature_stacker.png - :target: ./feature_stacker.html - - :ref:`example_feature_stacker.py` - - -.. raw:: html - - -

In many real-world examples, there are many ways to extract features from a dataset. Often it i... -

-
- - -.. toctree:: - :hidden: - - ./feature_stacker - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_isotonic_regression.png - :target: ./plot_isotonic_regression.html - - :ref:`example_plot_isotonic_regression.py` - - -.. raw:: html - - -

An illustration of the isotonic regression on generated data. The isotonic regression finds a n... -

-
- - -.. toctree:: - :hidden: - - ./plot_isotonic_regression - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/imputation.png - :target: ./imputation.html - - :ref:`example_imputation.py` - - -.. raw:: html - - -

This example shows that imputing the missing values can give better results than discarding the... -

-
- - -.. toctree:: - :hidden: - - ./imputation - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_digits_pipe.png - :target: ./plot_digits_pipe.html - - :ref:`example_plot_digits_pipe.py` - - -.. raw:: html - - -

The PCA does an unsupervised dimensionality reduction, while the logistic regression does the p... -

-
- - -.. toctree:: - :hidden: - - ./plot_digits_pipe - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_digits_classification.png - :target: ./plot_digits_classification.html - - :ref:`example_plot_digits_classification.py` - - -.. raw:: html - - -

An example showing how the scikit-learn can be used to recognize images of hand-written digits. -

-
- - -.. toctree:: - :hidden: - - ./plot_digits_classification - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_permutation_test_for_classification.png - :target: ./plot_permutation_test_for_classification.html - - :ref:`example_plot_permutation_test_for_classification.py` - - -.. raw:: html - - -

In order to test if a classification score is significative a technique in repeating the classi... -

-
- - -.. toctree:: - :hidden: - - ./plot_permutation_test_for_classification - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/grid_search_digits.png - :target: ./grid_search_digits.html - - :ref:`example_grid_search_digits.py` - - -.. raw:: html - - -

This examples shows how a classifier is optimized by cross-validation, which is done using the ... -

-
- - -.. toctree:: - :hidden: - - ./grid_search_digits - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_roc_crossval.png - :target: ./plot_roc_crossval.html - - :ref:`example_plot_roc_crossval.py` - - -.. raw:: html - - -

Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality... -

-
- - -.. toctree:: - :hidden: - - ./plot_roc_crossval - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_train_error_vs_test_error.png - :target: ./plot_train_error_vs_test_error.html - - :ref:`example_plot_train_error_vs_test_error.py` - - -.. raw:: html - - -

Illustration of how the performance of an estimator on unseen data (test data) is not the same ... -

-
- - -.. toctree:: - :hidden: - - ./plot_train_error_vs_test_error - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_feature_selection.png - :target: ./plot_feature_selection.html - - :ref:`example_plot_feature_selection.py` - - -.. raw:: html - - -

An example showing univariate feature selection. -

-
- - -.. toctree:: - :hidden: - - ./plot_feature_selection - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_classification_probability.png - :target: ./plot_classification_probability.html - - :ref:`example_plot_classification_probability.py` - - -.. raw:: html - - -

Plot the classification probability for different classifiers. We use a 3 class dataset, and we... -

-
- - -.. toctree:: - :hidden: - - ./plot_classification_probability - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/randomized_search.png - :target: ./randomized_search.html - - :ref:`example_randomized_search.py` - - -.. raw:: html - - -

Compare randomized search and grid search for optimizing hyperparameters of a random forest. Al... -

-
- - -.. toctree:: - :hidden: - - ./randomized_search - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_roc.png - :target: ./plot_roc.html - - :ref:`example_plot_roc.py` - - -.. raw:: html - - -

Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality... -

-
- - -.. toctree:: - :hidden: - - ./plot_roc - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_precision_recall.png - :target: ./plot_precision_recall.html - - :ref:`example_plot_precision_recall.py` - - -.. raw:: html - - -

Example of Precision-Recall metric to evaluate classifier output quality. -

-
- - -.. toctree:: - :hidden: - - ./plot_precision_recall - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_multilabel.png - :target: ./plot_multilabel.html - - :ref:`example_plot_multilabel.py` - - -.. raw:: html - - -

This example simulates a multi-label document classification problem. The dataset is generated ... -

-
- - -.. toctree:: - :hidden: - - ./plot_multilabel - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_multioutput_face_completion.png - :target: ./plot_multioutput_face_completion.html - - :ref:`example_plot_multioutput_face_completion.py` - - -.. raw:: html - - -

This example shows the use of multi-output estimator to complete images. The goal is to predict... -

-
- - -.. toctree:: - :hidden: - - ./plot_multioutput_face_completion - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/grid_search_text_feature_extraction.png - :target: ./grid_search_text_feature_extraction.html - - :ref:`example_grid_search_text_feature_extraction.py` - - -.. raw:: html - - -

The dataset used in this example is the 20 newsgroups dataset which will be automatically downl... -

-
- - -.. toctree:: - :hidden: - - ./grid_search_text_feature_extraction - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_learning_curve.png - :target: ./plot_learning_curve.html - - :ref:`example_plot_learning_curve.py` - - -.. raw:: html - - -

On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset... -

-
- - -.. toctree:: - :hidden: - - ./plot_learning_curve - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/hashing_vs_dict_vectorizer.png - :target: ./hashing_vs_dict_vectorizer.html - - :ref:`example_hashing_vs_dict_vectorizer.py` - - -.. raw:: html - - -

Compares FeatureHasher and DictVectorizer by using both to vectorize text documents. -

-
- - -.. toctree:: - :hidden: - - ./hashing_vs_dict_vectorizer - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_johnson_lindenstrauss_bound.png - :target: ./plot_johnson_lindenstrauss_bound.html - - :ref:`example_plot_johnson_lindenstrauss_bound.py` - - -.. raw:: html - - -

The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly pr... -

-
- - -.. toctree:: - :hidden: - - ./plot_johnson_lindenstrauss_bound - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_classifier_comparison.png - :target: ./plot_classifier_comparison.html - - :ref:`example_plot_classifier_comparison.py` - - -.. raw:: html - - -

A comparison of a several classifiers in scikit-learn on synthetic datasets. The point of this ... -

-
- - -.. toctree:: - :hidden: - - ./plot_classifier_comparison - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_rbm_logistic_classification.png - :target: ./plot_rbm_logistic_classification.html - - :ref:`example_plot_rbm_logistic_classification.py` - - -.. raw:: html - - -

For greyscale image data where pixel values can be interpreted as degrees of blackness on a whi... -

-
- - -.. toctree:: - :hidden: - - ./plot_rbm_logistic_classification - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_lda_qda.png - :target: ./plot_lda_qda.html - - :ref:`example_plot_lda_qda.py` - - -.. raw:: html - - -

Plot the confidence ellipsoids of each class and decision boundary -

-
- - -.. toctree:: - :hidden: - - ./plot_lda_qda - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/document_clustering.png - :target: ./document_clustering.html - - :ref:`example_document_clustering.py` - - -.. raw:: html - - -

This is an example showing how the scikit-learn can be used to cluster documents by topics usin... -

-
- - -.. toctree:: - :hidden: - - ./document_clustering - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/plot_kernel_approximation.png - :target: ./plot_kernel_approximation.html - - :ref:`example_plot_kernel_approximation.py` - - -.. raw:: html - - -

An example illustrating the approximation of the feature map of an RBF kernel. -

-
- - -.. toctree:: - :hidden: - - ./plot_kernel_approximation - - - -.. raw:: html - - -
-
- - -.. figure:: ./images/thumb/document_classification_20newsgroups.png - :target: ./document_classification_20newsgroups.html - - :ref:`example_document_classification_20newsgroups.py` - - -.. raw:: html - - -

This is an example showing how scikit-learn can be used to classify documents by topics using a... -

-
- - -.. toctree:: - :hidden: - - ./document_classification_20newsgroups - - -.. raw:: html - -
- - - -.. _realworld_examples: - -Examples based on real world datasets -------------------------------------- - -Applications to real world problems with some medium sized datasets or -interactive user interface. - - - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/topics_extraction_with_nmf.png - :target: ./applications/topics_extraction_with_nmf.html - - :ref:`example_applications_topics_extraction_with_nmf.py` - - -.. raw:: html - - -

This is a proof of concept application of Non Negative Matrix Factorization of the term frequen... -

-
- - -.. toctree:: - :hidden: - - applications/topics_extraction_with_nmf - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/plot_outlier_detection_housing.png - :target: ./applications/plot_outlier_detection_housing.html - - :ref:`example_applications_plot_outlier_detection_housing.py` - - -.. raw:: html - - -

This example illustrates the need for robust covariance estimation on a real data set. It is us... -

-
- - -.. toctree:: - :hidden: - - applications/plot_outlier_detection_housing - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/plot_tomography_l1_reconstruction.png - :target: ./applications/plot_tomography_l1_reconstruction.html - - :ref:`example_applications_plot_tomography_l1_reconstruction.py` - - -.. raw:: html - - -

This example shows the reconstruction of an image from a set of parallel projections, acquired ... -

-
- - -.. toctree:: - :hidden: - - applications/plot_tomography_l1_reconstruction - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/face_recognition.png - :target: ./applications/face_recognition.html - - :ref:`example_applications_face_recognition.py` - - -.. raw:: html - - -

The dataset used in this example is a preprocessed excerpt of the "Labeled Faces in the Wild", ... -

-
- - -.. toctree:: - :hidden: - - applications/face_recognition - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/plot_model_complexity_influence.png - :target: ./applications/plot_model_complexity_influence.html - - :ref:`example_applications_plot_model_complexity_influence.py` - - -.. raw:: html - - -

Demonstrate how model complexity influences both prediction accuracy and computational performa... -

-
- - -.. toctree:: - :hidden: - - applications/plot_model_complexity_influence - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/plot_species_distribution_modeling.png - :target: ./applications/plot_species_distribution_modeling.html - - :ref:`example_applications_plot_species_distribution_modeling.py` - - -.. raw:: html - - -

Modeling species' geographic distributions is an important problem in conservation biology. In ... -

-
- - -.. toctree:: - :hidden: - - applications/plot_species_distribution_modeling - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/plot_stock_market.png - :target: ./applications/plot_stock_market.html - - :ref:`example_applications_plot_stock_market.py` - - -.. raw:: html - - -

This example employs several unsupervised learning techniques to extract the stock market struc... -

-
- - -.. toctree:: - :hidden: - - applications/plot_stock_market - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/wikipedia_principal_eigenvector.png - :target: ./applications/wikipedia_principal_eigenvector.html - - :ref:`example_applications_wikipedia_principal_eigenvector.py` - - -.. raw:: html - - -

A classical way to assert the relative importance of vertices in a graph is to compute the prin... -

-
- - -.. toctree:: - :hidden: - - applications/wikipedia_principal_eigenvector - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/plot_prediction_latency.png - :target: ./applications/plot_prediction_latency.html - - :ref:`example_applications_plot_prediction_latency.py` - - -.. raw:: html - - -

This is an example showing the prediction latency of various scikit-learn estimators. -

-
- - -.. toctree:: - :hidden: - - applications/plot_prediction_latency - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/svm_gui.png - :target: ./applications/svm_gui.html - - :ref:`example_applications_svm_gui.py` - - -.. raw:: html - - -

A simple graphical frontend for Libsvm mainly intended for didactic purposes. You can create da... -

-
- - -.. toctree:: - :hidden: - - applications/svm_gui - - - -.. raw:: html - - -
-
- - -.. figure:: applications/images/thumb/plot_out_of_core_classification.png - :target: ./applications/plot_out_of_core_classification.html - - :ref:`example_applications_plot_out_of_core_classification.py` - - -.. raw:: html - - -

This is an example showing how scikit-learn can be used for classification using an out-of-core... -

-
- - -.. toctree:: - :hidden: - - applications/plot_out_of_core_classification - - -.. raw:: html - -
- - - -.. _bicluster_examples: - -Biclustering ------------- - -Examples concerning the :mod:`sklearn.cluster.bicluster` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: bicluster/images/thumb/plot_spectral_coclustering.png - :target: ./bicluster/plot_spectral_coclustering.html - - :ref:`example_bicluster_plot_spectral_coclustering.py` - - -.. raw:: html - - -

This example demonstrates how to generate a dataset and bicluster it using the the Spectral Co-... -

-
- - -.. toctree:: - :hidden: - - bicluster/plot_spectral_coclustering - - - -.. raw:: html - - -
-
- - -.. figure:: bicluster/images/thumb/plot_spectral_biclustering.png - :target: ./bicluster/plot_spectral_biclustering.html - - :ref:`example_bicluster_plot_spectral_biclustering.py` - - -.. raw:: html - - -

This example demonstrates how to generate a checkerboard dataset and bicluster it using the Spe... -

-
- - -.. toctree:: - :hidden: - - bicluster/plot_spectral_biclustering - - - -.. raw:: html - - -
-
- - -.. figure:: bicluster/images/thumb/bicluster_newsgroups.png - :target: ./bicluster/bicluster_newsgroups.html - - :ref:`example_bicluster_bicluster_newsgroups.py` - - -.. raw:: html - - -

This example demonstrates the Spectral Co-clustering algorithm on the twenty newsgroups dataset... -

-
- - -.. toctree:: - :hidden: - - bicluster/bicluster_newsgroups - - -.. raw:: html - -
- - - -.. _cluster_examples: - -Clustering ----------- - -Examples concerning the :mod:`sklearn.cluster` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_mean_shift.png - :target: ./cluster/plot_mean_shift.html - - :ref:`example_cluster_plot_mean_shift.py` - - -.. raw:: html - - -

Reference: -

-
- - -.. toctree:: - :hidden: - - cluster/plot_mean_shift - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_lena_ward_segmentation.png - :target: ./cluster/plot_lena_ward_segmentation.html - - :ref:`example_cluster_plot_lena_ward_segmentation.py` - - -.. raw:: html - - -

Compute the segmentation of a 2D image with Ward hierarchical clustering. The clustering is spa... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_lena_ward_segmentation - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_digits_agglomeration.png - :target: ./cluster/plot_digits_agglomeration.html - - :ref:`example_cluster_plot_digits_agglomeration.py` - - -.. raw:: html - - -

These images how similar features are merged together using feature agglomeration. -

-
- - -.. toctree:: - :hidden: - - cluster/plot_digits_agglomeration - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_affinity_propagation.png - :target: ./cluster/plot_affinity_propagation.html - - :ref:`example_cluster_plot_affinity_propagation.py` - - -.. raw:: html - - -

Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Poin... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_affinity_propagation - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_agglomerative_clustering.png - :target: ./cluster/plot_agglomerative_clustering.html - - :ref:`example_cluster_plot_agglomerative_clustering.py` - - -.. raw:: html - - -

This example shows the effect of imposing a connectivity graph to capture local structure in th... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_agglomerative_clustering - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_lena_segmentation.png - :target: ./cluster/plot_lena_segmentation.html - - :ref:`example_cluster_plot_lena_segmentation.py` - - -.. raw:: html - - -

This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference ... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_lena_segmentation - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_dbscan.png - :target: ./cluster/plot_dbscan.html - - :ref:`example_cluster_plot_dbscan.py` - - -.. raw:: html - - -

Finds core samples of high density and expands clusters from them. -

-
- - -.. toctree:: - :hidden: - - cluster/plot_dbscan - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_dict_face_patches.png - :target: ./cluster/plot_dict_face_patches.html - - :ref:`example_cluster_plot_dict_face_patches.py` - - -.. raw:: html - - -

This example uses a large dataset of faces to learn a set of 20 x 20 images patches that consti... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_dict_face_patches - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_lena_compress.png - :target: ./cluster/plot_lena_compress.html - - :ref:`example_cluster_plot_lena_compress.py` - - -.. raw:: html - - -

The classic image processing example, Lena, an 8-bit grayscale bit-depth, 512 x 512 sized image... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_lena_compress - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_ward_structured_vs_unstructured.png - :target: ./cluster/plot_ward_structured_vs_unstructured.html - - :ref:`example_cluster_plot_ward_structured_vs_unstructured.py` - - -.. raw:: html - - -

Example builds a swiss roll dataset and runs hierarchical clustering on their position. -

-
- - -.. toctree:: - :hidden: - - cluster/plot_ward_structured_vs_unstructured - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_segmentation_toy.png - :target: ./cluster/plot_segmentation_toy.html - - :ref:`example_cluster_plot_segmentation_toy.py` - - -.. raw:: html - - -

In this example, an image with connected circles is generated and spectral clustering is used t... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_segmentation_toy - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_cluster_iris.png - :target: ./cluster/plot_cluster_iris.html - - :ref:`example_cluster_plot_cluster_iris.py` - - -.. raw:: html - - -

The plots display firstly what a K-means algorithm would yield using three clusters. It is then... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_cluster_iris - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_digits_linkage.png - :target: ./cluster/plot_digits_linkage.html - - :ref:`example_cluster_plot_digits_linkage.py` - - -.. raw:: html - - -

An illustration of various linkage option for agglomerative clustering on a 2D embedding of the... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_digits_linkage - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_color_quantization.png - :target: ./cluster/plot_color_quantization.html - - :ref:`example_cluster_plot_color_quantization.py` - - -.. raw:: html - - -

Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reduci... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_color_quantization - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_feature_agglomeration_vs_univariate_selection.png - :target: ./cluster/plot_feature_agglomeration_vs_univariate_selection.html - - :ref:`example_cluster_plot_feature_agglomeration_vs_univariate_selection.py` - - -.. raw:: html - - -

This example compares 2 dimensionality reduction strategies: -

-
- - -.. toctree:: - :hidden: - - cluster/plot_feature_agglomeration_vs_univariate_selection - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_agglomerative_clustering_metrics.png - :target: ./cluster/plot_agglomerative_clustering_metrics.html - - :ref:`example_cluster_plot_agglomerative_clustering_metrics.py` - - -.. raw:: html - - -

Demonstrates the effect of different metrics on the hierarchical clustering. -

-
- - -.. toctree:: - :hidden: - - cluster/plot_agglomerative_clustering_metrics - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_kmeans_stability_low_dim_dense.png - :target: ./cluster/plot_kmeans_stability_low_dim_dense.html - - :ref:`example_cluster_plot_kmeans_stability_low_dim_dense.py` - - -.. raw:: html - - -

Evaluate the ability of k-means initializations strategies to make the algorithm convergence ro... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_kmeans_stability_low_dim_dense - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_kmeans_digits.png - :target: ./cluster/plot_kmeans_digits.html - - :ref:`example_cluster_plot_kmeans_digits.py` - - -.. raw:: html - - -

In this example we compare the various initialization strategies for K-means in terms of runtim... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_kmeans_digits - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_adjusted_for_chance_measures.png - :target: ./cluster/plot_adjusted_for_chance_measures.html - - :ref:`example_cluster_plot_adjusted_for_chance_measures.py` - - -.. raw:: html - - -

The following plots demonstrate the impact of the number of clusters and number of samples on v... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_adjusted_for_chance_measures - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_cluster_comparison.png - :target: ./cluster/plot_cluster_comparison.html - - :ref:`example_cluster_plot_cluster_comparison.py` - - -.. raw:: html - - -

This example aims at showing characteristics of different clustering algorithms on datasets tha... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_cluster_comparison - - - -.. raw:: html - - -
-
- - -.. figure:: cluster/images/thumb/plot_mini_batch_kmeans.png - :target: ./cluster/plot_mini_batch_kmeans.html - - :ref:`example_cluster_plot_mini_batch_kmeans.py` - - -.. raw:: html - - -

We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is fa... -

-
- - -.. toctree:: - :hidden: - - cluster/plot_mini_batch_kmeans - - -.. raw:: html - -
- - - -.. _covariance_examples: - -Covariance estimation ---------------------- - -Examples concerning the :mod:`sklearn.covariance` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: covariance/images/thumb/plot_lw_vs_oas.png - :target: ./covariance/plot_lw_vs_oas.html - - :ref:`example_covariance_plot_lw_vs_oas.py` - - -.. raw:: html - - -

The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and... -

-
- - -.. toctree:: - :hidden: - - covariance/plot_lw_vs_oas - - - -.. raw:: html - - -
-
- - -.. figure:: covariance/images/thumb/plot_outlier_detection.png - :target: ./covariance/plot_outlier_detection.html - - :ref:`example_covariance_plot_outlier_detection.py` - - -.. raw:: html - - -

When the amount of contamination is known, this example illustrates two different ways of perfo... -

-
- - -.. toctree:: - :hidden: - - covariance/plot_outlier_detection - - - -.. raw:: html - - -
-
- - -.. figure:: covariance/images/thumb/plot_sparse_cov.png - :target: ./covariance/plot_sparse_cov.html - - :ref:`example_covariance_plot_sparse_cov.py` - - -.. raw:: html - - -

Using the GraphLasso estimator to learn a covariance and sparse precision from a small number o... -

-
- - -.. toctree:: - :hidden: - - covariance/plot_sparse_cov - - - -.. raw:: html - - -
-
- - -.. figure:: covariance/images/thumb/plot_covariance_estimation.png - :target: ./covariance/plot_covariance_estimation.html - - :ref:`example_covariance_plot_covariance_estimation.py` - - -.. raw:: html - - -

When working with covariance estimation, the usual approach is to use a maximum likelihood esti... -

-
- - -.. toctree:: - :hidden: - - covariance/plot_covariance_estimation - - - -.. raw:: html - - -
-
- - -.. figure:: covariance/images/thumb/plot_mahalanobis_distances.png - :target: ./covariance/plot_mahalanobis_distances.html - - :ref:`example_covariance_plot_mahalanobis_distances.py` - - -.. raw:: html - - -

An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed... -

-
- - -.. toctree:: - :hidden: - - covariance/plot_mahalanobis_distances - - - -.. raw:: html - - -
-
- - -.. figure:: covariance/images/thumb/plot_robust_vs_empirical_covariance.png - :target: ./covariance/plot_robust_vs_empirical_covariance.html - - :ref:`example_covariance_plot_robust_vs_empirical_covariance.py` - - -.. raw:: html - - -

The usual covariance maximum likelihood estimate is very sensitive to the presence of outliers ... -

-
- - -.. toctree:: - :hidden: - - covariance/plot_robust_vs_empirical_covariance - - -.. raw:: html - -
- - - -.. _cross_decomposition_examples: - -Cross decomposition -------------------- - -Examples concerning the :mod:`sklearn.cross_decomposition` package. - - - - - - -.. raw:: html - - -
-
- - -.. figure:: cross_decomposition/images/thumb/plot_compare_cross_decomposition.png - :target: ./cross_decomposition/plot_compare_cross_decomposition.html - - :ref:`example_cross_decomposition_plot_compare_cross_decomposition.py` - - -.. raw:: html - - -

Simple usage of various cross decomposition algorithms: - PLSCanonical - PLSRegression, with mu... -

-
- - -.. toctree:: - :hidden: - - cross_decomposition/plot_compare_cross_decomposition - - -.. raw:: html - -
- - - -.. _dataset_examples: - -Dataset examples ------------------------ - -Examples concerning the :mod:`sklearn.datasets` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: datasets/images/thumb/plot_digits_last_image.png - :target: ./datasets/plot_digits_last_image.html - - :ref:`example_datasets_plot_digits_last_image.py` - - -.. raw:: html - - -

This dataset is made up of 1797 8x8 images. Each image, like the one shown below, is of a hand-... -

-
- - -.. toctree:: - :hidden: - - datasets/plot_digits_last_image - - - -.. raw:: html - - -
-
- - -.. figure:: datasets/images/thumb/plot_random_dataset.png - :target: ./datasets/plot_random_dataset.html - - :ref:`example_datasets_plot_random_dataset.py` - - -.. raw:: html - - -

Plot several randomly generated 2D classification datasets. This example illustrates the `datas... -

-
- - -.. toctree:: - :hidden: - - datasets/plot_random_dataset - - - -.. raw:: html - - -
-
- - -.. figure:: datasets/images/thumb/plot_iris_dataset.png - :target: ./datasets/plot_iris_dataset.html - - :ref:`example_datasets_plot_iris_dataset.py` - - -.. raw:: html - - -

The rows being the samples and the columns being: Sepal Length, Sepal Width, Petal Length and P... -

-
- - -.. toctree:: - :hidden: - - datasets/plot_iris_dataset - - -.. raw:: html - -
- - - -.. _decomposition_examples: - -Decomposition -------------- - -Examples concerning the :mod:`sklearn.decomposition` package. - - - - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_pca_vs_lda.png - :target: ./decomposition/plot_pca_vs_lda.html - - :ref:`example_decomposition_plot_pca_vs_lda.py` - - -.. raw:: html - - -

The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour and Virginica) with 4 a... -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_pca_vs_lda - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_pca_iris.png - :target: ./decomposition/plot_pca_iris.html - - :ref:`example_decomposition_plot_pca_iris.py` - - -.. raw:: html - - -

Principal Component Analysis applied to the Iris dataset. -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_pca_iris - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_ica_blind_source_separation.png - :target: ./decomposition/plot_ica_blind_source_separation.html - - :ref:`example_decomposition_plot_ica_blind_source_separation.py` - - -.. raw:: html - - -

An example of estimating sources from noisy data. -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_ica_blind_source_separation - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_kernel_pca.png - :target: ./decomposition/plot_kernel_pca.html - - :ref:`example_decomposition_plot_kernel_pca.py` - - -.. raw:: html - - -

This example shows that Kernel PCA is able to find a projection of the data that makes data lin... -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_kernel_pca - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_ica_vs_pca.png - :target: ./decomposition/plot_ica_vs_pca.html - - :ref:`example_decomposition_plot_ica_vs_pca.py` - - -.. raw:: html - - -

This example illustrates visually in the feature space a comparison by results using two differ... -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_ica_vs_pca - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_sparse_coding.png - :target: ./decomposition/plot_sparse_coding.html - - :ref:`example_decomposition_plot_sparse_coding.py` - - -.. raw:: html - - -

Transform a signal as a sparse combination of Ricker wavelets. This example visually compares d... -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_sparse_coding - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_pca_3d.png - :target: ./decomposition/plot_pca_3d.html - - :ref:`example_decomposition_plot_pca_3d.py` - - -.. raw:: html - - -

These figures aid in illustrating how a point cloud can be very flat in one direction--which is... -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_pca_3d - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_pca_vs_fa_model_selection.png - :target: ./decomposition/plot_pca_vs_fa_model_selection.html - - :ref:`example_decomposition_plot_pca_vs_fa_model_selection.py` - - -.. raw:: html - - -

Probabilistic PCA and Factor Analysis are probabilistic models. The consequence is that the lik... -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_pca_vs_fa_model_selection - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_faces_decomposition.png - :target: ./decomposition/plot_faces_decomposition.html - - :ref:`example_decomposition_plot_faces_decomposition.py` - - -.. raw:: html - - -

This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dime... -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_faces_decomposition - - - -.. raw:: html - - -
-
- - -.. figure:: decomposition/images/thumb/plot_image_denoising.png - :target: ./decomposition/plot_image_denoising.html - - :ref:`example_decomposition_plot_image_denoising.py` - - -.. raw:: html - - -

An example comparing the effect of reconstructing noisy fragments of the Lena image using first... -

-
- - -.. toctree:: - :hidden: - - decomposition/plot_image_denoising - - -.. raw:: html - -
- - - -.. _ensemble_examples: - -Ensemble methods ----------------- - -Examples concerning the :mod:`sklearn.ensemble` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_forest_importances_faces.png - :target: ./ensemble/plot_forest_importances_faces.html - - :ref:`example_ensemble_plot_forest_importances_faces.py` - - -.. raw:: html - - -

This example shows the use of forests of trees to evaluate the importance of the pixels in an i... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_forest_importances_faces - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_adaboost_regression.png - :target: ./ensemble/plot_adaboost_regression.html - - :ref:`example_ensemble_plot_adaboost_regression.py` - - -.. raw:: html - - -

A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with ... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_adaboost_regression - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_forest_importances.png - :target: ./ensemble/plot_forest_importances.html - - :ref:`example_ensemble_plot_forest_importances.py` - - -.. raw:: html - - -

This examples shows the use of forests of trees to evaluate the importance of features on an ar... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_forest_importances - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_gradient_boosting_regularization.png - :target: ./ensemble/plot_gradient_boosting_regularization.html - - :ref:`example_ensemble_plot_gradient_boosting_regularization.py` - - -.. raw:: html - - -

Illustration of the effect of different regularization strategies for Gradient Boosting. The ex... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_gradient_boosting_regularization - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_partial_dependence.png - :target: ./ensemble/plot_partial_dependence.html - - :ref:`example_ensemble_plot_partial_dependence.py` - - -.. raw:: html - - -

Partial dependence plots show the dependence between the target function [1]_ and a set of 'tar... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_partial_dependence - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_gradient_boosting_regression.png - :target: ./ensemble/plot_gradient_boosting_regression.html - - :ref:`example_ensemble_plot_gradient_boosting_regression.py` - - -.. raw:: html - - -

Demonstrate Gradient Boosting on the boston housing dataset. -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_gradient_boosting_regression - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_gradient_boosting_quantile.png - :target: ./ensemble/plot_gradient_boosting_quantile.html - - :ref:`example_ensemble_plot_gradient_boosting_quantile.py` - - -.. raw:: html - - -

This example shows how quantile regression can be used to create prediction intervals. -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_gradient_boosting_quantile - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_adaboost_twoclass.png - :target: ./ensemble/plot_adaboost_twoclass.html - - :ref:`example_ensemble_plot_adaboost_twoclass.py` - - -.. raw:: html - - -

This example fits an AdaBoosted decision stump on a non-linearly separable classification datas... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_adaboost_twoclass - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_random_forest_embedding.png - :target: ./ensemble/plot_random_forest_embedding.html - - :ref:`example_ensemble_plot_random_forest_embedding.py` - - -.. raw:: html - - -

RandomTreesEmbedding provides a way to map data to a very high-dimensional, sparse representati... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_random_forest_embedding - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_adaboost_hastie_10_2.png - :target: ./ensemble/plot_adaboost_hastie_10_2.html - - :ref:`example_ensemble_plot_adaboost_hastie_10_2.py` - - -.. raw:: html - - -

This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference ... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_adaboost_hastie_10_2 - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_adaboost_multiclass.png - :target: ./ensemble/plot_adaboost_multiclass.html - - :ref:`example_ensemble_plot_adaboost_multiclass.py` - - -.. raw:: html - - -

This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_adaboost_multiclass - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_gradient_boosting_oob.png - :target: ./ensemble/plot_gradient_boosting_oob.html - - :ref:`example_ensemble_plot_gradient_boosting_oob.py` - - -.. raw:: html - - -

Out-of-bag (OOB) estimates can be a useful heuristic to estimate the "optimal" number of boosti... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_gradient_boosting_oob - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_forest_iris.png - :target: ./ensemble/plot_forest_iris.html - - :ref:`example_ensemble_plot_forest_iris.py` - - -.. raw:: html - - -

Plot the decision surfaces of forests of randomized trees trained on pairs of features of the i... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_forest_iris - - - -.. raw:: html - - -
-
- - -.. figure:: ensemble/images/thumb/plot_bias_variance.png - :target: ./ensemble/plot_bias_variance.html - - :ref:`example_ensemble_plot_bias_variance.py` - - -.. raw:: html - - -

This example illustrates and compares the bias-variance decomposition of the expected mean squa... -

-
- - -.. toctree:: - :hidden: - - ensemble/plot_bias_variance - - -.. raw:: html - -
- - - -Tutorial exercises ------------------- - -Exercises for the tutorials - - - - - -.. raw:: html - - -
-
- - -.. figure:: exercises/images/thumb/digits_classification_exercise.png - :target: ./exercises/digits_classification_exercise.html - - :ref:`example_exercises_digits_classification_exercise.py` - - -.. raw:: html - - -

A tutorial exercise regarding the use of classification techniques on the Digits dataset. -

-
- - -.. toctree:: - :hidden: - - exercises/digits_classification_exercise - - - -.. raw:: html - - -
-
- - -.. figure:: exercises/images/thumb/plot_cv_digits.png - :target: ./exercises/plot_cv_digits.html - - :ref:`example_exercises_plot_cv_digits.py` - - -.. raw:: html - - -

A tutorial excercise using Cross-validation with an SVM on the Digits dataset. -

-
- - -.. toctree:: - :hidden: - - exercises/plot_cv_digits - - - -.. raw:: html - - -
-
- - -.. figure:: exercises/images/thumb/plot_iris_exercise.png - :target: ./exercises/plot_iris_exercise.html - - :ref:`example_exercises_plot_iris_exercise.py` - - -.. raw:: html - - -

A tutorial exercise for using different SVM kernels. -

-
- - -.. toctree:: - :hidden: - - exercises/plot_iris_exercise - - - -.. raw:: html - - -
-
- - -.. figure:: exercises/images/thumb/plot_cv_diabetes.png - :target: ./exercises/plot_cv_diabetes.html - - :ref:`example_exercises_plot_cv_diabetes.py` - - -.. raw:: html - - -

A tutorial excercise which uses cross-validation with linear models. -

-
- - -.. toctree:: - :hidden: - - exercises/plot_cv_diabetes - - -.. raw:: html - -
- - - -.. _gaussian_process_examples: - -Gaussian Process for Machine Learning -------------------------------------- - -Examples concerning the :mod:`sklearn.gaussian_process` package. - - - - - - -.. raw:: html - - -
-
- - -.. figure:: gaussian_process/images/thumb/gp_diabetes_dataset.png - :target: ./gaussian_process/gp_diabetes_dataset.html - - :ref:`example_gaussian_process_gp_diabetes_dataset.py` - - -.. raw:: html - - -

This example consists in fitting a Gaussian Process model onto the diabetes dataset. -

-
- - -.. toctree:: - :hidden: - - gaussian_process/gp_diabetes_dataset - - - -.. raw:: html - - -
-
- - -.. figure:: gaussian_process/images/thumb/plot_gp_probabilistic_classification_after_regression.png - :target: ./gaussian_process/plot_gp_probabilistic_classification_after_regression.html - - :ref:`example_gaussian_process_plot_gp_probabilistic_classification_after_regression.py` - - -.. raw:: html - - -

A two-dimensional regression exercise with a post-processing allowing for probabilistic classif... -

-
- - -.. toctree:: - :hidden: - - gaussian_process/plot_gp_probabilistic_classification_after_regression - - - -.. raw:: html - - -
-
- - -.. figure:: gaussian_process/images/thumb/plot_gp_regression.png - :target: ./gaussian_process/plot_gp_regression.html - - :ref:`example_gaussian_process_plot_gp_regression.py` - - -.. raw:: html - - -

A simple one-dimensional regression exercise computed in two different ways: -

-
- - -.. toctree:: - :hidden: - - gaussian_process/plot_gp_regression - - -.. raw:: html - -
- - - -.. _linear_examples: - -Generalized Linear Models -------------------------- - -Examples concerning the :mod:`sklearn.linear_model` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_lasso_lars.png - :target: ./linear_model/plot_lasso_lars.html - - :ref:`example_linear_model_plot_lasso_lars.py` - - -.. raw:: html - - -

Computes Lasso Path along the regularization parameter using the LARS algorithm on the diabetes... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_lasso_lars - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_sgd_loss_functions.png - :target: ./linear_model/plot_sgd_loss_functions.html - - :ref:`example_linear_model_plot_sgd_loss_functions.py` - - -.. raw:: html - - -

A plot that compares the various convex loss functions supported by :class:`sklearn.linear_mode... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_sgd_loss_functions - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_sgd_separating_hyperplane.png - :target: ./linear_model/plot_sgd_separating_hyperplane.html - - :ref:`example_linear_model_plot_sgd_separating_hyperplane.py` - - -.. raw:: html - - -

Plot the maximum margin separating hyperplane within a two-class separable dataset using a line... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_sgd_separating_hyperplane - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_sgd_weighted_samples.png - :target: ./linear_model/plot_sgd_weighted_samples.html - - :ref:`example_linear_model_plot_sgd_weighted_samples.py` - - -.. raw:: html - - -

Plot decision function of a weighted dataset, where the size of points is proportional to its w... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_sgd_weighted_samples - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_ridge_path.png - :target: ./linear_model/plot_ridge_path.html - - :ref:`example_linear_model_plot_ridge_path.py` - - -.. raw:: html - - -

Shows the effect of collinearity in the coefficients of an estimator. -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_ridge_path - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_sgd_comparison.png - :target: ./linear_model/plot_sgd_comparison.html - - :ref:`example_linear_model_plot_sgd_comparison.py` - - -.. raw:: html - - -

An example showing how different online solvers perform on the hand-written digits dataset. -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_sgd_comparison - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_ransac.png - :target: ./linear_model/plot_ransac.html - - :ref:`example_linear_model_plot_ransac.py` - - -.. raw:: html - - -

In this example we see how to robustly fit a linear model to faulty data using the RANSAC algor... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_ransac - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_polynomial_interpolation.png - :target: ./linear_model/plot_polynomial_interpolation.html - - :ref:`example_linear_model_plot_polynomial_interpolation.py` - - -.. raw:: html - - -

This example demonstrates how to approximate a function with a polynomial of degree n_degree by... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_polynomial_interpolation - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_iris_logistic.png - :target: ./linear_model/plot_iris_logistic.html - - :ref:`example_linear_model_plot_iris_logistic.py` - - -.. raw:: html - - -

Show below is a logistic-regression classifiers decision boundaries on the `iris

-
- - -.. toctree:: - :hidden: - - linear_model/plot_iris_logistic - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_logistic_path.png - :target: ./linear_model/plot_logistic_path.html - - :ref:`example_linear_model_plot_logistic_path.py` - - -.. raw:: html - - -

Computes path on IRIS dataset. -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_logistic_path - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_ols_ridge_variance.png - :target: ./linear_model/plot_ols_ridge_variance.html - - :ref:`example_linear_model_plot_ols_ridge_variance.py` - - -.. raw:: html - - -

Ridge regression is basically minimizing a penalised version of the least-squared function. The... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_ols_ridge_variance - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_ols.png - :target: ./linear_model/plot_ols.html - - :ref:`example_linear_model_plot_ols.py` - - -.. raw:: html - - -

The coefficients, the residual sum of squares and the variance score are also calculated. -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_ols - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_logistic.png - :target: ./linear_model/plot_logistic.html - - :ref:`example_linear_model_plot_logistic.py` - - -.. raw:: html - - -

Show in the plot is how the logistic regression would, in this synthetic dataset, classify valu... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_logistic - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_multi_task_lasso_support.png - :target: ./linear_model/plot_multi_task_lasso_support.html - - :ref:`example_linear_model_plot_multi_task_lasso_support.py` - - -.. raw:: html - - -

The multi-task lasso allows to fit multiple regression problems jointly enforcing the selected ... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_multi_task_lasso_support - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_sgd_penalties.png - :target: ./linear_model/plot_sgd_penalties.html - - :ref:`example_linear_model_plot_sgd_penalties.py` - - -.. raw:: html - - -

Plot the contours of the three penalties. -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_sgd_penalties - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/lasso_dense_vs_sparse_data.png - :target: ./linear_model/lasso_dense_vs_sparse_data.html - - :ref:`example_linear_model_lasso_dense_vs_sparse_data.py` - - -.. raw:: html - - -

We show that linear_model.Lasso provides the same results for dense and sparse data and that in... -

-
- - -.. toctree:: - :hidden: - - linear_model/lasso_dense_vs_sparse_data - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_lasso_and_elasticnet.png - :target: ./linear_model/plot_lasso_and_elasticnet.html - - :ref:`example_linear_model_plot_lasso_and_elasticnet.py` - - -.. raw:: html - - -

Estimates Lasso and Elastic-Net regression models on a manually generated sparse signal corrupt... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_lasso_and_elasticnet - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_bayesian_ridge.png - :target: ./linear_model/plot_bayesian_ridge.html - - :ref:`example_linear_model_plot_bayesian_ridge.py` - - -.. raw:: html - - -

Computes a Bayesian Ridge Regression on a synthetic dataset. -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_bayesian_ridge - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_ols_3d.png - :target: ./linear_model/plot_ols_3d.html - - :ref:`example_linear_model_plot_ols_3d.py` - - -.. raw:: html - - -

Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that alth... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_ols_3d - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_ard.png - :target: ./linear_model/plot_ard.html - - :ref:`example_linear_model_plot_ard.py` - - -.. raw:: html - - -

Fit regression model with Bayesian Ridge Regression. -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_ard - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_logistic_l1_l2_sparsity.png - :target: ./linear_model/plot_logistic_l1_l2_sparsity.html - - :ref:`example_linear_model_plot_logistic_l1_l2_sparsity.py` - - -.. raw:: html - - -

Comparison of the sparsity (percentage of zero coefficients) of solutions when L1 and L2 penalt... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_logistic_l1_l2_sparsity - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_sgd_iris.png - :target: ./linear_model/plot_sgd_iris.html - - :ref:`example_linear_model_plot_sgd_iris.py` - - -.. raw:: html - - -

Plot decision surface of multi-class SGD on iris dataset. The hyperplanes corresponding to the ... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_sgd_iris - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_omp.png - :target: ./linear_model/plot_omp.html - - :ref:`example_linear_model_plot_omp.py` - - -.. raw:: html - - -

Using orthogonal matching pursuit for recovering a sparse signal from a noisy measurement encod... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_omp - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_lasso_coordinate_descent_path.png - :target: ./linear_model/plot_lasso_coordinate_descent_path.html - - :ref:`example_linear_model_plot_lasso_coordinate_descent_path.py` - - -.. raw:: html - - -

Lasso and elastic net (L1 and L2 penalisation) implemented using a coordinate descent. -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_lasso_coordinate_descent_path - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_lasso_model_selection.png - :target: ./linear_model/plot_lasso_model_selection.html - - :ref:`example_linear_model_plot_lasso_model_selection.py` - - -.. raw:: html - - -

Use the Akaike information criterion (AIC), the Bayes Information criterion (BIC) and cross-val... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_lasso_model_selection - - - -.. raw:: html - - -
-
- - -.. figure:: linear_model/images/thumb/plot_sparse_recovery.png - :target: ./linear_model/plot_sparse_recovery.html - - :ref:`example_linear_model_plot_sparse_recovery.py` - - -.. raw:: html - - -

Given a small number of observations, we want to recover which features of X are relevant to ex... -

-
- - -.. toctree:: - :hidden: - - linear_model/plot_sparse_recovery - - -.. raw:: html - -
- - - -.. _manifold_examples: - -Manifold learning ------------------------ - -Examples concerning the :mod:`sklearn.manifold` package. - - - - - - -.. raw:: html - - -
-
- - -.. figure:: manifold/images/thumb/plot_swissroll.png - :target: ./manifold/plot_swissroll.html - - :ref:`example_manifold_plot_swissroll.py` - - -.. raw:: html - - -

An illustration of Swiss Roll reduction with locally linear embedding -

-
- - -.. toctree:: - :hidden: - - manifold/plot_swissroll - - - -.. raw:: html - - -
-
- - -.. figure:: manifold/images/thumb/plot_mds.png - :target: ./manifold/plot_mds.html - - :ref:`example_manifold_plot_mds.py` - - -.. raw:: html - - -

An illustration of the metric and non-metric MDS on generated noisy data. -

-
- - -.. toctree:: - :hidden: - - manifold/plot_mds - - - -.. raw:: html - - -
-
- - -.. figure:: manifold/images/thumb/plot_compare_methods.png - :target: ./manifold/plot_compare_methods.html - - :ref:`example_manifold_plot_compare_methods.py` - - -.. raw:: html - - -

An illustration of dimensionality reduction on the S-curve dataset with various manifold learni... -

-
- - -.. toctree:: - :hidden: - - manifold/plot_compare_methods - - - -.. raw:: html - - -
-
- - -.. figure:: manifold/images/thumb/plot_manifold_sphere.png - :target: ./manifold/plot_manifold_sphere.html - - :ref:`example_manifold_plot_manifold_sphere.py` - - -.. raw:: html - - -

An application of the different :ref:`manifold` techniques on a spherical data-set. Here one ca... -

-
- - -.. toctree:: - :hidden: - - manifold/plot_manifold_sphere - - - -.. raw:: html - - -
-
- - -.. figure:: manifold/images/thumb/plot_lle_digits.png - :target: ./manifold/plot_lle_digits.html - - :ref:`example_manifold_plot_lle_digits.py` - - -.. raw:: html - - -

An illustration of various embeddings on the digits dataset. -

-
- - -.. toctree:: - :hidden: - - manifold/plot_lle_digits - - -.. raw:: html - -
- - - -.. _mixture_examples: - -Gaussian Mixture Models ------------------------ - -Examples concerning the :mod:`sklearn.mixture` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: mixture/images/thumb/plot_gmm_pdf.png - :target: ./mixture/plot_gmm_pdf.html - - :ref:`example_mixture_plot_gmm_pdf.py` - - -.. raw:: html - - -

Plot the density estimation of a mixture of two Gaussians. Data is generated from two Gaussians... -

-
- - -.. toctree:: - :hidden: - - mixture/plot_gmm_pdf - - - -.. raw:: html - - -
-
- - -.. figure:: mixture/images/thumb/plot_gmm.png - :target: ./mixture/plot_gmm.html - - :ref:`example_mixture_plot_gmm.py` - - -.. raw:: html - - -

Plot the confidence ellipsoids of a mixture of two Gaussians with EM and variational Dirichlet ... -

-
- - -.. toctree:: - :hidden: - - mixture/plot_gmm - - - -.. raw:: html - - -
-
- - -.. figure:: mixture/images/thumb/plot_gmm_sin.png - :target: ./mixture/plot_gmm_sin.html - - :ref:`example_mixture_plot_gmm_sin.py` - - -.. raw:: html - - -

This example highlights the advantages of the Dirichlet Process: complexity control and dealing... -

-
- - -.. toctree:: - :hidden: - - mixture/plot_gmm_sin - - - -.. raw:: html - - -
-
- - -.. figure:: mixture/images/thumb/plot_gmm_selection.png - :target: ./mixture/plot_gmm_selection.html - - :ref:`example_mixture_plot_gmm_selection.py` - - -.. raw:: html - - -

This example shows that model selection can be performed with Gaussian Mixture Models using inf... -

-
- - -.. toctree:: - :hidden: - - mixture/plot_gmm_selection - - - -.. raw:: html - - -
-
- - -.. figure:: mixture/images/thumb/plot_gmm_classifier.png - :target: ./mixture/plot_gmm_classifier.html - - :ref:`example_mixture_plot_gmm_classifier.py` - - -.. raw:: html - - -

Demonstration of Gaussian mixture models for classification. -

-
- - -.. toctree:: - :hidden: - - mixture/plot_gmm_classifier - - -.. raw:: html - -
- - - -.. _neighbors_examples: - -Nearest Neighbors ------------------------ - -Examples concerning the :mod:`sklearn.neighbors` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: neighbors/images/thumb/plot_regression.png - :target: ./neighbors/plot_regression.html - - :ref:`example_neighbors_plot_regression.py` - - -.. raw:: html - - -

Demonstrate the resolution of a regression problem using a k-Nearest Neighbor and the interpola... -

-
- - -.. toctree:: - :hidden: - - neighbors/plot_regression - - - -.. raw:: html - - -
-
- - -.. figure:: neighbors/images/thumb/plot_classification.png - :target: ./neighbors/plot_classification.html - - :ref:`example_neighbors_plot_classification.py` - - -.. raw:: html - - -

Sample usage of Nearest Neighbors classification. It will plot the decision boundaries for each... -

-
- - -.. toctree:: - :hidden: - - neighbors/plot_classification - - - -.. raw:: html - - -
-
- - -.. figure:: neighbors/images/thumb/plot_nearest_centroid.png - :target: ./neighbors/plot_nearest_centroid.html - - :ref:`example_neighbors_plot_nearest_centroid.py` - - -.. raw:: html - - -

Sample usage of Nearest Centroid classification. It will plot the decision boundaries for each ... -

-
- - -.. toctree:: - :hidden: - - neighbors/plot_nearest_centroid - - - -.. raw:: html - - -
-
- - -.. figure:: neighbors/images/thumb/plot_digits_kde_sampling.png - :target: ./neighbors/plot_digits_kde_sampling.html - - :ref:`example_neighbors_plot_digits_kde_sampling.py` - - -.. raw:: html - - -

This example shows how kernel density estimation (KDE), a powerful non-parametric density estim... -

-
- - -.. toctree:: - :hidden: - - neighbors/plot_digits_kde_sampling - - - -.. raw:: html - - -
-
- - -.. figure:: neighbors/images/thumb/plot_species_kde.png - :target: ./neighbors/plot_species_kde.html - - :ref:`example_neighbors_plot_species_kde.py` - - -.. raw:: html - - -

This example does not perform any learning over the data (see :ref:`example_applications_plot_s... -

-
- - -.. toctree:: - :hidden: - - neighbors/plot_species_kde - - - -.. raw:: html - - -
-
- - -.. figure:: neighbors/images/thumb/plot_kde_1d.png - :target: ./neighbors/plot_kde_1d.html - - :ref:`example_neighbors_plot_kde_1d.py` - - -.. raw:: html - - -

The first plot shows one of the problems with using histograms to visualize the density of poin... -

-
- - -.. toctree:: - :hidden: - - neighbors/plot_kde_1d - - -.. raw:: html - -
- - - - - - - -.. raw:: html - -
- - - -.. _semi_supervised_examples: - -Semi Supervised Classification ------------------------------- - -Examples concerning the :mod:`sklearn.semi_supervised` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: semi_supervised/images/thumb/plot_label_propagation_structure.png - :target: ./semi_supervised/plot_label_propagation_structure.html - - :ref:`example_semi_supervised_plot_label_propagation_structure.py` - - -.. raw:: html - - -

Example of LabelPropagation learning a complex internal structure to demonstrate "manifold lear... -

-
- - -.. toctree:: - :hidden: - - semi_supervised/plot_label_propagation_structure - - - -.. raw:: html - - -
-
- - -.. figure:: semi_supervised/images/thumb/plot_label_propagation_versus_svm_iris.png - :target: ./semi_supervised/plot_label_propagation_versus_svm_iris.html - - :ref:`example_semi_supervised_plot_label_propagation_versus_svm_iris.py` - - -.. raw:: html - - -

Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. -

-
- - -.. toctree:: - :hidden: - - semi_supervised/plot_label_propagation_versus_svm_iris - - - -.. raw:: html - - -
-
- - -.. figure:: semi_supervised/images/thumb/plot_label_propagation_digits.png - :target: ./semi_supervised/plot_label_propagation_digits.html - - :ref:`example_semi_supervised_plot_label_propagation_digits.py` - - -.. raw:: html - - -

This example demonstrates the power of semisupervised learning by training a Label Spreading mo... -

-
- - -.. toctree:: - :hidden: - - semi_supervised/plot_label_propagation_digits - - - -.. raw:: html - - -
-
- - -.. figure:: semi_supervised/images/thumb/plot_label_propagation_digits_active_learning.png - :target: ./semi_supervised/plot_label_propagation_digits_active_learning.html - - :ref:`example_semi_supervised_plot_label_propagation_digits_active_learning.py` - - -.. raw:: html - - -

Demonstrates an active learning technique to learn handwritten digits using label propagation. -

-
- - -.. toctree:: - :hidden: - - semi_supervised/plot_label_propagation_digits_active_learning - - -.. raw:: html - -
- - - -.. _svm_examples: - -Support Vector Machines ------------------------ - -Examples concerning the :mod:`sklearn.svm` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_svm_nonlinear.png - :target: ./svm/plot_svm_nonlinear.html - - :ref:`example_svm_plot_svm_nonlinear.py` - - -.. raw:: html - - -

Perform binary classification using non-linear SVC with RBF kernel. The target to predict is a ... -

-
- - -.. toctree:: - :hidden: - - svm/plot_svm_nonlinear - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_svm_regression.png - :target: ./svm/plot_svm_regression.html - - :ref:`example_svm_plot_svm_regression.py` - - -.. raw:: html - - -

Toy example of 1D regression using linear, polynomial and RBF kernels. -

-
- - -.. toctree:: - :hidden: - - svm/plot_svm_regression - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_separating_hyperplane.png - :target: ./svm/plot_separating_hyperplane.html - - :ref:`example_svm_plot_separating_hyperplane.py` - - -.. raw:: html - - -

Plot the maximum margin separating hyperplane within a two-class separable dataset using a Supp... -

-
- - -.. toctree:: - :hidden: - - svm/plot_separating_hyperplane - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_separating_hyperplane_unbalanced.png - :target: ./svm/plot_separating_hyperplane_unbalanced.html - - :ref:`example_svm_plot_separating_hyperplane_unbalanced.py` - - -.. raw:: html - - -

Find the optimal separating hyperplane using an SVC for classes that are unbalanced. -

-
- - -.. toctree:: - :hidden: - - svm/plot_separating_hyperplane_unbalanced - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_custom_kernel.png - :target: ./svm/plot_custom_kernel.html - - :ref:`example_svm_plot_custom_kernel.py` - - -.. raw:: html - - -

Simple usage of Support Vector Machines to classify a sample. It will plot the decision surface... -

-
- - -.. toctree:: - :hidden: - - svm/plot_custom_kernel - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_svm_anova.png - :target: ./svm/plot_svm_anova.html - - :ref:`example_svm_plot_svm_anova.py` - - -.. raw:: html - - -

This example shows how to perform univariate feature before running a SVC (support vector class... -

-
- - -.. toctree:: - :hidden: - - svm/plot_svm_anova - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_weighted_samples.png - :target: ./svm/plot_weighted_samples.html - - :ref:`example_svm_plot_weighted_samples.py` - - -.. raw:: html - - -

Plot decision function of a weighted dataset, where the size of points is proportional to its w... -

-
- - -.. toctree:: - :hidden: - - svm/plot_weighted_samples - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_oneclass.png - :target: ./svm/plot_oneclass.html - - :ref:`example_svm_plot_oneclass.py` - - -.. raw:: html - - -

An example using a one-class SVM for novelty detection. -

-
- - -.. toctree:: - :hidden: - - svm/plot_oneclass - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_iris.png - :target: ./svm/plot_iris.html - - :ref:`example_svm_plot_iris.py` - - -.. raw:: html - - -

Comparison of different linear SVM classifiers on a 2D projection of the iris dataset. We only ... -

-
- - -.. toctree:: - :hidden: - - svm/plot_iris - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_svm_kernels.png - :target: ./svm/plot_svm_kernels.html - - :ref:`example_svm_plot_svm_kernels.py` - - -.. raw:: html - - -

Three different types of SVM-Kernels are displayed below. The polynomial and RBF are especially... -

-
- - -.. toctree:: - :hidden: - - svm/plot_svm_kernels - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_svm_margin.png - :target: ./svm/plot_svm_margin.html - - :ref:`example_svm_plot_svm_margin.py` - - -.. raw:: html - - -

A small value of `C` includes more/all the observations, allowing the margins to be calculated ... -

-
- - -.. toctree:: - :hidden: - - svm/plot_svm_margin - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_svm_scale_c.png - :target: ./svm/plot_svm_scale_c.html - - :ref:`example_svm_plot_svm_scale_c.py` - - -.. raw:: html - - -

The following example illustrates the effect of scaling the regularization parameter when using... -

-
- - -.. toctree:: - :hidden: - - svm/plot_svm_scale_c - - - -.. raw:: html - - -
-
- - -.. figure:: svm/images/thumb/plot_rbf_parameters.png - :target: ./svm/plot_rbf_parameters.html - - :ref:`example_svm_plot_rbf_parameters.py` - - -.. raw:: html - - -

This example illustrates the effect of the parameters `gamma` and `C` of the rbf kernel SVM. -

-
- - -.. toctree:: - :hidden: - - svm/plot_rbf_parameters - - -.. raw:: html - -
- - - -.. _tree_examples: - -Decision Trees --------------- - -Examples concerning the :mod:`sklearn.tree` package. - - - - - -.. raw:: html - - -
-
- - -.. figure:: tree/images/thumb/plot_tree_regression.png - :target: ./tree/plot_tree_regression.html - - :ref:`example_tree_plot_tree_regression.py` - - -.. raw:: html - - -

A 1D regression with decision tree. -

-
- - -.. toctree:: - :hidden: - - tree/plot_tree_regression - - - -.. raw:: html - - -
-
- - -.. figure:: tree/images/thumb/plot_tree_regression_multioutput.png - :target: ./tree/plot_tree_regression_multioutput.html - - :ref:`example_tree_plot_tree_regression_multioutput.py` - - -.. raw:: html - - -

An example to illustrate multi-output regression with decision tree. -

-
- - -.. toctree:: - :hidden: - - tree/plot_tree_regression_multioutput - - - -.. raw:: html - - -
-
- - -.. figure:: tree/images/thumb/plot_iris.png - :target: ./tree/plot_iris.html - - :ref:`example_tree_plot_iris.py` - - -.. raw:: html - - -

Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. -

-
- - -.. toctree:: - :hidden: - - tree/plot_iris - - -.. raw:: html - -
- \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/lasso_dense_vs_sparse_data.txt b/0.15/_sources/auto_examples/linear_model/lasso_dense_vs_sparse_data.txt deleted file mode 100644 index 4cfcdbf995a97..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/lasso_dense_vs_sparse_data.txt +++ /dev/null @@ -1,19 +0,0 @@ - - -.. _example_linear_model_lasso_dense_vs_sparse_data.py: - - -============================== -Lasso on dense and sparse data -============================== - -We show that linear_model.Lasso provides the same results for dense and sparse -data and that in the case of sparse data the speed is improved. - - - -**Python source code:** :download:`lasso_dense_vs_sparse_data.py ` - -.. literalinclude:: lasso_dense_vs_sparse_data.py - :lines: 10- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_ard.txt b/0.15/_sources/auto_examples/linear_model/plot_ard.txt deleted file mode 100644 index 5def72541df8c..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_ard.txt +++ /dev/null @@ -1,53 +0,0 @@ - - -.. _example_linear_model_plot_ard.py: - - -================================================== -Automatic Relevance Determination Regression (ARD) -================================================== - -Fit regression model with Bayesian Ridge Regression. - -See :ref:`bayesian_ridge_regression` for more information on the regressor. - -Compared to the OLS (ordinary least squares) estimator, the coefficient -weights are slightly shifted toward zeros, which stabilises them. - -The histogram of the estimated weights is very peaked, as a sparsity-inducing -prior is implied on the weights. - -The estimation of the model is done by iteratively maximizing the -marginal log-likelihood of the observations. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_ard_001.png - :scale: 47 - - * - - .. image:: images/plot_ard_002.png - :scale: 47 - - * - - .. image:: images/plot_ard_003.png - :scale: 47 - - - - -**Python source code:** :download:`plot_ard.py ` - -.. literalinclude:: plot_ard.py - :lines: 19- - -**Total running time of the example:** 0.39 seconds -( 0 minutes 0.39 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_bayesian_ridge.txt b/0.15/_sources/auto_examples/linear_model/plot_bayesian_ridge.txt deleted file mode 100644 index a4299e7d23b2d..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_bayesian_ridge.txt +++ /dev/null @@ -1,53 +0,0 @@ - - -.. _example_linear_model_plot_bayesian_ridge.py: - - -========================= -Bayesian Ridge Regression -========================= - -Computes a Bayesian Ridge Regression on a synthetic dataset. - -See :ref:`bayesian_ridge_regression` for more information on the regressor. - -Compared to the OLS (ordinary least squares) estimator, the coefficient -weights are slightly shifted toward zeros, which stabilises them. - -As the prior on the weights is a Gaussian prior, the histogram of the -estimated weights is Gaussian. - -The estimation of the model is done by iteratively maximizing the -marginal log-likelihood of the observations. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_bayesian_ridge_001.png - :scale: 47 - - * - - .. image:: images/plot_bayesian_ridge_002.png - :scale: 47 - - * - - .. image:: images/plot_bayesian_ridge_003.png - :scale: 47 - - - - -**Python source code:** :download:`plot_bayesian_ridge.py ` - -.. literalinclude:: plot_bayesian_ridge.py - :lines: 19- - -**Total running time of the example:** 0.26 seconds -( 0 minutes 0.26 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_iris_logistic.txt b/0.15/_sources/auto_examples/linear_model/plot_iris_logistic.txt deleted file mode 100644 index 73f92fadb9ccb..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_iris_logistic.txt +++ /dev/null @@ -1,30 +0,0 @@ - - -.. _example_linear_model_plot_iris_logistic.py: - - -========================================================= -Logistic Regression 3-class Classifier -========================================================= - -Show below is a logistic-regression classifiers decision boundaries on the -`iris `_ dataset. The -datapoints are colored according to their labels. - - - - -.. image:: images/plot_iris_logistic_001.png - :align: center - - - - -**Python source code:** :download:`plot_iris_logistic.py ` - -.. literalinclude:: plot_iris_logistic.py - :lines: 14- - -**Total running time of the example:** 0.09 seconds -( 0 minutes 0.09 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_lasso_and_elasticnet.txt b/0.15/_sources/auto_examples/linear_model/plot_lasso_and_elasticnet.txt deleted file mode 100644 index 6fe6fc3870cd9..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_lasso_and_elasticnet.txt +++ /dev/null @@ -1,41 +0,0 @@ - - -.. _example_linear_model_plot_lasso_and_elasticnet.py: - - -======================================== -Lasso and Elastic Net for Sparse Signals -======================================== - -Estimates Lasso and Elastic-Net regression models on a manually generated -sparse signal corrupted with an additive noise. Estimated coefficients are -compared with the ground-truth. - - - - -.. image:: images/plot_lasso_and_elasticnet_001.png - :align: center - - -**Script output**:: - - Lasso(alpha=0.1, copy_X=True, fit_intercept=True, max_iter=1000, - normalize=False, positive=False, precompute=False, random_state=None, - selection='cyclic', tol=0.0001, warm_start=False) - r^2 on test data : 0.384710 - ElasticNet(alpha=0.1, copy_X=True, fit_intercept=True, l1_ratio=0.7, - max_iter=1000, normalize=False, positive=False, precompute=False, - random_state=None, selection='cyclic', tol=0.0001, warm_start=False) - r^2 on test data : 0.240176 - - - -**Python source code:** :download:`plot_lasso_and_elasticnet.py ` - -.. literalinclude:: plot_lasso_and_elasticnet.py - :lines: 11- - -**Total running time of the example:** 0.10 seconds -( 0 minutes 0.10 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_lasso_coordinate_descent_path.txt b/0.15/_sources/auto_examples/linear_model/plot_lasso_coordinate_descent_path.txt deleted file mode 100644 index 056098e83a9a2..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_lasso_coordinate_descent_path.txt +++ /dev/null @@ -1,52 +0,0 @@ - - -.. _example_linear_model_plot_lasso_coordinate_descent_path.py: - - -===================== -Lasso and Elastic Net -===================== - -Lasso and elastic net (L1 and L2 penalisation) implemented using a -coordinate descent. - -The coefficients can be forced to be positive. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_lasso_coordinate_descent_path_001.png - :scale: 47 - - * - - .. image:: images/plot_lasso_coordinate_descent_path_002.png - :scale: 47 - - * - - .. image:: images/plot_lasso_coordinate_descent_path_003.png - :scale: 47 - - -**Script output**:: - - Computing regularization path using the lasso... - Computing regularization path using the positive lasso... - Computing regularization path using the elastic net... - Computing regularization path using the positve elastic net... - - - -**Python source code:** :download:`plot_lasso_coordinate_descent_path.py ` - -.. literalinclude:: plot_lasso_coordinate_descent_path.py - :lines: 11- - -**Total running time of the example:** 0.26 seconds -( 0 minutes 0.26 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_lasso_lars.txt b/0.15/_sources/auto_examples/linear_model/plot_lasso_lars.txt deleted file mode 100644 index a4daf2e2cfddc..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_lasso_lars.txt +++ /dev/null @@ -1,36 +0,0 @@ - - -.. _example_linear_model_plot_lasso_lars.py: - - -===================== -Lasso path using LARS -===================== - -Computes Lasso Path along the regularization parameter using the LARS -algorithm on the diabetes dataset. Each color represents a different -feature of the coefficient vector, and this is displayed as a function -of the regularization parameter. - - - - -.. image:: images/plot_lasso_lars_001.png - :align: center - - -**Script output**:: - - Computing regularization path using the LARS ... - . - - - -**Python source code:** :download:`plot_lasso_lars.py ` - -.. literalinclude:: plot_lasso_lars.py - :lines: 13- - -**Total running time of the example:** 0.10 seconds -( 0 minutes 0.10 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_lasso_model_selection.txt b/0.15/_sources/auto_examples/linear_model/plot_lasso_model_selection.txt deleted file mode 100644 index 293c53cd9be06..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_lasso_model_selection.txt +++ /dev/null @@ -1,83 +0,0 @@ - - -.. _example_linear_model_plot_lasso_model_selection.py: - - -=================================================== -Lasso model selection: Cross-Validation / AIC / BIC -=================================================== - -Use the Akaike information criterion (AIC), the Bayes Information -criterion (BIC) and cross-validation to select an optimal value -of the regularization parameter alpha of the :ref:`lasso` estimator. - -Results obtained with LassoLarsIC are based on AIC/BIC criteria. - -Information-criterion based model selection is very fast, but it -relies on a proper estimation of degrees of freedom, are -derived for large samples (asymptotic results) and assume the model -is correct, i.e. that the data are actually generated by this model. -They also tend to break when the problem is badly conditioned -(more features than samples). - -For cross-validation, we use 20-fold with 2 algorithms to compute the -Lasso path: coordinate descent, as implemented by the LassoCV class, and -Lars (least angle regression) as implemented by the LassoLarsCV class. -Both algorithms give roughly the same results. They differ with regards -to their execution speed and sources of numerical errors. - -Lars computes a path solution only for each kink in the path. As a -result, it is very efficient when there are only of few kinks, which is -the case if there are few features or samples. Also, it is able to -compute the full path without setting any meta parameter. On the -opposite, coordinate descent compute the path points on a pre-specified -grid (here we use the default). Thus it is more efficient if the number -of grid points is smaller than the number of kinks in the path. Such a -strategy can be interesting if the number of features is really large -and there are enough samples to select a large amount. In terms of -numerical errors, for heavily correlated variables, Lars will accumulate -more errors, while the coordinate descent algorithm will only sample the -path on a grid. - -Note how the optimal value of alpha varies for each fold. This -illustrates why nested-cross validation is necessary when trying to -evaluate the performance of a method for which a parameter is chosen by -cross-validation: this choice of parameter may not be optimal for unseen -data. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_lasso_model_selection_001.png - :scale: 47 - - * - - .. image:: images/plot_lasso_model_selection_002.png - :scale: 47 - - * - - .. image:: images/plot_lasso_model_selection_003.png - :scale: 47 - - -**Script output**:: - - Computing regularization path using the coordinate descent lasso... - Computing regularization path using the Lars lasso... - - - -**Python source code:** :download:`plot_lasso_model_selection.py ` - -.. literalinclude:: plot_lasso_model_selection.py - :lines: 44- - -**Total running time of the example:** 0.66 seconds -( 0 minutes 0.66 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_logistic.txt b/0.15/_sources/auto_examples/linear_model/plot_logistic.txt deleted file mode 100644 index b7a68223385fc..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_logistic.txt +++ /dev/null @@ -1,30 +0,0 @@ - - -.. _example_linear_model_plot_logistic.py: - - -========================================================= -Logit function -========================================================= - -Show in the plot is how the logistic regression would, in this -synthetic dataset, classify values as either 0 or 1, -i.e. class one or two, using the logit-curve. - - - - -.. image:: images/plot_logistic_001.png - :align: center - - - - -**Python source code:** :download:`plot_logistic.py ` - -.. literalinclude:: plot_logistic.py - :lines: 15- - -**Total running time of the example:** 0.09 seconds -( 0 minutes 0.09 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_logistic_l1_l2_sparsity.txt b/0.15/_sources/auto_examples/linear_model/plot_logistic_l1_l2_sparsity.txt deleted file mode 100644 index 9d29e4a287506..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_logistic_l1_l2_sparsity.txt +++ /dev/null @@ -1,52 +0,0 @@ - - -.. _example_linear_model_plot_logistic_l1_l2_sparsity.py: - - -============================================== -L1 Penalty and Sparsity in Logistic Regression -============================================== - -Comparison of the sparsity (percentage of zero coefficients) of solutions when -L1 and L2 penalty are used for different values of C. We can see that large -values of C give more freedom to the model. Conversely, smaller values of C -constrain the model more. In the L1 penalty case, this leads to sparser -solutions. - -We classify 8x8 images of digits into two classes: 0-4 against 5-9. -The visualization shows coefficients of the models for varying C. - - - -.. image:: images/plot_logistic_l1_l2_sparsity_001.png - :align: center - - -**Script output**:: - - C=10 - Sparsity with L1 penalty: 6.25% - score with L1 penalty: 0.9098 - Sparsity with L2 penalty: 4.69% - score with L2 penalty: 0.9093 - C=100 - Sparsity with L1 penalty: 6.25% - score with L1 penalty: 0.9115 - Sparsity with L2 penalty: 4.69% - score with L2 penalty: 0.9098 - C=1000 - Sparsity with L1 penalty: 4.69% - score with L1 penalty: 0.9104 - Sparsity with L2 penalty: 4.69% - score with L2 penalty: 0.9098 - - - -**Python source code:** :download:`plot_logistic_l1_l2_sparsity.py ` - -.. literalinclude:: plot_logistic_l1_l2_sparsity.py - :lines: 15- - -**Total running time of the example:** 0.47 seconds -( 0 minutes 0.47 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_logistic_path.txt b/0.15/_sources/auto_examples/linear_model/plot_logistic_path.txt deleted file mode 100644 index 42c0277783034..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_logistic_path.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_linear_model_plot_logistic_path.py: - - -================================= -Path with L1- Logistic Regression -================================= - -Computes path on IRIS dataset. - - - - -.. image:: images/plot_logistic_path_001.png - :align: center - - -**Script output**:: - - Computing regularization path ... - This took 0:00:00.026381 - - - -**Python source code:** :download:`plot_logistic_path.py ` - -.. literalinclude:: plot_logistic_path.py - :lines: 10- - -**Total running time of the example:** 0.11 seconds -( 0 minutes 0.11 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_multi_task_lasso_support.txt b/0.15/_sources/auto_examples/linear_model/plot_multi_task_lasso_support.txt deleted file mode 100644 index ed639a8cb92c3..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_multi_task_lasso_support.txt +++ /dev/null @@ -1,44 +0,0 @@ - - -.. _example_linear_model_plot_multi_task_lasso_support.py: - - -============================================= -Joint feature selection with multi-task Lasso -============================================= - -The multi-task lasso allows to fit multiple regression problems -jointly enforcing the selected features to be the same across -tasks. This example simulates sequential measurements, each task -is a time instant, and the relevant features vary in amplitude -over time while being the same. The multi-task lasso imposes that -features that are selected at one time point are select for all time -point. This makes feature selection by the Lasso more stable. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_multi_task_lasso_support_001.png - :scale: 47 - - * - - .. image:: images/plot_multi_task_lasso_support_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_multi_task_lasso_support.py ` - -.. literalinclude:: plot_multi_task_lasso_support.py - :lines: 16- - -**Total running time of the example:** 0.17 seconds -( 0 minutes 0.17 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_ols.txt b/0.15/_sources/auto_examples/linear_model/plot_ols.txt deleted file mode 100644 index 8c2e47386a559..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_ols.txt +++ /dev/null @@ -1,42 +0,0 @@ - - -.. _example_linear_model_plot_ols.py: - - -========================================================= -Linear Regression Example -========================================================= -This example uses the only the first feature of the `diabetes` dataset, in -order to illustrate a two-dimensional plot of this regression technique. The -straight line can be seen in the plot, showing how linear regression attempts -to draw a straight line that will best minimize the residual sum of squares -between the observed responses in the dataset, and the responses predicted by -the linear approximation. - -The coefficients, the residual sum of squares and the variance score are also -calculated. - - - - -.. image:: images/plot_ols_001.png - :align: center - - -**Script output**:: - - Coefficients: - [ 938.23786125] - Residual sum of squares: 2548.07 - Variance score: 0.47 - - - -**Python source code:** :download:`plot_ols.py ` - -.. literalinclude:: plot_ols.py - :lines: 19- - -**Total running time of the example:** 0.13 seconds -( 0 minutes 0.13 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_ols_3d.txt b/0.15/_sources/auto_examples/linear_model/plot_ols_3d.txt deleted file mode 100644 index 1c0c1d2b6897d..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_ols_3d.txt +++ /dev/null @@ -1,46 +0,0 @@ - - -.. _example_linear_model_plot_ols_3d.py: - - -========================================================= -Sparsity Example: Fitting only features 1 and 2 -========================================================= - -Features 1 and 2 of the diabetes-dataset are fitted and -plotted below. It illustrates that although feature 2 -has a strong coefficient on the full model, it does not -give us much regarding `y` when compared to just feature 1 - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_ols_3d_001.png - :scale: 47 - - * - - .. image:: images/plot_ols_3d_002.png - :scale: 47 - - * - - .. image:: images/plot_ols_3d_003.png - :scale: 47 - - - - -**Python source code:** :download:`plot_ols_3d.py ` - -.. literalinclude:: plot_ols_3d.py - :lines: 15- - -**Total running time of the example:** 0.26 seconds -( 0 minutes 0.26 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_ols_ridge_variance.txt b/0.15/_sources/auto_examples/linear_model/plot_ols_ridge_variance.txt deleted file mode 100644 index 070bcd0f26fbd..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_ols_ridge_variance.txt +++ /dev/null @@ -1,49 +0,0 @@ - - -.. _example_linear_model_plot_ols_ridge_variance.py: - - -========================================================= -Ordinary Least Squares and Ridge Regression Variance -========================================================= -Due to the few points in each dimension and the straight -line that linear regression uses to follow these points -as well as it can, noise on the observations will cause -great variance as shown in the first plot. Every line's slope -can vary quite a bit for each prediction due to the noise -induced in the observations. - -Ridge regression is basically minimizing a penalised version -of the least-squared function. The penalising `shrinks` the -value of the regression coefficients. -Despite the few data points in each dimension, the slope -of the prediction is much more stable and the variance -in the line itself is greatly reduced, in comparison to that -of the standard linear regression - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_ols_ridge_variance_001.png - :scale: 47 - - * - - .. image:: images/plot_ols_ridge_variance_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_ols_ridge_variance.py ` - -.. literalinclude:: plot_ols_ridge_variance.py - :lines: 23- - -**Total running time of the example:** 0.23 seconds -( 0 minutes 0.23 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_omp.txt b/0.15/_sources/auto_examples/linear_model/plot_omp.txt deleted file mode 100644 index 8d7867088f3a6..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_omp.txt +++ /dev/null @@ -1,28 +0,0 @@ - - -.. _example_linear_model_plot_omp.py: - - -=========================== -Orthogonal Matching Pursuit -=========================== - -Using orthogonal matching pursuit for recovering a sparse signal from a noisy -measurement encoded with a dictionary - - - -.. image:: images/plot_omp_001.png - :align: center - - - - -**Python source code:** :download:`plot_omp.py ` - -.. literalinclude:: plot_omp.py - :lines: 9- - -**Total running time of the example:** 0.29 seconds -( 0 minutes 0.29 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_polynomial_interpolation.txt b/0.15/_sources/auto_examples/linear_model/plot_polynomial_interpolation.txt deleted file mode 100644 index eadb502618175..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_polynomial_interpolation.txt +++ /dev/null @@ -1,42 +0,0 @@ - - -.. _example_linear_model_plot_polynomial_interpolation.py: - - -======================== -Polynomial interpolation -======================== - -This example demonstrates how to approximate a function with a polynomial of -degree n_degree by using ridge regression. Concretely, from n_samples 1d -points, it suffices to build the Vandermonde matrix, which is n_samples x -n_degree+1 and has the following form: - -[[1, x_1, x_1 ** 2, x_1 ** 3, ...], - [1, x_2, x_2 ** 2, x_2 ** 3, ...], - ...] - -Intuitively, this matrix can be interpreted as a matrix of pseudo features (the -points raised to some power). The matrix is akin to (but different from) the -matrix induced by a polynomial kernel. - -This example shows that you can do non-linear regression with a linear model, -using a pipeline to add non-linear features. Kernel methods extend this idea -and can induce very high (even infinite) dimensional feature spaces. - - - -.. image:: images/plot_polynomial_interpolation_001.png - :align: center - - - - -**Python source code:** :download:`plot_polynomial_interpolation.py ` - -.. literalinclude:: plot_polynomial_interpolation.py - :lines: 24- - -**Total running time of the example:** 0.11 seconds -( 0 minutes 0.11 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_ransac.txt b/0.15/_sources/auto_examples/linear_model/plot_ransac.txt deleted file mode 100644 index 6af220a7d5b65..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_ransac.txt +++ /dev/null @@ -1,34 +0,0 @@ - - -.. _example_linear_model_plot_ransac.py: - - -=========================================== -Robust linear model estimation using RANSAC -=========================================== - -In this example we see how to robustly fit a linear model to faulty data using -the RANSAC algorithm. - - - - -.. image:: images/plot_ransac_001.png - :align: center - - -**Script output**:: - - Estimated coefficients (true, normal, RANSAC): - 82.1903908408 [ 54.17236387] [ 82.08533159] - - - -**Python source code:** :download:`plot_ransac.py ` - -.. literalinclude:: plot_ransac.py - :lines: 10- - -**Total running time of the example:** 0.11 seconds -( 0 minutes 0.11 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_ridge_path.txt b/0.15/_sources/auto_examples/linear_model/plot_ridge_path.txt deleted file mode 100644 index 7ea322a548bfc..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_ridge_path.txt +++ /dev/null @@ -1,38 +0,0 @@ - - -.. _example_linear_model_plot_ridge_path.py: - - -=========================================================== -Plot Ridge coefficients as a function of the regularization -=========================================================== - -Shows the effect of collinearity in the coefficients of an estimator. - -.. currentmodule:: sklearn.linear_model - -:class:`Ridge` Regression is the estimator used in this example. -Each color represents a different feature of the -coefficient vector, and this is displayed as a function of the -regularization parameter. - -At the end of the path, as alpha tends toward zero -and the solution tends towards the ordinary least squares, coefficients -exhibit big oscillations. - - - -.. image:: images/plot_ridge_path_001.png - :align: center - - - - -**Python source code:** :download:`plot_ridge_path.py ` - -.. literalinclude:: plot_ridge_path.py - :lines: 19- - -**Total running time of the example:** 0.13 seconds -( 0 minutes 0.13 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_robust_fit.txt b/0.15/_sources/auto_examples/linear_model/plot_robust_fit.txt deleted file mode 100644 index b883c1b5cff49..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_robust_fit.txt +++ /dev/null @@ -1,72 +0,0 @@ - - -.. _example_linear_model_plot_robust_fit.py: - - -Robust linear estimator fitting -=============================== - -Here a sine function is fit with a polynomial of order 3, for values -close to zero. - -Robust fitting is demoed in different situations: - -- No measurement errors, only modelling errors (fitting a sine with a - polynomial) - -- Measurement errors in X - -- Measurement errors in y - -The median absolute deviation to non corrupt new data is used to judge -the quality of the prediction. - -What we can see that: - -- RANSAC is good for strong outliers in the y direction - -- TheilSen is good for small outliers, both in direction X and y, but has - a break point above which it performs worst than OLS. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_robust_fit_001.png - :scale: 47 - - * - - .. image:: images/plot_robust_fit_002.png - :scale: 47 - - * - - .. image:: images/plot_robust_fit_003.png - :scale: 47 - - * - - .. image:: images/plot_robust_fit_004.png - :scale: 47 - - * - - .. image:: images/plot_robust_fit_005.png - :scale: 47 - - - - -**Python source code:** :download:`plot_robust_fit.py ` - -.. literalinclude:: plot_robust_fit.py - :lines: 28- - -**Total running time of the example:** 5.97 seconds -( 0 minutes 5.97 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_sgd_comparison.txt b/0.15/_sources/auto_examples/linear_model/plot_sgd_comparison.txt deleted file mode 100644 index 47b26fa3c3fb5..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_sgd_comparison.txt +++ /dev/null @@ -1,29 +0,0 @@ - - -.. _example_linear_model_plot_sgd_comparison.py: - - -================================== -Comparing various online solvers -================================== - -An example showing how different online solvers perform -on the hand-written digits dataset. - - - - -.. image:: images/plot_sgd_comparison_001.png - :align: center - - - - -**Python source code:** :download:`plot_sgd_comparison.py ` - -.. literalinclude:: plot_sgd_comparison.py - :lines: 10- - -**Total running time of the example:** 3.38 seconds -( 0 minutes 3.38 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_sgd_iris.txt b/0.15/_sources/auto_examples/linear_model/plot_sgd_iris.txt deleted file mode 100644 index ccafe1d189b4d..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_sgd_iris.txt +++ /dev/null @@ -1,30 +0,0 @@ - - -.. _example_linear_model_plot_sgd_iris.py: - - -======================================== -Plot multi-class SGD on the iris dataset -======================================== - -Plot decision surface of multi-class SGD on iris dataset. -The hyperplanes corresponding to the three one-versus-all (OVA) classifiers -are represented by the dashed lines. - - - - -.. image:: images/plot_sgd_iris_001.png - :align: center - - - - -**Python source code:** :download:`plot_sgd_iris.py ` - -.. literalinclude:: plot_sgd_iris.py - :lines: 11- - -**Total running time of the example:** 0.13 seconds -( 0 minutes 0.13 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_sgd_loss_functions.txt b/0.15/_sources/auto_examples/linear_model/plot_sgd_loss_functions.txt deleted file mode 100644 index e8e9ef499f685..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_sgd_loss_functions.txt +++ /dev/null @@ -1,28 +0,0 @@ - - -.. _example_linear_model_plot_sgd_loss_functions.py: - - -========================== -SGD: convex loss functions -========================== - -A plot that compares the various convex loss functions supported by -:class:`sklearn.linear_model.SGDClassifier` . - - - -.. image:: images/plot_sgd_loss_functions_001.png - :align: center - - - - -**Python source code:** :download:`plot_sgd_loss_functions.py ` - -.. literalinclude:: plot_sgd_loss_functions.py - :lines: 9- - -**Total running time of the example:** 0.09 seconds -( 0 minutes 0.09 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_sgd_penalties.txt b/0.15/_sources/auto_examples/linear_model/plot_sgd_penalties.txt deleted file mode 100644 index e97b2eca52ac7..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_sgd_penalties.txt +++ /dev/null @@ -1,31 +0,0 @@ - - -.. _example_linear_model_plot_sgd_penalties.py: - - -============== -SGD: Penalties -============== - -Plot the contours of the three penalties. - -All of the above are supported by -:class:`sklearn.linear_model.stochastic_gradient`. - - - - -.. image:: images/plot_sgd_penalties_001.png - :align: center - - - - -**Python source code:** :download:`plot_sgd_penalties.py ` - -.. literalinclude:: plot_sgd_penalties.py - :lines: 12- - -**Total running time of the example:** 0.10 seconds -( 0 minutes 0.10 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_sgd_separating_hyperplane.txt b/0.15/_sources/auto_examples/linear_model/plot_sgd_separating_hyperplane.txt deleted file mode 100644 index 884e8ae041607..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_sgd_separating_hyperplane.txt +++ /dev/null @@ -1,29 +0,0 @@ - - -.. _example_linear_model_plot_sgd_separating_hyperplane.py: - - -========================================= -SGD: Maximum margin separating hyperplane -========================================= - -Plot the maximum margin separating hyperplane within a two-class -separable dataset using a linear Support Vector Machines classifier -trained using SGD. - - - -.. image:: images/plot_sgd_separating_hyperplane_001.png - :align: center - - - - -**Python source code:** :download:`plot_sgd_separating_hyperplane.py ` - -.. literalinclude:: plot_sgd_separating_hyperplane.py - :lines: 10- - -**Total running time of the example:** 0.09 seconds -( 0 minutes 0.09 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_sgd_weighted_samples.txt b/0.15/_sources/auto_examples/linear_model/plot_sgd_weighted_samples.txt deleted file mode 100644 index 0a3c04e5c98ee..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_sgd_weighted_samples.txt +++ /dev/null @@ -1,28 +0,0 @@ - - -.. _example_linear_model_plot_sgd_weighted_samples.py: - - -===================== -SGD: Weighted samples -===================== - -Plot decision function of a weighted dataset, where the size of points -is proportional to its weight. - - - -.. image:: images/plot_sgd_weighted_samples_001.png - :align: center - - - - -**Python source code:** :download:`plot_sgd_weighted_samples.py ` - -.. literalinclude:: plot_sgd_weighted_samples.py - :lines: 9- - -**Total running time of the example:** 0.11 seconds -( 0 minutes 0.11 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_sparse_recovery.txt b/0.15/_sources/auto_examples/linear_model/plot_sparse_recovery.txt deleted file mode 100644 index d17ebf1be662b..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_sparse_recovery.txt +++ /dev/null @@ -1,80 +0,0 @@ - - -.. _example_linear_model_plot_sparse_recovery.py: - - -============================================================ -Sparse recovery: feature selection for sparse linear models -============================================================ - -Given a small number of observations, we want to recover which features -of X are relevant to explain y. For this :ref:`sparse linear models -` can outperform standard statistical tests if the -true model is sparse, i.e. if a small fraction of the features are -relevant. - -As detailed in :ref:`the compressive sensing notes -`, the ability of L1-based approach to identify the -relevant variables depends on the sparsity of the ground truth, the -number of samples, the number of features, the conditioning of the -design matrix on the signal subspace, the amount of noise, and the -absolute value of the smallest non-zero coefficient [Wainwright2006] -(http://statistics.berkeley.edu/tech-reports/709.pdf). - -Here we keep all parameters constant and vary the conditioning of the -design matrix. For a well-conditioned design matrix (small mutual -incoherence) we are exactly in compressive sensing conditions (i.i.d -Gaussian sensing matrix), and L1-recovery with the Lasso performs very -well. For an ill-conditioned matrix (high mutual incoherence), -regressors are very correlated, and the Lasso randomly selects one. -However, randomized-Lasso can recover the ground truth well. - -In each situation, we first vary the alpha parameter setting the sparsity -of the estimated model and look at the stability scores of the randomized -Lasso. This analysis, knowing the ground truth, shows an optimal regime -in which relevant features stand out from the irrelevant ones. If alpha -is chosen too small, non-relevant variables enter the model. On the -opposite, if alpha is selected too large, the Lasso is equivalent to -stepwise regression, and thus brings no advantage over a univariate -F-test. - -In a second time, we set alpha and compare the performance of different -feature selection methods, using the area under curve (AUC) of the -precision-recall. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_sparse_recovery_001.png - :scale: 47 - - * - - .. image:: images/plot_sparse_recovery_002.png - :scale: 47 - - * - - .. image:: images/plot_sparse_recovery_003.png - :scale: 47 - - * - - .. image:: images/plot_sparse_recovery_004.png - :scale: 47 - - - - -**Python source code:** :download:`plot_sparse_recovery.py ` - -.. literalinclude:: plot_sparse_recovery.py - :lines: 41- - -**Total running time of the example:** 5.55 seconds -( 0 minutes 5.55 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/linear_model/plot_theilsen.txt b/0.15/_sources/auto_examples/linear_model/plot_theilsen.txt deleted file mode 100644 index 918fac1c2eb27..0000000000000 --- a/0.15/_sources/auto_examples/linear_model/plot_theilsen.txt +++ /dev/null @@ -1,65 +0,0 @@ - - -.. _example_linear_model_plot_theilsen.py: - - -==================== -Theil-Sen Regression -==================== - -Computes a Theil-Sen Regression on a synthetic dataset. - -See :ref:`theil_sen_regression` for more information on the regressor. - -Compared to the OLS (ordinary least squares) estimator, the Theil-Sen -estimator is robust against outliers. It has a breakdown point of about 29.3% -in case of a simple linear regression which means that it can tolerate -arbitrary corrupted data (outliers) of up to 29.3% in the two-dimensional -case. - -The estimation of the model is done by calculating the slopes and intercepts -of a subpopulation of all possible combinations of p subsample points. If an -intercept is fitted, p must be greater than or equal to n_features + 1. The -final slope and intercept is then defined as the spatial median of these -slopes and intercepts. - -In certain cases Theil-Sen performs better than :ref:`RANSAC -` which is also a robust method. This is illustrated in the -second example below where outliers with respect to the x-axis perturb RANSAC. -Tuning the ``residual_threshold`` parameter of RANSAC remedies this but in -general a priori knowledge about the data and the nature of the outliers is -needed. -Due to the computational complexity of Theil-Sen it is recommended to use it -only for small problems in terms of number of samples and features. For larger -problems the ``max_subpopulation`` parameter restricts the magnitude of all -possible combinations of p subsample points to a randomly chosen subset and -therefore also limits the runtime. Therefore, Theil-Sen is applicable to larger -problems with the drawback of losing some of its mathematical properties since -it then works on a random subset. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_theilsen_001.png - :scale: 47 - - * - - .. image:: images/plot_theilsen_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_theilsen.py ` - -.. literalinclude:: plot_theilsen.py - :lines: 36- - -**Total running time of the example:** 1.60 seconds -( 0 minutes 1.60 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/manifold/plot_compare_methods.txt b/0.15/_sources/auto_examples/manifold/plot_compare_methods.txt deleted file mode 100644 index 4771aede62b58..0000000000000 --- a/0.15/_sources/auto_examples/manifold/plot_compare_methods.txt +++ /dev/null @@ -1,51 +0,0 @@ - - -.. _example_manifold_plot_compare_methods.py: - - -========================================= - Comparison of Manifold Learning methods -========================================= - -An illustration of dimensionality reduction on the S-curve dataset -with various manifold learning methods. - -For a discussion and comparison of these algorithms, see the -:ref:`manifold module page ` - -For a similar example, where the methods are applied to a -sphere dataset, see :ref:`example_manifold_plot_manifold_sphere.py` - -Note that the purpose of the MDS is to find a low-dimensional -representation of the data (here 2D) in which the distances respect well -the distances in the original high-dimensional space, unlike other -manifold-learning algorithms, it does not seeks an isotropic -representation of the data in the low-dimensional space. - - - -.. image:: images/plot_compare_methods_001.png - :align: center - - -**Script output**:: - - standard: 0.12 sec - ltsa: 0.27 sec - hessian: 0.32 sec - modified: 0.24 sec - Isomap: 0.58 sec - MDS: 3 sec - SpectralEmbedding: 0.17 sec - t-SNE: 22 sec - - - -**Python source code:** :download:`plot_compare_methods.py ` - -.. literalinclude:: plot_compare_methods.py - :lines: 21- - -**Total running time of the example:** 27.51 seconds -( 0 minutes 27.51 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/manifold/plot_lle_digits.txt b/0.15/_sources/auto_examples/manifold/plot_lle_digits.txt deleted file mode 100644 index 15278c82f175e..0000000000000 --- a/0.15/_sources/auto_examples/manifold/plot_lle_digits.txt +++ /dev/null @@ -1,124 +0,0 @@ - - -.. _example_manifold_plot_lle_digits.py: - - -============================================================================= -Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... -============================================================================= - -An illustration of various embeddings on the digits dataset. - -The RandomTreesEmbedding, from the :mod:`sklearn.ensemble` module, is not -technically a manifold embedding method, as it learn a high-dimensional -representation on which we apply a dimensionality reduction method. -However, it is often useful to cast a dataset into a representation in -which the classes are linearly-separable. - -t-SNE will be initialized with the embedding that is generated by PCA in -this example, which is not the default setting. It ensures global stability -of the embedding, i.e., the embedding does not depend on random -initialization. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_lle_digits_001.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_002.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_003.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_004.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_005.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_006.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_007.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_008.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_009.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_010.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_011.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_012.png - :scale: 47 - - * - - .. image:: images/plot_lle_digits_013.png - :scale: 47 - - -**Script output**:: - - Computing random projection - Computing PCA projection - Computing LDA projection - Computing Isomap embedding - Done. - Computing LLE embedding - Done. Reconstruction error: 1.63539e-06 - Computing modified LLE embedding - Done. Reconstruction error: 0.360702 - Computing Hessian LLE embedding - Done. Reconstruction error: 0.212759 - Computing LTSA embedding - Done. Reconstruction error: 0.212806 - Computing MDS embedding - Done. Stress: 139486576.843200 - Computing Totally Random Trees embedding - Computing Spectral embedding - Computing t-SNE embedding - - - -**Python source code:** :download:`plot_lle_digits.py ` - -.. literalinclude:: plot_lle_digits.py - :lines: 19- - -**Total running time of the example:** 33.82 seconds -( 0 minutes 33.82 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/manifold/plot_manifold_sphere.txt b/0.15/_sources/auto_examples/manifold/plot_manifold_sphere.txt deleted file mode 100644 index 94ee714ecd274..0000000000000 --- a/0.15/_sources/auto_examples/manifold/plot_manifold_sphere.txt +++ /dev/null @@ -1,56 +0,0 @@ - - -.. _example_manifold_plot_manifold_sphere.py: - - -============================================= -Manifold Learning methods on a severed sphere -============================================= - -An application of the different :ref:`manifold` techniques -on a spherical data-set. Here one can see the use of -dimensionality reduction in order to gain some intuition -regarding the manifold learning methods. Regarding the dataset, -the poles are cut from the sphere, as well as a thin slice down its -side. This enables the manifold learning techniques to -'spread it open' whilst projecting it onto two dimensions. - -For a similar example, where the methods are applied to the -S-curve dataset, see :ref:`example_manifold_plot_compare_methods.py` - -Note that the purpose of the :ref:`MDS ` is -to find a low-dimensional representation of the data (here 2D) in -which the distances respect well the distances in the original -high-dimensional space, unlike other manifold-learning algorithms, -it does not seeks an isotropic representation of the data in -the low-dimensional space. Here the manifold problem matches fairly -that of representing a flat map of the Earth, as with -`map projection `_ - - - -.. image:: images/plot_manifold_sphere_001.png - :align: center - - -**Script output**:: - - standard: 0.086 sec - ltsa: 0.17 sec - hessian: 0.23 sec - modified: 0.18 sec - ISO: 0.32 sec - MDS: 1.6 sec - Spectral Embedding: 0.096 sec - t-SNE: 9.2 sec - - - -**Python source code:** :download:`plot_manifold_sphere.py ` - -.. literalinclude:: plot_manifold_sphere.py - :lines: 29- - -**Total running time of the example:** 12.30 seconds -( 0 minutes 12.30 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/manifold/plot_mds.txt b/0.15/_sources/auto_examples/manifold/plot_mds.txt deleted file mode 100644 index 8810a05ca6803..0000000000000 --- a/0.15/_sources/auto_examples/manifold/plot_mds.txt +++ /dev/null @@ -1,30 +0,0 @@ - - -.. _example_manifold_plot_mds.py: - - -========================= -Multi-dimensional scaling -========================= - -An illustration of the metric and non-metric MDS on generated noisy data. - -The reconstructed points using the metric MDS and non metric MDS are slightly -shifted to avoid overlapping. - - - -.. image:: images/plot_mds_001.png - :align: center - - - - -**Python source code:** :download:`plot_mds.py ` - -.. literalinclude:: plot_mds.py - :lines: 11- - -**Total running time of the example:** 0.15 seconds -( 0 minutes 0.15 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/manifold/plot_swissroll.txt b/0.15/_sources/auto_examples/manifold/plot_swissroll.txt deleted file mode 100644 index 961070da8b6fb..0000000000000 --- a/0.15/_sources/auto_examples/manifold/plot_swissroll.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_manifold_plot_swissroll.py: - - -=================================== -Swiss Roll reduction with LLE -=================================== - -An illustration of Swiss Roll reduction -with locally linear embedding - - - -.. image:: images/plot_swissroll_001.png - :align: center - - -**Script output**:: - - Computing LLE embedding - Done. Reconstruction error: 9.9806e-08 - - - -**Python source code:** :download:`plot_swissroll.py ` - -.. literalinclude:: plot_swissroll.py - :lines: 9- - -**Total running time of the example:** 0.38 seconds -( 0 minutes 0.38 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/missing_values.txt b/0.15/_sources/auto_examples/missing_values.txt deleted file mode 100644 index eb0efc2ded5f2..0000000000000 --- a/0.15/_sources/auto_examples/missing_values.txt +++ /dev/null @@ -1,34 +0,0 @@ - - -.. _example_missing_values.py: - - -====================================================== -Imputing missing values before building an estimator -====================================================== - -This example shows that imputing the missing values can give better results -than discarding the samples containing any missing value. -Imputing does not always improve the predictions, so please check via cross-validation. -Sometimes dropping rows or using marker values is more effective. - -Missing values can be replaced by the mean, the median or the most frequent -value using the ``strategy`` hyper-parameter. -The median is a more robust estimator for data with high magnitude variables -which could dominate results (otherwise known as a 'long tail'). - -Script output:: - - Score with the entire dataset = 0.56 - Score without the samples containing missing values = 0.48 - Score after imputation of the missing values = 0.55 - -In this case, imputing helps the classifier get close to the original score. - - - -**Python source code:** :download:`missing_values.py ` - -.. literalinclude:: missing_values.py - :lines: 25- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/mixture/plot_gmm.txt b/0.15/_sources/auto_examples/mixture/plot_gmm.txt deleted file mode 100644 index c493800e1c055..0000000000000 --- a/0.15/_sources/auto_examples/mixture/plot_gmm.txt +++ /dev/null @@ -1,42 +0,0 @@ - - -.. _example_mixture_plot_gmm.py: - - -================================= -Gaussian Mixture Model Ellipsoids -================================= - -Plot the confidence ellipsoids of a mixture of two Gaussians with EM -and variational Dirichlet process. - -Both models have access to five components with which to fit the -data. Note that the EM model will necessarily use all five components -while the DP model will effectively only use as many as are needed for -a good fit. This is a property of the Dirichlet Process prior. Here we -can see that the EM model splits some components arbitrarily, because it -is trying to fit too many components, while the Dirichlet Process model -adapts it number of state automatically. - -This example doesn't show it, as we're in a low-dimensional space, but -another advantage of the Dirichlet process model is that it can fit -full covariance matrices effectively even when there are less examples -per cluster than there are dimensions in the data, due to -regularization properties of the inference algorithm. - - - -.. image:: images/plot_gmm_001.png - :align: center - - - - -**Python source code:** :download:`plot_gmm.py ` - -.. literalinclude:: plot_gmm.py - :lines: 23- - -**Total running time of the example:** 0.35 seconds -( 0 minutes 0.35 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/mixture/plot_gmm_classifier.txt b/0.15/_sources/auto_examples/mixture/plot_gmm_classifier.txt deleted file mode 100644 index edc5a7780150a..0000000000000 --- a/0.15/_sources/auto_examples/mixture/plot_gmm_classifier.txt +++ /dev/null @@ -1,43 +0,0 @@ - - -.. _example_mixture_plot_gmm_classifier.py: - - -================== -GMM classification -================== - -Demonstration of Gaussian mixture models for classification. - -See :ref:`gmm` for more information on the estimator. - -Plots predicted labels on both training and held out test data using a -variety of GMM classifiers on the iris dataset. - -Compares GMMs with spherical, diagonal, full, and tied covariance -matrices in increasing order of performance. Although one would -expect full covariance to perform best in general, it is prone to -overfitting on small datasets and does not generalize well to held out -test data. - -On the plots, train data is shown as dots, while test data is shown as -crosses. The iris dataset is four-dimensional. Only the first two -dimensions are shown here, and thus some points are separated in other -dimensions. - - - -.. image:: images/plot_gmm_classifier_001.png - :align: center - - - - -**Python source code:** :download:`plot_gmm_classifier.py ` - -.. literalinclude:: plot_gmm_classifier.py - :lines: 24- - -**Total running time of the example:** 0.27 seconds -( 0 minutes 0.27 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/mixture/plot_gmm_pdf.txt b/0.15/_sources/auto_examples/mixture/plot_gmm_pdf.txt deleted file mode 100644 index 33cad247ca7ec..0000000000000 --- a/0.15/_sources/auto_examples/mixture/plot_gmm_pdf.txt +++ /dev/null @@ -1,29 +0,0 @@ - - -.. _example_mixture_plot_gmm_pdf.py: - - -============================================= -Density Estimation for a mixture of Gaussians -============================================= - -Plot the density estimation of a mixture of two Gaussians. Data is -generated from two Gaussians with different centers and covariance -matrices. - - - -.. image:: images/plot_gmm_pdf_001.png - :align: center - - - - -**Python source code:** :download:`plot_gmm_pdf.py ` - -.. literalinclude:: plot_gmm_pdf.py - :lines: 10- - -**Total running time of the example:** 0.93 seconds -( 0 minutes 0.93 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/mixture/plot_gmm_selection.txt b/0.15/_sources/auto_examples/mixture/plot_gmm_selection.txt deleted file mode 100644 index 51916c3cba3ab..0000000000000 --- a/0.15/_sources/auto_examples/mixture/plot_gmm_selection.txt +++ /dev/null @@ -1,36 +0,0 @@ - - -.. _example_mixture_plot_gmm_selection.py: - - -================================= -Gaussian Mixture Model Selection -================================= - -This example shows that model selection can be performed with -Gaussian Mixture Models using information-theoretic criteria (BIC). -Model selection concerns both the covariance type -and the number of components in the model. -In that case, AIC also provides the right result (not shown to save time), -but BIC is better suited if the problem is to identify the right model. -Unlike Bayesian procedures, such inferences are prior-free. - -In that case, the model with 2 components and full covariance -(which corresponds to the true generative model) is selected. - - - -.. image:: images/plot_gmm_selection_001.png - :align: center - - - - -**Python source code:** :download:`plot_gmm_selection.py ` - -.. literalinclude:: plot_gmm_selection.py - :lines: 17- - -**Total running time of the example:** 1.19 seconds -( 0 minutes 1.19 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/mixture/plot_gmm_sin.txt b/0.15/_sources/auto_examples/mixture/plot_gmm_sin.txt deleted file mode 100644 index 5e98ce7590a37..0000000000000 --- a/0.15/_sources/auto_examples/mixture/plot_gmm_sin.txt +++ /dev/null @@ -1,35 +0,0 @@ - - -.. _example_mixture_plot_gmm_sin.py: - - -================================= -Gaussian Mixture Model Sine Curve -================================= - -This example highlights the advantages of the Dirichlet Process: -complexity control and dealing with sparse data. The dataset is formed -by 100 points loosely spaced following a noisy sine curve. The fit by -the GMM class, using the expectation-maximization algorithm to fit a -mixture of 10 Gaussian components, finds too-small components and very -little structure. The fits by the Dirichlet process, however, show -that the model can either learn a global structure for the data (small -alpha) or easily interpolate to finding relevant local structure -(large alpha), never falling into the problems shown by the GMM class. - - - -.. image:: images/plot_gmm_sin_001.png - :align: center - - - - -**Python source code:** :download:`plot_gmm_sin.py ` - -.. literalinclude:: plot_gmm_sin.py - :lines: 16- - -**Total running time of the example:** 0.44 seconds -( 0 minutes 0.44 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/grid_search_digits.txt b/0.15/_sources/auto_examples/model_selection/grid_search_digits.txt deleted file mode 100644 index 4887a78fbb3c6..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/grid_search_digits.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -.. _example_model_selection_grid_search_digits.py: - - -============================================================ -Parameter estimation using grid search with cross-validation -============================================================ - -This examples shows how a classifier is optimized by cross-validation, -which is done using the :class:`sklearn.grid_search.GridSearchCV` object -on a development set that comprises only half of the available labeled data. - -The performance of the selected hyper-parameters and trained model is -then measured on a dedicated evaluation set that was not used during -the model selection step. - -More details on tools available for model selection can be found in the -sections on :ref:`cross_validation` and :ref:`grid_search`. - - - -**Python source code:** :download:`grid_search_digits.py ` - -.. literalinclude:: grid_search_digits.py - :lines: 18- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/grid_search_text_feature_extraction.txt b/0.15/_sources/auto_examples/model_selection/grid_search_text_feature_extraction.txt deleted file mode 100644 index f80e47a44aaef..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/grid_search_text_feature_extraction.txt +++ /dev/null @@ -1,52 +0,0 @@ - - -.. _example_model_selection_grid_search_text_feature_extraction.py: - - -========================================================== -Sample pipeline for text feature extraction and evaluation -========================================================== - -The dataset used in this example is the 20 newsgroups dataset which will be -automatically downloaded and then cached and reused for the document -classification example. - -You can adjust the number of categories by giving their names to the dataset -loader or setting them to None to get the 20 of them. - -Here is a sample output of a run on a quad-core machine:: - - Loading 20 newsgroups dataset for categories: - ['alt.atheism', 'talk.religion.misc'] - 1427 documents - 2 categories - - Performing grid search... - pipeline: ['vect', 'tfidf', 'clf'] - parameters: - {'clf__alpha': (1.0000000000000001e-05, 9.9999999999999995e-07), - 'clf__n_iter': (10, 50, 80), - 'clf__penalty': ('l2', 'elasticnet'), - 'tfidf__use_idf': (True, False), - 'vect__max_n': (1, 2), - 'vect__max_df': (0.5, 0.75, 1.0), - 'vect__max_features': (None, 5000, 10000, 50000)} - done in 1737.030s - - Best score: 0.940 - Best parameters set: - clf__alpha: 9.9999999999999995e-07 - clf__n_iter: 50 - clf__penalty: 'elasticnet' - tfidf__use_idf: True - vect__max_n: 2 - vect__max_df: 0.75 - vect__max_features: 50000 - - - -**Python source code:** :download:`grid_search_text_feature_extraction.py ` - -.. literalinclude:: grid_search_text_feature_extraction.py - :lines: 43- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/plot_confusion_matrix.txt b/0.15/_sources/auto_examples/model_selection/plot_confusion_matrix.txt deleted file mode 100644 index bb48614562f71..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/plot_confusion_matrix.txt +++ /dev/null @@ -1,66 +0,0 @@ - - -.. _example_model_selection_plot_confusion_matrix.py: - - -================ -Confusion matrix -================ - -Example of confusion matrix usage to evaluate the quality -of the output of a classifier on the iris data set. The -diagonal elements represent the number of points for which -the predicted label is equal to the true label, while -off-diagonal elements are those that are mislabeled by the -classifier. The higher the diagonal values of the confusion -matrix the better, indicating many correct predictions. - -The figures show the confusion matrix with and without -normalization by class support size (number of elements -in each class). This kind of normalization can be -interesting in case of class imbalance to have a more -visual interpretation of which class is being misclassified. - -Here the results are not as good as they could be as our -choice for the regularization parameter C was not the best. -In real life applications this parameter is usually chosen -using :ref:`grid_search`. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_confusion_matrix_001.png - :scale: 47 - - * - - .. image:: images/plot_confusion_matrix_002.png - :scale: 47 - - -**Script output**:: - - Confusion matrix, without normalization - [[13 0 0] - [ 0 10 6] - [ 0 0 9]] - Normalized confusion matrix - [[ 1. 0. 0. ] - [ 0. 0.62 0.38] - [ 0. 0. 1. ]] - - - -**Python source code:** :download:`plot_confusion_matrix.py ` - -.. literalinclude:: plot_confusion_matrix.py - :lines: 26- - -**Total running time of the example:** 0.28 seconds -( 0 minutes 0.28 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/plot_learning_curve.txt b/0.15/_sources/auto_examples/model_selection/plot_learning_curve.txt deleted file mode 100644 index d417ae33e18f9..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/plot_learning_curve.txt +++ /dev/null @@ -1,45 +0,0 @@ - - -.. _example_model_selection_plot_learning_curve.py: - - -======================== -Plotting Learning Curves -======================== - -On the left side the learning curve of a naive Bayes classifier is shown for -the digits dataset. Note that the training score and the cross-validation score -are both not very good at the end. However, the shape of the curve can be found -in more complex datasets very often: the training score is very high at the -beginning and decreases and the cross-validation score is very low at the -beginning and increases. On the right side we see the learning curve of an SVM -with RBF kernel. We can see clearly that the training score is still around -the maximum and the validation score could be increased with more training -samples. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_learning_curve_001.png - :scale: 47 - - * - - .. image:: images/plot_learning_curve_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_learning_curve.py ` - -.. literalinclude:: plot_learning_curve.py - :lines: 16- - -**Total running time of the example:** 12.69 seconds -( 0 minutes 12.69 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/plot_precision_recall.txt b/0.15/_sources/auto_examples/model_selection/plot_precision_recall.txt deleted file mode 100644 index d6e78def2c902..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/plot_precision_recall.txt +++ /dev/null @@ -1,93 +0,0 @@ - - -.. _example_model_selection_plot_precision_recall.py: - - -================ -Precision-Recall -================ - -Example of Precision-Recall metric to evaluate classifier output quality. - -In information retrieval, precision is a measure of result relevancy, while -recall is a measure of how many truly relevant results are returned. A high -area under the curve represents both high recall and high precision, where high -precision relates to a low false positive rate, and high recall relates to a -low false negative rate. High scores for both show that the classifier is -returning accurate results (high precision), as well as returning a majority of -all positive results (high recall). - -A system with high recall but low precision returns many results, but most of -its predicted labels are incorrect when compared to the training labels. A -system with high precision but low recall is just the opposite, returning very -few results, but most of its predicted labels are correct when compared to the -training labels. An ideal system with high precision and high recall will -return many results, with all results labeled correctly. - -Precision (:math:`P`) is defined as the number of true positives (:math:`T_p`) -over the number of true positives plus the number of false positives -(:math:`F_p`). - -:math:`P = \frac{T_p}{T_p+F_p}` - -Recall (:math:`R`) is defined as the number of true positives (:math:`T_p`) -over the number of true positives plus the number of false negatives -(:math:`F_n`). - -:math:`R = \frac{T_p}{T_p + F_n}` - -These quantities are also related to the (:math:`F_1`) score, which is defined -as the harmonic mean of precision and recall. - -:math:`F1 = 2\frac{P \times R}{P+R}` - -It is important to note that the precision may not decrease with recall. The -definition of precision (:math:`\frac{T_p}{T_p + F_p}`) shows that lowering -the threshold of a classifier may increase the denominator, by increasing the -number of results returned. If the threshold was previously set too high, the -new results may all be true positives, which will increase precision. If the -previous threshold was about right or too low, further lowering the threshold -will introduce false positives, decreasing precision. - -Recall is defined as :math:`\frac{T_p}{T_p+F_n}`, where :math:`T_p+F_n` does -not depend on the classifier threshold. This means that lowering the classifier -threshold may increase recall, by increasing the number of true positive -results. It is also possible that lowering the threshold may leave recall -unchanged, while the precision fluctuates. - -The relationship between recall and precision can be observed in the -stairstep area of the plot - at the edges of these steps a small change -in the threshold considerably reduces precision, with only a minor gain in -recall. See the corner at recall = .59, precision = .8 for an example of this -phenomenon. - -Precision-recall curves are typically used in binary classification to study -the output of a classifier. In order to extend Precision-recall curve and -average precision to multi-class or multi-label classification, it is necessary -to binarize the output. One curve can be drawn per label, but one can also draw -a precision-recall curve by considering each element of the label indicator -matrix as a binary prediction (micro-averaging). - -.. note:: - - See also :func:`sklearn.metrics.average_precision_score`, - :func:`sklearn.metrics.recall_score`, - :func:`sklearn.metrics.precision_score`, - :func:`sklearn.metrics.f1_score` - - - -.. image:: images/plot_precision_recall_001.png - :align: center - - - - -**Python source code:** :download:`plot_precision_recall.py ` - -.. literalinclude:: plot_precision_recall.py - :lines: 74- - -**Total running time of the example:** 0.29 seconds -( 0 minutes 0.29 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/plot_roc.txt b/0.15/_sources/auto_examples/model_selection/plot_roc.txt deleted file mode 100644 index cf50a53a61091..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/plot_roc.txt +++ /dev/null @@ -1,60 +0,0 @@ - - -.. _example_model_selection_plot_roc.py: - - -======================================= -Receiver Operating Characteristic (ROC) -======================================= - -Example of Receiver Operating Characteristic (ROC) metric to evaluate -classifier output quality. - -ROC curves typically feature true positive rate on the Y axis, and false -positive rate on the X axis. This means that the top left corner of the plot is -the "ideal" point - a false positive rate of zero, and a true positive rate of -one. This is not very realistic, but it does mean that a larger area under the -curve (AUC) is usually better. - -The "steepness" of ROC curves is also important, since it is ideal to maximize -the true positive rate while minimizing the false positive rate. - -ROC curves are typically used in binary classification to study the output of -a classifier. In order to extend ROC curve and ROC area to multi-class -or multi-label classification, it is necessary to binarize the output. One ROC -curve can be drawn per label, but one can also draw a ROC curve by considering -each element of the label indicator matrix as a binary prediction -(micro-averaging). - -.. note:: - - See also :func:`sklearn.metrics.roc_auc_score`, - :ref:`example_model_selection_plot_roc_crossval.py`. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_roc_001.png - :scale: 47 - - * - - .. image:: images/plot_roc_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_roc.py ` - -.. literalinclude:: plot_roc.py - :lines: 31- - -**Total running time of the example:** 0.27 seconds -( 0 minutes 0.27 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/plot_roc_crossval.txt b/0.15/_sources/auto_examples/model_selection/plot_roc_crossval.txt deleted file mode 100644 index 78048b8ad6203..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/plot_roc_crossval.txt +++ /dev/null @@ -1,51 +0,0 @@ - - -.. _example_model_selection_plot_roc_crossval.py: - - -============================================================= -Receiver Operating Characteristic (ROC) with cross validation -============================================================= - -Example of Receiver Operating Characteristic (ROC) metric to evaluate -classifier output quality using cross-validation. - -ROC curves typically feature true positive rate on the Y axis, and false -positive rate on the X axis. This means that the top left corner of the plot is -the "ideal" point - a false positive rate of zero, and a true positive rate of -one. This is not very realistic, but it does mean that a larger area under the -curve (AUC) is usually better. - -The "steepness" of ROC curves is also important, since it is ideal to maximize -the true positive rate while minimizing the false positive rate. - -This example shows the ROC response of different datasets, created from K-fold -cross-validation. Taking all of these curves, it is possible to calculate the -mean area under curve, and see the variance of the curve when the -training set is split into different subsets. This roughly shows how the -classifier output is affected by changes in the training data, and how -different the splits generated by K-fold cross-validation are from one another. - -.. note:: - - See also :func:`sklearn.metrics.auc_score`, - :func:`sklearn.cross_validation.cross_val_score`, - :ref:`example_model_selection_plot_roc.py`, - - - - -.. image:: images/plot_roc_crossval_001.png - :align: center - - - - -**Python source code:** :download:`plot_roc_crossval.py ` - -.. literalinclude:: plot_roc_crossval.py - :lines: 32- - -**Total running time of the example:** 0.37 seconds -( 0 minutes 0.37 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/plot_train_error_vs_test_error.txt b/0.15/_sources/auto_examples/model_selection/plot_train_error_vs_test_error.txt deleted file mode 100644 index d2ce83316c598..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/plot_train_error_vs_test_error.txt +++ /dev/null @@ -1,37 +0,0 @@ - - -.. _example_model_selection_plot_train_error_vs_test_error.py: - - -========================= -Train error vs Test error -========================= - -Illustration of how the performance of an estimator on unseen data (test data) -is not the same as the performance on training data. As the regularization -increases the performance on train decreases while the performance on test -is optimal within a range of values of the regularization parameter. -The example with an Elastic-Net regression model and the performance is -measured using the explained variance a.k.a. R^2. - - - - -.. image:: images/plot_train_error_vs_test_error_001.png - :align: center - - -**Script output**:: - - Optimal regularization parameter : 0.000335292414925 - - - -**Python source code:** :download:`plot_train_error_vs_test_error.py ` - -.. literalinclude:: plot_train_error_vs_test_error.py - :lines: 14- - -**Total running time of the example:** 2.48 seconds -( 0 minutes 2.48 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/plot_underfitting_overfitting.txt b/0.15/_sources/auto_examples/model_selection/plot_underfitting_overfitting.txt deleted file mode 100644 index 7f48a7540511f..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/plot_underfitting_overfitting.txt +++ /dev/null @@ -1,41 +0,0 @@ - - -.. _example_model_selection_plot_underfitting_overfitting.py: - - -============================ -Underfitting vs. Overfitting -============================ - -This example demonstrates the problems of underfitting and overfitting and -how we can use linear regression with polynomial features to approximate -nonlinear functions. The plot shows the function that we want to approximate, -which is a part of the cosine function. In addition, the samples from the -real function and the approximations of different models are displayed. The -models have polynomial features of different degrees. We can see that a -linear function (polynomial with degree 1) is not sufficient to fit the -training samples. This is called **underfitting**. A polynomial of degree 4 -approximates the true function almost perfectly. However, for higher degrees -the model will **overfit** the training data, i.e. it learns the noise of the -training data. -We evaluate quantitatively **overfitting** / **underfitting** by using -cross-validation. We calculate the mean squared error (MSE) on the validation -set, the higher, the less likely the model generalizes correctly from the -training data. - - - -.. image:: images/plot_underfitting_overfitting_001.png - :align: center - - - - -**Python source code:** :download:`plot_underfitting_overfitting.py ` - -.. literalinclude:: plot_underfitting_overfitting.py - :lines: 22- - -**Total running time of the example:** 0.27 seconds -( 0 minutes 0.27 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/plot_validation_curve.txt b/0.15/_sources/auto_examples/model_selection/plot_validation_curve.txt deleted file mode 100644 index f0337ce2f1559..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/plot_validation_curve.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_model_selection_plot_validation_curve.py: - - -========================== -Plotting Validation Curves -========================== - -In this plot you can see the training scores and validation scores of an SVM -for different values of the kernel parameter gamma. For very low values of -gamma, you can see that both the training score and the validation score are -low. This is called underfitting. Medium values of gamma will result in high -values for both scores, i.e. the classifier is performing fairly well. If gamma -is too high, the classifier will overfit, which means that the training score -is good but the validation score is poor. - - - -.. image:: images/plot_validation_curve_001.png - :align: center - - - - -**Python source code:** :download:`plot_validation_curve.py ` - -.. literalinclude:: plot_validation_curve.py - :lines: 14- - -**Total running time of the example:** 41.90 seconds -( 0 minutes 41.90 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/model_selection/randomized_search.txt b/0.15/_sources/auto_examples/model_selection/randomized_search.txt deleted file mode 100644 index 7a04df4fa5dce..0000000000000 --- a/0.15/_sources/auto_examples/model_selection/randomized_search.txt +++ /dev/null @@ -1,30 +0,0 @@ - - -.. _example_model_selection_randomized_search.py: - - -========================================================================= -Comparing randomized search and grid search for hyperparameter estimation -========================================================================= - -Compare randomized search and grid search for optimizing hyperparameters of a -random forest. -All parameters that influence the learning are searched simultaneously -(except for the number of estimators, which poses a time / quality tradeoff). - -The randomized search and the grid search explore exactly the same space of -parameters. The result in parameter settings is quite similar, while the run -time for randomized search is drastically lower. - -The performance is slightly worse for the randomized search, though this -is most likely a noise effect and would not carry over to a held-out test set. - -Note that in practice, one would not search over this many different parameters -simultaneously using grid search, but pick only the ones deemed most important. - - -**Python source code:** :download:`randomized_search.py ` - -.. literalinclude:: randomized_search.py - :lines: 21- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.txt b/0.15/_sources/auto_examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.txt deleted file mode 100644 index e3477197c0867..0000000000000 --- a/0.15/_sources/auto_examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.txt +++ /dev/null @@ -1,52 +0,0 @@ - - -.. _example_neighbors_plot_approximate_nearest_neighbors_hyperparameters.py: - - -================================================= -Hyper-parameters of Approximate Nearest Neighbors -================================================= - -This example demonstrates the behaviour of the -accuracy of the nearest neighbor queries of Locality Sensitive Hashing -Forest as the number of candidates and the number of estimators (trees) -vary. - -In the first plot, accuracy is measured with the number of candidates. Here, -the term "number of candidates" refers to maximum bound for the number of -distinct points retrieved from each tree to calculate the distances. Nearest -neighbors are selected from this pool of candidates. Number of estimators is -maintained at three fixed levels (1, 5, 10). - -In the second plot, the number of candidates is fixed at 50. Number of trees -is varied and the accuracy is plotted against those values. To measure the -accuracy, the true nearest neighbors are required, therefore -:class:`sklearn.neighbors.NearestNeighbors` is used to compute the exact -neighbors. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_approximate_nearest_neighbors_hyperparameters_001.png - :scale: 47 - - * - - .. image:: images/plot_approximate_nearest_neighbors_hyperparameters_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_approximate_nearest_neighbors_hyperparameters.py ` - -.. literalinclude:: plot_approximate_nearest_neighbors_hyperparameters.py - :lines: 23- - -**Total running time of the example:** 57.37 seconds -( 0 minutes 57.37 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/neighbors/plot_approximate_nearest_neighbors_scalability.txt b/0.15/_sources/auto_examples/neighbors/plot_approximate_nearest_neighbors_scalability.txt deleted file mode 100644 index 21b9a481ffe3b..0000000000000 --- a/0.15/_sources/auto_examples/neighbors/plot_approximate_nearest_neighbors_scalability.txt +++ /dev/null @@ -1,73 +0,0 @@ - - -.. _example_neighbors_plot_approximate_nearest_neighbors_scalability.py: - - -============================================ -Scalability of Approximate Nearest Neighbors -============================================ - -This example studies the scalability profile of approximate 10-neighbors -queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200`` -when varying the number of samples in the dataset. - -The first plot demonstrates the relationship between query time and index size -of LSHForest. Query time is compared with the brute force method in exact -nearest neighbor search for the same index sizes. The brute force queries have a -very predictable linear scalability with the index (full scan). LSHForest index -have sub-linear scalability profile but can be slower for small datasets. - -The second plot shows the speedup when using approximate queries vs brute force -exact queries. The speedup tends to increase with the dataset size but should -reach a plateau typically when doing queries on datasets with millions of -samples and a few hundreds of dimensions. Higher dimensional datasets tends to -benefit more from LSHForest indexing. - -The break even point (speedup = 1) depends on the dimensionality and structure -of the indexed data and the parameters of the LSHForest index. - -The precision of approximate queries should decrease slowly with the dataset -size. The speed of the decrease depends mostly on the LSHForest parameters and -the dimensionality of the data. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_approximate_nearest_neighbors_scalability_001.png - :scale: 47 - - * - - .. image:: images/plot_approximate_nearest_neighbors_scalability_002.png - :scale: 47 - - * - - .. image:: images/plot_approximate_nearest_neighbors_scalability_003.png - :scale: 47 - - -**Script output**:: - - Index size: 1000, exact: 0.001s, LSHF: 0.011s, speedup: 0.1, accuracy: 1.00 +/-0.00 - Index size: 2511, exact: 0.003s, LSHF: 0.013s, speedup: 0.2, accuracy: 1.00 +/-0.00 - Index size: 6309, exact: 0.006s, LSHF: 0.012s, speedup: 0.5, accuracy: 1.00 +/-0.00 - Index size: 15848, exact: 0.014s, LSHF: 0.014s, speedup: 1.0, accuracy: 1.00 +/-0.00 - Index size: 39810, exact: 0.037s, LSHF: 0.018s, speedup: 2.1, accuracy: 1.00 +/-0.00 - Index size: 100000, exact: 0.163s, LSHF: 0.025s, speedup: 6.5, accuracy: 0.94 +/-0.08 - - - -**Python source code:** :download:`plot_approximate_nearest_neighbors_scalability.py ` - -.. literalinclude:: plot_approximate_nearest_neighbors_scalability.py - :lines: 30- - -**Total running time of the example:** 20.52 seconds -( 0 minutes 20.52 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/neighbors/plot_classification.txt b/0.15/_sources/auto_examples/neighbors/plot_classification.txt deleted file mode 100644 index 7471e611cd512..0000000000000 --- a/0.15/_sources/auto_examples/neighbors/plot_classification.txt +++ /dev/null @@ -1,38 +0,0 @@ - - -.. _example_neighbors_plot_classification.py: - - -================================ -Nearest Neighbors Classification -================================ - -Sample usage of Nearest Neighbors classification. -It will plot the decision boundaries for each class. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_classification_001.png - :scale: 47 - - * - - .. image:: images/plot_classification_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_classification.py ` - -.. literalinclude:: plot_classification.py - :lines: 9- - -**Total running time of the example:** 0.57 seconds -( 0 minutes 0.57 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/neighbors/plot_digits_kde_sampling.txt b/0.15/_sources/auto_examples/neighbors/plot_digits_kde_sampling.txt deleted file mode 100644 index 3899736ee2431..0000000000000 --- a/0.15/_sources/auto_examples/neighbors/plot_digits_kde_sampling.txt +++ /dev/null @@ -1,35 +0,0 @@ - - -.. _example_neighbors_plot_digits_kde_sampling.py: - - -========================= -Kernel Density Estimation -========================= - -This example shows how kernel density estimation (KDE), a powerful -non-parametric density estimation technique, can be used to learn -a generative model for a dataset. With this generative model in place, -new samples can be drawn. These new samples reflect the underlying model -of the data. - - - -.. image:: images/plot_digits_kde_sampling_001.png - :align: center - - -**Script output**:: - - best bandwidth: 3.79269019073 - - - -**Python source code:** :download:`plot_digits_kde_sampling.py ` - -.. literalinclude:: plot_digits_kde_sampling.py - :lines: 12- - -**Total running time of the example:** 8.13 seconds -( 0 minutes 8.13 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/neighbors/plot_kde_1d.txt b/0.15/_sources/auto_examples/neighbors/plot_kde_1d.txt deleted file mode 100644 index 87555c990b3c5..0000000000000 --- a/0.15/_sources/auto_examples/neighbors/plot_kde_1d.txt +++ /dev/null @@ -1,63 +0,0 @@ - - -.. _example_neighbors_plot_kde_1d.py: - - -=================================== -Simple 1D Kernel Density Estimation -=================================== -This example uses the :class:`sklearn.neighbors.KernelDensity` class to -demonstrate the principles of Kernel Density Estimation in one dimension. - -The first plot shows one of the problems with using histograms to visualize -the density of points in 1D. Intuitively, a histogram can be thought of as a -scheme in which a unit "block" is stacked above each point on a regular grid. -As the top two panels show, however, the choice of gridding for these blocks -can lead to wildly divergent ideas about the underlying shape of the density -distribution. If we instead center each block on the point it represents, we -get the estimate shown in the bottom left panel. This is a kernel density -estimation with a "top hat" kernel. This idea can be generalized to other -kernel shapes: the bottom-right panel of the first figure shows a Gaussian -kernel density estimate over the same distribution. - -Scikit-learn implements efficient kernel density estimation using either -a Ball Tree or KD Tree structure, through the -:class:`sklearn.neighbors.KernelDensity` estimator. The available kernels -are shown in the second figure of this example. - -The third figure compares kernel density estimates for a distribution of 100 -samples in 1 dimension. Though this example uses 1D distributions, kernel -density estimation is easily and efficiently extensible to higher dimensions -as well. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_kde_1d_001.png - :scale: 47 - - * - - .. image:: images/plot_kde_1d_002.png - :scale: 47 - - * - - .. image:: images/plot_kde_1d_003.png - :scale: 47 - - - - -**Python source code:** :download:`plot_kde_1d.py ` - -.. literalinclude:: plot_kde_1d.py - :lines: 29- - -**Total running time of the example:** 2.64 seconds -( 0 minutes 2.64 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/neighbors/plot_nearest_centroid.txt b/0.15/_sources/auto_examples/neighbors/plot_nearest_centroid.txt deleted file mode 100644 index cbb769be1f7e3..0000000000000 --- a/0.15/_sources/auto_examples/neighbors/plot_nearest_centroid.txt +++ /dev/null @@ -1,43 +0,0 @@ - - -.. _example_neighbors_plot_nearest_centroid.py: - - -=============================== -Nearest Centroid Classification -=============================== - -Sample usage of Nearest Centroid classification. -It will plot the decision boundaries for each class. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_nearest_centroid_001.png - :scale: 47 - - * - - .. image:: images/plot_nearest_centroid_002.png - :scale: 47 - - -**Script output**:: - - None 0.813333333333 - 0.1 0.813333333333 - - - -**Python source code:** :download:`plot_nearest_centroid.py ` - -.. literalinclude:: plot_nearest_centroid.py - :lines: 9- - -**Total running time of the example:** 0.16 seconds -( 0 minutes 0.16 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/neighbors/plot_regression.txt b/0.15/_sources/auto_examples/neighbors/plot_regression.txt deleted file mode 100644 index 4a082f94bb468..0000000000000 --- a/0.15/_sources/auto_examples/neighbors/plot_regression.txt +++ /dev/null @@ -1,30 +0,0 @@ - - -.. _example_neighbors_plot_regression.py: - - -============================ -Nearest Neighbors regression -============================ - -Demonstrate the resolution of a regression problem -using a k-Nearest Neighbor and the interpolation of the -target using both barycenter and constant weights. - - - - -.. image:: images/plot_regression_001.png - :align: center - - - - -**Python source code:** :download:`plot_regression.py ` - -.. literalinclude:: plot_regression.py - :lines: 11- - -**Total running time of the example:** 0.16 seconds -( 0 minutes 0.16 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/neighbors/plot_species_kde.txt b/0.15/_sources/auto_examples/neighbors/plot_species_kde.txt deleted file mode 100644 index d2ac773d58310..0000000000000 --- a/0.15/_sources/auto_examples/neighbors/plot_species_kde.txt +++ /dev/null @@ -1,64 +0,0 @@ - - -.. _example_neighbors_plot_species_kde.py: - - -================================================ -Kernel Density Estimate of Species Distributions -================================================ -This shows an example of a neighbors-based query (in particular a kernel -density estimate) on geospatial data, using a Ball Tree built upon the -Haversine distance metric -- i.e. distances over points in latitude/longitude. -The dataset is provided by Phillips et. al. (2006). -If available, the example uses -`basemap `_ -to plot the coast lines and national boundaries of South America. - -This example does not perform any learning over the data -(see :ref:`example_applications_plot_species_distribution_modeling.py` for -an example of classification based on the attributes in this dataset). It -simply shows the kernel density estimate of observed data points in -geospatial coordinates. - -The two species are: - - - `"Bradypus variegatus" - `_ , - the Brown-throated Sloth. - - - `"Microryzomys minutus" - `_ , - also known as the Forest Small Rice Rat, a rodent that lives in Peru, - Colombia, Ecuador, Peru, and Venezuela. - -References ----------- - - * `"Maximum entropy modeling of species geographic distributions" - `_ - S. J. Phillips, R. P. Anderson, R. E. Schapire - Ecological Modelling, - 190:231-259, 2006. - - - -.. image:: images/plot_species_kde_001.png - :align: center - - -**Script output**:: - - - computing KDE in spherical coordinates - - plot coastlines from coverage - - computing KDE in spherical coordinates - - plot coastlines from coverage - - - -**Python source code:** :download:`plot_species_kde.py ` - -.. literalinclude:: plot_species_kde.py - :lines: 38- - -**Total running time of the example:** 7.96 seconds -( 0 minutes 7.96 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/neural_networks/plot_rbm_logistic_classification.txt b/0.15/_sources/auto_examples/neural_networks/plot_rbm_logistic_classification.txt deleted file mode 100644 index 58c880d873255..0000000000000 --- a/0.15/_sources/auto_examples/neural_networks/plot_rbm_logistic_classification.txt +++ /dev/null @@ -1,102 +0,0 @@ - - -.. _example_neural_networks_plot_rbm_logistic_classification.py: - - -============================================================== -Restricted Boltzmann Machine features for digit classification -============================================================== - -For greyscale image data where pixel values can be interpreted as degrees of -blackness on a white background, like handwritten digit recognition, the -Bernoulli Restricted Boltzmann machine model (:class:`BernoulliRBM -`) can perform effective non-linear -feature extraction. - -In order to learn good latent representations from a small dataset, we -artificially generate more labeled data by perturbing the training data with -linear shifts of 1 pixel in each direction. - -This example shows how to build a classification pipeline with a BernoulliRBM -feature extractor and a :class:`LogisticRegression -` classifier. The hyperparameters -of the entire model (learning rate, hidden layer size, regularization) -were optimized by grid search, but the search is not reproduced here because -of runtime constraints. - -Logistic regression on raw pixel values is presented for comparison. The -example shows that the features extracted by the BernoulliRBM help improve the -classification accuracy. - - - -.. image:: images/plot_rbm_logistic_classification_001.png - :align: center - - -**Script output**:: - - [BernoulliRBM] Iteration 1, pseudo-likelihood = -25.39, time = 0.59s - [BernoulliRBM] Iteration 2, pseudo-likelihood = -23.77, time = 0.81s - [BernoulliRBM] Iteration 3, pseudo-likelihood = -22.94, time = 0.84s - [BernoulliRBM] Iteration 4, pseudo-likelihood = -21.91, time = 0.84s - [BernoulliRBM] Iteration 5, pseudo-likelihood = -21.69, time = 0.83s - [BernoulliRBM] Iteration 6, pseudo-likelihood = -21.06, time = 0.85s - [BernoulliRBM] Iteration 7, pseudo-likelihood = -20.89, time = 0.82s - [BernoulliRBM] Iteration 8, pseudo-likelihood = -20.64, time = 0.81s - [BernoulliRBM] Iteration 9, pseudo-likelihood = -20.36, time = 0.83s - [BernoulliRBM] Iteration 10, pseudo-likelihood = -20.09, time = 0.84s - [BernoulliRBM] Iteration 11, pseudo-likelihood = -20.08, time = 0.85s - [BernoulliRBM] Iteration 12, pseudo-likelihood = -19.82, time = 0.82s - [BernoulliRBM] Iteration 13, pseudo-likelihood = -19.64, time = 0.81s - [BernoulliRBM] Iteration 14, pseudo-likelihood = -19.61, time = 0.82s - [BernoulliRBM] Iteration 15, pseudo-likelihood = -19.57, time = 0.81s - [BernoulliRBM] Iteration 16, pseudo-likelihood = -19.41, time = 0.89s - [BernoulliRBM] Iteration 17, pseudo-likelihood = -19.30, time = 0.82s - [BernoulliRBM] Iteration 18, pseudo-likelihood = -19.25, time = 0.82s - [BernoulliRBM] Iteration 19, pseudo-likelihood = -19.27, time = 0.85s - [BernoulliRBM] Iteration 20, pseudo-likelihood = -19.01, time = 0.81s - - Logistic regression using RBM features: - precision recall f1-score support - - 0 0.99 0.99 0.99 174 - 1 0.92 0.95 0.93 184 - 2 0.95 0.98 0.97 166 - 3 0.97 0.91 0.94 194 - 4 0.97 0.95 0.96 186 - 5 0.93 0.93 0.93 181 - 6 0.98 0.97 0.97 207 - 7 0.95 1.00 0.97 154 - 8 0.90 0.88 0.89 182 - 9 0.91 0.93 0.92 169 - - avg / total 0.95 0.95 0.95 1797 - - - Logistic regression using raw pixel features: - precision recall f1-score support - - 0 0.85 0.94 0.89 174 - 1 0.57 0.55 0.56 184 - 2 0.72 0.85 0.78 166 - 3 0.76 0.74 0.75 194 - 4 0.85 0.82 0.84 186 - 5 0.74 0.75 0.75 181 - 6 0.93 0.88 0.91 207 - 7 0.86 0.90 0.88 154 - 8 0.68 0.55 0.61 182 - 9 0.71 0.74 0.72 169 - - avg / total 0.77 0.77 0.77 1797 - - - -**Python source code:** :download:`plot_rbm_logistic_classification.py ` - -.. literalinclude:: plot_rbm_logistic_classification.py - :lines: 27- - -**Total running time of the example:** 56.74 seconds -( 0 minutes 56.74 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_classification_probability.txt b/0.15/_sources/auto_examples/plot_classification_probability.txt deleted file mode 100644 index 0a305cdb9f898..0000000000000 --- a/0.15/_sources/auto_examples/plot_classification_probability.txt +++ /dev/null @@ -1,38 +0,0 @@ - - -.. _example_plot_classification_probability.py: - - -=============================== -Plot classification probability -=============================== - -Plot the classification probability for different classifiers. We use a 3 -class dataset, and we classify it with a Support Vector classifier, as -well as L1 and L2 penalized logistic regression. - -The logistic regression is not a multiclass classifier out of the box. As -a result it can identify only the first class. - - - -.. image:: images/plot_classification_probability_001.png - :align: center - - -**Script output**:: - - classif_rate for Linear SVC : 82.000000 - classif_rate for L1 logistic : 79.333333 - classif_rate for L2 logistic : 76.666667 - - - -**Python source code:** :download:`plot_classification_probability.py ` - -.. literalinclude:: plot_classification_probability.py - :lines: 13- - -**Total running time of the example:** 0.51 seconds -( 0 minutes 0.51 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_classifier_comparison.txt b/0.15/_sources/auto_examples/plot_classifier_comparison.txt deleted file mode 100644 index 3318a2c87bed7..0000000000000 --- a/0.15/_sources/auto_examples/plot_classifier_comparison.txt +++ /dev/null @@ -1,39 +0,0 @@ - - -.. _example_plot_classifier_comparison.py: - - -===================== -Classifier comparison -===================== - -A comparison of a several classifiers in scikit-learn on synthetic datasets. -The point of this example is to illustrate the nature of decision boundaries -of different classifiers. -This should be taken with a grain of salt, as the intuition conveyed by -these examples does not necessarily carry over to real datasets. - -Particularly in high-dimensional spaces, data can more easily be separated -linearly and the simplicity of classifiers such as naive Bayes and linear SVMs -might lead to better generalization than is achieved by other classifiers. - -The plots show training points in solid colors and testing points -semi-transparent. The lower right shows the classification accuracy on the test -set. - - - -.. image:: images/plot_classifier_comparison_001.png - :align: center - - - - -**Python source code:** :download:`plot_classifier_comparison.py ` - -.. literalinclude:: plot_classifier_comparison.py - :lines: 23- - -**Total running time of the example:** 4.36 seconds -( 0 minutes 4.36 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_confusion_matrix.txt b/0.15/_sources/auto_examples/plot_confusion_matrix.txt deleted file mode 100644 index eab159da9dcc6..0000000000000 --- a/0.15/_sources/auto_examples/plot_confusion_matrix.txt +++ /dev/null @@ -1,39 +0,0 @@ - - -.. _example_plot_confusion_matrix.py: - - -================ -Confusion matrix -================ - -Example of confusion matrix usage to evaluate the quality -of the output of a classifier on the iris data set. The -diagonal elements represent the number of points for which -the predicted label is equal to the true label, while -off-diagonal elements are those that are mislabeled by the -classifier. The higher the diagonal values of the confusion -matrix the better, indicating many correct predictions. - - - -.. image:: images/plot_confusion_matrix_001.png - :align: center - - -**Script output**:: - - [[13 0 0] - [ 0 15 1] - [ 0 0 9]] - - - -**Python source code:** :download:`plot_confusion_matrix.py ` - -.. literalinclude:: plot_confusion_matrix.py - :lines: 14- - -**Total running time of the example:** 0.16 seconds -( 0 minutes 0.16 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_cv_predict.txt b/0.15/_sources/auto_examples/plot_cv_predict.txt deleted file mode 100644 index 2d696af4ba680..0000000000000 --- a/0.15/_sources/auto_examples/plot_cv_predict.txt +++ /dev/null @@ -1,29 +0,0 @@ - - -.. _example_plot_cv_predict.py: - - -==================================== -Plotting Cross-Validated Predictions -==================================== - -This example shows how to use `cross_val_predict` to visualize prediction -errors. - - - - -.. image:: images/plot_cv_predict_001.png - :align: center - - - - -**Python source code:** :download:`plot_cv_predict.py ` - -.. literalinclude:: plot_cv_predict.py - :lines: 10- - -**Total running time of the example:** 6.30 seconds -( 0 minutes 6.30 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_digits_classification.txt b/0.15/_sources/auto_examples/plot_digits_classification.txt deleted file mode 100644 index ddb5490840ab9..0000000000000 --- a/0.15/_sources/auto_examples/plot_digits_classification.txt +++ /dev/null @@ -1,65 +0,0 @@ - - -.. _example_plot_digits_classification.py: - - -================================ -Recognizing hand-written digits -================================ - -An example showing how the scikit-learn can be used to recognize images of -hand-written digits. - -This example is commented in the -:ref:`tutorial section of the user manual `. - - - - -.. image:: images/plot_digits_classification_001.png - :align: center - - -**Script output**:: - - Classification report for classifier SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, - gamma=0.001, kernel='rbf', max_iter=-1, probability=False, - random_state=None, shrinking=True, tol=0.001, verbose=False): - precision recall f1-score support - - 0 1.00 0.99 0.99 88 - 1 0.99 0.97 0.98 91 - 2 0.99 0.99 0.99 86 - 3 0.98 0.87 0.92 91 - 4 0.99 0.96 0.97 92 - 5 0.95 0.97 0.96 91 - 6 0.99 0.99 0.99 91 - 7 0.96 0.99 0.97 89 - 8 0.94 1.00 0.97 88 - 9 0.93 0.98 0.95 92 - - avg / total 0.97 0.97 0.97 899 - - - Confusion matrix: - [[87 0 0 0 1 0 0 0 0 0] - [ 0 88 1 0 0 0 0 0 1 1] - [ 0 0 85 1 0 0 0 0 0 0] - [ 0 0 0 79 0 3 0 4 5 0] - [ 0 0 0 0 88 0 0 0 0 4] - [ 0 0 0 0 0 88 1 0 0 2] - [ 0 1 0 0 0 0 90 0 0 0] - [ 0 0 0 0 0 1 0 88 0 0] - [ 0 0 0 0 0 0 0 0 88 0] - [ 0 0 0 1 0 1 0 0 0 90]] - - - -**Python source code:** :download:`plot_digits_classification.py ` - -.. literalinclude:: plot_digits_classification.py - :lines: 13- - -**Total running time of the example:** 0.54 seconds -( 0 minutes 0.54 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_digits_pipe.txt b/0.15/_sources/auto_examples/plot_digits_pipe.txt deleted file mode 100644 index dddda84b7803c..0000000000000 --- a/0.15/_sources/auto_examples/plot_digits_pipe.txt +++ /dev/null @@ -1,31 +0,0 @@ - - -.. _example_plot_digits_pipe.py: - - -========================================================= -Pipelining: chaining a PCA and a logistic regression -========================================================= - -The PCA does an unsupervised dimensionality reduction, while the logistic -regression does the prediction. - -We use a GridSearchCV to set the dimensionality of the PCA - - - - -.. image:: images/plot_digits_pipe_001.png - :align: center - - - - -**Python source code:** :download:`plot_digits_pipe.py ` - -.. literalinclude:: plot_digits_pipe.py - :lines: 15- - -**Total running time of the example:** 8.43 seconds -( 0 minutes 8.43 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_feature_selection.txt b/0.15/_sources/auto_examples/plot_feature_selection.txt deleted file mode 100644 index 8bdce5a17c755..0000000000000 --- a/0.15/_sources/auto_examples/plot_feature_selection.txt +++ /dev/null @@ -1,41 +0,0 @@ - - -.. _example_plot_feature_selection.py: - - -=============================== -Univariate Feature Selection -=============================== - -An example showing univariate feature selection. - -Noisy (non informative) features are added to the iris data and -univariate feature selection is applied. For each feature, we plot the -p-values for the univariate feature selection and the corresponding -weights of an SVM. We can see that univariate feature selection -selects the informative features and that these have larger SVM weights. - -In the total set of features, only the 4 first ones are significant. We -can see that they have the highest score with univariate feature -selection. The SVM assigns a large weight to one of these features, but also -Selects many of the non-informative features. -Applying univariate feature selection before the SVM -increases the SVM weight attributed to the significant features, and will -thus improve classification. - - - -.. image:: images/plot_feature_selection_001.png - :align: center - - - - -**Python source code:** :download:`plot_feature_selection.py ` - -.. literalinclude:: plot_feature_selection.py - :lines: 22- - -**Total running time of the example:** 0.18 seconds -( 0 minutes 0.18 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_isotonic_regression.txt b/0.15/_sources/auto_examples/plot_isotonic_regression.txt deleted file mode 100644 index de01cbd60ceb8..0000000000000 --- a/0.15/_sources/auto_examples/plot_isotonic_regression.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_plot_isotonic_regression.py: - - -=================== -Isotonic Regression -=================== - -An illustration of the isotonic regression on generated data. The -isotonic regression finds a non-decreasing approximation of a function -while minimizing the mean squared error on the training data. The benefit -of such a model is that it does not assume any form for the target -function such as linearity. For comparison a linear regression is also -presented. - - - - -.. image:: images/plot_isotonic_regression_001.png - :align: center - - - - -**Python source code:** :download:`plot_isotonic_regression.py ` - -.. literalinclude:: plot_isotonic_regression.py - :lines: 14- - -**Total running time of the example:** 0.11 seconds -( 0 minutes 0.11 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_johnson_lindenstrauss_bound.txt b/0.15/_sources/auto_examples/plot_johnson_lindenstrauss_bound.txt deleted file mode 100644 index db7f558546274..0000000000000 --- a/0.15/_sources/auto_examples/plot_johnson_lindenstrauss_bound.txt +++ /dev/null @@ -1,162 +0,0 @@ - - -.. _example_plot_johnson_lindenstrauss_bound.py: - - -===================================================================== -The Johnson-Lindenstrauss bound for embedding with random projections -===================================================================== - - -The `Johnson-Lindenstrauss lemma`_ states that any high dimensional -dataset can be randomly projected into a lower dimensional Euclidean -space while controlling the distortion in the pairwise distances. - -.. _`Johnson-Lindenstrauss lemma`: http://en.wikipedia.org/wiki/Johnson%E2%80%93Lindenstrauss_lemma - - -Theoretical bounds -================== - -The distortion introduced by a random projection `p` is asserted by -the fact that `p` is defining an eps-embedding with good probability -as defined by: - - (1 - eps) ||u - v||^2 < ||p(u) - p(v)||^2 < (1 + eps) ||u - v||^2 - -Where u and v are any rows taken from a dataset of shape [n_samples, -n_features] and p is a projection by a random Gaussian N(0, 1) matrix -with shape [n_components, n_features] (or a sparse Achlioptas matrix). - -The minimum number of components to guarantees the eps-embedding is -given by: - - n_components >= 4 log(n_samples) / (eps^2 / 2 - eps^3 / 3) - - -The first plot shows that with an increasing number of samples ``n_samples``, -the minimal number of dimensions ``n_components`` increased logarithmically -in order to guarantee an ``eps``-embedding. - -The second plot shows that an increase of the admissible -distortion ``eps`` allows to reduce drastically the minimal number of -dimensions ``n_components`` for a given number of samples ``n_samples`` - - -Empirical validation -==================== - -We validate the above bounds on the the digits dataset or on the 20 newsgroups -text document (TF-IDF word frequencies) dataset: - -- for the digits dataset, some 8x8 gray level pixels data for 500 - handwritten digits pictures are randomly projected to spaces for various - larger number of dimensions ``n_components``. - -- for the 20 newsgroups dataset some 500 documents with 100k - features in total are projected using a sparse random matrix to smaller - euclidean spaces with various values for the target number of dimensions - ``n_components``. - -The default dataset is the digits dataset. To run the example on the twenty -newsgroups dataset, pass the --twenty-newsgroups command line argument to this -script. - -For each value of ``n_components``, we plot: - -- 2D distribution of sample pairs with pairwise distances in original - and projected spaces as x and y axis respectively. - -- 1D histogram of the ratio of those distances (projected / original). - -We can see that for low values of ``n_components`` the distribution is wide -with many distorted pairs and a skewed distribution (due to the hard -limit of zero ratio on the left as distances are always positives) -while for larger values of n_components the distortion is controlled -and the distances are well preserved by the random projection. - - -Remarks -======= - -According to the JL lemma, projecting 500 samples without too much distortion -will require at least several thousands dimensions, irrespective of the -number of features of the original dataset. - -Hence using random projections on the digits dataset which only has 64 features -in the input space does not make sense: it does not allow for dimensionality -reduction in this case. - -On the twenty newsgroups on the other hand the dimensionality can be decreased -from 56436 down to 10000 while reasonably preserving pairwise distances. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_johnson_lindenstrauss_bound_001.png - :scale: 47 - - * - - .. image:: images/plot_johnson_lindenstrauss_bound_002.png - :scale: 47 - - * - - .. image:: images/plot_johnson_lindenstrauss_bound_003.png - :scale: 47 - - * - - .. image:: images/plot_johnson_lindenstrauss_bound_004.png - :scale: 47 - - * - - .. image:: images/plot_johnson_lindenstrauss_bound_005.png - :scale: 47 - - * - - .. image:: images/plot_johnson_lindenstrauss_bound_006.png - :scale: 47 - - * - - .. image:: images/plot_johnson_lindenstrauss_bound_007.png - :scale: 47 - - * - - .. image:: images/plot_johnson_lindenstrauss_bound_008.png - :scale: 47 - - -**Script output**:: - - Embedding 500 samples with dim 64 using various random projections - Projected 500 samples from 64 to 300 in 0.010s - Random matrix with size: 0.029MB - Mean distances rate: 0.98 (0.08) - Projected 500 samples from 64 to 1000 in 0.025s - Random matrix with size: 0.096MB - Mean distances rate: 1.00 (0.05) - Projected 500 samples from 64 to 10000 in 0.248s - Random matrix with size: 0.961MB - Mean distances rate: 1.01 (0.01) - - - -**Python source code:** :download:`plot_johnson_lindenstrauss_bound.py ` - -.. literalinclude:: plot_johnson_lindenstrauss_bound.py - :lines: 90- - -**Total running time of the example:** 17.09 seconds -( 0 minutes 17.09 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_kernel_approximation.txt b/0.15/_sources/auto_examples/plot_kernel_approximation.txt deleted file mode 100644 index 384293705530c..0000000000000 --- a/0.15/_sources/auto_examples/plot_kernel_approximation.txt +++ /dev/null @@ -1,73 +0,0 @@ - - -.. _example_plot_kernel_approximation.py: - - -================================================== -Explicit feature map approximation for RBF kernels -================================================== - -An example illustrating the approximation of the feature map -of an RBF kernel. - -.. currentmodule:: sklearn.kernel_approximation - -It shows how to use :class:`RBFSampler` and :class:`Nystroem` to -approximate the feature map of an RBF kernel for classification with an SVM on -the digits dataset. Results using a linear SVM in the original space, a linear -SVM using the approximate mappings and using a kernelized SVM are compared. -Timings and accuracy for varying amounts of Monte Carlo samplings (in the case -of :class:`RBFSampler`, which uses random Fourier features) and different sized -subsets of the training set (for :class:`Nystroem`) for the approximate mapping -are shown. - -Please note that the dataset here is not large enough to show the benefits -of kernel approximation, as the exact SVM is still reasonably fast. - -Sampling more dimensions clearly leads to better classification results, but -comes at a greater cost. This means there is a tradeoff between runtime and -accuracy, given by the parameter n_components. Note that solving the Linear -SVM and also the approximate kernel SVM could be greatly accelerated by using -stochastic gradient descent via :class:`sklearn.linear_model.SGDClassifier`. -This is not easily possible for the case of the kernelized SVM. - -The second plot visualized the decision surfaces of the RBF kernel SVM and -the linear SVM with approximate kernel maps. -The plot shows decision surfaces of the classifiers projected onto -the first two principal components of the data. This visualization should -be taken with a grain of salt since it is just an interesting slice through -the decision surface in 64 dimensions. In particular note that -a datapoint (represented as a dot) does not necessarily be classified -into the region it is lying in, since it will not lie on the plane -that the first two principal components span. - -The usage of :class:`RBFSampler` and :class:`Nystroem` is described in detail -in :ref:`kernel_approximation`. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_kernel_approximation_001.png - :scale: 47 - - * - - .. image:: images/plot_kernel_approximation_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_kernel_approximation.py ` - -.. literalinclude:: plot_kernel_approximation.py - :lines: 44- - -**Total running time of the example:** 3.44 seconds -( 0 minutes 3.44 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_kernel_ridge_regression.txt b/0.15/_sources/auto_examples/plot_kernel_ridge_regression.txt deleted file mode 100644 index d009c6cd9d62c..0000000000000 --- a/0.15/_sources/auto_examples/plot_kernel_ridge_regression.txt +++ /dev/null @@ -1,75 +0,0 @@ - - -.. _example_plot_kernel_ridge_regression.py: - - -============================================= -Comparison of kernel ridge regression and SVR -============================================= - -Both kernel ridge regression (KRR) and SVR learn a non-linear function by -employing the kernel trick, i.e., they learn a linear function in the space -induced by the respective kernel which corresponds to a non-linear function in -the original space. They differ in the loss functions (ridge versus -epsilon-insensitive loss). In contrast to SVR, fitting a KRR can be done in -closed-form and is typically faster for medium-sized datasets. On the other -hand, the learned model is non-sparse and thus slower than SVR at -prediction-time. - -This example illustrates both methods on an artificial dataset, which -consists of a sinusoidal target function and strong noise added to every fifth -datapoint. The first figure compares the learned model of KRR and SVR when both -complexity/regularization and bandwidth of the RBF kernel are optimized using -grid-search. The learned functions are very similar; however, fitting KRR is -approx. seven times faster than fitting SVR (both with grid-search). However, -prediction of 100000 target values is more than tree times faster with SVR -since it has learned a sparse model using only approx. 1/3 of the 100 training -datapoints as support vectors. - -The next figure compares the time for fitting and prediction of KRR and SVR for -different sizes of the training set. Fitting KRR is faster than SVR for medium- -sized training sets (less than 1000 samples); however, for larger training sets -SVR scales better. With regard to prediction time, SVR is faster than -KRR for all sizes of the training set because of the learned sparse -solution. Note that the degree of sparsity and thus the prediction time depends -on the parameters epsilon and C of the SVR. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_kernel_ridge_regression_001.png - :scale: 47 - - * - - .. image:: images/plot_kernel_ridge_regression_002.png - :scale: 47 - - * - - .. image:: images/plot_kernel_ridge_regression_003.png - :scale: 47 - - -**Script output**:: - - SVR complexity and bandwidth selected and model fitted in 0.869 s - KRR complexity and bandwidth selected and model fitted in 0.154 s - Support vector ratio: 0.320 - SVR prediction for 100000 inputs in 0.113 s - KRR prediction for 100000 inputs in 0.442 s - - - -**Python source code:** :download:`plot_kernel_ridge_regression.py ` - -.. literalinclude:: plot_kernel_ridge_regression.py - :lines: 33- - -**Total running time of the example:** 72.35 seconds -( 1 minutes 12.35 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_lda_qda.txt b/0.15/_sources/auto_examples/plot_lda_qda.txt deleted file mode 100644 index ea2261d857b87..0000000000000 --- a/0.15/_sources/auto_examples/plot_lda_qda.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -.. _example_plot_lda_qda.py: - - -==================================================================== -Linear and Quadratic Discriminant Analysis with confidence ellipsoid -==================================================================== - -Plot the confidence ellipsoids of each class and decision boundary - - - -.. image:: images/plot_lda_qda_001.png - :align: center - - - - -**Python source code:** :download:`plot_lda_qda.py ` - -.. literalinclude:: plot_lda_qda.py - :lines: 8- - -**Total running time of the example:** 0.45 seconds -( 0 minutes 0.45 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_learning_curve.txt b/0.15/_sources/auto_examples/plot_learning_curve.txt deleted file mode 100644 index ca6548302725e..0000000000000 --- a/0.15/_sources/auto_examples/plot_learning_curve.txt +++ /dev/null @@ -1,45 +0,0 @@ - - -.. _example_plot_learning_curve.py: - - -======================== -Plotting Learning Curves -======================== - -On the left side the learning curve of a naive Bayes classifier is shown for -the digits dataset. Note that the training score and the cross-validation score -are both not very good at the end. However, the shape of the curve can be found -in more complex datasets very often: the training score is very high at the -beginning and decreases and the cross-validation score is very low at the -beginning and increases. On the right side we see the learning curve of an SVM -with RBF kernel. We can see clearly that the training score is still around -the maximum and the validation score could be increased with more training -samples. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_learning_curve_001.png - :scale: 47 - - * - - .. image:: images/plot_learning_curve_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_learning_curve.py ` - -.. literalinclude:: plot_learning_curve.py - :lines: 16- - -**Total running time of the example:** 7.42 seconds -( 0 minutes 7.42 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_multilabel.txt b/0.15/_sources/auto_examples/plot_multilabel.txt deleted file mode 100644 index f62a657db825e..0000000000000 --- a/0.15/_sources/auto_examples/plot_multilabel.txt +++ /dev/null @@ -1,49 +0,0 @@ - - -.. _example_plot_multilabel.py: - - -========================= -Multilabel classification -========================= - -This example simulates a multi-label document classification problem. The -dataset is generated randomly based on the following process: - - - pick the number of labels: n ~ Poisson(n_labels) - - n times, choose a class c: c ~ Multinomial(theta) - - pick the document length: k ~ Poisson(length) - - k times, choose a word: w ~ Multinomial(theta_c) - -In the above process, rejection sampling is used to make sure that n is more -than 2, and that the document length is never zero. Likewise, we reject classes -which have already been chosen. The documents that are assigned to both -classes are plotted surrounded by two colored circles. - -The classification is performed by projecting to the first two principal -components found by PCA and CCA for visualisation purposes, followed by using -the :class:`sklearn.multiclass.OneVsRestClassifier` metaclassifier using two -SVCs with linear kernels to learn a discriminative model for each class. -Note that PCA is used to perform an unsupervised dimensionality reduction, -while CCA is used to perform a supervised one. - -Note: in the plot, "unlabeled samples" does not mean that we don't know the -labels (as in semi-supervised learning) but that the samples simply do *not* -have a label. - - - -.. image:: images/plot_multilabel_001.png - :align: center - - - - -**Python source code:** :download:`plot_multilabel.py ` - -.. literalinclude:: plot_multilabel.py - :lines: 32- - -**Total running time of the example:** 0.34 seconds -( 0 minutes 0.34 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_multioutput_face_completion.txt b/0.15/_sources/auto_examples/plot_multioutput_face_completion.txt deleted file mode 100644 index 000b5110c5ffa..0000000000000 --- a/0.15/_sources/auto_examples/plot_multioutput_face_completion.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_plot_multioutput_face_completion.py: - - -============================================== -Face completion with a multi-output estimators -============================================== - -This example shows the use of multi-output estimator to complete images. -The goal is to predict the lower half of a face given its upper half. - -The first column of images shows true faces. The next columns illustrate -how extremely randomized trees, k nearest neighbors, linear -regression and ridge regression complete the lower half of those faces. - - - - -.. image:: images/plot_multioutput_face_completion_001.png - :align: center - - - - -**Python source code:** :download:`plot_multioutput_face_completion.py ` - -.. literalinclude:: plot_multioutput_face_completion.py - :lines: 14- - -**Total running time of the example:** 44.80 seconds -( 0 minutes 44.80 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_permutation_test_for_classification.txt b/0.15/_sources/auto_examples/plot_permutation_test_for_classification.txt deleted file mode 100644 index 1db4a2ff5c79c..0000000000000 --- a/0.15/_sources/auto_examples/plot_permutation_test_for_classification.txt +++ /dev/null @@ -1,36 +0,0 @@ - - -.. _example_plot_permutation_test_for_classification.py: - - -================================================================= -Test with permutations the significance of a classification score -================================================================= - -In order to test if a classification score is significative a technique -in repeating the classification procedure after randomizing, permuting, -the labels. The p-value is then given by the percentage of runs for -which the score obtained is greater than the classification score -obtained in the first place. - - - - -.. image:: images/plot_permutation_test_for_classification_001.png - :align: center - - -**Script output**:: - - Classification score 0.513333333333 (pvalue : 0.00990099009901) - - - -**Python source code:** :download:`plot_permutation_test_for_classification.py ` - -.. literalinclude:: plot_permutation_test_for_classification.py - :lines: 13- - -**Total running time of the example:** 7.75 seconds -( 0 minutes 7.75 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_precision_recall.txt b/0.15/_sources/auto_examples/plot_precision_recall.txt deleted file mode 100644 index 08e03e967eefa..0000000000000 --- a/0.15/_sources/auto_examples/plot_precision_recall.txt +++ /dev/null @@ -1,93 +0,0 @@ - - -.. _example_plot_precision_recall.py: - - -================ -Precision-Recall -================ - -Example of Precision-Recall metric to evaluate classifier output quality. - -In information retrieval, precision is a measure of result relevancy, while -recall is a measure of how many truly relevant results are returned. A high -area under the curve represents both high recall and high precision, where high -precision relates to a low false positive rate, and high recall relates to a -low false negative rate. High scores for both show that the classifier is -returning accurate results (high precision), as well as returning a majority of -all positive results (high recall). - -A system with high recall but low precision returns many results, but most of -its predicted labels are incorrect when compared to the training labels. A -system with high precision but low recall is just the opposite, returning very -few results, but most of its predicted labels are correct when compared to the -training labels. An ideal system with high precision and high recall will -return many results, with all results labeled correctly. - -Precision (:math:`P`) is defined as the number of true positives (:math:`T_p`) -over the number of true positives plus the number of false positives -(:math:`F_p`). - -:math:`P = \frac{T_p}{T_p+F_p}` - -Recall (:math:`R`) is defined as the number of true positives (:math:`T_p`) -over the number of true positives plus the number of false negatives -(:math:`F_n`). - -:math:`R = \frac{T_p}{T_p + F_n}` - -These quantities are also related to the (:math:`F_1`) score, which is defined -as the harmonic mean of precision and recall. - -:math:`F1 = 2\frac{P \times R}{P+R}` - -It is important to note that the precision may not decrease with recall. The -definition of precision (:math:`\frac{T_p}{T_p + F_p}`) shows that lowering -the threshold of a classifier may increase the denominator, by increasing the -number of results returned. If the threshold was previously set too high, the -new results may all be true positives, which will increase precision. If the -previous threshold was about right or too low, further lowering the threshold -will introduce false positives, decreasing precision. - -Recall is defined as :math:`\frac{T_p}{T_p+F_n}`, where :math:`T_p+F_n` does -not depend on the classifier threshold. This means that lowering the classifier -threshold may increase recall, by increasing the number of true positive -results. It is also possible that lowering the threshold may leave recall -unchanged, while the precision fluctuates. - -The relationship between recall and precision can be observed in the -stairstep area of the plot - at the edges of these steps a small change -in the threshold considerably reduces precision, with only a minor gain in -recall. See the corner at recall = .59, precision = .8 for an example of this -phenomenon. - -Precision-recall curves are typically used in binary classification to study -the output of a classifier. In order to extend Precision-recall curve and -average precision to multi-class or multi-label classification, it is necessary -to binarize the output. One curve can be drawn per label, but one can also draw -a precision-recall curve by considering each element of the label indicator -matrix as a binary prediction (micro-averaging). - -.. note:: - - See also :func:`sklearn.metrics.average_precision_score`, - :func:`sklearn.metrics.recall_score`, - :func:`sklearn.metrics.precision_score`, - :func:`sklearn.metrics.f1_score` - - - -.. image:: images/plot_precision_recall_001.png - :align: center - - - - -**Python source code:** :download:`plot_precision_recall.py ` - -.. literalinclude:: plot_precision_recall.py - :lines: 74- - -**Total running time of the example:** 0.30 seconds -( 0 minutes 0.30 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_rbm_logistic_classification.txt b/0.15/_sources/auto_examples/plot_rbm_logistic_classification.txt deleted file mode 100644 index 184bf1b37404f..0000000000000 --- a/0.15/_sources/auto_examples/plot_rbm_logistic_classification.txt +++ /dev/null @@ -1,102 +0,0 @@ - - -.. _example_plot_rbm_logistic_classification.py: - - -============================================================== -Restricted Boltzmann Machine features for digit classification -============================================================== - -For greyscale image data where pixel values can be interpreted as degrees of -blackness on a white background, like handwritten digit recognition, the -Bernoulli Restricted Boltzmann machine model (:class:`BernoulliRBM -`) can perform effective non-linear -feature extraction. - -In order to learn good latent representations from a small dataset, we -artificially generate more labeled data by perturbing the training data with -linear shifts of 1 pixel in each direction. - -This example shows how to build a classification pipeline with a BernoulliRBM -feature extractor and a :class:`LogisticRegression -` classifier. The hyperparameters -of the entire model (learning rate, hidden layer size, regularization) -were optimized by grid search, but the search is not reproduced here because -of runtime constraints. - -Logistic regression on raw pixel values is presented for comparison. The -example shows that the features extracted by the BernoulliRBM help improve the -classification accuracy. - - - -.. image:: images/plot_rbm_logistic_classification_001.png - :align: center - - -**Script output**:: - - [BernoulliRBM] Iteration 1, pseudo-likelihood = -25.39, time = 0.56s - [BernoulliRBM] Iteration 2, pseudo-likelihood = -23.77, time = 0.77s - [BernoulliRBM] Iteration 3, pseudo-likelihood = -22.94, time = 0.78s - [BernoulliRBM] Iteration 4, pseudo-likelihood = -21.91, time = 0.78s - [BernoulliRBM] Iteration 5, pseudo-likelihood = -21.69, time = 0.78s - [BernoulliRBM] Iteration 6, pseudo-likelihood = -21.06, time = 0.85s - [BernoulliRBM] Iteration 7, pseudo-likelihood = -20.89, time = 0.78s - [BernoulliRBM] Iteration 8, pseudo-likelihood = -20.64, time = 0.78s - [BernoulliRBM] Iteration 9, pseudo-likelihood = -20.36, time = 0.78s - [BernoulliRBM] Iteration 10, pseudo-likelihood = -20.09, time = 0.78s - [BernoulliRBM] Iteration 11, pseudo-likelihood = -20.08, time = 0.78s - [BernoulliRBM] Iteration 12, pseudo-likelihood = -19.82, time = 0.84s - [BernoulliRBM] Iteration 13, pseudo-likelihood = -19.64, time = 0.80s - [BernoulliRBM] Iteration 14, pseudo-likelihood = -19.61, time = 0.77s - [BernoulliRBM] Iteration 15, pseudo-likelihood = -19.57, time = 0.79s - [BernoulliRBM] Iteration 16, pseudo-likelihood = -19.41, time = 0.77s - [BernoulliRBM] Iteration 17, pseudo-likelihood = -19.30, time = 0.77s - [BernoulliRBM] Iteration 18, pseudo-likelihood = -19.25, time = 0.82s - [BernoulliRBM] Iteration 19, pseudo-likelihood = -19.27, time = 0.81s - [BernoulliRBM] Iteration 20, pseudo-likelihood = -19.01, time = 0.77s - - Logistic regression using RBM features: - precision recall f1-score support - - 0 0.99 0.99 0.99 174 - 1 0.92 0.95 0.93 184 - 2 0.95 0.98 0.97 166 - 3 0.97 0.91 0.94 194 - 4 0.97 0.95 0.96 186 - 5 0.93 0.93 0.93 181 - 6 0.98 0.97 0.97 207 - 7 0.95 1.00 0.97 154 - 8 0.90 0.88 0.89 182 - 9 0.91 0.93 0.92 169 - - avg / total 0.95 0.95 0.95 1797 - - - Logistic regression using raw pixel features: - precision recall f1-score support - - 0 0.85 0.94 0.89 174 - 1 0.57 0.55 0.56 184 - 2 0.72 0.85 0.78 166 - 3 0.76 0.74 0.75 194 - 4 0.85 0.82 0.84 186 - 5 0.74 0.75 0.75 181 - 6 0.93 0.88 0.91 207 - 7 0.86 0.90 0.88 154 - 8 0.68 0.55 0.61 182 - 9 0.71 0.74 0.72 169 - - avg / total 0.77 0.77 0.77 1797 - - - -**Python source code:** :download:`plot_rbm_logistic_classification.py ` - -.. literalinclude:: plot_rbm_logistic_classification.py - :lines: 27- - -**Total running time of the example:** 45.91 seconds -( 0 minutes 45.91 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_rfe_digits.txt b/0.15/_sources/auto_examples/plot_rfe_digits.txt deleted file mode 100644 index 9415afc029213..0000000000000 --- a/0.15/_sources/auto_examples/plot_rfe_digits.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_plot_rfe_digits.py: - - -============================= -Recursive feature elimination -============================= - -A recursive feature elimination example showing the relevance of pixels in -a digit classification task. - -.. note:: - - See also :ref:`example_plot_rfe_with_cross_validation.py` - - - - -.. image:: images/plot_rfe_digits_001.png - :align: center - - - - -**Python source code:** :download:`plot_rfe_digits.py ` - -.. literalinclude:: plot_rfe_digits.py - :lines: 14- - -**Total running time of the example:** 5.68 seconds -( 0 minutes 5.68 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_rfe_with_cross_validation.txt b/0.15/_sources/auto_examples/plot_rfe_with_cross_validation.txt deleted file mode 100644 index 2ead021a223ba..0000000000000 --- a/0.15/_sources/auto_examples/plot_rfe_with_cross_validation.txt +++ /dev/null @@ -1,32 +0,0 @@ - - -.. _example_plot_rfe_with_cross_validation.py: - - -=================================================== -Recursive feature elimination with cross-validation -=================================================== - -A recursive feature elimination example with automatic tuning of the -number of features selected with cross-validation. - - - -.. image:: images/plot_rfe_with_cross_validation_001.png - :align: center - - -**Script output**:: - - Optimal number of features : 3 - - - -**Python source code:** :download:`plot_rfe_with_cross_validation.py ` - -.. literalinclude:: plot_rfe_with_cross_validation.py - :lines: 9- - -**Total running time of the example:** 3.69 seconds -( 0 minutes 3.69 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_roc.txt b/0.15/_sources/auto_examples/plot_roc.txt deleted file mode 100644 index 86f2edb06532f..0000000000000 --- a/0.15/_sources/auto_examples/plot_roc.txt +++ /dev/null @@ -1,60 +0,0 @@ - - -.. _example_plot_roc.py: - - -======================================= -Receiver Operating Characteristic (ROC) -======================================= - -Example of Receiver Operating Characteristic (ROC) metric to evaluate -classifier output quality. - -ROC curves typically feature true positive rate on the Y axis, and false -positive rate on the X axis. This means that the top left corner of the plot is -the "ideal" point - a false positive rate of zero, and a true positive rate of -one. This is not very realistic, but it does mean that a larger area under the -curve (AUC) is usually better. - -The "steepness" of ROC curves is also important, since it is ideal to maximize -the true positive rate while minimizing the false positive rate. - -ROC curves are typically used in binary classification to study the output of -a classifier. In order to extend ROC curve and ROC area to multi-class -or multi-label classification, it is necessary to binarize the output. One ROC -curve can be drawn per label, but one can also draw a ROC curve by considering -each element of the label indicator matrix as a binary prediction -(micro-averaging). - -.. note:: - - See also :func:`sklearn.metrics.roc_auc_score`, - :ref:`example_plot_roc_crossval.py`. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_roc_001.png - :scale: 47 - - * - - .. image:: images/plot_roc_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_roc.py ` - -.. literalinclude:: plot_roc.py - :lines: 31- - -**Total running time of the example:** 0.28 seconds -( 0 minutes 0.28 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_roc_crossval.txt b/0.15/_sources/auto_examples/plot_roc_crossval.txt deleted file mode 100644 index f76c4568977fb..0000000000000 --- a/0.15/_sources/auto_examples/plot_roc_crossval.txt +++ /dev/null @@ -1,51 +0,0 @@ - - -.. _example_plot_roc_crossval.py: - - -============================================================= -Receiver Operating Characteristic (ROC) with cross validation -============================================================= - -Example of Receiver Operating Characteristic (ROC) metric to evaluate -classifier output quality using cross-validation. - -ROC curves typically feature true positive rate on the Y axis, and false -positive rate on the X axis. This means that the top left corner of the plot is -the "ideal" point - a false positive rate of zero, and a true positive rate of -one. This is not very realistic, but it does mean that a larger area under the -curve (AUC) is usually better. - -The "steepness" of ROC curves is also important, since it is ideal to maximize -the true positive rate while minimizing the false positive rate. - -This example shows the ROC response of different datasets, created from K-fold -cross-validation. Taking all of these curves, it is possible to calculate the -mean area under curve, and see the variance of the curve when the -training set is split into different subsets. This roughly shows how the -classifier output is affected by changes in the training data, and how -different the splits generated by K-fold cross-validation are from one another. - -.. note:: - - See also :func:`sklearn.metrics.auc_score`, - :func:`sklearn.cross_validation.cross_val_score`, - :ref:`example_plot_roc.py`, - - - - -.. image:: images/plot_roc_crossval_001.png - :align: center - - - - -**Python source code:** :download:`plot_roc_crossval.py ` - -.. literalinclude:: plot_roc_crossval.py - :lines: 32- - -**Total running time of the example:** 0.36 seconds -( 0 minutes 0.36 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_train_error_vs_test_error.txt b/0.15/_sources/auto_examples/plot_train_error_vs_test_error.txt deleted file mode 100644 index b7597850724ac..0000000000000 --- a/0.15/_sources/auto_examples/plot_train_error_vs_test_error.txt +++ /dev/null @@ -1,37 +0,0 @@ - - -.. _example_plot_train_error_vs_test_error.py: - - -========================= -Train error vs Test error -========================= - -Illustration of how the performance of an estimator on unseen data (test data) -is not the same as the performance on training data. As the regularization -increases the performance on train decreases while the performance on test -is optimal within a range of values of the regularization parameter. -The example with an Elastic-Net regression model and the performance is -measured using the explained variance a.k.a. R^2. - - - - -.. image:: images/plot_train_error_vs_test_error_001.png - :align: center - - -**Script output**:: - - Optimal regularization parameter : 0.000335292414925 - - - -**Python source code:** :download:`plot_train_error_vs_test_error.py ` - -.. literalinclude:: plot_train_error_vs_test_error.py - :lines: 14- - -**Total running time of the example:** 2.25 seconds -( 0 minutes 2.25 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_underfitting_overfitting.txt b/0.15/_sources/auto_examples/plot_underfitting_overfitting.txt deleted file mode 100644 index 7357e74496b23..0000000000000 --- a/0.15/_sources/auto_examples/plot_underfitting_overfitting.txt +++ /dev/null @@ -1,37 +0,0 @@ - - -.. _example_plot_underfitting_overfitting.py: - - -============================ -Underfitting vs. Overfitting -============================ - -This example demonstrates the problems of underfitting and overfitting and -how we can use linear regression with polynomial features to approximate -nonlinear functions. The plot shows the function that we want to approximate, -which is a part of the cosine function. In addition, the samples from the -real function and the approximations of different models are displayed. The -models have polynomial features of different degrees. We can see that a -linear function (polynomial with degree 1) is not sufficient to fit the -training samples. This is called **underfitting**. A polynomial of degree 4 -approximates the true function almost perfectly. However, for higher degrees -the model will **overfit** the training data, i.e. it learns the noise of the -training data. - - - -.. image:: images/plot_underfitting_overfitting_001.png - :align: center - - - - -**Python source code:** :download:`plot_underfitting_overfitting.py ` - -.. literalinclude:: plot_underfitting_overfitting.py - :lines: 18- - -**Total running time of the example:** 0.20 seconds -( 0 minutes 0.20 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/plot_validation_curve.txt b/0.15/_sources/auto_examples/plot_validation_curve.txt deleted file mode 100644 index 39fd736a9337f..0000000000000 --- a/0.15/_sources/auto_examples/plot_validation_curve.txt +++ /dev/null @@ -1,33 +0,0 @@ - - -.. _example_plot_validation_curve.py: - - -========================== -Plotting Validation Curves -========================== - -In this plot you can see the training scores and validation scores of an SVM -for different values of the kernel parameter gamma. For very low values of -gamma, you can see that both the training score and the validation score are -low. This is called underfitting. Medium values of gamma will result in high -values for both scores, i.e. the classifier is perfoming fairly well. If gamma -is too high, the classifier will overfit, which means that the training score -is good but the validation score is poor. - - - -.. image:: images/plot_validation_curve_001.png - :align: center - - - - -**Python source code:** :download:`plot_validation_curve.py ` - -.. literalinclude:: plot_validation_curve.py - :lines: 14- - -**Total running time of the example:** 40.03 seconds -( 0 minutes 40.03 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/preprocessing/plot_robust_scaling.txt b/0.15/_sources/auto_examples/preprocessing/plot_robust_scaling.txt deleted file mode 100644 index 8cfb936019b10..0000000000000 --- a/0.15/_sources/auto_examples/preprocessing/plot_robust_scaling.txt +++ /dev/null @@ -1,39 +0,0 @@ - - -.. _example_preprocessing_plot_robust_scaling.py: - - -========================================================= -Robust Scaling on Toy Data -========================================================= - -Making sure that each Feature has approximately the same scale can be a -crucial preprocessing step. However, when data contains outliers, -:class:`StandardScaler ` can often -be mislead. In such cases, it is better to use a scaler that is robust -against outliers. - -Here, we demonstrate this on a toy dataset, where one single datapoint -is a large outlier. - - - -.. image:: images/plot_robust_scaling_001.png - :align: center - - -**Script output**:: - - Testset accuracy using standard scaler: 0.545 - Testset accuracy using robust scaler: 0.700 - - - -**Python source code:** :download:`plot_robust_scaling.py ` - -.. literalinclude:: plot_robust_scaling.py - :lines: 18- - -**Total running time of the example:** 0.42 seconds -( 0 minutes 0.42 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/randomized_search.txt b/0.15/_sources/auto_examples/randomized_search.txt deleted file mode 100644 index c6f7b96589125..0000000000000 --- a/0.15/_sources/auto_examples/randomized_search.txt +++ /dev/null @@ -1,30 +0,0 @@ - - -.. _example_randomized_search.py: - - -========================================================================= -Comparing randomized search and grid search for hyperparameter estimation -========================================================================= - -Compare randomized search and grid search for optimizing hyperparameters of a -random forest. -All parameters that influence the learning are searched simultaneously -(except for the number of estimators, which poses a time / quality tradeoff). - -The randomized search and the grid search explore exactly the same space of -parameters. The result in parameter settings is quite similar, while the run -time for randomized search is drastically lower. - -The performance is slightly worse for the randomized search, though this -is most likely a noise effect and would not carry over to a held-out test set. - -Note that in practice, one would not search over this many different parameters -simultaneously using grid search, but pick only the ones deemed most important. - - -**Python source code:** :download:`randomized_search.py ` - -.. literalinclude:: randomized_search.py - :lines: 21- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_digits.txt b/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_digits.txt deleted file mode 100644 index 39f369d9b8735..0000000000000 --- a/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_digits.txt +++ /dev/null @@ -1,65 +0,0 @@ - - -.. _example_semi_supervised_plot_label_propagation_digits.py: - - -=================================================== -Label Propagation digits: Demonstrating performance -=================================================== - -This example demonstrates the power of semisupervised learning by -training a Label Spreading model to classify handwritten digits -with sets of very few labels. - -The handwritten digit dataset has 1797 total points. The model will -be trained using all points, but only 30 will be labeled. Results -in the form of a confusion matrix and a series of metrics over each -class will be very good. - -At the end, the top 10 most uncertain predictions will be shown. - - - -.. image:: images/plot_label_propagation_digits_001.png - :align: center - - -**Script output**:: - - Label Spreading model: 30 labeled & 300 unlabeled points (330 total) - precision recall f1-score support - - 0 1.00 1.00 1.00 23 - 1 0.58 0.54 0.56 28 - 2 0.96 0.93 0.95 29 - 3 0.00 0.00 0.00 28 - 4 0.91 0.80 0.85 25 - 5 0.96 0.79 0.87 33 - 6 0.97 0.97 0.97 36 - 7 0.89 1.00 0.94 34 - 8 0.48 0.83 0.61 29 - 9 0.54 0.77 0.64 35 - - avg / total 0.73 0.77 0.74 300 - - Confusion matrix - [[23 0 0 0 0 0 0 0 0] - [ 0 15 1 0 0 1 0 11 0] - [ 0 0 27 0 0 0 2 0 0] - [ 0 5 0 20 0 0 0 0 0] - [ 0 0 0 0 26 0 0 1 6] - [ 0 1 0 0 0 35 0 0 0] - [ 0 0 0 0 0 0 34 0 0] - [ 0 5 0 0 0 0 0 24 0] - [ 0 0 0 2 1 0 2 3 27]] - - - -**Python source code:** :download:`plot_label_propagation_digits.py ` - -.. literalinclude:: plot_label_propagation_digits.py - :lines: 17- - -**Total running time of the example:** 0.61 seconds -( 0 minutes 0.61 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_digits_active_learning.txt b/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_digits_active_learning.txt deleted file mode 100644 index 5938002332928..0000000000000 --- a/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_digits_active_learning.txt +++ /dev/null @@ -1,177 +0,0 @@ - - -.. _example_semi_supervised_plot_label_propagation_digits_active_learning.py: - - -======================================== -Label Propagation digits active learning -======================================== - -Demonstrates an active learning technique to learn handwritten digits -using label propagation. - -We start by training a label propagation model with only 10 labeled points, -then we select the top five most uncertain points to label. Next, we train -with 15 labeled points (original 10 + 5 new ones). We repeat this process -four times to have a model trained with 30 labeled examples. - -A plot will appear showing the top 5 most uncertain digits for each iteration -of training. These may or may not contain mistakes, but we will train the next -model with their true labels. - - - -.. image:: images/plot_label_propagation_digits_active_learning_001.png - :align: center - - -**Script output**:: - - Iteration 0 ______________________________________________________________________ - Label Spreading model: 10 labeled & 320 unlabeled (330 total) - precision recall f1-score support - - 0 0.00 0.00 0.00 24 - 1 0.49 0.90 0.63 29 - 2 0.88 0.97 0.92 31 - 3 0.00 0.00 0.00 28 - 4 0.00 0.00 0.00 27 - 5 0.89 0.49 0.63 35 - 6 0.86 0.95 0.90 40 - 7 0.75 0.92 0.83 36 - 8 0.54 0.79 0.64 33 - 9 0.41 0.86 0.56 37 - - avg / total 0.52 0.63 0.55 320 - - Confusion matrix - [[26 1 0 0 1 0 1] - [ 1 30 0 0 0 0 0] - [ 0 0 17 6 0 2 10] - [ 2 0 0 38 0 0 0] - [ 0 3 0 0 33 0 0] - [ 7 0 0 0 0 26 0] - [ 0 0 2 0 0 3 32]] - Iteration 1 ______________________________________________________________________ - Label Spreading model: 15 labeled & 315 unlabeled (330 total) - precision recall f1-score support - - 0 1.00 1.00 1.00 23 - 1 0.61 0.59 0.60 29 - 2 0.91 0.97 0.94 31 - 3 1.00 0.56 0.71 27 - 4 0.79 0.88 0.84 26 - 5 0.89 0.46 0.60 35 - 6 0.86 0.95 0.90 40 - 7 0.97 0.92 0.94 36 - 8 0.54 0.84 0.66 31 - 9 0.70 0.81 0.75 37 - - avg / total 0.82 0.80 0.79 315 - - Confusion matrix - [[23 0 0 0 0 0 0 0 0 0] - [ 0 17 1 0 2 0 0 1 7 1] - [ 0 1 30 0 0 0 0 0 0 0] - [ 0 0 0 15 0 0 0 0 10 2] - [ 0 3 0 0 23 0 0 0 0 0] - [ 0 0 0 0 1 16 6 0 2 10] - [ 0 2 0 0 0 0 38 0 0 0] - [ 0 0 2 0 1 0 0 33 0 0] - [ 0 5 0 0 0 0 0 0 26 0] - [ 0 0 0 0 2 2 0 0 3 30]] - Iteration 2 ______________________________________________________________________ - Label Spreading model: 20 labeled & 310 unlabeled (330 total) - precision recall f1-score support - - 0 1.00 1.00 1.00 23 - 1 0.68 0.59 0.63 29 - 2 0.91 0.97 0.94 31 - 3 0.96 1.00 0.98 23 - 4 0.81 1.00 0.89 25 - 5 0.89 0.46 0.60 35 - 6 0.86 0.95 0.90 40 - 7 0.97 0.92 0.94 36 - 8 0.68 0.84 0.75 31 - 9 0.75 0.81 0.78 37 - - avg / total 0.85 0.84 0.83 310 - - Confusion matrix - [[23 0 0 0 0 0 0 0 0 0] - [ 0 17 1 0 2 0 0 1 7 1] - [ 0 1 30 0 0 0 0 0 0 0] - [ 0 0 0 23 0 0 0 0 0 0] - [ 0 0 0 0 25 0 0 0 0 0] - [ 0 0 0 1 1 16 6 0 2 9] - [ 0 2 0 0 0 0 38 0 0 0] - [ 0 0 2 0 1 0 0 33 0 0] - [ 0 5 0 0 0 0 0 0 26 0] - [ 0 0 0 0 2 2 0 0 3 30]] - Iteration 3 ______________________________________________________________________ - Label Spreading model: 25 labeled & 305 unlabeled (330 total) - precision recall f1-score support - - 0 1.00 1.00 1.00 23 - 1 0.70 0.85 0.77 27 - 2 1.00 0.90 0.95 31 - 3 1.00 1.00 1.00 23 - 4 1.00 1.00 1.00 25 - 5 0.96 0.74 0.83 34 - 6 1.00 0.95 0.97 40 - 7 0.90 1.00 0.95 35 - 8 0.83 0.81 0.82 31 - 9 0.75 0.83 0.79 36 - - avg / total 0.91 0.90 0.90 305 - - Confusion matrix - [[23 0 0 0 0 0 0 0 0 0] - [ 0 23 0 0 0 0 0 0 4 0] - [ 0 1 28 0 0 0 0 2 0 0] - [ 0 0 0 23 0 0 0 0 0 0] - [ 0 0 0 0 25 0 0 0 0 0] - [ 0 0 0 0 0 25 0 0 0 9] - [ 0 2 0 0 0 0 38 0 0 0] - [ 0 0 0 0 0 0 0 35 0 0] - [ 0 5 0 0 0 0 0 0 25 1] - [ 0 2 0 0 0 1 0 2 1 30]] - Iteration 4 ______________________________________________________________________ - Label Spreading model: 30 labeled & 300 unlabeled (330 total) - precision recall f1-score support - - 0 1.00 1.00 1.00 23 - 1 0.77 0.88 0.82 26 - 2 1.00 0.90 0.95 31 - 3 1.00 1.00 1.00 23 - 4 1.00 1.00 1.00 25 - 5 0.94 0.97 0.95 32 - 6 1.00 0.97 0.99 39 - 7 0.90 1.00 0.95 35 - 8 0.89 0.81 0.85 31 - 9 0.94 0.89 0.91 35 - - avg / total 0.94 0.94 0.94 300 - - Confusion matrix - [[23 0 0 0 0 0 0 0 0 0] - [ 0 23 0 0 0 0 0 0 3 0] - [ 0 1 28 0 0 0 0 2 0 0] - [ 0 0 0 23 0 0 0 0 0 0] - [ 0 0 0 0 25 0 0 0 0 0] - [ 0 0 0 0 0 31 0 0 0 1] - [ 0 1 0 0 0 0 38 0 0 0] - [ 0 0 0 0 0 0 0 35 0 0] - [ 0 5 0 0 0 0 0 0 25 1] - [ 0 0 0 0 0 2 0 2 0 31]] - - - -**Python source code:** :download:`plot_label_propagation_digits_active_learning.py ` - -.. literalinclude:: plot_label_propagation_digits_active_learning.py - :lines: 18- - -**Total running time of the example:** 1.34 seconds -( 0 minutes 1.34 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_structure.txt b/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_structure.txt deleted file mode 100644 index 63e5a228ca493..0000000000000 --- a/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_structure.txt +++ /dev/null @@ -1,31 +0,0 @@ - - -.. _example_semi_supervised_plot_label_propagation_structure.py: - - -============================================== -Label Propagation learning a complex structure -============================================== - -Example of LabelPropagation learning a complex internal structure -to demonstrate "manifold learning". The outer circle should be -labeled "red" and the inner circle "blue". Because both label groups -lie inside their own distinct shape, we can see that the labels -propagate correctly around the circle. - - - -.. image:: images/plot_label_propagation_structure_001.png - :align: center - - - - -**Python source code:** :download:`plot_label_propagation_structure.py ` - -.. literalinclude:: plot_label_propagation_structure.py - :lines: 12- - -**Total running time of the example:** 0.35 seconds -( 0 minutes 0.35 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_versus_svm_iris.txt b/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_versus_svm_iris.txt deleted file mode 100644 index c88ce0dbe1117..0000000000000 --- a/0.15/_sources/auto_examples/semi_supervised/plot_label_propagation_versus_svm_iris.txt +++ /dev/null @@ -1,32 +0,0 @@ - - -.. _example_semi_supervised_plot_label_propagation_versus_svm_iris.py: - - -===================================================================== -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. - - - - -.. image:: images/plot_label_propagation_versus_svm_iris_001.png - :align: center - - - - -**Python source code:** :download:`plot_label_propagation_versus_svm_iris.py ` - -.. literalinclude:: plot_label_propagation_versus_svm_iris.py - :lines: 13- - -**Total running time of the example:** 1.88 seconds -( 0 minutes 1.88 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_custom_kernel.txt b/0.15/_sources/auto_examples/svm/plot_custom_kernel.txt deleted file mode 100644 index 2ba997728dc8c..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_custom_kernel.txt +++ /dev/null @@ -1,29 +0,0 @@ - - -.. _example_svm_plot_custom_kernel.py: - - -====================== -SVM with custom kernel -====================== - -Simple usage of Support Vector Machines to classify a sample. It will -plot the decision surface and the support vectors. - - - - -.. image:: images/plot_custom_kernel_001.png - :align: center - - - - -**Python source code:** :download:`plot_custom_kernel.py ` - -.. literalinclude:: plot_custom_kernel.py - :lines: 10- - -**Total running time of the example:** 0.22 seconds -( 0 minutes 0.22 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_iris.txt b/0.15/_sources/auto_examples/svm/plot_iris.txt deleted file mode 100644 index 91fe4ab2b7b96..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_iris.txt +++ /dev/null @@ -1,55 +0,0 @@ - - -.. _example_svm_plot_iris.py: - - -================================================== -Plot different SVM classifiers in the iris dataset -================================================== - -Comparison of different linear SVM classifiers on a 2D projection of the iris -dataset. We only consider the first 2 features of this dataset: - -- Sepal length -- Sepal width - -This example shows how to plot the decision surface for four SVM classifiers -with different kernels. - -The linear models ``LinearSVC()`` and ``SVC(kernel='linear')`` yield slightly -different decision boundaries. This can be a consequence of the following -differences: - -- ``LinearSVC`` minimizes the squared hinge loss while ``SVC`` minimizes the - regular hinge loss. - -- ``LinearSVC`` uses the One-vs-All (also known as One-vs-Rest) multiclass - reduction while ``SVC`` uses the One-vs-One multiclass reduction. - -Both linear models have linear decision boundaries (intersecting hyperplanes) -while the non-linear kernel models (polynomial or Gaussian RBF) have more -flexible non-linear decision boundaries with shapes that depend on the kind of -kernel and its parameters. - -.. NOTE:: while plotting the decision function of classifiers for toy 2D - datasets can help get an intuitive understanding of their respective - expressive power, be aware that those intuitions don't always generalize to - more realistic high-dimensional problem. - - - - -.. image:: images/plot_iris_001.png - :align: center - - - - -**Python source code:** :download:`plot_iris.py ` - -.. literalinclude:: plot_iris.py - :lines: 36- - -**Total running time of the example:** 0.63 seconds -( 0 minutes 0.63 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_oneclass.txt b/0.15/_sources/auto_examples/svm/plot_oneclass.txt deleted file mode 100644 index 55d7cd22b2ef1..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_oneclass.txt +++ /dev/null @@ -1,31 +0,0 @@ - - -.. _example_svm_plot_oneclass.py: - - -========================================== -One-class SVM with non-linear kernel (RBF) -========================================== - -An example using a one-class SVM for novelty detection. - -:ref:`One-class SVM ` is an unsupervised -algorithm that learns a decision function for novelty detection: -classifying new data as similar or different to the training set. - - - -.. image:: images/plot_oneclass_001.png - :align: center - - - - -**Python source code:** :download:`plot_oneclass.py ` - -.. literalinclude:: plot_oneclass.py - :lines: 12- - -**Total running time of the example:** 0.33 seconds -( 0 minutes 0.33 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_rbf_parameters.txt b/0.15/_sources/auto_examples/svm/plot_rbf_parameters.txt deleted file mode 100644 index 2c3b7a4ae8b7a..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_rbf_parameters.txt +++ /dev/null @@ -1,59 +0,0 @@ - - -.. _example_svm_plot_rbf_parameters.py: - - -================== -RBF SVM parameters -================== - -This example illustrates the effect of the parameters `gamma` -and `C` of the rbf kernel SVM. - -Intuitively, the `gamma` parameter defines how far the influence -of a single training example reaches, with low values meaning 'far' -and high values meaning 'close'. -The `C` parameter trades off misclassification of training examples -against simplicity of the decision surface. A low C makes -the decision surface smooth, while a high C aims at classifying -all training examples correctly. - -Two plots are generated. The first is a visualization of the -decision function for a variety of parameter values, and the second -is a heatmap of the classifier's cross-validation accuracy as -a function of `C` and `gamma`. For this example we explore a relatively -large grid for illustration purposes. In practice, a logarithmic -grid from `10**-3` to `10**3` is usually sufficient. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_rbf_parameters_001.png - :scale: 47 - - * - - .. image:: images/plot_rbf_parameters_002.png - :scale: 47 - - -**Script output**:: - - The best classifier is: SVC(C=10000.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, - gamma=0.001, kernel='rbf', max_iter=-1, probability=False, - random_state=None, shrinking=True, tol=0.001, verbose=False) - - - -**Python source code:** :download:`plot_rbf_parameters.py ` - -.. literalinclude:: plot_rbf_parameters.py - :lines: 24- - -**Total running time of the example:** 2.37 seconds -( 0 minutes 2.37 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_separating_hyperplane.txt b/0.15/_sources/auto_examples/svm/plot_separating_hyperplane.txt deleted file mode 100644 index 0e531dd7ccfc8..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_separating_hyperplane.txt +++ /dev/null @@ -1,29 +0,0 @@ - - -.. _example_svm_plot_separating_hyperplane.py: - - -========================================= -SVM: Maximum margin separating hyperplane -========================================= - -Plot the maximum margin separating hyperplane within a two-class -separable dataset using a Support Vector Machines classifier with -linear kernel. - - - -.. image:: images/plot_separating_hyperplane_001.png - :align: center - - - - -**Python source code:** :download:`plot_separating_hyperplane.py ` - -.. literalinclude:: plot_separating_hyperplane.py - :lines: 10- - -**Total running time of the example:** 0.11 seconds -( 0 minutes 0.11 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_separating_hyperplane_unbalanced.txt b/0.15/_sources/auto_examples/svm/plot_separating_hyperplane_unbalanced.txt deleted file mode 100644 index 06fd06b45aa0a..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_separating_hyperplane_unbalanced.txt +++ /dev/null @@ -1,46 +0,0 @@ - - -.. _example_svm_plot_separating_hyperplane_unbalanced.py: - - -================================================= -SVM: Separating hyperplane for unbalanced classes -================================================= - -Find the optimal separating hyperplane using an SVC for classes that -are unbalanced. - -We first find the separating plane with a plain SVC and then plot -(dashed) the separating hyperplane with automatically correction for -unbalanced classes. - -.. currentmodule:: sklearn.linear_model - -.. note:: - - This example will also work by replacing ``SVC(kernel="linear")`` - with ``SGDClassifier(loss="hinge")``. Setting the ``loss`` parameter - of the :class:`SGDClassifier` equal to ``hinge`` will yield behaviour - such as that of a SVC with a linear kernel. - - For example try instead of the ``SVC``:: - - clf = SGDClassifier(n_iter=100, alpha=0.01) - - - - -.. image:: images/plot_separating_hyperplane_unbalanced_001.png - :align: center - - - - -**Python source code:** :download:`plot_separating_hyperplane_unbalanced.py ` - -.. literalinclude:: plot_separating_hyperplane_unbalanced.py - :lines: 27- - -**Total running time of the example:** 0.10 seconds -( 0 minutes 0.10 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_svm_anova.txt b/0.15/_sources/auto_examples/svm/plot_svm_anova.txt deleted file mode 100644 index 110be26cb5fc0..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_svm_anova.txt +++ /dev/null @@ -1,28 +0,0 @@ - - -.. _example_svm_plot_svm_anova.py: - - -================================================= -SVM-Anova: SVM with univariate feature selection -================================================= - -This example shows how to perform univariate feature before running a SVC -(support vector classifier) to improve the classification scores. - - - -.. image:: images/plot_svm_anova_001.png - :align: center - - - - -**Python source code:** :download:`plot_svm_anova.py ` - -.. literalinclude:: plot_svm_anova.py - :lines: 9- - -**Total running time of the example:** 0.56 seconds -( 0 minutes 0.56 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_svm_kernels.txt b/0.15/_sources/auto_examples/svm/plot_svm_kernels.txt deleted file mode 100644 index 150e847e34d8e..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_svm_kernels.txt +++ /dev/null @@ -1,46 +0,0 @@ - - -.. _example_svm_plot_svm_kernels.py: - - -========================================================= -SVM-Kernels -========================================================= - -Three different types of SVM-Kernels are displayed below. -The polynomial and RBF are especially useful when the -data-points are not linearly separable. - - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_svm_kernels_001.png - :scale: 47 - - * - - .. image:: images/plot_svm_kernels_002.png - :scale: 47 - - * - - .. image:: images/plot_svm_kernels_003.png - :scale: 47 - - - - -**Python source code:** :download:`plot_svm_kernels.py ` - -.. literalinclude:: plot_svm_kernels.py - :lines: 15- - -**Total running time of the example:** 0.25 seconds -( 0 minutes 0.25 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_svm_margin.txt b/0.15/_sources/auto_examples/svm/plot_svm_margin.txt deleted file mode 100644 index 101db43f2932c..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_svm_margin.txt +++ /dev/null @@ -1,44 +0,0 @@ - - -.. _example_svm_plot_svm_margin.py: - - -========================================================= -SVM Margins Example -========================================================= -The plots below illustrate the effect the parameter `C` has -on the separation line. A large value of `C` basically tells -our model that we do not have that much faith in our data's -distribution, and will only consider points close to line -of separation. - -A small value of `C` includes more/all the observations, allowing -the margins to be calculated using all the data in the area. - - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_svm_margin_001.png - :scale: 47 - - * - - .. image:: images/plot_svm_margin_002.png - :scale: 47 - - - - -**Python source code:** :download:`plot_svm_margin.py ` - -.. literalinclude:: plot_svm_margin.py - :lines: 18- - -**Total running time of the example:** 0.17 seconds -( 0 minutes 0.17 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_svm_nonlinear.txt b/0.15/_sources/auto_examples/svm/plot_svm_nonlinear.txt deleted file mode 100644 index 8807843ca4944..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_svm_nonlinear.txt +++ /dev/null @@ -1,31 +0,0 @@ - - -.. _example_svm_plot_svm_nonlinear.py: - - -============== -Non-linear SVM -============== - -Perform binary classification using non-linear SVC -with RBF kernel. The target to predict is a XOR of the -inputs. - -The color map illustrates the decision function learn by the SVC. - - - -.. image:: images/plot_svm_nonlinear_001.png - :align: center - - - - -**Python source code:** :download:`plot_svm_nonlinear.py ` - -.. literalinclude:: plot_svm_nonlinear.py - :lines: 12- - -**Total running time of the example:** 1.49 seconds -( 0 minutes 1.49 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_svm_regression.txt b/0.15/_sources/auto_examples/svm/plot_svm_regression.txt deleted file mode 100644 index 8fc47d292cfb8..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_svm_regression.txt +++ /dev/null @@ -1,28 +0,0 @@ - - -.. _example_svm_plot_svm_regression.py: - - -=================================================================== -Support Vector Regression (SVR) using linear and non-linear kernels -=================================================================== - -Toy example of 1D regression using linear, polynomial and RBF kernels. - - - - -.. image:: images/plot_svm_regression_001.png - :align: center - - - - -**Python source code:** :download:`plot_svm_regression.py ` - -.. literalinclude:: plot_svm_regression.py - :lines: 9- - -**Total running time of the example:** 1.24 seconds -( 0 minutes 1.24 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_svm_scale_c.txt b/0.15/_sources/auto_examples/svm/plot_svm_scale_c.txt deleted file mode 100644 index 042561645691c..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_svm_scale_c.txt +++ /dev/null @@ -1,108 +0,0 @@ - - -.. _example_svm_plot_svm_scale_c.py: - - -============================================== -Scaling the regularization parameter for SVCs -============================================== - -The following example illustrates the effect of scaling the -regularization parameter when using :ref:`svm` for -:ref:`classification `. -For SVC classification, we are interested in a risk minimization for the -equation: - - -.. math:: - - C \sum_{i=1, n} \mathcal{L} (f(x_i), y_i) + \Omega (w) - -where - - - :math:`C` is used to set the amount of regularization - - :math:`\mathcal{L}` is a `loss` function of our samples - and our model parameters. - - :math:`\Omega` is a `penalty` function of our model parameters - -If we consider the loss function to be the individual error per -sample, then the data-fit term, or the sum of the error for each sample, will -increase as we add more samples. The penalization term, however, will not -increase. - -When using, for example, :ref:`cross validation `, to -set the amount of regularization with `C`, there will be a -different amount of samples between the main problem and the smaller problems -within the folds of the cross validation. - -Since our loss function is dependent on the amount of samples, the latter -will influence the selected value of `C`. -The question that arises is `How do we optimally adjust C to -account for the different amount of training samples?` - -The figures below are used to illustrate the effect of scaling our -`C` to compensate for the change in the number of samples, in the -case of using an `L1` penalty, as well as the `L2` penalty. - -L1-penalty case ------------------ -In the `L1` case, theory says that prediction consistency -(i.e. that under given hypothesis, the estimator -learned predicts as well as a model knowing the true distribution) -is not possible because of the bias of the `L1`. It does say, however, -that model consistency, in terms of finding the right set of non-zero -parameters as well as their signs, can be achieved by scaling -`C1`. - -L2-penalty case ------------------ -The theory says that in order to achieve prediction consistency, the -penalty parameter should be kept constant -as the number of samples grow. - -Simulations ------------- - -The two figures below plot the values of `C` on the `x-axis` and the -corresponding cross-validation scores on the `y-axis`, for several different -fractions of a generated data-set. - -In the `L1` penalty case, the cross-validation-error correlates best with -the test-error, when scaling our `C` with the number of samples, `n`, -which can be seen in the first figure. - -For the `L2` penalty case, the best result comes from the case where `C` -is not scaled. - -.. topic:: Note: - - Two separate datasets are used for the two different plots. The reason - behind this is the `L1` case works better on sparse data, while `L2` - is better suited to the non-sparse case. - - - -.. rst-class:: horizontal - - - * - - .. image:: images/plot_svm_scale_c_000.png - :scale: 47 - - * - - .. image:: images/plot_svm_scale_c_001.png - :scale: 47 - - - - -**Python source code:** :download:`plot_svm_scale_c.py ` - -.. literalinclude:: plot_svm_scale_c.py - :lines: 79- - -**Total running time of the example:** 16.34 seconds -( 0 minutes 16.34 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/svm/plot_weighted_samples.txt b/0.15/_sources/auto_examples/svm/plot_weighted_samples.txt deleted file mode 100644 index 57a5133012594..0000000000000 --- a/0.15/_sources/auto_examples/svm/plot_weighted_samples.txt +++ /dev/null @@ -1,34 +0,0 @@ - - -.. _example_svm_plot_weighted_samples.py: - - -===================== -SVM: Weighted samples -===================== - -Plot decision function of a weighted dataset, where the size of points -is proportional to its weight. - -The sample weighting rescales the C parameter, which means that the classifier -puts more emphasis on getting these points right. The effect might often be -subtle. -To emphasis the effect here, we particularly weight outliers, making the -deformation of the decision boundary very visible. - - - -.. image:: images/plot_weighted_samples_001.png - :align: center - - - - -**Python source code:** :download:`plot_weighted_samples.py ` - -.. literalinclude:: plot_weighted_samples.py - :lines: 15- - -**Total running time of the example:** 0.54 seconds -( 0 minutes 0.54 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/text/document_classification_20newsgroups.txt b/0.15/_sources/auto_examples/text/document_classification_20newsgroups.txt deleted file mode 100644 index 92407522a6346..0000000000000 --- a/0.15/_sources/auto_examples/text/document_classification_20newsgroups.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -.. _example_text_document_classification_20newsgroups.py: - - -====================================================== -Classification of text documents using sparse features -====================================================== - -This is an example showing how scikit-learn can be used to classify documents -by topics using a bag-of-words approach. This example uses a scipy.sparse -matrix to store the features and demonstrates various classifiers that can -efficiently handle sparse matrices. - -The dataset used in this example is the 20 newsgroups dataset. It will be -automatically downloaded, then cached. - -The bar plot indicates the accuracy, training time (normalized) and test time -(normalized) of each classifier. - - - -**Python source code:** :download:`document_classification_20newsgroups.py ` - -.. literalinclude:: document_classification_20newsgroups.py - :lines: 18- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/text/document_clustering.txt b/0.15/_sources/auto_examples/text/document_clustering.txt deleted file mode 100644 index c13dcb4ce2c3b..0000000000000 --- a/0.15/_sources/auto_examples/text/document_clustering.txt +++ /dev/null @@ -1,57 +0,0 @@ - - -.. _example_text_document_clustering.py: - - -======================================= -Clustering text documents using k-means -======================================= - -This is an example showing how the scikit-learn can be used to cluster -documents by topics using a bag-of-words approach. This example uses -a scipy.sparse matrix to store the features instead of standard numpy arrays. - -Two feature extraction methods can be used in this example: - - - TfidfVectorizer uses a in-memory vocabulary (a python dict) to map the most - frequent words to features indices and hence compute a word occurrence - frequency (sparse) matrix. The word frequencies are then reweighted using - the Inverse Document Frequency (IDF) vector collected feature-wise over - the corpus. - - - HashingVectorizer hashes word occurrences to a fixed dimensional space, - possibly with collisions. The word count vectors are then normalized to - each have l2-norm equal to one (projected to the euclidean unit-ball) which - seems to be important for k-means to work in high dimensional space. - - HashingVectorizer does not provide IDF weighting as this is a stateless - model (the fit method does nothing). When IDF weighting is needed it can - be added by pipelining its output to a TfidfTransformer instance. - -Two algorithms are demoed: ordinary k-means and its more scalable cousin -minibatch k-means. - -It can be noted that k-means (and minibatch k-means) are very sensitive to -feature scaling and that in this case the IDF weighting helps improve the -quality of the clustering by quite a lot as measured against the "ground truth" -provided by the class label assignments of the 20 newsgroups dataset. - -This improvement is not visible in the Silhouette Coefficient which is small -for both as this measure seem to suffer from the phenomenon called -"Concentration of Measure" or "Curse of Dimensionality" for high dimensional -datasets such as text data. Other measures such as V-measure and Adjusted Rand -Index are information theoretic based evaluation scores: as they are only based -on cluster assignments rather than distances, hence not affected by the curse -of dimensionality. - -Note: as k-means is optimizing a non-convex objective function, it will likely -end up in a local optimum. Several runs with independent random init might be -necessary to get a good convergence. - - - -**Python source code:** :download:`document_clustering.py ` - -.. literalinclude:: document_clustering.py - :lines: 48- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/text/hashing_vs_dict_vectorizer.txt b/0.15/_sources/auto_examples/text/hashing_vs_dict_vectorizer.txt deleted file mode 100644 index b34b860309773..0000000000000 --- a/0.15/_sources/auto_examples/text/hashing_vs_dict_vectorizer.txt +++ /dev/null @@ -1,26 +0,0 @@ - - -.. _example_text_hashing_vs_dict_vectorizer.py: - - -=========================================== -FeatureHasher and DictVectorizer Comparison -=========================================== - -Compares FeatureHasher and DictVectorizer by using both to vectorize -text documents. - -The example demonstrates syntax and speed only; it doesn't actually do -anything useful with the extracted vectors. See the example scripts -{document_classification_20newsgroups,clustering}.py for actual learning -on text documents. - -A discrepancy between the number of terms reported for DictVectorizer and -for FeatureHasher is to be expected due to hash collisions. - - -**Python source code:** :download:`hashing_vs_dict_vectorizer.py ` - -.. literalinclude:: hashing_vs_dict_vectorizer.py - :lines: 17- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/text/mlcomp_sparse_document_classification.txt b/0.15/_sources/auto_examples/text/mlcomp_sparse_document_classification.txt deleted file mode 100644 index b76c94702ef2f..0000000000000 --- a/0.15/_sources/auto_examples/text/mlcomp_sparse_document_classification.txt +++ /dev/null @@ -1,45 +0,0 @@ - - -.. _example_text_mlcomp_sparse_document_classification.py: - - -======================================================== -Classification of text documents: using a MLComp dataset -======================================================== - -This is an example showing how the scikit-learn can be used to classify -documents by topics using a bag-of-words approach. This example uses -a scipy.sparse matrix to store the features instead of standard numpy arrays. - -The dataset used in this example is the 20 newsgroups dataset and should be -downloaded from the http://mlcomp.org (free registration required): - - http://mlcomp.org/datasets/379 - -Once downloaded unzip the archive somewhere on your filesystem. -For instance in:: - - % mkdir -p ~/data/mlcomp - % cd ~/data/mlcomp - % unzip /path/to/dataset-379-20news-18828_XXXXX.zip - -You should get a folder ``~/data/mlcomp/379`` with a file named ``metadata`` -and subfolders ``raw``, ``train`` and ``test`` holding the text documents -organized by newsgroups. - -Then set the ``MLCOMP_DATASETS_HOME`` environment variable pointing to -the root folder holding the uncompressed archive:: - - % export MLCOMP_DATASETS_HOME="~/data/mlcomp" - -Then you are ready to run this example using your favorite python shell:: - - % ipython examples/mlcomp_sparse_document_classification.py - - - -**Python source code:** :download:`mlcomp_sparse_document_classification.py ` - -.. literalinclude:: mlcomp_sparse_document_classification.py - :lines: 36- - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/tree/plot_iris.txt b/0.15/_sources/auto_examples/tree/plot_iris.txt deleted file mode 100644 index 7b2d2cc858683..0000000000000 --- a/0.15/_sources/auto_examples/tree/plot_iris.txt +++ /dev/null @@ -1,34 +0,0 @@ - - -.. _example_tree_plot_iris.py: - - -================================================================ -Plot the decision surface of a decision tree on the iris dataset -================================================================ - -Plot the decision surface of a decision tree trained on pairs -of features of the iris dataset. - -See :ref:`decision tree ` for more information on the estimator. - -For each pair of iris features, the decision tree learns decision -boundaries made of combinations of simple thresholding rules inferred from -the training samples. - - - -.. image:: images/plot_iris_001.png - :align: center - - - - -**Python source code:** :download:`plot_iris.py ` - -.. literalinclude:: plot_iris.py - :lines: 15- - -**Total running time of the example:** 0.45 seconds -( 0 minutes 0.45 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/tree/plot_tree_regression.txt b/0.15/_sources/auto_examples/tree/plot_tree_regression.txt deleted file mode 100644 index ca713e3341f61..0000000000000 --- a/0.15/_sources/auto_examples/tree/plot_tree_regression.txt +++ /dev/null @@ -1,35 +0,0 @@ - - -.. _example_tree_plot_tree_regression.py: - - -=================================================================== -Decision Tree Regression -=================================================================== - -A 1D regression with decision tree. - -The :ref:`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. - - - -.. image:: images/plot_tree_regression_001.png - :align: center - - - - -**Python source code:** :download:`plot_tree_regression.py ` - -.. literalinclude:: plot_tree_regression.py - :lines: 16- - -**Total running time of the example:** 0.14 seconds -( 0 minutes 0.14 seconds) - \ No newline at end of file diff --git a/0.15/_sources/auto_examples/tree/plot_tree_regression_multioutput.txt b/0.15/_sources/auto_examples/tree/plot_tree_regression_multioutput.txt deleted file mode 100644 index 8a74a342ab14e..0000000000000 --- a/0.15/_sources/auto_examples/tree/plot_tree_regression_multioutput.txt +++ /dev/null @@ -1,36 +0,0 @@ - - -.. _example_tree_plot_tree_regression_multioutput.py: - - -=================================================================== -Multi-output Decision Tree Regression -=================================================================== - -An example to illustrate multi-output regression with decision tree. - -The :ref:`decision trees ` -is used to predict simultaneously the noisy x and y observations of a circle -given a single underlying feature. As a result, it learns local linear -regressions approximating the circle. - -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. - - - -.. image:: images/plot_tree_regression_multioutput_001.png - :align: center - - - - -**Python source code:** :download:`plot_tree_regression_multioutput.py ` - -.. literalinclude:: plot_tree_regression_multioutput.py - :lines: 17- - -**Total running time of the example:** 0.39 seconds -( 0 minutes 0.39 seconds) - \ No newline at end of file diff --git a/0.15/_sources/data_transforms.txt b/0.15/_sources/data_transforms.txt deleted file mode 100644 index 2888780dd70a3..0000000000000 --- a/0.15/_sources/data_transforms.txt +++ /dev/null @@ -1,14 +0,0 @@ -.. include:: includes/big_toc_css.rst - -.. _data-transforms: - -Dataset transformations ------------------------ - -.. toctree:: - - modules/feature_extraction - modules/preprocessing - modules/kernel_approximation - modules/random_projection - modules/metrics diff --git a/0.15/_sources/datasets/covtype.txt b/0.15/_sources/datasets/covtype.txt deleted file mode 100644 index c0ed4ea08af3d..0000000000000 --- a/0.15/_sources/datasets/covtype.txt +++ /dev/null @@ -1,20 +0,0 @@ - -.. _covtype: - -Forest covertypes -================= - -The samples in this dataset correspond to 30×30m patches of forest in the US, -collected for the task of predicting each patch's cover type, -i.e. the dominant species of tree. -There are seven covertypes, making this a multiclass classification problem. -Each sample has 54 features, described on the -`dataset's homepage `_. -Some of the features are boolean indicators, -while others are discrete or continuous measurements. - -:func:`sklearn.datasets.fetch_covtype` will load the covertype dataset; -it returns a dictionary-like object -with the feature matrix in the ``data`` member -and the target values in ``target``. -The dataset will be downloaded from the web if necessary. diff --git a/0.15/_sources/datasets/index.txt b/0.15/_sources/datasets/index.txt deleted file mode 100644 index 7bff294e52048..0000000000000 --- a/0.15/_sources/datasets/index.txt +++ /dev/null @@ -1,185 +0,0 @@ -.. _datasets: - -========================= -Dataset loading utilities -========================= - -.. currentmodule:: sklearn.datasets - -The ``sklearn.datasets`` package embeds some small toy datasets -as introduced in the :ref:`Getting Started ` section. - -To evaluate the impact of the scale of the dataset (``n_samples`` and -``n_features``) while controlling the statistical properties of the data -(typically the correlation and informativeness of the features), it is -also possible to generate synthetic data. - -This package also features helpers to fetch larger datasets commonly -used by the machine learning community to benchmark algorithm on data -that comes from the 'real world'. - -General dataset API -=================== - -There are three distinct kinds of dataset interfaces for different types -of datasets. -The simplest one is the interface for sample images, which is described -below in the :ref:`sample_images` section. - -The dataset generation functions and the svmlight loader share a simplistic -interface, returning a tuple ``(X, y)`` consisting of a n_samples x n_features -numpy array X and an array of length n_samples containing the targets y. - -The toy datasets as well as the 'real world' datasets and the datasets -fetched from mldata.org have more sophisticated structure. -These functions return a dictionary-like object holding at least two items: -an array of shape ``n_samples`` * `` n_features`` with key ``data`` -(except for 20newsgroups) -and a NumPy array of length ``n_samples``, containing the target values, -with key ``target``. - -The datasets also contain a description in ``DESCR`` and some contain -``feature_names`` and ``target_names``. -See the dataset descriptions below for details. - - -Toy datasets -============ - -scikit-learn comes with a few small standard datasets that do not -require to download any file from some external website. - -.. autosummary:: - - :toctree: ../modules/generated/ - :template: function.rst - - load_boston - load_iris - load_diabetes - load_digits - load_linnerud - -These datasets are useful to quickly illustrate the behavior of the -various algorithms implemented in the scikit. They are however often too -small to be representative of real world machine learning tasks. - -.. _sample_images: - -Sample images -============= - -The scikit also embed a couple of sample JPEG images published under Creative -Commons license by their authors. Those image can be useful to test algorithms -and pipeline on 2D data. - -.. autosummary:: - - :toctree: ../modules/generated/ - :template: function.rst - - load_sample_images - load_sample_image - -.. image:: ../auto_examples/cluster/images/plot_color_quantization_001.png - :target: ../auto_examples/cluster/plot_color_quantization.html - :scale: 30 - :align: right - - -.. warning:: - - The default coding of images is based on the ``uint8`` dtype to - spare memory. Often machine learning algorithms work best if the - input is converted to a floating point representation first. Also, - if you plan to use ``pylab.imshow`` don't forget to scale to the range - 0 - 1 as done in the following example. - -.. topic:: Examples: - - * :ref:`example_cluster_plot_color_quantization.py` - - -.. _sample_generators: - -Sample generators -================= - -In addition, scikit-learn includes various random sample generators that -can be used to build artificial datasets of controlled size and complexity. - -.. image:: ../auto_examples/datasets/images/plot_random_dataset_001.png - :target: ../auto_examples/datasets/plot_random_dataset.html - :scale: 50 - :align: center - -.. autosummary:: - - :toctree: ../modules/generated/ - :template: function.rst - - make_classification - make_multilabel_classification - make_regression - make_blobs - make_friedman1 - make_friedman2 - make_friedman3 - make_hastie_10_2 - make_low_rank_matrix - make_sparse_coded_signal - make_sparse_uncorrelated - make_spd_matrix - make_swiss_roll - make_s_curve - make_sparse_spd_matrix - make_biclusters - make_checkerboard - -.. _libsvm_loader: - -Datasets in svmlight / libsvm format -==================================== - -scikit-learn includes utility functions for loading -datasets in the svmlight / libsvm format. In this format, each line -takes the form ``