[mlpack-git] [mlpack] add train test split (#523)
stereomatchingkiss
notifications at github.com
Sat Feb 27 19:12:25 EST 2016
>We can't just shuffle the dataset (data) because one set of the has 3 slices.
It can be done, but need some change.First part is the ExtractData
```
template<typename T>
void ExtractData(arma::Cube<T> const &input, arma::Cube<T> &output,
size_t inputIndex, size_t outputIndex) const
{
outputIndex *= slice;
inputIndex *= slice;
output.slices(outputIndex, outputIndex + slice - 1) =
input.slices(inputIndex, inputIndex + slice - 1);
}
```
Second part is augmentation the order of col(if you take solution 2)
```
arma::Col<size_t> augmentOrder(order.size()*slice);
for(size_t i = 0; i != order.size(); ++i){
for(size_t j = 0; j != slice; ++j){
augmentOrder(i*slice + j) = order(i);
}
}
```
>Actually I have a preference for solution 1
Then I would take the path of solution 1, this one could save some memory and maybe more intuitive for users.
---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/523#issuecomment-189751957
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160227/0360f487/attachment-0001.html>
More information about the mlpack-git
mailing list