File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
multiclass_classification Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ fn main() {
97
97
let mut data = Vec :: new ( ) ;
98
98
99
99
let reader = BufReader :: new ( File :: open ( "../../xgboost-sys/xgboost/demo/data/agaricus.txt.train" ) . unwrap ( ) ) ;
100
- let mut current_row = 0 ;
100
+ let mut current_row: u64 = 0 ;
101
101
for line in reader. lines ( ) {
102
102
let line = line. unwrap ( ) ;
103
103
let sample: Vec < & str > = line. split_whitespace ( ) . collect ( ) ;
@@ -106,16 +106,16 @@ fn main() {
106
106
for entry in & sample[ 1 ..] {
107
107
let pair: Vec < & str > = entry. split ( ':' ) . collect ( ) ;
108
108
rows. push ( current_row) ;
109
- cols. push ( pair[ 0 ] . parse :: < usize > ( ) . unwrap ( ) ) ;
109
+ cols. push ( pair[ 0 ] . parse :: < u64 > ( ) . unwrap ( ) ) ;
110
110
data. push ( pair[ 1 ] . parse :: < f32 > ( ) . unwrap ( ) ) ;
111
111
}
112
112
113
113
current_row += 1 ;
114
114
}
115
115
116
116
// work out size of sparse matrix from max row/col values
117
- let shape = ( * rows. iter ( ) . max ( ) . unwrap ( ) + 1 as usize ,
118
- * cols. iter ( ) . max ( ) . unwrap ( ) + 1 as usize ) ;
117
+ let shape = ( ( * rows. iter ( ) . max ( ) . unwrap ( ) + 1 ) as usize ,
118
+ ( * cols. iter ( ) . max ( ) . unwrap ( ) + 1 ) as usize ) ;
119
119
let triplet_mat = sprs:: TriMatBase :: from_triplets ( shape, rows, cols, data) ;
120
120
let csr_mat = triplet_mat. to_csr ( ) ;
121
121
Original file line number Diff line number Diff line change @@ -8,4 +8,4 @@ publish = false
8
8
xgboost = { path = " ../../" }
9
9
log = " 0.4"
10
10
env_logger = " 0.5"
11
- reqwest = " 0.8 "
11
+ reqwest = { version = " 0.11 " , features = [ " blocking " ] }
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ fn download_dataset<P: AsRef<Path>>(dst: P) {
73
73
}
74
74
75
75
debug ! ( "Fetching training dataset from {}" , url) ;
76
- let mut response = reqwest:: get ( url) . expect ( "failed to download training set data" ) ;
76
+ let mut response = reqwest:: blocking :: get ( url) . expect ( "failed to download training set data" ) ;
77
77
78
78
let file = File :: create ( dst) . expect ( & format ! ( "failed to create file {}" , dst. display( ) ) ) ;
79
79
let mut writer = BufWriter :: new ( file) ;
You can’t perform that action at this time.
0 commit comments