Explicit feature map approximation for RBF kernels

An example illustrating the approximation of the feature map of an RBF kernel. It shows how to use RBFSampler and 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 RBFSampler, which uses random Fourier features) and diff

exceptions.UndefinedMetricWarning

class sklearn.exceptions.UndefinedMetricWarning [source] Warning used when the metric is invalid Changed in version 0.18: Moved from sklearn.base.

exceptions.NotFittedError

class sklearn.exceptions.NotFittedError [source] Exception class to raise if estimator is used before fitting. This class inherits from both ValueError and AttributeError to help with exception handling and backward compatibility. Examples >>> from sklearn.svm import LinearSVC >>> from sklearn.exceptions import NotFittedError >>> try: ... LinearSVC().predict([[1, 2], [2, 3], [3, 4]]) ... except NotFittedError as e: ... print(repr(e)) ...

exceptions.NonBLASDotWarning

class sklearn.exceptions.NonBLASDotWarning [source] Warning used when the dot operation does not use BLAS. This warning is used to notify the user that BLAS was not used for dot operation and hence the efficiency may be affected. Changed in version 0.18: Moved from sklearn.utils.validation, extends EfficiencyWarning.

exceptions.FitFailedWarning

class sklearn.exceptions.FitFailedWarning [source] Warning class used if there is an error while fitting the estimator. This Warning is used in meta estimators GridSearchCV and RandomizedSearchCV and the cross-validation helper function cross_val_score to warn when there is an error while fitting the estimator. Examples >>> from sklearn.model_selection import GridSearchCV >>> from sklearn.svm import LinearSVC >>> from sklearn.exceptions import FitFailedWarning >

exceptions.DataDimensionalityWarning

class sklearn.exceptions.DataDimensionalityWarning [source] Custom warning to notify potential issues with data dimensionality. For example, in random projection, this warning is raised when the number of components, which quantifies the dimensionality of the target projection space, is higher than the number of features, which quantifies the dimensionality of the original source space, to imply that the dimensionality of the problem will not be reduced. Changed in version 0.18: Moved from

exceptions.EfficiencyWarning

class sklearn.exceptions.EfficiencyWarning [source] Warning used to notify the user of inefficient computation. This warning notifies the user that the efficiency may not be optimal due to some reason which may be included as a part of the warning message. This may be subclassed into a more specific Warning class. New in version 0.18.

exceptions.DataConversionWarning

class sklearn.exceptions.DataConversionWarning [source] Warning used to notify implicit data conversions happening in the code. This warning occurs when some input data needs to be converted or interpreted in a way that may not match the user?s expectations. For example, this warning may occur when the user passes an integer array to a function which expects float input and will convert the input requests a non-copying operation, but a copy is required to meet the implementation?s data-typ

exceptions.ChangedBehaviorWarning

class sklearn.exceptions.ChangedBehaviorWarning [source] Warning class used to notify the user of any change in the behavior. Changed in version 0.18: Moved from sklearn.base.

exceptions.ConvergenceWarning

class sklearn.exceptions.ConvergenceWarning [source] Custom warning to capture convergence problems Changed in version 0.18: Moved from sklearn.utils. Examples using sklearn.exceptions.ConvergenceWarning Sparse recovery: feature selection for sparse linear models