use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class Models method summarizeGLMModel.
/**
* Summarize fields which are specific to hex.glm.GLMModel.
*/
private static void summarizeGLMModel(ModelSummary summary, hex.glm.GLMModel model) {
// add generic fields such as column names
summarizeModelCommonFields(summary, model);
summary.model_algorithm = "GLM";
JsonObject all_params = (model.get_params()).toJSON();
summary.critical_parameters = whitelistJsonObject(all_params, GLM_critical_params);
summary.secondary_parameters = whitelistJsonObject(all_params, GLM_secondary_params);
summary.expert_parameters = whitelistJsonObject(all_params, GLM_expert_params);
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class Models method summarizeDRFModel.
/**
* Summarize fields which are specific to hex.drf.DRF.DRFModel.
*/
private static void summarizeDRFModel(ModelSummary summary, hex.drf.DRF.DRFModel model) {
// add generic fields such as column names
summarizeModelCommonFields(summary, model);
summary.model_algorithm = "BigData RF";
JsonObject all_params = (model.get_params()).toJSON();
summary.critical_parameters = whitelistJsonObject(all_params, DRF_critical_params);
summary.secondary_parameters = whitelistJsonObject(all_params, DRF_secondary_params);
summary.expert_parameters = whitelistJsonObject(all_params, DRF_expert_params);
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class Models method summarizeGBMModel.
/**
* Summarize fields which are specific to hex.gbm.GBM.GBMModel.
*/
private static void summarizeGBMModel(ModelSummary summary, hex.gbm.GBM.GBMModel model) {
// add generic fields such as column names
summarizeModelCommonFields(summary, model);
summary.model_algorithm = "GBM";
JsonObject all_params = (model.get_params()).toJSON();
summary.critical_parameters = whitelistJsonObject(all_params, GBM_critical_params);
summary.secondary_parameters = whitelistJsonObject(all_params, GBM_secondary_params);
summary.expert_parameters = whitelistJsonObject(all_params, GBM_expert_params);
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class RemoveAll method serve.
@Override
protected Response serve() {
try {
Log.info("Removing all keys for the cluster");
// First cancel all jobs and wait for them to be done.
Log.info("Cancelling all jobs...");
for (Job job : Job.all()) {
job.cancel();
Job.waitUntilJobEnded(job.self());
}
Log.info("Finished cancelling all jobs");
RemoveAllKeysTask collector = new RemoveAllKeysTask();
collector.invokeOnAllNodes();
Log.info("Finished removing keys");
} catch (Throwable e) {
return Response.error(e);
}
JsonObject response = new JsonObject();
return Response.done(response);
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class AutoBuffer2JSONTest method testDoubleFromRequest.
// ---- Only Request1 tests for correct JSON
@Test
public void testDoubleFromRequest() {
JsonObject o = new JsonObject();
o.addProperty("d1", Double.NaN);
o.addProperty("d2", Double.POSITIVE_INFINITY);
o.addProperty("d3", Double.NEGATIVE_INFINITY);
o.addProperty("d4", 3.141527);
o = JsonUtil.escape(o);
Assert.assertEquals("{\"d1\":\"NaN\",\"d2\":\"Infinity\",\"d3\":\"-Infinity\",\"d4\":3.141527}", o.toString());
}
Aggregations