[mlpack-git] master: refine comments (b5790a0)
gitdub at mlpack.org
gitdub at mlpack.org
Tue Apr 12 19:40:40 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/ebf77f8b13323a87c433b6f639deb2369188b00c...b08ae02b90e18f97366b236e7a4d8725cd6e9050
>---------------------------------------------------------------
commit b5790a0030b99f4999264f10a48584b6670dafcf
Author: stereomatchingkiss <stereomatchingkiss at gmail.com>
Date: Wed Apr 13 07:40:40 2016 +0800
refine comments
>---------------------------------------------------------------
b5790a0030b99f4999264f10a48584b6670dafcf
src/mlpack/core/util/split_data.hpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/mlpack/core/util/split_data.hpp b/src/mlpack/core/util/split_data.hpp
index 32ccaa6..fc695c7 100644
--- a/src/mlpack/core/util/split_data.hpp
+++ b/src/mlpack/core/util/split_data.hpp
@@ -29,8 +29,7 @@ namespace util {
*arma::mat testData;
*arma::Row<size_t> trainLabel;
*arma::Row<size_t> testLabel;
- *std::random_device rd;
- *TrainTestSplit tts(0.25);
+ *arma::arma_rng::set_seed(100); //set the seed if you like
*TrainTestSplit(input, label, trainData,
* testData, trainLabel, testLabel);
*@endcode
@@ -77,6 +76,11 @@ void TrainTestSplit(arma::Mat<T> const &input,
*@param label input label want to split
*@return They are trainData, testData, trainLabel and
*testLabel
+ *@code
+ *arma::mat input = loadData();
+ *arma::Row<size_t> label = loadLabel();
+ *auto splitResult = TrainTestSplit(input, label, 0.2);
+ *@endcode
*/
template<typename T,typename U>
std::tuple<arma::Mat<T>, arma::Mat<T>,
More information about the mlpack-git
mailing list