Package org.pepstock.charba.client.ml
Interface IsRegression
- 
- All Known Implementing Classes:
- ExponentialRegression,- LinearRegression,- PolynomialRegression,- PowerRegression,- RobustPolynomialRegression,- TheilSenRegression
 
 public interface IsRegressionMaps all common methods of a regression.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T extends IsRegression>
 TcheckAndGetIfValid(T regression)Checks if regression passed as argument is notnulland if consistent as well.
 If not, throw aIllegalArgumentException, otherwise it returns the regression.static voidcheckIfValid(IsRegression regression)Checks if regression passed as argument is notnulland if consistent as well.
 If not, throw aIllegalArgumentException.List<Double>getCoefficients()Returns all calculated coefficients as a list.RegressionDescriptorgetDescriptor()Returns the regression descriptor.RegressionTypegetType()Returns the regression type.booleanisConsistent()Returnstrueif the regression is consistent and usable.doublepredict(double x)Returns the Y value, calculated by the regression formula at specific X value.List<Double>predict(double... xValues)Returns a list of Y values, calculated by the regression formula for specific X values.doublepredict(Date x)Returns the Y value, calculated by the regression formula at specific X value.List<Double>predict(List<Double> xValues)Returns a list of Y values, calculated by the regression formula for specific X values.doublepredict(DataPoint dataPoint)Returns the Y value, calculated by the regression formula at specific X value.doublepredict(TimeSeriesItem item)Returns the Y value, calculated by the regression formula at specific X value.List<Double>predictByDataPoints(List<DataPoint> dataPoints)Returns a list of Y values, calculated by the regression formula for specific X values.List<Double>predictByDataPoints(DataPoint... dataPoints)Returns a list of Y values, calculated by the regression formula for specific X values.List<Double>predictByDates(Date... xValues)Returns a list of Y values, calculated by the regression formula for specific X values.List<Double>predictByDates(List<Date> xValues)Returns a list of Y values, calculated by the regression formula for specific X values.List<Double>predictByTimeSeriesItems(List<TimeSeriesItem> items)Returns a list of Y values, calculated by the regression formula for specific X values.List<Double>predictByTimeSeriesItems(TimeSeriesItem... items)Returns a list of Y values, calculated by the regression formula for specific X values.RegressionScorescore(List<Double> y)Evaluates the regression formula if the model fits enough.
 X values are creating starting from 0 with increment of 1.RegressionScorescore(List<Double> y, double starting)Evaluates the regression formula if the model fits enough.
 X values are creating starting from passed argument with increment of 1.RegressionScorescore(List<Double> y, double starting, double increment)Evaluates the regression formula if the model fits enough.
 X values are creating starting from passed argument with increment of passed argument.RegressionScorescore(List<Double> x, List<Double> y)Evaluates the regression formula if the model fits enough.RegressionScorescoreByDataPoints(List<DataPoint> dataPoints)Evaluates the regression formula if the model fits enough.RegressionScorescoreByDate(List<Date> x, List<Double> y)Evaluates the regression formula if the model fits enough.RegressionScorescoreByTimeSeriesItems(List<TimeSeriesItem> items)Evaluates the regression formula if the model fits enough.StringtoFormula()Returns the formula of the regression.StringtoFormula(int precision)Returns the formula of the regression, using the requested precision.StringtoLaTeX()Returns the formula of the regression.StringtoLaTeX(int precision)Returns the formula of the regression, using the requested precision.
 
- 
- 
- 
Method Detail- 
checkIfValidstatic void checkIfValid(IsRegression regression) Checks if regression passed as argument is notnulland if consistent as well.
 If not, throw aIllegalArgumentException.- Parameters:
- regression- regression to be checked
 
 - 
checkAndGetIfValidstatic <T extends IsRegression> T checkAndGetIfValid(T regression) Checks if regression passed as argument is notnulland if consistent as well.
 If not, throw aIllegalArgumentException, otherwise it returns the regression.- Type Parameters:
- T- type of regression
- Parameters:
- regression- regression to be checked
- Returns:
- the same regression passed as argument
 
 - 
getTypeRegressionType getType() Returns the regression type.- Returns:
- the regression type
 
 - 
getDescriptorRegressionDescriptor getDescriptor() Returns the regression descriptor.- Returns:
- the regression descriptor
 
 - 
getCoefficientsList<Double> getCoefficients() Returns all calculated coefficients as a list.- Returns:
- all calculated coefficients as a list
 
 - 
isConsistentboolean isConsistent() Returnstrueif the regression is consistent and usable.- Returns:
- trueif the regression is consistent and usable
 
 - 
predictdouble predict(double x) Returns the Y value, calculated by the regression formula at specific X value.- Parameters:
- x- value to use to get the predicted value
- Returns:
- the Y value, calculated by the regression formula at specific X value
 
 - 
predictdouble predict(Date x) Returns the Y value, calculated by the regression formula at specific X value.- Parameters:
- x- value to use to get the predicted value
- Returns:
- the Y value, calculated by the regression formula at specific X value
 
 - 
predictdouble predict(DataPoint dataPoint) Returns the Y value, calculated by the regression formula at specific X value.- Parameters:
- dataPoint- value to use to get the predicted value
- Returns:
- the Y value, calculated by the regression formula at specific X value
 
 - 
predictdouble predict(TimeSeriesItem item) Returns the Y value, calculated by the regression formula at specific X value.- Parameters:
- item- value to use to get the predicted value
- Returns:
- the Y value, calculated by the regression formula at specific X value
 
 - 
predictList<Double> predict(double... xValues) Returns a list of Y values, calculated by the regression formula for specific X values.- Parameters:
- xValues- values to use to get the predicted values
- Returns:
- a list of Y values, calculated by the regression formula for specific X values
 
 - 
predictList<Double> predict(List<Double> xValues) Returns a list of Y values, calculated by the regression formula for specific X values.- Parameters:
- xValues- values to use to get the predicted values
- Returns:
- a list of Y values, calculated by the regression formula for specific X values
 
 - 
predictByDatesList<Double> predictByDates(Date... xValues) Returns a list of Y values, calculated by the regression formula for specific X values.- Parameters:
- xValues- values to use to get the predicted values
- Returns:
- a list of Y values, calculated by the regression formula for specific X values
 
 - 
predictByDatesList<Double> predictByDates(List<Date> xValues) Returns a list of Y values, calculated by the regression formula for specific X values.- Parameters:
- xValues- values to use to get the predicted values
- Returns:
- a list of Y values, calculated by the regression formula for specific X values
 
 - 
predictByDataPointsList<Double> predictByDataPoints(DataPoint... dataPoints) Returns a list of Y values, calculated by the regression formula for specific X values.- Parameters:
- dataPoints- values to use to get the predicted values
- Returns:
- a list of Y values, calculated by the regression formula for specific X values
 
 - 
predictByDataPointsList<Double> predictByDataPoints(List<DataPoint> dataPoints) Returns a list of Y values, calculated by the regression formula for specific X values.- Parameters:
- dataPoints- values to use to get the predicted values
- Returns:
- a list of Y values, calculated by the regression formula for specific X values
 
 - 
predictByTimeSeriesItemsList<Double> predictByTimeSeriesItems(TimeSeriesItem... items) Returns a list of Y values, calculated by the regression formula for specific X values.- Parameters:
- items- values to use to get the predicted values
- Returns:
- a list of Y values, calculated by the regression formula for specific X values
 
 - 
predictByTimeSeriesItemsList<Double> predictByTimeSeriesItems(List<TimeSeriesItem> items) Returns a list of Y values, calculated by the regression formula for specific X values.- Parameters:
- items- values to use to get the predicted values
- Returns:
- a list of Y values, calculated by the regression formula for specific X values
 
 - 
scoreRegressionScore score(List<Double> y) Evaluates the regression formula if the model fits enough.
 X values are creating starting from 0 with increment of 1.- Parameters:
- y- Y values to use for evaluation
- Returns:
- the score of the regression
 
 - 
scoreRegressionScore score(List<Double> y, double starting) Evaluates the regression formula if the model fits enough.
 X values are creating starting from passed argument with increment of 1.- Parameters:
- y- Y values to use for evaluation
- starting- starting value to create X values
- Returns:
- the score of the regression
 
 - 
scoreRegressionScore score(List<Double> y, double starting, double increment) Evaluates the regression formula if the model fits enough.
 X values are creating starting from passed argument with increment of passed argument.- Parameters:
- y- Y values to use for evaluation
- starting- starting value to create X values
- increment- increment to apply to the starting value
- Returns:
- the score of the regression
 
 - 
scoreRegressionScore score(List<Double> x, List<Double> y) Evaluates the regression formula if the model fits enough.- Parameters:
- x- X values to use for evaluation
- y- Y values to use for evaluation
- Returns:
- the score of the regression
 
 - 
scoreByDateRegressionScore scoreByDate(List<Date> x, List<Double> y) Evaluates the regression formula if the model fits enough.- Parameters:
- x- X values to use for evaluation
- y- Y values to use for evaluation
- Returns:
- the score of the regression
 
 - 
scoreByDataPointsRegressionScore scoreByDataPoints(List<DataPoint> dataPoints) Evaluates the regression formula if the model fits enough.- Parameters:
- dataPoints- X and Y values to use for evaluation
- Returns:
- the score of the regression
 
 - 
scoreByTimeSeriesItemsRegressionScore scoreByTimeSeriesItems(List<TimeSeriesItem> items) Evaluates the regression formula if the model fits enough.- Parameters:
- items- X and Y values to use for evaluation
- Returns:
- the score of the regression
 
 - 
toFormulaString toFormula() Returns the formula of the regression.- Returns:
- the formula of the regression
 
 - 
toFormulaString toFormula(int precision) Returns the formula of the regression, using the requested precision.- Parameters:
- precision- precision to apply to the numbers of the formula
- Returns:
- the formula of the regression
 
 - 
toLaTeXString toLaTeX() Returns the formula of the regression.- Returns:
- the formula of the regression
 
 - 
toLaTeXString toLaTeX(int precision) Returns the formula of the regression, using the requested precision.- Parameters:
- precision- precision to apply to the numbers of the formula
- Returns:
- the formula of the regression
 
 
- 
 
-