-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
451 additions
and
5 deletions.
There are no files selected for viewing
Submodule dmlc-core
updated
4 files
+13 −0 | tracker/dmlc_tracker/launcher.py | |
+5 −0 | tracker/dmlc_tracker/opts.py | |
+63 −2 | tracker/dmlc_tracker/tracker.py | |
+6 −0 | tracker/dmlc_tracker/yarn.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/DataBatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package ml.dmlc.xgboost4j; | ||
|
||
/** | ||
* A mini-batch of data that can be converted to DMatrix. | ||
* The data is in sparse matrix CSR format. | ||
* | ||
* Usually this object is not needed. | ||
* | ||
* This class is used to support advanced creation of DMatrix from Iterator of DataBatch, | ||
*/ | ||
public class DataBatch { | ||
/** The offset of each rows in the sparse matrix */ | ||
long[] rowOffset = null; | ||
/** weight of each data point, can be null */ | ||
float[] weight = null; | ||
/** label of each data point, can be null */ | ||
float[] label = null; | ||
/** index of each feature(column) in the sparse matrix */ | ||
int[] featureIndex = null; | ||
/** value of each non-missing entry in the sparse matrix */ | ||
float[] featureValue = null; | ||
/** | ||
* Get number of rows in the data batch. | ||
* @return Number of rows in the data batch. | ||
*/ | ||
public int numRows() { | ||
return rowOffset.length - 1; | ||
} | ||
|
||
/** | ||
* Shallow copy a DataBatch | ||
* @return a copy of the batch | ||
*/ | ||
public DataBatch shallowCopy() { | ||
DataBatch b = new DataBatch(); | ||
b.rowOffset = this.rowOffset; | ||
b.weight = this.weight; | ||
b.label = this.label; | ||
b.featureIndex = this.featureIndex; | ||
b.featureValue = this.featureValue; | ||
return b; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.