public class RANSAC extends Object implements Regressor, Parameterized
Constructor and Description |
---|
RANSAC(Regressor baseRegressor,
int iterations,
int initialTrainSize,
int minResultSize,
double maxPointError)
Creates a new RANSAC training object.
|
Modifier and Type | Method and Description |
---|---|
RANSAC |
clone() |
Regressor |
getBaseRegressorClone()
Once RANSAC is complete, it maintains its trained version of the
finalized regressor.
|
boolean[] |
getConsensusSet()
Returns an boolean array where the indices correspond to data points in
the original training set.
|
int |
getInitialTrainSize()
Returns the number of data points to be sampled from the training set to
create initial models.
|
int |
getIterations()
Returns the number models that will be tested on the data set.
|
double |
getMaxPointError()
Each data point not in the initial training set will be tested against.
|
int |
getMinResultSize()
RANSAC requires an initial model to be accurate enough to include a
minimum number of inliers before being considered as a potentially good
model.
|
double |
getModelError()
Returns the model error, which is the average absolute difference between
the model and all points in the set of inliers.
|
Parameter |
getParameter(String paramName)
Returns the parameter with the given name.
|
List<Parameter> |
getParameters()
Returns the list of parameters that can be altered for this learner.
|
double |
regress(DataPoint data) |
void |
setInitialTrainSize(int initialTrainSize)
Sets the number of data points to be sampled from the training set to
create initial models.
|
void |
setIterations(int iterations)
Sets the number models that will be tested on the data set.
|
void |
setMaxPointError(double maxPointError)
Each data point not in the initial training set will be tested against.
|
void |
setMinResultSize(int minResultSize)
RANSAC requires an initial model to be accurate enough to include a
minimum number of inliers before being considered as a potentially good
model.
|
boolean |
supportsWeightedData() |
void |
train(RegressionDataSet dataSet) |
void |
train(RegressionDataSet dataSet,
ExecutorService threadPool) |
public RANSAC(Regressor baseRegressor, int iterations, int initialTrainSize, int minResultSize, double maxPointError)
baseRegressor
- the model to fit using RANSACiterations
- the number of iterations of the algorithm to performinitialTrainSize
- the number of points to seed each iteration of
training withminResultSize
- the minimum number of inliers to make it into the
model to be considered a possible fit.maxPointError
- the maximum allowed absolute difference in the
output of the model and the true value for the data point to be added to
the inlier set.public List<Parameter> getParameters()
Parameterized
getParameters
in interface Parameterized
public Parameter getParameter(String paramName)
Parameterized
getParameter
in interface Parameterized
paramName
- the name of the parameter to obtainpublic int getInitialTrainSize()
public void setInitialTrainSize(int initialTrainSize)
initialTrainSize
- the number of data points to use to create modelspublic int getIterations()
public void setIterations(int iterations)
iterations
- the number of iterations to performpublic double getMaxPointError()
public void setMaxPointError(double maxPointError)
maxPointError
- the new maximum error a data point may have to be
considered an inlier.public int getMinResultSize()
public void setMinResultSize(int minResultSize)
minResultSize
- the minimum number of inliers to be consideredpublic void train(RegressionDataSet dataSet, ExecutorService threadPool)
public void train(RegressionDataSet dataSet)
public boolean supportsWeightedData()
supportsWeightedData
in interface Regressor
public RANSAC clone()
public Regressor getBaseRegressorClone()
public boolean[] getConsensusSet()
public double getModelError()
Double.POSITIVE_INFINITY
if the model has not been trained or
failed to fit.Copyright © 2017. All rights reserved.