load.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_CORE_DATA_LOAD_HPP
15 #define MLPACK_CORE_DATA_LOAD_HPP
16 
17 #include <mlpack/prereqs.hpp>
18 #include <mlpack/core/util/log.hpp>
19 #include <string>
20 
21 #include "format.hpp"
22 #include "dataset_mapper.hpp"
23 #include "detect_file_type.hpp"
24 #include "image_info.hpp"
25 #include "load_csv.hpp"
26 #include "load_arff.hpp"
27 #include "load_image.hpp"
28 
29 namespace mlpack {
30 namespace data {
31 
73 template<typename eT>
74 bool Load(const std::string& filename,
75  arma::Mat<eT>& matrix,
76  const bool fatal = false,
77  const bool transpose = true,
78  const FileType inputLoadType = FileType::AutoDetect);
79 
109 template<typename eT>
110 bool Load(const std::string& filename,
111  arma::SpMat<eT>& matrix,
112  const bool fatal = false,
113  const bool transpose = true);
114 
142 template<typename eT>
143 bool Load(const std::string& filename,
144  arma::Col<eT>& vec,
145  const bool fatal = false);
146 
174 template<typename eT>
175 bool Load(const std::string& filename,
176  arma::Row<eT>& rowvec,
177  const bool fatal = false);
178 
215 template<typename eT, typename PolicyType>
216 bool Load(const std::string& filename,
217  arma::Mat<eT>& matrix,
218  DatasetMapper<PolicyType>& info,
219  const bool fatal = false,
220  const bool transpose = true);
221 
247 template<typename T>
248 bool Load(const std::string& filename,
249  const std::string& name,
250  T& t,
251  const bool fatal = false,
253 
254 } // namespace data
255 } // namespace mlpack
256 
257 // Include implementation of Load() for matrix.
258 #include "load_impl.hpp"
259 // Include implementation of model-loading Load() overload.
260 #include "load_model_impl.hpp"
261 // Include implementation of Load() for vectors.
262 #include "load_vec_impl.hpp"
263 
264 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
format
Define the formats we can read through cereal.
Definition: format.hpp:20
The core includes that mlpack expects; standard C++ includes and Armadillo.
bool Load(const std::string &filename, arma::Mat< eT > &matrix, const bool fatal=false, const bool transpose=true, const FileType inputLoadType=FileType::AutoDetect)
Loads a matrix from file, guessing the filetype from the extension.
constexpr auto data(Container const &container) noexcept -> decltype(container.data())
Definition: iterator.hpp:79
attempt to automatically detect the file type