rename files/packages
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -21,7 +21,6 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
/**
|
||||
* test cases for Booster
|
||||
@@ -43,7 +42,7 @@ public class BoosterImplTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float eval(float[][] predicts, org.dmlc.xgboost4j.DMatrix dmat) {
|
||||
public float eval(float[][] predicts, DMatrix dmat) {
|
||||
float error = 0f;
|
||||
float[] labels;
|
||||
try {
|
||||
@@ -67,8 +66,8 @@ public class BoosterImplTest {
|
||||
|
||||
@Test
|
||||
public void testBoosterBasic() throws XGBoostError {
|
||||
org.dmlc.xgboost4j.DMatrix trainMat = new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.train");
|
||||
org.dmlc.xgboost4j.DMatrix testMat = new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.test");
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
|
||||
//set params
|
||||
Map<String, Object> paramMap = new HashMap<String, Object>() {
|
||||
@@ -81,7 +80,7 @@ public class BoosterImplTest {
|
||||
};
|
||||
|
||||
//set watchList
|
||||
HashMap<String, org.dmlc.xgboost4j.DMatrix> watches = new HashMap<>();
|
||||
HashMap<String, DMatrix> watches = new HashMap<>();
|
||||
|
||||
watches.put("train", trainMat);
|
||||
watches.put("test", testMat);
|
||||
@@ -112,7 +111,7 @@ public class BoosterImplTest {
|
||||
@Test
|
||||
public void testCV() throws XGBoostError {
|
||||
//load train mat
|
||||
org.dmlc.xgboost4j.DMatrix trainMat = new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
|
||||
//set params
|
||||
Map<String, Object> param = new HashMap<String, Object>() {
|
||||
@@ -13,10 +13,9 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
package org.dmlc.xgboost4j;
|
||||
package ml.dmlc.xgboost4j;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.dmlc.xgboost4j.*;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -32,7 +31,7 @@ public class DMatrixTest {
|
||||
@Test
|
||||
public void testCreateFromFile() throws XGBoostError {
|
||||
//create DMatrix from file
|
||||
org.dmlc.xgboost4j.DMatrix dmat = new org.dmlc.xgboost4j.DMatrix("../../demo/data/agaricus.txt.test");
|
||||
DMatrix dmat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
//get label
|
||||
float[] labels = dmat.getLabel();
|
||||
//check length
|
||||
@@ -56,7 +55,7 @@ public class DMatrixTest {
|
||||
float[] data = new float[]{1, 2, 3, 4, 2, 3, 5, 3, 1, 2, 5};
|
||||
int[] colIndex = new int[]{0, 2, 3, 0, 2, 3, 4, 0, 1, 2, 3};
|
||||
long[] rowHeaders = new long[]{0, 3, 7, 11};
|
||||
org.dmlc.xgboost4j.DMatrix dmat1 = new org.dmlc.xgboost4j.DMatrix(rowHeaders, colIndex, data, org.dmlc.xgboost4j.DMatrix.SparseType.CSR);
|
||||
DMatrix dmat1 = new DMatrix(rowHeaders, colIndex, data, DMatrix.SparseType.CSR);
|
||||
//check row num
|
||||
System.out.println(dmat1.rowNum());
|
||||
TestCase.assertTrue(dmat1.rowNum() == 3);
|
||||
@@ -85,7 +84,7 @@ public class DMatrixTest {
|
||||
label0[i] = random.nextFloat();
|
||||
}
|
||||
|
||||
org.dmlc.xgboost4j.DMatrix dmat0 = new org.dmlc.xgboost4j.DMatrix(data0, nrow, ncol);
|
||||
DMatrix dmat0 = new DMatrix(data0, nrow, ncol);
|
||||
dmat0.setLabel(label0);
|
||||
|
||||
//check
|
||||
Reference in New Issue
Block a user