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
131,200
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/ForkJoinPool.java
ForkJoinPool.signalWork
final void signalWork() { long c; int u; while ((u = (int)((c = ctl) >>> 32)) < 0) { // too few active WorkQueue[] ws = workQueues; int e, i; WorkQueue w; Thread p; if ((e = (int)c) > 0) { // at least one waiting if (ws != null && (i = e & ...
java
final void signalWork() { long c; int u; while ((u = (int)((c = ctl) >>> 32)) < 0) { // too few active WorkQueue[] ws = workQueues; int e, i; WorkQueue w; Thread p; if ((e = (int)c) > 0) { // at least one waiting if (ws != null && (i = e & ...
[ "final", "void", "signalWork", "(", ")", "{", "long", "c", ";", "int", "u", ";", "while", "(", "(", "u", "=", "(", "int", ")", "(", "(", "c", "=", "ctl", ")", ">>>", "32", ")", ")", "<", "0", ")", "{", "// too few active", "WorkQueue", "[", "...
Tries to activate or create a worker if too few are active.
[ "Tries", "to", "activate", "or", "create", "a", "worker", "if", "too", "few", "are", "active", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinPool.java#L1438-L1468
131,201
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/ForkJoinPool.java
ForkJoinPool.idleAwaitWork
private void idleAwaitWork(WorkQueue w, long currentCtl, long prevCtl) { if (w.eventCount < 0 && !tryTerminate(false, false) && (int)prevCtl != 0 && !hasQueuedSubmissions() && ctl == currentCtl) { Thread wt = Thread.currentThread(); Thread.yield(); // yield before ...
java
private void idleAwaitWork(WorkQueue w, long currentCtl, long prevCtl) { if (w.eventCount < 0 && !tryTerminate(false, false) && (int)prevCtl != 0 && !hasQueuedSubmissions() && ctl == currentCtl) { Thread wt = Thread.currentThread(); Thread.yield(); // yield before ...
[ "private", "void", "idleAwaitWork", "(", "WorkQueue", "w", ",", "long", "currentCtl", ",", "long", "prevCtl", ")", "{", "if", "(", "w", ".", "eventCount", "<", "0", "&&", "!", "tryTerminate", "(", "false", ",", "false", ")", "&&", "(", "int", ")", "p...
If inactivating worker w has caused the pool to become quiescent, checks for pool termination, and, so long as this is not the only worker, waits for event for up to SHRINK_RATE nanosecs. On timeout, if ctl has not changed, terminates the worker, which will in turn wake up another worker to possibly repeat this proces...
[ "If", "inactivating", "worker", "w", "has", "caused", "the", "pool", "to", "become", "quiescent", "checks", "for", "pool", "termination", "and", "so", "long", "as", "this", "is", "not", "the", "only", "worker", "waits", "for", "event", "for", "up", "to", ...
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinPool.java#L1615-L1639
131,202
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/ForkJoinPool.java
ForkJoinPool.tryPollForAndExec
private void tryPollForAndExec(WorkQueue joiner, ForkJoinTask<?> task) { WorkQueue[] ws; if ((ws = workQueues) != null) { for (int j = 1; j < ws.length && task.status >= 0; j += 2) { WorkQueue q = ws[j]; if (q != null && q.pollFor(task)) { ...
java
private void tryPollForAndExec(WorkQueue joiner, ForkJoinTask<?> task) { WorkQueue[] ws; if ((ws = workQueues) != null) { for (int j = 1; j < ws.length && task.status >= 0; j += 2) { WorkQueue q = ws[j]; if (q != null && q.pollFor(task)) { ...
[ "private", "void", "tryPollForAndExec", "(", "WorkQueue", "joiner", ",", "ForkJoinTask", "<", "?", ">", "task", ")", "{", "WorkQueue", "[", "]", "ws", ";", "if", "(", "(", "ws", "=", "workQueues", ")", "!=", "null", ")", "{", "for", "(", "int", "j", ...
If task is at base of some steal queue, steals and executes it. @param joiner the joining worker @param task the task
[ "If", "task", "is", "at", "base", "of", "some", "steal", "queue", "steals", "and", "executes", "it", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinPool.java#L1733-L1744
131,203
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/ForkJoinPool.java
ForkJoinPool.submit
public <T> ForkJoinTask<T> submit(ForkJoinTask<T> task) { if (task == null) throw new NullPointerException(); doSubmit(task); return task; }
java
public <T> ForkJoinTask<T> submit(ForkJoinTask<T> task) { if (task == null) throw new NullPointerException(); doSubmit(task); return task; }
[ "public", "<", "T", ">", "ForkJoinTask", "<", "T", ">", "submit", "(", "ForkJoinTask", "<", "T", ">", "task", ")", "{", "if", "(", "task", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "doSubmit", "(", "task", ")", ";", ...
Submits a ForkJoinTask for execution. @param task the task to submit @return the task @throws NullPointerException if the task is null @throws RejectedExecutionException if the task cannot be scheduled for execution
[ "Submits", "a", "ForkJoinTask", "for", "execution", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinPool.java#L2238-L2243
131,204
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/ForkJoinPool.java
ForkJoinPool.getRunningThreadCount
public int getRunningThreadCount() { int rc = 0; WorkQueue[] ws; WorkQueue w; if ((ws = workQueues) != null) { for (int i = 1; i < ws.length; i += 2) { if ((w = ws[i]) != null && w.isApparentlyUnblocked()) ++rc; } } retu...
java
public int getRunningThreadCount() { int rc = 0; WorkQueue[] ws; WorkQueue w; if ((ws = workQueues) != null) { for (int i = 1; i < ws.length; i += 2) { if ((w = ws[i]) != null && w.isApparentlyUnblocked()) ++rc; } } retu...
[ "public", "int", "getRunningThreadCount", "(", ")", "{", "int", "rc", "=", "0", ";", "WorkQueue", "[", "]", "ws", ";", "WorkQueue", "w", ";", "if", "(", "(", "ws", "=", "workQueues", ")", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "1", ...
Returns an estimate of the number of worker threads that are not blocked waiting to join tasks or for other managed synchronization. This method may overestimate the number of running threads. @return the number of worker threads
[ "Returns", "an", "estimate", "of", "the", "number", "of", "worker", "threads", "that", "are", "not", "blocked", "waiting", "to", "join", "tasks", "or", "for", "other", "managed", "synchronization", ".", "This", "method", "may", "overestimate", "the", "number",...
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinPool.java#L2374-L2384
131,205
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/ForkJoinPool.java
ForkJoinPool.awaitTermination
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); final Mutex lock = this.lock; lock.lock(); try { for (;;) { if (isTerminated()) return true; ...
java
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); final Mutex lock = this.lock; lock.lock(); try { for (;;) { if (isTerminated()) return true; ...
[ "public", "boolean", "awaitTermination", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", "{", "long", "nanos", "=", "unit", ".", "toNanos", "(", "timeout", ")", ";", "final", "Mutex", "lock", "=", "this", ".", "lock", ...
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first. @param timeout the maximum time to wait @param unit the time unit of the timeout argument @return {@code true} if this executor terminated and {@code false} if...
[ "Blocks", "until", "all", "tasks", "have", "completed", "execution", "after", "a", "shutdown", "request", "or", "the", "timeout", "occurs", "or", "the", "current", "thread", "is", "interrupted", "whichever", "happens", "first", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinPool.java#L2684-L2700
131,206
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/ForkJoinPool.java
ForkJoinPool.newTaskFor
protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) { return new ForkJoinTask.AdaptedRunnable<T>(runnable, value); }
java
protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) { return new ForkJoinTask.AdaptedRunnable<T>(runnable, value); }
[ "protected", "<", "T", ">", "RunnableFuture", "<", "T", ">", "newTaskFor", "(", "Runnable", "runnable", ",", "T", "value", ")", "{", "return", "new", "ForkJoinTask", ".", "AdaptedRunnable", "<", "T", ">", "(", "runnable", ",", "value", ")", ";", "}" ]
implement RunnableFuture.
[ "implement", "RunnableFuture", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinPool.java#L2817-L2819
131,207
h2oai/h2o-3
h2o-automl/src/main/java/ai/h2o/automl/targetencoding/TargetEncoder.java
TargetEncoder.applyTargetEncoding
public Frame applyTargetEncoding(Frame data, String targetColumnName, Map<String, Frame> targetEncodingMap, byte dataLeakageHandlingStrategy, String foldColumn, ...
java
public Frame applyTargetEncoding(Frame data, String targetColumnName, Map<String, Frame> targetEncodingMap, byte dataLeakageHandlingStrategy, String foldColumn, ...
[ "public", "Frame", "applyTargetEncoding", "(", "Frame", "data", ",", "String", "targetColumnName", ",", "Map", "<", "String", ",", "Frame", ">", "targetEncodingMap", ",", "byte", "dataLeakageHandlingStrategy", ",", "String", "foldColumn", ",", "boolean", "withBlende...
Overloaded for the case when user had not specified the noise parameter
[ "Overloaded", "for", "the", "case", "when", "user", "had", "not", "specified", "the", "noise", "parameter" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-automl/src/main/java/ai/h2o/automl/targetencoding/TargetEncoder.java#L706-L719
131,208
h2oai/h2o-3
h2o-genmodel/src/main/java/hex/genmodel/algos/tree/TreeSHAP.java
TreeSHAP.extendPath
private void extendPath(PathPointer unique_path, int unique_depth, float zero_fraction, float one_fraction, int feature_index) { unique_path.get(unique_depth).feature_index = feature_index; unique_path.get(unique_depth).zero_fraction = zero_fraction; uniqu...
java
private void extendPath(PathPointer unique_path, int unique_depth, float zero_fraction, float one_fraction, int feature_index) { unique_path.get(unique_depth).feature_index = feature_index; unique_path.get(unique_depth).zero_fraction = zero_fraction; uniqu...
[ "private", "void", "extendPath", "(", "PathPointer", "unique_path", ",", "int", "unique_depth", ",", "float", "zero_fraction", ",", "float", "one_fraction", ",", "int", "feature_index", ")", "{", "unique_path", ".", "get", "(", "unique_depth", ")", ".", "feature...
extend our decision path with a fraction of one and zero extensions
[ "extend", "our", "decision", "path", "with", "a", "fraction", "of", "one", "and", "zero", "extensions" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/algos/tree/TreeSHAP.java#L42-L55
131,209
h2oai/h2o-3
h2o-genmodel/src/main/java/hex/genmodel/algos/tree/TreeSHAP.java
TreeSHAP.unwindPath
private void unwindPath(PathPointer unique_path, int unique_depth, int path_index) { final float one_fraction = unique_path.get(path_index).one_fraction; final float zero_fraction = unique_path.get(path_index).zero_fraction; float next_one_portion = unique_path.get(unique_depth).pw...
java
private void unwindPath(PathPointer unique_path, int unique_depth, int path_index) { final float one_fraction = unique_path.get(path_index).one_fraction; final float zero_fraction = unique_path.get(path_index).zero_fraction; float next_one_portion = unique_path.get(unique_depth).pw...
[ "private", "void", "unwindPath", "(", "PathPointer", "unique_path", ",", "int", "unique_depth", ",", "int", "path_index", ")", "{", "final", "float", "one_fraction", "=", "unique_path", ".", "get", "(", "path_index", ")", ".", "one_fraction", ";", "final", "fl...
undo a previous extension of the decision path
[ "undo", "a", "previous", "extension", "of", "the", "decision", "path" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/algos/tree/TreeSHAP.java#L58-L82
131,210
h2oai/h2o-3
h2o-genmodel/src/main/java/hex/genmodel/algos/tree/TreeSHAP.java
TreeSHAP.unwoundPathSum
private float unwoundPathSum(final PathPointer unique_path, int unique_depth, int path_index) { final float one_fraction = unique_path.get(path_index).one_fraction; final float zero_fraction = unique_path.get(path_index).zero_fraction; float next_one_portion = unique_path.get(...
java
private float unwoundPathSum(final PathPointer unique_path, int unique_depth, int path_index) { final float one_fraction = unique_path.get(path_index).one_fraction; final float zero_fraction = unique_path.get(path_index).zero_fraction; float next_one_portion = unique_path.get(...
[ "private", "float", "unwoundPathSum", "(", "final", "PathPointer", "unique_path", ",", "int", "unique_depth", ",", "int", "path_index", ")", "{", "final", "float", "one_fraction", "=", "unique_path", ".", "get", "(", "path_index", ")", ".", "one_fraction", ";", ...
we unwound a previous extension in the decision path
[ "we", "unwound", "a", "previous", "extension", "in", "the", "decision", "path" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/algos/tree/TreeSHAP.java#L86-L108
131,211
h2oai/h2o-3
h2o-genmodel/src/main/java/hex/genmodel/algos/tree/TreeSHAP.java
TreeSHAP.treeShap
private void treeShap(R feat, float[] phi, N node, S nodeStat, int unique_depth, PathPointer parent_unique_path, float parent_zero_fraction, float parent_one_fraction, int parent_feature_index, int co...
java
private void treeShap(R feat, float[] phi, N node, S nodeStat, int unique_depth, PathPointer parent_unique_path, float parent_zero_fraction, float parent_one_fraction, int parent_feature_index, int co...
[ "private", "void", "treeShap", "(", "R", "feat", ",", "float", "[", "]", "phi", ",", "N", "node", ",", "S", "nodeStat", ",", "int", "unique_depth", ",", "PathPointer", "parent_unique_path", ",", "float", "parent_zero_fraction", ",", "float", "parent_one_fracti...
recursive computation of SHAP values for a decision tree
[ "recursive", "computation", "of", "SHAP", "values", "for", "a", "decision", "tree" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/algos/tree/TreeSHAP.java#L111-L185
131,212
h2oai/h2o-3
h2o-core/src/main/java/water/init/TimelineSnapshot.java
TimelineSnapshot.processEvent
void processEvent(Event e) { assert !_processed; // Event e = _events[idx]; if (e.isSend()) { _sends.put(e, new ArrayList<TimelineSnapshot.Event>()); for (Event otherE : _events) { if ((otherE != null) && (otherE != e) && (!otherE.equals(e)) && otherE._blocked && otherE.match(e...
java
void processEvent(Event e) { assert !_processed; // Event e = _events[idx]; if (e.isSend()) { _sends.put(e, new ArrayList<TimelineSnapshot.Event>()); for (Event otherE : _events) { if ((otherE != null) && (otherE != e) && (!otherE.equals(e)) && otherE._blocked && otherE.match(e...
[ "void", "processEvent", "(", "Event", "e", ")", "{", "assert", "!", "_processed", ";", "// Event e = _events[idx];", "if", "(", "e", ".", "isSend", "(", ")", ")", "{", "_sends", ".", "put", "(", "e", ",", "new", "ArrayList", "<", "TimelineSnapshot", ".",...
Process new event. For sender, check if there are any blocked receives waiting for this send. For receiver, try to find matching sender, otherwise block. @param e
[ "Process", "new", "event", ".", "For", "sender", "check", "if", "there", "are", "any", "blocked", "receives", "waiting", "for", "this", "send", ".", "For", "receiver", "try", "to", "find", "matching", "sender", "otherwise", "block", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/init/TimelineSnapshot.java#L349-L389
131,213
h2oai/h2o-3
h2o-core/src/main/java/water/init/TimelineSnapshot.java
TimelineSnapshot.hasNext
@Override public boolean hasNext() { for (int i = 0; i < _events.length; ++i) if (_events[i] != null && (!_events[i].isEmpty() || _events[i].next())) { assert (_events[i] == null) || ((_events[i]._eventIdx < TimeLine.MAX_EVENTS) && !_events[i].isEmpty()); return true; } else ...
java
@Override public boolean hasNext() { for (int i = 0; i < _events.length; ++i) if (_events[i] != null && (!_events[i].isEmpty() || _events[i].next())) { assert (_events[i] == null) || ((_events[i]._eventIdx < TimeLine.MAX_EVENTS) && !_events[i].isEmpty()); return true; } else ...
[ "@", "Override", "public", "boolean", "hasNext", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "_events", ".", "length", ";", "++", "i", ")", "if", "(", "_events", "[", "i", "]", "!=", "null", "&&", "(", "!", "_events", "[", ...
Just check if there is any non null non-issued event.
[ "Just", "check", "if", "there", "is", "any", "non", "null", "non", "-", "issued", "event", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/init/TimelineSnapshot.java#L399-L412
131,214
h2oai/h2o-3
h2o-algos/src/main/java/hex/optimization/L_BFGS.java
L_BFGS.solve
public final Result solve(GradientSolver gslvr, double [] coefs){ return solve(gslvr, coefs, gslvr.getGradient(coefs), new ProgressMonitor(){ @Override public boolean progress(double[] beta, GradientInfo ginfo) { return true; } }); }
java
public final Result solve(GradientSolver gslvr, double [] coefs){ return solve(gslvr, coefs, gslvr.getGradient(coefs), new ProgressMonitor(){ @Override public boolean progress(double[] beta, GradientInfo ginfo) { return true; } }); }
[ "public", "final", "Result", "solve", "(", "GradientSolver", "gslvr", ",", "double", "[", "]", "coefs", ")", "{", "return", "solve", "(", "gslvr", ",", "coefs", ",", "gslvr", ".", "getGradient", "(", "coefs", ")", ",", "new", "ProgressMonitor", "(", ")",...
Solve the optimization problem defined by the user-supplied ginfo function using L-BFGS algorithm. Will result into multiple (10s to 100s or even 1000s) calls of the user-provided ginfo function. Outside of that it does only limited single threaded computation (order of number of coefficients). The ginfo is likely to ...
[ "Solve", "the", "optimization", "problem", "defined", "by", "the", "user", "-", "supplied", "ginfo", "function", "using", "L", "-", "BFGS", "algorithm", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/optimization/L_BFGS.java#L212-L219
131,215
h2oai/h2o-3
h2o-core/src/main/java/water/rapids/Env.java
Env.returning
public <V extends Val> V returning(V val) { if (val instanceof ValFrame) _ses.addRefCnt(val.getFrame(), 1); return val; }
java
public <V extends Val> V returning(V val) { if (val instanceof ValFrame) _ses.addRefCnt(val.getFrame(), 1); return val; }
[ "public", "<", "V", "extends", "Val", ">", "V", "returning", "(", "V", "val", ")", "{", "if", "(", "val", "instanceof", "ValFrame", ")", "_ses", ".", "addRefCnt", "(", "val", ".", "getFrame", "(", ")", ",", "1", ")", ";", "return", "val", ";", "}...
shared in the returning output Frame.
[ "shared", "in", "the", "returning", "output", "Frame", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/Env.java#L370-L374
131,216
h2oai/h2o-3
h2o-core/src/main/java/water/rapids/Env.java
Env.addGlobals
ValFrame addGlobals(Frame fr) { _ses.addGlobals(fr); return new ValFrame(new Frame(fr._names.clone(), fr.vecs().clone())); }
java
ValFrame addGlobals(Frame fr) { _ses.addGlobals(fr); return new ValFrame(new Frame(fr._names.clone(), fr.vecs().clone())); }
[ "ValFrame", "addGlobals", "(", "Frame", "fr", ")", "{", "_ses", ".", "addGlobals", "(", "fr", ")", ";", "return", "new", "ValFrame", "(", "new", "Frame", "(", "fr", ".", "_names", ".", "clone", "(", ")", ",", "fr", ".", "vecs", "(", ")", ".", "cl...
frame - so we can hack it without changing the global frame view.
[ "frame", "-", "so", "we", "can", "hack", "it", "without", "changing", "the", "global", "frame", "view", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/Env.java#L414-L417
131,217
h2oai/h2o-3
h2o-algos/src/main/java/hex/kmeans/KMeans.java
KMeansDriver.computeStatsFillModel
double[][] computeStatsFillModel(LloydsIterationTask task, KMeansModel model, final Vec[] vecs, final double[] means, final double[] mults, final int[] modes, int k) { // Fill in the model based on original destandardized centers if (model._parms._standardize) { model._output._centers_std_raw = task...
java
double[][] computeStatsFillModel(LloydsIterationTask task, KMeansModel model, final Vec[] vecs, final double[] means, final double[] mults, final int[] modes, int k) { // Fill in the model based on original destandardized centers if (model._parms._standardize) { model._output._centers_std_raw = task...
[ "double", "[", "]", "[", "]", "computeStatsFillModel", "(", "LloydsIterationTask", "task", ",", "KMeansModel", "model", ",", "final", "Vec", "[", "]", "vecs", ",", "final", "double", "[", "]", "means", ",", "final", "double", "[", "]", "mults", ",", "fin...
etc). Return new centers.
[ "etc", ")", ".", "Return", "new", "centers", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/kmeans/KMeans.java#L209-L247
131,218
h2oai/h2o-3
h2o-core/src/main/java/water/Value.java
Value.storePersist
void storePersist() throws java.io.IOException { // 00 then start writing // 01 delete requested; do not write // 10 already written; do nothing // 11 already written & deleted; do nothing if( isDeleted() ) return; // 01 and 11 cases if( isPersisted() ) return; // 10 ca...
java
void storePersist() throws java.io.IOException { // 00 then start writing // 01 delete requested; do not write // 10 already written; do nothing // 11 already written & deleted; do nothing if( isDeleted() ) return; // 01 and 11 cases if( isPersisted() ) return; // 10 ca...
[ "void", "storePersist", "(", ")", "throws", "java", ".", "io", ".", "IOException", "{", "// 00 then start writing", "// 01 delete requested; do not write", "// 10 already written; do nothing", "// 11 already written & deleted; do nothing", "if", "(", "isDele...
Best-effort store complete Values to disk.
[ "Best", "-", "effort", "store", "complete", "Values", "to", "disk", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Value.java#L200-L217
131,219
h2oai/h2o-3
h2o-core/src/main/java/water/Value.java
Value.loadPersist
byte[] loadPersist() { // 00 assert: not written yet // 01 assert: load-after-delete // 10 expected; read // 11 assert: load-after-delete assert isPersisted(); try { byte[] res = H2O.getPM().load(backend(), this); assert !isDeleted(); // Race in user-la...
java
byte[] loadPersist() { // 00 assert: not written yet // 01 assert: load-after-delete // 10 expected; read // 11 assert: load-after-delete assert isPersisted(); try { byte[] res = H2O.getPM().load(backend(), this); assert !isDeleted(); // Race in user-la...
[ "byte", "[", "]", "loadPersist", "(", ")", "{", "// 00 assert: not written yet", "// 01 assert: load-after-delete", "// 10 expected; read", "// 11 assert: load-after-delete", "assert", "isPersisted", "(", ")", ";", "try", "{", "byte", "[", "]", "res"...
Load some or all of completely persisted Values
[ "Load", "some", "or", "all", "of", "completely", "persisted", "Values" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Value.java#L234-L245
131,220
h2oai/h2o-3
h2o-core/src/main/java/water/Value.java
Value.nameOfPersist
public static String nameOfPersist(int x) { switch( x ) { case ICE : return "ICE"; case HDFS: return "HDFS"; case S3 : return "S3"; case NFS : return "NFS"; case TCP : return "TCP"; case GCS : return "GCS"; default : return null; } }
java
public static String nameOfPersist(int x) { switch( x ) { case ICE : return "ICE"; case HDFS: return "HDFS"; case S3 : return "S3"; case NFS : return "NFS"; case TCP : return "TCP"; case GCS : return "GCS"; default : return null; } }
[ "public", "static", "String", "nameOfPersist", "(", "int", "x", ")", "{", "switch", "(", "x", ")", "{", "case", "ICE", ":", "return", "\"ICE\"", ";", "case", "HDFS", ":", "return", "\"HDFS\"", ";", "case", "S3", ":", "return", "\"S3\"", ";", "case", ...
One of ICE, HDFS, S3, GCS, NFS or TCP, according to where this Value is persisted. @return Short String of the persitance name
[ "One", "of", "ICE", "HDFS", "S3", "GCS", "NFS", "or", "TCP", "according", "to", "where", "this", "Value", "is", "persisted", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Value.java#L250-L260
131,221
h2oai/h2o-3
h2o-core/src/main/java/water/Value.java
Value.replicas
private byte[] replicas( ) { byte[] r = _replicas; if( r != null ) return r; byte[] nr = new byte[H2O.CLOUD.size()+1/*1-based numbering*/+10/*limit of 10 clients*/]; if( REPLICAS_UPDATER.compareAndSet(this,null,nr) ) return nr; r = _replicas/*read again, since CAS failed must be set now*/; asser...
java
private byte[] replicas( ) { byte[] r = _replicas; if( r != null ) return r; byte[] nr = new byte[H2O.CLOUD.size()+1/*1-based numbering*/+10/*limit of 10 clients*/]; if( REPLICAS_UPDATER.compareAndSet(this,null,nr) ) return nr; r = _replicas/*read again, since CAS failed must be set now*/; asser...
[ "private", "byte", "[", "]", "replicas", "(", ")", "{", "byte", "[", "]", "r", "=", "_replicas", ";", "if", "(", "r", "!=", "null", ")", "return", "r", ";", "byte", "[", "]", "nr", "=", "new", "byte", "[", "H2O", ".", "CLOUD", ".", "size", "(...
Fills in the _replicas field atomically, on first set of a replica.
[ "Fills", "in", "the", "_replicas", "field", "atomically", "on", "first", "set", "of", "a", "replica", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Value.java#L457-L465
131,222
h2oai/h2o-3
h2o-core/src/main/java/water/Value.java
Value.read_lock
boolean read_lock() { while( true ) { // Repeat, in case racing GETs are bumping the counter int old = _rwlock.get(); if( old == -1 ) return false; // Write-locked; no new replications. Read fails to read *this* value assert old >= 0; // Not negative if( RW_CAS(old,old+1,"r...
java
boolean read_lock() { while( true ) { // Repeat, in case racing GETs are bumping the counter int old = _rwlock.get(); if( old == -1 ) return false; // Write-locked; no new replications. Read fails to read *this* value assert old >= 0; // Not negative if( RW_CAS(old,old+1,"r...
[ "boolean", "read_lock", "(", ")", "{", "while", "(", "true", ")", "{", "// Repeat, in case racing GETs are bumping the counter", "int", "old", "=", "_rwlock", ".", "get", "(", ")", ";", "if", "(", "old", "==", "-", "1", ")", "return", "false", ";", "// Wri...
Bump the read lock, once per pending-GET or pending-Invalidate
[ "Bump", "the", "read", "lock", "once", "per", "pending", "-", "GET", "or", "pending", "-", "Invalidate" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Value.java#L468-L475
131,223
h2oai/h2o-3
h2o-core/src/main/java/water/Value.java
Value.STORE_get
public static Value STORE_get( Key key ) { Value val = H2O.STORE.get(key); if( val == null ) return null; // A true null if( !val.isNull() ) return val; // Not a special Null // One-shot throwaway attempt at upgrading the special Null to a true null if( val._rwlock.get()==0 ) H2O.putIfMatch(key,null...
java
public static Value STORE_get( Key key ) { Value val = H2O.STORE.get(key); if( val == null ) return null; // A true null if( !val.isNull() ) return val; // Not a special Null // One-shot throwaway attempt at upgrading the special Null to a true null if( val._rwlock.get()==0 ) H2O.putIfMatch(key,null...
[ "public", "static", "Value", "STORE_get", "(", "Key", "key", ")", "{", "Value", "val", "=", "H2O", ".", "STORE", ".", "get", "(", "key", ")", ";", "if", "(", "val", "==", "null", ")", "return", "null", ";", "// A true null", "if", "(", "!", "val", ...
Return the not-Null value, or the true null.
[ "Return", "the", "not", "-", "Null", "value", "or", "the", "true", "null", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Value.java#L602-L609
131,224
h2oai/h2o-3
h2o-core/src/main/java/water/Value.java
Value.isReleasable
@Override public boolean isReleasable() { int r = _rwlock.get(); if( _key.home() ) { // Called from lock_and_invalidate // Home-key blocking: wait for active-GET count to fall to zero, or blocking on deleted object return r <= 0; } else { // Called from start_put ...
java
@Override public boolean isReleasable() { int r = _rwlock.get(); if( _key.home() ) { // Called from lock_and_invalidate // Home-key blocking: wait for active-GET count to fall to zero, or blocking on deleted object return r <= 0; } else { // Called from start_put ...
[ "@", "Override", "public", "boolean", "isReleasable", "(", ")", "{", "int", "r", "=", "_rwlock", ".", "get", "(", ")", ";", "if", "(", "_key", ".", "home", "(", ")", ")", "{", "// Called from lock_and_invalidate", "// Home-key blocking: wait for active-GET count...
Return true if blocking is unnecessary. Alas, used in TWO places and the blocking API forces them to share here.
[ "Return", "true", "if", "blocking", "is", "unnecessary", ".", "Alas", "used", "in", "TWO", "places", "and", "the", "blocking", "API", "forces", "them", "to", "share", "here", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Value.java#L614-L624
131,225
h2oai/h2o-3
h2o-core/src/main/java/hex/ModelMetricsRegression.java
ModelMetricsRegression.make
static public ModelMetricsRegression make(Vec predicted, Vec actual, DistributionFamily family) { if (predicted == null || actual == null) throw new IllegalArgumentException("Missing actual or predicted targets for regression metrics!"); if (!predicted.isNumeric()) throw new IllegalArgumentException...
java
static public ModelMetricsRegression make(Vec predicted, Vec actual, DistributionFamily family) { if (predicted == null || actual == null) throw new IllegalArgumentException("Missing actual or predicted targets for regression metrics!"); if (!predicted.isNumeric()) throw new IllegalArgumentException...
[ "static", "public", "ModelMetricsRegression", "make", "(", "Vec", "predicted", ",", "Vec", "actual", ",", "DistributionFamily", "family", ")", "{", "if", "(", "predicted", "==", "null", "||", "actual", "==", "null", ")", "throw", "new", "IllegalArgumentException...
Build a Regression ModelMetrics object from predicted and actual targets @param predicted A Vec containing predicted values @param actual A Vec containing the actual target values @return ModelMetrics object
[ "Build", "a", "Regression", "ModelMetrics", "object", "from", "predicted", "and", "actual", "targets" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/ModelMetricsRegression.java#L56-L71
131,226
h2oai/h2o-3
h2o-algos/src/main/java/hex/deeplearning/Storage.java
Storage.toFrame
static Frame toFrame(Vector v, Key key) { final int log_rows_per_chunk = Math.max(1, FileVec.DFLT_LOG2_CHUNK_SIZE - (int) Math.floor(Math.log(1) / Math.log(2.))); Vec vv = makeCon(0, v.size(), log_rows_per_chunk, false /* no rebalancing! */); Frame f = new Frame(key, new Vec[]{vv}, true); try( Vec.Write...
java
static Frame toFrame(Vector v, Key key) { final int log_rows_per_chunk = Math.max(1, FileVec.DFLT_LOG2_CHUNK_SIZE - (int) Math.floor(Math.log(1) / Math.log(2.))); Vec vv = makeCon(0, v.size(), log_rows_per_chunk, false /* no rebalancing! */); Frame f = new Frame(key, new Vec[]{vv}, true); try( Vec.Write...
[ "static", "Frame", "toFrame", "(", "Vector", "v", ",", "Key", "key", ")", "{", "final", "int", "log_rows_per_chunk", "=", "Math", ".", "max", "(", "1", ",", "FileVec", ".", "DFLT_LOG2_CHUNK_SIZE", "-", "(", "int", ")", "Math", ".", "floor", "(", "Math"...
Helper to convert a Vector into a Frame @param v Vector @param key Key for output Frame @return Reference to Frame (which is also in DKV)
[ "Helper", "to", "convert", "a", "Vector", "into", "a", "Frame" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/deeplearning/Storage.java#L233-L243
131,227
h2oai/h2o-3
h2o-core/src/main/java/water/ExternalFrameReaderClient.java
ExternalFrameReaderClient.waitUntilAllReceived
public void waitUntilAllReceived(int timeout) throws ExternalFrameConfirmationException { try { byte flag = ExternalFrameConfirmationCheck.getConfirmation(ab, timeout); assert (flag == ExternalFrameHandler.CONFIRM_READING_DONE); } catch (TimeoutException ex) { throw n...
java
public void waitUntilAllReceived(int timeout) throws ExternalFrameConfirmationException { try { byte flag = ExternalFrameConfirmationCheck.getConfirmation(ab, timeout); assert (flag == ExternalFrameHandler.CONFIRM_READING_DONE); } catch (TimeoutException ex) { throw n...
[ "public", "void", "waitUntilAllReceived", "(", "int", "timeout", ")", "throws", "ExternalFrameConfirmationException", "{", "try", "{", "byte", "flag", "=", "ExternalFrameConfirmationCheck", ".", "getConfirmation", "(", "ab", ",", "timeout", ")", ";", "assert", "(", ...
This method ensures the application waits for all bytes to be received before continuing in the application's control flow. It has to be called at the end of reading. @param timeout timeout in seconds @throws ExternalFrameConfirmationException
[ "This", "method", "ensures", "the", "application", "waits", "for", "all", "bytes", "to", "be", "received", "before", "continuing", "in", "the", "application", "s", "control", "flow", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExternalFrameReaderClient.java#L169-L180
131,228
h2oai/h2o-3
h2o-core/src/main/java/water/api/MetadataHandler.java
MetadataHandler.listRoutes
@SuppressWarnings("unused") // called through reflection by RequestServer public MetadataV3 listRoutes(int version, MetadataV3 docs) { MarkdownBuilder builder = new MarkdownBuilder(); builder.comment("Preview with http://jbt.github.io/markdown-editor"); builder.heading1("REST API Routes Table of Contents"...
java
@SuppressWarnings("unused") // called through reflection by RequestServer public MetadataV3 listRoutes(int version, MetadataV3 docs) { MarkdownBuilder builder = new MarkdownBuilder(); builder.comment("Preview with http://jbt.github.io/markdown-editor"); builder.heading1("REST API Routes Table of Contents"...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "// called through reflection by RequestServer", "public", "MetadataV3", "listRoutes", "(", "int", "version", ",", "MetadataV3", "docs", ")", "{", "MarkdownBuilder", "builder", "=", "new", "MarkdownBuilder", "(", ")", "...
Return a list of all REST API Routes and a Markdown Table of Contents.
[ "Return", "a", "list", "of", "all", "REST", "API", "Routes", "and", "a", "Markdown", "Table", "of", "Contents", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/MetadataHandler.java#L25-L62
131,229
h2oai/h2o-3
h2o-core/src/main/java/water/api/MetadataHandler.java
MetadataHandler.fetchRoute
public MetadataV3 fetchRoute(int version, MetadataV3 docs) { Route route = null; if (docs.path != null && docs.http_method != null) { try { route = RequestServer.lookupRoute(new RequestUri(docs.http_method, docs.path)); } catch (MalformedURLException e) { route = null; } } ...
java
public MetadataV3 fetchRoute(int version, MetadataV3 docs) { Route route = null; if (docs.path != null && docs.http_method != null) { try { route = RequestServer.lookupRoute(new RequestUri(docs.http_method, docs.path)); } catch (MalformedURLException e) { route = null; } } ...
[ "public", "MetadataV3", "fetchRoute", "(", "int", "version", ",", "MetadataV3", "docs", ")", "{", "Route", "route", "=", "null", ";", "if", "(", "docs", ".", "path", "!=", "null", "&&", "docs", ".", "http_method", "!=", "null", ")", "{", "try", "{", ...
Also called through reflection by RequestServer
[ "Also", "called", "through", "reflection", "by", "RequestServer" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/MetadataHandler.java#L79-L130
131,230
h2oai/h2o-3
h2o-core/src/main/java/water/api/MetadataHandler.java
MetadataHandler.listSchemas
@SuppressWarnings("unused") // called through reflection by RequestServer public MetadataV3 listSchemas(int version, MetadataV3 docs) { Map<String, Class<? extends Schema>> ss = SchemaServer.schemas(); docs.schemas = new SchemaMetadataV3[ss.size()]; // NOTE: this will throw an exception if the classname ...
java
@SuppressWarnings("unused") // called through reflection by RequestServer public MetadataV3 listSchemas(int version, MetadataV3 docs) { Map<String, Class<? extends Schema>> ss = SchemaServer.schemas(); docs.schemas = new SchemaMetadataV3[ss.size()]; // NOTE: this will throw an exception if the classname ...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "// called through reflection by RequestServer", "public", "MetadataV3", "listSchemas", "(", "int", "version", ",", "MetadataV3", "docs", ")", "{", "Map", "<", "String", ",", "Class", "<", "?", "extends", "Schema", ...
Fetch the metadata for all the Schemas.
[ "Fetch", "the", "metadata", "for", "all", "the", "Schemas", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/MetadataHandler.java#L168-L191
131,231
h2oai/h2o-3
h2o-core/src/main/java/water/api/GridsHandler.java
GridsHandler.list
@SuppressWarnings("unused") // called through reflection by RequestServer public GridsV99 list(int version, GridsV99 s) { final Key[] gridKeys = KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() { @Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k...
java
@SuppressWarnings("unused") // called through reflection by RequestServer public GridsV99 list(int version, GridsV99 s) { final Key[] gridKeys = KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() { @Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "// called through reflection by RequestServer", "public", "GridsV99", "list", "(", "int", "version", ",", "GridsV99", "s", ")", "{", "final", "Key", "[", "]", "gridKeys", "=", "KeySnapshot", ".", "globalSnapshot", ...
Return all the grids.
[ "Return", "all", "the", "grids", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/GridsHandler.java#L18-L34
131,232
h2oai/h2o-3
h2o-core/src/main/java/water/api/GridsHandler.java
GridsHandler.fetch
@SuppressWarnings("unused") // called through reflection by RequestServer public GridSchemaV99 fetch(int version, GridSchemaV99 s) { return s.fillFromImpl(getFromDKV("grid_id", s.grid_id.key(), Grid.class)); }
java
@SuppressWarnings("unused") // called through reflection by RequestServer public GridSchemaV99 fetch(int version, GridSchemaV99 s) { return s.fillFromImpl(getFromDKV("grid_id", s.grid_id.key(), Grid.class)); }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "// called through reflection by RequestServer", "public", "GridSchemaV99", "fetch", "(", "int", "version", ",", "GridSchemaV99", "s", ")", "{", "return", "s", ".", "fillFromImpl", "(", "getFromDKV", "(", "\"grid_id\"",...
Return a specified grid.
[ "Return", "a", "specified", "grid", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/GridsHandler.java#L39-L42
131,233
h2oai/h2o-3
h2o-extensions/xgboost/src/main/java/ml/dmlc/xgboost4j/java/XGBoostRegTree.java
XGBoostRegTree.getLeafValue
@Override public final float getLeafValue(FVec feat, int root_id) { int pid = root_id; int pos = pid * NODE_SIZE + 4; int cleft_ = UnsafeUtils.get4(_nodes, pos); while (cleft_ != -1) { final int sindex_ = UnsafeUtils.get4(_nodes, pos + 8); final float fvalue = feat.fvalue((int) (sindex_ ...
java
@Override public final float getLeafValue(FVec feat, int root_id) { int pid = root_id; int pos = pid * NODE_SIZE + 4; int cleft_ = UnsafeUtils.get4(_nodes, pos); while (cleft_ != -1) { final int sindex_ = UnsafeUtils.get4(_nodes, pos + 8); final float fvalue = feat.fvalue((int) (sindex_ ...
[ "@", "Override", "public", "final", "float", "getLeafValue", "(", "FVec", "feat", ",", "int", "root_id", ")", "{", "int", "pid", "=", "root_id", ";", "int", "pos", "=", "pid", "*", "NODE_SIZE", "+", "4", ";", "int", "cleft_", "=", "UnsafeUtils", ".", ...
Retrieves nodes from root to leaf and returns leaf value. @param feat feature vector @param root_id starting root index @return leaf value
[ "Retrieves", "nodes", "from", "root", "to", "leaf", "and", "returns", "leaf", "value", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-extensions/xgboost/src/main/java/ml/dmlc/xgboost4j/java/XGBoostRegTree.java#L53-L74
131,234
h2oai/h2o-3
h2o-core/src/main/java/water/rapids/SingleThreadRadixOrder.java
SingleThreadRadixOrder.runCopy
private static void runCopy(final long start, final long len, final int keySize, final int batchSize, final long otmp[][], final byte xtmp[][], final long o[][], final byte x[][]) { // now copy _otmp and _xtmp back over _o and _x from the start position, allowing for boundaries // _o, _x, _otmp and _xtmp all ha...
java
private static void runCopy(final long start, final long len, final int keySize, final int batchSize, final long otmp[][], final byte xtmp[][], final long o[][], final byte x[][]) { // now copy _otmp and _xtmp back over _o and _x from the start position, allowing for boundaries // _o, _x, _otmp and _xtmp all ha...
[ "private", "static", "void", "runCopy", "(", "final", "long", "start", ",", "final", "long", "len", ",", "final", "int", "keySize", ",", "final", "int", "batchSize", ",", "final", "long", "otmp", "[", "]", "[", "]", ",", "final", "byte", "xtmp", "[", ...
Hot loop, pulled out from the main run code
[ "Hot", "loop", "pulled", "out", "from", "the", "main", "run", "code" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/SingleThreadRadixOrder.java#L369-L390
131,235
h2oai/h2o-3
h2o-core/src/main/java/water/MRTask.java
MRTask.closeFrame
private Frame closeFrame(Key key, String[] names, String[][] domains, Futures fs) { if( _output_types == null ) return null; final int noutputs = _output_types.length; Vec[] vecs = new Vec[noutputs]; if( _appendables==null || _appendables.length == 0) // Zero rows? for( int i = 0; i < noutputs; i...
java
private Frame closeFrame(Key key, String[] names, String[][] domains, Futures fs) { if( _output_types == null ) return null; final int noutputs = _output_types.length; Vec[] vecs = new Vec[noutputs]; if( _appendables==null || _appendables.length == 0) // Zero rows? for( int i = 0; i < noutputs; i...
[ "private", "Frame", "closeFrame", "(", "Key", "key", ",", "String", "[", "]", "names", ",", "String", "[", "]", "[", "]", "domains", ",", "Futures", "fs", ")", "{", "if", "(", "_output_types", "==", "null", ")", "return", "null", ";", "final", "int",...
the work-horse for the outputFrame calls
[ "the", "work", "-", "horse", "for", "the", "outputFrame", "calls" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/MRTask.java#L227-L242
131,236
h2oai/h2o-3
h2o-jetty-8/src/main/java/water/webserver/jetty8/Jetty8Helper.java
Jetty8Helper.configureConnector
private void configureConnector(String proto, Connector connector) { connector.setRequestHeaderSize(getSysPropInt(proto+".requestHeaderSize", 32*1024)); connector.setRequestBufferSize(getSysPropInt(proto+".requestBufferSize", 32*1024)); connector.setResponseHeaderSize(getSysPropInt(proto+".responseHeaderSiz...
java
private void configureConnector(String proto, Connector connector) { connector.setRequestHeaderSize(getSysPropInt(proto+".requestHeaderSize", 32*1024)); connector.setRequestBufferSize(getSysPropInt(proto+".requestBufferSize", 32*1024)); connector.setResponseHeaderSize(getSysPropInt(proto+".responseHeaderSiz...
[ "private", "void", "configureConnector", "(", "String", "proto", ",", "Connector", "connector", ")", "{", "connector", ".", "setRequestHeaderSize", "(", "getSysPropInt", "(", "proto", "+", "\".requestHeaderSize\"", ",", "32", "*", "1024", ")", ")", ";", "connect...
see PUBDEV-5939 for details
[ "see", "PUBDEV", "-", "5939", "for", "details" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-jetty-8/src/main/java/water/webserver/jetty8/Jetty8Helper.java#L78-L83
131,237
h2oai/h2o-3
h2o-core/src/main/java/water/api/RequestServer.java
RequestServer.numRoutes
public static int numRoutes(int version) { int count = 0; for (Route route : routesList) if (route.getVersion() == version) count++; return count; }
java
public static int numRoutes(int version) { int count = 0; for (Route route : routesList) if (route.getVersion() == version) count++; return count; }
[ "public", "static", "int", "numRoutes", "(", "int", "version", ")", "{", "int", "count", "=", "0", ";", "for", "(", "Route", "route", ":", "routesList", ")", "if", "(", "route", ".", "getVersion", "(", ")", "==", "version", ")", "count", "++", ";", ...
Calculates number of routes having the specified version.
[ "Calculates", "number", "of", "routes", "having", "the", "specified", "version", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/RequestServer.java#L164-L170
131,238
h2oai/h2o-3
h2o-core/src/main/java/water/api/RequestServer.java
RequestServer.registerEndpoint
public static Route registerEndpoint(String method_uri, Class<? extends RestApiHandler> handler_clz) { try { RestApiHandler handler = handler_clz.newInstance(); return registerEndpoint(handler.name(), method_uri, handler_clz, null, handler.help()); } catch (Exception e) { throw H2O.fail(e.getM...
java
public static Route registerEndpoint(String method_uri, Class<? extends RestApiHandler> handler_clz) { try { RestApiHandler handler = handler_clz.newInstance(); return registerEndpoint(handler.name(), method_uri, handler_clz, null, handler.help()); } catch (Exception e) { throw H2O.fail(e.getM...
[ "public", "static", "Route", "registerEndpoint", "(", "String", "method_uri", ",", "Class", "<", "?", "extends", "RestApiHandler", ">", "handler_clz", ")", "{", "try", "{", "RestApiHandler", "handler", "=", "handler_clz", ".", "newInstance", "(", ")", ";", "re...
Register an HTTP request handler for the given URL pattern. @param method_uri combined method/url pattern of the endpoint, for example: {@code "GET /3/Jobs/{job_id}"} @param handler_clz class of the handler (should inherit from {@link RestApiHandler}).
[ "Register", "an", "HTTP", "request", "handler", "for", "the", "given", "URL", "pattern", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/RequestServer.java#L238-L245
131,239
h2oai/h2o-3
h2o-core/src/main/java/water/api/RequestServer.java
RequestServer.defaultFilter
public static HttpLogFilter defaultFilter() { return new HttpLogFilter() { // this is much prettier with 1.8 lambdas @Override public LogFilterLevel filter(RequestUri uri, Properties header, Properties parms) { // static web content String url = uri.getUrl(); if (url.endsWith(".css") |...
java
public static HttpLogFilter defaultFilter() { return new HttpLogFilter() { // this is much prettier with 1.8 lambdas @Override public LogFilterLevel filter(RequestUri uri, Properties header, Properties parms) { // static web content String url = uri.getUrl(); if (url.endsWith(".css") |...
[ "public", "static", "HttpLogFilter", "defaultFilter", "(", ")", "{", "return", "new", "HttpLogFilter", "(", ")", "{", "// this is much prettier with 1.8 lambdas", "@", "Override", "public", "LogFilterLevel", "filter", "(", "RequestUri", "uri", ",", "Properties", "head...
Provide the default filters for H2O's HTTP logging. @return an array of HttpLogFilter instances
[ "Provide", "the", "default", "filters", "for", "H2O", "s", "HTTP", "logging", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/RequestServer.java#L579-L612
131,240
h2oai/h2o-3
h2o-core/src/main/java/water/api/RequestServer.java
RequestServer.maybeServeSpecial
private static NanoResponse maybeServeSpecial(RequestUri uri) { assert uri != null; if (uri.isHeadMethod()) { // Blank response used by R's uri.exists("/") if (uri.getUrl().equals("/")) return new NanoResponse(HTTP_OK, MIME_PLAINTEXT, ""); } if (uri.isGetMethod()) { // url "/3...
java
private static NanoResponse maybeServeSpecial(RequestUri uri) { assert uri != null; if (uri.isHeadMethod()) { // Blank response used by R's uri.exists("/") if (uri.getUrl().equals("/")) return new NanoResponse(HTTP_OK, MIME_PLAINTEXT, ""); } if (uri.isGetMethod()) { // url "/3...
[ "private", "static", "NanoResponse", "maybeServeSpecial", "(", "RequestUri", "uri", ")", "{", "assert", "uri", "!=", "null", ";", "if", "(", "uri", ".", "isHeadMethod", "(", ")", ")", "{", "// Blank response used by R's uri.exists(\"/\")", "if", "(", "uri", ".",...
Handle any URLs that bypass the standard route approach. This is stuff that has abnormal non-JSON response payloads. @param uri RequestUri object of the incoming request. @return Response object, or null if the request does not require any special handling.
[ "Handle", "any", "URLs", "that", "bypass", "the", "standard", "route", "approach", ".", "This", "is", "stuff", "that", "has", "abnormal", "non", "-", "JSON", "response", "payloads", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/RequestServer.java#L723-L739
131,241
h2oai/h2o-3
h2o-core/src/main/java/water/api/RequestServer.java
RequestServer.getResource
private static NanoResponse getResource(RequestType request_type, String url) { byte[] bytes = _cache.get(url); if (bytes == null) { // Try-with-resource try (InputStream resource = water.init.JarHash.getResource2(url)) { if( resource != null ) { try { bytes = toByteArray(resource)...
java
private static NanoResponse getResource(RequestType request_type, String url) { byte[] bytes = _cache.get(url); if (bytes == null) { // Try-with-resource try (InputStream resource = water.init.JarHash.getResource2(url)) { if( resource != null ) { try { bytes = toByteArray(resource)...
[ "private", "static", "NanoResponse", "getResource", "(", "RequestType", "request_type", ",", "String", "url", ")", "{", "byte", "[", "]", "bytes", "=", "_cache", ".", "get", "(", "url", ")", ";", "if", "(", "bytes", "==", "null", ")", "{", "// Try-with-r...
Returns the response containing the given uri with the appropriate mime type.
[ "Returns", "the", "response", "containing", "the", "given", "uri", "with", "the", "appropriate", "mime", "type", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/RequestServer.java#L933-L974
131,242
h2oai/h2o-3
h2o-parsers/h2o-orc-parser/src/main/java/water/parser/orc/OrcParserProvider.java
OrcParserProvider.createParserSetup
@Override public ParseSetup createParserSetup(Key[] inputs, ParseSetup requiredSetup) { FileVec f; Object frameOrVec = DKV.getGet(inputs[0]); if (frameOrVec instanceof water.fvec.Frame) f = (FileVec) ((Frame) frameOrVec).vec(0); else f = (FileVec) frameOrVec; return readSetup(f, requ...
java
@Override public ParseSetup createParserSetup(Key[] inputs, ParseSetup requiredSetup) { FileVec f; Object frameOrVec = DKV.getGet(inputs[0]); if (frameOrVec instanceof water.fvec.Frame) f = (FileVec) ((Frame) frameOrVec).vec(0); else f = (FileVec) frameOrVec; return readSetup(f, requ...
[ "@", "Override", "public", "ParseSetup", "createParserSetup", "(", "Key", "[", "]", "inputs", ",", "ParseSetup", "requiredSetup", ")", "{", "FileVec", "f", ";", "Object", "frameOrVec", "=", "DKV", ".", "getGet", "(", "inputs", "[", "0", "]", ")", ";", "i...
Use only the first file to setup everything. @param inputs input keys @param requiredSetup user given parser setup @return
[ "Use", "only", "the", "first", "file", "to", "setup", "everything", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-parsers/h2o-orc-parser/src/main/java/water/parser/orc/OrcParserProvider.java#L68-L79
131,243
h2oai/h2o-3
h2o-parsers/h2o-orc-parser/src/main/java/water/parser/orc/OrcParserProvider.java
OrcParserProvider.readSetup
public ParseSetup readSetup(FileVec f, String[] columnNames, byte[] columnTypes) { try { Reader orcFileReader = getReader(f); StructObjectInspector insp = (StructObjectInspector) orcFileReader.getObjectInspector(); OrcParser.OrcParseSetup stp = OrcParser.deriveParseSetup(orcFileReader, insp); ...
java
public ParseSetup readSetup(FileVec f, String[] columnNames, byte[] columnTypes) { try { Reader orcFileReader = getReader(f); StructObjectInspector insp = (StructObjectInspector) orcFileReader.getObjectInspector(); OrcParser.OrcParseSetup stp = OrcParser.deriveParseSetup(orcFileReader, insp); ...
[ "public", "ParseSetup", "readSetup", "(", "FileVec", "f", ",", "String", "[", "]", "columnNames", ",", "byte", "[", "]", "columnTypes", ")", "{", "try", "{", "Reader", "orcFileReader", "=", "getReader", "(", "f", ")", ";", "StructObjectInspector", "insp", ...
This method will create the readers and others info needed to parse an orc file. In addition, it will not over-ride the columnNames, columnTypes that the user may want to force upon it. However, we only allow users to set column types to enum at this point and ignore all the other requests. @param f @param columnName...
[ "This", "method", "will", "create", "the", "readers", "and", "others", "info", "needed", "to", "parse", "an", "orc", "file", ".", "In", "addition", "it", "will", "not", "over", "-", "ride", "the", "columnNames", "columnTypes", "that", "the", "user", "may",...
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-parsers/h2o-orc-parser/src/main/java/water/parser/orc/OrcParserProvider.java#L112-L155
131,244
h2oai/h2o-3
h2o-genmodel/src/main/java/hex/genmodel/easy/prediction/SortedClassProbability.java
SortedClassProbability.compareTo
@Override public int compareTo(Object o) { SortedClassProbability other = (SortedClassProbability) o; if (this.probability < other.probability) { return -1; } else if (this.probability > other.probability) { return 1; } else { return 0; } }
java
@Override public int compareTo(Object o) { SortedClassProbability other = (SortedClassProbability) o; if (this.probability < other.probability) { return -1; } else if (this.probability > other.probability) { return 1; } else { return 0; } }
[ "@", "Override", "public", "int", "compareTo", "(", "Object", "o", ")", "{", "SortedClassProbability", "other", "=", "(", "SortedClassProbability", ")", "o", ";", "if", "(", "this", ".", "probability", "<", "other", ".", "probability", ")", "{", "return", ...
Comparison implementation for this object type. @param o The other object to compare to. @return -1, 0, 1 if this object is less than, equal, or greather than the other object.
[ "Comparison", "implementation", "for", "this", "object", "type", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/easy/prediction/SortedClassProbability.java#L25-L37
131,245
h2oai/h2o-3
h2o-core/src/main/java/water/api/ParseHandler.java
ParseHandler.parse
@SuppressWarnings("unused") // called through reflection by RequestServer public ParseV3 parse(int version, ParseV3 parse) { ParserInfo parserInfo = ParserService.INSTANCE.getByName(parse.parse_type).info(); ParseSetup setup = new ParseSetup(parserInfo, parse.separator, p...
java
@SuppressWarnings("unused") // called through reflection by RequestServer public ParseV3 parse(int version, ParseV3 parse) { ParserInfo parserInfo = ParserService.INSTANCE.getByName(parse.parse_type).info(); ParseSetup setup = new ParseSetup(parserInfo, parse.separator, p...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "// called through reflection by RequestServer", "public", "ParseV3", "parse", "(", "int", "version", ",", "ParseV3", "parse", ")", "{", "ParserInfo", "parserInfo", "=", "ParserService", ".", "INSTANCE", ".", "getByName...
Entry point for parsing.
[ "Entry", "point", "for", "parsing", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/ParseHandler.java#L14-L52
131,246
h2oai/h2o-3
h2o-core/src/main/java/water/Job.java
Job.jobs
public static Job[] jobs() { final Value val = DKV.get(LIST); if( val==null ) return new Job[0]; JobList jl = val.get(); Job[] jobs = new Job[jl._jobs.length]; int j=0; for( int i=0; i<jl._jobs.length; i++ ) { final Value job = DKV.get(jl._jobs[i]); if( job != null ) jobs[j++] = job....
java
public static Job[] jobs() { final Value val = DKV.get(LIST); if( val==null ) return new Job[0]; JobList jl = val.get(); Job[] jobs = new Job[jl._jobs.length]; int j=0; for( int i=0; i<jl._jobs.length; i++ ) { final Value job = DKV.get(jl._jobs[i]); if( job != null ) jobs[j++] = job....
[ "public", "static", "Job", "[", "]", "jobs", "(", ")", "{", "final", "Value", "val", "=", "DKV", ".", "get", "(", "LIST", ")", ";", "if", "(", "val", "==", "null", ")", "return", "new", "Job", "[", "0", "]", ";", "JobList", "jl", "=", "val", ...
The list of all Jobs, past and present. @return The list of all Jobs, past and present
[ "The", "list", "of", "all", "Jobs", "past", "and", "present", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Job.java#L187-L204
131,247
h2oai/h2o-3
h2o-core/src/main/java/water/Job.java
Job.get
public T get() { Barrier2 bar = _barrier; if( bar != null ) // Barrier may be null if task already completed bar.join(); // Block on the *barrier* task, which blocks until the fjtask on*Completion code runs completely assert isStopped(); if (_ex!=null) throw new RuntimeException((T...
java
public T get() { Barrier2 bar = _barrier; if( bar != null ) // Barrier may be null if task already completed bar.join(); // Block on the *barrier* task, which blocks until the fjtask on*Completion code runs completely assert isStopped(); if (_ex!=null) throw new RuntimeException((T...
[ "public", "T", "get", "(", ")", "{", "Barrier2", "bar", "=", "_barrier", ";", "if", "(", "bar", "!=", "null", ")", "// Barrier may be null if task already completed", "bar", ".", "join", "(", ")", ";", "// Block on the *barrier* task, which blocks until the fjtask on*...
Blocks until the Job completes
[ "Blocks", "until", "the", "Job", "completes" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Job.java#L368-L377
131,248
h2oai/h2o-3
h2o-core/src/main/java/water/util/RString.java
RString.isIdentChar
static private boolean isIdentChar(char x) { return (x == '$') || ((x >= 'a') && (x <= 'z')) || ((x >= 'A') && (x <= 'Z')) || ((x >= '0') && (x <= '9')) || (x == '_'); }
java
static private boolean isIdentChar(char x) { return (x == '$') || ((x >= 'a') && (x <= 'z')) || ((x >= 'A') && (x <= 'Z')) || ((x >= '0') && (x <= '9')) || (x == '_'); }
[ "static", "private", "boolean", "isIdentChar", "(", "char", "x", ")", "{", "return", "(", "x", "==", "'", "'", ")", "||", "(", "(", "x", ">=", "'", "'", ")", "&&", "(", "x", "<=", "'", "'", ")", ")", "||", "(", "(", "x", ">=", "'", "'", "...
Passes only valid placeholder name characters
[ "Passes", "only", "valid", "placeholder", "name", "characters" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/RString.java#L51-L53
131,249
h2oai/h2o-3
h2o-core/src/main/java/water/rapids/ast/prims/advmath/AstTable.java
AstTable.fast_table
private ValFrame fast_table(Vec v1, int ncols, String colname) { if (ncols != 1 || !v1.isInt()) return null; long spanl = (long) v1.max() - (long) v1.min() + 1; if (spanl > 1000000) return null; // Cap at decent array size, for performance // First fast-pass counting AstTable.FastCnt fastCnt = new ...
java
private ValFrame fast_table(Vec v1, int ncols, String colname) { if (ncols != 1 || !v1.isInt()) return null; long spanl = (long) v1.max() - (long) v1.min() + 1; if (spanl > 1000000) return null; // Cap at decent array size, for performance // First fast-pass counting AstTable.FastCnt fastCnt = new ...
[ "private", "ValFrame", "fast_table", "(", "Vec", "v1", ",", "int", "ncols", ",", "String", "colname", ")", "{", "if", "(", "ncols", "!=", "1", "||", "!", "v1", ".", "isInt", "(", ")", ")", "return", "null", ";", "long", "spanl", "=", "(", "long", ...
Fast-path for 1 integer column
[ "Fast", "-", "path", "for", "1", "integer", "column" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/ast/prims/advmath/AstTable.java#L70-L98
131,250
h2oai/h2o-3
h2o-algos/src/main/java/hex/tree/CompressedForest.java
CompressedForest.fetch
public final LocalCompressedForest fetch() { int ntrees = _treeKeys.length; CompressedTree[][] trees = new CompressedTree[ntrees][]; for (int t = 0; t < ntrees; t++) { Key[] treek = _treeKeys[t]; trees[t] = new CompressedTree[treek.length]; for (int i = 0; i < treek.length; i++) if...
java
public final LocalCompressedForest fetch() { int ntrees = _treeKeys.length; CompressedTree[][] trees = new CompressedTree[ntrees][]; for (int t = 0; t < ntrees; t++) { Key[] treek = _treeKeys[t]; trees[t] = new CompressedTree[treek.length]; for (int i = 0; i < treek.length; i++) if...
[ "public", "final", "LocalCompressedForest", "fetch", "(", ")", "{", "int", "ntrees", "=", "_treeKeys", ".", "length", ";", "CompressedTree", "[", "]", "[", "]", "trees", "=", "new", "CompressedTree", "[", "ntrees", "]", "[", "", "]", ";", "for", "(", "...
Fetches trees from DKV and converts to a node-local structure. @return fetched trees
[ "Fetches", "trees", "from", "DKV", "and", "converts", "to", "a", "node", "-", "local", "structure", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/tree/CompressedForest.java#L30-L41
131,251
h2oai/h2o-3
h2o-core/src/main/java/water/api/Schema.java
Schema.extractVersionFromSchemaName
public static int extractVersionFromSchemaName(String clz_name) { int idx = clz_name.lastIndexOf('V'); if (idx == -1) return -1; try { return Integer.valueOf(clz_name.substring(idx+1)); } catch( NumberFormatException ex) { return -1; } }
java
public static int extractVersionFromSchemaName(String clz_name) { int idx = clz_name.lastIndexOf('V'); if (idx == -1) return -1; try { return Integer.valueOf(clz_name.substring(idx+1)); } catch( NumberFormatException ex) { return -1; } }
[ "public", "static", "int", "extractVersionFromSchemaName", "(", "String", "clz_name", ")", "{", "int", "idx", "=", "clz_name", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "idx", "==", "-", "1", ")", "return", "-", "1", ";", "try", "{", "r...
Extract the version number from the schema class name. Returns -1 if there's no version number at the end of the classname.
[ "Extract", "the", "version", "number", "from", "the", "schema", "class", "name", ".", "Returns", "-", "1", "if", "there", "s", "no", "version", "number", "at", "the", "end", "of", "the", "classname", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/Schema.java#L130-L135
131,252
h2oai/h2o-3
h2o-core/src/main/java/water/api/Schema.java
Schema.getImplClass
public static Class<? extends Iced> getImplClass(Class<? extends Schema> clz) { Class<? extends Iced> impl_class = ReflectionUtils.findActualClassParameter(clz, 0); if (null == impl_class) Log.warn("Failed to find an impl class for Schema: " + clz); return impl_class; }
java
public static Class<? extends Iced> getImplClass(Class<? extends Schema> clz) { Class<? extends Iced> impl_class = ReflectionUtils.findActualClassParameter(clz, 0); if (null == impl_class) Log.warn("Failed to find an impl class for Schema: " + clz); return impl_class; }
[ "public", "static", "Class", "<", "?", "extends", "Iced", ">", "getImplClass", "(", "Class", "<", "?", "extends", "Schema", ">", "clz", ")", "{", "Class", "<", "?", "extends", "Iced", ">", "impl_class", "=", "ReflectionUtils", ".", "findActualClassParameter"...
Return the class of the implementation type parameter I for the given Schema class. Used by the metadata facilities and the reflection-base field-copying magic in PojoUtils.
[ "Return", "the", "class", "of", "the", "implementation", "type", "parameter", "I", "for", "the", "given", "Schema", "class", ".", "Used", "by", "the", "metadata", "facilities", "and", "the", "reflection", "-", "base", "field", "-", "copying", "magic", "in", ...
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/Schema.java#L214-L219
131,253
h2oai/h2o-3
h2o-core/src/main/java/water/api/Schema.java
Schema.getImplClass
public Class<I> getImplClass() { return _impl_class != null ? _impl_class : (_impl_class = ReflectionUtils.findActualClassParameter(this.getClass(), 0)); }
java
public Class<I> getImplClass() { return _impl_class != null ? _impl_class : (_impl_class = ReflectionUtils.findActualClassParameter(this.getClass(), 0)); }
[ "public", "Class", "<", "I", ">", "getImplClass", "(", ")", "{", "return", "_impl_class", "!=", "null", "?", "_impl_class", ":", "(", "_impl_class", "=", "ReflectionUtils", ".", "findActualClassParameter", "(", "this", ".", "getClass", "(", ")", ",", "0", ...
Return the class of the implementation type parameter I for this Schema. Used by generic code which deals with arbitrary schemas and their backing impl classes. Never returns null.
[ "Return", "the", "class", "of", "the", "implementation", "type", "parameter", "I", "for", "this", "Schema", ".", "Used", "by", "generic", "code", "which", "deals", "with", "arbitrary", "schemas", "and", "their", "backing", "impl", "classes", ".", "Never", "r...
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/Schema.java#L224-L226
131,254
h2oai/h2o-3
h2o-core/src/main/java/water/api/Schema.java
Schema.parseInteger
static private <T> T parseInteger(String s, Class<T> return_type) { try { java.math.BigDecimal num = new java.math.BigDecimal(s); T result = (T) num.getClass().getDeclaredMethod(return_type.getSimpleName() + "ValueExact", new Class[0]).invoke(num); return result; } catch (InvocationTargetExcep...
java
static private <T> T parseInteger(String s, Class<T> return_type) { try { java.math.BigDecimal num = new java.math.BigDecimal(s); T result = (T) num.getClass().getDeclaredMethod(return_type.getSimpleName() + "ValueExact", new Class[0]).invoke(num); return result; } catch (InvocationTargetExcep...
[ "static", "private", "<", "T", ">", "T", "parseInteger", "(", "String", "s", ",", "Class", "<", "T", ">", "return_type", ")", "{", "try", "{", "java", ".", "math", ".", "BigDecimal", "num", "=", "new", "java", ".", "math", ".", "BigDecimal", "(", "...
Parses a string into an integer data type specified by parameter return_type. Accepts any format that is accepted by java's BigDecimal class. - Throws a NumberFormatException if the evaluated string is not an integer or if the value is too large to be stored into return_type without overflow. - Throws an IllegalAgument...
[ "Parses", "a", "string", "into", "an", "integer", "data", "type", "specified", "by", "parameter", "return_type", ".", "Accepts", "any", "format", "that", "is", "accepted", "by", "java", "s", "BigDecimal", "class", ".", "-", "Throws", "a", "NumberFormatExceptio...
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/Schema.java#L571-L583
131,255
h2oai/h2o-3
h2o-core/src/main/java/water/api/Schema.java
Schema.newInstance
public static <T extends Schema> T newInstance(Class<T> clz) { try { return clz.newInstance(); } catch (Exception e) { throw H2O.fail("Failed to instantiate schema of class: " + clz.getCanonicalName(),e); } }
java
public static <T extends Schema> T newInstance(Class<T> clz) { try { return clz.newInstance(); } catch (Exception e) { throw H2O.fail("Failed to instantiate schema of class: " + clz.getCanonicalName(),e); } }
[ "public", "static", "<", "T", "extends", "Schema", ">", "T", "newInstance", "(", "Class", "<", "T", ">", "clz", ")", "{", "try", "{", "return", "clz", ".", "newInstance", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "H2O",...
Returns a new Schema instance. Does not throw, nor returns null. @return New instance of Schema Class 'clz'.
[ "Returns", "a", "new", "Schema", "instance", ".", "Does", "not", "throw", "nor", "returns", "null", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/Schema.java#L632-L635
131,256
h2oai/h2o-3
h2o-core/src/main/java/hex/ModelMojoWriter.java
ModelMojoWriter.writeModelDetails
private void writeModelDetails() throws IOException { ModelSchemaV3 modelSchema = (ModelSchemaV3) SchemaServer.schema(3, model).fillFromImpl(model); startWritingTextFile("experimental/modelDetails.json"); writeln(modelSchema.toJsonString()); finishWritingTextFile(); }
java
private void writeModelDetails() throws IOException { ModelSchemaV3 modelSchema = (ModelSchemaV3) SchemaServer.schema(3, model).fillFromImpl(model); startWritingTextFile("experimental/modelDetails.json"); writeln(modelSchema.toJsonString()); finishWritingTextFile(); }
[ "private", "void", "writeModelDetails", "(", ")", "throws", "IOException", "{", "ModelSchemaV3", "modelSchema", "=", "(", "ModelSchemaV3", ")", "SchemaServer", ".", "schema", "(", "3", ",", "model", ")", ".", "fillFromImpl", "(", "model", ")", ";", "startWriti...
Create file that contains model details in JSON format. This information is pulled from the models schema.
[ "Create", "file", "that", "contains", "model", "details", "in", "JSON", "format", ".", "This", "information", "is", "pulled", "from", "the", "models", "schema", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/ModelMojoWriter.java#L91-L96
131,257
h2oai/h2o-3
h2o-core/src/main/java/water/util/IcedHashMap.java
IcedHashMap.writeMap
@Override protected void writeMap(AutoBuffer ab, int mode) { // For faster K/V store walking get the NBHM raw backing array, // and walk it directly. Object[] kvs = _map.raw_array(); // Start the walk at slot 2, because slots 0,1 hold meta-data // In the raw backing array, Keys and Values alternat...
java
@Override protected void writeMap(AutoBuffer ab, int mode) { // For faster K/V store walking get the NBHM raw backing array, // and walk it directly. Object[] kvs = _map.raw_array(); // Start the walk at slot 2, because slots 0,1 hold meta-data // In the raw backing array, Keys and Values alternat...
[ "@", "Override", "protected", "void", "writeMap", "(", "AutoBuffer", "ab", ",", "int", "mode", ")", "{", "// For faster K/V store walking get the NBHM raw backing array,", "// and walk it directly.", "Object", "[", "]", "kvs", "=", "_map", ".", "raw_array", "(", ")", ...
Map-writing optimized for NBHM
[ "Map", "-", "writing", "optimized", "for", "NBHM" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/IcedHashMap.java#L28-L76
131,258
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java
LinkedTransferQueue.casTail
private boolean casTail(Node cmp, Node val) { return UNSAFE.compareAndSwapObject(this, tailOffset, cmp, val); }
java
private boolean casTail(Node cmp, Node val) { return UNSAFE.compareAndSwapObject(this, tailOffset, cmp, val); }
[ "private", "boolean", "casTail", "(", "Node", "cmp", ",", "Node", "val", ")", "{", "return", "UNSAFE", ".", "compareAndSwapObject", "(", "this", ",", "tailOffset", ",", "cmp", ",", "val", ")", ";", "}" ]
CAS methods for fields
[ "CAS", "methods", "for", "fields" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java#L539-L541
131,259
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java
LinkedTransferQueue.firstOfMode
private Node firstOfMode(boolean isData) { for (Node p = head; p != null; p = succ(p)) { if (!p.isMatched()) return (p.isData == isData) ? p : null; } return null; }
java
private Node firstOfMode(boolean isData) { for (Node p = head; p != null; p = succ(p)) { if (!p.isMatched()) return (p.isData == isData) ? p : null; } return null; }
[ "private", "Node", "firstOfMode", "(", "boolean", "isData", ")", "{", "for", "(", "Node", "p", "=", "head", ";", "p", "!=", "null", ";", "p", "=", "succ", "(", "p", ")", ")", "{", "if", "(", "!", "p", ".", "isMatched", "(", ")", ")", "return", ...
Returns the first unmatched node of the given mode, or null if none. Used by methods isEmpty, hasWaitingConsumer.
[ "Returns", "the", "first", "unmatched", "node", "of", "the", "given", "mode", "or", "null", "if", "none", ".", "Used", "by", "methods", "isEmpty", "hasWaitingConsumer", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java#L743-L749
131,260
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java
LinkedTransferQueue.firstDataItem
private E firstDataItem() { for (Node p = head; p != null; p = succ(p)) { Object item = p.item; if (p.isData) { if (item != null && item != p) return LinkedTransferQueue.<E>cast(item); } else if (item == null) re...
java
private E firstDataItem() { for (Node p = head; p != null; p = succ(p)) { Object item = p.item; if (p.isData) { if (item != null && item != p) return LinkedTransferQueue.<E>cast(item); } else if (item == null) re...
[ "private", "E", "firstDataItem", "(", ")", "{", "for", "(", "Node", "p", "=", "head", ";", "p", "!=", "null", ";", "p", "=", "succ", "(", "p", ")", ")", "{", "Object", "item", "=", "p", ".", "item", ";", "if", "(", "p", ".", "isData", ")", ...
Returns the item in the first unmatched node with isData; or null if none. Used by peek.
[ "Returns", "the", "item", "in", "the", "first", "unmatched", "node", "with", "isData", ";", "or", "null", "if", "none", ".", "Used", "by", "peek", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java#L755-L766
131,261
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java
LinkedTransferQueue.transfer
public void transfer(E e) throws InterruptedException { if (xfer(e, true, SYNC, 0) != null) { Thread.interrupted(); // failure possible only due to interrupt throw new InterruptedException(); } }
java
public void transfer(E e) throws InterruptedException { if (xfer(e, true, SYNC, 0) != null) { Thread.interrupted(); // failure possible only due to interrupt throw new InterruptedException(); } }
[ "public", "void", "transfer", "(", "E", "e", ")", "throws", "InterruptedException", "{", "if", "(", "xfer", "(", "e", ",", "true", ",", "SYNC", ",", "0", ")", "!=", "null", ")", "{", "Thread", ".", "interrupted", "(", ")", ";", "// failure possible onl...
Transfers the element to a consumer, waiting if necessary to do so. <p>More precisely, transfers the specified element immediately if there exists a consumer already waiting to receive it (in {@link #take} or timed {@link #poll(long,TimeUnit) poll}), else inserts the specified element at the tail of this queue and wai...
[ "Transfers", "the", "element", "to", "a", "consumer", "waiting", "if", "necessary", "to", "do", "so", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/LinkedTransferQueue.java#L1078-L1083
131,262
h2oai/h2o-3
h2o-core/src/main/java/water/util/ReflectionUtils.java
ReflectionUtils.findActualClassParameter
public static <T> Class<T> findActualClassParameter(Class clz, int parm) { Class parm_class = null; if (clz.getGenericSuperclass() instanceof ParameterizedType) { Type[] handler_type_parms = ((ParameterizedType) (clz.getGenericSuperclass())).getActualTypeArguments(); if (handler_type_parms[parm] in...
java
public static <T> Class<T> findActualClassParameter(Class clz, int parm) { Class parm_class = null; if (clz.getGenericSuperclass() instanceof ParameterizedType) { Type[] handler_type_parms = ((ParameterizedType) (clz.getGenericSuperclass())).getActualTypeArguments(); if (handler_type_parms[parm] in...
[ "public", "static", "<", "T", ">", "Class", "<", "T", ">", "findActualClassParameter", "(", "Class", "clz", ",", "int", "parm", ")", "{", "Class", "parm_class", "=", "null", ";", "if", "(", "clz", ".", "getGenericSuperclass", "(", ")", "instanceof", "Par...
Reflection helper which returns the actual class for a type parameter, even if itself is parameterized.
[ "Reflection", "helper", "which", "returns", "the", "actual", "class", "for", "a", "type", "parameter", "even", "if", "itself", "is", "parameterized", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/ReflectionUtils.java#L12-L41
131,263
h2oai/h2o-3
h2o-core/src/main/java/water/util/ReflectionUtils.java
ReflectionUtils.findMethodParameterClass
public static Class findMethodParameterClass(Method method, int parm) { Class[] clzes = method.getParameterTypes(); if (clzes.length <= parm) throw H2O.fail("Asked for the class of parameter number: " + parm + " of method: " + method + ", which only has: " + clzes.length + " parameters."); return cl...
java
public static Class findMethodParameterClass(Method method, int parm) { Class[] clzes = method.getParameterTypes(); if (clzes.length <= parm) throw H2O.fail("Asked for the class of parameter number: " + parm + " of method: " + method + ", which only has: " + clzes.length + " parameters."); return cl...
[ "public", "static", "Class", "findMethodParameterClass", "(", "Method", "method", ",", "int", "parm", ")", "{", "Class", "[", "]", "clzes", "=", "method", ".", "getParameterTypes", "(", ")", ";", "if", "(", "clzes", ".", "length", "<=", "parm", ")", "thr...
Reflection helper which returns the actual class for a method's parameter.
[ "Reflection", "helper", "which", "returns", "the", "actual", "class", "for", "a", "method", "s", "parameter", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/ReflectionUtils.java#L46-L53
131,264
h2oai/h2o-3
h2o-core/src/main/java/water/util/ReflectionUtils.java
ReflectionUtils.findActualFieldClass
public static Class findActualFieldClass(Class clz, Field f) { // schema.getClass().getGenericSuperclass() instanceof ParameterizedType Type generic_type = f.getGenericType(); if (! (generic_type instanceof TypeVariable)) return f.getType(); // field is a parameterized type // ((TypeVariable)...
java
public static Class findActualFieldClass(Class clz, Field f) { // schema.getClass().getGenericSuperclass() instanceof ParameterizedType Type generic_type = f.getGenericType(); if (! (generic_type instanceof TypeVariable)) return f.getType(); // field is a parameterized type // ((TypeVariable)...
[ "public", "static", "Class", "findActualFieldClass", "(", "Class", "clz", ",", "Field", "f", ")", "{", "// schema.getClass().getGenericSuperclass() instanceof ParameterizedType", "Type", "generic_type", "=", "f", ".", "getGenericType", "(", ")", ";", "if", "(", "!", ...
Reflection helper which returns the actual class for a field which has a parameterized type. E.g., DeepLearningV2's "parameters" class is in parent ModelBuilderSchema, and is parameterized by type parameter P.
[ "Reflection", "helper", "which", "returns", "the", "actual", "class", "for", "a", "field", "which", "has", "a", "parameterized", "type", ".", "E", ".", "g", ".", "DeepLearningV2", "s", "parameters", "class", "is", "in", "parent", "ModelBuilderSchema", "and", ...
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/ReflectionUtils.java#L65-L94
131,265
h2oai/h2o-3
h2o-core/src/main/java/water/util/ReflectionUtils.java
ReflectionUtils.asDouble
public static double asDouble( Object o ) { if( o == null ) return Double.NaN; if( o instanceof Integer ) return ((Integer)o); if( o instanceof Long ) return ((Long)o); if( o instanceof Float ) return ((Float)o); if( o instanceof Double ) return ((Double)o); if( o instanceof Enum ) return ((Enum...
java
public static double asDouble( Object o ) { if( o == null ) return Double.NaN; if( o instanceof Integer ) return ((Integer)o); if( o instanceof Long ) return ((Long)o); if( o instanceof Float ) return ((Float)o); if( o instanceof Double ) return ((Double)o); if( o instanceof Enum ) return ((Enum...
[ "public", "static", "double", "asDouble", "(", "Object", "o", ")", "{", "if", "(", "o", "==", "null", ")", "return", "Double", ".", "NaN", ";", "if", "(", "o", "instanceof", "Integer", ")", "return", "(", "(", "Integer", ")", "o", ")", ";", "if", ...
Best effort conversion from an Object to a double
[ "Best", "effort", "conversion", "from", "an", "Object", "to", "a", "double" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/ReflectionUtils.java#L97-L106
131,266
h2oai/h2o-3
h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostUtils.java
XGBoostUtils.getDataRows
private static int getDataRows(Chunk[] chunks, Frame f, int[] chunksIds, int cols) { double totalRows = 0; if(null != chunks) { for (Chunk ch : chunks) { totalRows += ch.len(); } } else { for(int chunkId : chunksIds) { totalRows...
java
private static int getDataRows(Chunk[] chunks, Frame f, int[] chunksIds, int cols) { double totalRows = 0; if(null != chunks) { for (Chunk ch : chunks) { totalRows += ch.len(); } } else { for(int chunkId : chunksIds) { totalRows...
[ "private", "static", "int", "getDataRows", "(", "Chunk", "[", "]", "chunks", ",", "Frame", "f", ",", "int", "[", "]", "chunksIds", ",", "int", "cols", ")", "{", "double", "totalRows", "=", "0", ";", "if", "(", "null", "!=", "chunks", ")", "{", "for...
FIXME this and the other method should subtract rows where response is 0
[ "FIXME", "this", "and", "the", "other", "method", "should", "subtract", "rows", "where", "response", "is", "0" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostUtils.java#L143-L155
131,267
h2oai/h2o-3
h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostUtils.java
XGBoostUtils.sumChunksLength
private static long sumChunksLength(int[] chunkIds, Vec vec, Vec weightsVector, int[] chunkLengths) { for (int i = 0; i < chunkIds.length; i++) { final int chunk = chunkIds[i]; chunkLengths[i] = vec.chunkLen(chunk); if (weightsVector == null) continue; ...
java
private static long sumChunksLength(int[] chunkIds, Vec vec, Vec weightsVector, int[] chunkLengths) { for (int i = 0; i < chunkIds.length; i++) { final int chunk = chunkIds[i]; chunkLengths[i] = vec.chunkLen(chunk); if (weightsVector == null) continue; ...
[ "private", "static", "long", "sumChunksLength", "(", "int", "[", "]", "chunkIds", ",", "Vec", "vec", ",", "Vec", "weightsVector", ",", "int", "[", "]", "chunkLengths", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "chunkIds", ".", "lengt...
Counts a total sum of chunks inside a vector. Only chunks present in chunkIds are considered. @param chunkIds Chunk identifier of a vector @param vec Vector containing given chunk identifiers @param weightsVector Vector with row weights, possibly null @return A sum of chunk lengths. Possibly zero, if there are no...
[ "Counts", "a", "total", "sum", "of", "chunks", "inside", "a", "vector", ".", "Only", "chunks", "present", "in", "chunkIds", "are", "considered", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostUtils.java#L166-L188
131,268
h2oai/h2o-3
h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostUtils.java
XGBoostUtils.enlargeTables
private static void enlargeTables(float[][] data, int[][] rowIndex, int cols, int currentRow, int currentCol) { while (data[currentRow].length < currentCol + cols) { if(data[currentRow].length == SPARSE_MATRIX_DIM) { currentCol = 0; cols -= (data[currentRow].length - ...
java
private static void enlargeTables(float[][] data, int[][] rowIndex, int cols, int currentRow, int currentCol) { while (data[currentRow].length < currentCol + cols) { if(data[currentRow].length == SPARSE_MATRIX_DIM) { currentCol = 0; cols -= (data[currentRow].length - ...
[ "private", "static", "void", "enlargeTables", "(", "float", "[", "]", "[", "]", "data", ",", "int", "[", "]", "[", "]", "rowIndex", ",", "int", "cols", ",", "int", "currentRow", ",", "int", "currentCol", ")", "{", "while", "(", "data", "[", "currentR...
Assumes both matrices are getting filled at the same rate and will require the same amount of space
[ "Assumes", "both", "matrices", "are", "getting", "filled", "at", "the", "same", "rate", "and", "will", "require", "the", "same", "amount", "of", "space" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostUtils.java#L784-L798
131,269
h2oai/h2o-3
h2o-automl/src/main/java/ai/h2o/automl/AutoML.java
AutoML.defaultGBMs
void defaultGBMs() { Algo algo = Algo.GBM; WorkAllocations.Work work = workAllocations.getAllocation(algo, JobType.ModelBuild); if (work == null) return; Job gbmJob; GBMParameters gbmParameters = new GBMParameters(); setCommonModelBuilderParams(gbmParameters); gbmParameters._score_tree_int...
java
void defaultGBMs() { Algo algo = Algo.GBM; WorkAllocations.Work work = workAllocations.getAllocation(algo, JobType.ModelBuild); if (work == null) return; Job gbmJob; GBMParameters gbmParameters = new GBMParameters(); setCommonModelBuilderParams(gbmParameters); gbmParameters._score_tree_int...
[ "void", "defaultGBMs", "(", ")", "{", "Algo", "algo", "=", "Algo", ".", "GBM", ";", "WorkAllocations", ".", "Work", "work", "=", "workAllocations", ".", "getAllocation", "(", "algo", ",", "JobType", ".", "ModelBuild", ")", ";", "if", "(", "work", "==", ...
Build Arno's magical 5 default GBMs.
[ "Build", "Arno", "s", "magical", "5", "default", "GBMs", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-automl/src/main/java/ai/h2o/automl/AutoML.java#L1076-L1127
131,270
h2oai/h2o-3
h2o-automl/src/main/java/ai/h2o/automl/AutoML.java
AutoML.remove_impl
@Override protected Futures remove_impl(Futures fs) { if (trainingFrame != null && origTrainingFrame != null) Frame.deleteTempFrameAndItsNonSharedVecs(trainingFrame, origTrainingFrame); if (leaderboard != null) leaderboard.remove(fs); if (userFeedback != null) userFeedback.remove(fs); return sup...
java
@Override protected Futures remove_impl(Futures fs) { if (trainingFrame != null && origTrainingFrame != null) Frame.deleteTempFrameAndItsNonSharedVecs(trainingFrame, origTrainingFrame); if (leaderboard != null) leaderboard.remove(fs); if (userFeedback != null) userFeedback.remove(fs); return sup...
[ "@", "Override", "protected", "Futures", "remove_impl", "(", "Futures", "fs", ")", "{", "if", "(", "trainingFrame", "!=", "null", "&&", "origTrainingFrame", "!=", "null", ")", "Frame", ".", "deleteTempFrameAndItsNonSharedVecs", "(", "trainingFrame", ",", "origTrai...
Delete the AutoML-related objects, but leave the grids and models that it built.
[ "Delete", "the", "AutoML", "-", "related", "objects", "but", "leave", "the", "grids", "and", "models", "that", "it", "built", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-automl/src/main/java/ai/h2o/automl/AutoML.java#L1328-L1335
131,271
h2oai/h2o-3
h2o-automl/src/main/java/ai/h2o/automl/AutoML.java
AutoML.addModels
private void addModels(final Key<Model>[] newModels) { int before = leaderboard().getModelCount(); leaderboard().addModels(newModels); int after = leaderboard().getModelCount(); modelCount.addAndGet(after - before); }
java
private void addModels(final Key<Model>[] newModels) { int before = leaderboard().getModelCount(); leaderboard().addModels(newModels); int after = leaderboard().getModelCount(); modelCount.addAndGet(after - before); }
[ "private", "void", "addModels", "(", "final", "Key", "<", "Model", ">", "[", "]", "newModels", ")", "{", "int", "before", "=", "leaderboard", "(", ")", ".", "getModelCount", "(", ")", ";", "leaderboard", "(", ")", ".", "addModels", "(", "newModels", ")...
Also, the leaderboard will reject duplicate models, so use the difference in Leaderboard length here.
[ "Also", "the", "leaderboard", "will", "reject", "duplicate", "models", "so", "use", "the", "difference", "in", "Leaderboard", "length", "here", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-automl/src/main/java/ai/h2o/automl/AutoML.java#L1362-L1367
131,272
h2oai/h2o-3
h2o-core/src/main/java/water/api/ModelBuildersHandler.java
ModelBuildersHandler.list
@SuppressWarnings("unused") // called through reflection by RequestServer public ModelBuildersV3 list(int version, ModelBuildersV3 m) { m.model_builders = new ModelBuilderSchema.IcedHashMapStringModelBuilderSchema(); for( String algo : ModelBuilder.algos() ) { ModelBuilder builder = ModelBuilder.make(al...
java
@SuppressWarnings("unused") // called through reflection by RequestServer public ModelBuildersV3 list(int version, ModelBuildersV3 m) { m.model_builders = new ModelBuilderSchema.IcedHashMapStringModelBuilderSchema(); for( String algo : ModelBuilder.algos() ) { ModelBuilder builder = ModelBuilder.make(al...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "// called through reflection by RequestServer", "public", "ModelBuildersV3", "list", "(", "int", "version", ",", "ModelBuildersV3", "m", ")", "{", "m", ".", "model_builders", "=", "new", "ModelBuilderSchema", ".", "Ice...
Return all the modelbuilders.
[ "Return", "all", "the", "modelbuilders", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/ModelBuildersHandler.java#L21-L29
131,273
h2oai/h2o-3
h2o-core/src/main/java/water/api/ModelBuildersHandler.java
ModelBuildersHandler.calcModelId
@SuppressWarnings("unused") // called through reflection by RequestServer public ModelIdV3 calcModelId(int version, ModelBuildersV3 m) { m.model_builders = new ModelBuilderSchema.IcedHashMapStringModelBuilderSchema(); String model_id = H2O.calcNextUniqueModelId(m.algo); ModelIdV3 mm = new ModelIdV3(); ...
java
@SuppressWarnings("unused") // called through reflection by RequestServer public ModelIdV3 calcModelId(int version, ModelBuildersV3 m) { m.model_builders = new ModelBuilderSchema.IcedHashMapStringModelBuilderSchema(); String model_id = H2O.calcNextUniqueModelId(m.algo); ModelIdV3 mm = new ModelIdV3(); ...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "// called through reflection by RequestServer", "public", "ModelIdV3", "calcModelId", "(", "int", "version", ",", "ModelBuildersV3", "m", ")", "{", "m", ".", "model_builders", "=", "new", "ModelBuilderSchema", ".", "Ic...
Calculate next unique model_id.
[ "Calculate", "next", "unique", "model_id", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/ModelBuildersHandler.java#L46-L53
131,274
h2oai/h2o-3
h2o-core/src/main/java/water/ExtensionManager.java
ExtensionManager.registerRestApiExtensions
public void registerRestApiExtensions() { if (restApiExtensionsRegistered) { throw H2O.fail("APIs already registered"); } // Log core extension registrations here so the message is grouped in the right spot. for (AbstractH2OExtension e : getCoreExtensions()) { e.printInitialized(); } ...
java
public void registerRestApiExtensions() { if (restApiExtensionsRegistered) { throw H2O.fail("APIs already registered"); } // Log core extension registrations here so the message is grouped in the right spot. for (AbstractH2OExtension e : getCoreExtensions()) { e.printInitialized(); } ...
[ "public", "void", "registerRestApiExtensions", "(", ")", "{", "if", "(", "restApiExtensionsRegistered", ")", "{", "throw", "H2O", ".", "fail", "(", "\"APIs already registered\"", ")", ";", "}", "// Log core extension registrations here so the message is grouped in the right s...
Register REST API routes. Use reflection to find all classes that inherit from {@link water.api.AbstractRegister} and call the register() method for each.
[ "Register", "REST", "API", "routes", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExtensionManager.java#L133-L176
131,275
h2oai/h2o-3
h2o-core/src/main/java/water/ExtensionManager.java
ExtensionManager.registerListenerExtensions
public void registerListenerExtensions() { if (listenerExtensionsRegistered) { throw H2O.fail("Listeners already registered"); } long before = System.currentTimeMillis(); ServiceLoader<H2OListenerExtension> extensionsLoader = ServiceLoader.load(H2OListenerExtension.class); for (H2OListenerExt...
java
public void registerListenerExtensions() { if (listenerExtensionsRegistered) { throw H2O.fail("Listeners already registered"); } long before = System.currentTimeMillis(); ServiceLoader<H2OListenerExtension> extensionsLoader = ServiceLoader.load(H2OListenerExtension.class); for (H2OListenerExt...
[ "public", "void", "registerListenerExtensions", "(", ")", "{", "if", "(", "listenerExtensionsRegistered", ")", "{", "throw", "H2O", ".", "fail", "(", "\"Listeners already registered\"", ")", ";", "}", "long", "before", "=", "System", ".", "currentTimeMillis", "(",...
Register various listener extensions Use reflection to find all classes that inherit from {@link water.api.AbstractRegister} and call the register() method for each.
[ "Register", "various", "listener", "extensions" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExtensionManager.java#L223-L236
131,276
h2oai/h2o-3
h2o-genmodel/src/main/java/hex/genmodel/easy/error/CountingErrorConsumer.java
CountingErrorConsumer.initializeDataTransformationErrorsCount
private void initializeDataTransformationErrorsCount(GenModel model) { String responseColumnName = model.isSupervised() ? model.getResponseName() : null; dataTransformationErrorsCountPerColumn = new ConcurrentHashMap<>(); for (String column : model.getNames()) { // Do not perform check for response c...
java
private void initializeDataTransformationErrorsCount(GenModel model) { String responseColumnName = model.isSupervised() ? model.getResponseName() : null; dataTransformationErrorsCountPerColumn = new ConcurrentHashMap<>(); for (String column : model.getNames()) { // Do not perform check for response c...
[ "private", "void", "initializeDataTransformationErrorsCount", "(", "GenModel", "model", ")", "{", "String", "responseColumnName", "=", "model", ".", "isSupervised", "(", ")", "?", "model", ".", "getResponseName", "(", ")", ":", "null", ";", "dataTransformationErrors...
Initializes the map of data transformation errors for each column that is not related to response variable, excluding response column. The map is initialized as unmodifiable and thread-safe. @param model {@link GenModel} the data trasnformation errors count map is initialized for
[ "Initializes", "the", "map", "of", "data", "transformation", "errors", "for", "each", "column", "that", "is", "not", "related", "to", "response", "variable", "excluding", "response", "column", ".", "The", "map", "is", "initialized", "as", "unmodifiable", "and", ...
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/easy/error/CountingErrorConsumer.java#L33-L44
131,277
h2oai/h2o-3
h2o-genmodel/src/main/java/hex/genmodel/easy/error/CountingErrorConsumer.java
CountingErrorConsumer.getTotalUnknownCategoricalLevelsSeen
public long getTotalUnknownCategoricalLevelsSeen() { long total = 0; for (AtomicLong l : unknownCategoricalsPerColumn.values()) { total += l.get(); } return total; }
java
public long getTotalUnknownCategoricalLevelsSeen() { long total = 0; for (AtomicLong l : unknownCategoricalsPerColumn.values()) { total += l.get(); } return total; }
[ "public", "long", "getTotalUnknownCategoricalLevelsSeen", "(", ")", "{", "long", "total", "=", "0", ";", "for", "(", "AtomicLong", "l", ":", "unknownCategoricalsPerColumn", ".", "values", "(", ")", ")", "{", "total", "+=", "l", ".", "get", "(", ")", ";", ...
Counts and returns all previously unseen categorical variables across all columns. Results may vary when called during prediction phase. @return A sum of all previously unseen categoricals across all columns
[ "Counts", "and", "returns", "all", "previously", "unseen", "categorical", "variables", "across", "all", "columns", ".", "Results", "may", "vary", "when", "called", "during", "prediction", "phase", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/easy/error/CountingErrorConsumer.java#L80-L86
131,278
h2oai/h2o-3
h2o-algos/src/main/java/hex/deepwater/DeepWaterParameters.java
DeepWaterParameters.guessProblemType
ProblemType guessProblemType() { if (_problem_type == auto) { boolean image = false; boolean text = false; String first = null; Vec v = train().vec(0); if (v.isString() || v.isCategorical() /*small data parser artefact*/) { BufferedString bs = new BufferedString(); firs...
java
ProblemType guessProblemType() { if (_problem_type == auto) { boolean image = false; boolean text = false; String first = null; Vec v = train().vec(0); if (v.isString() || v.isCategorical() /*small data parser artefact*/) { BufferedString bs = new BufferedString(); firs...
[ "ProblemType", "guessProblemType", "(", ")", "{", "if", "(", "_problem_type", "==", "auto", ")", "{", "boolean", "image", "=", "false", ";", "boolean", "text", "=", "false", ";", "String", "first", "=", "null", ";", "Vec", "v", "=", "train", "(", ")", ...
Attempt to guess the problem type from the dataset @return
[ "Attempt", "to", "guess", "the", "problem", "type", "from", "the", "dataset" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/deepwater/DeepWaterParameters.java#L396-L431
131,279
h2oai/h2o-3
h2o-algos/src/main/java/hex/tree/SharedTreeModel.java
SharedTreeModel.score0
private void score0(double[] data, double[] preds, int treeIdx) { Key[] keys = _output._treeKeys[treeIdx]; for( int c=0; c<keys.length; c++ ) { if (keys[c] != null) { double pred = DKV.get(keys[c]).<CompressedTree>get().score(data,_output._domains); assert (!Double.isInfinite(pred)); ...
java
private void score0(double[] data, double[] preds, int treeIdx) { Key[] keys = _output._treeKeys[treeIdx]; for( int c=0; c<keys.length; c++ ) { if (keys[c] != null) { double pred = DKV.get(keys[c]).<CompressedTree>get().score(data,_output._domains); assert (!Double.isInfinite(pred)); ...
[ "private", "void", "score0", "(", "double", "[", "]", "data", ",", "double", "[", "]", "preds", ",", "int", "treeIdx", ")", "{", "Key", "[", "]", "keys", "=", "_output", ".", "_treeKeys", "[", "treeIdx", "]", ";", "for", "(", "int", "c", "=", "0"...
Score per line per tree
[ "Score", "per", "line", "per", "tree" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java#L450-L459
131,280
h2oai/h2o-3
h2o-algos/src/main/java/hex/tree/SharedTreeModel.java
SharedTreeModel.deepClone
protected M deepClone(Key<M> result) { M newModel = IcedUtils.deepCopy(self()); newModel._key = result; // Do not clone model metrics newModel._output.clearModelMetrics(); newModel._output._training_metrics = null; newModel._output._validation_metrics = null; // Clone trees Key[][] treeK...
java
protected M deepClone(Key<M> result) { M newModel = IcedUtils.deepCopy(self()); newModel._key = result; // Do not clone model metrics newModel._output.clearModelMetrics(); newModel._output._training_metrics = null; newModel._output._validation_metrics = null; // Clone trees Key[][] treeK...
[ "protected", "M", "deepClone", "(", "Key", "<", "M", ">", "result", ")", "{", "M", "newModel", "=", "IcedUtils", ".", "deepCopy", "(", "self", "(", ")", ")", ";", "newModel", ".", "_key", "=", "result", ";", "// Do not clone model metrics", "newModel", "...
Performs deep clone of given model.
[ "Performs", "deep", "clone", "of", "given", "model", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java#L462-L494
131,281
h2oai/h2o-3
h2o-algos/src/main/java/hex/tree/SharedTreeModel.java
SharedTreeModel.getSharedTreeSubgraph
public SharedTreeSubgraph getSharedTreeSubgraph(final int tidx, final int cls) { if (tidx < 0 || tidx >= _output._ntrees) { throw new IllegalArgumentException("Invalid tree index: " + tidx + ". Tree index must be in range [0, " + (_output._ntrees -1) + "]."); } final CompressedTree auxCo...
java
public SharedTreeSubgraph getSharedTreeSubgraph(final int tidx, final int cls) { if (tidx < 0 || tidx >= _output._ntrees) { throw new IllegalArgumentException("Invalid tree index: " + tidx + ". Tree index must be in range [0, " + (_output._ntrees -1) + "]."); } final CompressedTree auxCo...
[ "public", "SharedTreeSubgraph", "getSharedTreeSubgraph", "(", "final", "int", "tidx", ",", "final", "int", "cls", ")", "{", "if", "(", "tidx", "<", "0", "||", "tidx", ">=", "_output", ".", "_ntrees", ")", "{", "throw", "new", "IllegalArgumentException", "(",...
Converts a given tree of the ensemble to a user-understandable representation. @param tidx tree index @param cls tree class @return instance of SharedTreeSubgraph
[ "Converts", "a", "given", "tree", "of", "the", "ensemble", "to", "a", "user", "-", "understandable", "representation", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/tree/SharedTreeModel.java#L538-L545
131,282
h2oai/h2o-3
h2o-core/src/main/java/water/init/AbstractEmbeddedH2OConfig.java
AbstractEmbeddedH2OConfig.notifyAboutCloudSize
public void notifyAboutCloudSize(InetAddress ip, int port, InetAddress leaderIp, int leaderPort, int size) { notifyAboutCloudSize(ip, port, size); }
java
public void notifyAboutCloudSize(InetAddress ip, int port, InetAddress leaderIp, int leaderPort, int size) { notifyAboutCloudSize(ip, port, size); }
[ "public", "void", "notifyAboutCloudSize", "(", "InetAddress", "ip", ",", "int", "port", ",", "InetAddress", "leaderIp", ",", "int", "leaderPort", ",", "int", "size", ")", "{", "notifyAboutCloudSize", "(", "ip", ",", "port", ",", "size", ")", ";", "}" ]
Tell the embedding software that this H2O instance belongs to a cloud of a certain size. This may be nonblocking. Note: this method will be made abstract in a future stable release. User is expected to override the method in the implementation. @param ip IP address this H2O can be reached at. @param port Port this H2...
[ "Tell", "the", "embedding", "software", "that", "this", "H2O", "instance", "belongs", "to", "a", "cloud", "of", "a", "certain", "size", ".", "This", "may", "be", "nonblocking", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/init/AbstractEmbeddedH2OConfig.java#L63-L65
131,283
h2oai/h2o-3
h2o-core/src/main/java/water/rapids/vals/ValFrame.java
ValFrame.getRow
@Override public double[] getRow() { if (_fr.numRows() != 1) throw new IllegalArgumentException("Trying to get a single row from a multirow frame: " + _fr.numRows() + "!=1"); double res[] = new double[_fr.numCols()]; for (int i = 0; i < _fr.numCols(); ++i) res[i] = _fr.vec(i).at(0); return ...
java
@Override public double[] getRow() { if (_fr.numRows() != 1) throw new IllegalArgumentException("Trying to get a single row from a multirow frame: " + _fr.numRows() + "!=1"); double res[] = new double[_fr.numCols()]; for (int i = 0; i < _fr.numCols(); ++i) res[i] = _fr.vec(i).at(0); return ...
[ "@", "Override", "public", "double", "[", "]", "getRow", "(", ")", "{", "if", "(", "_fr", ".", "numRows", "(", ")", "!=", "1", ")", "throw", "new", "IllegalArgumentException", "(", "\"Trying to get a single row from a multirow frame: \"", "+", "_fr", ".", "num...
Extract row from a single-row frame. @return Array of row elements.
[ "Extract", "row", "from", "a", "single", "-", "row", "frame", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/vals/ValFrame.java#L26-L34
131,284
h2oai/h2o-3
h2o-core/src/main/java/water/nbhm/NonBlockingHashMap.java
NonBlockingHashMap.putIfMatchUnlocked
public final TypeV putIfMatchUnlocked( Object key, Object newVal, Object oldVal ) { if( oldVal == null ) oldVal = TOMBSTONE; if( newVal == null ) newVal = TOMBSTONE; final TypeV res = (TypeV)putIfMatch( this, _kvs, key, newVal, oldVal ); assert !(res instanceof Prime); //assert res != null; retu...
java
public final TypeV putIfMatchUnlocked( Object key, Object newVal, Object oldVal ) { if( oldVal == null ) oldVal = TOMBSTONE; if( newVal == null ) newVal = TOMBSTONE; final TypeV res = (TypeV)putIfMatch( this, _kvs, key, newVal, oldVal ); assert !(res instanceof Prime); //assert res != null; retu...
[ "public", "final", "TypeV", "putIfMatchUnlocked", "(", "Object", "key", ",", "Object", "newVal", ",", "Object", "oldVal", ")", "{", "if", "(", "oldVal", "==", "null", ")", "oldVal", "=", "TOMBSTONE", ";", "if", "(", "newVal", "==", "null", ")", "newVal",...
then the put inserted newVal, otherwise it failed.
[ "then", "the", "put", "inserted", "newVal", "otherwise", "it", "failed", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/nbhm/NonBlockingHashMap.java#L359-L366
131,285
h2oai/h2o-3
h2o-core/src/main/java/water/nbhm/NonBlockingHashMap.java
NonBlockingHashMap.writeObject
private void writeObject(java.io.ObjectOutputStream s) throws IOException { s.defaultWriteObject(); // Nothing to write for( Object K : keySet() ) { final Object V = get(K); // Do an official 'get' s.writeObject(K); // Write the <TypeK,TypeV> pair s.writeObject(V); } s.wr...
java
private void writeObject(java.io.ObjectOutputStream s) throws IOException { s.defaultWriteObject(); // Nothing to write for( Object K : keySet() ) { final Object V = get(K); // Do an official 'get' s.writeObject(K); // Write the <TypeK,TypeV> pair s.writeObject(V); } s.wr...
[ "private", "void", "writeObject", "(", "java", ".", "io", ".", "ObjectOutputStream", "s", ")", "throws", "IOException", "{", "s", ".", "defaultWriteObject", "(", ")", ";", "// Nothing to write", "for", "(", "Object", "K", ":", "keySet", "(", ")", ")", "{",...
Write a NBHM to a stream
[ "Write", "a", "NBHM", "to", "a", "stream" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/nbhm/NonBlockingHashMap.java#L1404-L1413
131,286
h2oai/h2o-3
h2o-core/src/main/java/water/nbhm/NonBlockingHashMap.java
NonBlockingHashMap.readObject
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); // Read nothing initialize(MIN_SIZE); for(;;) { final TypeK K = (TypeK) s.readObject(); final TypeV V = (TypeV) s.readObject(); if( K == null ) break; put(K,V...
java
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); // Read nothing initialize(MIN_SIZE); for(;;) { final TypeK K = (TypeK) s.readObject(); final TypeV V = (TypeV) s.readObject(); if( K == null ) break; put(K,V...
[ "private", "void", "readObject", "(", "java", ".", "io", ".", "ObjectInputStream", "s", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "s", ".", "defaultReadObject", "(", ")", ";", "// Read nothing", "initialize", "(", "MIN_SIZE", ")", ";", ...
Read a CHM from a stream
[ "Read", "a", "CHM", "from", "a", "stream" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/nbhm/NonBlockingHashMap.java#L1417-L1426
131,287
h2oai/h2o-3
h2o-core/src/main/java/water/rapids/RadixOrder.java
RadixOrder.computeShift
private long computeShift( final BigInteger max, final int i ) { int biggestBit = 0; int rangeD = max.subtract(_base[i]).add(BigInteger.ONE).add(BigInteger.ONE).bitLength(); biggestBit = _isInt[i] ? rangeD : (rangeD == 64 ? 64 : rangeD + 1); // TODO: feed back to R warnings() if (biggestBit < 8) ...
java
private long computeShift( final BigInteger max, final int i ) { int biggestBit = 0; int rangeD = max.subtract(_base[i]).add(BigInteger.ONE).add(BigInteger.ONE).bitLength(); biggestBit = _isInt[i] ? rangeD : (rangeD == 64 ? 64 : rangeD + 1); // TODO: feed back to R warnings() if (biggestBit < 8) ...
[ "private", "long", "computeShift", "(", "final", "BigInteger", "max", ",", "final", "int", "i", ")", "{", "int", "biggestBit", "=", "0", ";", "int", "rangeD", "=", "max", ".", "subtract", "(", "_base", "[", "i", "]", ")", ".", "add", "(", "BigInteger...
power of the shift.
[ "power", "of", "the", "shift", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/RadixOrder.java#L207-L226
131,288
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.call
public static <DT extends DTask> RPC<DT> call(H2ONode target, DT dtask) { return new RPC(target,dtask).call(); }
java
public static <DT extends DTask> RPC<DT> call(H2ONode target, DT dtask) { return new RPC(target,dtask).call(); }
[ "public", "static", "<", "DT", "extends", "DTask", ">", "RPC", "<", "DT", ">", "call", "(", "H2ONode", "target", ",", "DT", "dtask", ")", "{", "return", "new", "RPC", "(", "target", ",", "dtask", ")", ".", "call", "(", ")", ";", "}" ]
5 sec max timeout cap on exponential decay of retries
[ "5", "sec", "max", "timeout", "cap", "on", "exponential", "decay", "of", "retries" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L101-L103
131,289
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.handleCompleter
private void handleCompleter( CountedCompleter cc ) { assert cc instanceof H2OCountedCompleter; if( _fjtasks == null || !_fjtasks.contains(cc) ) addCompleter((H2OCountedCompleter)cc); _dt.setCompleter(null); }
java
private void handleCompleter( CountedCompleter cc ) { assert cc instanceof H2OCountedCompleter; if( _fjtasks == null || !_fjtasks.contains(cc) ) addCompleter((H2OCountedCompleter)cc); _dt.setCompleter(null); }
[ "private", "void", "handleCompleter", "(", "CountedCompleter", "cc", ")", "{", "assert", "cc", "instanceof", "H2OCountedCompleter", ";", "if", "(", "_fjtasks", "==", "null", "||", "!", "_fjtasks", ".", "contains", "(", "cc", ")", ")", "addCompleter", "(", "(...
so completion is signaled after the remote comes back.
[ "so", "completion", "is", "signaled", "after", "the", "remote", "comes", "back", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L129-L134
131,290
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.handleLocal
private RPC<V> handleLocal() { assert _dt.getCompleter()==null; _dt.setCompleter(new H2O.H2OCallback<DTask>() { @Override public void callback(DTask dt) { synchronized(RPC.this) { _done = true; RPC.this.notifyAll(); } doAllCompletions(); } ...
java
private RPC<V> handleLocal() { assert _dt.getCompleter()==null; _dt.setCompleter(new H2O.H2OCallback<DTask>() { @Override public void callback(DTask dt) { synchronized(RPC.this) { _done = true; RPC.this.notifyAll(); } doAllCompletions(); } ...
[ "private", "RPC", "<", "V", ">", "handleLocal", "(", ")", "{", "assert", "_dt", ".", "getCompleter", "(", ")", "==", "null", ";", "_dt", ".", "setCompleter", "(", "new", "H2O", ".", "H2OCallback", "<", "DTask", ">", "(", ")", "{", "@", "Override", ...
If running on self, just submit to queues & do locally
[ "If", "running", "on", "self", "just", "submit", "to", "queues", "&", "do", "locally" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L137-L162
131,291
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.get
@Override public V get() { // check priorities - FJ task can only block on a task with higher priority! Thread cThr = Thread.currentThread(); int priority = (cThr instanceof FJWThr) ? ((FJWThr)cThr)._priority : -1; assert _dt.priority() > priority || (_dt.priority() == priority && _dt instanceof MRTask)...
java
@Override public V get() { // check priorities - FJ task can only block on a task with higher priority! Thread cThr = Thread.currentThread(); int priority = (cThr instanceof FJWThr) ? ((FJWThr)cThr)._priority : -1; assert _dt.priority() > priority || (_dt.priority() == priority && _dt instanceof MRTask)...
[ "@", "Override", "public", "V", "get", "(", ")", "{", "// check priorities - FJ task can only block on a task with higher priority!", "Thread", "cThr", "=", "Thread", ".", "currentThread", "(", ")", ";", "int", "priority", "=", "(", "cThr", "instanceof", "FJWThr", "...
Throws a DException if the remote throws, wrapping the original exception.
[ "Throws", "a", "DException", "if", "the", "remote", "throws", "wrapping", "the", "original", "exception", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L247-L260
131,292
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.cancel
@Override public final boolean cancel( boolean mayInterruptIfRunning ) { boolean did = false; synchronized(this) { // Install the answer under lock if( !isCancelled() ) { did = true; // Did cancel (was not cancelled already) _target.taskRemove(_tasknum); _target ...
java
@Override public final boolean cancel( boolean mayInterruptIfRunning ) { boolean did = false; synchronized(this) { // Install the answer under lock if( !isCancelled() ) { did = true; // Did cancel (was not cancelled already) _target.taskRemove(_tasknum); _target ...
[ "@", "Override", "public", "final", "boolean", "cancel", "(", "boolean", "mayInterruptIfRunning", ")", "{", "boolean", "did", "=", "false", ";", "synchronized", "(", "this", ")", "{", "// Install the answer under lock", "if", "(", "!", "isCancelled", "(", ")", ...
Attempt to cancel job
[ "Attempt", "to", "cancel", "job" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L281-L293
131,293
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.tcp_ack
static void tcp_ack( final AutoBuffer ab ) throws IOException { // Get the RPC we're waiting on int task = ab.getTask(); RPC rpc = ab._h2o.taskGet(task); // Race with canceling a large RPC fetch: Task is already dead. Do not // bother reading from the TCP socket, just bail out & close socket. i...
java
static void tcp_ack( final AutoBuffer ab ) throws IOException { // Get the RPC we're waiting on int task = ab.getTask(); RPC rpc = ab._h2o.taskGet(task); // Race with canceling a large RPC fetch: Task is already dead. Do not // bother reading from the TCP socket, just bail out & close socket. i...
[ "static", "void", "tcp_ack", "(", "final", "AutoBuffer", "ab", ")", "throws", "IOException", "{", "// Get the RPC we're waiting on", "int", "task", "=", "ab", ".", "getTask", "(", ")", ";", "RPC", "rpc", "=", "ab", ".", "_h2o", ".", "taskGet", "(", "task",...
reader thread.
[ "reader", "thread", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L536-L570
131,294
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.ackack
static AutoBuffer ackack( AutoBuffer ab, int tnum ) { return ab.clearForWriting(H2O.ACK_ACK_PRIORITY).putTask(UDP.udp.ackack.ordinal(),tnum); }
java
static AutoBuffer ackack( AutoBuffer ab, int tnum ) { return ab.clearForWriting(H2O.ACK_ACK_PRIORITY).putTask(UDP.udp.ackack.ordinal(),tnum); }
[ "static", "AutoBuffer", "ackack", "(", "AutoBuffer", "ab", ",", "int", "tnum", ")", "{", "return", "ab", ".", "clearForWriting", "(", "H2O", ".", "ACK_ACK_PRIORITY", ")", ".", "putTask", "(", "UDP", ".", "udp", ".", "ackack", ".", "ordinal", "(", ")", ...
On all paths, send an ACKACK back
[ "On", "all", "paths", "send", "an", "ACKACK", "back" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L575-L577
131,295
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.sz_check
private boolean sz_check(AutoBuffer ab) { final int absize = ab.size(); if( _size == 0 ) { _size = absize; return true; } return _size==absize; }
java
private boolean sz_check(AutoBuffer ab) { final int absize = ab.size(); if( _size == 0 ) { _size = absize; return true; } return _size==absize; }
[ "private", "boolean", "sz_check", "(", "AutoBuffer", "ab", ")", "{", "final", "int", "absize", "=", "ab", ".", "size", "(", ")", ";", "if", "(", "_size", "==", "0", ")", "{", "_size", "=", "absize", ";", "return", "true", ";", "}", "return", "_size...
i.e., resends sent identical data.
[ "i", ".", "e", ".", "resends", "sent", "identical", "data", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L641-L645
131,296
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.getDelay
@Override public final long getDelay( TimeUnit unit ) { long delay = (_started+_retry)-System.currentTimeMillis(); return unit.convert( delay, TimeUnit.MILLISECONDS ); }
java
@Override public final long getDelay( TimeUnit unit ) { long delay = (_started+_retry)-System.currentTimeMillis(); return unit.convert( delay, TimeUnit.MILLISECONDS ); }
[ "@", "Override", "public", "final", "long", "getDelay", "(", "TimeUnit", "unit", ")", "{", "long", "delay", "=", "(", "_started", "+", "_retry", ")", "-", "System", ".", "currentTimeMillis", "(", ")", ";", "return", "unit", ".", "convert", "(", "delay", ...
How long until we should do the "timeout" action?
[ "How", "long", "until", "we", "should", "do", "the", "timeout", "action?" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L652-L655
131,297
h2oai/h2o-3
h2o-core/src/main/java/water/RPC.java
RPC.compareTo
@Override public final int compareTo( Delayed t ) { RPC<?> dt = (RPC<?>)t; long nextTime = _started+_retry, dtNextTime = dt._started+dt._retry; return nextTime == dtNextTime ? 0 : (nextTime > dtNextTime ? 1 : -1); }
java
@Override public final int compareTo( Delayed t ) { RPC<?> dt = (RPC<?>)t; long nextTime = _started+_retry, dtNextTime = dt._started+dt._retry; return nextTime == dtNextTime ? 0 : (nextTime > dtNextTime ? 1 : -1); }
[ "@", "Override", "public", "final", "int", "compareTo", "(", "Delayed", "t", ")", "{", "RPC", "<", "?", ">", "dt", "=", "(", "RPC", "<", "?", ">", ")", "t", ";", "long", "nextTime", "=", "_started", "+", "_retry", ",", "dtNextTime", "=", "dt", "....
Needed for the DelayQueue API
[ "Needed", "for", "the", "DelayQueue", "API" ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/RPC.java#L657-L661
131,298
h2oai/h2o-3
h2o-core/src/main/java/hex/ScoringInfo.java
ScoringInfo.scoreKeepers
public static ScoreKeeper[] scoreKeepers(ScoringInfo[] scoring_history) { ScoreKeeper[] sk = new ScoreKeeper[scoring_history.length]; for (int i=0;i<sk.length;++i) { sk[i] = scoring_history[i].cross_validation ? scoring_history[i].scored_xval : scoring_history[i].validation ? scoring_history...
java
public static ScoreKeeper[] scoreKeepers(ScoringInfo[] scoring_history) { ScoreKeeper[] sk = new ScoreKeeper[scoring_history.length]; for (int i=0;i<sk.length;++i) { sk[i] = scoring_history[i].cross_validation ? scoring_history[i].scored_xval : scoring_history[i].validation ? scoring_history...
[ "public", "static", "ScoreKeeper", "[", "]", "scoreKeepers", "(", "ScoringInfo", "[", "]", "scoring_history", ")", "{", "ScoreKeeper", "[", "]", "sk", "=", "new", "ScoreKeeper", "[", "scoring_history", ".", "length", "]", ";", "for", "(", "int", "i", "=", ...
For a given array of ScoringInfo return an array of the cross-validation, validation or training ScoreKeepers, as available.
[ "For", "a", "given", "array", "of", "ScoringInfo", "return", "an", "array", "of", "the", "cross", "-", "validation", "validation", "or", "training", "ScoreKeepers", "as", "available", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/ScoringInfo.java#L58-L66
131,299
h2oai/h2o-3
h2o-core/src/main/java/water/rapids/vals/ValRow.java
ValRow.slice
public ValRow slice(int[] cols) { double[] ds = new double[cols.length]; String[] ns = new String[cols.length]; for (int i = 0; i < cols.length; ++i) { ds[i] = _ds[cols[i]]; ns[i] = _names[cols[i]]; } return new ValRow(ds, ns); }
java
public ValRow slice(int[] cols) { double[] ds = new double[cols.length]; String[] ns = new String[cols.length]; for (int i = 0; i < cols.length; ++i) { ds[i] = _ds[cols[i]]; ns[i] = _names[cols[i]]; } return new ValRow(ds, ns); }
[ "public", "ValRow", "slice", "(", "int", "[", "]", "cols", ")", "{", "double", "[", "]", "ds", "=", "new", "double", "[", "cols", ".", "length", "]", ";", "String", "[", "]", "ns", "=", "new", "String", "[", "cols", ".", "length", "]", ";", "fo...
Creates a new ValRow by selecting elements at the specified indices. @param cols array of indices to select. We do not check for AIOOB errors. @return new ValRow object
[ "Creates", "a", "new", "ValRow", "by", "selecting", "elements", "at", "the", "specified", "indices", "." ]
845eb49dfeaadf638b6e2f779d82fac996391fad
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/vals/ValRow.java#L37-L45