wrapped up lines and some minor corrections
This commit is contained in:
@@ -29,10 +29,6 @@ void LoadARFF(const std::string& filename,
|
||||
// First, open the file.
|
||||
std::ifstream ifs;
|
||||
ifs.open(filename, std::ios::in | std::ios::binary);
|
||||
if (!ifs.is_open())
|
||||
{
|
||||
Log::Fatal << "Cannot open file '" << filename << "'. " << std::endl;
|
||||
}
|
||||
|
||||
// if file is not open throw an error (file not found).
|
||||
if (!ifs.is_open())
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
* @file one_hot_encoding.hpp
|
||||
* @author Jeffin Sam
|
||||
*
|
||||
* One hot encoding functions
|
||||
* The purpose of this function is to convert
|
||||
* One hot encoding functions .The purpose of this function is to convert
|
||||
* categorical variables as binary vectors.
|
||||
*
|
||||
* mlpack is free software; you may redistribute it and/or modify it under the
|
||||
@@ -33,7 +32,6 @@ template<typename eT, typename RowType>
|
||||
void OneHotEncoding(const RowType& labelsIn,
|
||||
arma::Mat<eT>& output);
|
||||
|
||||
|
||||
} // namespace data
|
||||
} // namespace mlpack
|
||||
|
||||
|
||||
@@ -920,7 +920,7 @@ BOOST_AUTO_TEST_CASE(OneHotEncodingTest)
|
||||
"1 0;"
|
||||
"0 1;"
|
||||
"1 0;";
|
||||
// output matrix
|
||||
// Output matrix to save onehotencoding results.
|
||||
arma::Mat<size_t> output;
|
||||
arma::irowvec labels("-1 1 -1 -1 -1 -1 1 -1");
|
||||
data::OneHotEncoding(labels, output);
|
||||
|
||||
Reference in New Issue
Block a user