Package ai.djl.ml.xgboost
Class XgbNDManager
java.lang.Object
ai.djl.ndarray.BaseNDManager
ai.djl.ml.xgboost.XgbNDManager
- All Implemented Interfaces:
ai.djl.ndarray.NDManager,AutoCloseable
public class XgbNDManager
extends ai.djl.ndarray.BaseNDManager
XgbNDManager is the XGBoost implementation of NDManager.-
Nested Class Summary
Nested classes/interfaces inherited from class ai.djl.ndarray.BaseNDManager
ai.djl.ndarray.BaseNDManager.TempResourceNested classes/interfaces inherited from interface ai.djl.ndarray.NDManager
ai.djl.ndarray.NDManager.SystemNDManager -
Field Summary
Fields inherited from class ai.djl.ndarray.BaseNDManager
alternativeManager, capped, closed, device, name, parent, resources, tempResources, uid -
Method Summary
Modifier and TypeMethodDescriptionallocateDirect(int capacity) voidclose()ai.djl.ndarray.NDArrayai.djl.ndarray.NDArraycreate(ml.dmlc.xgboost4j.java.ColumnBatch columnBatch, float missing, int nthread) CreatesXgbNDArrayfrom column array interface.ai.djl.ndarray.NDArrayfrom(ai.djl.ndarray.NDArray array) ai.djl.engine.Engineai.djl.ndarray.NDManagernewSubManager(ai.djl.Device device) voidsetMissingValue(float missingValue) Sets the default missing value.voidsetNthread(int nthread) Sets the default number of threads.Methods inherited from class ai.djl.ndarray.BaseNDManager
arange, attachInternal, attachUncappedInternal, cap, copyBuffer, create, create, createCoo, createRowSparse, debugDump, defaultDevice, detachInternal, eye, full, getDevice, getManagedArrays, getName, getParentManager, invoke, invoke, isOpen, linspace, load, newSubManager, randomInteger, randomMultinomial, randomMultinomial, randomNormal, randomPermutation, randomUniform, sampleGamma, sampleGamma, sampleNormal, sampleNormal, samplePoisson, samplePoisson, setName, tempAttachInternal, toString, truncatedNormal, validateBufferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.djl.ndarray.NDManager
arange, arange, arange, arange, arange, arange, arange, arange, attachAll, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, createCSR, createCSR, createRowSparse, decode, decode, eye, eye, eye, eye, full, full, full, hanningWindow, linspace, linspace, linspace, linspace, load, ones, ones, ones, randomNormal, randomNormal, randomNormal, randomUniform, randomUniform, ret, tempAttachAll, truncatedNormal, truncatedNormal, truncatedNormal, zeros, zeros, zeros
-
Method Details
-
setMissingValue
public void setMissingValue(float missingValue) Sets the default missing value.- Parameters:
missingValue- the default missing value
-
setNthread
public void setNthread(int nthread) Sets the default number of threads.- Parameters:
nthread- the default number of threads
-
allocateDirect
-
from
-
newSubManager
public ai.djl.ndarray.NDManager newSubManager(ai.djl.Device device) -
getEngine
public ai.djl.engine.Engine getEngine() -
create
public ai.djl.ndarray.NDArray create(ml.dmlc.xgboost4j.java.ColumnBatch columnBatch, float missing, int nthread) CreatesXgbNDArrayfrom column array interface.- Parameters:
columnBatch- – the XGBoost ColumnBatch to provide the cuda array interface of feature columnsmissing- – missing valuenthread- – threads number- Returns:
- a new instance of
NDArray
-
create
public ai.djl.ndarray.NDArray create(Buffer data, ai.djl.ndarray.types.Shape shape, ai.djl.ndarray.types.DataType dataType) -
createCSR
public ai.djl.ndarray.NDArray createCSR(Buffer buffer, long[] indptr, long[] indices, ai.djl.ndarray.types.Shape shape) - Specified by:
createCSRin interfaceai.djl.ndarray.NDManager- Overrides:
createCSRin classai.djl.ndarray.BaseNDManager
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceai.djl.ndarray.NDManager- Overrides:
closein classai.djl.ndarray.BaseNDManager
-