There are a variety of file formats used for datasets, and not all of them might be supported by libraries. For using data from unsupported formats, we might need to write custom parsers. After we read values to regular C++ containers, we usually need to convert them into object types used in the machine learning framework we use. As an example, let's consider the case of reading matrix data from files into C++ objects.
Initializing matrix and tensor objects from C++ data structures
Eigen
Using the Eigen library, we can wrap a C++ array into the Eigen::Matrix object with the Eigen::Map type. The wrapped object will behave as a standard Eigen matrix. We have to parametrize the Eigen::Map type with the type of matrix that...