class sklearn.linear_model.RANSACRegressor(base_estimator=None, min_samples=None, residual_threshold=None, is_data_valid=None, is_model_valid=None, max_trials=100, max_skips=inf, stop_n_inliers=inf, stop_score=inf, stop_probability=0.99, residual_metric=None, loss=’absolute_loss’, random_state=None)
[source]
RANSAC (RANdom SAmple Consensus) algorithm.
RANSAC is an iterative algorithm for the robust estimation of parameters from a subset of inliers from the complete data set. More information can be found in the general documentation of linear models.
A detailed description of the algorithm can be found in the documentation of the linear_model
sub-package.
Read more in the User Guide.
[R182] | https://en.wikipedia.org/wiki/RANSAC |
[R183] | http://www.cs.columbia.edu/~belhumeur/courses/compPhoto/ransac.pdf |
[R184] | http://www.bmva.org/bmvc/2009/Papers/Paper355/Paper355.pdf |
fit (X, y[, sample_weight]) | Fit estimator using RANSAC algorithm. |
get_params ([deep]) | Get parameters for this estimator. |
predict (X) | Predict using the estimated model. |
score (X, y) | Returns the score of the prediction. |
set_params (**params) | Set the parameters of this estimator. |
__init__(base_estimator=None, min_samples=None, residual_threshold=None, is_data_valid=None, is_model_valid=None, max_trials=100, max_skips=inf, stop_n_inliers=inf, stop_score=inf, stop_probability=0.99, residual_metric=None, loss=’absolute_loss’, random_state=None)
[source]
fit(X, y, sample_weight=None)
[source]
Fit estimator using RANSAC algorithm.
Parameters: |
X : array-like or sparse matrix, shape [n_samples, n_features] Training data. y : array-like, shape = [n_samples] or [n_samples, n_targets] Target values. sample_weight : array-like, shape = [n_samples] Individual weights for each sample raises error if sample_weight is passed and base_estimator fit method does not support it. |
---|---|
Raises: |
ValueError : If no valid consensus set could be found. This occurs if |
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
deep : boolean, optional If True, will return the parameters for this estimator and contained subobjects that are estimators. |
---|---|
Returns: |
params : mapping of string to any Parameter names mapped to their values. |
predict(X)
[source]
Predict using the estimated model.
This is a wrapper for estimator_.predict(X)
.
Parameters: |
X : numpy array of shape [n_samples, n_features] |
---|---|
Returns: |
y : array, shape = [n_samples] or [n_samples, n_targets] Returns predicted values. |
score(X, y)
[source]
Returns the score of the prediction.
This is a wrapper for estimator_.score(X, y)
.
Parameters: |
X : numpy array or sparse matrix of shape [n_samples, n_features] Training data. y : array, shape = [n_samples] or [n_samples, n_targets] Target values. |
---|---|
Returns: |
z : float Score of the prediction. |
set_params(**params)
[source]
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter>
so that it’s possible to update each component of a nested object.
Returns: | self : |
---|
sklearn.linear_model.RANSACRegressor
© 2007–2017 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.RANSACRegressor.html