From 6b2cea33c5a5f2af90eec721ff26c4ff9de468dc Mon Sep 17 00:00:00 2001 From: jvech Date: Sat, 14 Sep 2024 19:46:36 -0500 Subject: feat: onehot feature implementation in process To make onehot available I had to refactor how the data is stored, the current implementation supports json files. --- src/util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 69ebfbe..707e79b 100644 --- a/src/util.h +++ b/src/util.h @@ -12,9 +12,14 @@ struct Configs { char *loss; char **input_keys, **label_keys; size_t n_input_keys, n_label_keys; + char **categorical_keys, ***categorical_values; + size_t n_categorical_keys, *n_categorical_values; char *weights_filepath; char *config_filepath; bool shuffle; + /* preprocessing */ + char **onehot_keys; + size_t n_onehot_keys; /* cli cfgs */ char *file_format; char *in_filepath; @@ -32,6 +37,8 @@ void die(const char *fmt, ...); void *ecalloc(size_t nmemb, size_t size); void *erealloc(void *ptr, size_t size); char *e_strdup(const char *s); +int util_get_key_index(char *key, char **keys, size_t n_keys); +int util_argmax(double *values, size_t n_values); void util_load_cli(struct Configs *ml, int argc, char *argv[]); void util_load_config(struct Configs *ml, char *filepath); void util_free_config(struct Configs *ml); -- cgit v1.2.3-70-g09d2