index
int64
repo_id
string
file_path
string
content
string
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/UnlockKeysHandler.java
package water.api; import water.api.schemas3.UnlockKeysV3; public class UnlockKeysHandler extends Handler { @SuppressWarnings("unused") // called through reflection by RequestServer public UnlockKeysV3 unlock(int version, UnlockKeysV3 u) { new UnlockTask().doAllNodes(); return u; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/UnlockTask.java
package water.api; import water.*; import water.util.Log; public class UnlockTask extends MRTask<UnlockTask> { final boolean _quiet; public UnlockTask() {super(H2O.GUI_PRIORITY); _quiet = false; } public UnlockTask(boolean q) { super(H2O.GUI_PRIORITY); _quiet = q; } @Override public void setupLocal() { final KeySnapshot.KeyInfo[] kinfo = KeySnapshot.localSnapshot(true)._keyInfos; for(KeySnapshot.KeyInfo k:kinfo) { if(!k.isLockable()) continue; final Value val = DKV.get(k._key); if( val == null ) continue; final Lockable<?> lockable = val.<Lockable<?>>get(); final Key[] lockers = lockable._lockers; if (lockers != null) { // check that none of the locking jobs is still running for (Key<Job> locker : lockers) { if (locker != null && locker.type() == Key.JOB) { final Job job = locker.get(); if (job != null && job.isRunning()) throw new UnsupportedOperationException("Cannot unlock all keys since locking jobs are still running."); } } lockable.unlock_all(); Log.info("Unlocked key '" + k._key + "' from " + lockers.length + " lockers."); } } if (!_quiet) Log.info("All keys are now unlocked."); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/ValidationAdapter.java
package water.api; import hex.Model; import water.fvec.Frame; import water.fvec.Vec; public class ValidationAdapter { // public ValidationAdapter(Frame validation, boolean classification) { // this.validation = validation; // this.classification = classification; // } // // /** Validation frame */ // final private transient Frame validation; // /** Whether classification is done or not */ // final private transient boolean classification; // // /** Validation vector extracted from validation frame. */ // private transient Vec _validResponse; // /** Validation response domain or null if validation is not specified or null if response is float. */ // private transient String[] _validResponseDomain; // /** Source response domain or null if response is float. */ // private transient String[] _sourceResponseDomain; // /** CM domain derived from {@link #_validResponseDomain} and {@link #_sourceResponseDomain}. */ // private transient String[] _cmDomain; // /** Names of columns */ // private transient String[] _names; // /** Name of validation response. Should be same as source response. */ // private transient String _responseName; // // /** Adapted validation frame to a computed model. */ // private transient Frame _adaptedValidation; // private transient Vec _adaptedValidationResponse; // Validation response adapted to computed CM domain // private transient int[][] _fromModel2CM; // Transformation for model response to common CM domain // private transient int[][] _fromValid2CM; // Transformation for validation response to common CM domain // // /** Returns true if the job has specified validation dataset. */ // private final boolean hasValidation() { return validation!=null; } // /** Returns a domain for confusion matrix. */ // private final String[] getCMDomain() { return _cmDomain; } // /** Return validation dataset which can be adapted to a model if it is necessary. */ // public final Frame getValidation() { return _adaptedValidation!=null ? _adaptedValidation : validation; } // /** Returns original validation dataset. */ // private final Frame getOrigValidation() { return validation; } // public final Response2CMAdaptor getValidAdaptor() { return new Response2CMAdaptor(); } // // /** */ // public final void prepareValidationWithModel(final Model model) { // if (validation == null) return; // Frame[] av = model.adapt(validation, false); // _adaptedValidation = av[0]; //// gtrash(av[1]); // delete this after computation // if (_fromValid2CM!=null) { // assert classification : "Validation response transformation should be declared only for classification!"; // assert _fromModel2CM != null : "Model response transformation should exist if validation response transformation exists!"; // Vec tmp = _validResponse.toCategoricalVec(); // _adaptedValidationResponse = tmp.makeTransf(_fromValid2CM, getCMDomain()); // Add an original response adapted to CM domain //// gtrash(_adaptedValidationResponse); // Add the created vector to a clean-up list //// gtrash(tmp); // } // } // // /** A micro helper for transforming model/validation responses to confusion matrix domain. */ // public class Response2CMAdaptor { // /** Adapt given vector produced by a model to confusion matrix domain. Always return a new vector which needs to be deleted. */ // public Vec adaptModelResponse2CM(final Vec v) { return v.makeTransf(_fromModel2CM, getCMDomain()); } // /** Adapt given validation vector to confusion matrix domain. Always return a new vector which needs to be deleted. */ // private Vec adaptValidResponse2CM(final Vec v) { return v.makeTransf(_fromValid2CM, getCMDomain()); } // /** Returns validation dataset. */ // private Frame getValidation() { return getValidation(); } // /** Return cached validation response already adapted to CM domain. */ // public Vec getAdaptedValidationResponse2CM() { return _adaptedValidationResponse; } // /** Return cm domain. */ // private String[] getCMDomain() { return getCMDomain(); } // /** Returns true if model/validation responses need to be adapted to confusion matrix domain. */ // public boolean needsAdaptation2CM() { return _fromModel2CM != null; } // /** Return the adapted response name */ // public String adaptedValidationResponse(final String response) { return response + ".adapted"; } // } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/ValuesProvider.java
package water.api; /** * A marker type to provide values for type which behaves like Enum in REST API. * * For example String type, which has known set of possible values. * * Note: we need this provider since we cannot reference non-constant expression inside * @API annotation. For example, @API(values = ParserService.INSTANCE.NAMES) is denied! * So ValuesProvider in this case is just a reader which provides value of the field * ParserService.INSTANCE.NAMES. * */ public interface ValuesProvider { Class<? extends ValuesProvider> NULL = ValuesProvider.class; // default valuesProvider value in @API String[] values(); }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/WaterMeterCpuTicksHandler.java
package water.api; import water.api.schemas3.WaterMeterCpuTicksV3; import water.util.WaterMeterCpuTicks; public class WaterMeterCpuTicksHandler extends Handler { @SuppressWarnings("unused") // called through reflection by RequestServer public WaterMeterCpuTicksV3 fetch(int version, WaterMeterCpuTicksV3 s) { WaterMeterCpuTicks impl = s.createAndFillImpl(); impl.doIt(); return s.fillFromImpl(impl); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/WaterMeterIoHandler.java
package water.api; import water.api.schemas3.WaterMeterIoV3; import water.util.WaterMeterIo; public class WaterMeterIoHandler extends Handler { @SuppressWarnings("unused") // called through reflection by RequestServer public WaterMeterIoV3 fetch(int version, WaterMeterIoV3 s) { WaterMeterIo impl = s.createAndFillImpl(); impl.doIt(false); return s.fillFromImpl(impl); } @SuppressWarnings("unused") // called through reflection by RequestServer public WaterMeterIoV3 fetch_all(int version, WaterMeterIoV3 s) { WaterMeterIo impl = s.createAndFillImpl(); impl.doIt(true); return s.fillFromImpl(impl); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/AboutEntryV3.java
package water.api.schemas3; import water.Iced; import water.api.API; import water.api.AboutHandler; /** */ public class AboutEntryV3 extends SchemaV3<Iced, AboutEntryV3> { @API(help = "Property name", direction = API.Direction.OUTPUT) public String name; @API(help = "Property value", direction = API.Direction.OUTPUT) public String value; public AboutEntryV3() {} public AboutEntryV3(String n, String v) { name = n; value = v; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/AboutV3.java
package water.api.schemas3; import water.Iced; import water.api.API; /** */ public class AboutV3 extends RequestSchemaV3<Iced, AboutV3> { @API(help = "List of properties about this running H2O instance", direction = API.Direction.OUTPUT) public AboutEntryV3 entries[]; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/CapabilitiesV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class CapabilitiesV3 extends RequestSchemaV3<Iced, CapabilitiesV3> { @API(help = "List of H2O capabilities", direction = API.Direction.OUTPUT) public CapabilityEntryV3[] capabilities; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/CapabilityEntryV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class CapabilityEntryV3 extends SchemaV3<Iced, CapabilityEntryV3> { @API(help = "Extension name", direction = API.Direction.OUTPUT) public String name; public CapabilityEntryV3() {} public CapabilityEntryV3(String name) { this.name = name; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/CloudLockV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class CloudLockV3 extends RequestSchemaV3<Iced, CloudLockV3> { public CloudLockV3() { } @API(help="reason", direction=API.Direction.INPUT) public String reason; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/CloudV3.java
package water.api.schemas3; import water.*; import water.api.API; import java.util.concurrent.ConcurrentHashMap; public class CloudV3 extends RequestSchemaV3<Iced, CloudV3> { /** * Data structure to store last tick counts from a given node. */ private static class LastTicksEntry { final public long _system_idle_ticks; final public long _system_total_ticks; final public long _process_total_ticks; LastTicksEntry(HeartBeat hb) { _system_idle_ticks = hb._system_idle_ticks; _system_total_ticks = hb._system_total_ticks; _process_total_ticks = hb._process_total_ticks; } } /** * Store last tick counts for each node. * * This is local to a node and doesn't need to be Iced, so make it transient. * Access this each time the Cloud status page is called on this node. * * The window of tick aggregation is between calls to this page (which might come from the browser or from REST * API clients). * * Note there is no attempt to distinguish between REST API sessions. Every call updates the last tick count info. */ private static transient ConcurrentHashMap<String,LastTicksEntry> ticksHashMap = new ConcurrentHashMap<>(); public CloudV3() {} // Input fields @API(help="skip_ticks", direction=API.Direction.INPUT) public boolean skip_ticks = false; // Output fields @API(help="version", direction=API.Direction.OUTPUT) public String version; @API(help="branch_name", direction=API.Direction.OUTPUT) public String branch_name; @API(help="last_commit_hash", direction=API.Direction.OUTPUT) public String last_commit_hash; @API(help="describe", direction=API.Direction.OUTPUT) public String describe; @API(help="compiled_by", direction=API.Direction.OUTPUT) public String compiled_by; @API(help="compiled_on", direction=API.Direction.OUTPUT) public String compiled_on; @API(help="build_number", direction=API.Direction.OUTPUT) public String build_number; @API(help="build_age", direction=API.Direction.OUTPUT) public String build_age; @API(help="build_too_old", direction=API.Direction.OUTPUT) public boolean build_too_old; @API(help="Node index number cloud status is collected from (zero-based)", direction=API.Direction.OUTPUT) public int node_idx; @API(help="cloud_name", direction=API.Direction.OUTPUT) public String cloud_name; @API(help="cloud_size", direction=API.Direction.OUTPUT) public int cloud_size; @API(help="cloud_uptime_millis", direction=API.Direction.OUTPUT) public long cloud_uptime_millis; @API(help="Cloud internal timezone", direction= API.Direction.OUTPUT) public String cloud_internal_timezone; @API(help="Timezone used for parsing datetime columns", direction= API.Direction.OUTPUT) public String datafile_parser_timezone; @API(help="cloud_healthy", direction=API.Direction.OUTPUT) public boolean cloud_healthy; @API(help="Nodes reporting unhealthy", direction=API.Direction.OUTPUT) public int bad_nodes; @API(help="Cloud voting is stable", direction=API.Direction.OUTPUT) public boolean consensus; @API(help="Cloud is accepting new members or not", direction=API.Direction.OUTPUT) public boolean locked; @API(help="Cloud is in client mode.", direction=API.Direction.OUTPUT) public boolean is_client; @API(help="nodes", direction=API.Direction.OUTPUT) public NodeV3[] nodes; @API(help="internal_security_enabled", direction=API.Direction.OUTPUT) public boolean internal_security_enabled; @API(help="leader_idx", direction=API.Direction.OUTPUT) public int leader_idx = -1; @API(help="web_ip", direction=API.Direction.OUTPUT) public String web_ip=null; // Output fields one-per-JVM public static class NodeV3 extends SchemaV3<Iced, NodeV3> { public NodeV3() {} @API(help="IP", direction=API.Direction.OUTPUT) public String h2o; @API(help="IP address and port in the form a.b.c.d:e", direction=API.Direction.OUTPUT) public String ip_port; @API(help="(now-last_ping)<HeartbeatThread.TIMEOUT", direction=API.Direction.OUTPUT) public boolean healthy; @API(help="Time (in msec) of last ping", direction=API.Direction.OUTPUT) public long last_ping; @API(help="PID", direction=API.Direction.OUTPUT) public int pid; @API(help="num_cpus", direction=API.Direction.OUTPUT) public int num_cpus; @API(help="cpus_allowed", direction=API.Direction.OUTPUT) public int cpus_allowed; @API(help="nthreads", direction=API.Direction.OUTPUT) public int nthreads; @API(help="System load; average #runnables/#cores", direction=API.Direction.OUTPUT) public float sys_load; // Average #runnables/#cores @API(help="System CPU percentage used by this H2O process in last interval", direction=API.Direction.OUTPUT) public int my_cpu_pct; @API(help="System CPU percentage used by everything in last interval", direction=API.Direction.OUTPUT) public int sys_cpu_pct; @API(help="Data on Node memory", direction=API.Direction.OUTPUT) public long mem_value_size; @API(help="Temp (non Data) memory", direction=API.Direction.OUTPUT) public long pojo_mem; @API(help="Free heap", direction=API.Direction.OUTPUT) public long free_mem; @API(help="Maximum memory size for node", direction=API.Direction.OUTPUT) public long max_mem; @API(help="Size of data on node's disk", direction=API.Direction.OUTPUT) public long swap_mem; @API(help="#local keys", direction=API.Direction.OUTPUT) public int num_keys; @API(help="Free disk", direction=API.Direction.OUTPUT) public long free_disk; @API(help="Max disk", direction=API.Direction.OUTPUT) public long max_disk; @API(help="Active Remote Procedure Calls", direction=API.Direction.OUTPUT) public int rpcs_active; @API(help="F/J Thread count, by priority", direction=API.Direction.OUTPUT) public short fjthrds[]; @API(help="F/J Task count, by priority", direction=API.Direction.OUTPUT) public short fjqueue[]; @API(help="Open TCP connections", direction=API.Direction.OUTPUT) public int tcps_active; @API(help="Open File Descripters", direction=API.Direction.OUTPUT) public int open_fds; @API(help="Linpack GFlops", direction=API.Direction.OUTPUT) public double gflops; @API(help="Memory Bandwidth", direction=API.Direction.OUTPUT) public double mem_bw; public NodeV3(H2ONode h2o, boolean skip_ticks) { HeartBeat hb = h2o._heartbeat; // Basic system health this.h2o = h2o.toString(); ip_port = h2o.getIpPortString(); healthy = h2o.isHealthy(); last_ping = h2o._last_heard_from; sys_load = hb._system_load_average; gflops = hb._gflops; mem_bw = hb._membw; // Memory being used mem_value_size = hb.get_kv_mem(); pojo_mem = hb.get_pojo_mem(); free_mem = hb.get_free_mem(); swap_mem = hb.get_swap_mem(); max_mem = pojo_mem + free_mem + mem_value_size; num_keys = hb._keys; // Disk health free_disk = hb.get_free_disk(); max_disk = hb.get_max_disk(); // Fork/Join Activity rpcs_active = hb._rpcs; fjthrds = hb._fjthrds; fjqueue = hb._fjqueue; // System properties & I/O Status tcps_active = hb._tcps_active; open_fds = hb._process_num_open_fds; // -1 if not available num_cpus = hb._num_cpus; cpus_allowed = hb._cpus_allowed; nthreads = hb._nthreads; pid = hb._pid; // Use tick information to calculate CPU usage percentage for the entire system and // for the specific H2O node. // // Note that 100% here means "the entire box". This is different from 'top' 100%, // which usually means one core. my_cpu_pct = -1; sys_cpu_pct = -1; if (!skip_ticks) { LastTicksEntry lte = ticksHashMap.get(h2o.toString()); if (lte != null) { long system_total_ticks_delta = hb._system_total_ticks - lte._system_total_ticks; // Avoid divide by 0 errors. if (system_total_ticks_delta > 0) { long system_idle_ticks_delta = hb._system_idle_ticks - lte._system_idle_ticks; double sys_cpu_frac_double = 1 - ((double)(system_idle_ticks_delta) / (double)system_total_ticks_delta); if (sys_cpu_frac_double < 0) sys_cpu_frac_double = 0; // Clamp at 0. else if (sys_cpu_frac_double > 1) sys_cpu_frac_double = 1; // Clamp at 1. sys_cpu_pct = (int)(sys_cpu_frac_double * 100); long process_total_ticks_delta = hb._process_total_ticks - lte._process_total_ticks; double process_cpu_frac_double = ((double)(process_total_ticks_delta) / (double)system_total_ticks_delta); // Saturate at 0 and 1. if (process_cpu_frac_double < 0) process_cpu_frac_double = 0; // Clamp at 0. else if (process_cpu_frac_double > 1) process_cpu_frac_double = 1; // Clamp at 1. my_cpu_pct = (int)(process_cpu_frac_double * 100); } } LastTicksEntry newLte = new LastTicksEntry(hb); ticksHashMap.put(h2o.toString(), newLte); } } } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ClusteringModelParametersSchemaV3.java
package water.api.schemas3; import hex.ClusteringModel; import water.api.API; /** * An instance of a ClusteringModelParameters schema contains the common ClusteringModel build parameters. */ public class ClusteringModelParametersSchemaV3<P extends ClusteringModel.ClusteringParameters, S extends ClusteringModelParametersSchemaV3<P, S>> extends ModelParametersSchemaV3<P, S> { static public String[] own_fields = new String[] { "k" }; @API(help = "The max. number of clusters. If estimate_k is disabled, the model will find k centroids, otherwise it will find up to k centroids.", direction = API.Direction.INOUT, gridable = true) public int k; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ConfusionMatrixV3.java
package water.api.schemas3; import hex.ConfusionMatrix; import water.api.API; public class ConfusionMatrixV3 extends SchemaV3<ConfusionMatrix, ConfusionMatrixV3> { @API(help="Annotated confusion matrix", direction=API.Direction.OUTPUT) public TwoDimTableV3 table; // Version&Schema-specific filling into the implementation object public ConfusionMatrix createImpl() { // TODO: this is bogus. . . return new ConfusionMatrix(null, null); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/CreateFrameV3.java
package water.api.schemas3; import hex.CreateFrame; import water.Key; import water.api.API; import water.fvec.Frame; public class CreateFrameV3 extends RequestSchemaV3<CreateFrame, CreateFrameV3> { @API(help="destination key", direction=API.Direction.INOUT) public KeyV3.FrameKeyV3 dest; @API(help = "Number of rows", direction=API.Direction.INOUT) public long rows; @API(help = "Number of data columns (in addition to the first response column)", direction=API.Direction.INOUT) public int cols; @API(help = "Random number seed that determines the random values", direction=API.Direction.INOUT) public long seed; @API(help = "Random number seed for setting the column types", direction=API.Direction.INOUT) public long seed_for_column_types; @API(help = "Whether frame should be randomized", direction=API.Direction.INOUT) public boolean randomize; @API(help = "Constant value (for randomize=false)", direction=API.Direction.INOUT) public long value; @API(help = "Range for real variables (-range ... range)", direction=API.Direction.INOUT) public long real_range; @API(help = "Fraction of categorical columns (for randomize=true)", direction=API.Direction.INOUT) public double categorical_fraction; @API(help = "Factor levels for categorical variables", direction=API.Direction.INOUT) public int factors; @API(help = "Fraction of integer columns (for randomize=true)", direction=API.Direction.INOUT) public double integer_fraction; @API(help = "Range for integer variables (-range ... range)", direction=API.Direction.INOUT) public long integer_range; @API(help = "Fraction of binary columns (for randomize=true)", direction=API.Direction.INOUT) public double binary_fraction; @API(help = "Fraction of 1's in binary columns", direction=API.Direction.INOUT) public double binary_ones_fraction; @API(help = "Fraction of date/time columns (for randomize=true)", direction=API.Direction.INOUT) public double time_fraction; @API(help = "Fraction of string columns (for randomize=true)", direction=API.Direction.INOUT) public double string_fraction; @API(help = "Fraction of missing values", direction=API.Direction.INOUT) public double missing_fraction; @API(help = "Whether an additional response column should be generated", direction=API.Direction.INOUT) public boolean has_response; @API(help = "Number of factor levels of the first column (1=real, 2=binomial, N=multinomial or ordinal)", direction=API.Direction.INOUT) public int response_factors; @API(help = "For real-valued response variable: Whether the response should be positive only.", direction=API.Direction.INOUT) public boolean positive_response; // Output only: @API(help="Job Key", direction=API.Direction.OUTPUT) public KeyV3.JobKeyV3 key; @Override public CreateFrame createImpl( ) { return new CreateFrame(Key.<Frame>make()); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/DCTTransformerV3.java
package water.api.schemas3; import water.Key; import water.api.API; import water.api.schemas3.KeyV3.FrameKeyV3; import water.fvec.Frame; import water.util.DCTTransformer; public class DCTTransformerV3 extends RequestSchemaV3<DCTTransformer, DCTTransformerV3> { @API(help="Dataset", required = true) public FrameKeyV3 dataset; @API(help="Destination Frame ID") public FrameKeyV3 destination_frame; @API(help="Dimensions of the input array: Height, Width, Depth (Nx1x1 for 1D, NxMx1 for 2D)", required = true) public int[] dimensions; @API(help="Whether to do the inverse transform") public boolean inverse; @Override public DCTTransformer createImpl() { return new DCTTransformer(destination_frame == null ? Key.<Frame>make() : destination_frame.key()); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/DecryptionSetupV3.java
package water.api.schemas3; import water.api.API; import water.parser.*; public class DecryptionSetupV3 extends RequestSchemaV3<DecryptionTool.DecryptionSetup, DecryptionSetupV3> { @API(help = "Target key for the Decryption Tool", direction = API.Direction.INOUT) public KeyV3.DecryptionToolKeyV3 decrypt_tool_id; @API(help = "Implementation of the Decryption Tool", direction = API.Direction.INOUT) public String decrypt_impl; @API(help = "Location of Java Keystore", direction = API.Direction.INOUT) public KeyV3.FrameKeyV3 keystore_id; @API(help = "Keystore type", direction = API.Direction.INOUT) public String keystore_type; @API(help = "Key alias", direction = API.Direction.INOUT) public String key_alias; @API(help = "Key password", direction = API.Direction.INPUT) public String password; @API(help = "Specification of the cipher (and padding)", direction = API.Direction.INOUT) public String cipher_spec; @Override public DecryptionTool.DecryptionSetup fillImpl(DecryptionTool.DecryptionSetup impl) { DecryptionTool.DecryptionSetup ds = fillImpl(impl, new String[]{"password"}); ds._password = this.password.toCharArray(); return ds; } @Override public DecryptionSetupV3 fillFromImpl(DecryptionTool.DecryptionSetup impl) { return fillFromImpl(impl, new String[] {"password"}); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/DownloadDataV3.java
package water.api.schemas3; import water.Iced; import water.api.API; import water.api.schemas3.KeyV3.FrameKeyV3; public class DownloadDataV3 extends RequestSchemaV3<Iced, DownloadDataV3> { // Input fields @API(help="Frame to download", required=true) public FrameKeyV3 frame_id; @API(help="Emit double values in a machine readable lossless format with Double.toHexString().") public boolean hex_string; // Output @API(help="CSV Stream", direction=API.Direction.OUTPUT) public String csv; @API(help="Suggested Filename", direction=API.Direction.OUTPUT) public String filename; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FeatureInteractionV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class FeatureInteractionV3 extends RequestSchemaV3<Iced, FeatureInteractionV3> { @API(help="Model id of interest", json = false) public KeyV3.ModelKeyV3 model_id; @API(help = "Maximum interaction depth", required = true) public int max_interaction_depth; @API(help = "Maximum tree depth", required = true) public int max_tree_depth; @API(help = "Maximum deepening", required = true) public int max_deepening; @API(help="Feature importance table", direction = API.Direction.OUTPUT) public TwoDimTableV3[] feature_interaction; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FieldMetadataV3.java
package water.api.schemas3; import water.AutoBuffer; import water.Iced; import water.IcedWrapper; import water.api.API; import water.api.SchemaMetadata; /** * Schema for the metadata for the field of a Schema. */ public class FieldMetadataV3 extends SchemaV3<SchemaMetadata.FieldMetadata, FieldMetadataV3> { @API(help="Field name in the Schema", direction=API.Direction.OUTPUT) public String name; @API(help="Type for this field", direction=API.Direction.OUTPUT) public String type; @API(help="Type for this field is itself a Schema.", direction=API.Direction.OUTPUT) public boolean is_schema; @API(help="Schema name for this field, if it is_schema, or the name of the enum, if it's an enum.") public String schema_name; @API(help="Value for this field", direction=API.Direction.OUTPUT) public Iced value; @API(help="A short help description to appear alongside the field in a UI", direction=API.Direction.OUTPUT) public String help; @API(help="The label that should be displayed for the field if the name is insufficient", direction=API.Direction.OUTPUT) public String label; @API(help="Is this field required, or is the default value generally sufficient?", direction=API.Direction.OUTPUT) public boolean required; @API(help="How important is this field? The web UI uses the level to do a slow reveal of the parameters", values={"critical", "secondary", "expert"}, direction=API.Direction.OUTPUT) public API.Level level; @API(help="Is this field an input, output or inout?", values={"INPUT", "OUTPUT", "INOUT"}, direction=API.Direction.OUTPUT) public API.Direction direction; @API(help="Is the field inherited from the parent schema?", direction = API.Direction.OUTPUT) public boolean is_inherited; @API(help="If this field is inherited from a class higher in the hierarchy which one?", direction = API.Direction.OUTPUT) public String inherited_from; @API(help="Is the field gridable (i.e., it can be used in grid call)", direction = API.Direction.OUTPUT) public boolean is_gridable; // The following are markers for *input* fields. @API(help="For enum-type fields the allowed values are specified using the values annotation; this is used in UIs to tell the user the allowed values, and for validation", direction=API.Direction.OUTPUT) String[] values; @API(help="Should this field be rendered in the JSON representation?", direction=API.Direction.OUTPUT) boolean json; @API(help="For Vec-type fields this is the set of other Vec-type fields which must contain mutually exclusive values; for example, for a SupervisedModel the response_column must be mutually exclusive with the weights_column", direction=API.Direction.OUTPUT) String[] is_member_of_frames; @API(help="For Vec-type fields this is the set of Frame-type fields which must contain the named column; for example, for a SupervisedModel the response_column must be in both the training_frame and (if it's set) the validation_frame", direction=API.Direction.OUTPUT) String[] is_mutually_exclusive_with; /** * FieldMetadataBase has its own serializer so that value get serialized as its native * type. Autobuffer assumes all classes that have their own serializers should be * serialized as JSON objects, and wraps them in {}, so this can't just be handled by a * customer serializer in IcedWrapper. */ public final AutoBuffer writeJSON_impl(AutoBuffer ab) { boolean isOut = direction == API.Direction.OUTPUT; ab.putJSONStr("name", name); ab.put1(','); ab.putJSONStr("type", type); ab.put1(','); ab.putJSONStrUnquoted("is_schema", is_schema ? "true" : "false"); ab.put1(','); ab.putJSONStr("schema_name", schema_name); ab.put1(','); if (value instanceof IcedWrapper) { ab.putJSONStr("value").put1(':'); ((IcedWrapper) value).writeUnwrappedJSON(ab); ab.put1(','); } else { ab.putJSONStr("value").put1(':').putJSON(value); ab.put1(','); } ab.putJSONStr("help", help); ab.put1(','); ab.putJSONStr("label", label); ab.put1(','); ab.putJSONStrUnquoted("required", isOut? "null" : required ? "true" : "false"); ab.put1(','); ab.putJSONStr("level", level.toString()); ab.put1(','); ab.putJSONStr("direction", direction.toString()); ab.put1(','); ab.putJSONStrUnquoted("is_inherited", is_inherited ? "true" : "false"); ab.put1(','); ab.putJSONStr("inherited_from", inherited_from); ab.put1(','); ab.putJSONStrUnquoted("is_gridable", isOut? "null" : is_gridable ? "true" : "false"); ab.put1(','); ab.putJSONAStr("values", values); ab.put1(','); ab.putJSONStrUnquoted("json", json ? "true" : "false"); ab.put1(','); ab.putJSONAStr("is_member_of_frames", is_member_of_frames); ab.put1(','); ab.putJSONAStr("is_mutually_exclusive_with", is_mutually_exclusive_with); return ab; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FindV3.java
package water.api.schemas3; import water.Iced; import water.Key; import water.api.API; public class FindV3 extends RequestSchemaV3<Iced, FindV3> { // Input fields @API(help="Frame to search",required=true) public FrameV3 key; @API(help="Column, or null for all") public String column; @API(help="Starting row for search",required=true) public long row; @API(help="Value to search for; leave blank for a search for missing values") public String match; // Output @API(help="previous row with matching value, or -1", direction=API.Direction.OUTPUT) public long prev; @API(help="next row with matching value, or -1", direction=API.Direction.OUTPUT) public long next; //========================== // Helper so InspectV2 can link to FindV2 static String link(Key key, String column, long row, String match ) { return "/2/Find?key="+key+(column==null?"":"&column="+column)+"&row="+row+(match==null?"":"&match="+match); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FrameBaseV3.java
package water.api.schemas3; import water.Iced; import water.api.API; import water.api.FramesHandler; import water.api.schemas3.KeyV3.FrameKeyV3; import water.fvec.Frame; /** * The minimal amount of information on a Frame. * @see FramesHandler#list(int, FramesV3) */ public class FrameBaseV3<I extends Iced, S extends FrameBaseV3<I, S>> extends RequestSchemaV3<I, S> { public transient Frame _fr; // Avoid a racey update to Key; cached loaded value // Input fields @API(help="Frame ID",required=true, direction=API.Direction.INOUT) public FrameKeyV3 frame_id; // Output fields @API(help="Total data size in bytes", direction=API.Direction.OUTPUT) public long byte_size; @API(help="Is this Frame raw unparsed data?", direction=API.Direction.OUTPUT) public boolean is_text; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FrameChunksV3.java
package water.api.schemas3; import water.Iced; import water.fvec.Frame; import water.api.API; import water.fvec.Vec; public class FrameChunksV3 extends SchemaV3<Iced, FrameChunksV3> { @API(help="ID of a given frame", required=true, direction=API.Direction.INOUT) public KeyV3.FrameKeyV3 frame_id; @API(help="Description of particular chunks", direction=API.Direction.OUTPUT) public FrameChunkV3[] chunks; public static class FrameChunkV3 extends SchemaV3<Iced, FrameChunkV3> { @API(help="An identifier unique in scope of a given frame", direction=API.Direction.OUTPUT) public int chunk_id; @API(help="Number of rows represented byt the chunk", direction=API.Direction.OUTPUT) public int row_count; @API(help="Index of H2O node where the chunk is located in", direction=API.Direction.OUTPUT) public int node_idx; public FrameChunkV3() {} public FrameChunkV3(int id, Vec vector) { this.chunk_id = id; this.row_count = vector.chunkLen(id); this.node_idx = vector.chunkKey(id).home_node().index(); } } public FrameChunksV3 fillFromFrame(Frame frame) { this.frame_id = new KeyV3.FrameKeyV3(frame._key); Vec vector = frame.anyVec(); this.chunks = new FrameChunkV3[vector.nChunks()]; for(int i = 0; i < vector.nChunks(); i++) { this.chunks[i] = new FrameChunkV3(i, vector); } return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FrameLoadV3.java
package water.api.schemas3; import water.Iced; import water.api.API; /** * Frame import REST end-point. */ public class FrameLoadV3 extends RequestSchemaV3<Iced, FrameLoadV3> { @API(help="Import frame under given key into DKV.", json=false) public KeyV3.FrameKeyV3 frame_id; @API(help="Source directory (hdfs, s3, local) containing serialized frame") public String dir; @API(help="Override existing frame in case it exists or throw exception if set to false") public boolean force = true; @API(help = "Job indicating progress", direction = API.Direction.OUTPUT) public JobV3 job; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FrameSaveV3.java
package water.api.schemas3; import water.Iced; import water.api.API; /** * Frame export REST end-point. */ public class FrameSaveV3 extends RequestSchemaV3<Iced, FrameSaveV3> { @API(help = "Name of Frame of interest", json = false) public KeyV3.FrameKeyV3 frame_id; @API(help = "Destination directory (hdfs, s3, local)") public String dir; @API(help = "Overwrite destination file in case it exists or throw exception if set to false.") public boolean force = true; @API(help = "Job indicating progress", direction = API.Direction.OUTPUT) public JobV3 job; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FrameSynopsisV3.java
package water.api.schemas3; import water.Iced; import water.api.API; import water.api.schemas3.KeyV3.FrameKeyV3; import water.fvec.ByteVec; import water.fvec.Frame; import water.fvec.Vec; /** * The minimal amount of information on a Frame. * @see water.api.FramesHandler#list(int, FramesV3) */ public class FrameSynopsisV3 extends FrameBaseV3<Iced, FrameSynopsisV3> { public FrameSynopsisV3() {} // Output fields @API(help="Number of rows in the Frame", direction=API.Direction.OUTPUT) public long rows; @API(help="Number of columns in the Frame", direction=API.Direction.OUTPUT) public long columns; public FrameSynopsisV3(Frame fr) { Vec[] vecs = fr.vecs(); frame_id = new FrameKeyV3(fr._key); _fr = fr; rows = fr.numRows(); columns = vecs.length; byte_size = fr.byteSize(); is_text = fr.numCols()==1 && vecs[0] instanceof ByteVec; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FrameV3.java
package water.api.schemas3; import water.DKV; import water.Futures; import water.Key; import water.MemoryManager; import water.api.API; import water.api.schemas3.KeyV3.FrameKeyV3; import water.fvec.ByteVec; import water.fvec.Chunk; import water.fvec.Frame; import water.fvec.Frame.VecSpecifier; import water.fvec.Vec; import water.parser.BufferedString; import water.util.ChunkSummary; import water.util.FrameUtils; import water.util.Log; import water.util.PrettyPrint; /** * All the details on a Frame. Note that inside ColV3 there are fields which won't be * populated if we don't compute rollups, e.g. via * the REST API endpoint /Frames/<frameid>/columns/<colname>/summary. */ public class FrameV3 extends FrameBaseV3<Frame, FrameV3> { // Input fields @API(help="Row offset to display",direction=API.Direction.INPUT) public long row_offset; @API(help="Number of rows to display",direction=API.Direction.INOUT) public int row_count; @API(help="Column offset to return", direction=API.Direction.INOUT) public int column_offset; @API(help="Number of columns to return", direction=API.Direction.INOUT) public int column_count; @API(help="Number of full columns to return. The columns between full_column_count and column_count will be returned without the data", direction=API.Direction.INOUT) public int full_column_count; @API(help="Total number of columns in the Frame", direction=API.Direction.INOUT) public int total_column_count; // Output fields @API(help="checksum", direction=API.Direction.OUTPUT) public long checksum; @API(help="Number of rows in the Frame", direction=API.Direction.OUTPUT) public long rows; @API(help="Number of columns in the Frame", direction=API.Direction.OUTPUT) public long num_columns; @API(help="Default percentiles, from 0 to 1", direction=API.Direction.OUTPUT) public double[] default_percentiles; @API(help="Columns in the Frame", direction=API.Direction.OUTPUT) public ColV3[] columns; @API(help="Compatible models, if requested", direction=API.Direction.OUTPUT) public String[] compatible_models; @API(help="Chunk summary", direction=API.Direction.OUTPUT) public TwoDimTableV3 chunk_summary; @API(help="Distribution summary", direction=API.Direction.OUTPUT) public TwoDimTableV3 distribution_summary; public static class ColSpecifierV3 extends SchemaV3<VecSpecifier, ColSpecifierV3> implements AutoParseable { public ColSpecifierV3() { } public ColSpecifierV3(String column_name) { this.column_name = column_name; } public ColSpecifierV3(final String column_name, final String[] is_member_of_frames) { this.column_name = column_name; this.is_member_of_frames = is_member_of_frames; } @API(help="Name of the column", direction= API.Direction.INOUT) public String column_name; @API(help="List of fields which specify columns that must contain this column", direction= API.Direction.INOUT) public String[] is_member_of_frames; } public static class ColV3 extends SchemaV3<Vec, ColV3> { public ColV3() {} @API(help="label", direction=API.Direction.OUTPUT) public String label; @API(help="missing", direction=API.Direction.OUTPUT) public long missing_count; @API(help="zeros", direction=API.Direction.OUTPUT) public long zero_count; @API(help="positive infinities", direction=API.Direction.OUTPUT) public long positive_infinity_count; @API(help="negative infinities", direction=API.Direction.OUTPUT) public long negative_infinity_count; @API(help="mins", direction=API.Direction.OUTPUT) public double[] mins; @API(help="maxs", direction=API.Direction.OUTPUT) public double[] maxs; @API(help="mean", direction=API.Direction.OUTPUT) public double mean; @API(help="sigma", direction=API.Direction.OUTPUT) public double sigma; @API(help="datatype: {enum, string, int, real, time, uuid}", direction=API.Direction.OUTPUT) public String type; @API(help="domain; not-null for categorical columns only", direction=API.Direction.OUTPUT) public String[] domain; @API(help="cardinality of this column's domain; not-null for categorical columns only", direction=API.Direction.OUTPUT) public int domain_cardinality; @API(help="data", direction=API.Direction.OUTPUT) public double[] data; @API(help="string data", direction=API.Direction.OUTPUT) public String[] string_data; @API(help="decimal precision, -1 for all digits", direction=API.Direction.OUTPUT) public byte precision; @API(help="Histogram bins; null if not computed", direction=API.Direction.OUTPUT) public long[] histogram_bins; @API(help="Start of histogram bin zero", direction=API.Direction.OUTPUT) public double histogram_base; @API(help="Stride per bin", direction=API.Direction.OUTPUT) public double histogram_stride; @API(help="Percentile values, matching the default percentiles", direction=API.Direction.OUTPUT) public double[] percentiles; transient Vec _vec; ColV3(String name, Vec vec, long off, int len, boolean is_full_column) { label = name; missing_count = vec.naCnt(); zero_count = vec.length() - vec.nzCnt() - missing_count; positive_infinity_count = vec.pinfs(); negative_infinity_count = vec.ninfs(); mins = vec.mins(); maxs = vec.maxs(); mean = vec.mean(); sigma = vec.sigma(); // Histogram data is only computed on-demand. By default here we do NOT // compute it, but will return any prior computed & cached histogram. histogram_bins = vec.lazy_bins(); histogram_base = histogram_bins == null ? 0 : vec.base(); histogram_stride = histogram_bins == null ? 0 : vec.stride(); percentiles = histogram_bins == null ? null : vec.pctiles(); type = vec.isUUID() ? "uuid" : vec.isString() ? "string" : vec.isCategorical() ? "enum" : vec.isTime() ? "time" : vec.isInt() ? "int" : "real"; domain = vec.domain(); if (vec.isCategorical()) { domain_cardinality = domain.length; } else { domain_cardinality = 0; } if (is_full_column) { len = (int) Math.min(len, vec.length() - off); if (vec.isUUID()) { string_data = new String[len]; for (int i = 0; i < len; i++) string_data[i] = vec.isNA(off + i) ? null : PrettyPrint.UUID(vec.at16l(off + i), vec.at16h(off + i)); data = null; } else if (vec.isString()) { string_data = new String[len]; BufferedString tmpStr = new BufferedString(); for (int i = 0; i < len; i++) string_data[i] = vec.isNA(off + i) ? null : vec.atStr(tmpStr, off + i).toString(); data = null; } else { data = MemoryManager.malloc8d(len); for (int i = 0; i < len; i++) data[i] = vec.at(off + i); string_data = null; } _vec = vec; // Better HTML display, not in the JSON } if (len > 0) // len == 0 is presumed to be a header file precision = vec.chunkForRow(0).precision(); } ColV3(String name, Vec vec, long off, int len) { this(name, vec, off, len, true); } public void clearBinsField() { this.histogram_bins = null; } } public FrameV3() { super(); } /* Key-only constructor, for the times we only want to return the key. */ public FrameV3(Key<Frame> frame_id) { this.frame_id = new FrameKeyV3(frame_id); } public FrameV3(Frame fr) { this(fr, 1, (int) fr.numRows(), 0, -1, -1, true); // NOTE: possible row len truncation } public FrameV3(Frame f, long row_offset, int row_count) { this(f, row_offset, row_count, 0, -1, -1, true); } public FrameV3(Frame f, long row_offset, int row_count, int column_offset, int column_count) { this.fillFromImpl(f, row_offset, row_count, column_offset, column_count, -1, true); } public FrameV3(Frame f, long row_offset, int row_count, int column_offset, int column_count, int full_column_count, boolean expensive) { this.fillFromImpl(f, row_offset, row_count, column_offset, column_count, full_column_count, expensive); } @Override public FrameV3 fillFromImpl(Frame f) { return fillFromImpl(f, 1, (int)f.numRows(), 0, -1, -1, false); } /** * * @param f frame from which to obtain the data * @param row_offset starting position for rows * @param row_count number or rows to obtain * @param column_offset starting position for columns * @param column_count number of columns to obtain * @param full_column_count number of columns starting at column_offset which will be obtained together with data. * The columns on positions between column_offset+full_column_count and column_offset+column_count * won't be backed by vectors so we won't transfer the data to the client side. By default, all columns * we ask for are full columns. * @param expensive whether to execute long-lasting but not exactly strictly required computations * @return desired frame slice */ private FrameV3 fillFromImpl(Frame f, long row_offset, int row_count, int column_offset, int column_count, int full_column_count, boolean expensive) { if( row_count < 0 ) row_count = 100; // 100 rows by default if( column_count < 0 ) column_count = f.numCols() - column_offset; // full width by default if( full_column_count < 0 || full_column_count > column_count) full_column_count=column_count; // light_column_count can't be larger then number of columns we asked for row_count = (int) Math.min(row_count, row_offset + f.numRows()); column_count = Math.min(column_count, column_offset + f.numCols()); this.frame_id = new FrameKeyV3(f._key); if (expensive) { this.checksum = f.checksum(); this.byte_size = f.byteSize(); } this.row_offset = row_offset; this.rows = f.numRows(); this.num_columns = f.numCols(); this.row_count = row_count; this.total_column_count = f.numCols(); this.column_offset = column_offset; this.column_count = column_count; this.full_column_count = full_column_count; this.columns = new ColV3[column_count]; Vec[] vecs = f.vecs(); Futures fs = new Futures(); // Compute rollups in parallel as needed, by starting all of them and using // them when filling in the ColV3 Schemas. // NOTE: SKIP deleted Vecs! The columns entry will be null for deleted Vecs. for( int i = 0; i < column_count; i++ ) if (null == DKV.get(vecs[column_offset + i]._key)) Log.warn("For Frame: " + f._key + ", Vec number: " + (column_offset + i) + " (" + f.name((column_offset + i))+ ") is missing; not returning it."); else vecs[column_offset + i].startRollupStats(fs); for( int i = 0; i < column_count; i++ ) if (null == DKV.get(vecs[column_offset + i]._key)) Log.warn("For Frame: " + f._key + ", Vec number: " + (column_offset + i) + " (" + f.name((column_offset + i))+ ") is missing; not returning it."); else columns[i] = new ColV3(f._names[column_offset + i], vecs[column_offset + i], this.row_offset, this.row_count, i < full_column_count); fs.blockForPending(); this.is_text = f.numCols()==1 && vecs[0] instanceof ByteVec; this.default_percentiles = Vec.PERCENTILES; if (expensive) { ChunkSummary cs = FrameUtils.chunkSummary(f); this.chunk_summary = new TwoDimTableV3(cs.toTwoDimTableChunkTypes()); this.distribution_summary = new TwoDimTableV3(cs.toTwoDimTableDistribution()); } this._fr = f; return this; } public void clearBinsField() { for (ColV3 col: columns) if (col != null) col.clearBinsField(); } private abstract static class ColOp { abstract String op(ColV3 v); } private String rollUpStr(ColV3 c, double d) { return formatCell(c.domain!=null || "uuid".equals(c.type) || "string".equals(c.type) ? Double.NaN : d,null,c,4); } private String formatCell( double d, String str, ColV3 c, int precision ) { if (Double.isNaN(d)) return "-"; if (c.domain != null) return c.domain[(int) d]; if ("uuid".equals(c.type) || "string".equals(c.type)) { // UUID and String handling if (str == null) return "-"; return "<b style=\"font-family:monospace;\">" + str + "</b>"; } else { Chunk chk = c._vec.chunkForRow(row_offset); return PrettyPrint.number(chk, d, precision); } } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FramesListV3.java
package water.api.schemas3; import water.api.API; import water.api.FramesHandler.Frames; import water.fvec.Frame; public class FramesListV3 extends RequestSchemaV3<Frames, FramesListV3> { // Input fields @API(help="Name of Frame of interest", json=false) public KeyV3.FrameKeyV3 frame_id; // Output fields @API(help="Frames", direction=API.Direction.OUTPUT) public FrameBaseV3[] frames; public FramesListV3 fillFromImplWithSynopsis(Frames f) { this.frame_id = new KeyV3.FrameKeyV3(f.frame_id); if (f.frames != null) { this.frames = new FrameSynopsisV3[f.frames.length]; int i = 0; for (Frame frame : f.frames) { this.frames[i++] = new FrameSynopsisV3(frame); } } return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FramesV3.java
package water.api.schemas3; import water.api.API; import water.api.FramesHandler.Frames; import water.fvec.Frame; import water.util.ExportFileFormat; public class FramesV3 extends RequestSchemaV3<Frames, FramesV3> { // Input fields @API(help="Name of Frame of interest", json=false) public KeyV3.FrameKeyV3 frame_id; @API(help="Name of column of interest", json=false) public String column; @API(help="Row offset to return", direction=API.Direction.INOUT) public long row_offset; @API(help="Number of rows to return", direction=API.Direction.INOUT) public int row_count = -1; @API(help="Column offset to return", direction=API.Direction.INOUT) public int column_offset; @API(help="Number of full columns to return. The columns between full_column_count and column_count will be returned without the data", direction=API.Direction.INOUT) public int full_column_count = -1; @API(help="Number of columns to return", direction=API.Direction.INOUT) public int column_count = -1; @API(help="Find and return compatible models?", json=false) public boolean find_compatible_models = false; @API(help="File output path",json=false) public String path; @API(help="Overwrite existing file",json=false) public boolean force; @API(help="Number of part files to use (1=single file,-1=automatic)",json=false) public int num_parts = 1; @API(help="Use parallel export to a single file (doesn't apply when num_parts != 1, creates temporary files in the destination directory)",json=false) public boolean parallel; @API(help="Output file format. Defaults to 'csv'.", values = { "csv", "parquet"} , json=false) public ExportFileFormat format; @API(help="Compression method (default none; gzip, bzip2, zstd and snappy available depending on runtime environment)") public String compression; @API(help="Specifies if checksum should be written next to data files on export (if supported by export format).") public boolean write_checksum = true; @API(help="Specifies if the timezone should be adjusted from local to UTC timezone (parquet only).") public boolean tz_adjust_from_local = false; @API(help="Field separator (default ',')") public byte separator = Frame.CSVStreamParams.DEFAULT_SEPARATOR; @API(help="Use header (default true)") public boolean header = true; @API(help="Quote column names in header line (default true)") public boolean quote_header = true; @API(help="Job for export file",direction=API.Direction.OUTPUT) public JobV3 job; // Output fields @API(help="Frames", direction=API.Direction.OUTPUT) public FrameV3[] frames; @API(help="Compatible models", direction=API.Direction.OUTPUT) public ModelSchemaV3[] compatible_models; @API(help="Domains", direction=API.Direction.OUTPUT) public String[][] domain; // Non-version-specific filling into the impl @Override public Frames fillImpl(Frames f) { super.fillImpl(f); if (frames != null) { f.frames = new Frame[frames.length]; int i = 0; for (FrameBaseV3 frame : this.frames) { f.frames[i++] = frame._fr; } } return f; } @Override public FramesV3 fillFromImpl(Frames f) { this.frame_id = new KeyV3.FrameKeyV3(f.frame_id); this.column = f.column; // NOTE: this is needed for request handling, but isn't really part of state this.find_compatible_models = f.find_compatible_models; if (f.frames != null) { this.frames = new FrameV3[f.frames.length]; int i = 0; for (Frame frame : f.frames) { this.frames[i++] = new FrameV3(frame, f.row_offset, f.row_count); } } return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/FriedmanPopescusHV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class FriedmanPopescusHV3 extends RequestSchemaV3<Iced, FriedmanPopescusHV3> { @API(help="Model id of interest", json = false) public KeyV3.ModelKeyV3 model_id; @API(help = "Frame the model has been fitted to", required = true) public FrameV3 frame; @API(help = "Variables of interest", required = true) public String[] variables; @API(help = "Value of H statistic") public double h; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/GarbageCollectV3.java
package water.api.schemas3; import water.Iced; public class GarbageCollectV3 extends SchemaV3<Iced, GarbageCollectV3> { }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/GridExportV3.java
package water.api.schemas3; import water.Iced; import water.api.API; import water.api.ModelExportAware; public class GridExportV3 extends SchemaV3<Iced, GridExportV3> implements ModelExportAware { @API(help = "ID of the Grid to load from the directory", required = true, direction = API.Direction.INPUT, level = API.Level.critical) public String grid_id; @API(help = "Path to the directory with saved Grid search", required = true, direction = API.Direction.INPUT, level = API.Level.critical) public String grid_directory; @API(help = "True if objects referenced by params should also be saved.", direction = API.Direction.INPUT) public boolean save_params_references = false; @API(direction = API.Direction.INPUT, help = "Flag indicating whether the exported model artifacts should also include CV Holdout Frame predictions", level = API.Level.secondary) public boolean export_cross_validation_predictions; @Override public boolean isExportCVPredictionsEnabled() { return export_cross_validation_predictions; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/GridImportV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class GridImportV3 extends SchemaV3<Iced, GridImportV3> { @API(help = "Full path to the file containing saved Grid", required = true, direction = API.Direction.INPUT, level = API.Level.critical) public String grid_path; @API(help = "If true will also load saved objects referenced by params. Will fail with an error if grid was saved without objects referenced by params.", direction = API.Direction.INPUT) public boolean load_params_references = false; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/H2OErrorV3.java
package water.api.schemas3; import water.H2OError; import water.api.API; import water.api.SpecifiesHttpResponseCode; import water.util.IcedHashMap; import water.util.IcedHashMapGeneric; /** * Schema which represents a back-end error which will be returned to the client. Such * errors may be caused by the user (specifying an object which has been removed) or due * to a failure which is out of the user's control. */ public class H2OErrorV3<I extends H2OError, S extends H2OErrorV3<I, S>> extends SchemaV3<I, S> implements SpecifiesHttpResponseCode { @API(help="Milliseconds since the epoch for the time that this H2OError instance was created. Generally this is a short time since the underlying error ocurred.", direction=API.Direction.OUTPUT) public long timestamp; @API(help="Error url", direction=API.Direction.OUTPUT) String error_url; @API(help="Message intended for the end user (a data scientist).", direction=API.Direction.OUTPUT) public String msg; @API(help="Potentially more detailed message intended for a developer (e.g. a front end engineer or someone designing a language binding).", direction=API.Direction.OUTPUT) public String dev_msg; @API(help="HTTP status code for this error.", direction=API.Direction.OUTPUT) public int http_status; // @API(help="Unique ID for this error instance, so that later we can build a dictionary of errors for docs and I18N.", direction=API.Direction.OUTPUT) // public int error_id; @API(help="Any values that are relevant to reporting or handling this error. Examples are a key name if the error is on a key, or a field name and object name if it's on a specific field.", direction=API.Direction.OUTPUT) public IcedHashMapGeneric.IcedHashMapStringObject values; @API(help="Exception type, if any.", direction=API.Direction.OUTPUT) public String exception_type; @API(help="Raw exception message, if any.", direction=API.Direction.OUTPUT) public String exception_msg; @API(help="Stacktrace, if any.", direction=API.Direction.OUTPUT) public String[] stacktrace; public int httpStatus() { return http_status; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/H2OModelBuilderErrorV3.java
package water.api.schemas3; import water.H2OModelBuilderError; import water.api.API; import water.api.SpecifiesHttpResponseCode; /** * Schema which represents a back-end error from the model building process which will be * returned to the client. Such errors may be caused by the user (specifying bad mode * building parameters) or due to a failure which is out of the user's control. * * <p> NOTE: parameters, validation_messages and error_count are in the schema in two * places. This is intentional, so that a client can handle it like any other H2OErrorV1 * by just rendering the values map, or like ModelBuilderSchema by looking at those fields * directly. * @see ModelBuilderJobV3 */ public class H2OModelBuilderErrorV3 extends H2OErrorV3<H2OModelBuilderError, H2OModelBuilderErrorV3> implements SpecifiesHttpResponseCode { @API(help="Model builder parameters.", direction = API.Direction.OUTPUT) public ModelParametersSchemaV3 parameters; @API(help="Parameter validation messages", direction=API.Direction.OUTPUT) public ValidationMessageV3 messages[]; @API(help="Count of parameter validation errors", direction=API.Direction.OUTPUT) public int error_count; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ImportFilesMultiV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class ImportFilesMultiV3 extends RequestSchemaV3<ImportFilesMultiV3.ImportFilesMulti, ImportFilesMultiV3> { public final static class ImportFilesMulti extends Iced<ImportFilesMulti> { public String[] paths; public String pattern; public String files[]; public String destination_frames[]; public String fails[]; public String dels[]; } // Input fields @API(help = "paths", required = true) public String[] paths; @API(help = "pattern", direction = API.Direction.INPUT) public String pattern; // Output fields @API(help = "files", direction = API.Direction.OUTPUT) public String files[]; @API(help = "names", direction = API.Direction.OUTPUT) public String destination_frames[]; @API(help = "fails", direction = API.Direction.OUTPUT) public String fails[]; @API(help = "dels", direction = API.Direction.OUTPUT) public String dels[]; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ImportFilesV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class ImportFilesV3 extends RequestSchemaV3<ImportFilesV3.ImportFiles, ImportFilesV3> { public final static class ImportFiles extends Iced { public String path; public String pattern; public String files[]; public String destination_frames[]; public String fails[]; public String dels[]; } // Input fields @API(help = "path", required = true) public String path; @API(help = "pattern", direction = API.Direction.INPUT) public String pattern; // Output fields @API(help = "files", direction = API.Direction.OUTPUT) public String files[]; @API(help = "names", direction = API.Direction.OUTPUT) public String destination_frames[]; @API(help = "fails", direction = API.Direction.OUTPUT) public String fails[]; @API(help = "dels", direction = API.Direction.OUTPUT) public String dels[]; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ImportHiveTableV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class ImportHiveTableV3 extends RequestSchemaV3<Iced, ImportHiveTableV3> { //Input fields @API(help = "database") public String database = ""; @API(help = "table", required = true) public String table = ""; @API(help = "partitions") public String[][] partitions; @API(help = "partitions") public boolean allow_multi_format = false; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ImportSQLTableV99.java
package water.api.schemas3; import water.Iced; import water.api.API; import water.jdbc.SqlFetchMode; public class ImportSQLTableV99 extends RequestSchemaV3<Iced,ImportSQLTableV99> { //Input fields @API(help = "connection_url", required = true) public String connection_url; @API(help = "table") public String table = ""; @API(help = "select_query") public String select_query = ""; @API(help = "use_temp_table") public String use_temp_table = null; @API(help = "temp_table_name") public String temp_table_name = null; @API(help = "username", required = true) public String username; @API(help = "password", required = true) public String password; @API(help = "columns") public String columns = "*"; @API(help = "Mode for data loading. All modes may not be supported by all databases.") public String fetch_mode; @API(help = "Desired number of chunks for the target Frame. Optional.") public String num_chunks_hint; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/InitIDV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class InitIDV3 extends RequestSchemaV3<Iced, InitIDV3> { @API(help="Session ID", direction = API.Direction.INOUT) public String session_key; @API(help="Indicates whether users are allowed to set and modify session properties", direction = API.Direction.OUTPUT) public boolean session_properties_allowed; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/InteractionV3.java
package water.api.schemas3; import hex.Interaction; import water.api.API; public class InteractionV3 extends RequestSchemaV3<Interaction, InteractionV3> { static public String[] own_fields = new String[] { "source_frame", "factor_columns", "pairwise", "max_factors", "min_occurrence" }; @API(help="destination key", direction=API.Direction.INOUT) public KeyV3.FrameKeyV3 dest; @API(help = "Input data frame", direction = API.Direction.INOUT) public KeyV3.FrameKeyV3 source_frame; @API(help = "Factor columns", is_member_of_frames = {"source_frame"}, direction = API.Direction.INOUT) public String[] factor_columns; @API(help = "Whether to create pairwise quadratic interactions between factors (otherwise create one higher-order interaction). Only applicable if there are 3 or more factors.", required = false, direction = API.Direction.INOUT) public boolean pairwise; @API(help = "Max. number of factor levels in pair-wise interaction terms (if enforced, one extra catch-all factor will be made)", required = true, direction = API.Direction.INOUT) public int max_factors; @API(help = "Min. occurrence threshold for factor levels in pair-wise interaction terms", direction = API.Direction.INOUT) public int min_occurrence; @Override public Interaction createImpl( ) { return new Interaction(); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/JStackV3.java
package water.api.schemas3; import water.api.API; import water.util.JStack; import water.util.JStackCollectorTask.DStackTrace; public class JStackV3 extends RequestSchemaV3<JStack, JStackV3> { @API(help="Stacktraces", direction=API.Direction.OUTPUT) public DStackTraceV3[] traces; public static class DStackTraceV3 extends SchemaV3<DStackTrace, DStackTraceV3> { public DStackTraceV3() { } @API(help="Node name", direction=API.Direction.OUTPUT) public String node; @API(help="Unix epoch time", direction=API.Direction.OUTPUT) public long time; @API(help="One trace per thread", direction=API.Direction.OUTPUT) public String[] thread_traces; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/JobV3.java
package water.api.schemas3; import water.*; import water.api.API; import water.api.schemas3.KeyV3.JobKeyV3; import water.exceptions.H2OIllegalArgumentException; import water.util.Log; import water.util.PojoUtils; import java.io.PrintWriter; import java.io.StringWriter; /** Schema for a single Job. */ public class JobV3 extends SchemaV3<Job, JobV3> { // Input fields @API(help="Job Key") public JobKeyV3 key; @API(help="Job description") public String description; // Output fields @API(help="job status", direction=API.Direction.OUTPUT) public String status; @API(help="progress, from 0 to 1", direction=API.Direction.OUTPUT) public float progress; // A number from 0 to 1 @API(help="current progress status description", direction=API.Direction.OUTPUT) public String progress_msg; @API(help="Start time", direction=API.Direction.OUTPUT) public long start_time; @API(help="Runtime in milliseconds", direction=API.Direction.OUTPUT) public long msec; @API(help="destination key", direction=API.Direction.INOUT) public KeyV3 dest; @API(help="exception", direction=API.Direction.OUTPUT) public String [] warnings; @API(help="exception", direction=API.Direction.OUTPUT) public String exception; @API(help="stacktrace", direction=API.Direction.OUTPUT) public String stacktrace; @API(help="recoverable", direction=API.Direction.OUTPUT) public boolean auto_recoverable; @API(help="ready for view", direction=API.Direction.OUTPUT) public boolean ready_for_view; //========================== // Custom adapters go here public JobV3() {} public JobV3(Job impl) { super(impl); } // Version&Schema-specific filling into the impl @SuppressWarnings("unchecked") @Override public Job createImpl( ) { throw H2O.fail(); } // Cannot make a new Job directly via REST // Version&Schema-specific filling from the impl @Override public JobV3 fillFromImpl( Job job ) { if( job == null ) return this; // Handle fields in subclasses: PojoUtils.copyProperties(this, job, PojoUtils.FieldNaming.ORIGIN_HAS_UNDERSCORES); PojoUtils.copyProperties(this, job, PojoUtils.FieldNaming.CONSISTENT); // TODO: make consistent and remove key = new JobKeyV3(job._key); description = job._description; warnings = job.warns(); progress = job.progress(); progress_msg = job.progress_msg(); // Bogus status; Job no longer has these states, but we fake it for /3/Job poller's. // Notice state "CREATED" no long exists and is never returned. // Notice new state "CANCEL_PENDING". if( job.isRunning() ) if( job.stop_requested() ) status = "CANCEL_PENDING"; else status = "RUNNING"; else if( job.stop_requested() ) status = "CANCELLED"; else status = "DONE"; Throwable ex = job.ex(); if( ex != null ) status = "FAILED"; exception = ex == null ? null : ex.toString(); if (ex!=null) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); stacktrace = sw.toString(); } msec = job.msec(); auto_recoverable = job.isRecoverable(); ready_for_view = job.readyForView(); Keyed dest_type; Value value = null; if (job._result != null) { value = DKV.get(job._result); } if (value != null) { dest_type = (Keyed) TypeMap.theFreezable(value.type()); } else { dest_type = (Keyed) TypeMap.theFreezable(job._typeid); } dest = job._result == null ? null : KeyV3.make(dest_type.makeSchema(), job._result); return this; } //========================== // Helper so Jobs can link to JobPoll public static String link(Key key) { return "/Jobs/"+key; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/JobsV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class JobsV3 extends RequestSchemaV3<Iced,JobsV3> { // Input fields @API(help="Optional Job identifier") public KeyV3.JobKeyV3 job_id; // Output fields @API(help="jobs", direction=API.Direction.OUTPUT) public JobV3[] jobs; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/KeyV3.java
package water.api.schemas3; import hex.Model; import hex.PartialDependence; import hex.segments.SegmentModels; import hex.grid.Grid; import water.*; import water.api.API; import water.parser.DecryptionTool; import water.rapids.Assembly; import water.exceptions.H2OIllegalArgumentException; import water.fvec.Frame; import water.fvec.Vec; import water.util.ReflectionUtils; import java.lang.reflect.Constructor; /** * <p> * Base Schema Class for Keys. Note that Key schemas are generally typed by the type of * object they point to (e.g., the front something like a Key<Frame>). * <p> * The type parameters are a bit subtle, because we have several schemas that map to Key, * by type. We want to be parameterized by the type of Keyed that we point to, but the * Iced type we pass up to Schema must be Iced, so that a lookup for a Schema for Key<T> * doesn't get an arbitrary subclass of KeyV3. */ public class KeyV3<I extends Iced, S extends KeyV3<I, S, K>, K extends Keyed> extends SchemaV3<I, KeyV3<I,S,K>> { @API(help="Name (string representation) for this Key.", direction = API.Direction.INOUT) public String name; @API(help="Name (string representation) for the type of Keyed this Key points to.", direction = API.Direction.INOUT) public String type; @API(help="URL for the resource that this Key points to, if one exists.", direction = API.Direction.INOUT) public String URL; public KeyV3() { // NOTE: this is a bit of a hack; without this we won't have the type parameter. // We'll be able to remove this once we have proper typed Key subclasses, like FrameKey. // Set the new type both in Schema and in SchemaV3, so that they are always in sync. String newType = "Key<" + getKeyedClassType() + ">"; __meta.schema_type = newType; setSchemaType_doNotCall(newType); } // need versioned public KeyV3(Key key) { this(); if (null != key) { Class clz = getKeyedClass(); Value v = DKV.get(key); if (null != v) { // Type checking of value from DKV if (Job.class.isAssignableFrom(clz) && !v.isJob()) throw new H2OIllegalArgumentException("For Key: " + key + " expected a value of type Job; found a: " + v.theFreezableClass(), "For Key: " + key + " expected a value of type Job; found a: " + v.theFreezableClass() + " (" + clz + ")"); else if (Frame.class.isAssignableFrom(clz) && !v.isFrame() && !v.isVec()) // NOTE: we currently allow Vecs to be fetched via the /Frames endpoint, so this constraint is relaxed accordingly. Note this means that if the user gets hold of a (hidden) Vec key and passes it to some other endpoint they will get an ugly error instead of an H2OIllegalArgumentException. throw new H2OIllegalArgumentException("For Key: " + key + " expected a value of type Frame; found a: " + v.theFreezableClass(), "For Key: " + key + " expected a value of type Frame; found a: " + v.theFreezableClass() + " (" + clz + ")"); else if (Model.class.isAssignableFrom(clz) && !v.isModel()) throw new H2OIllegalArgumentException("For Key: " + key + " expected a value of type Model; found a: " + v.theFreezableClass(), "For Key: " + key + " expected a value of type Model; found a: " + v.theFreezableClass() + " (" + clz + ")"); else if (Vec.class.isAssignableFrom(clz) && !v.isVec()) throw new H2OIllegalArgumentException("For Key: " + key + " expected a value of type Vec; found a: " + v.theFreezableClass(), "For Key: " + key + " expected a value of type Vec; found a: " + v.theFreezableClass() + " (" + clz + ")"); } this.fillFromImpl(key); } } public static KeyV3 make(Class<? extends KeyV3> clz, Key key) { try { Constructor c = clz.getConstructor(Key.class); return (KeyV3)c.newInstance(key); } catch (Exception e) { throw new H2OIllegalArgumentException("Caught exception trying to instantiate KeyV3 for class: " + clz.toString() + ": cause: " + e.getCause()); } } /** TODO: figure out the right KeyV3 class from the Key, so the type is set properly. */ public static KeyV3 make(Key key) { return make(KeyV3.class, key); } public static class JobKeyV3 extends KeyV3<Iced, JobKeyV3, Job> { public JobKeyV3() {} public JobKeyV3(Key<Job> key) { super(key); } } public static class FrameKeyV3 extends KeyV3<Iced, FrameKeyV3, Frame> { public FrameKeyV3() {} public FrameKeyV3(Key<Frame> key) { super(key); } } public static class ModelKeyV3<T extends Model> extends KeyV3<Iced, ModelKeyV3<T>, T> { public ModelKeyV3() {} public ModelKeyV3(Key<T> key) { super(key); } } public static class GridKeyV3 extends KeyV3<Iced, GridKeyV3, Grid> { public GridKeyV3() { } public GridKeyV3(Key<Grid> key) { super(key); } } public static class SegmentModelsKeyV3 extends KeyV3<Iced, SegmentModelsKeyV3, SegmentModels> { public SegmentModelsKeyV3() { } public SegmentModelsKeyV3(Key<SegmentModels> key) { super(key); } } public static class AssemblyKeyV3 extends KeyV3<Iced, AssemblyKeyV3, Assembly> { public AssemblyKeyV3() {} public AssemblyKeyV3(Key<Assembly> key) { super(key); } } public static class PartialDependenceKeyV3 extends KeyV3<Iced, PartialDependenceKeyV3, PartialDependence> { public PartialDependenceKeyV3() {} public PartialDependenceKeyV3(Key<PartialDependence> key) { super(key); } } public static class DecryptionToolKeyV3 extends KeyV3<Iced, DecryptionToolKeyV3, DecryptionTool> { public DecryptionToolKeyV3() {} public DecryptionToolKeyV3(Key<DecryptionTool> key) { super(key); } } @Override public S fillFromImpl(Iced i) { if (! (i instanceof Key)) throw new H2OIllegalArgumentException("fillFromImpl", "key", i); Key key = (Key)i; if (null == key) return (S)this; this.name = key.toString(); // Our type is generally determined by our type parameter, but some APIs use raw untyped KeyV3s to return multiple types. this.type = "Key<" + this.getKeyedClassType() + ">"; if ("Keyed".equals(this.type)) { // get the actual type, if the key points to a value in the DKV String vc = key.valueClassSimple(); if (null != vc) { this.type = "Key<" + vc + ">"; } } Class<? extends Keyed> keyed_class = this.getKeyedClass(); if (Job.class.isAssignableFrom(keyed_class)) this.URL = "/3/Jobs/" + key.toString(); else if (Frame.class.isAssignableFrom(keyed_class)) this.URL = "/3/Frames/" + key.toString(); else if (Model.class.isAssignableFrom(keyed_class)) this.URL = "/3/Models/" + key.toString(); else if (PartialDependence.class.isAssignableFrom(keyed_class)) this.URL = "/3/PartialDependence/" + key.toString(); else if (Vec.class.isAssignableFrom(keyed_class)) this.URL = null; else this.URL = null; return (S)this; } public static Class<? extends Keyed> getKeyedClass(Class<? extends KeyV3> clz) { // (Only) if we're a subclass of KeyV3 the Keyed class is type parameter 2. if (clz == KeyV3.class) return Keyed.class; return ReflectionUtils.findActualClassParameter(clz, 2); } public Class<? extends Keyed> getKeyedClass() { return getKeyedClass(this.getClass()); } public static String getKeyedClassType(Class<? extends KeyV3> clz) { Class<? extends Keyed> keyed_class = getKeyedClass(clz); return keyed_class.getSimpleName(); } public String getKeyedClassType() { return getKeyedClassType(this.getClass()); } public Key<K> key() { if (null == name) return null; return Key.make(this.name); } @Override public I createImpl() { return (I)Key.make(this.name); } @Override public String toString() { return type + " " + name; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/KeyValueV3.java
package water.api.schemas3; import hex.KeyValue; import water.api.API; import water.api.Schema; public class KeyValueV3 extends SchemaV3<KeyValue, KeyValueV3> implements Schema.AutoParseable { @API(help = "Key") String key; @API(help = "Value") double value; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/KillMinus3V3.java
package water.api.schemas3; import water.Iced; public class KillMinus3V3 extends RequestSchemaV3<Iced, KillMinus3V3> { }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/LogAndEchoV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class LogAndEchoV3 extends RequestSchemaV3<Iced, LogAndEchoV3> { //Input @API(help="Message to be Logged and Echoed") public String message; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/LogsV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class LogsV3 extends RequestSchemaV3<Iced, LogsV3> { @API(help="Identifier of the node to get logs from. It can be either node index starting from (0-based), where -1 means current node, or IP and port.", required = true, direction = API.Direction.INPUT) public String nodeidx; @API(help="Which specific log file to read from the log file directory. If left unspecified, the system chooses a default for you.", direction = API.Direction.INPUT) public String name; @API(help="Content of log file", direction = API.Direction.OUTPUT) public String log; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/MetadataV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public final class MetadataV3 extends RequestSchemaV3<Iced, MetadataV3> { @API(help="Number for specifying an endpoint", json=false) public int num; @API(help="HTTP method (GET, POST, DELETE) if fetching by path", json=false) public String http_method; @API(help="Path for specifying an endpoint", json=false) public String path; @API(help="Class name, for fetching docs for a schema (DEPRECATED)", json=false) public String classname; @API(help="Schema name (e.g., DocsV1), for fetching docs for a schema", json=false) public String schemaname; // Outputs @API(help="List of endpoint routes", direction=API.Direction.OUTPUT) public RouteV3[] routes; @API(help="List of schemas", direction=API.Direction.OUTPUT) public SchemaMetadataV3[] schemas; @API(help="Table of Contents Markdown", direction=API.Direction.OUTPUT) public String markdown; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/MissingInserterV3.java
package water.api.schemas3; import water.api.API; import water.api.schemas3.KeyV3.FrameKeyV3; import water.util.FrameUtils; import java.util.Random; public class MissingInserterV3 extends RequestSchemaV3<FrameUtils.MissingInserter, MissingInserterV3> { @API(help="dataset", required = true) public FrameKeyV3 dataset; @API(help="Fraction of data to replace with a missing value", required=true) public double fraction; @API(help="Seed", required = false) public long seed = new Random().nextLong(); @Override public FrameUtils.MissingInserter createImpl() { return new FrameUtils.MissingInserter(null, 0, 0); //fill dummy version } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelBuilderV3.java
package water.api.schemas3; import hex.ModelBuilder; import hex.schemas.ModelBuilderSchema; import water.api.*; /** * Job which includes the standard validation error fields, to allow us to capture * validation and other errors after the job building task has been forked. Some of * these will come from init(true); others may after the model build really begins. * @see H2OModelBuilderErrorV3 */ public class ModelBuilderV3<J extends ModelBuilder, S extends ModelBuilderV3<J, S>> extends SchemaV3<J, S> { @API(help="Model builder parameters.", direction = API.Direction.OUTPUT) public ModelParametersSchemaV3 parameters; @API(help="Info, warning and error messages; NOTE: can be appended to while the Job is running", direction=API.Direction.OUTPUT) public ValidationMessageV3 messages[]; @API(help="Count of error messages", direction=API.Direction.OUTPUT) public int error_count; @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++ ) this.messages[i] = new ValidationMessageV3().fillFromImpl(vms[i]); // TODO: version // Note: does default field_name mapping // 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; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelBuildersV3.java
package water.api.schemas3; import hex.schemas.ModelBuilderSchema; import water.Iced; import water.api.API; public class ModelBuildersV3 extends RequestSchemaV3<Iced, ModelBuildersV3> { // TODO: no validation yet, because right now fields are required if they have validation. @API(help = "Algo of ModelBuilder of interest", json = false) public String algo; // Output fields @API(help = "ModelBuilders", direction = API.Direction.OUTPUT) public ModelBuilderSchema.IcedHashMapStringModelBuilderSchema model_builders; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelExportV3.java
package water.api.schemas3; import water.Iced; import water.api.API; import water.api.ModelExportAware; /** * Model export REST end-point. */ public class ModelExportV3 extends RequestSchemaV3<Iced, ModelExportV3> implements ModelExportAware { /** Model to export. */ @API(help="Name of Model of interest", json=false) public KeyV3.ModelKeyV3 model_id; /** Destination directory to save exported model. */ @API(help="Destination file (hdfs, s3, local)") public String dir; /** Destination directory to save exported model. */ @API(help="Overwrite destination file in case it exists or throw exception if set to false.") public boolean force = true; @API(direction = API.Direction.INPUT, help = "Flag indicating whether the exported model artifact should also include CV Holdout Frame predictions", level = API.Level.secondary) public boolean export_cross_validation_predictions; @Override public boolean isExportCVPredictionsEnabled() { return export_cross_validation_predictions; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelImportV3.java
package water.api.schemas3; import water.Iced; import water.api.API; /** * Model import REST end-point. */ public class ModelImportV3 extends RequestSchemaV3<Iced, ModelImportV3> { // Input fields @API(help="Save imported model under given key into DKV.", json=false) public KeyV3.ModelKeyV3 model_id; @API(help="Source directory (hdfs, s3, local) containing serialized model") public String dir; @API(help="Override existing model in case it exists or throw exception if set to false") public boolean force = true; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsAutoEncoderV3.java
package water.api.schemas3; import hex.ModelMetricsAutoEncoder; public class ModelMetricsAutoEncoderV3 extends ModelMetricsBaseV3<ModelMetricsAutoEncoder, ModelMetricsAutoEncoderV3> { }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsBaseV3.java
package water.api.schemas3; import hex.Model; import hex.ModelCategory; import hex.ModelMetrics; import water.api.API; import water.api.schemas3.KeyV3.FrameKeyV3; import water.api.schemas3.KeyV3.ModelKeyV3; import water.fvec.Frame; import water.util.PojoUtils; /** * Base Schema for individual instances of ModelMetrics objects. Note: this class should not be used directly. */ public class ModelMetricsBaseV3<I extends ModelMetrics, S extends ModelMetricsBaseV3<I, S>> extends SchemaV3<I, S> { // InOut fields @API(help="The model used for this scoring run.", direction=API.Direction.INOUT) public ModelKeyV3 model; @API(help="The checksum for the model used for this scoring run.", direction=API.Direction.INOUT) public long model_checksum; @API(help="The frame used for this scoring run.", direction=API.Direction.INOUT) public FrameKeyV3 frame; @API(help="The checksum for the frame used for this scoring run.", direction=API.Direction.INOUT) public long frame_checksum; // Output fields @API(help="Optional description for this scoring run (to note out-of-bag, sampled data, etc.)", direction=API.Direction.OUTPUT) public String description; @API(help="The category (e.g., Clustering) for the model used for this scoring run.", values={"Unknown", "Binomial", "BinomialUplift", "Ordinal", "Multinomial", "Regression", "Clustering"}, direction=API.Direction.OUTPUT) public ModelCategory model_category; // @API(help="The duration in mS for this scoring run.", direction=API.Direction.OUTPUT) // public long duration_in_ms; @API(help="The time in mS since the epoch for the start of this scoring run.", direction=API.Direction.OUTPUT) public long scoring_time; @API(help="Predictions Frame.", direction=API.Direction.OUTPUT) public FrameV3 predictions; @API(help = "The Mean Squared Error of the prediction for this scoring run.", direction = API.Direction.OUTPUT) public double MSE; @API(help = "The Root Mean Squared Error of the prediction for this scoring run.", direction = API.Direction.OUTPUT) public double RMSE; @API(help="Number of observations.") public long nobs; @API(help="Name of custom metric", direction = API.Direction.OUTPUT) public String custom_metric_name; @API(help="Value of custom metric", direction = API.Direction.OUTPUT) public double custom_metric_value; public ModelMetricsBaseV3() {} public ModelMetricsBaseV3(I impl) { super(impl); } @Override public S fillFromImpl(ModelMetrics modelMetrics) { // If we're copying in a Model we need a ModelSchemaV3 of the right class to fill into. Model m = modelMetrics.model(); if( m != null ) { this.model = new ModelKeyV3(m._key); this.model_category = m._output.getModelCategory(); this.model_checksum = m.checksum(); } // If we're copying in a Frame we need a Frame Schema of the right class to fill into. Frame f = modelMetrics.frame(); if (null != f) { //true == f.getClass().getSuperclass().getGenericSuperclass() instanceof ParameterizedType this.frame = new FrameKeyV3(f._key); this.frame_checksum = f.checksum(); } PojoUtils.copyProperties(this, modelMetrics, PojoUtils.FieldNaming.ORIGIN_HAS_UNDERSCORES, new String[]{"model", "model_category", "model_checksum", "frame", "frame_checksum", "custom_metric"}); RMSE=modelMetrics.rmse(); // Fill the custom metric if (modelMetrics._custom_metric != null) { custom_metric_name = modelMetrics._custom_metric.name; custom_metric_value = modelMetrics._custom_metric.value; } return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsBinomialGLMGenericV3.java
package water.api.schemas3; import hex.ModelMetricsBinomialGLMGeneric; import water.api.API; public class ModelMetricsBinomialGLMGenericV3<I extends ModelMetricsBinomialGLMGeneric, S extends ModelMetricsBinomialGLMGenericV3<I, S>> extends ModelMetricsBinomialGenericV3<I, S> { @API(help="residual deviance",direction = API.Direction.OUTPUT) public double residual_deviance; @API(help="null deviance",direction = API.Direction.OUTPUT) public double null_deviance; @API(help="AIC",direction = API.Direction.OUTPUT) public double AIC; @API(help="log likelihood",direction = API.Direction.OUTPUT) public double loglikelihood; @API(help="null DOF", direction= API.Direction.OUTPUT) public long null_degrees_of_freedom; @API(help="residual DOF", direction= API.Direction.OUTPUT) public long residual_degrees_of_freedom; @API(direction = API.Direction.OUTPUT, help="coefficients_table") public TwoDimTableV3 coefficients_table; // Originally not part of metrics, put here to avoid GenericOutput having multiple output classes. @Override public S fillFromImpl(ModelMetricsBinomialGLMGeneric modelMetrics) { super.fillFromImpl(modelMetrics); this.AIC = modelMetrics._AIC; this.loglikelihood = modelMetrics._loglikelihood; this.residual_deviance = modelMetrics._resDev; this.null_deviance = modelMetrics._nullDev; this.null_degrees_of_freedom = modelMetrics._nullDegreesOfFreedom; this.residual_degrees_of_freedom = modelMetrics._residualDegreesOfFreedom; coefficients_table = modelMetrics._coefficients_table != null ?new TwoDimTableV3().fillFromImpl(modelMetrics._coefficients_table) : null; return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsBinomialGLMV3.java
package water.api.schemas3; import hex.ModelMetricsBinomialGLM; import water.api.API; import water.api.API.Direction; public class ModelMetricsBinomialGLMV3 extends ModelMetricsBinomialV3<ModelMetricsBinomialGLM, ModelMetricsBinomialGLMV3> { @API(help="residual deviance",direction = Direction.OUTPUT) public double residual_deviance; @API(help="null deviance",direction = Direction.OUTPUT) public double null_deviance; @API(help="AIC",direction = Direction.OUTPUT) public double AIC; @API(help="log likelihood",direction = Direction.OUTPUT) public double loglikelihood; @API(help="null DOF", direction= Direction.OUTPUT) public long null_degrees_of_freedom; @API(help="residual DOF", direction= Direction.OUTPUT) public long residual_degrees_of_freedom; @Override public ModelMetricsBinomialGLMV3 fillFromImpl(ModelMetricsBinomialGLM modelMetrics) { super.fillFromImpl(modelMetrics); this.AIC = modelMetrics._AIC; this.loglikelihood = modelMetrics._loglikelihood; this.residual_deviance = modelMetrics._resDev; this.null_deviance = modelMetrics._nullDev; this.null_degrees_of_freedom = modelMetrics._nullDegreesOfFreedom; this.residual_degrees_of_freedom = modelMetrics._residualDegreesOfFreedom; return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsBinomialGenericV3.java
package water.api.schemas3; import hex.ModelMetricsBinomialGeneric; public class ModelMetricsBinomialGenericV3<I extends ModelMetricsBinomialGeneric, S extends ModelMetricsBinomialGenericV3<I, S>> extends ModelMetricsBinomialV3<I, S> { @Override public S fillFromImpl(ModelMetricsBinomialGeneric modelMetrics) { super.fillFromImpl(modelMetrics); r2 = modelMetrics.r2(); logloss = modelMetrics._logloss; loglikelihood = modelMetrics._loglikelihood; AIC = modelMetrics._aic; if (modelMetrics != null && modelMetrics._confusion_matrix != null) { final ConfusionMatrixV3 convertedConfusionMatrix = new ConfusionMatrixV3(); convertedConfusionMatrix.table = new TwoDimTableV3().fillFromImpl(modelMetrics._confusion_matrix); this.cm = convertedConfusionMatrix; } if (modelMetrics._thresholds_and_metric_scores != null) { // Possibly overwrites whatever has been set in the ModelMetricsBinomialV3 this.thresholds_and_metric_scores = new TwoDimTableV3().fillFromImpl(modelMetrics._thresholds_and_metric_scores); } if (modelMetrics._max_criteria_and_metric_scores != null) { // Possibly overwrites whatever has been set in the ModelMetricsBinomialV3 max_criteria_and_metric_scores = new TwoDimTableV3().fillFromImpl(modelMetrics._max_criteria_and_metric_scores); } if (modelMetrics._gainsLiftTable != null) { // Possibly overwrites whatever has been set in the ModelMetricsBinomialV3 this.gains_lift_table = new TwoDimTableV3().fillFromImpl(modelMetrics._gainsLiftTable); } return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsBinomialUpliftGenericV3.java
package water.api.schemas3; import hex.ModelMetricsBinomialUpliftGeneric; public class ModelMetricsBinomialUpliftGenericV3<I extends ModelMetricsBinomialUpliftGeneric, S extends ModelMetricsBinomialUpliftGenericV3<I, S>> extends ModelMetricsBinomialUpliftV3<I, S> { @Override public S fillFromImpl(ModelMetricsBinomialUpliftGeneric modelMetrics) { super.fillFromImpl(modelMetrics); this.AUUC = modelMetrics._auuc.auuc(); this.auuc_normalized = modelMetrics._auuc.auucNormalized(); this.ate = modelMetrics.ate(); this.att = modelMetrics.att(); this.atc = modelMetrics.atc(); this.qini = modelMetrics.qini(); if (modelMetrics._auuc_table != null) { // Possibly overwrites whatever has been set in the ModelMetricsBinomialV3 this.auuc_table = new TwoDimTableV3().fillFromImpl(modelMetrics._auuc_table); } if (modelMetrics._aecu_table != null) { // Possibly overwrites whatever has been set in the ModelMetricsBinomialV3 this.aecu_table = new TwoDimTableV3().fillFromImpl(modelMetrics._aecu_table); } if (modelMetrics._thresholds_and_metric_scores != null) { // Possibly overwrites whatever has been set in the ModelMetricsBinomialV3 this.thresholds_and_metric_scores = new TwoDimTableV3().fillFromImpl(modelMetrics._thresholds_and_metric_scores); } return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsBinomialUpliftV3.java
package water.api.schemas3; import hex.AUUC; import hex.ModelMetricsBinomialUplift; import water.api.API; import water.util.ArrayUtils; import water.util.EnumUtils; import water.util.TwoDimTable; import hex.AUUC.AUUCType; import java.util.Arrays; public class ModelMetricsBinomialUpliftV3<I extends ModelMetricsBinomialUplift, S extends water.api.schemas3.ModelMetricsBinomialUpliftV3<I, S>> extends ModelMetricsBaseV3<I,S> { @API(help="Average Treatment Effect.", direction=API.Direction.OUTPUT) public double ate; @API(help="Average Treatment Effect on the Treated.", direction=API.Direction.OUTPUT) public double att; @API(help="Average Treatment Effect on the Control.", direction=API.Direction.OUTPUT) public double atc; @API(help="The default AUUC for this scoring run.", direction=API.Direction.OUTPUT) public double AUUC; @API(help="The default normalized AUUC for this scoring run.", direction=API.Direction.OUTPUT) public double auuc_normalized; @API(help="The Qini value for this scoring run.", direction=API.Direction.OUTPUT) public double qini; @API(help="The class labels of the response.", direction=API.Direction.OUTPUT) public String[] domain; @API(help = "The metrics for various thresholds.", direction = API.Direction.OUTPUT, level = API.Level.expert) public TwoDimTableV3 thresholds_and_metric_scores; @API(help = "Table of all types of AUUC.", direction = API.Direction.OUTPUT, level = API.Level.secondary) public TwoDimTableV3 auuc_table; @API(help = "Table of all types of AECU values.", direction = API.Direction.OUTPUT, level = API.Level.secondary) public TwoDimTableV3 aecu_table; @Override public S fillFromImpl(ModelMetricsBinomialUplift modelMetrics) { super.fillFromImpl(modelMetrics); AUUC auuc = modelMetrics._auuc; if (null != auuc) { ate = modelMetrics.ate(); att = modelMetrics.att(); atc = modelMetrics.atc(); AUUC = auuc.auuc(); auuc_normalized = auuc.auucNormalized(); qini = auuc.qini(); // Fill TwoDimTable String[] thresholds = new String[auuc._nBins]; AUUCType metrics[] = AUUCType.VALUES_WITHOUT_AUTO; int metricsLength = metrics.length; long[] n = new long[auuc._nBins]; double[][] uplift = new double[metricsLength][]; double[][] upliftNormalized = new double[metricsLength][]; double[][] upliftRandom = new double[metricsLength][]; for( int i = 0; i < auuc._nBins; i++ ) { thresholds[i] = Double.toString(auuc._ths[i]); n[i] = auuc._frequencyCumsum[i]; } String[] colHeaders = new String[3 * metricsLength + 3]; String[] types = new String[3 * metricsLength + 3]; String[] formats = new String[3 * metricsLength + 3]; colHeaders[0] = "thresholds"; types[0] = "double"; formats[0] = "%f"; int i; for (i = 0; i < metricsLength; i++) { colHeaders[i + 1] = metrics[i].toString(); colHeaders[(i + 1 + metricsLength)] = metrics[i].toString()+"_normalized"; colHeaders[(i + 1 + 2 * metricsLength)] = metrics[i].toString()+"_random"; uplift[i] = auuc.upliftByType(metrics[i]); upliftNormalized[i] = auuc.upliftNormalizedByType(metrics[i]); upliftRandom[i] = auuc.upliftRandomByType(metrics[i]); types [i + 1] = "double"; formats [i + 1] = "%f"; types [i + 1 + metricsLength] = "double"; formats [i + 1 + metricsLength] = "%f"; types [i + 1 + 2 * metricsLength] = "double"; formats [i + 1 + 2 * metricsLength] = "%f"; } colHeaders[i + 1 + 2 * metricsLength] = "n"; types[i + 1 + 2 * metricsLength] = "long"; formats[i + 1 + 2 * metricsLength] = "%d"; colHeaders[i + 2 + 2 * metricsLength] = "idx"; types[i + 2 + 2 * metricsLength] = "int"; formats[i + 2 + 2 * metricsLength] = "%d"; TwoDimTable thresholdsByMetrics = new TwoDimTable("Metrics for Thresholds", "Cumulative Uplift metrics for a given percentile", new String[auuc._nBins], colHeaders, types, formats, null ); for (i = 0; i < auuc._nBins; i++) { int j = 0; thresholdsByMetrics.set(i, j, Double.valueOf(thresholds[i])); for (j = 0; j < metricsLength; j++) { thresholdsByMetrics.set(i, 1 + j, uplift[j][i]); thresholdsByMetrics.set(i, 1 + j + metricsLength, upliftNormalized[j][i]); thresholdsByMetrics.set(i, 1 + j + 2 * metricsLength, upliftRandom[j][i]); } thresholdsByMetrics.set(i, 1 + j + 2 * metricsLength, n[i]); thresholdsByMetrics.set(i, 2 + j + 2 * metricsLength, i); } this.thresholds_and_metric_scores = new TwoDimTableV3().fillFromImpl(thresholdsByMetrics); // fill AUUC table String[] rowHeaders = new String[]{"AUUC value", "AUUC normalized", "AUUC random value"}; String[] metricNames = EnumUtils.getNames(AUUCType.class); colHeaders = ArrayUtils.remove(metricNames, Arrays.asList(metricNames).indexOf("AUTO")); types = new String[metricsLength]; formats = new String[metricsLength]; for (i = 0; i < metricsLength; i++){ types[i] = "double"; formats[i] = "%f"; } TwoDimTable auucs = new TwoDimTable("AUUC table (number of bins: "+auuc._nBins+ ")", "All types of AUUC value", rowHeaders, colHeaders, types, formats, "Uplift type" ); for (i = 0; i < metricsLength; i++) { auucs.set(0, i, auuc.auucByType(metrics[i])); auucs.set(1, i, auuc.auucNormalizedByType(metrics[i])); auucs.set(2, i, auuc.auucRandomByType(metrics[i])); } this.auuc_table = new TwoDimTableV3().fillFromImpl(auucs); rowHeaders = new String[]{"AECU value"}; TwoDimTable qinis = new TwoDimTable("AECU values table", "All types of AECU value", rowHeaders, colHeaders, types, formats, "Uplift type" ); for (i = 0; i < metricsLength; i++) { qinis.set(0, i, auuc.aecuByType(metrics[i])); } this.aecu_table = new TwoDimTableV3().fillFromImpl(qinis); } return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsBinomialV3.java
package water.api.schemas3; import hex.AUC2; import hex.ConfusionMatrix; import hex.ModelMetricsBinomial; import water.api.API; import water.api.SchemaServer; import water.util.TwoDimTable; public class ModelMetricsBinomialV3<I extends ModelMetricsBinomial, S extends ModelMetricsBinomialV3<I, S>> extends ModelMetricsBaseV3<I,S> { // @API(help="The standard deviation of the training response.", direction=API.Direction.OUTPUT) // public double sigma; // Belongs in a mythical ModelMetricsSupervisedV3 @API(help="The R^2 for this scoring run.", direction=API.Direction.OUTPUT) public double r2; @API(help="The logarithmic loss for this scoring run.", direction=API.Direction.OUTPUT) public double logloss; @API(help="The logarithmic likelihood for this scoring run.", direction=API.Direction.OUTPUT) public double loglikelihood; @API(help="The AIC for this scoring run.", direction=API.Direction.OUTPUT) public double AIC; @API(help="The AUC for this scoring run.", direction=API.Direction.OUTPUT) public double AUC; @API(help="The precision-recall AUC for this scoring run.", direction=API.Direction.OUTPUT) public double pr_auc; @API(help="The Gini score for this scoring run.", direction=API.Direction.OUTPUT) public double Gini; @API(help="The mean misclassification error per class.", direction=API.Direction.OUTPUT) public double mean_per_class_error; @API(help="The class labels of the response.", direction=API.Direction.OUTPUT) public String[] domain; @API(help = "The ConfusionMatrix at the threshold for maximum F1.", direction = API.Direction.OUTPUT) public ConfusionMatrixV3 cm; @API(help = "The Metrics for various thresholds.", direction = API.Direction.OUTPUT, level = API.Level.expert) public TwoDimTableV3 thresholds_and_metric_scores; @API(help = "The Metrics for various criteria.", direction = API.Direction.OUTPUT, level = API.Level.secondary) public TwoDimTableV3 max_criteria_and_metric_scores; @API(help = "Gains and Lift table.", direction = API.Direction.OUTPUT, level = API.Level.secondary) public TwoDimTableV3 gains_lift_table; @Override public S fillFromImpl(ModelMetricsBinomial modelMetrics) { super.fillFromImpl(modelMetrics); // sigma = modelMetrics._sigma; r2 = modelMetrics.r2(); logloss = modelMetrics._logloss; loglikelihood = modelMetrics._loglikelihood; AIC = modelMetrics._aic; mean_per_class_error = modelMetrics._mean_per_class_error; if (null != modelMetrics.cm()) { ConfusionMatrix cm = modelMetrics.cm(); cm.table(); // Fill in lazy table, for icing this.cm = (ConfusionMatrixV3) SchemaServer.schema(this.getSchemaVersion(), cm).fillFromImpl(cm); } AUC2 auc = modelMetrics._auc; if (auc != null) { AUC = auc._auc; Gini = auc._gini; pr_auc = auc._pr_auc; if (!auc.isEmpty()) { // Fill TwoDimTable String[] thresholds = new String[auc._nBins]; for (int i = 0; i < auc._nBins; i++) thresholds[i] = Double.toString(auc._ths[i]); AUC2.ThresholdCriterion crits[] = AUC2.ThresholdCriterion.VALUES; String[] colHeaders = new String[crits.length + 2]; String[] colHeadersMax = new String[crits.length]; String[] types = new String[crits.length + 2]; String[] formats = new String[crits.length + 2]; colHeaders[0] = "Threshold"; types[0] = "double"; formats[0] = "%f"; int i; for (i = 0; i < crits.length; i++) { if (colHeadersMax.length > i) colHeadersMax[i] = "max " + crits[i].toString(); colHeaders[i + 1] = crits[i].toString(); types[i + 1] = crits[i]._isInt ? "long" : "double"; formats[i + 1] = crits[i]._isInt ? "%d" : "%f"; } colHeaders[i + 1] = "idx"; types[i + 1] = "int"; formats[i + 1] = "%d"; TwoDimTable thresholdsByMetrics = new TwoDimTable("Metrics for Thresholds", "Binomial metrics as a function of classification thresholds", new String[auc._nBins], colHeaders, types, formats, null); for (i = 0; i < auc._nBins; i++) { int j = 0; thresholdsByMetrics.set(i, j, Double.valueOf(thresholds[i])); for (j = 0; j < crits.length; j++) { double d = crits[j].exec(auc, i); // Note: casts to Object are NOT redundant thresholdsByMetrics.set(i, 1 + j, crits[j]._isInt ? (Object) ((long) d) : d); } thresholdsByMetrics.set(i, 1 + j, i); } this.thresholds_and_metric_scores = new TwoDimTableV3().fillFromImpl(thresholdsByMetrics); // Fill TwoDimTable TwoDimTable maxMetrics = new TwoDimTable("Maximum Metrics", "Maximum metrics at their respective thresholds", colHeadersMax, new String[]{"Threshold", "Value", "idx"}, new String[]{"double", "double", "long"}, new String[]{"%f", "%f", "%d"}, "Metric"); for (i = 0; i < colHeadersMax.length; i++) { int idx = crits[i].max_criterion_idx(auc); maxMetrics.set(i, 0, idx == -1 ? Double.NaN : auc._ths[idx]); maxMetrics.set(i, 1, idx == -1 ? Double.NaN : crits[i].exec(auc, idx)); maxMetrics.set(i, 2, idx); } max_criteria_and_metric_scores = new TwoDimTableV3().fillFromImpl(maxMetrics); } } if (modelMetrics._gainsLift != null) { TwoDimTable t = modelMetrics._gainsLift.createTwoDimTable(); if (t!=null) this.gains_lift_table = new TwoDimTableV3().fillFromImpl(t); } return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsClusteringV3.java
package water.api.schemas3; import hex.ModelMetricsClustering; import water.api.API; import water.util.TwoDimTable; public class ModelMetricsClusteringV3 extends ModelMetricsBaseV3<ModelMetricsClustering, ModelMetricsClusteringV3> { @API(help="Within Cluster Sum of Square Error") public double tot_withinss; // Total within-cluster sum-of-square error @API(help="Total Sum of Square Error to Grand Mean") public double totss; // Total sum-of-square error to grand mean centroid @API(help="Between Cluster Sum of Square Error") public double betweenss; @API(help="Centroid Statistics") public TwoDimTableV3 centroid_stats; @Override public ModelMetricsClusteringV3 fillFromImpl(ModelMetricsClustering impl) { ModelMetricsClusteringV3 mm = super.fillFromImpl(impl); TwoDimTable tdt = impl.createCentroidStatsTable(); if (tdt != null) mm.centroid_stats = new TwoDimTableV3().fillFromImpl(tdt); return mm; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsMultinomialGLMGenericV3.java
package water.api.schemas3; import hex.ModelMetricsMultinomialGLMGeneric; import water.api.API; import water.api.API.Direction; public class ModelMetricsMultinomialGLMGenericV3 extends ModelMetricsMultinomialV3<ModelMetricsMultinomialGLMGeneric, ModelMetricsMultinomialGLMGenericV3> { @API(help="residual deviance",direction = Direction.OUTPUT) public double residual_deviance; @API(help="null deviance",direction = Direction.OUTPUT) public double null_deviance; @API(help="AIC",direction = Direction.OUTPUT) public double AIC; @API(help="log likelihood",direction = Direction.OUTPUT) public double loglikelihood; @API(help="null DOF", direction= Direction.OUTPUT) public long null_degrees_of_freedom; @API(help="residual DOF", direction= Direction.OUTPUT) public long residual_degrees_of_freedom; @API(direction = API.Direction.OUTPUT, help="coefficients_table") public TwoDimTableV3 coefficients_table; // Originally not part of metrics, put here to avoid GenericOutput having multiple output classes. @Override public ModelMetricsMultinomialGLMGenericV3 fillFromImpl(ModelMetricsMultinomialGLMGeneric mms) { super.fillFromImpl(mms); this.AIC = mms._AIC; this.loglikelihood = mms._loglikelihood; this.residual_deviance = mms._resDev; this.null_deviance = mms._nullDev; this.null_degrees_of_freedom = mms._nullDegreesOfFreedom; this.residual_degrees_of_freedom = mms._residualDegreesOfFreedom; this.coefficients_table = mms._coefficients_table != null ? new TwoDimTableV3().fillFromImpl(mms._coefficients_table) : null; this.r2 = mms.r2(); if (mms._hit_ratio_table != null) { hit_ratio_table = new TwoDimTableV3(mms._hit_ratio_table); } if (null != mms._confusion_matrix_table) { final ConfusionMatrixV3 convertedConfusionMatrix = new ConfusionMatrixV3(); convertedConfusionMatrix.table = new TwoDimTableV3().fillFromImpl(mms._confusion_matrix_table); this.cm = convertedConfusionMatrix; } return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsMultinomialGLMV3.java
package water.api.schemas3; import hex.ModelMetricsBinomialGLM.ModelMetricsMultinomialGLM; import water.api.API; import water.api.API.Direction; public class ModelMetricsMultinomialGLMV3 extends ModelMetricsMultinomialV3<ModelMetricsMultinomialGLM, ModelMetricsMultinomialGLMV3> { @API(help="residual deviance",direction = Direction.OUTPUT) public double residual_deviance; @API(help="null deviance",direction = Direction.OUTPUT) public double null_deviance; @API(help="AIC",direction = Direction.OUTPUT) public double AIC; @API(help="log likelihood",direction = Direction.OUTPUT) public double loglikelihood; @API(help="null DOF", direction= Direction.OUTPUT) public long null_degrees_of_freedom; @API(help="residual DOF", direction= Direction.OUTPUT) public long residual_degrees_of_freedom; @Override public ModelMetricsMultinomialGLMV3 fillFromImpl(ModelMetricsMultinomialGLM mms) { super.fillFromImpl(mms); this.AIC = mms._AIC; this.loglikelihood = mms._loglikelihood; this.residual_deviance = mms._resDev; this.null_deviance = mms._nullDev; this.null_degrees_of_freedom = mms._nullDegreesOfFreedom; this.residual_degrees_of_freedom = mms._residualDegreesOfFreedom; return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsMultinomialGenericV3.java
package water.api.schemas3; import hex.ModelMetricsMultinomialGeneric; public class ModelMetricsMultinomialGenericV3<I extends ModelMetricsMultinomialGeneric, S extends ModelMetricsMultinomialGenericV3<I, S>> extends ModelMetricsMultinomialV3<I, S> { @Override public S fillFromImpl(I modelMetrics) { super.fillFromImpl(modelMetrics); logloss = modelMetrics._logloss; loglikelihood = modelMetrics.loglikelihood(); AIC = modelMetrics.aic(); r2 = modelMetrics.r2(); if (modelMetrics._hit_ratio_table != null) { hit_ratio_table = new TwoDimTableV3(modelMetrics._hit_ratio_table); } if (null != modelMetrics._confusion_matrix_table) { final ConfusionMatrixV3 convertedConfusionMatrix = new ConfusionMatrixV3(); convertedConfusionMatrix.table = new TwoDimTableV3().fillFromImpl(modelMetrics._confusion_matrix_table); this.cm = convertedConfusionMatrix; } AUC = modelMetrics.auc(); pr_auc = modelMetrics.pr_auc(); if(null != modelMetrics._multinomial_auc_table){ multinomial_auc_table = new TwoDimTableV3(modelMetrics._multinomial_auc_table); } if(null != modelMetrics._multinomial_aucpr_table){ multinomial_aucpr_table = new TwoDimTableV3(modelMetrics._multinomial_aucpr_table); } return (S)this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsMultinomialV3.java
package water.api.schemas3; import hex.AUC2; import hex.ModelMetricsMultinomial; import hex.PairwiseAUC; import water.api.API; import water.api.SchemaServer; import water.util.TwoDimTable; import static hex.ModelMetricsMultinomial.*; public class ModelMetricsMultinomialV3<I extends ModelMetricsMultinomial, S extends ModelMetricsMultinomialV3<I, S>> extends ModelMetricsBaseV3<I, S> { @API(help="The R^2 for this scoring run.", direction=API.Direction.OUTPUT) public double r2; @API(help="The hit ratio table for this scoring run.", direction=API.Direction.OUTPUT, level= API.Level.expert) public TwoDimTableV3 hit_ratio_table; @API(help="The ConfusionMatrix object for this scoring run.", direction=API.Direction.OUTPUT) public ConfusionMatrixV3 cm; @API(help="The logarithmic loss for this scoring run.", direction=API.Direction.OUTPUT) public double logloss; @API(help="The logarithmic likelihood for this scoring run.", direction=API.Direction.OUTPUT) public double loglikelihood; @API(help="The AIC for this scoring run.", direction=API.Direction.OUTPUT) public double AIC; @API(help="The mean misclassification error per class.", direction=API.Direction.OUTPUT) public double mean_per_class_error; @API(help="The average AUC for this scoring run.", direction=API.Direction.OUTPUT) public double AUC; @API(help="The average precision-recall AUC for this scoring run.", direction=API.Direction.OUTPUT) public double pr_auc; @API(help="The multinomial AUC values.", direction=API.Direction.OUTPUT, level= API.Level.expert) public TwoDimTableV3 multinomial_auc_table; @API(help="The multinomial PR AUC values.", direction=API.Direction.OUTPUT, level= API.Level.expert) public TwoDimTableV3 multinomial_aucpr_table; @Override public S fillFromImpl(I modelMetrics) { super.fillFromImpl(modelMetrics); logloss = modelMetrics.logloss(); loglikelihood = modelMetrics.loglikelihood(); AIC = modelMetrics.aic(); r2 = modelMetrics.r2(); if (modelMetrics._hit_ratios != null) { TwoDimTable table = getHitRatioTable(modelMetrics._hit_ratios); hit_ratio_table = (TwoDimTableV3) SchemaServer.schema(this.getSchemaVersion(), table).fillFromImpl(table); } AUC = modelMetrics.auc(); pr_auc = modelMetrics.pr_auc(); if (modelMetrics._auc != null && modelMetrics._auc._calculateAuc) { TwoDimTable aucTable = modelMetrics._auc.getTable(false); multinomial_auc_table = (TwoDimTableV3) SchemaServer.schema(this.getSchemaVersion(), aucTable).fillFromImpl(aucTable); TwoDimTable aucprTable = modelMetrics._auc.getTable(true); multinomial_aucpr_table = (TwoDimTableV3) SchemaServer.schema(this.getSchemaVersion(), aucprTable).fillFromImpl(aucprTable); } if (null != modelMetrics._cm) { modelMetrics._cm.table(); // Fill in lazy table, for icing cm = (ConfusionMatrixV3) SchemaServer.schema(this.getSchemaVersion(), modelMetrics._cm).fillFromImpl (modelMetrics._cm); } return (S)this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsOrdinalGLMGenericV3.java
package water.api.schemas3; import hex.ModelMetricsOrdinalGLMGeneric; import water.api.API; public class ModelMetricsOrdinalGLMGenericV3<I extends ModelMetricsOrdinalGLMGeneric, S extends ModelMetricsOrdinalGLMGenericV3<I, S>> extends ModelMetricsOrdinalGenericV3<I, S> { @API(help = "residual deviance", direction = API.Direction.OUTPUT) public double residual_deviance; @API(help = "null deviance", direction = API.Direction.OUTPUT) public double null_deviance; @API(help = "AIC", direction = API.Direction.OUTPUT) public double AIC; @API(help = "log likelihood", direction = API.Direction.OUTPUT) public double loglikelihood; @API(help = "null DOF", direction = API.Direction.OUTPUT) public long null_degrees_of_freedom; @API(help = "residual DOF", direction = API.Direction.OUTPUT) public long residual_degrees_of_freedom; @API(direction = API.Direction.OUTPUT, help="coefficients_table") public TwoDimTableV3 coefficients_table; // Originally not part of metrics, put here to avoid GenericOutput having multiple output classes. @Override public S fillFromImpl(I modelMetrics) { super.fillFromImpl(modelMetrics); this.AIC = modelMetrics._AIC; this.loglikelihood = modelMetrics._loglikelihood; this.residual_deviance = modelMetrics._resDev; this.null_deviance = modelMetrics._nullDev; this.null_degrees_of_freedom = modelMetrics._nullDegreesOfFreedom; this.residual_degrees_of_freedom = modelMetrics._residualDegreesOfFreedom; this.coefficients_table = new TwoDimTableV3().fillFromImpl(modelMetrics._coefficients_table); this.r2 = modelMetrics._r2; return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsOrdinalGLMV3.java
package water.api.schemas3; import hex.ModelMetricsBinomialGLM.ModelMetricsOrdinalGLM; import water.api.API; import water.api.API.Direction; public class ModelMetricsOrdinalGLMV3 extends ModelMetricsOrdinalV3<ModelMetricsOrdinalGLM, ModelMetricsOrdinalGLMV3> { @API(help="residual deviance",direction = Direction.OUTPUT) public double residual_deviance; @API(help="null deviance",direction = Direction.OUTPUT) public double null_deviance; @API(help="AIC",direction = Direction.OUTPUT) public double AIC; @API(help="log likelihood",direction = Direction.OUTPUT) public double loglikelihood; @API(help="null DOF", direction= Direction.OUTPUT) public long null_degrees_of_freedom; @API(help="residual DOF", direction= Direction.OUTPUT) public long residual_degrees_of_freedom; @Override public ModelMetricsOrdinalGLMV3 fillFromImpl(ModelMetricsOrdinalGLM mms) { super.fillFromImpl(mms); this.AIC = mms._AIC; this.loglikelihood = mms._loglikelihood; this.residual_deviance = mms._resDev; this.null_deviance = mms._nullDev; this.null_degrees_of_freedom = mms._nullDegreesOfFreedom; this.residual_degrees_of_freedom = mms._residualDegreesOfFreedom; return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsOrdinalGenericV3.java
package water.api.schemas3; import hex.ModelMetricsOrdinalGeneric; import water.api.API; public class ModelMetricsOrdinalGenericV3<I extends ModelMetricsOrdinalGeneric, S extends ModelMetricsOrdinalGenericV3<I, S>> extends ModelMetricsBaseV3<I, S> { @API(help = "The R^2 for this scoring run.", direction = API.Direction.OUTPUT) public double r2; @API(help = "The hit ratio table for this scoring run.", direction = API.Direction.OUTPUT, level = API.Level.expert) public TwoDimTableV3 hit_ratio_table; @API(help = "The ConfusionMatrix object for this scoring run.", direction = API.Direction.OUTPUT) public ConfusionMatrixV3 cm; @API(help = "The logarithmic loss for this scoring run.", direction = API.Direction.OUTPUT) public double logloss; @API(help = "The mean misclassification error per class.", direction = API.Direction.OUTPUT) public double mean_per_class_error; @Override public S fillFromImpl(I modelMetrics) { super.fillFromImpl(modelMetrics); if (null != modelMetrics._confusion_matrix) { final ConfusionMatrixV3 convertedConfusionMatrix = new ConfusionMatrixV3(); convertedConfusionMatrix.table = new TwoDimTableV3().fillFromImpl(modelMetrics._confusion_matrix); cm = convertedConfusionMatrix; } mean_per_class_error = modelMetrics._mean_per_class_error; return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsOrdinalV3.java
package water.api.schemas3; import hex.ModelMetricsOrdinal; import water.api.API; import water.api.SchemaServer; import water.util.TwoDimTable; import static hex.ModelMetricsMultinomial.getHitRatioTable; public class ModelMetricsOrdinalV3<I extends ModelMetricsOrdinal, S extends ModelMetricsOrdinalV3<I, S>> extends ModelMetricsBaseV3<I, S> { @API(help="The R^2 for this scoring run.", direction=API.Direction.OUTPUT) public double r2; @API(help="The hit ratio table for this scoring run.", direction=API.Direction.OUTPUT, level= API.Level.expert) public TwoDimTableV3 hit_ratio_table; @API(help="The ConfusionMatrix object for this scoring run.", direction=API.Direction.OUTPUT) public ConfusionMatrixV3 cm; @API(help="The logarithmic loss for this scoring run.", direction=API.Direction.OUTPUT) public double logloss; @API(help="The mean misclassification error per class.", direction=API.Direction.OUTPUT) public double mean_per_class_error; @Override public S fillFromImpl(I modelMetrics) { super.fillFromImpl(modelMetrics); logloss = modelMetrics._logloss; r2 = modelMetrics.r2(); if (modelMetrics._hit_ratios != null) { TwoDimTable table = getHitRatioTable(modelMetrics._hit_ratios); hit_ratio_table = (TwoDimTableV3) SchemaServer.schema(this.getSchemaVersion(), table).fillFromImpl(table); } if (null != modelMetrics._cm) { modelMetrics._cm.table(); // Fill in lazy table, for icing cm = (ConfusionMatrixV3) SchemaServer.schema(this.getSchemaVersion(), modelMetrics._cm).fillFromImpl (modelMetrics._cm); } return (S)this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsRegressionCoxPHGenericV3.java
package water.api.schemas3; import hex.ModelMetricsRegressionCoxPHGeneric; import water.api.API; public class ModelMetricsRegressionCoxPHGenericV3 extends ModelMetricsRegressionV3<ModelMetricsRegressionCoxPHGeneric, ModelMetricsRegressionCoxPHGenericV3> { @API(help="Concordance metric (c-index)", direction=API.Direction.OUTPUT) public double concordance; @API(help="Number of concordant pairs", direction=API.Direction.OUTPUT) public long concordant; @API(help="Number of discordant pairs.", direction=API.Direction.OUTPUT) public long discordant; @API(help="Number of tied pairs", direction=API.Direction.OUTPUT) public long tied_y; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsRegressionCoxPHV3.java
package water.api.schemas3; import hex.ModelMetricsRegressionCoxPH; import water.api.API; import water.api.API.Direction; public class ModelMetricsRegressionCoxPHV3 extends ModelMetricsRegressionV3<ModelMetricsRegressionCoxPH, ModelMetricsRegressionCoxPHV3> { @API(help="concordance index",direction = Direction.OUTPUT) public double concordance; @API(help = "number of concordant pairs", direction = Direction.OUTPUT) public long concordant; @API(help = "number of discordant pairs", direction = Direction.OUTPUT) public long discordant; @API(help = "number of pairs tied in Y value", direction = Direction.OUTPUT) public long tied_y; @Override public ModelMetricsRegressionCoxPHV3 fillFromImpl(ModelMetricsRegressionCoxPH modelMetrics) { super.fillFromImpl(modelMetrics); this.concordance = modelMetrics.concordance(); this.concordant = modelMetrics.concordant(); this.discordant = modelMetrics.discordant(); this.tied_y = modelMetrics.tiedY(); return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsRegressionGLMGenericV3.java
package water.api.schemas3; import hex.ModelMetricsRegressionGLMGeneric; import water.api.API; public class ModelMetricsRegressionGLMGenericV3 extends ModelMetricsRegressionV3<ModelMetricsRegressionGLMGeneric, ModelMetricsRegressionGLMGenericV3> { @API(help = "residual deviance", direction = API.Direction.OUTPUT) public double residual_deviance; @API(help = "null deviance", direction = API.Direction.OUTPUT) public double null_deviance; @API(help = "AIC", direction = API.Direction.OUTPUT) public double AIC; @API(help = "log likelihood", direction = API.Direction.OUTPUT) public double loglikelihood; @API(help="null DOF", direction= API.Direction.OUTPUT) public long null_degrees_of_freedom; @API(help="residual DOF", direction= API.Direction.OUTPUT) public long residual_degrees_of_freedom; @API(direction = API.Direction.OUTPUT, help="coefficients_table") public TwoDimTableV3 coefficients_table; // Originally not part of metrics, put here to avoid GenericOutput having multiple output classes. @Override public ModelMetricsRegressionGLMGenericV3 fillFromImpl(ModelMetricsRegressionGLMGeneric modelMetrics) { super.fillFromImpl(modelMetrics); this.AIC = modelMetrics._AIC; this.loglikelihood = modelMetrics._loglikelihood; this.residual_deviance = modelMetrics._resDev; this.null_deviance = modelMetrics._nullDev; this.null_degrees_of_freedom = modelMetrics._nullDegressOfFreedom; this.residual_degrees_of_freedom = modelMetrics._residualDegressOfFreedom; coefficients_table = modelMetrics._coefficients_table != null ?new TwoDimTableV3().fillFromImpl(modelMetrics._coefficients_table) : null; return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsRegressionGLMV3.java
package water.api.schemas3; import hex.ModelMetricsRegressionGLM; import water.api.API; import water.api.API.Direction; public class ModelMetricsRegressionGLMV3 extends ModelMetricsRegressionV3<ModelMetricsRegressionGLM, ModelMetricsRegressionGLMV3> { @API(help = "residual deviance", direction = Direction.OUTPUT) public double residual_deviance; @API(help = "null deviance", direction = Direction.OUTPUT) public double null_deviance; @API(help = "AIC", direction = Direction.OUTPUT) public double AIC; @API(help = "log likelihood", direction = Direction.OUTPUT) public double loglikelihood; @API(help="null DOF", direction= Direction.OUTPUT) public long null_degrees_of_freedom; @API(help="residual DOF", direction= Direction.OUTPUT) public long residual_degrees_of_freedom; @Override public ModelMetricsRegressionGLMV3 fillFromImpl(ModelMetricsRegressionGLM modelMetrics) { super.fillFromImpl(modelMetrics); this.AIC = modelMetrics._AIC; this.loglikelihood = modelMetrics._loglikelihood; this.residual_deviance = modelMetrics._resDev; this.null_deviance = modelMetrics._nullDev; this.null_degrees_of_freedom = modelMetrics._nullDegressOfFreedom; this.residual_degrees_of_freedom = modelMetrics._residualDegressOfFreedom; return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsRegressionGenericV3.java
package water.api.schemas3; import hex.ModelMetricsRegressionGeneric; import water.api.API; public class ModelMetricsRegressionGenericV3<I extends ModelMetricsRegressionGeneric, S extends ModelMetricsRegressionGenericV3<I, S>> extends ModelMetricsBaseV3<I, S> { @API(help="The mean residual deviance for this scoring run.", direction=API.Direction.OUTPUT) public double mean_residual_deviance; @API(help="The mean absolute error for this scoring run.", direction=API.Direction.OUTPUT) public double mae; @API(help="The root mean squared log error for this scoring run.", direction=API.Direction.OUTPUT) public double rmsle; @API(help="The logarithmic likelihood for this scoring run.", direction=API.Direction.OUTPUT) public double loglikelihood; @API(help="The AIC for this scoring run.", direction=API.Direction.OUTPUT) public double AIC; @Override public S fillFromImpl(I modelMetrics) { super.fillFromImpl(modelMetrics); mae = modelMetrics._mean_absolute_error; rmsle = modelMetrics._root_mean_squared_log_error; mean_residual_deviance = modelMetrics._mean_residual_deviance; loglikelihood = modelMetrics.loglikelihood(); AIC = modelMetrics.aic(); return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsRegressionHGLMGenericV3.java
package water.api.schemas3; import hex.ModelMetricsRegressionHGLMGeneric; public class ModelMetricsRegressionHGLMGenericV3<I extends ModelMetricsRegressionHGLMGeneric, S extends ModelMetricsRegressionHGLMGenericV3<I, S>> extends ModelMetricsRegressionHGLMV3<I,S> { @Override public S fillFromImpl(ModelMetricsRegressionHGLMGeneric modelMetrics) { super.fillFromImpl(modelMetrics); log_likelihood = modelMetrics._log_likelihood; icc = modelMetrics._icc; beta = modelMetrics._beta; ubeta = modelMetrics._ubeta; iterations = modelMetrics._iterations; tmat = modelMetrics._tmat; var_residual = modelMetrics._var_residual; mse_fixed = modelMetrics._mse_fixed; return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsRegressionHGLMV3.java
package water.api.schemas3; import hex.ModelMetricsRegressionHGLM; import water.api.API; public class ModelMetricsRegressionHGLMV3<I extends ModelMetricsRegressionHGLM, S extends ModelMetricsRegressionHGLMV3<I, S>> extends ModelMetricsBaseV3<I, S> { @API(help="fixed coefficient)", direction=API.Direction.OUTPUT) public double[] beta; // dispersion parameter of the mean model (residual variance for LMM) @API(help="random coefficients", direction=API.Direction.OUTPUT) public double[][] ubeta; // dispersion parameter of the random effects (variance of random effects for GLMM) @API(help="log likelihood", direction=API.Direction.OUTPUT) public double log_likelihood; // log h-likelihood @API(help="interclass correlation", direction=API.Direction.OUTPUT) public double[] icc; @API(help="iterations taken to build model", direction=API.Direction.OUTPUT) public int iterations; @API(help="covariance matrix of random effects", direction=API.Direction.OUTPUT) public double[][] tmat; @API(help="variance of residual error", direction=API.Direction.OUTPUT) public double var_residual; @API(help="mean square error of fixed effects only", direction=API.Direction.OUTPUT) public double mse_fixed; @Override public S fillFromImpl(ModelMetricsRegressionHGLM modelMetrics) { super.fillFromImpl(modelMetrics); log_likelihood = modelMetrics._log_likelihood; icc = modelMetrics._icc; beta = modelMetrics._beta; ubeta = modelMetrics._ubeta; iterations = modelMetrics._iterations; tmat = modelMetrics._tmat; var_residual = modelMetrics._var_residual; mse_fixed = modelMetrics._mse_fixed; return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelMetricsRegressionV3.java
package water.api.schemas3; import hex.ModelMetricsRegression; import water.api.API; public class ModelMetricsRegressionV3<I extends ModelMetricsRegression, S extends ModelMetricsRegressionV3<I, S>> extends ModelMetricsBaseV3<I, S> { @API(help="The R^2 for this scoring run.", direction=API.Direction.OUTPUT) public double r2; @API(help="The mean residual deviance for this scoring run.", direction=API.Direction.OUTPUT) public double mean_residual_deviance; @API(help="The mean absolute error for this scoring run.", direction=API.Direction.OUTPUT) public double mae; @API(help="The root mean squared log error for this scoring run.", direction=API.Direction.OUTPUT) public double rmsle; @API(help="The logarithmic likelihood for this scoring run.", direction=API.Direction.OUTPUT) public double loglikelihood; @API(help="The AIC for this scoring run.", direction=API.Direction.OUTPUT) public double AIC; @Override public S fillFromImpl(I modelMetrics) { super.fillFromImpl(modelMetrics); r2 = modelMetrics.r2(); mae = modelMetrics._mean_absolute_error; rmsle = modelMetrics._root_mean_squared_log_error; mean_residual_deviance = modelMetrics._mean_residual_deviance; loglikelihood = modelMetrics.loglikelihood(); AIC = modelMetrics.aic(); return (S) this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelOutputSchemaV3.java
package water.api.schemas3; import hex.Model; import hex.ModelCategory; import water.Weaver; import water.api.API; import water.util.IcedHashMap; import water.util.IcedHashMapGeneric; import water.util.Log; import java.lang.reflect.Field; /** * An instance of a ModelOutput schema contains the Model build output (e.g., the cluster centers for KMeans). * NOTE: use subclasses, not this class directly. It is not abstract only so that we can instantiate it to generate metadata * for it for the metadata API. */ public class ModelOutputSchemaV3<O extends Model.Output, S extends ModelOutputSchemaV3<O, S>> extends SchemaV3<O, S> { @API(help="Column names", direction=API.Direction.OUTPUT) public String[] names; @API(help="Original column names", direction=API.Direction.OUTPUT) public String[] original_names; @API(help="Column types", direction=API.Direction.OUTPUT) public String[] column_types; // column type mappings can be found in Vec.java, around line 198. @API(help="Domains for categorical columns", direction=API.Direction.OUTPUT, level=API.Level.expert) public String[][] domains; @API(help="Cross-validation models (model ids)", direction=API.Direction.OUTPUT, level=API.Level.expert) public KeyV3.ModelKeyV3[] cross_validation_models; @API(help="Cross-validation predictions, one per cv model (deprecated, use cross_validation_holdout_predictions_frame_id instead)", direction=API.Direction.OUTPUT, level=API.Level.expert) public KeyV3.FrameKeyV3[] cross_validation_predictions; @API(help="Cross-validation holdout predictions (full out-of-sample predictions on training data)", direction=API.Direction.OUTPUT, level=API.Level.expert) public KeyV3.FrameKeyV3 cross_validation_holdout_predictions_frame_id; @API(help="Cross-validation fold assignment (each row is assigned to one holdout fold)", direction=API.Direction.OUTPUT, level=API.Level.expert) public KeyV3.FrameKeyV3 cross_validation_fold_assignment_frame_id; @API(help="Category of the model (e.g., Binomial)", values={"Unknown", "Binomial", "Ordinal", "Multinomial", "Regression", "Clustering", "AutoEncoder", "DimReduction", "WordEmbedding"}, direction=API.Direction.OUTPUT) public ModelCategory model_category; @API(help="Model summary", direction=API.Direction.OUTPUT, level=API.Level.critical) public TwoDimTableV3 model_summary; @API(help="Scoring history", direction=API.Direction.OUTPUT, level=API.Level.secondary) public TwoDimTableV3 scoring_history; @API(help="Cross-Validation scoring history", direction=API.Direction.OUTPUT, level=API.Level.secondary) public TwoDimTableV3 cv_scoring_history[]; @API(help="Model reproducibility information", direction=API.Direction.OUTPUT, level=API.Level.secondary) public TwoDimTableV3[] reproducibility_information_table; @API(help="Training data model metrics", direction=API.Direction.OUTPUT, level=API.Level.critical) public ModelMetricsBaseV3 training_metrics; @API(help="Validation data model metrics", direction=API.Direction.OUTPUT, level=API.Level.critical) public ModelMetricsBaseV3 validation_metrics; @API(help="Cross-validation model metrics", direction=API.Direction.OUTPUT, level=API.Level.critical) public ModelMetricsBaseV3 cross_validation_metrics; @API(help="Cross-validation model metrics summary", direction=API.Direction.OUTPUT, level=API.Level.critical) public TwoDimTableV3 cross_validation_metrics_summary; @API(help="Job status", direction=API.Direction.OUTPUT, level=API.Level.secondary) public String status; @API(help="Start time in milliseconds", direction=API.Direction.OUTPUT, level=API.Level.secondary) public long start_time; @API(help="End time in milliseconds", direction=API.Direction.OUTPUT, level=API.Level.secondary) public long end_time; @API(help="Runtime in milliseconds", direction=API.Direction.OUTPUT, level=API.Level.secondary) public long run_time; @API(help="Default threshold used for predictions", direction=API.Direction.OUTPUT) public double default_threshold; @API(help="Help information for output fields", direction=API.Direction.OUTPUT) public IcedHashMapGeneric.IcedHashMapStringString help; public ModelOutputSchemaV3() { super(); } public S fillFromImpl( O impl ) { super.fillFromImpl(impl); this.model_category = impl.getModelCategory(); this.original_names = impl._origNames; this.default_threshold = impl.defaultThreshold(); fillHelp(); return (S)this; } private void fillHelp() { this.help = new IcedHashMapGeneric.IcedHashMapStringString(); try { Field[] dest_fields = Weaver.getWovenFields(this.getClass()); for (Field f : dest_fields) { fillHelp(f); } } catch (Exception e) { Log.warn(e); } } private void fillHelp(Field f) { API annotation = f.getAnnotation(API.class); if (null != annotation) { String helpString = annotation.help(); if (helpString == null) { return; } String name = f.getName(); if (name == null) { return; } this.help.put(name, helpString); } } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelParameterSchemaV3.java
package water.api.schemas3; import java.lang.reflect.Field; import water.AutoBuffer; import water.H2O; import water.Iced; import water.IcedWrapper; import water.api.API; import water.api.SchemaMetadata; import water.api.SchemaMetadata.FieldMetadata; import water.api.ValuesProvider; import water.util.PojoUtils; // TODO: move into hex.schemas! /** * An instance of a ModelParameters schema contains the metadata for a single Model build parameter (e.g., K for KMeans). * TODO: add a superclass. * TODO: refactor this into with FieldMetadataBase. */ public class ModelParameterSchemaV3 extends SchemaV3<Iced, ModelParameterSchemaV3> { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CAREFUL: This class has its own JSON serializer. If you add a field here you probably also want to add it to the serializer! //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @API(help="name in the JSON, e.g. \"lambda\"", direction=API.Direction.OUTPUT) public String name; @API(help="[DEPRECATED] same as name.", direction=API.Direction.OUTPUT) public String label; @API(help="help for the UI, e.g. \"regularization multiplier, typically used for foo bar baz etc.\"", direction=API.Direction.OUTPUT) public String help; @API(help="the field is required", direction=API.Direction.OUTPUT) public boolean required; @API(help="Java type, e.g. \"double\"", direction=API.Direction.OUTPUT) public String type; @API(help="default value, e.g. 1", direction=API.Direction.OUTPUT) public Iced default_value; @API(help="actual value as set by the user and / or modified by the ModelBuilder, e.g., 10", direction=API.Direction.OUTPUT) public Iced actual_value; @API(help="input value as set by the user, e.g., 10", direction=API.Direction.OUTPUT) public Iced input_value; @API(help="the importance of the parameter, used by the UI, e.g. \"critical\", \"extended\" or \"expert\"", direction=API.Direction.OUTPUT) public String level; @API(help="list of valid values for use by the front-end", direction=API.Direction.OUTPUT) public String[] values; @API(help="For Vec-type fields this is the set of Frame-type fields which must contain the named column; for example, for a SupervisedModel the response_column must be in both the training_frame and (if it's set) the validation_frame") public String[] is_member_of_frames; @API(help="For Vec-type fields this is the set of other Vec-type fields which must contain mutually exclusive values; for example, for a SupervisedModel the response_column must be mutually exclusive with the weights_column") public String[] is_mutually_exclusive_with; @API(help="Parameter can be used in grid call", direction=API.Direction.OUTPUT) public boolean gridable; public ModelParameterSchemaV3() { } /** TODO: refactor using SchemaMetadata. */ public ModelParameterSchemaV3(ModelParametersSchemaV3 schema, ModelParametersSchemaV3 input_schema, ModelParametersSchemaV3 default_schema, Field f) { f.setAccessible(true); try { this.name = f.getName(); API annotation = f.getAnnotation(API.class); Object o; o = f.get(default_schema); this.default_value = FieldMetadata.consValue(o); if (input_schema != null) { o = f.get(input_schema); this.input_value = FieldMetadata.consValue(o); } o = f.get(schema); this.actual_value = FieldMetadata.consValue(o); boolean is_enum = Enum.class.isAssignableFrom(f.getType()); this.type = FieldMetadata.consType(schema, f.getType(), f.getName(), annotation); if (null != annotation) { this.label = this.name; this.help = annotation.help(); this.required = annotation.required(); this.level = annotation.level().toString(); this.values = annotation.valuesProvider() == ValuesProvider.NULL ? annotation.values() : SchemaMetadata.getValues(annotation.valuesProvider()); // If the field is an enum then the values annotation field had better be set. . . if (is_enum && (null == this.values || 0 == this.values.length)) { throw H2O.fail("Didn't find values annotation for enum field: " + this.name); } // NOTE: we just set the raw value here. We compute the transitive closure // before serializing to JSON. We have to do this automagically since we // need to combine the values from multiple fields in multiple levels of the // inheritance hierarchy. this.is_member_of_frames = annotation.is_member_of_frames(); this.is_mutually_exclusive_with = annotation.is_mutually_exclusive_with(); // NOTE: later we walk all the fields in the Schema and form the transitive closure of these lists. this.gridable = annotation.gridable(); } } catch (Exception e) { throw H2O.fail("Caught exception accessing field: " + f + " for schema object: " + this + ": " + e.toString()); } } public ModelParameterSchemaV3 fillFromImpl(Iced iced) { PojoUtils.copyProperties(this, iced, PojoUtils.FieldNaming.ORIGIN_HAS_UNDERSCORES); return this; } public Iced createImpl() { // should never get called throw H2O.fail("createImpl should never get called in ModelParameterSchemaV2!"); } /** * ModelParameterSchema has its own serializer so that default_value and actual_value * get serialized as their native types. Autobuffer assumes all classes that have their * own serializers should be serialized as JSON objects, and wraps them in {}, so this * can't just be handled by a customer serializer in IcedWrapper. * * @param ab * @return */ public final AutoBuffer writeJSON_impl(AutoBuffer ab) { ab.putJSONStr("name", name); ab.put1(','); ab.putJSONStr("label", name); ab.put1(','); ab.putJSONStr("help", help); ab.put1(','); ab.putJSONStrUnquoted("required", required ? "true" : "false"); ab.put1(','); ab.putJSONStr("type", type); ab.put1(','); writeValue(ab, "default_value", default_value); writeValue(ab, "actual_value", actual_value); writeValue(ab, "input_value", input_value); ab.putJSONStr("level", level); ab.put1(','); ab.putJSONAStr("values", values); ab.put1(','); ab.putJSONAStr("is_member_of_frames", is_member_of_frames); ab.put1(','); ab.putJSONAStr("is_mutually_exclusive_with", is_mutually_exclusive_with); ab.put1(','); ab.putJSONStrUnquoted("gridable", gridable ? "true" : "false"); return ab; } private void writeValue(AutoBuffer ab, String label, Iced value) { if (value instanceof IcedWrapper) { ab.putJSONStr(label).put1(':'); ((IcedWrapper) value).writeUnwrappedJSON(ab); ab.put1(','); } else { ab.putJSONStr(label).put1(':').putJSON(value); ab.put1(','); } } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelParametersSchemaV3.java
package water.api.schemas3; import hex.MultinomialAucType; import hex.genmodel.utils.DistributionFamily; import hex.Model; import hex.ScoreKeeper; import water.*; import water.api.API; import water.api.schemas3.KeyV3.FrameKeyV3; import water.api.schemas3.KeyV3.ModelKeyV3; import water.fvec.Frame; import water.util.ArrayUtils; import water.util.PojoUtils; import java.lang.reflect.Field; import java.util.*; /** * An instance of a ModelParameters schema contains the Model build parameters (e.g., K and max_iterations for KMeans). * NOTE: use subclasses, not this class directly. It is not abstract only so that we can instantiate it to generate metadata * for it for the metadata API. */ public class ModelParametersSchemaV3<P extends Model.Parameters, S extends ModelParametersSchemaV3<P, S>> extends SchemaV3<P, S> { //////////////////////////////////////// // NOTE: // Parameters must be ordered for the UI //////////////////////////////////////// public String[] fields() { try { return (String[]) getClass().getField("fields").get(getClass()); } catch (Exception e) { throw H2O.fail("Caught exception from accessing the schema field list", e); } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CAREFUL: This class has its own JSON serializer. If you add a field here you probably also want to add it to the serializer! //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Parameters common to all models: @API(level = API.Level.critical, direction = API.Direction.INOUT, help="Destination id for this model; auto-generated if not specified.") public ModelKeyV3 model_id; @API(level = API.Level.critical, direction = API.Direction.INOUT, help = "Id of the training data frame.") public FrameKeyV3 training_frame; @API(level = API.Level.critical, direction = API.Direction.INOUT, gridable = true, help = "Id of the validation data frame.") public FrameKeyV3 validation_frame; @API(level = API.Level.critical, direction = API.Direction.INOUT, help = "Number of folds for K-fold cross-validation (0 to disable or >= 2).") public int nfolds; @API(level = API.Level.expert, direction = API.Direction.INOUT, help = "Whether to keep the cross-validation models.") public boolean keep_cross_validation_models; @API(level = API.Level.expert, direction = API.Direction.INOUT, help = "Whether to keep the predictions of the cross-validation models.") public boolean keep_cross_validation_predictions; @API(level = API.Level.expert, direction = API.Direction.INOUT, help = "Whether to keep the cross-validation fold assignment.") public boolean keep_cross_validation_fold_assignment; @API(help="Allow parallel training of cross-validation models", direction=API.Direction.INOUT, level = API.Level.expert) public boolean parallelize_cross_validation; @API(help = "Distribution function", values = { "AUTO", "bernoulli", "quasibinomial", "ordinal", "multinomial", "gaussian", "poisson", "gamma", "tweedie", "laplace", "quantile", "huber", "custom" }, level = API.Level.secondary, gridable = true) public DistributionFamily distribution; @API(level = API.Level.secondary, direction = API.Direction.INPUT, gridable = true, help = "Tweedie power for Tweedie regression, must be between 1 and 2.") public double tweedie_power; @API(level = API.Level.secondary, direction = API.Direction.INPUT, gridable = true, help = "Desired quantile for Quantile regression, must be between 0 and 1.") public double quantile_alpha; @API(help = "Desired quantile for Huber/M-regression (threshold between quadratic and linear loss, must be between 0 and 1).", level = API.Level.secondary, direction = API.Direction.INPUT, gridable = true) public double huber_alpha; @API(level = API.Level.critical, direction = API.Direction.INOUT, gridable = true, is_member_of_frames = {"training_frame", "validation_frame"}, is_mutually_exclusive_with = {"ignored_columns"}, help = "Response variable column.") public FrameV3.ColSpecifierV3 response_column; @API(level = API.Level.secondary, direction = API.Direction.INOUT, gridable = true, is_member_of_frames = {"training_frame", "validation_frame"}, is_mutually_exclusive_with = {"ignored_columns", "response_column"}, help = "Column with observation weights. Giving some observation a weight of zero is equivalent to excluding it" + " from the dataset; giving an observation a relative weight of 2 is equivalent to repeating that row twice." + " Negative weights are not allowed. Note: Weights are per-row observation weights and do not increase the" + " size of the data frame. This is typically the number of times a row is repeated, but non-integer values are" + " supported as well. During training, rows with higher weights matter more, due to the larger loss function" + " pre-factor. If you set weight = 0 for a row, the returned prediction frame at that row is zero and this" + " is incorrect. To get an accurate prediction, remove all rows with weight == 0.") public FrameV3.ColSpecifierV3 weights_column; @API(level = API.Level.secondary, direction = API.Direction.INOUT, gridable = true, is_member_of_frames = {"training_frame", "validation_frame"}, is_mutually_exclusive_with = {"ignored_columns","response_column", "weights_column"}, help = "Offset column. This will be added to the combination of columns before applying the link function.") public FrameV3.ColSpecifierV3 offset_column; @API(level = API.Level.secondary, direction = API.Direction.INOUT, gridable = true, is_member_of_frames = {"training_frame"}, is_mutually_exclusive_with = {"ignored_columns", "response_column", "weights_column", "offset_column"}, help = "Column with cross-validation fold index assignment per observation.") public FrameV3.ColSpecifierV3 fold_column; @API(level = API.Level.secondary, direction = API.Direction.INOUT, gridable = true, values = {"AUTO", "Random", "Modulo", "Stratified"}, help = "Cross-validation fold assignment scheme, if fold_column is not specified. The 'Stratified' option will " + "stratify the folds based on the response variable, for classification problems.") public Model.Parameters.FoldAssignmentScheme fold_assignment; @API(level = API.Level.secondary, direction = API.Direction.INOUT, gridable = true, values = {"AUTO", "Enum", "OneHotInternal", "OneHotExplicit", "Binary", "Eigen", "LabelEncoder", "SortByResponse", "EnumLimited"}, help = "Encoding scheme for categorical features") public Model.Parameters.CategoricalEncodingScheme categorical_encoding; @API(level = API.Level.secondary, direction = API.Direction.INPUT, gridable = true, help = "For every categorical feature, only use this many most frequent categorical levels for model training. Only used for categorical_encoding == EnumLimited.") public int max_categorical_levels; @API(level = API.Level.critical, direction = API.Direction.INOUT, is_member_of_frames = {"training_frame", "validation_frame"}, help = "Names of columns to ignore for training.") public String[] ignored_columns; @API(level = API.Level.critical, direction = API.Direction.INOUT, help = "Ignore constant columns.") public boolean ignore_const_cols; @API(level = API.Level.secondary, direction = API.Direction.INOUT, help = "Whether to score during each iteration of model training.") public boolean score_each_iteration; /** * A model key associated with a previously trained * model. This option allows users to build a new model as a * continuation of a previously generated model (e.g., by a grid search). */ @API(level = API.Level.secondary, direction=API.Direction.INOUT, help = "Model checkpoint to resume training with.") public ModelKeyV3 checkpoint; /** * Early stopping based on convergence of stopping_metric. * Stop if simple moving average of length k of the stopping_metric does not improve (by stopping_tolerance) for k=stopping_rounds scoring events." * Can only trigger after at least 2k scoring events. Use 0 to disable. */ @API(help = "Early stopping based on convergence of stopping_metric. Stop if simple moving average of length k of the stopping_metric does not improve for k:=stopping_rounds scoring events (0 to disable)", level = API.Level.secondary, direction=API.Direction.INOUT, gridable = true) public int stopping_rounds; @API(help = "Maximum allowed runtime in seconds for model training. Use 0 to disable.", level = API.Level.secondary, direction=API.Direction.INOUT, gridable = true) public double max_runtime_secs; /** * Metric to use for convergence checking, only for _stopping_rounds > 0 */ @API(help = "Metric to use for early stopping (AUTO: logloss for classification, deviance for regression and " + "anomaly_score for Isolation Forest). Note that custom and custom_increasing can only be used in GBM and " + "DRF with the Python client.", valuesProvider = ModelParamsValuesProviders.StoppingMetricValuesProvider.class, level = API.Level.secondary, direction=API.Direction.INOUT, gridable = true) public ScoreKeeper.StoppingMetric stopping_metric; @API(help = "Relative tolerance for metric-based stopping criterion (stop if relative improvement is not at least this much)", level = API.Level.secondary, direction=API.Direction.INOUT, gridable = true) public double stopping_tolerance; @API(help = "Gains/Lift table number of bins. 0 means disabled.. Default value -1 means automatic binning.", level = API.Level.secondary, direction=API.Direction.INOUT) public int gainslift_bins; /* * Custom metric */ @API(help = "Reference to custom evaluation function, format: `language:keyName=funcName`", level = API.Level.secondary, direction=API.Direction.INOUT, gridable = false) public String custom_metric_func; /* * Custom distribution */ @API(help = "Reference to custom distribution, format: `language:keyName=funcName`", level = API.Level.secondary, direction=API.Direction.INOUT, gridable = false) public String custom_distribution_func; @API(help = "Automatically export generated models to this directory.", level = API.Level.secondary, direction = API.Direction.INOUT) public String export_checkpoints_dir; @API(help = "Set default multinomial AUC type.", valuesProvider = ModelParamsValuesProviders.MultinomialAucTypeSchemeValuesProvider.class, level = API.Level.secondary, direction = API.Direction.INOUT, gridable = true) public MultinomialAucType auc_type; protected static String[] append_field_arrays(String[] first, String[] second) { String[] appended = new String[first.length + second.length]; System.arraycopy(first, 0, appended, 0, first.length); System.arraycopy(second, 0, appended, first.length, second.length); return appended; } public S fillFromImpl(P impl) { PojoUtils.copyProperties(this, impl, PojoUtils.FieldNaming.ORIGIN_HAS_UNDERSCORES); if (impl._train != null) { Value v = DKV.get(impl._train); if (v != null) { training_frame = new FrameKeyV3(((Frame) v.get())._key); } } if (impl._valid != null) { Value v = DKV.get(impl._valid); if (v != null) { validation_frame = new FrameKeyV3(((Frame) v.get())._key); } } return (S)this; } public P fillImpl(P impl) { super.fillImpl(impl); impl._train = (this.training_frame == null) ? null : Key.<Frame>make(this.training_frame.name); impl._valid = (this.validation_frame == null) ? null : Key.<Frame>make(this.validation_frame.name); return impl; } private static void compute_transitive_closure_of_is_mutually_exclusive(ModelParameterSchemaV3[] metadata) { // Form the transitive closure of the is_mutually_exclusive field lists by visiting // all fields and collecting the fields in a Map of Sets. Then pass over them a second // time setting the full lists. Map<String, Set<String>> field_exclusivity_groups = new HashMap<>(); for (ModelParameterSchemaV3 param : metadata) { String name = param.name; // Turn param.is_mutually_exclusive_with into a List which we will walk over twice List<String> me = new ArrayList<String>(); me.add(name); // Note: this can happen if this field doesn't have an @API annotation, in which case we got an earlier WARN if (param.is_mutually_exclusive_with != null) me.addAll(Arrays.asList(param.is_mutually_exclusive_with)); // Make a new Set which contains ourselves, fields we have already been connected to, // and fields *they* have already been connected to. Set<String> new_set = new HashSet<>(); for (String s : me) { // Were we mentioned by a previous field? if (field_exclusivity_groups.containsKey(s)) new_set.addAll(field_exclusivity_groups.get(s)); else new_set.add(s); } // Now point all the fields in our Set to the Set. for (String s : me) { field_exclusivity_groups.put(s, new_set); } } // Now walk over all the fields and create new comprehensive is_mutually_exclusive arrays, not containing self. for (ModelParameterSchemaV3 param : metadata) { String name = param.name; Set<String> me = field_exclusivity_groups.get(name); Set<String> not_me = new HashSet<>(me); not_me.remove(name); param.is_mutually_exclusive_with = not_me.toArray(new String[not_me.size()]); } } /** * Write the parameters, including their metadata, into an AutoBuffer. Used by * ModelBuilderSchema#writeJSON_impl and ModelSchemaV3#writeJSON_impl. */ public static AutoBuffer writeParametersJSON(AutoBuffer ab, ModelParametersSchemaV3 parameters, ModelParametersSchemaV3 input_parameters, ModelParametersSchemaV3 default_parameters, String name) { String[] fields = parameters.fields(); // Build ModelParameterSchemaV2 objects for each field, and the call writeJSON on the array final ModelParameterSchemaV3[] additionalParameters = parameters.getAdditionalParameters(); ModelParameterSchemaV3[] metadata = new ModelParameterSchemaV3[fields.length]; String field_name = null; try { for (int i = 0; i < fields.length; i++) { field_name = fields[i]; Field f = parameters.getClass().getField(field_name); // TODO: cache a default parameters schema ModelParameterSchemaV3 schema = new ModelParameterSchemaV3(parameters, input_parameters, default_parameters, f); metadata[i] = schema; } } catch (NoSuchFieldException e) { throw new RuntimeException("Caught exception accessing field: " + field_name + " for schema object: " + parameters + ": " + e.toString()); } compute_transitive_closure_of_is_mutually_exclusive(metadata); if (additionalParameters != null) { metadata = ArrayUtils.append(metadata, additionalParameters); } ab.putJSONA(name, metadata); return ab; } protected ModelParameterSchemaV3[] getAdditionalParameters() { return null; } /** * * @param schemaClass A schema class to extract {@link API} annotated parameters * @param <X> A generic type for a {@link Class} object representing a class extending {@link ModelParametersSchemaV3}. * @return */ protected static <X extends Class<? extends ModelParametersSchemaV3>> List<String> extractDeclaredApiParameters(X schemaClass){ final Field[] declaredFields = schemaClass.getDeclaredFields(); final List<String> paramsList = new ArrayList<>(declaredFields.length); for (Field field : declaredFields){ if(!field.isAnnotationPresent(API.class)) continue; paramsList.add(field.getName()); } return paramsList; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelParamsValuesProviders.java
package water.api.schemas3; import hex.AUUC; import hex.Model.Parameters.CategoricalEncodingScheme; import hex.Model.Parameters.FoldAssignmentScheme; import hex.MultinomialAucType; import hex.ScoreKeeper.StoppingMetric; import hex.genmodel.utils.DistributionFamily; import water.api.EnumValuesProvider; public interface ModelParamsValuesProviders { class StoppingMetricValuesProvider extends EnumValuesProvider<StoppingMetric> { public StoppingMetricValuesProvider() { super(StoppingMetric.class); } } class DistributionFamilyValuesProvider extends EnumValuesProvider<DistributionFamily> { public DistributionFamilyValuesProvider() { super(DistributionFamily.class, new DistributionFamily[]{DistributionFamily.modified_huber}); } } class CategoricalEncodingSchemeValuesProvider extends EnumValuesProvider<CategoricalEncodingScheme> { public CategoricalEncodingSchemeValuesProvider() { super(CategoricalEncodingScheme.class); } } class FoldAssignmentSchemeValuesProvider extends EnumValuesProvider<FoldAssignmentScheme> { public FoldAssignmentSchemeValuesProvider() { super(FoldAssignmentScheme.class); } } class MultinomialAucTypeSchemeValuesProvider extends EnumValuesProvider<MultinomialAucType>{ public MultinomialAucTypeSchemeValuesProvider() {super(MultinomialAucType.class);} } class UpliftAuucTypeSchemeValuesProvider extends EnumValuesProvider<AUUC.AUUCType>{ public UpliftAuucTypeSchemeValuesProvider() {super(AUUC.AUUCType.class);} } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelSchemaBaseV3.java
package water.api.schemas3; import hex.ModelBuilder; import water.api.API; import water.api.schemas3.KeyV3.ModelKeyV3; import water.api.schemas3.KeyV3.FrameKeyV3; /** * A Model schema contains all the pieces associated with a Model: * <p> * <ul> * <li> an instance of a ModelParameters schema containing the build parameters</li> * <li> an instance of a ModelResults schema containing the f00 b4r b4z</li> * <li> an instance of a ModelMetrics schema</li> * </ul> * */ public class ModelSchemaBaseV3<M extends hex.Model<M,?,?>, S extends ModelSchemaBaseV3<M, S>> extends SchemaV3<M, S> { // Input fields @API(help="Model key", required=true, direction=API.Direction.INOUT) public ModelKeyV3<M> model_id; // Output fields @API(help="The algo name for this Model.", direction=API.Direction.OUTPUT) public String algo; @API(help="The pretty algo name for this Model (e.g., Generalized Linear Model, rather than GLM).", direction=API.Direction.OUTPUT) public String algo_full_name; @API(help="The response column name for this Model (if applicable). Is null otherwise.", direction=API.Direction.OUTPUT) public String response_column_name; @API(help="The treatment column name for this Model (if applicable). Is null otherwise.", direction=API.Direction.OUTPUT) public String treatment_column_name; @API(help="The Model\'s training frame key", direction=API.Direction.OUTPUT) public FrameKeyV3 data_frame; @API(help="Timestamp for when this model was completed", direction=API.Direction.OUTPUT) public long timestamp; @API(help="Indicator, whether export to POJO is available", direction=API.Direction.OUTPUT) public boolean have_pojo; @API(help="Indicator, whether export to MOJO is available", direction=API.Direction.OUTPUT) public boolean have_mojo; public ModelSchemaBaseV3() {} public ModelSchemaBaseV3(M m) { this.model_id = new ModelKeyV3<>(m._key); this.algo = m._parms.algoName().toLowerCase(); this.algo_full_name = m._parms.fullName(); this.data_frame = new FrameKeyV3(m._parms._train); this.response_column_name = m._parms._response_column; this.treatment_column_name = m._parms._treatment_column; this.timestamp = m._output._job == null?-1:m._output._job.isRunning() ? 0 : m._output._job.end_time(); this.have_pojo = m.havePojo(); this.have_mojo = m.haveMojo(); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelSchemaV3.java
package water.api.schemas3; import hex.Model; import org.apache.log4j.Logger; import water.AutoBuffer; import water.H2O; import water.api.API; import water.api.schemas3.KeyV3.ModelKeyV3; import water.exceptions.H2OIllegalArgumentException; import water.util.PojoUtils; /** * A Model schema contains all the pieces associated with a Model: * <p> * <ul> * <li> an instance of a ModelParameters schema containing the build parameters</li> * <li> an instance of a ModelResults schema containing the f00 b4r b4z</li> * <li> an instance of a ModelMetrics schema</li> * </ul> * */ public class ModelSchemaV3< M extends Model<M, P, O>, S extends ModelSchemaV3<M, S, P, PS, O, OS>, P extends Model.Parameters, PS extends ModelParametersSchemaV3<P, PS>, O extends Model.Output, OS extends ModelOutputSchemaV3<O, OS> > extends ModelSchemaBaseV3<M, S> { private static final Logger LOG = Logger.getLogger(ModelSchemaV3.class); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CAREFUL: This class has its own JSON serializer. If you add a field here you probably also want to add it to the serializer! //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Output fields @API(help="The build parameters for the model (e.g. K for KMeans).", direction=API.Direction.OUTPUT) public PS parameters; @API(help="The build output for the model (e.g. the cluster centers for KMeans).", direction=API.Direction.OUTPUT) public OS output; @API(help="Compatible frames, if requested", direction=API.Direction.OUTPUT) public String[] compatible_frames; @API(help="Checksum for all the things that go into building the Model.", direction=API.Direction.OUTPUT) protected long checksum; private PS input_parameters; public ModelSchemaV3() {} public ModelSchemaV3(M m) { super(m); PojoUtils.copyProperties(this.parameters, m._parms, PojoUtils.FieldNaming.ORIGIN_HAS_UNDERSCORES); PojoUtils.copyProperties(this.output, m._output, PojoUtils.FieldNaming.ORIGIN_HAS_UNDERSCORES); } //========================== // Custom adapters go here // TODO: I think we can implement the following two here, using reflection on the type parameters. /** Factory method to create the model-specific parameters schema. */ public PS createParametersSchema() { throw H2O.fail("createParametersSchema() must be implemented in class: " + this.getClass()); } /** Factory method to create the model-specific output schema. */ public OS createOutputSchema() { throw H2O.fail("createOutputSchema() must be implemented in class: " + this.getClass()); } // Version&Schema-specific filling from the impl @Override public S fillFromImpl(M m) { this.timestamp = m._output._job == null?-1:m._output._job.isRunning() ? 0 : m._output._job.end_time(); this.data_frame = new KeyV3.FrameKeyV3(m._parms._train); this.response_column_name = m._parms._response_column; this.treatment_column_name = m._parms._treatment_column; this.algo = m._parms.algoName().toLowerCase(); this.algo_full_name = m._parms.fullName(); // Key<? extends Model> k = m._key; this.model_id = new ModelKeyV3<>(m._key); this.checksum = m.checksum(); this.have_pojo = m.havePojo(); this.have_mojo = m.haveMojo(); parameters = createParametersSchema(); parameters.fillFromImpl(m._parms); if (m._input_parms != null) { input_parameters = createParametersSchema(); input_parameters.fillFromImpl(m._input_parms); } parameters.model_id = model_id; output = createOutputSchema(); output.fillFromImpl(m._output); // noinspection unchecked return (S)this; // have to cast because the definition of S doesn't include ModelSchemaV3 } public final AutoBuffer writeJSON_impl( AutoBuffer ab ) { ab.putJSONStr("algo", algo); ab.put1(','); ab.putJSONStr("algo_full_name", algo_full_name); ab.put1(','); ab.putJSON("model_id", model_id); ab.put1(','); // Builds ModelParameterSchemaV2 objects for each field, and then calls writeJSON on the array try { PS defaults = createParametersSchema().fillFromImpl(parameters.getImplClass().newInstance()); ModelParametersSchemaV3.writeParametersJSON(ab, parameters, input_parameters, defaults ,"parameters"); ab.put1(','); } catch (Exception e) { LOG.error("Error creating an instance of ModelParameters for algo: " + algo, e); String msg = "Error creating an instance of ModelParameters for algo: " + algo; String dev_msg = "Error creating an instance of ModelParameters for algo: " + algo + ": " + this.getImplClass(); throw new H2OIllegalArgumentException(msg, dev_msg); } if (null == output) { // allow key-only output output = createOutputSchema(); } // Let output render itself: ab.putJSON("output", output); ab.put1(','); ab.putJSONAStr("compatible_frames", compatible_frames); return ab; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelSynopsisV3.java
package water.api.schemas3; import hex.Model; /** * A Model synopsis contains only the minimal properties a Model: it's ID (key) and algo. */ public class ModelSynopsisV3<M extends Model<M, ?, ?>> extends ModelSchemaBaseV3<M, ModelSynopsisV3<M>> { public ModelSynopsisV3() { } public ModelSynopsisV3(M m) { super(m); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ModelsV3.java
package water.api.schemas3; import hex.Model; import water.api.*; import water.api.ModelsHandler.Models; public class ModelsV3 extends RequestSchemaV3<Models, ModelsV3> implements ModelExportAware { // Input fields @API(help="Name of Model of interest", json=false) public KeyV3.ModelKeyV3 model_id; @API(help="Return potentially abridged model suitable for viewing in a browser", json=false, required=false, direction=API.Direction.INPUT) public boolean preview = false; @API(help="Find and return compatible frames?", json=false, direction=API.Direction.INPUT) public boolean find_compatible_frames = false; // Output fields @API(help="Models", direction=API.Direction.OUTPUT) public ModelSchemaBaseV3[] models; @API(help="Compatible frames", direction=API.Direction.OUTPUT) public FrameV3[] compatible_frames; // TODO: FrameBaseV3 @API(direction = API.Direction.INPUT, help = "Flag indicating whether the exported model artifact should also include CV Holdout Frame predictions", level = API.Level.secondary) public boolean export_cross_validation_predictions; // Non-version-specific filling into the impl @Override public Models fillImpl(Models m) { super.fillImpl(m); if (null != models) { m.models = new Model[models.length]; int i = 0; for (ModelSchemaBaseV3 model : this.models) { m.models[i++] = (Model)model.createImpl(); } } return m; } @Override public ModelsV3 fillFromImpl(Models m) { // TODO: this is failing in PojoUtils with an IllegalAccessException. Why? Different class loaders? // PojoUtils.copyProperties(this, m, PojoUtils.FieldNaming.CONSISTENT); // Shouldn't need to do this manually. . . this.model_id = new KeyV3.ModelKeyV3(m.model_id); this.find_compatible_frames = m.find_compatible_frames; if (null != m.models) { this.models = new ModelSchemaBaseV3[m.models.length]; int i = 0; for (Model model : m.models) { this.models[i++] = (ModelSchemaV3)SchemaServer.schema(this.getSchemaVersion(), model).fillFromImpl(model); } } return this; } public ModelsV3 fillFromImplWithSynopsis(Models m) { this.model_id = new KeyV3.ModelKeyV3(m.model_id); if (null != m.models) { this.models = new ModelSchemaBaseV3[m.models.length]; int i = 0; for (Model model : m.models) { this.models[i++] = new ModelSynopsisV3(model); } } return this; } @Override public boolean isExportCVPredictionsEnabled() { return export_cross_validation_predictions; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/NetworkBenchV3.java
package water.api.schemas3; import water.api.API; import water.init.NetworkBench; /** */ public class NetworkBenchV3 extends RequestSchemaV3<NetworkBench, NetworkBenchV3> { @API(help="NetworkBenchResults", direction = API.Direction.OUTPUT) TwoDimTableV3[] results; @Override public NetworkBenchV3 fillFromImpl(NetworkBench impl) { if(impl._results != null) { results = new TwoDimTableV3[impl._results.length]; for(int i = 0; i < results.length; ++i) results[i] = (TwoDimTableV3)new TwoDimTableV3().fillFromImpl(impl._results[i].to2dTable()); } return this; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/NetworkTestV3.java
package water.api.schemas3; import water.api.API; import water.init.NetworkTest; public class NetworkTestV3 extends RequestSchemaV3<NetworkTest, NetworkTestV3> { @API(help="Collective broadcast/reduce times in microseconds (for each message size)", direction = API.Direction.OUTPUT) public double[] microseconds_collective; @API(help="Collective bandwidths in Bytes/sec (for each message size, for each node)", direction = API.Direction.OUTPUT) public double[] bandwidths_collective; @API(help="Round-trip times in microseconds (for each message size, for each node)", direction = API.Direction.OUTPUT) public double[][] microseconds; @API(help="Bi-directional bandwidths in Bytes/sec (for each message size, for each node)", direction = API.Direction.OUTPUT) public double[][] bandwidths; @API(help="Nodes", direction = API.Direction.OUTPUT) public String[] nodes; @API(help="NetworkTestResults", direction = API.Direction.OUTPUT) public TwoDimTableV3 table; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/NodePersistentStorageV3.java
package water.api.schemas3; import water.Iced; import water.api.API; /** */ public class NodePersistentStorageV3 extends RequestSchemaV3<Iced, NodePersistentStorageV3> { public static class NodePersistentStorageEntryV3 extends SchemaV3<Iced, NodePersistentStorageEntryV3> { @API(help = "Category name", required = true, direction = API.Direction.OUTPUT) public String category; @API(help = "Key name", required = true, direction = API.Direction.OUTPUT) public String name; @API(help = "Size in bytes of value", required = true, direction = API.Direction.OUTPUT) public long size; @API(help = "Epoch time in milliseconds of when the value was written", required = true, direction = API.Direction.OUTPUT) public long timestamp_millis; } @API(help="Category name", required=false, direction=API.Direction.INOUT) public String category; @API(help="Key name", required=false, direction=API.Direction.INOUT) public String name; @API(help="Value", required=false, direction=API.Direction.INOUT) public String value; @API(help="Configured", required=false, direction=API.Direction.OUTPUT) public boolean configured; @API(help = "Exists", required = false, direction = API.Direction.OUTPUT) public boolean exists; @API(help = "List of entries", required = false, direction = API.Direction.OUTPUT) public NodePersistentStorageEntryV3[] entries; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ParseSVMLightV3.java
package water.api.schemas3; import water.Iced; import water.api.API; /** * API for inhale of sparse data. */ public class ParseSVMLightV3 extends RequestSchemaV3<Iced, ParseSVMLightV3> { // Input fields @API(help = "Final frame name", required = false) public KeyV3.FrameKeyV3 destination_frame; // TODO: for now this has to be a Key, not a Frame, because it doesn't exist yet. @API(help = "Source frames", required = true) public KeyV3.FrameKeyV3[] source_frames; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ParseSetupV3.java
package water.api.schemas3; import water.api.API; import water.api.ParseTypeValuesProvider; import water.api.schemas3.KeyV3.FrameKeyV3; import water.exceptions.H2OIllegalValueException; import water.fvec.FileVec; import water.parser.ParseSetup; import water.parser.ParserInfo; import water.parser.ParserProvider; import water.parser.ParserService; import static water.parser.DefaultParserProviders.GUESS_INFO; public class ParseSetupV3 extends RequestSchemaV3<ParseSetup, ParseSetupV3> { // Input fields @API(help="Source frames", required=true, direction=API.Direction.INOUT) public FrameKeyV3[] source_frames; @API(help="Parser type", valuesProvider = ParseTypeValuesProvider.class, direction=API.Direction.INOUT) public String parse_type = GUESS_INFO.name(); @API(help="Field separator", direction=API.Direction.INOUT) public byte separator = ParseSetup.GUESS_SEP; @API(help="Single quotes", direction=API.Direction.INOUT) public boolean single_quotes = false; @API(help="Check header: 0 means guess, +1 means 1st line is header not data, -1 means 1st line is data not header", direction=API.Direction.INOUT) public int check_header = ParseSetup.GUESS_HEADER; @API(help="Column names", direction=API.Direction.INOUT) public String[] column_names = null; @API(help="Skipped columns indices", direction=API.Direction.INOUT) public int[] skipped_columns = null; @API(help="Value types for columns", direction=API.Direction.INOUT) public String[] column_types = null; @API(help="NA strings for columns", direction=API.Direction.INOUT) public String[][] na_strings; @API(help="Regex for names of columns to return", direction=API.Direction.INOUT) public String column_name_filter; @API(help="Column offset to return", direction=API.Direction.INOUT) public int column_offset; @API(help="Number of columns to return", direction=API.Direction.INOUT) public int column_count; // Output fields @API(help="Suggested name", direction=API.Direction.OUTPUT) public String destination_frame; @API(help="Number of header lines found", direction=API.Direction.OUTPUT) long header_lines; @API(help="Number of columns", direction=API.Direction.OUTPUT) public int number_columns = ParseSetup.GUESS_COL_CNT; @API(help="Sample data", direction=API.Direction.OUTPUT) public String[][] data; @API(help="Warnings", direction=API.Direction.OUTPUT) public String[] warnings; @API(help="Size of individual parse tasks", direction=API.Direction.OUTPUT) public int chunk_size = FileVec.DFLT_CHUNK_SIZE; @API(help="Total number of columns we would return with no column pagination", direction=API.Direction.INOUT) public int total_filtered_column_count; @API(help="Custom characters to be treated as non-data line markers", direction=API.Direction.INOUT) public String custom_non_data_line_markers; @API(help="Key-reference to an initialized instance of a Decryption Tool") public KeyV3.DecryptionToolKeyV3 decrypt_tool; @API(help = "Names of the columns the persisted dataset has been partitioned by.", direction = API.Direction.INOUT) public String[] partition_by; @API(help="One ASCII character used to escape other characters.", direction=API.Direction.INOUT) public byte escapechar = ParseSetup.DEFAULT_ESCAPE_CHAR; @API(help="If true, will force the column types to be either the ones in Parquet schema for Parquet files or the" + " ones specified in column_types. This parameter is used for numerical columns only. Other column settings" + " will happen without setting this parameter. Defaults to false.", direction=API.Direction.INPUT) public boolean force_col_types; @API(help="Adjust the imported time from GMT timezone to cluster timezone.", direction=API.Direction.INPUT) public boolean tz_adjust_to_local; @Override public ParseSetup fillImpl(ParseSetup impl) { ParseSetup parseSetup = fillImpl(impl, new String[] {"parse_type"}); // Transform the field parse_type ParserInfo pi = GUESS_INFO; if (this.parse_type != null) { ParserProvider pp = ParserService.INSTANCE.getByName(this.parse_type); if (pp != null) { pi = pp.info(); } else throw new H2OIllegalValueException("Cannot find right parser for specified parser type!", this.parse_type); } parseSetup.setParseType(pi); return parseSetup; } @Override public ParseSetupV3 fillFromImpl(ParseSetup impl) { ParseSetupV3 parseSetupV3 = fillFromImpl(impl, new String[] {"parse_type"}); parseSetupV3.parse_type = impl.getParseType() != null ? impl.getParseType().name() : GUESS_INFO.name(); return parseSetupV3; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ParseV3.java
package water.api.schemas3; import water.Iced; import water.api.API; import water.api.schemas3.KeyV3.FrameKeyV3; import water.api.ParseTypeValuesProvider; import water.parser.ParseSetup; public class ParseV3 extends RequestSchemaV3<Iced, ParseV3> { // Input fields @API(help="Final frame name",required=true) public FrameKeyV3 destination_frame; // TODO: for now this has to be a Key, not a Frame, because it doesn't exist // yet. @API(help="Source frames",required=true) public FrameKeyV3[] source_frames; @API(help="Parser type", valuesProvider = ParseTypeValuesProvider.class) public String parse_type; @API(help="Field separator") public byte separator; @API(help="Single Quotes") public boolean single_quotes; @API(help="Check header: 0 means guess, +1 means 1st line is header not data, -1 means 1st line is data not header") public int check_header; @API(help="Number of columns") public int number_columns; @API(help="Column names") public String[] column_names; @API(help="Value types for columns") public String[] column_types; @API(help="Skipped columns indices", direction=API.Direction.INOUT) public int[] skipped_columns; @API(help="If true, will force the column types to be either the ones in Parquet schema for Parquet files or the " + "ones specified in column_types. This parameter is used for numerical columns only. Other column" + "settings will happen without setting this parameter. Defaults to false.", direction=API.Direction.INPUT) public boolean force_col_types; @API(help="Domains for categorical columns") public String[][] domains; @API(help="NA strings for columns") public String[][] na_strings; @API(help="Size of individual parse tasks", direction=API.Direction.INPUT) public int chunk_size; @API(help="Delete input key after parse") public boolean delete_on_done; @API(help="Block until the parse completes (as opposed to returning early and requiring polling") public boolean blocking; @API(help="Key-reference to an initialized instance of a Decryption Tool") public KeyV3.DecryptionToolKeyV3 decrypt_tool; @API(help="Custom characters to be treated as non-data line markers", direction=API.Direction.INPUT) public String custom_non_data_line_markers; @API(help = "Name of the column the persisted dataset has been partitioned by.") public String[] partition_by; // Output fields @API(help="Parse job", direction=API.Direction.OUTPUT) public JobV3 job; // Zero if blocking==false; row-count if blocking==true @API(help="Rows", direction=API.Direction.OUTPUT) public long rows; @API(help="One ASCII character used to escape other characters.", direction=API.Direction.INOUT) public byte escapechar = ParseSetup.DEFAULT_ESCAPE_CHAR; @API(help="Adjust the imported time from GMT timezone to cluster timezone.", direction=API.Direction.INPUT) public boolean tz_adjust_to_local; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/PartialDependenceV3.java
package water.api.schemas3; import hex.PartialDependence; import water.Key; import water.api.API; /** * Partial dependence plot */ public class PartialDependenceV3 extends SchemaV3<PartialDependence, PartialDependenceV3> { @SuppressWarnings("unused") @API(help="Model", direction = API.Direction.INOUT) public KeyV3.ModelKeyV3 model_id; @SuppressWarnings("unused") @API(help="Frame", direction=API.Direction.INOUT) public KeyV3.FrameKeyV3 frame_id; @SuppressWarnings("unused") @API(help="Row Index", direction=API.Direction.INOUT) public long row_index; @SuppressWarnings("unused") @API(help="Column(s)", direction=API.Direction.INOUT) public String[] cols; @SuppressWarnings("unused") @API(help="weight_column_index", direction=API.Direction.INOUT) public int weight_column_index; // choose which column containing the weight @SuppressWarnings("unused") @API(help="add_missing_na", direction=API.Direction.INOUT) public boolean add_missing_na; // add missing values if data column contains NAs @SuppressWarnings("unused") @API(help="Number of bins", direction=API.Direction.INOUT) public int nbins; @SuppressWarnings("unused") @API(help="User define split points", direction=API.Direction.INOUT) public double[] user_splits; // all user split columns by value @SuppressWarnings("unused") @API(help="Column(s) of user defined splits", direction=API.Direction.INOUT) public String[] user_cols; // list column indices to use user defined split values @SuppressWarnings("unused") @API(help="Number of user defined splits per column", direction=API.Direction.INOUT) public int[] num_user_splits; // list of number of user defined split values per column @SuppressWarnings("unused") @API(help="Partial Dependence Data", direction=API.Direction.OUTPUT) public TwoDimTableV3[] partial_dependence_data; @API(help="lists of column name pairs to plot 2D pdp for", direction=API.Direction.INOUT) public String[][] col_pairs_2dpdp; @API(help="Key to store the destination", direction=API.Direction.INPUT) public KeyV3.PartialDependenceKeyV3 destination_key; @API(help="Target classes for multinomial classification", direction=API.Direction.INPUT) public String[] targets; @Override public PartialDependence createImpl( ) { return new PartialDependence(Key.<PartialDependence>make()); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/PingV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class PingV3 extends RequestSchemaV3<Iced, PingV3> { public PingV3() { } @API(help = "cloud_uptime_millis", direction = API.Direction.OUTPUT) public long cloud_uptime_millis; @API(help = "cloud_healthy", direction = API.Direction.OUTPUT) public boolean cloud_healthy; @API(help="nodes", direction=API.Direction.OUTPUT) public NodeMemoryInfoV3[] nodes; public static class NodeMemoryInfoV3 extends SchemaV3<Iced, NodeMemoryInfoV3> { public NodeMemoryInfoV3() { } public NodeMemoryInfoV3(String ipPort, long freeMemory) { ip_port = ipPort; free_mem = freeMemory; } @API(help="IP address and port in the form a.b.c.d:e", direction=API.Direction.OUTPUT) public String ip_port; @API(help = "Free heap", direction = API.Direction.OUTPUT) public long free_mem; } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ProfilerNodeV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class ProfilerNodeV3 extends SchemaV3<Iced, ProfilerNodeV3> { public static class ProfilerNodeEntryV3 extends SchemaV3<Iced, ProfilerNodeEntryV3> { @API(help="Stack trace", direction=API.Direction.OUTPUT) public String stacktrace; @API(help="Profile Count", direction=API.Direction.OUTPUT) public int count; } @API(help="Node names", direction=API.Direction.OUTPUT) public String node_name; @API(help="Timestamp (millis since epoch)", direction=API.Direction.OUTPUT) public long timestamp; @API(help="Profile entry list", direction=API.Direction.OUTPUT) public ProfilerNodeEntryV3[] entries; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/ProfilerV3.java
package water.api.schemas3; import water.Iced; import water.api.API; public class ProfilerV3 extends RequestSchemaV3<Iced, ProfilerV3> { @API(help="Stack trace depth", required=true) public int depth = 10; @API(help="", direction = API.Direction.OUTPUT) public ProfilerNodeV3[] nodes; }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/RapidsFrameV3.java
package water.api.schemas3; import water.Iced; import water.api.API; import water.fvec.Frame; public class RapidsFrameV3 extends RapidsSchemaV3<Iced,RapidsFrameV3> { @API(help="Frame result", direction=API.Direction.OUTPUT) public KeyV3.FrameKeyV3 key; @API(help="Rows in Frame result", direction=API.Direction.OUTPUT) public long num_rows; @API(help="Columns in Frame result", direction=API.Direction.OUTPUT) public int num_cols; public RapidsFrameV3() {} public RapidsFrameV3(Frame fr) { key = new KeyV3.FrameKeyV3(fr._key); num_rows = fr.numRows(); num_cols = fr.numCols(); } }
0
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api
java-sources/ai/h2o/h2o-core/3.46.0.7/water/api/schemas3/RapidsFunctionV3.java
package water.api.schemas3; import water.Iced; import water.api.API; /** */ public class RapidsFunctionV3 extends RapidsSchemaV3<Iced,RapidsFunctionV3> { @API(help="Function result", direction=API.Direction.OUTPUT) public String funstr; public RapidsFunctionV3() {} public RapidsFunctionV3(String s) { funstr = s; } }