dmlfw (Daniyal Machine Learning Framework)
example_dmlfw_data_encoder.c

Example usage:

#include <stdio.h>
#include <stdlib.h>
#include <dmlfw_encoder.h>
#include <dmlfw_error.h>
int main(void) {
char err[512], dbg[512];
dmlfw_row_vec_string_set(columns, 0, "town");
dmlfw_row_vec_string_set(columns, 1, "color");
dmlfw_encoder_encode_one_hot("input.csv", "onehot.csv", columns);
if (dmlfw_error()) {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(dbg, sizeof(dbg));
printf("Error in one-hot encoding: %s\nDebug info: %s\n", err, dbg);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
int main()
Main function to execute batch gradient descent linear regression example.
Definition batch_gd.c:316
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.
Core data encoding and transformation utilities.
Centralized error handling interface for the framework.
void dmlfw_get_error_string(char *error_string, uint32_t size)
Copies the last error message into the provided character buffer.
uint8_t dmlfw_error(void)
Checks if the last framework call resulted in an error.
void dmlfw_get_debug_string(char *debug_string, uint32_t size)
Copies detailed debug information about the last error into the provided character buffer.
void dmlfw_row_vec_string_destroy(dmlfw_row_vec_string *vector)
Destroys a row vector of strings and frees its memory.
dmlfw_row_vec_string * dmlfw_row_vec_string_create_new(dimension_t columns)
Creates a new row vector of strings of specified length.
void dmlfw_row_vec_string_set(dmlfw_row_vec_string *vector, index_t index, char *string)
Sets a string element in the row vector.
struct __dmlfw_row_vec_string dmlfw_row_vec_string
Opaque structure representing a row vector of strings.
Definition dmlfw_vec_string.h:82