fixed a bug in RegressionRegularization - don't ignore paramaters
Also labelled the vertices for clearer debugging
@@ -12,10 +12,10 @@ import io.improbable.keanu.vertices.dbl.probabilistic.LaplaceVertex;
public enum RegressionRegularization {
NONE {
public DoubleVertex getWeightsVertex(long featureCount, double[] priorOnWeightsMeans, double[] priorOnInterceptScaleParameter) {
- return new GaussianVertex(new long[]{1, featureCount}, ConstantVertex.of(DEFAULT_MU), ConstantVertex.of(DEFAULT_SCALE_PARAMETER));
+ return new GaussianVertex(new long[]{1, featureCount}, ConstantVertex.of(priorOnWeightsMeans), ConstantVertex.of(priorOnInterceptScaleParameter)).setLabel("weights");
}
public DoubleVertex getInterceptVertex(Double priorOnInterceptMean, Double priorOnInterceptScaleParameter) {
- return new GaussianVertex(DEFAULT_MU, DEFAULT_SCALE_PARAMETER);
+ return new GaussianVertex(priorOnInterceptMean, priorOnInterceptScaleParameter).setLabel("intercept");
}
public <INPUT, OUTPUT> ModelFitter<INPUT, OUTPUT> createFitterForGraph(ModelGraph<INPUT, OUTPUT> graph) {
return new MaximumLikelihoodModelFitter<>(graph);
