dmlfw (Daniyal Machine Learning Framework)
|
Categorical and binary feature encoding utilities. More...
#include <dmlfw_vector.h>
Go to the source code of this file.
Functions | |
void | dmlfw_encoder_encode (char *source, char *target, dmlfw_row_vec_string *columns_to_encode, char *algorithm) |
Generic encoder API. Dispatches by algorithm string. | |
void | dmlfw_encoder_encode_binary (char *source, char *target, dmlfw_row_vec_string *columns_to_encode) |
Encodes specified columns in a CSV file using binary encoding. | |
void | dmlfw_encoder_encode_one_hot (char *source, char *target, dmlfw_row_vec_string *columns_to_encode) |
Encodes specified columns in a CSV file using one-hot encoding. | |
Categorical and binary feature encoding utilities.
This module provides functions for encoding categorical/textual data columns from CSV files into numerical formats suitable for ML models. Supported encoding schemes include one-hot and binary encoding, with a generic dispatcher for algorithm selection.
All functions report errors via the centralized error API. Use dmlfw_error()
after function calls to check for errors. Retrieve error and diagnostic details with dmlfw_get_error_string()
and dmlfw_get_debug_string()
.
All allocated resources are cleaned up internally on error and after completion. No ownership is transferred to caller.
void dmlfw_encoder_encode | ( | char * | source, |
char * | target, | ||
dmlfw_row_vec_string * | columns_to_encode, | ||
char * | algorithm | ||
) |
Generic encoder API. Dispatches by algorithm string.
source | [in] Input CSV file path (must not be NULL). |
target | [in] Output CSV file path (must not be NULL). |
columns_to_encode | [in] Vector of column names to encode (must not be NULL). |
algorithm | [in] Algorithm name ("one-hot" or "binary", case-insensitive). |
Usage example:
void dmlfw_encoder_encode_binary | ( | char * | source, |
char * | target, | ||
dmlfw_row_vec_string * | columns_to_encode | ||
) |
Encodes specified columns in a CSV file using binary encoding.
source | [in] Input CSV file path (must not be NULL). |
target | [in] Output CSV file path (must not be NULL). |
columns_to_encode | [in] Vector of column names to encode (must not be NULL). |
Usage example:
void dmlfw_encoder_encode_one_hot | ( | char * | source, |
char * | target, | ||
dmlfw_row_vec_string * | columns_to_encode | ||
) |
Encodes specified columns in a CSV file using one-hot encoding.
source | [in] Input CSV file path (must not be NULL). |
target | [in] Output CSV file path (must not be NULL). |
columns_to_encode | [in] Vector of column names to encode (must not be NULL). |
Usage example: