Package org.pepstock.charba.client.ml
Class RegressionBuilder
- java.lang.Object
- 
- org.pepstock.charba.client.ml.RegressionBuilder
 
- 
 public final class RegressionBuilder extends Object Builds regressions instances.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IsRegressionbuild(IsRegression regression)Creates new regression instance, using the passed regression instance.static IsRegressionbuild(RegressionDescriptor descriptor)Creates new regression, using the passed regression descriptor instance to create new regression.ExponentialRegressionbuildExponentialRegression()Creates a exponential regression.LinearRegressionbuildLinearRegression()Creates a simple linear regression.PolynomialRegressionbuildPolynomialRegression()Creates a polynomial regression.
 It uses the default degree, 2.PolynomialRegressionbuildPolynomialRegression(int degree)Creates a polynomial regression.PowerRegressionbuildPowerRegression()Creates a power regression.RobustPolynomialRegressionbuildRobustPolynomialRegression()Creates a robust polynomial regression.
 It uses the default degree, 2.RobustPolynomialRegressionbuildRobustPolynomialRegression(int degree)Creates a robust polynomial regression.TheilSenRegressionbuildTheilSenRegression()Creates a TheilSen regression.static RegressionBuildercreate()Creates new regression builder, without any sample.static RegressionBuildercreate(List<Double> x, List<Double> y)Creates new regression builder, using the passed data as samples.static RegressionBuildercreate(IsRegression regression)Creates new regression builder, using the passed regression instance.static RegressionBuildercreate(RegressionDescriptor descriptor)Creates new regression builder, using the passed regression descriptor instance to create new regression.TsetSamples(List<Double> y)Sets samples, using the passed Y values.
 X values are creating starting from 0 with increment of 1.TsetSamples(List<Double> y, double starting)Sets samples, using the passed Y values.
 X values are creating starting from passed argument with increment of 1.TsetSamples(List<Double> y, double starting, double increment)Sets samples, using the passed Y values.
 X values are creating starting from passed argument with increment of passed argument.TsetSamples(List<Double> x, List<Double> y)Creates a simple linear regression, using the passed X and Y values.TsetSamplesByDataPoints(List<DataPoint> dataPoints)Creates a simple linear regression, using the passedDataPoints.TsetSamplesByDates(List<Date> x, List<Double> y)Creates a simple linear regression, using the passed X and Y values.TsetSamplesByTimeSeriesItems(List<TimeSeriesItem> items)Creates a simple linear regression, using the passedTimeSeriesItems.
 
- 
- 
- 
Method Detail- 
createpublic static RegressionBuilder create() Creates new regression builder, without any sample.- Returns:
- new regression builder, without any sample
 
 - 
createpublic static RegressionBuilder create(List<Double> x, List<Double> y) Creates new regression builder, using the passed data as samples.- Parameters:
- x- X values to use to create the regression
- y- Y values to use to create the regression
- Returns:
- new regression builder
 
 - 
createpublic static RegressionBuilder create(IsRegression regression) Creates new regression builder, using the passed regression instance.- Parameters:
- regression- regression instance to clone
- Returns:
- new regression builder
 
 - 
createpublic static RegressionBuilder create(RegressionDescriptor descriptor) Creates new regression builder, using the passed regression descriptor instance to create new regression.- Parameters:
- descriptor- regression descriptor instance to create new regression
- Returns:
- new regression builder
 
 - 
buildpublic static IsRegression build(IsRegression regression) Creates new regression instance, using the passed regression instance.- Parameters:
- regression- regression instance to clone
- Returns:
- new regression
 
 - 
buildpublic static IsRegression build(RegressionDescriptor descriptor) Creates new regression, using the passed regression descriptor instance to create new regression.- Parameters:
- descriptor- regression descriptor instance to create new regression
- Returns:
- new regression
 
 - 
buildLinearRegressionpublic LinearRegression buildLinearRegression() Creates a simple linear regression.- Returns:
- simple linear regression instance
 
 - 
buildPolynomialRegressionpublic PolynomialRegression buildPolynomialRegression() Creates a polynomial regression.
 It uses the default degree, 2.- Returns:
- polynomial regression instance
 
 - 
buildPolynomialRegressionpublic PolynomialRegression buildPolynomialRegression(int degree) Creates a polynomial regression.- Parameters:
- degree- the maximum degree of the polynomial
- Returns:
- polynomial regression instance
 
 - 
buildPowerRegressionpublic PowerRegression buildPowerRegression() Creates a power regression.- Returns:
- power regression instance
 
 - 
buildExponentialRegressionpublic ExponentialRegression buildExponentialRegression() Creates a exponential regression.- Returns:
- exponential regression instance
 
 - 
buildTheilSenRegressionpublic TheilSenRegression buildTheilSenRegression() Creates a TheilSen regression.- Returns:
- TheilSen regression instance
 
 - 
buildRobustPolynomialRegressionpublic RobustPolynomialRegression buildRobustPolynomialRegression() Creates a robust polynomial regression.
 It uses the default degree, 2.- Returns:
- robust polynomial regression instance
 
 - 
buildRobustPolynomialRegressionpublic RobustPolynomialRegression buildRobustPolynomialRegression(int degree) Creates a robust polynomial regression.- Parameters:
- degree- the maximum degree of the robust polynomial
- Returns:
- robust polynomial regression instance
 
 - 
setSamplespublic final T setSamples(List<Double> y) Sets samples, using the passed Y values.
 X values are creating starting from 0 with increment of 1.- Parameters:
- y- Y values to use to create the regression
- Returns:
- regression builder
 
 - 
setSamplespublic final T setSamples(List<Double> y, double starting) Sets samples, using the passed Y values.
 X values are creating starting from passed argument with increment of 1.- Parameters:
- y- Y values to use to create the regression
- starting- starting value to create X values
- Returns:
- regression builder instance
 
 - 
setSamplespublic T setSamples(List<Double> y, double starting, double increment) Sets samples, using the passed Y values.
 X values are creating starting from passed argument with increment of passed argument.- Parameters:
- y- Y values to use to create the regression
- starting- starting value to create X values
- increment- increment to apply to the starting value
- Returns:
- regression builder instance
 
 - 
setSamplesByDatespublic T setSamplesByDates(List<Date> x, List<Double> y) Creates a simple linear regression, using the passed X and Y values.- Parameters:
- x- X values to use to create the regression
- y- Y values to use to create the regression
- Returns:
- regression builder instance
 
 - 
setSamplesByDataPointspublic T setSamplesByDataPoints(List<DataPoint> dataPoints) Creates a simple linear regression, using the passedDataPoints.- Parameters:
- dataPoints- data points to use to create the regression
- Returns:
- regression builder instance
 
 - 
setSamplesByTimeSeriesItemspublic T setSamplesByTimeSeriesItems(List<TimeSeriesItem> items) Creates a simple linear regression, using the passedTimeSeriesItems.- Parameters:
- items- time series items to use to create the regression
- Returns:
- regression builder instance
 
 
- 
 
-