13 #ifndef MLPACK_CORE_DATA_BINARIZE_HPP 14 #define MLPACK_CORE_DATA_BINARIZE_HPP 43 const double threshold)
45 output.copy_size(input);
47 const T *inPtr = input.memptr();
48 T *outPtr = output.memptr();
50 #pragma omp parallel for 52 outPtr[i] = inPtr[i] > threshold;
79 const double threshold,
80 const size_t dimension)
84 #pragma omp parallel for 86 output(dimension, i) = input(dimension, i) > threshold;
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Binarize(const arma::Mat< T > &input, arma::Mat< T > &output, const double threshold)
Given an input dataset and threshold, set values greater than threshold to 1 and values less than or ...