id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
51,900
h2oai/h2o-2
src/main/java/hex/gbm/DHistogram.java
DHistogram.initialHist
static public DHistogram[] initialHist(Frame fr, int ncols, int nbins, DHistogram hs[], int min_rows, boolean doGrpSplit, boolean isBinom) { Vec vecs[] = fr.vecs(); for( int c=0; c<ncols; c++ ) { Vec v = vecs[c]; final float minIn = (float)Math.max(v.min(),-Float.MAX_VALUE); // inclusive vector min ...
java
static public DHistogram[] initialHist(Frame fr, int ncols, int nbins, DHistogram hs[], int min_rows, boolean doGrpSplit, boolean isBinom) { Vec vecs[] = fr.vecs(); for( int c=0; c<ncols; c++ ) { Vec v = vecs[c]; final float minIn = (float)Math.max(v.min(),-Float.MAX_VALUE); // inclusive vector min ...
[ "static", "public", "DHistogram", "[", "]", "initialHist", "(", "Frame", "fr", ",", "int", "ncols", ",", "int", "nbins", ",", "DHistogram", "hs", "[", "]", ",", "int", "min_rows", ",", "boolean", "doGrpSplit", ",", "boolean", "isBinom", ")", "{", "Vec", ...
The initial histogram bins are setup from the Vec rollups.
[ "The", "initial", "histogram", "bins", "are", "setup", "from", "the", "Vec", "rollups", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/gbm/DHistogram.java#L187-L199
51,901
h2oai/h2o-2
src/main/java/hex/gbm/DHistogram.java
DHistogram.isConstantResponse
public boolean isConstantResponse() { double m = Double.NaN; for( int b=0; b<_bins.length; b++ ) { if( _bins[b] == 0 ) continue; if( var(b) > 1e-14 ) return false; double mean = mean(b); if( mean != m ) if( Double.isNaN(m) ) m=mean; else if(Math.abs(m - mean) > 1e-6) retu...
java
public boolean isConstantResponse() { double m = Double.NaN; for( int b=0; b<_bins.length; b++ ) { if( _bins[b] == 0 ) continue; if( var(b) > 1e-14 ) return false; double mean = mean(b); if( mean != m ) if( Double.isNaN(m) ) m=mean; else if(Math.abs(m - mean) > 1e-6) retu...
[ "public", "boolean", "isConstantResponse", "(", ")", "{", "double", "m", "=", "Double", ".", "NaN", ";", "for", "(", "int", "b", "=", "0", ";", "b", "<", "_bins", ".", "length", ";", "b", "++", ")", "{", "if", "(", "_bins", "[", "b", "]", "==",...
Check for a constant response variable
[ "Check", "for", "a", "constant", "response", "variable" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/gbm/DHistogram.java#L208-L219
51,902
h2oai/h2o-2
src/main/java/water/Paxos.java
Paxos.lockCloud
static void lockCloud() { if( _cloudLocked ) return; // Fast-path cutout synchronized(Paxos.class) { while( !_commonKnowledge ) try { Paxos.class.wait(); } catch( InterruptedException ie ) { } _cloudLocked = true; } }
java
static void lockCloud() { if( _cloudLocked ) return; // Fast-path cutout synchronized(Paxos.class) { while( !_commonKnowledge ) try { Paxos.class.wait(); } catch( InterruptedException ie ) { } _cloudLocked = true; } }
[ "static", "void", "lockCloud", "(", ")", "{", "if", "(", "_cloudLocked", ")", "return", ";", "// Fast-path cutout", "synchronized", "(", "Paxos", ".", "class", ")", "{", "while", "(", "!", "_commonKnowledge", ")", "try", "{", "Paxos", ".", "class", ".", ...
change cloud shape - the distributed writes will be in the wrong place.
[ "change", "cloud", "shape", "-", "the", "distributed", "writes", "will", "be", "in", "the", "wrong", "place", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Paxos.java#L117-L124
51,903
h2oai/h2o-2
src/main/java/hex/FrameExtractor.java
FrameExtractor.makeTemplates
protected Vec[][] makeTemplates() { Vec anyVec = dataset.anyVec(); final long[][] espcPerSplit = computeEspcPerSplit(anyVec._espc, anyVec.length()); final int num = dataset.numCols(); // number of columns in input frame final int nsplits = espcPerSplit.length; // number of splits final String[][] do...
java
protected Vec[][] makeTemplates() { Vec anyVec = dataset.anyVec(); final long[][] espcPerSplit = computeEspcPerSplit(anyVec._espc, anyVec.length()); final int num = dataset.numCols(); // number of columns in input frame final int nsplits = espcPerSplit.length; // number of splits final String[][] do...
[ "protected", "Vec", "[", "]", "[", "]", "makeTemplates", "(", ")", "{", "Vec", "anyVec", "=", "dataset", ".", "anyVec", "(", ")", ";", "final", "long", "[", "]", "[", "]", "espcPerSplit", "=", "computeEspcPerSplit", "(", "anyVec", ".", "_espc", ",", ...
Create a templates for vector composing output frame
[ "Create", "a", "templates", "for", "vector", "composing", "output", "frame" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/FrameExtractor.java#L103-L117
51,904
h2oai/h2o-2
src/main/java/water/parser/XlsParser.java
XlsParser.guessSetup
public static PSetupGuess guessSetup(byte [] bits){ InputStream is = new ByteArrayInputStream(bits); XlsParser p = new XlsParser(); CustomInspectDataOut dout = new CustomInspectDataOut(); try{p.streamParse(is, dout);}catch(Exception e){} return new PSetupGuess(new ParserSetup(ParserType.XLS,CsvParse...
java
public static PSetupGuess guessSetup(byte [] bits){ InputStream is = new ByteArrayInputStream(bits); XlsParser p = new XlsParser(); CustomInspectDataOut dout = new CustomInspectDataOut(); try{p.streamParse(is, dout);}catch(Exception e){} return new PSetupGuess(new ParserSetup(ParserType.XLS,CsvParse...
[ "public", "static", "PSetupGuess", "guessSetup", "(", "byte", "[", "]", "bits", ")", "{", "InputStream", "is", "=", "new", "ByteArrayInputStream", "(", "bits", ")", ";", "XlsParser", "p", "=", "new", "XlsParser", "(", ")", ";", "CustomInspectDataOut", "dout"...
Try to parse the bits as svm light format, return SVMParser instance if the input is in svm light format, null otherwise. @param bits @return SVMLightPArser instance or null
[ "Try", "to", "parse", "the", "bits", "as", "svm", "light", "format", "return", "SVMParser", "instance", "if", "the", "input", "is", "in", "svm", "light", "format", "null", "otherwise", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/parser/XlsParser.java#L49-L55
51,905
h2oai/h2o-2
src/main/java/hex/la/DMatrix.java
DMatrix.mmul
public static Frame mmul(Frame x, Frame y) { MatrixMulJob mmj = new MatrixMulJob(Key.make("mmul" + ++cnt),Key.make("mmulProgress"),x,y); mmj.fork()._fjtask.join(); DKV.remove(mmj._dstKey); // do not leave garbage in KV mmj._z.reloadVecs(); return mmj._z; }
java
public static Frame mmul(Frame x, Frame y) { MatrixMulJob mmj = new MatrixMulJob(Key.make("mmul" + ++cnt),Key.make("mmulProgress"),x,y); mmj.fork()._fjtask.join(); DKV.remove(mmj._dstKey); // do not leave garbage in KV mmj._z.reloadVecs(); return mmj._z; }
[ "public", "static", "Frame", "mmul", "(", "Frame", "x", ",", "Frame", "y", ")", "{", "MatrixMulJob", "mmj", "=", "new", "MatrixMulJob", "(", "Key", ".", "make", "(", "\"mmul\"", "+", "++", "cnt", ")", ",", "Key", ".", "make", "(", "\"mmulProgress\"", ...
to be invoked from R expression
[ "to", "be", "invoked", "from", "R", "expression" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/la/DMatrix.java#L247-L253
51,906
h2oai/h2o-2
src/main/java/water/DRemoteTask.java
DRemoteTask.invokeOnAllNodes
public T invokeOnAllNodes() { H2O cloud = H2O.CLOUD; Key[] args = new Key[cloud.size()]; String skey = "RunOnAll"+Key.rand(); for( int i = 0; i < args.length; ++i ) args[i] = Key.make(skey,(byte)0,Key.DFJ_INTERNAL_USER,cloud._memary[i]); invoke(args); for( Key arg : args ) DKV.remove(arg);...
java
public T invokeOnAllNodes() { H2O cloud = H2O.CLOUD; Key[] args = new Key[cloud.size()]; String skey = "RunOnAll"+Key.rand(); for( int i = 0; i < args.length; ++i ) args[i] = Key.make(skey,(byte)0,Key.DFJ_INTERNAL_USER,cloud._memary[i]); invoke(args); for( Key arg : args ) DKV.remove(arg);...
[ "public", "T", "invokeOnAllNodes", "(", ")", "{", "H2O", "cloud", "=", "H2O", ".", "CLOUD", ";", "Key", "[", "]", "args", "=", "new", "Key", "[", "cloud", ".", "size", "(", ")", "]", ";", "String", "skey", "=", "\"RunOnAll\"", "+", "Key", ".", "r...
Invokes the task on all nodes
[ "Invokes", "the", "task", "on", "all", "nodes" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/DRemoteTask.java#L44-L53
51,907
h2oai/h2o-2
src/main/java/water/DRemoteTask.java
DRemoteTask.block
@Override public boolean block() throws InterruptedException { while( !isDone() ) { try { get(); } catch(ExecutionException eex) { // skip the execution part Throwable tex = eex.getCause(); if( tex instanceof Error) throw ( Error)tex; if( tex instan...
java
@Override public boolean block() throws InterruptedException { while( !isDone() ) { try { get(); } catch(ExecutionException eex) { // skip the execution part Throwable tex = eex.getCause(); if( tex instanceof Error) throw ( Error)tex; if( tex instan...
[ "@", "Override", "public", "boolean", "block", "(", ")", "throws", "InterruptedException", "{", "while", "(", "!", "isDone", "(", ")", ")", "{", "try", "{", "get", "(", ")", ";", "}", "catch", "(", "ExecutionException", "eex", ")", "{", "// skip the exec...
deadlock is otherwise all threads would block on waits.
[ "deadlock", "is", "otherwise", "all", "threads", "would", "block", "on", "waits", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/DRemoteTask.java#L73-L86
51,908
h2oai/h2o-2
src/main/java/water/DRemoteTask.java
DRemoteTask.dcompute
private final void dcompute() {// Work to do the distribution // Split out the keys into disjointly-homed sets of keys. // Find the split point. First find the range of home-indices. H2O cloud = H2O.CLOUD; int lo=cloud._memary.length, hi=-1; for( Key k : _keys ) { int i = k.home(cloud); ...
java
private final void dcompute() {// Work to do the distribution // Split out the keys into disjointly-homed sets of keys. // Find the split point. First find the range of home-indices. H2O cloud = H2O.CLOUD; int lo=cloud._memary.length, hi=-1; for( Key k : _keys ) { int i = k.home(cloud); ...
[ "private", "final", "void", "dcompute", "(", ")", "{", "// Work to do the distribution", "// Split out the keys into disjointly-homed sets of keys.", "// Find the split point. First find the range of home-indices.", "H2O", "cloud", "=", "H2O", ".", "CLOUD", ";", "int", "lo", "...
Override to specify local work
[ "Override", "to", "specify", "local", "work" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/DRemoteTask.java#L104-L144
51,909
h2oai/h2o-2
src/main/java/water/DRemoteTask.java
DRemoteTask.donCompletion
private final void donCompletion( CountedCompleter caller ) { // Distributed completion assert _lo == null || _lo.isDone(); assert _hi == null || _hi.isDone(); // Fold up results from left & right subtrees if( _lo != null ) reduce2(_lo.get()); if( _hi != null ) reduce2(_hi.get()); if( _l...
java
private final void donCompletion( CountedCompleter caller ) { // Distributed completion assert _lo == null || _lo.isDone(); assert _hi == null || _hi.isDone(); // Fold up results from left & right subtrees if( _lo != null ) reduce2(_lo.get()); if( _hi != null ) reduce2(_hi.get()); if( _l...
[ "private", "final", "void", "donCompletion", "(", "CountedCompleter", "caller", ")", "{", "// Distributed completion", "assert", "_lo", "==", "null", "||", "_lo", ".", "isDone", "(", ")", ";", "assert", "_hi", "==", "null", "||", "_hi", ".", "isDone", "(", ...
Override for local completion
[ "Override", "for", "local", "completion" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/DRemoteTask.java#L148-L164
51,910
h2oai/h2o-2
src/main/java/water/api/RequestArguments.java
RequestArguments.argumentsToJson
protected JsonObject argumentsToJson() { JsonObject result = new JsonObject(); for (Argument a : _arguments) { if (a.specified()) result.addProperty(a._name,a.originalValue()); } return result; }
java
protected JsonObject argumentsToJson() { JsonObject result = new JsonObject(); for (Argument a : _arguments) { if (a.specified()) result.addProperty(a._name,a.originalValue()); } return result; }
[ "protected", "JsonObject", "argumentsToJson", "(", ")", "{", "JsonObject", "result", "=", "new", "JsonObject", "(", ")", ";", "for", "(", "Argument", "a", ":", "_arguments", ")", "{", "if", "(", "a", ".", "specified", "(", ")", ")", "result", ".", "add...
Returns a json object containing all arguments specified to the page. Useful for redirects and polling.
[ "Returns", "a", "json", "object", "containing", "all", "arguments", "specified", "to", "the", "page", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/RequestArguments.java#L56-L63
51,911
h2oai/h2o-2
src/main/java/hex/singlenoderf/SpeeDRF.java
SpeeDRF.init
@Override protected void init() { super.init(); assert 0 <= ntrees && ntrees < 1000000; // Sanity check // Not enough rows to run if (source.numRows() - response.naCnt() <=0) throw new IllegalArgumentException("Dataset contains too many NAs!"); if( !classification && (!(response.isEnum() || ...
java
@Override protected void init() { super.init(); assert 0 <= ntrees && ntrees < 1000000; // Sanity check // Not enough rows to run if (source.numRows() - response.naCnt() <=0) throw new IllegalArgumentException("Dataset contains too many NAs!"); if( !classification && (!(response.isEnum() || ...
[ "@", "Override", "protected", "void", "init", "(", ")", "{", "super", ".", "init", "(", ")", ";", "assert", "0", "<=", "ntrees", "&&", "ntrees", "<", "1000000", ";", "// Sanity check", "// Not enough rows to run", "if", "(", "source", ".", "numRows", "(", ...
Put here all precondition verification
[ "Put", "here", "all", "precondition", "verification" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/singlenoderf/SpeeDRF.java#L177-L194
51,912
h2oai/h2o-2
src/main/java/hex/singlenoderf/SpeeDRF.java
SpeeDRF.build
public static void build( final Key jobKey, final Key modelKey, final DRFParams drfParams, final Data localData, int ntrees, int numSplitFeatures, int[] rowsPerChunks) { Timer t_alltrees = new Timer(); Tree[] trees = n...
java
public static void build( final Key jobKey, final Key modelKey, final DRFParams drfParams, final Data localData, int ntrees, int numSplitFeatures, int[] rowsPerChunks) { Timer t_alltrees = new Timer(); Tree[] trees = n...
[ "public", "static", "void", "build", "(", "final", "Key", "jobKey", ",", "final", "Key", "modelKey", ",", "final", "DRFParams", "drfParams", ",", "final", "Data", "localData", ",", "int", "ntrees", ",", "int", "numSplitFeatures", ",", "int", "[", "]", "row...
Build random forest for data stored on this node.
[ "Build", "random", "forest", "for", "data", "stored", "on", "this", "node", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/singlenoderf/SpeeDRF.java#L580-L606
51,913
h2oai/h2o-2
h2o-samples/src/main/java/samples/expert/WebAPI.java
WebAPI.listJobs
static void listJobs() throws Exception { HttpClient client = new HttpClient(); GetMethod get = new GetMethod(URL + "/Jobs.json"); int status = client.executeMethod(get); if( status != 200 ) throw new Exception(get.getStatusText()); Gson gson = new Gson(); JobsRes res = gson.fromJson(new I...
java
static void listJobs() throws Exception { HttpClient client = new HttpClient(); GetMethod get = new GetMethod(URL + "/Jobs.json"); int status = client.executeMethod(get); if( status != 200 ) throw new Exception(get.getStatusText()); Gson gson = new Gson(); JobsRes res = gson.fromJson(new I...
[ "static", "void", "listJobs", "(", ")", "throws", "Exception", "{", "HttpClient", "client", "=", "new", "HttpClient", "(", ")", ";", "GetMethod", "get", "=", "new", "GetMethod", "(", "URL", "+", "\"/Jobs.json\"", ")", ";", "int", "status", "=", "client", ...
Lists jobs currently running.
[ "Lists", "jobs", "currently", "running", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/h2o-samples/src/main/java/samples/expert/WebAPI.java#L38-L50
51,914
h2oai/h2o-2
h2o-samples/src/main/java/samples/expert/WebAPI.java
WebAPI.exportModel
static void exportModel() throws Exception { HttpClient client = new HttpClient(); GetMethod get = new GetMethod(URL + "/2/ExportModel.json?model=MyInitialNeuralNet"); int status = client.executeMethod(get); if( status != 200 ) throw new Exception(get.getStatusText()); JsonObject response = (J...
java
static void exportModel() throws Exception { HttpClient client = new HttpClient(); GetMethod get = new GetMethod(URL + "/2/ExportModel.json?model=MyInitialNeuralNet"); int status = client.executeMethod(get); if( status != 200 ) throw new Exception(get.getStatusText()); JsonObject response = (J...
[ "static", "void", "exportModel", "(", ")", "throws", "Exception", "{", "HttpClient", "client", "=", "new", "HttpClient", "(", ")", ";", "GetMethod", "get", "=", "new", "GetMethod", "(", "URL", "+", "\"/2/ExportModel.json?model=MyInitialNeuralNet\"", ")", ";", "i...
Exports a model to a JSON file.
[ "Exports", "a", "model", "to", "a", "JSON", "file", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/h2o-samples/src/main/java/samples/expert/WebAPI.java#L67-L81
51,915
h2oai/h2o-2
h2o-samples/src/main/java/samples/expert/WebAPI.java
WebAPI.importModel
public static void importModel() throws Exception { // Upload file to H2O HttpClient client = new HttpClient(); PostMethod post = new PostMethod(URL + "/Upload.json?key=" + JSON_FILE.getName()); Part[] parts = { new FilePart(JSON_FILE.getName(), JSON_FILE) }; post.setRequestEntity(new MultipartReque...
java
public static void importModel() throws Exception { // Upload file to H2O HttpClient client = new HttpClient(); PostMethod post = new PostMethod(URL + "/Upload.json?key=" + JSON_FILE.getName()); Part[] parts = { new FilePart(JSON_FILE.getName(), JSON_FILE) }; post.setRequestEntity(new MultipartReque...
[ "public", "static", "void", "importModel", "(", ")", "throws", "Exception", "{", "// Upload file to H2O", "HttpClient", "client", "=", "new", "HttpClient", "(", ")", ";", "PostMethod", "post", "=", "new", "PostMethod", "(", "URL", "+", "\"/Upload.json?key=\"", "...
Imports a model from a JSON file.
[ "Imports", "a", "model", "from", "a", "JSON", "file", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/h2o-samples/src/main/java/samples/expert/WebAPI.java#L86-L104
51,916
h2oai/h2o-2
src/main/java/hex/singlenoderf/DABuilder.java
DABuilder.checkAndLimitFeatureUsedPerSplit
private void checkAndLimitFeatureUsedPerSplit(Frame fr) { int validCols = fr.numCols()-1; // for classIdx column if (validCols < _rfParams.num_split_features) { Log.info(Log.Tag.Sys.RANDF, "Limiting features from " + _rfParams.num_split_features + " to " + validCols + " because there...
java
private void checkAndLimitFeatureUsedPerSplit(Frame fr) { int validCols = fr.numCols()-1; // for classIdx column if (validCols < _rfParams.num_split_features) { Log.info(Log.Tag.Sys.RANDF, "Limiting features from " + _rfParams.num_split_features + " to " + validCols + " because there...
[ "private", "void", "checkAndLimitFeatureUsedPerSplit", "(", "Frame", "fr", ")", "{", "int", "validCols", "=", "fr", ".", "numCols", "(", ")", "-", "1", ";", "// for classIdx column", "if", "(", "validCols", "<", "_rfParams", ".", "num_split_features", ")", "{"...
Check that we have proper number of valid columns vs. features selected, if not cap
[ "Check", "that", "we", "have", "proper", "number", "of", "valid", "columns", "vs", ".", "features", "selected", "if", "not", "cap" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/singlenoderf/DABuilder.java#L34-L41
51,917
h2oai/h2o-2
src/main/java/hex/singlenoderf/DABuilder.java
DABuilder.getChunkId
private long getChunkId(final Frame fr) { Key[] keys = new Key[fr.anyVec().nChunks()]; for(int i = 0; i < fr.anyVec().nChunks(); ++i) { keys[i] = fr.anyVec().chunkKey(i); } for(int i = 0; i < keys.length; ++i) { if (keys[i].home()) return i; } return -99999; //throw n...
java
private long getChunkId(final Frame fr) { Key[] keys = new Key[fr.anyVec().nChunks()]; for(int i = 0; i < fr.anyVec().nChunks(); ++i) { keys[i] = fr.anyVec().chunkKey(i); } for(int i = 0; i < keys.length; ++i) { if (keys[i].home()) return i; } return -99999; //throw n...
[ "private", "long", "getChunkId", "(", "final", "Frame", "fr", ")", "{", "Key", "[", "]", "keys", "=", "new", "Key", "[", "fr", ".", "anyVec", "(", ")", ".", "nChunks", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fr",...
Return chunk index of the first chunk on this node. Used to identify the trees built here.
[ "Return", "chunk", "index", "of", "the", "first", "chunk", "on", "this", "node", ".", "Used", "to", "identify", "the", "trees", "built", "here", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/singlenoderf/DABuilder.java#L47-L56
51,918
h2oai/h2o-2
src/main/java/water/api/RequestStatics.java
RequestStatics.JSON2HTML
public static String JSON2HTML(String name) { if( name.length() < 1 ) return name; if(name == "row") { return name.substring(0,1).toUpperCase()+ name.replace("_"," ").substring(1); } return name.substring(0,1)+name.replace("_"," ").substring(1); }
java
public static String JSON2HTML(String name) { if( name.length() < 1 ) return name; if(name == "row") { return name.substring(0,1).toUpperCase()+ name.replace("_"," ").substring(1); } return name.substring(0,1)+name.replace("_"," ").substring(1); }
[ "public", "static", "String", "JSON2HTML", "(", "String", "name", ")", "{", "if", "(", "name", ".", "length", "(", ")", "<", "1", ")", "return", "name", ";", "if", "(", "name", "==", "\"row\"", ")", "{", "return", "name", ".", "substring", "(", "0"...
Returns the name of the JSON property pretty printed. That is spaces instead of underscores and capital first letter. @param name @return
[ "Returns", "the", "name", "of", "the", "JSON", "property", "pretty", "printed", ".", "That", "is", "spaces", "instead", "of", "underscores", "and", "capital", "first", "letter", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/RequestStatics.java#L93-L99
51,919
h2oai/h2o-2
src/main/java/water/parser/SVMLightParser.java
SVMLightParser.guessSetup
public static PSetupGuess guessSetup(byte [] bytes){ // find the last eof int i = bytes.length-1; while(i > 0 && bytes[i] != '\n')--i; assert i >= 0; InputStream is = new ByteArrayInputStream(Arrays.copyOf(bytes,i)); SVMLightParser p = new SVMLightParser(new ParserSetup(ParserType.SVMLight, CsvP...
java
public static PSetupGuess guessSetup(byte [] bytes){ // find the last eof int i = bytes.length-1; while(i > 0 && bytes[i] != '\n')--i; assert i >= 0; InputStream is = new ByteArrayInputStream(Arrays.copyOf(bytes,i)); SVMLightParser p = new SVMLightParser(new ParserSetup(ParserType.SVMLight, CsvP...
[ "public", "static", "PSetupGuess", "guessSetup", "(", "byte", "[", "]", "bytes", ")", "{", "// find the last eof", "int", "i", "=", "bytes", ".", "length", "-", "1", ";", "while", "(", "i", ">", "0", "&&", "bytes", "[", "i", "]", "!=", "'", "'", ")...
Try to parse the bytes as svm light format, return SVMParser instance if the input is in svm light format, null otherwise. @param bytes @return SVMLightPArser instance or null
[ "Try", "to", "parse", "the", "bytes", "as", "svm", "light", "format", "return", "SVMParser", "instance", "if", "the", "input", "is", "in", "svm", "light", "format", "null", "otherwise", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/parser/SVMLightParser.java#L52-L62
51,920
h2oai/h2o-2
src/main/java/water/nbhm/UtilUnsafe.java
UtilUnsafe.getUnsafe
public static Unsafe getUnsafe() { // Not on bootclasspath if( UtilUnsafe.class.getClassLoader() == null ) return Unsafe.getUnsafe(); try { final Field fld = Unsafe.class.getDeclaredField("theUnsafe"); fld.setAccessible(true); return (Unsafe) fld.get(UtilUnsafe.class); } catch (E...
java
public static Unsafe getUnsafe() { // Not on bootclasspath if( UtilUnsafe.class.getClassLoader() == null ) return Unsafe.getUnsafe(); try { final Field fld = Unsafe.class.getDeclaredField("theUnsafe"); fld.setAccessible(true); return (Unsafe) fld.get(UtilUnsafe.class); } catch (E...
[ "public", "static", "Unsafe", "getUnsafe", "(", ")", "{", "// Not on bootclasspath", "if", "(", "UtilUnsafe", ".", "class", ".", "getClassLoader", "(", ")", "==", "null", ")", "return", "Unsafe", ".", "getUnsafe", "(", ")", ";", "try", "{", "final", "Field...
Fetch the Unsafe. Use With Caution.
[ "Fetch", "the", "Unsafe", ".", "Use", "With", "Caution", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/nbhm/UtilUnsafe.java#L17-L28
51,921
h2oai/h2o-2
src/main/java/hex/deeplearning/Neurons.java
Linear.bprop
protected void bprop(float target) { assert (target != missing_real_value); if (params.loss != Loss.MeanSquare) throw new UnsupportedOperationException("Regression is only implemented for MeanSquare error."); final int row = 0; // Computing partial derivative: dE/dnet = dE/dy * dy/dnet = dE/dy *...
java
protected void bprop(float target) { assert (target != missing_real_value); if (params.loss != Loss.MeanSquare) throw new UnsupportedOperationException("Regression is only implemented for MeanSquare error."); final int row = 0; // Computing partial derivative: dE/dnet = dE/dy * dy/dnet = dE/dy *...
[ "protected", "void", "bprop", "(", "float", "target", ")", "{", "assert", "(", "target", "!=", "missing_real_value", ")", ";", "if", "(", "params", ".", "loss", "!=", "Loss", ".", "MeanSquare", ")", "throw", "new", "UnsupportedOperationException", "(", "\"Re...
Backpropagation for regression @param target floating-point target value
[ "Backpropagation", "for", "regression" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/Neurons.java#L1041-L1050
51,922
h2oai/h2o-2
src/main/java/water/score/ScorecardModel.java
ScorecardModel.score_interpreter
public double score_interpreter(final HashMap<String, Comparable> row ) { double score = _initialScore; for( int i=0; i<_rules.length; i++ ) score += _rules[i].score(row.get(_colNames[i])); return score; }
java
public double score_interpreter(final HashMap<String, Comparable> row ) { double score = _initialScore; for( int i=0; i<_rules.length; i++ ) score += _rules[i].score(row.get(_colNames[i])); return score; }
[ "public", "double", "score_interpreter", "(", "final", "HashMap", "<", "String", ",", "Comparable", ">", "row", ")", "{", "double", "score", "=", "_initialScore", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "_rules", ".", "length", ";", "i", ...
Use the rule interpreter
[ "Use", "the", "rule", "interpreter" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/score/ScorecardModel.java#L35-L40
51,923
h2oai/h2o-2
src/main/java/water/score/ScorecardModel.java
ScorecardModel.getName
public static String getName( String pname, DataTypes type, StringBuilder sb ) { String jname = xml2jname(pname); // Emit the code to do the load return jname; }
java
public static String getName( String pname, DataTypes type, StringBuilder sb ) { String jname = xml2jname(pname); // Emit the code to do the load return jname; }
[ "public", "static", "String", "getName", "(", "String", "pname", ",", "DataTypes", "type", ",", "StringBuilder", "sb", ")", "{", "String", "jname", "=", "xml2jname", "(", "pname", ")", ";", "// Emit the code to do the load", "return", "jname", ";", "}" ]
to emit it at runtime.
[ "to", "emit", "it", "at", "runtime", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/score/ScorecardModel.java#L96-L101
51,924
h2oai/h2o-2
src/main/java/water/Key.java
Key.set_cache
private boolean set_cache( long cache ) { while( true ) { // Spin till get it long old = _cache; // Read once at the start if( !H2O.larger(cloud(cache),cloud(old)) ) // Rolling backwards? // Attempt to set for an older Cloud. Blow out with a failure; caller // should retry on a new Cloud...
java
private boolean set_cache( long cache ) { while( true ) { // Spin till get it long old = _cache; // Read once at the start if( !H2O.larger(cloud(cache),cloud(old)) ) // Rolling backwards? // Attempt to set for an older Cloud. Blow out with a failure; caller // should retry on a new Cloud...
[ "private", "boolean", "set_cache", "(", "long", "cache", ")", "{", "while", "(", "true", ")", "{", "// Spin till get it", "long", "old", "=", "_cache", ";", "// Read once at the start", "if", "(", "!", "H2O", ".", "larger", "(", "cloud", "(", "cache", ")",...
Update the cache, but only to strictly newer Clouds
[ "Update", "the", "cache", "but", "only", "to", "strictly", "newer", "Clouds" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Key.java#L161-L174
51,925
h2oai/h2o-2
src/main/java/water/Key.java
Key.cloud_info
public long cloud_info( H2O cloud ) { long x = _cache; // See if cached for this Cloud. This should be the 99% fast case. if( cloud(x) == cloud._idx ) return x; // Cache missed! Probaby it just needs (atomic) updating. // But we might be holding the stale cloud... // Figure out home Node in thi...
java
public long cloud_info( H2O cloud ) { long x = _cache; // See if cached for this Cloud. This should be the 99% fast case. if( cloud(x) == cloud._idx ) return x; // Cache missed! Probaby it just needs (atomic) updating. // But we might be holding the stale cloud... // Figure out home Node in thi...
[ "public", "long", "cloud_info", "(", "H2O", "cloud", ")", "{", "long", "x", "=", "_cache", ";", "// See if cached for this Cloud. This should be the 99% fast case.", "if", "(", "cloud", "(", "x", ")", "==", "cloud", ".", "_idx", ")", "return", "x", ";", "// Ca...
Return the info word for this Cloud. Use the cache if possible
[ "Return", "the", "info", "word", "for", "this", "Cloud", ".", "Use", "the", "cache", "if", "possible" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Key.java#L176-L198
51,926
h2oai/h2o-2
src/main/java/water/Key.java
Key.make
static public Key make(byte[] kb, byte rf) { if( rf == -1 ) throw new IllegalArgumentException(); Key key = new Key(kb); Key key2 = H2O.getk(key); // Get the interned version, if any if( key2 != null ) // There is one! Return it instead return key2; // Set the cache with desired replication f...
java
static public Key make(byte[] kb, byte rf) { if( rf == -1 ) throw new IllegalArgumentException(); Key key = new Key(kb); Key key2 = H2O.getk(key); // Get the interned version, if any if( key2 != null ) // There is one! Return it instead return key2; // Set the cache with desired replication f...
[ "static", "public", "Key", "make", "(", "byte", "[", "]", "kb", ",", "byte", "rf", ")", "{", "if", "(", "rf", "==", "-", "1", ")", "throw", "new", "IllegalArgumentException", "(", ")", ";", "Key", "key", "=", "new", "Key", "(", "kb", ")", ";", ...
Make new Keys. Optimistically attempt interning, but no guarantee.
[ "Make", "new", "Keys", ".", "Optimistically", "attempt", "interning", "but", "no", "guarantee", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Key.java#L222-L234
51,927
h2oai/h2o-2
src/main/java/water/Key.java
Key.rand
static public String rand() { UUID uid = UUID.randomUUID(); long l1 = uid.getLeastSignificantBits(); long l2 = uid. getMostSignificantBits(); return "_"+Long.toHexString(l1)+Long.toHexString(l2); }
java
static public String rand() { UUID uid = UUID.randomUUID(); long l1 = uid.getLeastSignificantBits(); long l2 = uid. getMostSignificantBits(); return "_"+Long.toHexString(l1)+Long.toHexString(l2); }
[ "static", "public", "String", "rand", "(", ")", "{", "UUID", "uid", "=", "UUID", ".", "randomUUID", "(", ")", ";", "long", "l1", "=", "uid", ".", "getLeastSignificantBits", "(", ")", ";", "long", "l2", "=", "uid", ".", "getMostSignificantBits", "(", ")...
A random string, useful as a Key name or partial Key suffix.
[ "A", "random", "string", "useful", "as", "a", "Key", "name", "or", "partial", "Key", "suffix", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Key.java#L237-L242
51,928
h2oai/h2o-2
src/main/java/water/Key.java
Key.make
static public Key make(String s, byte rf, byte systemType, H2ONode... replicas) { return make(decodeKeyName(s),rf,systemType,replicas); }
java
static public Key make(String s, byte rf, byte systemType, H2ONode... replicas) { return make(decodeKeyName(s),rf,systemType,replicas); }
[ "static", "public", "Key", "make", "(", "String", "s", ",", "byte", "rf", ",", "byte", "systemType", ",", "H2ONode", "...", "replicas", ")", "{", "return", "make", "(", "decodeKeyName", "(", "s", ")", ",", "rf", ",", "systemType", ",", "replicas", ")",...
If the addresses are not specified, returns a key with no home information.
[ "If", "the", "addresses", "are", "not", "specified", "returns", "a", "key", "with", "no", "home", "information", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Key.java#L252-L254
51,929
h2oai/h2o-2
src/main/java/water/Key.java
Key.make
static public Key make(byte[] kb, byte rf, byte systemType, H2ONode... replicas) { // no more than 3 replicas allowed to be stored in the key assert 0 <=replicas.length && replicas.length<=3; assert systemType<32; // only system keys allowed // Key byte layout is: // 0 - systemType, from 0-31 //...
java
static public Key make(byte[] kb, byte rf, byte systemType, H2ONode... replicas) { // no more than 3 replicas allowed to be stored in the key assert 0 <=replicas.length && replicas.length<=3; assert systemType<32; // only system keys allowed // Key byte layout is: // 0 - systemType, from 0-31 //...
[ "static", "public", "Key", "make", "(", "byte", "[", "]", "kb", ",", "byte", "rf", ",", "byte", "systemType", ",", "H2ONode", "...", "replicas", ")", "{", "// no more than 3 replicas allowed to be stored in the key", "assert", "0", "<=", "replicas", ".", "length...
Make a Key which is homed to specific nodes.
[ "Make", "a", "Key", "which", "is", "homed", "to", "specific", "nodes", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Key.java#L261-L278
51,930
h2oai/h2o-2
src/main/java/water/Key.java
Key.makeSystem
final public static Key makeSystem(String s) { byte[] kb= decodeKeyName(s); byte[] kb2 = new byte[kb.length+1]; System.arraycopy(kb,0,kb2,1,kb.length); kb2[0] = Key.BUILT_IN_KEY; return Key.make(kb2); }
java
final public static Key makeSystem(String s) { byte[] kb= decodeKeyName(s); byte[] kb2 = new byte[kb.length+1]; System.arraycopy(kb,0,kb2,1,kb.length); kb2[0] = Key.BUILT_IN_KEY; return Key.make(kb2); }
[ "final", "public", "static", "Key", "makeSystem", "(", "String", "s", ")", "{", "byte", "[", "]", "kb", "=", "decodeKeyName", "(", "s", ")", ";", "byte", "[", "]", "kb2", "=", "new", "byte", "[", "kb", ".", "length", "+", "1", "]", ";", "System",...
Hide a user key by turning it into a system key of type HIDDEN_USER_KEY
[ "Hide", "a", "user", "key", "by", "turning", "it", "into", "a", "system", "key", "of", "type", "HIDDEN_USER_KEY" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Key.java#L281-L287
51,931
h2oai/h2o-2
src/main/java/water/api/TutorialWorkflow.java
TutorialWorkflow.decorateActiveStep
protected void decorateActiveStep(final TutorStep step, StringBuilder sb) { sb.append("<h4>").append(step.summary()).append("</h4>"); sb.append(step.content()); }
java
protected void decorateActiveStep(final TutorStep step, StringBuilder sb) { sb.append("<h4>").append(step.summary()).append("</h4>"); sb.append(step.content()); }
[ "protected", "void", "decorateActiveStep", "(", "final", "TutorStep", "step", ",", "StringBuilder", "sb", ")", "{", "sb", ".", "append", "(", "\"<h4>\"", ")", ".", "append", "(", "step", ".", "summary", "(", ")", ")", ".", "append", "(", "\"</h4>\"", ")"...
Shows the active workflow step
[ "Shows", "the", "active", "workflow", "step" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/TutorialWorkflow.java#L34-L37
51,932
h2oai/h2o-2
src/main/java/water/util/JStackCollectorTask.java
JStackCollectorTask.reduce
@Override public void reduce(JStackCollectorTask that) { if( _result == null ) _result = that._result; else for (int i=0; i<_result.length; ++i) if (_result[i] == null) _result[i] = that._result[i]; }
java
@Override public void reduce(JStackCollectorTask that) { if( _result == null ) _result = that._result; else for (int i=0; i<_result.length; ++i) if (_result[i] == null) _result[i] = that._result[i]; }
[ "@", "Override", "public", "void", "reduce", "(", "JStackCollectorTask", "that", ")", "{", "if", "(", "_result", "==", "null", ")", "_result", "=", "that", ".", "_result", ";", "else", "for", "(", "int", "i", "=", "0", ";", "i", "<", "_result", ".", ...
for each node in the cloud it contains all threads stack traces
[ "for", "each", "node", "in", "the", "cloud", "it", "contains", "all", "threads", "stack", "traces" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/util/JStackCollectorTask.java#L11-L16
51,933
h2oai/h2o-2
src/main/java/water/genmodel/GeneratedModel.java
GeneratedModel.predict
public float[] predict( Map<String, Double> row, double data[], float preds[] ) { return predict(map(row,data),preds); }
java
public float[] predict( Map<String, Double> row, double data[], float preds[] ) { return predict(map(row,data),preds); }
[ "public", "float", "[", "]", "predict", "(", "Map", "<", "String", ",", "Double", ">", "row", ",", "double", "data", "[", "]", ",", "float", "preds", "[", "]", ")", "{", "return", "predict", "(", "map", "(", "row", ",", "data", ")", ",", "preds",...
Does the mapping lookup for every row, no allocation
[ "Does", "the", "mapping", "lookup", "for", "every", "row", "no", "allocation" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/genmodel/GeneratedModel.java#L83-L85
51,934
h2oai/h2o-2
hadoop/src/main/java/water/hadoop/h2omapper.java
h2omapper.emitLogHeader
private void emitLogHeader(Context context, String mapredTaskId) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); Text textId = new Text(mapredTaskId); for (Map.Entry<String, String> entry: conf) { StringBuilder sb = new StringBuilder(); sb.append(entr...
java
private void emitLogHeader(Context context, String mapredTaskId) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); Text textId = new Text(mapredTaskId); for (Map.Entry<String, String> entry: conf) { StringBuilder sb = new StringBuilder(); sb.append(entr...
[ "private", "void", "emitLogHeader", "(", "Context", "context", ",", "String", "mapredTaskId", ")", "throws", "IOException", ",", "InterruptedException", "{", "Configuration", "conf", "=", "context", ".", "getConfiguration", "(", ")", ";", "Text", "textId", "=", ...
Emit a bunch of logging output at the beginning of the map task. @throws IOException @throws InterruptedException
[ "Emit", "a", "bunch", "of", "logging", "output", "at", "the", "beginning", "of", "the", "map", "task", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/hadoop/src/main/java/water/hadoop/h2omapper.java#L270-L304
51,935
h2oai/h2o-2
src/main/java/water/api/DomainMapping.java
DomainMapping.serve
@Override protected Response serve() { if( src_key == null ) return RequestServer._http404.serve(); Vec v = src_key.anyVec(); if (v.isEnum()) { map = Arrays.asList(v.domain()).indexOf(str); } else if (v.masterVec() != null && v.masterVec().isEnum()) { map = Arrays.asList(v.masterVec().domain...
java
@Override protected Response serve() { if( src_key == null ) return RequestServer._http404.serve(); Vec v = src_key.anyVec(); if (v.isEnum()) { map = Arrays.asList(v.domain()).indexOf(str); } else if (v.masterVec() != null && v.masterVec().isEnum()) { map = Arrays.asList(v.masterVec().domain...
[ "@", "Override", "protected", "Response", "serve", "(", ")", "{", "if", "(", "src_key", "==", "null", ")", "return", "RequestServer", ".", "_http404", ".", "serve", "(", ")", ";", "Vec", "v", "=", "src_key", ".", "anyVec", "(", ")", ";", "if", "(", ...
Just validate the frame, and fill in the summary bits
[ "Just", "validate", "the", "frame", "and", "fill", "in", "the", "summary", "bits" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/DomainMapping.java#L27-L38
51,936
h2oai/h2o-2
src/main/java/water/DKV.java
DKV.DputIfMatch
static public Value DputIfMatch( Key key, Value val, Value old, Futures fs) { return DputIfMatch(key, val, old, fs, false); }
java
static public Value DputIfMatch( Key key, Value val, Value old, Futures fs) { return DputIfMatch(key, val, old, fs, false); }
[ "static", "public", "Value", "DputIfMatch", "(", "Key", "key", ",", "Value", "val", ",", "Value", "old", ",", "Futures", "fs", ")", "{", "return", "DputIfMatch", "(", "key", ",", "val", ",", "old", ",", "fs", ",", "false", ")", ";", "}" ]
to consume.
[ "to", "consume", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/DKV.java#L47-L49
51,937
h2oai/h2o-2
src/main/java/water/DKV.java
DKV.write_barrier
static public void write_barrier() { for( H2ONode h2o : H2O.CLOUD._memary ) for( RPC rpc : h2o.tasks() ) if( rpc._dt instanceof TaskPutKey || rpc._dt instanceof Atomic ) rpc.get(); }
java
static public void write_barrier() { for( H2ONode h2o : H2O.CLOUD._memary ) for( RPC rpc : h2o.tasks() ) if( rpc._dt instanceof TaskPutKey || rpc._dt instanceof Atomic ) rpc.get(); }
[ "static", "public", "void", "write_barrier", "(", ")", "{", "for", "(", "H2ONode", "h2o", ":", "H2O", ".", "CLOUD", ".", "_memary", ")", "for", "(", "RPC", "rpc", ":", "h2o", ".", "tasks", "(", ")", ")", "if", "(", "rpc", ".", "_dt", "instanceof", ...
Used to order successive writes.
[ "Used", "to", "order", "successive", "writes", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/DKV.java#L87-L92
51,938
h2oai/h2o-2
src/main/java/water/DKV.java
DKV.get
static public Value get( Key key, int len, int priority ) { while( true ) { // Read the Cloud once per put-attempt, to keep a consistent snapshot. H2O cloud = H2O.CLOUD; Value val = H2O.get(key); // Hit in local cache? if( val != null ) { if( len > val._max ) len = val._max; //...
java
static public Value get( Key key, int len, int priority ) { while( true ) { // Read the Cloud once per put-attempt, to keep a consistent snapshot. H2O cloud = H2O.CLOUD; Value val = H2O.get(key); // Hit in local cache? if( val != null ) { if( len > val._max ) len = val._max; //...
[ "static", "public", "Value", "get", "(", "Key", "key", ",", "int", "len", ",", "int", "priority", ")", "{", "while", "(", "true", ")", "{", "// Read the Cloud once per put-attempt, to keep a consistent snapshot.", "H2O", "cloud", "=", "H2O", ".", "CLOUD", ";", ...
User-Weak-Get a Key from the distributed cloud.
[ "User", "-", "Weak", "-", "Get", "a", "Key", "from", "the", "distributed", "cloud", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/DKV.java#L95-L133
51,939
h2oai/h2o-2
src/main/java/water/util/LogCollectorTask.java
LogCollectorTask.zipDir
private void zipDir(String dir2zip, ZipOutputStream zos) throws IOException { try { //create a new File object based on the directory we have to zip. File zipDir = new File(dir2zip); //get a listing of the directory content String[] dirList = zipDir.list(); byte[] readBuffer = ne...
java
private void zipDir(String dir2zip, ZipOutputStream zos) throws IOException { try { //create a new File object based on the directory we have to zip. File zipDir = new File(dir2zip); //get a listing of the directory content String[] dirList = zipDir.list(); byte[] readBuffer = ne...
[ "private", "void", "zipDir", "(", "String", "dir2zip", ",", "ZipOutputStream", "zos", ")", "throws", "IOException", "{", "try", "{", "//create a new File object based on the directory we have to zip.", "File", "zipDir", "=", "new", "File", "(", "dir2zip", ")", ";", ...
here is the code for the method
[ "here", "is", "the", "code", "for", "the", "method" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/util/LogCollectorTask.java#L47-L103
51,940
h2oai/h2o-2
src/main/java/water/InternalInterface.java
InternalInterface.scoreKey
@Override public float[] scoreKey( Object modelKey, String [] colNames, String domains[][], double[] row ) { Key key = (Key)modelKey; String sk = key.toString(); Value v = DKV.get(key); if (v == null) throw new IllegalArgumentException("Key "+sk+" not found!"); try { return scoreModel(v....
java
@Override public float[] scoreKey( Object modelKey, String [] colNames, String domains[][], double[] row ) { Key key = (Key)modelKey; String sk = key.toString(); Value v = DKV.get(key); if (v == null) throw new IllegalArgumentException("Key "+sk+" not found!"); try { return scoreModel(v....
[ "@", "Override", "public", "float", "[", "]", "scoreKey", "(", "Object", "modelKey", ",", "String", "[", "]", "colNames", ",", "String", "domains", "[", "]", "[", "]", ",", "double", "[", "]", "row", ")", "{", "Key", "key", "=", "(", "Key", ")", ...
All-in-one call to lookup a model, map the columns and score
[ "All", "-", "in", "-", "one", "call", "to", "lookup", "a", "model", "map", "the", "columns", "and", "score" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/InternalInterface.java#L22-L34
51,941
h2oai/h2o-2
src/main/java/hex/gbm/DRealHistogram.java
DRealHistogram.incr1
void incr1( int b, double y, double yy ) { Utils.AtomicDoubleArray.add(_sums,b,y); Utils.AtomicDoubleArray.add(_ssqs,b,yy); }
java
void incr1( int b, double y, double yy ) { Utils.AtomicDoubleArray.add(_sums,b,y); Utils.AtomicDoubleArray.add(_ssqs,b,yy); }
[ "void", "incr1", "(", "int", "b", ",", "double", "y", ",", "double", "yy", ")", "{", "Utils", ".", "AtomicDoubleArray", ".", "add", "(", "_sums", ",", "b", ",", "y", ")", ";", "Utils", ".", "AtomicDoubleArray", ".", "add", "(", "_ssqs", ",", "b", ...
Same, except square done by caller
[ "Same", "except", "square", "done", "by", "caller" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/gbm/DRealHistogram.java#L52-L55
51,942
h2oai/h2o-2
src/main/java/water/api/RequestQueries.java
RequestQueries.checkArguments
protected final String checkArguments(Properties args, RequestType type) { // Why the following lines duplicate lines from Request#92 - handling query? // reset all arguments for (Argument arg: _arguments) arg.reset(); // return query if in query mode if (type == RequestType.query) retur...
java
protected final String checkArguments(Properties args, RequestType type) { // Why the following lines duplicate lines from Request#92 - handling query? // reset all arguments for (Argument arg: _arguments) arg.reset(); // return query if in query mode if (type == RequestType.query) retur...
[ "protected", "final", "String", "checkArguments", "(", "Properties", "args", ",", "RequestType", "type", ")", "{", "// Why the following lines duplicate lines from Request#92 - handling query?", "// reset all arguments", "for", "(", "Argument", "arg", ":", "_arguments", ")", ...
Checks the given arguments. When first argument is found wrong, generates the json error and returns the result to be returned if any problems were found. Otherwise returns @param args @param type @return
[ "Checks", "the", "given", "arguments", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/RequestQueries.java#L35-L80
51,943
h2oai/h2o-2
src/main/java/water/UDPReceiverThread.java
UDPReceiverThread.basic_packet_handling
static public void basic_packet_handling( AutoBuffer ab ) throws java.io.IOException { // Randomly drop 1/10th of the packets, as-if broken network. Dropped // packets are timeline recorded before dropping - and we still will // respond to timelines and suicide packets. int drop = H2O.OPT_ARGS.random_u...
java
static public void basic_packet_handling( AutoBuffer ab ) throws java.io.IOException { // Randomly drop 1/10th of the packets, as-if broken network. Dropped // packets are timeline recorded before dropping - and we still will // respond to timelines and suicide packets. int drop = H2O.OPT_ARGS.random_u...
[ "static", "public", "void", "basic_packet_handling", "(", "AutoBuffer", "ab", ")", "throws", "java", ".", "io", ".", "IOException", "{", "// Randomly drop 1/10th of the packets, as-if broken network. Dropped", "// packets are timeline recorded before dropping - and we still will", ...
- Timeline record it
[ "-", "Timeline", "record", "it" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/UDPReceiverThread.java#L70-L123
51,944
h2oai/h2o-2
src/main/java/water/exec/Env.java
Env.push
void push( int slots ) { assert 0 <= slots && slots < 1000; int len = _d.length; _sp += slots; while( _sp > len ) { _key= Arrays.copyOf(_key,len<<1); _ary= Arrays.copyOf(_ary,len<<1); _d = Arrays.copyOf(_d ,len<<1); _fcn= Arrays.copyOf(_fcn,len<<=1); _str= Arrays.copyOf(_...
java
void push( int slots ) { assert 0 <= slots && slots < 1000; int len = _d.length; _sp += slots; while( _sp > len ) { _key= Arrays.copyOf(_key,len<<1); _ary= Arrays.copyOf(_ary,len<<1); _d = Arrays.copyOf(_d ,len<<1); _fcn= Arrays.copyOf(_fcn,len<<=1); _str= Arrays.copyOf(_...
[ "void", "push", "(", "int", "slots", ")", "{", "assert", "0", "<=", "slots", "&&", "slots", "<", "1000", ";", "int", "len", "=", "_d", ".", "length", ";", "_sp", "+=", "slots", ";", "while", "(", "_sp", ">", "len", ")", "{", "_key", "=", "Array...
Push k empty slots
[ "Push", "k", "empty", "slots" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/exec/Env.java#L83-L94
51,945
h2oai/h2o-2
src/main/java/water/exec/Env.java
Env.push_slot
void push_slot( int d, int n ) { assert d==0; // Should use a fcn's closure for d>1 int idx = _display[_tod-d]+n; push(1); _ary[_sp-1] = addRef(_ary[idx]); _d [_sp-1] = _d [idx]; _fcn[_sp-1] = addRef(_fcn[idx]); _str[_sp-1] = _str[idx]; assert _ary[0]==null...
java
void push_slot( int d, int n ) { assert d==0; // Should use a fcn's closure for d>1 int idx = _display[_tod-d]+n; push(1); _ary[_sp-1] = addRef(_ary[idx]); _d [_sp-1] = _d [idx]; _fcn[_sp-1] = addRef(_fcn[idx]); _str[_sp-1] = _str[idx]; assert _ary[0]==null...
[ "void", "push_slot", "(", "int", "d", ",", "int", "n", ")", "{", "assert", "d", "==", "0", ";", "// Should use a fcn's closure for d>1", "int", "idx", "=", "_display", "[", "_tod", "-", "d", "]", "+", "n", ";", "push", "(", "1", ")", ";", "_ary", "...
Copy from display offset d, nth slot
[ "Copy", "from", "display", "offset", "d", "nth", "slot" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/exec/Env.java#L102-L111
51,946
h2oai/h2o-2
src/main/java/water/exec/Env.java
Env.tos_into_slot
void tos_into_slot( int d, int n, String id ) { // In a copy-on-modify language, only update the local scope, or return val assert d==0 || (d==1 && _display[_tod]==n+1); int idx = _display[_tod-d]+n; // Temporary solution to kill a UDF from global name space. Needs to fix in the future. if (_tod == ...
java
void tos_into_slot( int d, int n, String id ) { // In a copy-on-modify language, only update the local scope, or return val assert d==0 || (d==1 && _display[_tod]==n+1); int idx = _display[_tod-d]+n; // Temporary solution to kill a UDF from global name space. Needs to fix in the future. if (_tod == ...
[ "void", "tos_into_slot", "(", "int", "d", ",", "int", "n", ",", "String", "id", ")", "{", "// In a copy-on-modify language, only update the local scope, or return val", "assert", "d", "==", "0", "||", "(", "d", "==", "1", "&&", "_display", "[", "_tod", "]", "=...
Copy from TOS into a slot. Does NOT pop results.
[ "Copy", "from", "TOS", "into", "a", "slot", ".", "Does", "NOT", "pop", "results", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/exec/Env.java#L124-L141
51,947
h2oai/h2o-2
src/main/java/water/exec/Env.java
Env.tos_into_slot
void tos_into_slot( int idx, String id ) { subRef(_ary[idx], _key[idx]); subRef(_fcn[idx]); Frame fr = _ary[_sp-1]; _ary[idx] = fr==null ? null : addRef(new Frame(fr)); _d [idx] = _d [_sp-1] ; _fcn[idx] = addRef(_fcn[_sp-1]); _str[idx] = ...
java
void tos_into_slot( int idx, String id ) { subRef(_ary[idx], _key[idx]); subRef(_fcn[idx]); Frame fr = _ary[_sp-1]; _ary[idx] = fr==null ? null : addRef(new Frame(fr)); _d [idx] = _d [_sp-1] ; _fcn[idx] = addRef(_fcn[_sp-1]); _str[idx] = ...
[ "void", "tos_into_slot", "(", "int", "idx", ",", "String", "id", ")", "{", "subRef", "(", "_ary", "[", "idx", "]", ",", "_key", "[", "idx", "]", ")", ";", "subRef", "(", "_fcn", "[", "idx", "]", ")", ";", "Frame", "fr", "=", "_ary", "[", "_sp",...
Copy from TOS into a slot, using absolute index.
[ "Copy", "from", "TOS", "into", "a", "slot", "using", "absolute", "index", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/exec/Env.java#L143-L153
51,948
h2oai/h2o-2
src/main/java/water/exec/Env.java
Env.popXAry
public Frame popXAry() { Frame fr = popAry(); for( Vec vec : fr.vecs() ) { popVec(vec); if ( vec.masterVec() != null ) popVec(vec.masterVec()); } return fr; }
java
public Frame popXAry() { Frame fr = popAry(); for( Vec vec : fr.vecs() ) { popVec(vec); if ( vec.masterVec() != null ) popVec(vec.masterVec()); } return fr; }
[ "public", "Frame", "popXAry", "(", ")", "{", "Frame", "fr", "=", "popAry", "(", ")", ";", "for", "(", "Vec", "vec", ":", "fr", ".", "vecs", "(", ")", ")", "{", "popVec", "(", "vec", ")", ";", "if", "(", "vec", ".", "masterVec", "(", ")", "!="...
Assumption is that this Frame will get pushed again shortly.
[ "Assumption", "is", "that", "this", "Frame", "will", "get", "pushed", "again", "shortly", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/exec/Env.java#L216-L223
51,949
h2oai/h2o-2
src/main/java/water/exec/Env.java
Env.poppush
public void poppush( int n, Frame ary, String key) { addRef(ary); for( int i=0; i<n; i++ ) { assert _sp > 0; _sp--; _fcn[_sp] = subRef(_fcn[_sp]); _ary[_sp] = subRef(_ary[_sp], _key[_sp]); } push(1); _ary[_sp-1] = ary; _key[_sp-1] = key; assert check_all_refcnts(); }
java
public void poppush( int n, Frame ary, String key) { addRef(ary); for( int i=0; i<n; i++ ) { assert _sp > 0; _sp--; _fcn[_sp] = subRef(_fcn[_sp]); _ary[_sp] = subRef(_ary[_sp], _key[_sp]); } push(1); _ary[_sp-1] = ary; _key[_sp-1] = key; assert check_all_refcnts(); }
[ "public", "void", "poppush", "(", "int", "n", ",", "Frame", "ary", ",", "String", "key", ")", "{", "addRef", "(", "ary", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n", ";", "i", "++", ")", "{", "assert", "_sp", ">", "0", ";...
Replace a function invocation with it's result
[ "Replace", "a", "function", "invocation", "with", "it", "s", "result" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/exec/Env.java#L231-L241
51,950
h2oai/h2o-2
src/main/java/water/exec/Env.java
Env.subRef
public Futures subRef( Vec vec, Futures fs ) { assert fs != null : "Future should not be null!"; if ( vec.masterVec() != null ) subRef(vec.masterVec(), fs); int cnt = _refcnt.get(vec)._val-1; if ( cnt > 0 ) { _refcnt.put(vec,new IcedInt(cnt)); } else { UKV.remove(vec._key,fs); _ref...
java
public Futures subRef( Vec vec, Futures fs ) { assert fs != null : "Future should not be null!"; if ( vec.masterVec() != null ) subRef(vec.masterVec(), fs); int cnt = _refcnt.get(vec)._val-1; if ( cnt > 0 ) { _refcnt.put(vec,new IcedInt(cnt)); } else { UKV.remove(vec._key,fs); _ref...
[ "public", "Futures", "subRef", "(", "Vec", "vec", ",", "Futures", "fs", ")", "{", "assert", "fs", "!=", "null", ":", "\"Future should not be null!\"", ";", "if", "(", "vec", ".", "masterVec", "(", ")", "!=", "null", ")", "subRef", "(", "vec", ".", "mas...
Subtract reference count. @param vec vector to handle @param fs future, cannot be null @return returns given Future
[ "Subtract", "reference", "count", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/exec/Env.java#L279-L290
51,951
h2oai/h2o-2
src/main/java/water/schemas/Schema.java
Schema.fillFrom
public S fillFrom( Properties parms ) { // Get passed-in fields, assign into Schema Class clz = getClass(); for( String key : parms.stringPropertyNames() ) { try { Field f = clz.getDeclaredField(key); // No such field error, if parm is junk int mods = f.getModifiers(); if( Modi...
java
public S fillFrom( Properties parms ) { // Get passed-in fields, assign into Schema Class clz = getClass(); for( String key : parms.stringPropertyNames() ) { try { Field f = clz.getDeclaredField(key); // No such field error, if parm is junk int mods = f.getModifiers(); if( Modi...
[ "public", "S", "fillFrom", "(", "Properties", "parms", ")", "{", "// Get passed-in fields, assign into Schema", "Class", "clz", "=", "getClass", "(", ")", ";", "for", "(", "String", "key", ":", "parms", ".", "stringPropertyNames", "(", ")", ")", "{", "try", ...
private. Input fields get filled here, so must not be final.
[ "private", ".", "Input", "fields", "get", "filled", "here", "so", "must", "not", "be", "final", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/schemas/Schema.java#L54-L104
51,952
h2oai/h2o-2
src/main/java/water/fvec/Chunk.java
Chunk.isNA
public final boolean isNA(long i) { long x = i - (_start>0 ? _start : 0); if( 0 <= x && x < _len ) return isNA0((int)x); throw new ArrayIndexOutOfBoundsException(getClass().getSimpleName() + " " +_start+" <= "+i+" < "+(_start+_len)); }
java
public final boolean isNA(long i) { long x = i - (_start>0 ? _start : 0); if( 0 <= x && x < _len ) return isNA0((int)x); throw new ArrayIndexOutOfBoundsException(getClass().getSimpleName() + " " +_start+" <= "+i+" < "+(_start+_len)); }
[ "public", "final", "boolean", "isNA", "(", "long", "i", ")", "{", "long", "x", "=", "i", "-", "(", "_start", ">", "0", "?", "_start", ":", "0", ")", ";", "if", "(", "0", "<=", "x", "&&", "x", "<", "_len", ")", "return", "isNA0", "(", "(", "...
Fetch the missing-status the slow way.
[ "Fetch", "the", "missing", "-", "status", "the", "slow", "way", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/Chunk.java#L54-L58
51,953
h2oai/h2o-2
src/main/java/water/fvec/Chunk.java
Chunk.set0
public final long set0(int idx, long l) { setWrite(); if( _chk2.set_impl(idx,l) ) return l; (_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,l); return l; }
java
public final long set0(int idx, long l) { setWrite(); if( _chk2.set_impl(idx,l) ) return l; (_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,l); return l; }
[ "public", "final", "long", "set0", "(", "int", "idx", ",", "long", "l", ")", "{", "setWrite", "(", ")", ";", "if", "(", "_chk2", ".", "set_impl", "(", "idx", ",", "l", ")", ")", "return", "l", ";", "(", "_chk2", "=", "inflate_impl", "(", "new", ...
Set a long element in a chunk given a 0-based chunk local index. Write into a chunk. May rewrite/replace chunks if the chunk needs to be "inflated" to hold larger values. Returns the input value. Note that the idx is an int (instead of a long), which tells you that index 0 is the first row in the chunk, not the whol...
[ "Set", "a", "long", "element", "in", "a", "chunk", "given", "a", "0", "-", "based", "chunk", "local", "index", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/Chunk.java#L129-L134
51,954
h2oai/h2o-2
src/main/java/water/fvec/Chunk.java
Chunk.set0
public final double set0(int idx, double d) { setWrite(); if( _chk2.set_impl(idx,d) ) return d; (_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,d); return d; }
java
public final double set0(int idx, double d) { setWrite(); if( _chk2.set_impl(idx,d) ) return d; (_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,d); return d; }
[ "public", "final", "double", "set0", "(", "int", "idx", ",", "double", "d", ")", "{", "setWrite", "(", ")", ";", "if", "(", "_chk2", ".", "set_impl", "(", "idx", ",", "d", ")", ")", "return", "d", ";", "(", "_chk2", "=", "inflate_impl", "(", "new...
Set a double element in a chunk given a 0-based chunk local index.
[ "Set", "a", "double", "element", "in", "a", "chunk", "given", "a", "0", "-", "based", "chunk", "local", "index", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/Chunk.java#L137-L142
51,955
h2oai/h2o-2
src/main/java/water/fvec/Chunk.java
Chunk.set0
public final float set0(int idx, float f) { setWrite(); if( _chk2.set_impl(idx,f) ) return f; (_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,f); return f; }
java
public final float set0(int idx, float f) { setWrite(); if( _chk2.set_impl(idx,f) ) return f; (_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,f); return f; }
[ "public", "final", "float", "set0", "(", "int", "idx", ",", "float", "f", ")", "{", "setWrite", "(", ")", ";", "if", "(", "_chk2", ".", "set_impl", "(", "idx", ",", "f", ")", ")", "return", "f", ";", "(", "_chk2", "=", "inflate_impl", "(", "new",...
Set a floating element in a chunk given a 0-based chunk local index.
[ "Set", "a", "floating", "element", "in", "a", "chunk", "given", "a", "0", "-", "based", "chunk", "local", "index", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/Chunk.java#L145-L150
51,956
h2oai/h2o-2
src/main/java/water/fvec/Chunk.java
Chunk.setNA0
public final boolean setNA0(int idx) { setWrite(); if( _chk2.setNA_impl(idx) ) return true; (_chk2 = inflate_impl(new NewChunk(this))).setNA_impl(idx); return true; }
java
public final boolean setNA0(int idx) { setWrite(); if( _chk2.setNA_impl(idx) ) return true; (_chk2 = inflate_impl(new NewChunk(this))).setNA_impl(idx); return true; }
[ "public", "final", "boolean", "setNA0", "(", "int", "idx", ")", "{", "setWrite", "(", ")", ";", "if", "(", "_chk2", ".", "setNA_impl", "(", "idx", ")", ")", "return", "true", ";", "(", "_chk2", "=", "inflate_impl", "(", "new", "NewChunk", "(", "this"...
Set the element in a chunk as missing given a 0-based chunk local index.
[ "Set", "the", "element", "in", "a", "chunk", "as", "missing", "given", "a", "0", "-", "based", "chunk", "local", "index", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/Chunk.java#L153-L158
51,957
h2oai/h2o-2
src/main/java/water/Model.java
Model.scoreImpl
protected Frame scoreImpl(Frame adaptFrm) { if (isSupervised()) { int ridx = adaptFrm.find(responseName()); assert ridx == -1 : "Adapted frame should not contain response in scoring method!"; assert nfeatures() == adaptFrm.numCols() : "Number of model features " + nfeatures() + " != number of test...
java
protected Frame scoreImpl(Frame adaptFrm) { if (isSupervised()) { int ridx = adaptFrm.find(responseName()); assert ridx == -1 : "Adapted frame should not contain response in scoring method!"; assert nfeatures() == adaptFrm.numCols() : "Number of model features " + nfeatures() + " != number of test...
[ "protected", "Frame", "scoreImpl", "(", "Frame", "adaptFrm", ")", "{", "if", "(", "isSupervised", "(", ")", ")", "{", "int", "ridx", "=", "adaptFrm", ".", "find", "(", "responseName", "(", ")", ")", ";", "assert", "ridx", "==", "-", "1", ":", "\"Adap...
Score already adapted frame. @param adaptFrm @return
[ "Score", "already", "adapted", "frame", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Model.java#L252-L285
51,958
h2oai/h2o-2
src/main/java/water/Model.java
Model.score
public final float[] score( Frame fr, boolean exact, int row ) { double tmp[] = new double[fr.numCols()]; for( int i=0; i<tmp.length; i++ ) tmp[i] = fr.vecs()[i].at(row); return score(fr.names(),fr.domains(),exact,tmp); }
java
public final float[] score( Frame fr, boolean exact, int row ) { double tmp[] = new double[fr.numCols()]; for( int i=0; i<tmp.length; i++ ) tmp[i] = fr.vecs()[i].at(row); return score(fr.names(),fr.domains(),exact,tmp); }
[ "public", "final", "float", "[", "]", "score", "(", "Frame", "fr", ",", "boolean", "exact", ",", "int", "row", ")", "{", "double", "tmp", "[", "]", "=", "new", "double", "[", "fr", ".", "numCols", "(", ")", "]", ";", "for", "(", "int", "i", "="...
Single row scoring, on a compatible Frame.
[ "Single", "row", "scoring", "on", "a", "compatible", "Frame", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Model.java#L288-L293
51,959
h2oai/h2o-2
src/main/java/water/Model.java
Model.score
public final float[] score( String names[], String domains[][], boolean exact, double row[] ) { return score(adapt(names,domains,exact),row,new float[nclasses()]); }
java
public final float[] score( String names[], String domains[][], boolean exact, double row[] ) { return score(adapt(names,domains,exact),row,new float[nclasses()]); }
[ "public", "final", "float", "[", "]", "score", "(", "String", "names", "[", "]", ",", "String", "domains", "[", "]", "[", "]", ",", "boolean", "exact", ",", "double", "row", "[", "]", ")", "{", "return", "score", "(", "adapt", "(", "names", ",", ...
Single row scoring, on a compatible set of data. Fairly expensive to adapt.
[ "Single", "row", "scoring", "on", "a", "compatible", "set", "of", "data", ".", "Fairly", "expensive", "to", "adapt", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Model.java#L296-L298
51,960
h2oai/h2o-2
src/main/java/water/Model.java
Model.toJavaSuper
protected SB toJavaSuper( SB sb ) { sb.nl(); sb.ii(1); sb.i().p("public String[] getNames() { return NAMES; } ").nl(); sb.i().p("public String[][] getDomainValues() { return DOMAINS; }").nl(); String uuid = this.uniqueId != null ? this.uniqueId.getId() : this._key.toString(); sb.i().p("public ...
java
protected SB toJavaSuper( SB sb ) { sb.nl(); sb.ii(1); sb.i().p("public String[] getNames() { return NAMES; } ").nl(); sb.i().p("public String[][] getDomainValues() { return DOMAINS; }").nl(); String uuid = this.uniqueId != null ? this.uniqueId.getId() : this._key.toString(); sb.i().p("public ...
[ "protected", "SB", "toJavaSuper", "(", "SB", "sb", ")", "{", "sb", ".", "nl", "(", ")", ";", "sb", ".", "ii", "(", "1", ")", ";", "sb", ".", "i", "(", ")", ".", "p", "(", "\"public String[] getNames() { return NAMES; } \"", ")", ".", "nl", "(", "...
Generate implementation for super class.
[ "Generate", "implementation", "for", "super", "class", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Model.java#L641-L650
51,961
h2oai/h2o-2
src/main/java/water/Model.java
Model.toJavaPredict
private SB toJavaPredict(SB ccsb, SB fileCtxSb) { // ccsb = classContext ccsb.nl(); ccsb.p(" // Pass in data in a double[], pre-aligned to the Model's requirements.").nl(); ccsb.p(" // Jam predictions into the preds[] array; preds[0] is reserved for the").nl(); ccsb.p(" // main prediction (class for ...
java
private SB toJavaPredict(SB ccsb, SB fileCtxSb) { // ccsb = classContext ccsb.nl(); ccsb.p(" // Pass in data in a double[], pre-aligned to the Model's requirements.").nl(); ccsb.p(" // Jam predictions into the preds[] array; preds[0] is reserved for the").nl(); ccsb.p(" // main prediction (class for ...
[ "private", "SB", "toJavaPredict", "(", "SB", "ccsb", ",", "SB", "fileCtxSb", ")", "{", "// ccsb = classContext", "ccsb", ".", "nl", "(", ")", ";", "ccsb", ".", "p", "(", "\" // Pass in data in a double[], pre-aligned to the Model's requirements.\"", ")", ".", "nl",...
Wrapper around the main predict call, including the signature and return value
[ "Wrapper", "around", "the", "main", "predict", "call", "including", "the", "signature", "and", "return", "value" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Model.java#L696-L711
51,962
h2oai/h2o-2
src/main/java/water/Func.java
Func.emptyLTrash
protected final void emptyLTrash() { if (_lVecTrash.isEmpty()) return; Futures fs = new Futures(); cleanupTrash(_lVecTrash, fs); fs.blockForPending(); }
java
protected final void emptyLTrash() { if (_lVecTrash.isEmpty()) return; Futures fs = new Futures(); cleanupTrash(_lVecTrash, fs); fs.blockForPending(); }
[ "protected", "final", "void", "emptyLTrash", "(", ")", "{", "if", "(", "_lVecTrash", ".", "isEmpty", "(", ")", ")", "return", ";", "Futures", "fs", "=", "new", "Futures", "(", ")", ";", "cleanupTrash", "(", "_lVecTrash", ",", "fs", ")", ";", "fs", "....
User call which empty local trash of vectors.
[ "User", "call", "which", "empty", "local", "trash", "of", "vectors", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Func.java#L74-L79
51,963
h2oai/h2o-2
src/main/java/hex/deeplearning/DeepLearning.java
DeepLearning.registered
@Override protected void registered(RequestServer.API_VERSION ver) { super.registered(ver); for (Argument arg : _arguments) { if ( arg._name.equals("activation") || arg._name.equals("initial_weight_distribution") || arg._name.equals("expert_mode") || arg._name.equals("adaptive_rate") ...
java
@Override protected void registered(RequestServer.API_VERSION ver) { super.registered(ver); for (Argument arg : _arguments) { if ( arg._name.equals("activation") || arg._name.equals("initial_weight_distribution") || arg._name.equals("expert_mode") || arg._name.equals("adaptive_rate") ...
[ "@", "Override", "protected", "void", "registered", "(", "RequestServer", ".", "API_VERSION", "ver", ")", "{", "super", ".", "registered", "(", "ver", ")", ";", "for", "(", "Argument", "arg", ":", "_arguments", ")", "{", "if", "(", "arg", ".", "_name", ...
Helper to specify which arguments trigger a refresh on change @param ver
[ "Helper", "to", "specify", "which", "arguments", "trigger", "a", "refresh", "on", "change" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearning.java#L581-L595
51,964
h2oai/h2o-2
src/main/java/hex/deeplearning/DeepLearning.java
DeepLearning.prepareDataInfo
private DataInfo prepareDataInfo() { final boolean del_enum_resp = classification && !response.isEnum(); final Frame train = FrameTask.DataInfo.prepareFrame(source, autoencoder ? null : response, ignored_cols, classification, ignore_const_cols, true /*drop >20% NA cols*/); final DataInfo dinfo = new FrameTa...
java
private DataInfo prepareDataInfo() { final boolean del_enum_resp = classification && !response.isEnum(); final Frame train = FrameTask.DataInfo.prepareFrame(source, autoencoder ? null : response, ignored_cols, classification, ignore_const_cols, true /*drop >20% NA cols*/); final DataInfo dinfo = new FrameTa...
[ "private", "DataInfo", "prepareDataInfo", "(", ")", "{", "final", "boolean", "del_enum_resp", "=", "classification", "&&", "!", "response", ".", "isEnum", "(", ")", ";", "final", "Frame", "train", "=", "FrameTask", ".", "DataInfo", ".", "prepareFrame", "(", ...
Helper to create a DataInfo object from the source and response @return DataInfo object
[ "Helper", "to", "create", "a", "DataInfo", "object", "from", "the", "source", "and", "response" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearning.java#L979-L991
51,965
h2oai/h2o-2
src/main/java/hex/deeplearning/DeepLearning.java
DeepLearning.updateFrame
Frame updateFrame(Frame target, Frame src) { if (src != target) ltrash(src); return src; }
java
Frame updateFrame(Frame target, Frame src) { if (src != target) ltrash(src); return src; }
[ "Frame", "updateFrame", "(", "Frame", "target", ",", "Frame", "src", ")", "{", "if", "(", "src", "!=", "target", ")", "ltrash", "(", "src", ")", ";", "return", "src", ";", "}" ]
Helper to update a Frame and adding it to the local trash at the same time @param target Frame referece, to be overwritten @param src Newly made frame, to be deleted via local trash @return src
[ "Helper", "to", "update", "a", "Frame", "and", "adding", "it", "to", "the", "local", "trash", "at", "the", "same", "time" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearning.java#L1020-L1023
51,966
h2oai/h2o-2
src/main/java/hex/deeplearning/DeepLearning.java
DeepLearning.lock_data
private void lock_data() { source.read_lock(self()); if( validation != null && source._key != null && validation._key !=null && !source._key.equals(validation._key) ) validation.read_lock(self()); }
java
private void lock_data() { source.read_lock(self()); if( validation != null && source._key != null && validation._key !=null && !source._key.equals(validation._key) ) validation.read_lock(self()); }
[ "private", "void", "lock_data", "(", ")", "{", "source", ".", "read_lock", "(", "self", "(", ")", ")", ";", "if", "(", "validation", "!=", "null", "&&", "source", ".", "_key", "!=", "null", "&&", "validation", ".", "_key", "!=", "null", "&&", "!", ...
Lock the input datasets against deletes
[ "Lock", "the", "input", "datasets", "against", "deletes" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearning.java#L1149-L1153
51,967
h2oai/h2o-2
src/main/java/hex/deeplearning/DeepLearning.java
DeepLearning.unlock_data
private void unlock_data() { source.unlock(self()); if( validation != null && source._key != null && validation._key != null && !source._key.equals(validation._key) ) validation.unlock(self()); }
java
private void unlock_data() { source.unlock(self()); if( validation != null && source._key != null && validation._key != null && !source._key.equals(validation._key) ) validation.unlock(self()); }
[ "private", "void", "unlock_data", "(", ")", "{", "source", ".", "unlock", "(", "self", "(", ")", ")", ";", "if", "(", "validation", "!=", "null", "&&", "source", ".", "_key", "!=", "null", "&&", "validation", ".", "_key", "!=", "null", "&&", "!", "...
Release the lock for the input datasets
[ "Release", "the", "lock", "for", "the", "input", "datasets" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearning.java#L1158-L1162
51,968
h2oai/h2o-2
src/main/java/hex/deeplearning/DeepLearning.java
DeepLearning.reBalance
private Frame reBalance(final Frame fr, boolean local) { int chunks = (int)Math.min( 4 * H2O.NUMCPUS * (local ? 1 : H2O.CLOUD.size()), fr.numRows()); if (fr.anyVec().nChunks() > chunks && !reproducible) { Log.info("Dataset already contains " + fr.anyVec().nChunks() + " chunks. No need to rebalance."); ...
java
private Frame reBalance(final Frame fr, boolean local) { int chunks = (int)Math.min( 4 * H2O.NUMCPUS * (local ? 1 : H2O.CLOUD.size()), fr.numRows()); if (fr.anyVec().nChunks() > chunks && !reproducible) { Log.info("Dataset already contains " + fr.anyVec().nChunks() + " chunks. No need to rebalance."); ...
[ "private", "Frame", "reBalance", "(", "final", "Frame", "fr", ",", "boolean", "local", ")", "{", "int", "chunks", "=", "(", "int", ")", "Math", ".", "min", "(", "4", "*", "H2O", ".", "NUMCPUS", "*", "(", "local", "?", "1", ":", "H2O", ".", "CLOUD...
Rebalance a frame for load balancing @param fr Input frame @param local whether to only create enough chunks to max out all cores on one node only @return Frame that has potentially more chunks
[ "Rebalance", "a", "frame", "for", "load", "balancing" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearning.java#L1179-L1196
51,969
h2oai/h2o-2
src/main/java/hex/deeplearning/DeepLearning.java
DeepLearning.computeRowUsageFraction
private static float computeRowUsageFraction(final long numRows, final long train_samples_per_iteration, final boolean replicate_training_data) { float rowUsageFraction = (float)train_samples_per_iteration / numRows; if (replicate_training_data) rowUsageFraction /= H2O.CLOUD.size(); assert(rowUsageFraction ...
java
private static float computeRowUsageFraction(final long numRows, final long train_samples_per_iteration, final boolean replicate_training_data) { float rowUsageFraction = (float)train_samples_per_iteration / numRows; if (replicate_training_data) rowUsageFraction /= H2O.CLOUD.size(); assert(rowUsageFraction ...
[ "private", "static", "float", "computeRowUsageFraction", "(", "final", "long", "numRows", ",", "final", "long", "train_samples_per_iteration", ",", "final", "boolean", "replicate_training_data", ")", "{", "float", "rowUsageFraction", "=", "(", "float", ")", "train_sam...
Compute the fraction of rows that need to be used for training during one iteration @param numRows number of training rows @param train_samples_per_iteration number of training rows to be processed per iteration @param replicate_training_data whether of not the training data is replicated on each node @return fraction ...
[ "Compute", "the", "fraction", "of", "rows", "that", "need", "to", "be", "used", "for", "training", "during", "one", "iteration" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearning.java#L1288-L1293
51,970
h2oai/h2o-2
src/main/java/water/util/CrossValUtils.java
CrossValUtils.crossValidate
public static void crossValidate(Job.ValidatedJob job) { if (job.state != Job.JobState.RUNNING) return; //don't do cross-validation if the full model builder failed if (job.validation != null) throw new IllegalArgumentException("Cannot provide validation dataset and n_folds > 0 at the same time."); if...
java
public static void crossValidate(Job.ValidatedJob job) { if (job.state != Job.JobState.RUNNING) return; //don't do cross-validation if the full model builder failed if (job.validation != null) throw new IllegalArgumentException("Cannot provide validation dataset and n_folds > 0 at the same time."); if...
[ "public", "static", "void", "crossValidate", "(", "Job", ".", "ValidatedJob", "job", ")", "{", "if", "(", "job", ".", "state", "!=", "Job", ".", "JobState", ".", "RUNNING", ")", "return", ";", "//don't do cross-validation if the full model builder failed", "if", ...
Cross-Validate a ValidatedJob @param job (must contain valid entries for n_folds, validation, destination_key, source, response)
[ "Cross", "-", "Validate", "a", "ValidatedJob" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/util/CrossValUtils.java#L14-L56
51,971
h2oai/h2o-2
src/main/java/water/api/ModelMetrics.java
ModelMetrics.fetchAll
protected static List<water.ModelMetrics>fetchAll() { return new ArrayList<water.ModelMetrics>(H2O.KeySnapshot.globalSnapshot().fetchAll(water.ModelMetrics.class).values()); }
java
protected static List<water.ModelMetrics>fetchAll() { return new ArrayList<water.ModelMetrics>(H2O.KeySnapshot.globalSnapshot().fetchAll(water.ModelMetrics.class).values()); }
[ "protected", "static", "List", "<", "water", ".", "ModelMetrics", ">", "fetchAll", "(", ")", "{", "return", "new", "ArrayList", "<", "water", ".", "ModelMetrics", ">", "(", "H2O", ".", "KeySnapshot", ".", "globalSnapshot", "(", ")", ".", "fetchAll", "(", ...
Fetch all ModelMetrics from the KV store.
[ "Fetch", "all", "ModelMetrics", "from", "the", "KV", "store", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/ModelMetrics.java#L52-L54
51,972
h2oai/h2o-2
src/main/java/water/api/ModelMetrics.java
ModelMetrics.serveOneOrAll
private Response serveOneOrAll(List<water.ModelMetrics> list) { JsonArray metricsArray = new JsonArray(); for (water.ModelMetrics metrics : list) { JsonObject metricsJson = metrics.toJSON(); metricsArray.add(metricsJson); } JsonObject result = new JsonObject(); result.add("metrics", me...
java
private Response serveOneOrAll(List<water.ModelMetrics> list) { JsonArray metricsArray = new JsonArray(); for (water.ModelMetrics metrics : list) { JsonObject metricsJson = metrics.toJSON(); metricsArray.add(metricsJson); } JsonObject result = new JsonObject(); result.add("metrics", me...
[ "private", "Response", "serveOneOrAll", "(", "List", "<", "water", ".", "ModelMetrics", ">", "list", ")", "{", "JsonArray", "metricsArray", "=", "new", "JsonArray", "(", ")", ";", "for", "(", "water", ".", "ModelMetrics", "metrics", ":", "list", ")", "{", ...
For one or more water.ModelMetrics from the KV store return Response containing a map of them.
[ "For", "one", "or", "more", "water", ".", "ModelMetrics", "from", "the", "KV", "store", "return", "Response", "containing", "a", "map", "of", "them", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/ModelMetrics.java#L60-L71
51,973
h2oai/h2o-2
src/main/java/hex/gbm/DTreeUtils.java
DTreeUtils.scoreTree
public static void scoreTree(double data[], float preds[], CompressedTree[] ts) { for( int c=0; c<ts.length; c++ ) if( ts[c] != null ) preds[ts.length==1?0:c+1] += ts[c].score(data); }
java
public static void scoreTree(double data[], float preds[], CompressedTree[] ts) { for( int c=0; c<ts.length; c++ ) if( ts[c] != null ) preds[ts.length==1?0:c+1] += ts[c].score(data); }
[ "public", "static", "void", "scoreTree", "(", "double", "data", "[", "]", ",", "float", "preds", "[", "]", ",", "CompressedTree", "[", "]", "ts", ")", "{", "for", "(", "int", "c", "=", "0", ";", "c", "<", "ts", ".", "length", ";", "c", "++", ")...
Score given tree on the row of data. @param data row of data @param preds array to hold resulting prediction @param ts a tree representation (single regression tree, or multi tree)
[ "Score", "given", "tree", "on", "the", "row", "of", "data", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/gbm/DTreeUtils.java#L15-L19
51,974
h2oai/h2o-2
src/main/java/water/api/RequestServer.java
RequestServer.registerRequest
public static Request registerRequest(Request req) { assert req.supportedVersions().length > 0; for (API_VERSION ver : req.supportedVersions()) { String href = req.href(ver); assert (! _requests.containsKey(href)) : "Request with href "+href+" already registered"; _requests.put(href,req); ...
java
public static Request registerRequest(Request req) { assert req.supportedVersions().length > 0; for (API_VERSION ver : req.supportedVersions()) { String href = req.href(ver); assert (! _requests.containsKey(href)) : "Request with href "+href+" already registered"; _requests.put(href,req); ...
[ "public", "static", "Request", "registerRequest", "(", "Request", "req", ")", "{", "assert", "req", ".", "supportedVersions", "(", ")", ".", "length", ">", "0", ";", "for", "(", "API_VERSION", "ver", ":", "req", ".", "supportedVersions", "(", ")", ")", "...
Registers the request with the request server.
[ "Registers", "the", "request", "with", "the", "request", "server", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/RequestServer.java#L277-L286
51,975
h2oai/h2o-2
src/main/java/water/api/RequestServer.java
RequestServer.start
public static void start() { new Thread( new Runnable() { @Override public void run() { while( true ) { try { // Try to get the NanoHTTP daemon started SERVER = new RequestServer(H2O._apiSocket); break; } catch( Exception ioe ) { ...
java
public static void start() { new Thread( new Runnable() { @Override public void run() { while( true ) { try { // Try to get the NanoHTTP daemon started SERVER = new RequestServer(H2O._apiSocket); break; } catch( Exception ioe ) { ...
[ "public", "static", "void", "start", "(", ")", "{", "new", "Thread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "while", "(", "true", ")", "{", "try", "{", "// Try to get the NanoHTTP daemon started", ...
Keep spinning until we get to launch the NanoHTTPD
[ "Keep", "spinning", "until", "we", "get", "to", "launch", "the", "NanoHTTPD" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/RequestServer.java#L361-L376
51,976
h2oai/h2o-2
src/main/java/water/Atomic.java
Atomic.invoke
public final T invoke( Key key ) { RPC<Atomic<T>> rpc = fork(key); return (T)(rpc == null ? this : rpc.get()); // Block for it }
java
public final T invoke( Key key ) { RPC<Atomic<T>> rpc = fork(key); return (T)(rpc == null ? this : rpc.get()); // Block for it }
[ "public", "final", "T", "invoke", "(", "Key", "key", ")", "{", "RPC", "<", "Atomic", "<", "T", ">>", "rpc", "=", "fork", "(", "key", ")", ";", "return", "(", "T", ")", "(", "rpc", "==", "null", "?", "this", ":", "rpc", ".", "get", "(", ")", ...
Block until it completes, even if run remotely
[ "Block", "until", "it", "completes", "even", "if", "run", "remotely" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Atomic.java#L33-L36
51,977
h2oai/h2o-2
src/main/java/water/genmodel/GenUtils.java
GenUtils.concat
public static String[] concat(String[] ...aa) { int l = 0; for (String[] a : aa) l += a.length; String[] r = new String[l]; l = 0; for (String[] a : aa) { System.arraycopy(a, 0, r, l, a.length); l += a.length; } return r; }
java
public static String[] concat(String[] ...aa) { int l = 0; for (String[] a : aa) l += a.length; String[] r = new String[l]; l = 0; for (String[] a : aa) { System.arraycopy(a, 0, r, l, a.length); l += a.length; } return r; }
[ "public", "static", "String", "[", "]", "concat", "(", "String", "[", "]", "...", "aa", ")", "{", "int", "l", "=", "0", ";", "for", "(", "String", "[", "]", "a", ":", "aa", ")", "l", "+=", ".", "length", ";", "String", "[", "]", "r", "=", "...
Concatenate given list of arrays into one long array. <p>Expect not null array.</p> @param aa list of string arrays @return a long array create by concatenation of given arrays.
[ "Concatenate", "given", "list", "of", "arrays", "into", "one", "long", "array", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/genmodel/GenUtils.java#L14-L24
51,978
h2oai/h2o-2
h2o-samples/src/main/java/samples/expert/Frames.java
Frames.parse
public static Frame parse(File file) { Key fkey = NFSFileVec.make(file); Key dest = Key.make(file.getName()); Frame frame = ParseDataset2.parse(dest, new Key[] { fkey }); return frame; }
java
public static Frame parse(File file) { Key fkey = NFSFileVec.make(file); Key dest = Key.make(file.getName()); Frame frame = ParseDataset2.parse(dest, new Key[] { fkey }); return frame; }
[ "public", "static", "Frame", "parse", "(", "File", "file", ")", "{", "Key", "fkey", "=", "NFSFileVec", ".", "make", "(", "file", ")", ";", "Key", "dest", "=", "Key", ".", "make", "(", "file", ".", "getName", "(", ")", ")", ";", "Frame", "frame", ...
Parse a dataset into a Frame.
[ "Parse", "a", "dataset", "into", "a", "Frame", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/h2o-samples/src/main/java/samples/expert/Frames.java#L45-L50
51,979
h2oai/h2o-2
h2o-samples/src/main/java/samples/expert/Frames.java
Frames.create
public static Frame create(String[] headers, double[][] rows) { Futures fs = new Futures(); Vec[] vecs = new Vec[rows[0].length]; Key keys[] = new Vec.VectorGroup().addVecs(vecs.length); for( int c = 0; c < vecs.length; c++ ) { AppendableVec vec = new AppendableVec(keys[c]); NewChunk chunk =...
java
public static Frame create(String[] headers, double[][] rows) { Futures fs = new Futures(); Vec[] vecs = new Vec[rows[0].length]; Key keys[] = new Vec.VectorGroup().addVecs(vecs.length); for( int c = 0; c < vecs.length; c++ ) { AppendableVec vec = new AppendableVec(keys[c]); NewChunk chunk =...
[ "public", "static", "Frame", "create", "(", "String", "[", "]", "headers", ",", "double", "[", "]", "[", "]", "rows", ")", "{", "Futures", "fs", "=", "new", "Futures", "(", ")", ";", "Vec", "[", "]", "vecs", "=", "new", "Vec", "[", "rows", "[", ...
Creates a frame programmatically.
[ "Creates", "a", "frame", "programmatically", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/h2o-samples/src/main/java/samples/expert/Frames.java#L55-L69
51,980
h2oai/h2o-2
src/main/java/water/fvec/FileVec.java
FileVec.chunkIdx
@Override public Value chunkIdx( int cidx ) { final long nchk = nChunks(); assert 0 <= cidx && cidx < nchk; Key dkey = chunkKey(cidx); Value val1 = DKV.get(dkey);// Check for an existing one... will fetch data as needed if( val1 != null ) return val1; // Found an existing one? // Lazily create a...
java
@Override public Value chunkIdx( int cidx ) { final long nchk = nChunks(); assert 0 <= cidx && cidx < nchk; Key dkey = chunkKey(cidx); Value val1 = DKV.get(dkey);// Check for an existing one... will fetch data as needed if( val1 != null ) return val1; // Found an existing one? // Lazily create a...
[ "@", "Override", "public", "Value", "chunkIdx", "(", "int", "cidx", ")", "{", "final", "long", "nchk", "=", "nChunks", "(", ")", ";", "assert", "0", "<=", "cidx", "&&", "cidx", "<", "nchk", ";", "Key", "dkey", "=", "chunkKey", "(", "cidx", ")", ";"...
Touching the DVec will force the file load.
[ "Touching", "the", "DVec", "will", "force", "the", "file", "load", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/FileVec.java#L68-L88
51,981
h2oai/h2o-2
src/main/java/water/api/Frames.java
Frames.summarizeAndEnhanceFrame
private static void summarizeAndEnhanceFrame(FrameSummary summary, Frame frame, boolean find_compatible_models, Map<String, Model> all_models, Map<String, Set<String>> all_models_cols) { UniqueId unique_id = frame.getUniqueId(); summary.id = unique_id.getId(); summary.key = unique_id.getKey(); summary.c...
java
private static void summarizeAndEnhanceFrame(FrameSummary summary, Frame frame, boolean find_compatible_models, Map<String, Model> all_models, Map<String, Set<String>> all_models_cols) { UniqueId unique_id = frame.getUniqueId(); summary.id = unique_id.getId(); summary.key = unique_id.getKey(); summary.c...
[ "private", "static", "void", "summarizeAndEnhanceFrame", "(", "FrameSummary", "summary", ",", "Frame", "frame", ",", "boolean", "find_compatible_models", ",", "Map", "<", "String", ",", "Model", ">", "all_models", ",", "Map", "<", "String", ",", "Set", "<", "S...
Summarize fields in water.fvec.Frame.
[ "Summarize", "fields", "in", "water", ".", "fvec", ".", "Frame", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/Frames.java#L145-L158
51,982
h2oai/h2o-2
src/main/java/water/api/Frames.java
Frames.serveOneOrAll
private Response serveOneOrAll(Map<String, Frame> framesMap) { // returns empty sets if !this.find_compatible_models Pair<Map<String, Model>, Map<String, Set<String>>> models_info = fetchModels(); Map<String, Model> all_models = models_info.getFirst(); Map<String, Set<String>> all_models_cols = models_i...
java
private Response serveOneOrAll(Map<String, Frame> framesMap) { // returns empty sets if !this.find_compatible_models Pair<Map<String, Model>, Map<String, Set<String>>> models_info = fetchModels(); Map<String, Model> all_models = models_info.getFirst(); Map<String, Set<String>> all_models_cols = models_i...
[ "private", "Response", "serveOneOrAll", "(", "Map", "<", "String", ",", "Frame", ">", "framesMap", ")", "{", "// returns empty sets if !this.find_compatible_models", "Pair", "<", "Map", "<", "String", ",", "Model", ">", ",", "Map", "<", "String", ",", "Set", "...
For one or more Frame from the KV store, sumamrize and enhance them and Response containing a map of them.
[ "For", "one", "or", "more", "Frame", "from", "the", "KV", "store", "sumamrize", "and", "enhance", "them", "and", "Response", "containing", "a", "map", "of", "them", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/Frames.java#L172-L201
51,983
h2oai/h2o-2
src/main/java/water/fvec/TransfVec.java
TransfVec.compose
public static Vec compose(TransfVec origVec, int[][] transfMap, String[] domain, boolean keepOrig) { // Do a mapping from INT -> ENUM -> this vector ENUM int[][] domMap = Utils.compose(new int[][] {origVec._values, origVec._indexes }, transfMap); Vec result = origVec.masterVec().makeTransf(domMap[0], domMap...
java
public static Vec compose(TransfVec origVec, int[][] transfMap, String[] domain, boolean keepOrig) { // Do a mapping from INT -> ENUM -> this vector ENUM int[][] domMap = Utils.compose(new int[][] {origVec._values, origVec._indexes }, transfMap); Vec result = origVec.masterVec().makeTransf(domMap[0], domMap...
[ "public", "static", "Vec", "compose", "(", "TransfVec", "origVec", ",", "int", "[", "]", "[", "]", "transfMap", ",", "String", "[", "]", "domain", ",", "boolean", "keepOrig", ")", "{", "// Do a mapping from INT -> ENUM -> this vector ENUM", "int", "[", "]", "[...
Compose given origVector with given transformation. Always returns a new vector. Original vector is kept if keepOrig is true. @param origVec @param transfMap @param keepOrig @return a new instance of {@link TransfVec} composing transformation of origVector and tranfsMap
[ "Compose", "given", "origVector", "with", "given", "transformation", ".", "Always", "returns", "a", "new", "vector", ".", "Original", "vector", "is", "kept", "if", "keepOrig", "is", "true", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/TransfVec.java#L127-L133
51,984
h2oai/h2o-2
src/main/java/water/api/Inspector.java
Inspector.redirect
public static Response redirect(Request req, Key src_key) { return Response.redirect(req, "/2/Inspector", "src_key", src_key.toString()); }
java
public static Response redirect(Request req, Key src_key) { return Response.redirect(req, "/2/Inspector", "src_key", src_key.toString()); }
[ "public", "static", "Response", "redirect", "(", "Request", "req", ",", "Key", "src_key", ")", "{", "return", "Response", ".", "redirect", "(", "req", ",", "\"/2/Inspector\"", ",", "\"src_key\"", ",", "src_key", ".", "toString", "(", ")", ")", ";", "}" ]
Called from some other page, to redirect that other page to this page.
[ "Called", "from", "some", "other", "page", "to", "redirect", "that", "other", "page", "to", "this", "page", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/Inspector.java#L83-L85
51,985
h2oai/h2o-2
src/main/java/water/fvec/NewChunk.java
NewChunk.addr
public void addr( NewChunk nc ) { long [] tmpl = _ls; _ls = nc._ls; nc._ls = tmpl; int [] tmpi = _xs; _xs = nc._xs; nc._xs = tmpi; tmpi = _id; _id = nc._id; nc._id = tmpi; double[] tmpd = _ds; _ds = nc._ds; nc._ds = tmpd; int tmp = _sparseLen; _sparseLen=nc._sparseLen; nc._sparseLe...
java
public void addr( NewChunk nc ) { long [] tmpl = _ls; _ls = nc._ls; nc._ls = tmpl; int [] tmpi = _xs; _xs = nc._xs; nc._xs = tmpi; tmpi = _id; _id = nc._id; nc._id = tmpi; double[] tmpd = _ds; _ds = nc._ds; nc._ds = tmpd; int tmp = _sparseLen; _sparseLen=nc._sparseLen; nc._sparseLe...
[ "public", "void", "addr", "(", "NewChunk", "nc", ")", "{", "long", "[", "]", "tmpl", "=", "_ls", ";", "_ls", "=", "nc", ".", "_ls", ";", "nc", ".", "_ls", "=", "tmpl", ";", "int", "[", "]", "tmpi", "=", "_xs", ";", "_xs", "=", "nc", ".", "_...
PREpend all of 'nc' onto the current NewChunk. Kill nc.
[ "PREpend", "all", "of", "nc", "onto", "the", "current", "NewChunk", ".", "Kill", "nc", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/NewChunk.java#L309-L317
51,986
h2oai/h2o-2
src/main/java/water/fvec/NewChunk.java
NewChunk.append2
void append2( long l, int x ) { if(_id == null || l != 0){ if(_ls == null || _sparseLen == _ls.length) { append2slow(); // again call append2 since calling append2slow might have changed things (eg might have switched to sparse and l could be 0) append2(l,x); return; } ...
java
void append2( long l, int x ) { if(_id == null || l != 0){ if(_ls == null || _sparseLen == _ls.length) { append2slow(); // again call append2 since calling append2slow might have changed things (eg might have switched to sparse and l could be 0) append2(l,x); return; } ...
[ "void", "append2", "(", "long", "l", ",", "int", "x", ")", "{", "if", "(", "_id", "==", "null", "||", "l", "!=", "0", ")", "{", "if", "(", "_ls", "==", "null", "||", "_sparseLen", "==", "_ls", ".", "length", ")", "{", "append2slow", "(", ")", ...
Fast-path append long data
[ "Fast", "-", "path", "append", "long", "data" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/NewChunk.java#L320-L335
51,987
h2oai/h2o-2
src/main/java/water/UKV.java
UKV.put
static public void put( Key key, Value val, Futures fs ) { assert !val.isLockable(); Value res = DKV.put(key,val,fs); assert res == null || !res.isLockable(); }
java
static public void put( Key key, Value val, Futures fs ) { assert !val.isLockable(); Value res = DKV.put(key,val,fs); assert res == null || !res.isLockable(); }
[ "static", "public", "void", "put", "(", "Key", "key", ",", "Value", "val", ",", "Futures", "fs", ")", "{", "assert", "!", "val", ".", "isLockable", "(", ")", ";", "Value", "res", "=", "DKV", ".", "put", "(", "key", ",", "val", ",", "fs", ")", "...
have to use the Lockable interface for all updates.
[ "have", "to", "use", "the", "Lockable", "interface", "for", "all", "updates", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/UKV.java#L26-L30
51,988
h2oai/h2o-2
src/main/java/water/UKV.java
UKV.put
static public void put( Key key, Freezable fr ) { if( fr == null ) UKV.remove(key); else UKV.put(key,new Value(key, fr)); }
java
static public void put( Key key, Freezable fr ) { if( fr == null ) UKV.remove(key); else UKV.put(key,new Value(key, fr)); }
[ "static", "public", "void", "put", "(", "Key", "key", ",", "Freezable", "fr", ")", "{", "if", "(", "fr", "==", "null", ")", "UKV", ".", "remove", "(", "key", ")", ";", "else", "UKV", ".", "put", "(", "key", ",", "new", "Value", "(", "key", ",",...
Also, allow auto-serialization
[ "Also", "allow", "auto", "-", "serialization" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/UKV.java#L54-L57
51,989
h2oai/h2o-2
src/main/java/water/H2ONode.java
H2ONode.remove_task_tracking
void remove_task_tracking( int task ) { RPC.RPCCall rpc = _work.get(task); if( rpc == null ) return; // Already stopped tracking // Atomically attempt to remove the 'dt'. If we win, we are the sole // thread running the dt.onAckAck. Also helps GC: the 'dt' is done (sent // to client and we rece...
java
void remove_task_tracking( int task ) { RPC.RPCCall rpc = _work.get(task); if( rpc == null ) return; // Already stopped tracking // Atomically attempt to remove the 'dt'. If we win, we are the sole // thread running the dt.onAckAck. Also helps GC: the 'dt' is done (sent // to client and we rece...
[ "void", "remove_task_tracking", "(", "int", "task", ")", "{", "RPC", ".", "RPCCall", "rpc", "=", "_work", ".", "get", "(", "task", ")", ";", "if", "(", "rpc", "==", "null", ")", "return", ";", "// Already stopped tracking", "// Atomically attempt to remove the...
Stop tracking a remote task, because we got an ACKACK.
[ "Stop", "tracking", "a", "remote", "task", "because", "we", "got", "an", "ACKACK", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/H2ONode.java#L315-L338
51,990
h2oai/h2o-2
src/main/java/water/util/FrameUtils.java
FrameUtils.frame
public static Frame frame(String[] names, double[]... rows) { assert names == null || names.length == rows[0].length; Futures fs = new Futures(); Vec[] vecs = new Vec[rows[0].length]; Key keys[] = Vec.VectorGroup.VG_LEN1.addVecs(vecs.length); for( int c = 0; c < vecs.length; c++ ) { Appendable...
java
public static Frame frame(String[] names, double[]... rows) { assert names == null || names.length == rows[0].length; Futures fs = new Futures(); Vec[] vecs = new Vec[rows[0].length]; Key keys[] = Vec.VectorGroup.VG_LEN1.addVecs(vecs.length); for( int c = 0; c < vecs.length; c++ ) { Appendable...
[ "public", "static", "Frame", "frame", "(", "String", "[", "]", "names", ",", "double", "[", "]", "...", "rows", ")", "{", "assert", "names", "==", "null", "||", "names", ".", "length", "==", "rows", "[", "0", "]", ".", "length", ";", "Futures", "fs...
Create a new frame based on given row data. @param names names of frame columns @param rows data given in the form of rows @return new frame which contains columns named according given names and including given data
[ "Create", "a", "new", "frame", "based", "on", "given", "row", "data", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/util/FrameUtils.java#L31-L46
51,991
h2oai/h2o-2
src/main/java/water/util/FrameUtils.java
FrameUtils.parseFrame
public static Frame parseFrame(Key okey, File ...files) { assert files.length > 0 : "Ups. No files to parse!"; for (File f : files) if (!f.exists()) throw new RuntimeException("File not found " + f); // Create output key if not specified if(okey == null) okey = Key.make(files[0].getN...
java
public static Frame parseFrame(Key okey, File ...files) { assert files.length > 0 : "Ups. No files to parse!"; for (File f : files) if (!f.exists()) throw new RuntimeException("File not found " + f); // Create output key if not specified if(okey == null) okey = Key.make(files[0].getN...
[ "public", "static", "Frame", "parseFrame", "(", "Key", "okey", ",", "File", "...", "files", ")", "{", "assert", "files", ".", "length", ">", "0", ":", "\"Ups. No files to parse!\"", ";", "for", "(", "File", "f", ":", "files", ")", "if", "(", "!", "f", ...
Parse given file into the form of frame represented by the given key. @param okey destination key for parsed frame @param files files to parse @return a new frame
[ "Parse", "given", "file", "into", "the", "form", "of", "frame", "represented", "by", "the", "given", "key", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/util/FrameUtils.java#L54-L67
51,992
h2oai/h2o-2
src/main/java/water/ga/GoogleAnalytics.java
GoogleAnalytics.processCustomDimensionParameters
private void processCustomDimensionParameters(@SuppressWarnings("rawtypes") GoogleAnalyticsRequest request, List<NameValuePair> postParms) { Map<String, String> customDimParms = new HashMap<String, String>(); for (String defaultCustomDimKey : defaultRequest.customDimentions().keySet()) { customDimParms.pu...
java
private void processCustomDimensionParameters(@SuppressWarnings("rawtypes") GoogleAnalyticsRequest request, List<NameValuePair> postParms) { Map<String, String> customDimParms = new HashMap<String, String>(); for (String defaultCustomDimKey : defaultRequest.customDimentions().keySet()) { customDimParms.pu...
[ "private", "void", "processCustomDimensionParameters", "(", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "GoogleAnalyticsRequest", "request", ",", "List", "<", "NameValuePair", ">", "postParms", ")", "{", "Map", "<", "String", ",", "String", ">", "customDimPar...
Processes the custom dimensions and adds the values to list of parameters, which would be posted to GA. @param request @param postParms
[ "Processes", "the", "custom", "dimensions", "and", "adds", "the", "values", "to", "list", "of", "parameters", "which", "would", "be", "posted", "to", "GA", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/ga/GoogleAnalytics.java#L217-L232
51,993
h2oai/h2o-2
src/main/java/water/ga/GoogleAnalytics.java
GoogleAnalytics.processCustomMetricParameters
private void processCustomMetricParameters(@SuppressWarnings("rawtypes") GoogleAnalyticsRequest request, List<NameValuePair> postParms) { Map<String, String> customMetricParms = new HashMap<String, String>(); for (String defaultCustomMetricKey : defaultRequest.custommMetrics().keySet()) { customMetricParm...
java
private void processCustomMetricParameters(@SuppressWarnings("rawtypes") GoogleAnalyticsRequest request, List<NameValuePair> postParms) { Map<String, String> customMetricParms = new HashMap<String, String>(); for (String defaultCustomMetricKey : defaultRequest.custommMetrics().keySet()) { customMetricParm...
[ "private", "void", "processCustomMetricParameters", "(", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "GoogleAnalyticsRequest", "request", ",", "List", "<", "NameValuePair", ">", "postParms", ")", "{", "Map", "<", "String", ",", "String", ">", "customMetricPar...
Processes the custom metrics and adds the values to list of parameters, which would be posted to GA. @param request @param postParms
[ "Processes", "the", "custom", "metrics", "and", "adds", "the", "values", "to", "list", "of", "parameters", "which", "would", "be", "posted", "to", "GA", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/ga/GoogleAnalytics.java#L240-L255
51,994
h2oai/h2o-2
src/main/java/water/fvec/CBSChunk.java
CBSChunk.clen
public static int clen(int values, int bpv) { int len = (values*bpv) >> 3; return values*bpv % 8 == 0 ? len : len + 1; }
java
public static int clen(int values, int bpv) { int len = (values*bpv) >> 3; return values*bpv % 8 == 0 ? len : len + 1; }
[ "public", "static", "int", "clen", "(", "int", "values", ",", "int", "bpv", ")", "{", "int", "len", "=", "(", "values", "*", "bpv", ")", ">>", "3", ";", "return", "values", "*", "bpv", "%", "8", "==", "0", "?", "len", ":", "len", "+", "1", ";...
Returns compressed len of the given array length if the value if represented by bpv-bits.
[ "Returns", "compressed", "len", "of", "the", "given", "array", "length", "if", "the", "value", "if", "represented", "by", "bpv", "-", "bits", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/CBSChunk.java#L84-L87
51,995
h2oai/h2o-2
src/main/java/water/TaskGetKey.java
TaskGetKey.get
public static Value get( H2ONode target, Key key, int priority ) { RPC<TaskGetKey> rpc, old; while( true ) { // Repeat until we get a unique TGK installed per key // Do we have an old TaskGetKey in-progress? rpc = TGKS.get(key); if( rpc != null && rpc._dt._priority >= priority ) ...
java
public static Value get( H2ONode target, Key key, int priority ) { RPC<TaskGetKey> rpc, old; while( true ) { // Repeat until we get a unique TGK installed per key // Do we have an old TaskGetKey in-progress? rpc = TGKS.get(key); if( rpc != null && rpc._dt._priority >= priority ) ...
[ "public", "static", "Value", "get", "(", "H2ONode", "target", ",", "Key", "key", ",", "int", "priority", ")", "{", "RPC", "<", "TaskGetKey", ">", "rpc", ",", "old", ";", "while", "(", "true", ")", "{", "// Repeat until we get a unique TGK installed per key", ...
Get a value from a named remote node
[ "Get", "a", "value", "from", "a", "named", "remote", "node" ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/TaskGetKey.java#L26-L44
51,996
h2oai/h2o-2
src/main/java/water/api/RequestBuilders.java
RequestBuilders.build
protected String build(Response response) { StringBuilder sb = new StringBuilder(); sb.append("<div class='container'>"); sb.append("<div class='row-fluid'>"); sb.append("<div class='span12'>"); sb.append(buildJSONResponseBox(response)); if( response._status == Response.Status.done ) response.to...
java
protected String build(Response response) { StringBuilder sb = new StringBuilder(); sb.append("<div class='container'>"); sb.append("<div class='row-fluid'>"); sb.append("<div class='span12'>"); sb.append(buildJSONResponseBox(response)); if( response._status == Response.Status.done ) response.to...
[ "protected", "String", "build", "(", "Response", "response", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"<div class='container'>\"", ")", ";", "sb", ".", "append", "(", "\"<div class='row-fluid'>\"", ...
Builds the HTML for the given response. This is the root of the HTML. Should display all what is needed, including the status, timing, etc. Then call the recursive builders for the response's JSON.
[ "Builds", "the", "HTML", "for", "the", "given", "response", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/api/RequestBuilders.java#L60-L85
51,997
h2oai/h2o-2
src/main/java/water/Boot.java
Boot.addExternalJars
public void addExternalJars(File file) throws IllegalAccessException, InvocationTargetException, MalformedURLException { assert file.exists() : "Unable to find external file: " + file.getAbsolutePath(); if( file.isDirectory() ) { for( File f : file.listFiles() ) addExternalJars(f); } else if( file.get...
java
public void addExternalJars(File file) throws IllegalAccessException, InvocationTargetException, MalformedURLException { assert file.exists() : "Unable to find external file: " + file.getAbsolutePath(); if( file.isDirectory() ) { for( File f : file.listFiles() ) addExternalJars(f); } else if( file.get...
[ "public", "void", "addExternalJars", "(", "File", "file", ")", "throws", "IllegalAccessException", ",", "InvocationTargetException", ",", "MalformedURLException", "{", "assert", "file", ".", "exists", "(", ")", ":", "\"Unable to find external file: \"", "+", "file", "...
Adds all jars in given directory to the classpath.
[ "Adds", "all", "jars", "in", "given", "directory", "to", "the", "classpath", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Boot.java#L343-L352
51,998
h2oai/h2o-2
src/main/java/water/Boot.java
Boot.extractInternalFiles
private void extractInternalFiles() throws IOException { Enumeration entries = _h2oJar.entries(); while( entries.hasMoreElements() ) { ZipEntry e = (ZipEntry) entries.nextElement(); String name = e.getName(); if( e.isDirectory() ) continue; // mkdirs() will handle these if(! name.endsWit...
java
private void extractInternalFiles() throws IOException { Enumeration entries = _h2oJar.entries(); while( entries.hasMoreElements() ) { ZipEntry e = (ZipEntry) entries.nextElement(); String name = e.getName(); if( e.isDirectory() ) continue; // mkdirs() will handle these if(! name.endsWit...
[ "private", "void", "extractInternalFiles", "(", ")", "throws", "IOException", "{", "Enumeration", "entries", "=", "_h2oJar", ".", "entries", "(", ")", ";", "while", "(", "entries", ".", "hasMoreElements", "(", ")", ")", "{", "ZipEntry", "e", "=", "(", "Zip...
Extracts the libraries from the jar file to given local path.
[ "Extracts", "the", "libraries", "from", "the", "jar", "file", "to", "given", "local", "path", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Boot.java#L355-L384
51,999
h2oai/h2o-2
src/main/java/water/Boot.java
Boot.loadClass
@Override public synchronized Class loadClass( String name, boolean resolve ) throws ClassNotFoundException { assert !name.equals(Weaver.class.getName()); Class z = loadClass2(name); // Do all the work in here if( resolve ) resolveClass(z); // Resolve here instead in the work method return z; }
java
@Override public synchronized Class loadClass( String name, boolean resolve ) throws ClassNotFoundException { assert !name.equals(Weaver.class.getName()); Class z = loadClass2(name); // Do all the work in here if( resolve ) resolveClass(z); // Resolve here instead in the work method return z; }
[ "@", "Override", "public", "synchronized", "Class", "loadClass", "(", "String", "name", ",", "boolean", "resolve", ")", "throws", "ClassNotFoundException", "{", "assert", "!", "name", ".", "equals", "(", "Weaver", ".", "class", ".", "getName", "(", ")", ")",...
search, THEN the System or parent loader.
[ "search", "THEN", "the", "System", "or", "parent", "loader", "." ]
be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/Boot.java#L424-L429