Skip to content

Commit

Permalink
fix zero-based format bug in scikit
Browse files Browse the repository at this point in the history
  • Loading branch information
QinbinLi committed Aug 10, 2018
1 parent 158cdc5 commit 05de37f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/thundersvm/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@ void DataSet::load_from_sparse(int row_size, float* val, int* row_ptr, int* col_
instances_.emplace_back();
for(int i = row_ptr[total_count_]; i < row_ptr[total_count_ + 1]; i++){
ind = col_ptr[i];
ind++; //convert to one-based format
v = val[i];
instances_[total_count_].emplace_back(ind, v);
if(ind > n_features_) n_features_ = ind;
}
total_count_++;

}
n_features_++;
// n_features_++;
LOG(INFO)<<"#instances = "<<this->n_instances()<<", #features = "<<this->n_features();

}
Expand Down

0 comments on commit 05de37f

Please sign in to comment.