class DMatrix extends AnyRef
- Alphabetic
- By Inheritance
- DMatrix
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
DMatrix(data: Array[Float], nrow: Int, ncol: Int, missing: Float)
create DMatrix from dense matrix
create DMatrix from dense matrix
- data
data values
- nrow
number of rows
- ncol
number of columns
- missing
the specified value to represent the missing value
- Annotations
- @throws( classOf[XGBoostError] )
-
new
DMatrix(columnBatch: ColumnBatch, missing: Float, nthread: Int)
Create the normal DMatrix from column array interface
Create the normal DMatrix from column array interface
- columnBatch
the XGBoost ColumnBatch to provide the cuda array interface of feature columns
- missing
missing value
- nthread
The number of threads used for constructing DMatrix
- Annotations
- @throws( classOf[XGBoostError] )
-
new
DMatrix(headers: Array[Long], indices: Array[Int], data: Array[Float], st: SparseType, shapeParam: Int, missing: Float, nthread: Int)
create DMatrix from sparse matrix
create DMatrix from sparse matrix
- headers
index to headers (rowHeaders for CSR or colHeaders for CSC)
- indices
Indices (colIndexs for CSR or rowIndexs for CSC)
- data
non zero values (sequence by row for CSR or by col for CSC)
- st
sparse matrix type (CSR or CSC)
- shapeParam
when st is CSR, it specifies the column number, otherwise it is taken as row number
- missing
missing value
- nthread
The number of threads used for constructing DMatrix
- Annotations
- @throws( classOf[XGBoostError] )
-
new
DMatrix(headers: Array[Long], indices: Array[Int], data: Array[Float], st: SparseType, shapeParam: Int)
create DMatrix from sparse matrix
create DMatrix from sparse matrix
- headers
index to headers (rowHeaders for CSR or colHeaders for CSC)
- indices
Indices (colIndexs for CSR or rowIndexs for CSC)
- data
non zero values (sequence by row for CSR or by col for CSC)
- st
sparse matrix type (CSR or CSC)
- shapeParam
when st is CSR, it specifies the column number, otherwise it is taken as row number
- Annotations
- @throws( classOf[XGBoostError] )
-
new
DMatrix(dataIter: Iterator[LabeledPoint], cacheInfo: String = null)
init DMatrix from Iterator of LabeledPoint
init DMatrix from Iterator of LabeledPoint
- dataIter
An iterator of LabeledPoint
- cacheInfo
Cache path information, used for external memory setting, null by default.
- Exceptions thrown
XGBoostError
native error
-
new
DMatrix(dataPath: String)
init DMatrix from file (svmlight format)
init DMatrix from file (svmlight format)
- dataPath
path of data file
- Exceptions thrown
XGBoostError
native error
-
new
DMatrix(data: Array[Float], nrow: Int, ncol: Int)
create DMatrix from dense matrix
create DMatrix from dense matrix
- data
data values
- nrow
number of rows
- ncol
number of columns
- Annotations
- @deprecated @throws( classOf[XGBoostError] )
- Deprecated
(Since version XGBoost 1.5) Please specify the missing value explicitly
-
new
DMatrix(headers: Array[Long], indices: Array[Int], data: Array[Float], st: SparseType)
create DMatrix from sparse matrix
create DMatrix from sparse matrix
- headers
index to headers (rowHeaders for CSR or colHeaders for CSC)
- indices
Indices (colIndexs for CSR or rowIndexs for CSC)
- data
non zero values (sequence by row for CSR or by col for CSC)
- st
sparse matrix type (CSR or CSC)
- Annotations
- @throws( classOf[XGBoostError] ) @deprecated
- Deprecated
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def delete(): Unit
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
getBaseMargin: Array[Float]
get base margin of the DMatrix
get base margin of the DMatrix
- returns
base margin
- Annotations
- @throws( classOf[XGBoostError] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getFeatureNames: Array[String]
get feature names
get feature names
- Annotations
- @throws( classOf[XGBoostError] )
- Exceptions thrown
-
def
getFeatureTypes: Array[String]
get feature types
get feature types
- Annotations
- @throws( classOf[XGBoostError] )
- Exceptions thrown
-
def
getGroup(): Array[Int]
Get group sizes of DMatrix (used for ranking)
Get group sizes of DMatrix (used for ranking)
- Annotations
- @throws( classOf[XGBoostError] )
- def getHandle: Long
-
def
getLabel: Array[Float]
get label values
get label values
- returns
label
- Annotations
- @throws( classOf[XGBoostError] )
-
def
getWeight: Array[Float]
get weight of the DMatrix
get weight of the DMatrix
- returns
weights
- Annotations
- @throws( classOf[XGBoostError] )
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nonMissingNum: Long
Get the number of non-missing values of DMatrix.
Get the number of non-missing values of DMatrix.
- returns
The number of non-missing values
- Annotations
- @throws( classOf[XGBoostError] )
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
rowNum: Long
get the row number of DMatrix
get the row number of DMatrix
- returns
number of rows
- Annotations
- @throws( classOf[XGBoostError] )
-
def
saveBinary(filePath: String): Unit
save DMatrix to filePath
save DMatrix to filePath
- filePath
file path
-
def
setBaseMargin(column: Column): Unit
set base margin of dmatrix from column array interface
set base margin of dmatrix from column array interface
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setBaseMargin(baseMargin: Array[Array[Float]]): Unit
if specified, xgboost will start from this init margin can be used to specify initial prediction to boost from
if specified, xgboost will start from this init margin can be used to specify initial prediction to boost from
- baseMargin
base margin
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setBaseMargin(baseMargin: Array[Float]): Unit
if specified, xgboost will start from this init margin can be used to specify initial prediction to boost from
if specified, xgboost will start from this init margin can be used to specify initial prediction to boost from
- baseMargin
base margin
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setFeatureNames(values: Array[String]): Unit
set feature names
set feature names
- values
feature names
- Annotations
- @throws( classOf[XGBoostError] )
- Exceptions thrown
-
def
setFeatureTypes(values: Array[String]): Unit
set feature types
set feature types
- values
feature types
- Annotations
- @throws( classOf[XGBoostError] )
- Exceptions thrown
-
def
setGroup(group: Array[Int]): Unit
Set group sizes of DMatrix (used for ranking)
Set group sizes of DMatrix (used for ranking)
- group
group size as array
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setLabel(column: Column): Unit
Set label of DMatrix from cuda array interface
Set label of DMatrix from cuda array interface
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setLabel(labels: Array[Float]): Unit
set label of dmatrix
set label of dmatrix
- labels
labels
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setWeight(column: Column): Unit
set weight of dmatrix from column array interface
set weight of dmatrix from column array interface
- Annotations
- @throws( classOf[XGBoostError] )
-
def
setWeight(weights: Array[Float]): Unit
set weight of each instance
set weight of each instance
- weights
weights
- Annotations
- @throws( classOf[XGBoostError] )
-
def
slice(rowIndex: Array[Int]): DMatrix
Slice the DMatrix and return a new DMatrix that only contains
rowIndex
.Slice the DMatrix and return a new DMatrix that only contains
rowIndex
.- rowIndex
row index
- returns
sliced new DMatrix
- Annotations
- @throws( classOf[XGBoostError] )
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()