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/parse.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/parse.h')
-rw-r--r-- | src/parse.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/parse.h b/src/parse.h index 07f740b..3f49c15 100644 --- a/src/parse.h +++ b/src/parse.h @@ -6,13 +6,38 @@ #include "util.h" +enum ArrayType { + ARRAY_NUMERICAL, + ARRAY_ORDINAL, + ARRAY_ONEHOT +}; + +union ArrayValue { + double numeric; + char *categorical; +}; + typedef struct Array { - double *data; + enum ArrayType *type; + union ArrayValue *data; size_t shape[2]; } Array; +void array_free(Array *x); void file_read(char *filepath, Array *input, Array *out, struct Configs configs, bool read_output); void file_write(Array input, Array out, struct Configs ml_configs); char * file_format_infer(char *filename); +double * data_preprocess( + size_t out_shape[2], + Array data, + struct Configs configs, + bool is_input, + bool only_allocate); + +void data_postprocess( + Array *out, + double *data, size_t data_shape[2], + struct Configs cfgs, + bool is_input); #endif |