public class RegressionModelBuilder<OUTPUT extends Tensor>
extends java.lang.Object
RegressionModel
Constructor and Description |
---|
RegressionModelBuilder(DoubleTensor inputTrainingData,
OUTPUT outputTrainingData,
java.util.function.Function<DoubleVertex,LinearRegressionGraph.OutputVertices<OUTPUT>> outputTransform) |
Modifier and Type | Method and Description |
---|---|
RegressionModel<OUTPUT> |
build() |
RegressionModel<OUTPUT> |
buildWithoutFitting() |
RegressionModelBuilder |
withPriorOnIntercept(double mean,
double scaleParameter) |
RegressionModelBuilder |
withPriorOnIntercept(DoubleTensor mean,
DoubleTensor scaleParameter) |
RegressionModelBuilder |
withPriorOnIntercept(DoubleVertex mean,
DoubleVertex scaleParameter)
Set the input parameters to the distribution describing the prior belief about the intercept of the regression model
|
RegressionModelBuilder |
withPriorOnWeights(double means,
double scaleParameters) |
RegressionModelBuilder |
withPriorOnWeights(DoubleTensor means,
DoubleTensor scaleParameters) |
RegressionModelBuilder |
withPriorOnWeights(DoubleVertex means,
DoubleVertex scaleParameters)
Set the input parameters to the distribution describing the prior belief about the weights of the regression model
|
RegressionModelBuilder |
withPriorOnWeightsAndIntercept(double mean,
double scaleParameter)
Set the input parameters to the distribution describing the prior belief about both the intercept and weights of the regression model
|
RegressionModelBuilder |
withRegularization(RegressionRegularization regularization) |
RegressionModelBuilder |
withSampling(SamplingModelFitting sampling)
Optional - use a sampling algorithm to fit the model instead of the default, which is gradient optimization.
|
public RegressionModelBuilder(DoubleTensor inputTrainingData, OUTPUT outputTrainingData, java.util.function.Function<DoubleVertex,LinearRegressionGraph.OutputVertices<OUTPUT>> outputTransform)
public RegressionModelBuilder withRegularization(RegressionRegularization regularization)
public RegressionModelBuilder withPriorOnWeights(DoubleVertex means, DoubleVertex scaleParameters)
means
- An array of means of the distribution describing the prior belief about the regression weightsscaleParameters
- An array of scale parameters of the distribution describing the prior belief about the regression weights.
This will represent sigmas if no or ridge regularization is used and will represent betas if lasso regularization is used.public RegressionModelBuilder withPriorOnWeights(DoubleTensor means, DoubleTensor scaleParameters)
public RegressionModelBuilder withPriorOnWeights(double means, double scaleParameters)
public RegressionModelBuilder withPriorOnIntercept(DoubleVertex mean, DoubleVertex scaleParameter)
mean
- The mean of the distribution describing the prior belief about the regression interceptscaleParameter
- The scale parameter of the distribution describing the prior belief about the regression intercept.
This will represent sigmas if no or ridge regularization is used and will represent betas if lasso regularization is used.public RegressionModelBuilder withPriorOnIntercept(DoubleTensor mean, DoubleTensor scaleParameter)
public RegressionModelBuilder withPriorOnIntercept(double mean, double scaleParameter)
public RegressionModelBuilder withPriorOnWeightsAndIntercept(double mean, double scaleParameter)
mean
- The mean of the distribution describing the prior belief about both the regression intercept and weightsscaleParameter
- The scale parameter of the distribution describing the prior belief about both regression intercept and weights.
This will represent sigmas if no or ridge regularization is used and will represent betas if lasso regularization is used.public RegressionModelBuilder withSampling(SamplingModelFitting sampling)
sampling
- Defines the number of samples to take and the algorithm to use, e.g. MetropolisHastings
public RegressionModel<OUTPUT> build()
public RegressionModel<OUTPUT> buildWithoutFitting()