package water.api;

import hex.Model;

/**
 * An instance of a ModelOutput schema contains the Model build output (e.g., the cluster centers for KMeans).
 */
abstract public class ModelOutputSchema<O extends Model.Output, S extends ModelOutputSchema<O, S>> extends Schema<O, S> {

  @API(help="Column names.", direction=API.Direction.OUTPUT)
  public String[] names;

  @API(help="Domains for categorical (enum) columns.", direction=API.Direction.OUTPUT)
  public String[][] domains;

  @API(help="Category of the model (e.g., Binomial).", values={"Unknown", "Binomial", "Multinomial", "Regression", "Clustering"}, direction=API.Direction.OUTPUT)
  Model.ModelCategory model_category;

  public ModelOutputSchema() {
    super();
  }

  public S fillFromImpl( O impl ) {
    super.fillFromImpl(impl);
    this.model_category = impl.getModelCategory();
    return (S)this;
  }
}

@@ -30,16 +30,124 @@
 x.Model;
+%0Aimport water.Weaver;%0Aimport water.util.IcedHashMap;%0Aimport water.util.Log;%0A%0Aimport java.lang.reflect.Field;
 %0A%0A/**%0A *
@@ -750,16 +750,23 @@
 TPUT)%0A  
+public 
 Model.Mo
@@ -794,16 +794,141 @@
 egory;%0A%0A
+  @API(help=%22Help information for output fields%22, direction=API.Direction.OUTPUT)%0A  public IcedHashMap%3CString,String%3E help;%0A%0A
   public
@@ -1093,23 +1093,660 @@
     
-return (S)this;
+fillHelp();%0A    return (S)this;%0A  %7D%0A%0A  private void fillHelp() %7B%0A    this.help = new IcedHashMap%3C%3E();%0A    try %7B%0A      Field%5B%5D dest_fields = Weaver.getWovenFields(this.getClass());%0A      for (Field f : dest_fields) %7B%0A        fillHelp(f);%0A      %7D%0A    %7D%0A    catch (Exception e) %7B%0A      Log.warn(e);%0A    %7D%0A  %7D%0A%0A  private void fillHelp(Field f) %7B%0A    API annotation = f.getAnnotation(API.class);%0A%0A    if (null != annotation) %7B%0A      String helpString = annotation.help();%0A      if (helpString == null) %7B%0A        return;%0A      %7D%0A%0A      String name = f.getName();%0A      if (name == null) %7B%0A        return;%0A      %7D%0A%0A      this.help.put(name, helpString);%0A    %7D
 %0A  %7D

Add "help" hashmap output to ModelOutputSchema.