[mlpack-git] [mlpack/mlpack] Wrong number of mapping (#658)

Keon Kim notifications at github.com
Sun May 29 15:36:41 EDT 2016


For testing purpose, I Loaded a simple csv like the one below.
```
1, 1, 1
1, 1, 1
  , 1, 1  <-- intentionally put missing value here
1, 1, 1
```
But it recognizes wrong number of mappings and modifies the csv in a wrong way.
```
[INFO ]         0       1.0000   1.0000   1.0000
[INFO ]         0       1.0000   1.0000   1.0000
[INFO ]    1.0000   1.0000   1.0000   1.0000
[INFO ] 
[INFO ] dataset info: 
[INFO ] 2 mappings in dimension 0.
[INFO ] 0 mappings in dimension 1.
[INFO ] 0 mappings in dimension 2.
```
Funny thing is that when I tried this,
```
1, 1, 1
  , 1, 1 <-- intentionally put missing value here
1, 1, 1
1, 1, 1
```
the result was different
```
[INFO ]         0       1.0000   1.0000   1.0000
[INFO ]    1.0000   1.0000   1.0000   1.0000
[INFO ]    1.0000   1.0000   1.0000   1.0000
[INFO ] 
[INFO ] dataset info: 
[INFO ] 2 mappings in dimension 0.
[INFO ] 0 mappings in dimension 1.
[INFO ] 0 mappings in dimension 2.
```
And the lastly when I tried with the following,
```
  , 1, 1  <-- intentionally put missing value here
1, 1, 1
1, 1, 1
1, 1, 1
```
It finally showed the right number of mappings
```
[INFO ]         0   1.0000   1.0000   1.0000
[INFO ]    1.0000   1.0000   1.0000   1.0000
[INFO ]    1.0000   1.0000   1.0000   1.0000
[INFO ] 
[INFO ] dataset info: 
[INFO ] 1 mappings in dimension 0.
[INFO ] 0 mappings in dimension 1.
[INFO ] 0 mappings in dimension 2.
```

The code I used for loading the file is:
```
  arma::mat data;
  data::DatasetInfo info;
  data::Load(inputFile, data, info,  true);
  Log::Info << data << endl;

  Log::Info << "dataset info: " << endl;
  for (size_t i = 0; i < data.n_rows; ++i)
  {
    Log::Info << info.NumMappings(i) << " mappings in dimension "
        << i << "." << endl;
  }
```

Thanks for reading this long post.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/658
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160529/6ca65b2e/attachment.html>


More information about the mlpack-git mailing list