Deep Learning Algorithm Implementations 1.0.0
C++ implementations of fundamental deep learning algorithms
Loading...
Searching...
No Matches
dl::utils::CSVLoader Class Reference

#include <data_loader.hpp>

Static Public Member Functions

static MatrixD load_csv (const std::string &filename, bool has_header=true, char delimiter=',')
 Load CSV file into a matrix.
 
static std::pair< MatrixD, MatrixDload_features_labels (const std::string &filename, const std::vector< size_t > &feature_cols, const std::vector< size_t > &label_cols, bool has_header=true, char delimiter=',')
 Load specific columns as features and labels.
 

Detailed Description

Definition at line 185 of file data_loader.hpp.

Member Function Documentation

◆ load_csv()

MatrixD dl::utils::CSVLoader::load_csv ( const std::string &  filename,
bool  has_header = true,
char  delimiter = ',' 
)
static

Load CSV file into a matrix.

Parameters
filenamePath to the CSV file
has_headerWhether the file contains a header row
delimiterCharacter used to separate values
Returns
Matrix containing the loaded data
Note
Missing values are handled by setting them to 0.0
Examples
/home/runner/work/deep-learning-algo-impls/deep-learning-algo-impls/include/utils/data_loader.hpp.

Definition at line 93 of file data_loader.cpp.

◆ load_features_labels()

std::pair< MatrixD, MatrixD > dl::utils::CSVLoader::load_features_labels ( const std::string &  filename,
const std::vector< size_t > &  feature_cols,
const std::vector< size_t > &  label_cols,
bool  has_header = true,
char  delimiter = ',' 
)
static

Load specific columns as features and labels.

Parameters
filenamePath to the CSV file
feature_colsColumn indices to use as features
label_colsColumn indices to use as labels
has_headerWhether the file contains a header row
delimiterCharacter used to separate values
Returns
Pair of (features, labels) matrices
Examples
/home/runner/work/deep-learning-algo-impls/deep-learning-algo-impls/include/utils/data_loader.hpp.

Definition at line 145 of file data_loader.cpp.


The documentation for this class was generated from the following files: