Search in sources :

Example 1 with ModelBuilderSchema

use of hex.schemas.ModelBuilderSchema in project h2o-3 by h2oai.

the class ModelBuildersHandler method fetch.

/** Return a single modelbuilder. */
// called through reflection by RequestServer
@SuppressWarnings("unused")
public ModelBuildersV3 fetch(int version, ModelBuildersV3 m) {
    m.model_builders = new ModelBuilderSchema.IcedHashMapStringModelBuilderSchema();
    ModelBuilder builder = ModelBuilder.make(m.algo, null, null);
    m.model_builders.put(m.algo.toLowerCase(), (ModelBuilderSchema) SchemaServer.schema(version, builder).fillFromImpl(builder));
    return m;
}
Also used : ModelBuilder(hex.ModelBuilder) ModelBuilderSchema(hex.schemas.ModelBuilderSchema)

Example 2 with ModelBuilderSchema

use of hex.schemas.ModelBuilderSchema in project h2o-3 by h2oai.

the class ModelBuildersHandler method list.

/** Return all the modelbuilders. */
// called through reflection by RequestServer
@SuppressWarnings("unused")
public ModelBuildersV3 list(int version, ModelBuildersV3 m) {
    m.model_builders = new ModelBuilderSchema.IcedHashMapStringModelBuilderSchema();
    for (String algo : ModelBuilder.algos()) {
        ModelBuilder builder = ModelBuilder.make(algo, null, null);
        m.model_builders.put(algo.toLowerCase(), (ModelBuilderSchema) SchemaServer.schema(version, builder).fillFromImpl(builder));
    }
    return m;
}
Also used : ModelBuilder(hex.ModelBuilder) ModelBuilderSchema(hex.schemas.ModelBuilderSchema)

Example 3 with ModelBuilderSchema

use of hex.schemas.ModelBuilderSchema in project h2o-3 by h2oai.

the class ModelBuilderV3 method fillFromImpl.

@Override
public S fillFromImpl(J builder) {
    super.fillFromImpl(builder);
    ModelBuilder.ValidationMessage[] vms = builder._messages;
    this.messages = new ValidationMessageV3[vms.length];
    for (int i = 0; i < vms.length; i++) // TODO: version // Note: does default field_name mapping
    this.messages[i] = new ValidationMessageV3().fillFromImpl(vms[i]);
    // default fieldname hacks
    ValidationMessageV3.mapValidationMessageFieldNames(this.messages, new String[] { "_train", "_valid" }, new String[] { "training_frame", "validation_frame" });
    this.error_count = builder.error_count();
    ModelBuilderSchema s = (ModelBuilderSchema) SchemaServer.schema(this.getSchemaVersion(), builder).fillFromImpl(builder);
    parameters = s.parameters;
    return (S) this;
}
Also used : ModelBuilderSchema(hex.schemas.ModelBuilderSchema)

Aggregations

ModelBuilderSchema (hex.schemas.ModelBuilderSchema)3 ModelBuilder (hex.ModelBuilder)2