Package org.pepstock.charba.client.ml
Class RegressionBuilder
- java.lang.Object
-
- org.pepstock.charba.client.ml.AbstractBuilder<RegressionBuilder>
-
- org.pepstock.charba.client.ml.RegressionBuilder
-
public final class RegressionBuilder extends AbstractBuilder<RegressionBuilder>
Builds regressions instances.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IsRegression
build(IsRegression regression)
Creates new regression instance, using the passed regression instance.static IsRegression
build(RegressionDescriptor descriptor)
Creates new regression, using the passed regression descriptor instance to create new regression.ExponentialRegression
buildExponentialRegression()
Creates a exponential regression.LinearRegression
buildLinearRegression()
Creates a simple linear regression.PolynomialRegression
buildPolynomialRegression()
Creates a polynomial regression.
It uses the default degree, 2.PolynomialRegression
buildPolynomialRegression(int degree)
Creates a polynomial regression.PowerRegression
buildPowerRegression()
Creates a power regression.RobustPolynomialRegression
buildRobustPolynomialRegression()
Creates a robust polynomial regression.
It uses the default degree, 2.RobustPolynomialRegression
buildRobustPolynomialRegression(int degree)
Creates a robust polynomial regression.TheilSenRegression
buildTheilSenRegression()
Creates a TheilSen regression.static RegressionBuilder
create()
Creates new regression builder, without any sample.static RegressionBuilder
create(List<Double> x, List<Double> y)
Creates new regression builder, using the passed data as samples.static RegressionBuilder
create(IsRegression regression)
Creates new regression builder, using the passed regression instance.static RegressionBuilder
create(RegressionDescriptor descriptor)
Creates new regression builder, using the passed regression descriptor instance to create new regression.-
Methods inherited from class org.pepstock.charba.client.ml.AbstractBuilder
setSamples, setSamples, setSamples, setSamples, setSamplesByDataPoints, setSamplesByDates, setSamplesByTimeSeriesItems
-
-
-
-
Method Detail
-
create
public static RegressionBuilder create()
Creates new regression builder, without any sample.- Returns:
- new regression builder, without any sample
-
create
public 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 regressiony
- Y values to use to create the regression- Returns:
- new regression builder
-
create
public static RegressionBuilder create(IsRegression regression)
Creates new regression builder, using the passed regression instance.- Parameters:
regression
- regression instance to clone- Returns:
- new regression builder
-
create
public 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
-
build
public static IsRegression build(IsRegression regression)
Creates new regression instance, using the passed regression instance.- Parameters:
regression
- regression instance to clone- Returns:
- new regression
-
build
public 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
-
buildLinearRegression
public LinearRegression buildLinearRegression()
Creates a simple linear regression.- Returns:
- simple linear regression instance
-
buildPolynomialRegression
public PolynomialRegression buildPolynomialRegression()
Creates a polynomial regression.
It uses the default degree, 2.- Returns:
- polynomial regression instance
-
buildPolynomialRegression
public PolynomialRegression buildPolynomialRegression(int degree)
Creates a polynomial regression.- Parameters:
degree
- the maximum degree of the polynomial- Returns:
- polynomial regression instance
-
buildPowerRegression
public PowerRegression buildPowerRegression()
Creates a power regression.- Returns:
- power regression instance
-
buildExponentialRegression
public ExponentialRegression buildExponentialRegression()
Creates a exponential regression.- Returns:
- exponential regression instance
-
buildTheilSenRegression
public TheilSenRegression buildTheilSenRegression()
Creates a TheilSen regression.- Returns:
- TheilSen regression instance
-
buildRobustPolynomialRegression
public RobustPolynomialRegression buildRobustPolynomialRegression()
Creates a robust polynomial regression.
It uses the default degree, 2.- Returns:
- robust polynomial regression instance
-
buildRobustPolynomialRegression
public RobustPolynomialRegression buildRobustPolynomialRegression(int degree)
Creates a robust polynomial regression.- Parameters:
degree
- the maximum degree of the robust polynomial- Returns:
- robust polynomial regression instance
-
-