use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class Models method summarizeSpeeDRFModel.
/**
* Summarize fields which are specific to hex.drf.DRF.SpeeDRFModel.
*/
private static void summarizeSpeeDRFModel(ModelSummary summary, hex.singlenoderf.SpeeDRFModel model) {
// add generic fields such as column names
summarizeModelCommonFields(summary, model);
summary.model_algorithm = "Random Forest";
JsonObject all_params = (model.get_params()).toJSON();
summary.critical_parameters = whitelistJsonObject(all_params, SpeeDRF_critical_params);
summary.secondary_parameters = whitelistJsonObject(all_params, SpeeDRF_secondary_params);
summary.expert_parameters = whitelistJsonObject(all_params, SpeeDRF_expert_params);
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class TestPoll method serve.
@Override
protected Response serve() {
++_counter;
JsonObject resp = new JsonObject();
resp.addProperty("hoho", _haha.value());
resp.addProperty("counter", _counter);
if (_counter == 10) {
_counter = 0;
return Response.done(resp);
} else {
return Response.poll(resp, _counter, 10);
}
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class TestRedirect method serve.
@Override
protected Response serve() {
JsonObject resp = new JsonObject();
resp.addProperty("hoho", "hehe");
return Response.redirect(resp, TestPoll.class, resp);
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class RequestStatics method jsonError.
protected static JsonObject jsonError(String error) {
JsonObject result = new JsonObject();
result.addProperty(ERROR, error);
return result;
}
use of dontweave.gson.JsonObject in project h2o-2 by h2oai.
the class PutValue method serve.
@Override
public Response serve() {
JsonObject response = new JsonObject();
Key k = Key.make(_key.value()._kb, (byte) (int) _rf.value());
Value v = new Value(k, _value.value().getBytes());
UKV.put(k, v);
response.addProperty(KEY, k.toString());
response.addProperty(REPLICATION_FACTOR, k.desired());
response.addProperty(VALUE_SIZE, v._max);
return Response.done(response);
}
Aggregations