|
13 | 13 | import org.apache.commons.math3.distribution.TDistribution; |
14 | 14 | import org.apache.commons.math3.special.Gamma; |
15 | 15 | import water.*; |
16 | | -import water.codegen.CodeGenerator; |
| 16 | +import water.codegen.CodeGenerator; conflict |
17 | 17 | import water.codegen.CodeGeneratorPipeline; |
18 | 18 | import water.exceptions.JCodeSB; |
19 | 19 | import water.fvec.Chunk; |
@@ -2362,7 +2362,10 @@ public double score(double[] data) { |
2362 | 2362 | classCtx.add(new CodeGenerator() { |
2363 | 2363 | @Override |
2364 | 2364 | public void generate(JCodeSB out) { |
2365 | | - JCodeGen.toClassWithArray(out, "public static", "BETA", beta_internal()); // "The Coefficients" |
| 2365 | + if (_parms._control_variables != null && _parms._control_variables.length > 0) |
| 2366 | + JCodeGen.toClassWithArray(out, "public static", "BETA", _output.getControlValBeta(beta_internal().clone())); // "The Control Variables Coefficients" |
| 2367 | + else |
| 2368 | + JCodeGen.toClassWithArray(out, "public static", "BETA", beta_internal()); // "The Coefficients" |
2366 | 2369 | JCodeGen.toClassWithArray(out, "static", "NUM_MEANS", _output._dinfo._numNAFill,"Imputed numeric values"); |
2367 | 2370 | JCodeGen.toClassWithArray(out, "static", "CAT_MODES", _output._dinfo.catNAFill(),"Imputed categorical values."); |
2368 | 2371 | JCodeGen.toStaticVar(out, "CATOFFS", dinfo()._catOffsets, "Categorical Offsets"); |
@@ -2526,18 +2529,24 @@ protected ModelMetrics.MetricBuilder scoreMetrics(Frame adaptFrm) { |
2526 | 2529 |
|
2527 | 2530 | @Override |
2528 | 2531 | public boolean haveMojo() { |
2529 | | - if (_parms._control_variables != null && _parms._control_variables.length>0) |
2530 | | - return false; |
2531 | | - if (_parms._remove_offset_effects) { |
2532 | | - return false; |
2533 | | - } |
| 2532 | + if (_parms._control_variables != null && _parms._control_variables.length > 0) |
| 2533 | + return _parms.interactionSpec() == null && |
| 2534 | + !_parms._family.equals(Family.multinomial) && |
| 2535 | + !_parms._family.equals(Family.ordinal) && |
| 2536 | + super.haveMojo(); |
2534 | 2537 | if (_parms.interactionSpec() == null) |
2535 | 2538 | return super.haveMojo(); |
2536 | 2539 | return false; |
2537 | 2540 | } |
2538 | 2541 |
|
2539 | 2542 | @Override |
2540 | 2543 | public boolean havePojo() { |
| 2544 | + if (_parms._control_variables != null && _parms._control_variables.length > 0) |
| 2545 | + return _parms.interactionSpec() == null && |
| 2546 | + _parms._offset_column == null && |
| 2547 | + !_parms._family.equals(Family.multinomial) && |
| 2548 | + !_parms._family.equals(Family.ordinal) && |
| 2549 | + super.havePojo(); |
2541 | 2550 | if (_parms.interactionSpec() == null && _parms._offset_column == null) return super.havePojo(); |
2542 | 2551 | else return false; |
2543 | 2552 | } |
|
0 commit comments