diff options
author | jvech <jmvalenciae@unal.edu.co> | 2024-09-14 19:46:36 -0500 |
---|---|---|
committer | jvech <jmvalenciae@unal.edu.co> | 2024-09-14 19:46:36 -0500 |
commit | 6b2cea33c5a5f2af90eec721ff26c4ff9de468dc (patch) | |
tree | ee2e9dc8e4ef884f13a59867493cfbf03f900df5 /src/util.h | |
parent | 97ac0db6b070b11652c3c8b181ff9d2ddfe53f17 (diff) |
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.
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |