All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hex.schemas.GBMModelV2 Maven / Gradle / Ivy

There is a newer version: 3.46.0.6
Show newest version
package hex.schemas;

import hex.tree.gbm.GBMModel;
import water.api.API;
import water.api.ModelOutputSchema;
import water.api.ModelSchema;
import water.util.PojoUtils;
//import water.util.DocGen.HTML;

public class GBMModelV2 extends ModelSchema {

  public static final class GBMModelOutputV2 extends ModelOutputSchema {
    // Output fields; input fields are in the parameters list
    @API(help="Mean Square Error")
    public double mse;           // Total MSE, variance

    @Override public GBMModel.GBMOutput createImpl() {
      GBMModel.GBMOutput impl = new GBMModel.GBMOutput(null);
      PojoUtils.copyProperties(impl, this, PojoUtils.FieldNaming.DEST_HAS_UNDERSCORES);
      return impl;
    }

    // Version&Schema-specific filling from the handler
    @Override public GBMModelOutputV2 fillFromImpl( GBMModel.GBMOutput impl) {
      PojoUtils.copyProperties(this, impl, PojoUtils.FieldNaming.ORIGIN_HAS_UNDERSCORES);
      return this;
    }


  } // GBMModelOutputV2

  // TOOD: I think we can implement the following two in ModelSchema, using reflection on the type parameters.
  public GBMV2.GBMParametersV2 createParametersSchema() { return new GBMV2.GBMParametersV2(); }
  public GBMModelOutputV2 createOutputSchema() { return new GBMModelOutputV2(); }

  //==========================
  // Custom adapters go here

  // Version&Schema-specific filling into the impl
  @Override public GBMModel createImpl() {
    GBMV2.GBMParametersV2 p = ((GBMV2.GBMParametersV2)this.parameters);
    GBMModel.GBMParameters parms = p.createImpl();
    return new GBMModel( key, parms, new GBMModel.GBMOutput(null) );
  }

  // Version&Schema-specific filling from the impl
  @Override public GBMModelV2 fillFromImpl( GBMModel kmm ) {
    return super.fillFromImpl(kmm);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy