-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fix Uplift MOJO API, add tests * Add tests, fix predict * Implement Generic logic behind Python/R uplift MOJO API
- Loading branch information
Showing
21 changed files
with
539 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
h2o-core/src/main/java/hex/ModelMetricsBinomialUpliftGeneric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package hex; | ||
|
||
import water.fvec.Frame; | ||
import water.util.TwoDimTable; | ||
|
||
public class ModelMetricsBinomialUpliftGeneric extends ModelMetricsBinomialUplift { | ||
|
||
|
||
public final TwoDimTable _thresholds_and_metric_scores; | ||
public final TwoDimTable _auuc_table; | ||
public final TwoDimTable _aecu_table; | ||
|
||
public ModelMetricsBinomialUpliftGeneric(Model model, Frame frame, long nobs, String[] domain, double ate, double att, double atc, double sigma, AUUC auuc, CustomMetric customMetric, TwoDimTable thresholds_and_metric_scores, TwoDimTable auuc_table, TwoDimTable aecu_table, final String description) { | ||
super(model, frame, nobs, domain, ate, att, atc, sigma, auuc, customMetric); | ||
_thresholds_and_metric_scores = thresholds_and_metric_scores; | ||
_auuc_table = auuc_table; | ||
_aecu_table = aecu_table; | ||
_description = description; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
h2o-core/src/main/java/water/api/schemas3/ModelMetricsBinomialUpliftGenericV3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package water.api.schemas3; | ||
|
||
import hex.ModelMetricsBinomialUpliftGeneric; | ||
|
||
public class ModelMetricsBinomialUpliftGenericV3<I extends ModelMetricsBinomialUpliftGeneric, S extends ModelMetricsBinomialUpliftGenericV3<I, S>> | ||
extends ModelMetricsBinomialUpliftV3<I, S> { | ||
|
||
@Override | ||
public S fillFromImpl(ModelMetricsBinomialUpliftGeneric modelMetrics) { | ||
super.fillFromImpl(modelMetrics); | ||
this.AUUC = modelMetrics._auuc.auuc(); | ||
this.auuc_normalized = modelMetrics._auuc.auucNormalized(); | ||
this.ate = modelMetrics.ate(); | ||
this.att = modelMetrics.att(); | ||
this.atc = modelMetrics.atc(); | ||
this.qini = modelMetrics.qini(); | ||
|
||
if (modelMetrics._auuc_table != null) { // Possibly overwrites whatever has been set in the ModelMetricsBinomialV3 | ||
this.auuc_table = new TwoDimTableV3().fillFromImpl(modelMetrics._auuc_table); | ||
} | ||
if (modelMetrics._aecu_table != null) { // Possibly overwrites whatever has been set in the ModelMetricsBinomialV3 | ||
this.aecu_table = new TwoDimTableV3().fillFromImpl(modelMetrics._aecu_table); | ||
} | ||
if (modelMetrics._thresholds_and_metric_scores != null) { // Possibly overwrites whatever has been set in the ModelMetricsBinomialV3 | ||
this.thresholds_and_metric_scores = new TwoDimTableV3().fillFromImpl(modelMetrics._thresholds_and_metric_scores); | ||
} | ||
return (S) this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.