cbasedann/preprocessing.h

51 lines
No EOL
984 B
C

#ifndef PREPROCESSING_H
#define PREPROCESSING_H
typedef struct feature Feature;
struct feature
{
float value;
Feature *next_feature;
};
typedef struct onehotlabel OneHotLabel;
struct onehotlabel
{
float value;
OneHotLabel *next;
};
typedef enum type Type;
enum type
{
TRAIN = 0 , TEST = 1 , VALID = 2
};
typedef struct sample Sample;
struct sample
{
Feature *first_feature;
OneHotLabel *first_hot;
Sample *next_sample;
Type t;
};
typedef struct data Data;
struct data
{
Sample *first_sample;
Sample *last_sample;
int size;
};
Feature *init_feature(float value);
OneHotLabel *init_onehotlabel(float value);
Sample *init_sample();
Data *init_data();
void destroy_features_from_feature(Feature *feature);
void destroy_hots_from_hot(OneHotLabel *first_hot);
void destroy_samples_from_sample(Sample *sample);
void destroy_data(Data *data);
Data *csv_to_samples(char *path_to_csv, char *features_separator, float train_percent);
#endif