Package org.pepstock.charba.client.ml
Class RegressionDatasetBuilder
- java.lang.Object
- 
- org.pepstock.charba.client.ml.RegressionDatasetBuilder
 
- 
 public final class RegressionDatasetBuilder extends Object Builds regressions datasets instances.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RegressionDatasetbuild(RegressionDataset dataset)Creates new regression dataset cloning the passed dataset.
 The options and the data are NOT cloned.RegressionDatasetbuildExponentialRegression()Creates a regression dataset, to add to a chart.RegressionDatasetbuildLinearRegression()Creates a regression dataset, to add to a chart.RegressionDatasetbuildPolynomialRegression()Creates a regression dataset, to add to a chart.
 It uses the default degree, 2.RegressionDatasetbuildPolynomialRegression(int degree)Creates a regression dataset, to add to a chart, using the passed maximum degree.RegressionDatasetbuildPowerRegression()Creates a regression dataset, to add to a chart.RegressionDatasetbuildRobustPolynomialRegression()Creates a regression dataset, to add to a chart.
 It uses the default degree, 2.RegressionDatasetbuildRobustPolynomialRegression(int degree)Creates a regression dataset, to add to a chart, using the passed maximum degree.RegressionDatasetbuildTheilSenRegression()Creates a regression dataset, to add to a chart.static RegressionDatasetBuildercreate()Creates new regression dataset builder, without any sample.static RegressionDatasetBuildercreate(List<Double> x, List<Double> y)Creates new regression dataset builder, using the passed data as samples.RegressionDatasetBuildersetHidden(boolean hidden)Setstrueif the dataset will be created in hidden status.RegressionDatasetBuildersetLoadData(boolean loadData)Setstrueif the samples will be loaded as dataset data.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.RegressionDatasetBuildersetSamples(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.RegressionDatasetBuildersetSamples(List<Double> x, List<Double> y)Creates a simple linear regression, using the passed X and Y values.RegressionDatasetBuildersetSamples(HasDataPoints dataset)Sets the samples by the passed dataset,DataPointbased, data as source.RegressionDatasetBuildersetSamples(HasTimeSeriesItems dataset)Sets the samples by the passed time series dataset,TimeSeriesItembased, data as source.RegressionDatasetBuildersetSamplesByDataPoints(List<DataPoint> dataPoints)Sets the samples by the passedDataPoints.RegressionDatasetBuildersetSamplesByDates(List<Date> x, List<Double> y)Sets the samples by the passed X and Y values.RegressionDatasetBuildersetSamplesByTimeSeriesItems(List<TimeSeriesItem> items)Sets the samples by the passedTimeSeriesItems.
 
- 
- 
- 
Method Detail- 
createpublic static RegressionDatasetBuilder create() Creates new regression dataset builder, without any sample.- Returns:
- new regression dataset builder, without any sample
 
 - 
createpublic static RegressionDatasetBuilder create(List<Double> x, List<Double> y) Creates new regression dataset 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 dataset builder
 
 - 
buildpublic static RegressionDataset build(RegressionDataset dataset) Creates new regression dataset cloning the passed dataset.
 The options and the data are NOT cloned.- Parameters:
- dataset- dataset to clone.
- Returns:
- new regression dataset instance
 
 - 
setLoadDatapublic RegressionDatasetBuilder setLoadData(boolean loadData) Setstrueif the samples will be loaded as dataset data.- Parameters:
- loadData-- trueif the samples will be loaded as dataset data
- Returns:
- new regression dataset builder
 
 - 
setHiddenpublic RegressionDatasetBuilder setHidden(boolean hidden) Setstrueif the dataset will be created in hidden status.- Parameters:
- hidden-- trueif the dataset will be created in hidden status
- Returns:
- new regression dataset builder
 
 - 
setSamplespublic RegressionDatasetBuilder 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
 
 - 
setSamplespublic RegressionDatasetBuilder setSamples(HasDataPoints dataset) Sets the samples by the passed dataset,DataPointbased, data as source.- Parameters:
- dataset- dataset instance to use getting data as source
- Returns:
- new regression dataset builder
 
 - 
setSamplesByDataPointspublic RegressionDatasetBuilder setSamplesByDataPoints(List<DataPoint> dataPoints) Sets the samples by the passedDataPoints.- Parameters:
- dataPoints- data points list to use for creating the regression
- Returns:
- new regression dataset builder
 
 - 
setSamplespublic RegressionDatasetBuilder setSamples(HasTimeSeriesItems dataset) Sets the samples by the passed time series dataset,TimeSeriesItembased, data as source.- Parameters:
- dataset- dataset instance to use getting data as source
- Returns:
- new regression dataset builder
 
 - 
setSamplesByTimeSeriesItemspublic RegressionDatasetBuilder setSamplesByTimeSeriesItems(List<TimeSeriesItem> items) Sets the samples by the passedTimeSeriesItems.- Parameters:
- items- time series items list to use for creating the regression
- Returns:
- new regression dataset builder
 
 - 
setSamplespublic RegressionDatasetBuilder setSamples(List<Double> 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
 
 - 
setSamplesByDatespublic RegressionDatasetBuilder setSamplesByDates(List<Date> x, List<Double> y) Sets the samples by 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:
- new regression dataset builder
 
 - 
buildLinearRegressionpublic RegressionDataset buildLinearRegression() Creates a regression dataset, to add to a chart.- Returns:
- regression dataset to add to a chart
 
 - 
buildPolynomialRegressionpublic RegressionDataset buildPolynomialRegression() Creates a regression dataset, to add to a chart.
 It uses the default degree, 2.- Returns:
- regression dataset to add to a chart
 
 - 
buildPolynomialRegressionpublic RegressionDataset buildPolynomialRegression(int degree) Creates a regression dataset, to add to a chart, using the passed maximum degree.- Parameters:
- degree- the maximum degree of the polynomial
- Returns:
- regression dataset to add to a chart
 
 - 
buildPowerRegressionpublic RegressionDataset buildPowerRegression() Creates a regression dataset, to add to a chart.- Returns:
- regression dataset to add to a chart
 
 - 
buildExponentialRegressionpublic RegressionDataset buildExponentialRegression() Creates a regression dataset, to add to a chart.- Returns:
- regression dataset to add to a chart
 
 - 
buildTheilSenRegressionpublic RegressionDataset buildTheilSenRegression() Creates a regression dataset, to add to a chart.- Returns:
- regression dataset to add to a chart
 
 - 
buildRobustPolynomialRegressionpublic RegressionDataset buildRobustPolynomialRegression() Creates a regression dataset, to add to a chart.
 It uses the default degree, 2.- Returns:
- regression dataset to add to a chart
 
 - 
buildRobustPolynomialRegressionpublic RegressionDataset buildRobustPolynomialRegression(int degree) Creates a regression dataset, to add to a chart, using the passed maximum degree.- Parameters:
- degree- the maximum degree of the robust polynomial
- Returns:
- regression dataset to add to a chart
 
 - 
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
 
 
- 
 
-