Skip to content

Commit

Permalink
Fix #21 while reading sparse datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
fcharte committed Oct 28, 2015
1 parent fdbb94f commit 46fc4aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
@@ -1,5 +1,7 @@
# Changelog

* Fix bug #21 when reading sparse datasets introducing zeroes instead of NAs

## mldr 0.2.82

* Fix bug in demo code for rebuilding an mldr object
Expand Down
2 changes: 1 addition & 1 deletion R/read.arff.R
Expand Up @@ -163,7 +163,7 @@ parse_sparse_data <- function(arff_data, num_attrs) {

# Build complete matrix with data
dataset <- sapply(arff_data, function(row) {
complete <- NA[1:num_attrs]
complete <- rep(0, num_attrs)
complete[as.integer(row[c(T, F)]) + 1] <- row[c(F, T)]
complete
})
Expand Down

0 comments on commit 46fc4aa

Please sign in to comment.