@@ -761,7 +761,8 @@ mod tests {
761
761
762
762
#[ test]
763
763
fn save_and_load_from_buffer ( ) {
764
- let dmat_train = DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
764
+ let dmat_train =
765
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
765
766
let mut booster = Booster :: new_with_cached_dmats ( & BoosterParameters :: default ( ) , & [ & dmat_train] ) . unwrap ( ) ;
766
767
let attr = booster. get_attribute ( "foo" ) . expect ( "Getting attribute failed" ) ;
767
768
assert_eq ! ( attr, None ) ;
@@ -804,8 +805,10 @@ mod tests {
804
805
805
806
#[ test]
806
807
fn predict ( ) {
807
- let dmat_train = DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
808
- let dmat_test =DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"# ) . unwrap ( ) ;
808
+ let dmat_train =
809
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
810
+ let dmat_test =
811
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"# ) . unwrap ( ) ;
809
812
810
813
let tree_params = tree:: TreeBoosterParametersBuilder :: default ( )
811
814
. max_depth ( 2 )
@@ -886,8 +889,10 @@ mod tests {
886
889
887
890
#[ test]
888
891
fn predict_leaf ( ) {
889
- let dmat_train = DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
890
- let dmat_test = DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"# ) . unwrap ( ) ;
892
+ let dmat_train =
893
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
894
+ let dmat_test =
895
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"# ) . unwrap ( ) ;
891
896
892
897
let tree_params = tree:: TreeBoosterParametersBuilder :: default ( )
893
898
. max_depth ( 2 )
@@ -919,8 +924,10 @@ mod tests {
919
924
920
925
#[ test]
921
926
fn predict_contributions ( ) {
922
- let dmat_train = DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
923
- let dmat_test = DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"# ) . unwrap ( ) ;
927
+ let dmat_train =
928
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
929
+ let dmat_test =
930
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"# ) . unwrap ( ) ;
924
931
925
932
let tree_params = tree:: TreeBoosterParametersBuilder :: default ( )
926
933
. max_depth ( 2 )
@@ -953,8 +960,10 @@ mod tests {
953
960
954
961
#[ test]
955
962
fn predict_interactions ( ) {
956
- let dmat_train = DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
957
- let dmat_test = DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"# ) . unwrap ( ) ;
963
+ let dmat_train =
964
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
965
+ let dmat_test =
966
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"# ) . unwrap ( ) ;
958
967
959
968
let tree_params = tree:: TreeBoosterParametersBuilder :: default ( )
960
969
. max_depth ( 2 )
@@ -1005,7 +1014,8 @@ mod tests {
1005
1014
1006
1015
#[ test]
1007
1016
fn dump_model ( ) {
1008
- let dmat_train = DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
1017
+ let dmat_train =
1018
+ DMatrix :: load ( r#"{"uri": "xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"# ) . unwrap ( ) ;
1009
1019
1010
1020
println ! ( "{:?}" , dmat_train. shape( ) ) ;
1011
1021
0 commit comments