Class RansacFitter<M>

java.lang.Object
org.hipparchus.fitting.ransac.RansacFitter<M>
Type Parameters:
M - mathematical model representing the parameters to estimate

public class RansacFitter<M> extends Object
Class implementing Random sample consensus (RANSAC) algorithm.

RANSAC is a robust method for estimating the parameters of a mathematical model from a set of observed data. It works iteratively selecting random subsets of the input data, fitting a model to these subsets, and then determining how many data points from the entire set are consistent with the estimated model parameters. The model can yields the largest number of inliers (i.e., point that fit well) is considered the best estimate.

This implementation is designed to be generic and can be used with different types of models, such as polynomial models.

Since:
4.1
  • Constructor Details

    • RansacFitter

      public RansacFitter(IModelFitter<M> fitter, int sampleSize, int maxIterations, double threshold, int minInliers, int seed)
      Constructor.
      Parameters:
      fitter - mathematical model fitter
      sampleSize - minimum number of data points to estimate the model parameters
      maxIterations - maximum number of iterations allowed to fit the model
      threshold - threshold to assert that a data point fits the model
      minInliers - minimum number of close data points required to assert that the model fits the input data
      seed - seed for the random generator
  • Method Details

    • fit

      public RansacFitterOutputs<M> fit(List<Fittable> points)
      Fits the set of observed data to determine the model parameters.
      Parameters:
      points - set of observed data
      Returns:
      a java class containing the best estimate of the model parameters