Medial Code Documentation
Loading...
Searching...
No Matches
SmokingGenerator.h
Go to the documentation of this file.
1#pragma once
2#include "FeatureGenerator.h"
3
4typedef enum {
5 SMX_CURRENT_SMOKER,
6 SMX_EX_SMOKER,
7 SMX_YEARS_SINCE_QUITTING,
8 SMX_SMOKING_YEARS,
9 SMX_SMOK_PACK_YEARS,
10 SMX_PLM_SMOKING_LEVEL,
11 SMX_NEVER_SMOKER,
12 SMX_UNKNOWN_SMOKER,
13 SMX_SMOKING_QUANTITY,
14 SMX_LAST
15} SmokingGeneratorFields ;
16
21public:
22
23 // source_feature_names as specified by the user, will be resolved to decorated names
24 vector<string> raw_feature_names;
25 string smoking_method = "SMOKING_ENRICHED";
26 string future_ind = "1";
27
28 // Constructor/Destructor
30
32
35 virtual int init(map<string, string>& mapper);
36
37 // Name
38 void set_names();
39
40 // Copy
41 virtual void copy(FeatureGenerator *generator) { *this = *(dynamic_cast<SmokingGenerator *>(generator)); }
42
43 // Learn a generator
44 int _learn(MedPidRepository& rep, const MedSamples& samples, vector<RepProcessor *> processors) { return 0; }
45
46 // generate a new feature
47 int _generate(PidDynamicRec& rec, MedFeatures& features, int index, int num, vector<float *> &_p_data);
48
49 // get pointers to data
50 void get_p_data(MedFeatures& features, vector<float *> &_p_data);
51
52 // Serialization
53 ADD_CLASS_NAME(SmokingGenerator)
54 ADD_SERIALIZATION_FUNCS(generator_type, raw_feature_names, names, tags, iGenerateWeights, smoking_method, future_ind, req_signals)
55};
56
FeatureGenerator : creating features from raw signals.
@ FTR_GEN_SMOKING
"smoking" - creating smoking feature - SmokingGenerator
Definition FeatureGenerator.h:33
#define ADD_SERIALIZATION_FUNCS(...)
Definition SerializableObject.h:122
#define MEDSERIALIZE_SUPPORT(Type)
Definition SerializableObject.h:108
Definition FeatureGenerator.h:53
int iGenerateWeights
Feature/Weights generator.
Definition FeatureGenerator.h:72
vector< string > tags
Tags - for defining labels or groups. may be used later for filtering for example.
Definition FeatureGenerator.h:69
FeatureGeneratorTypes generator_type
Type.
Definition FeatureGenerator.h:57
vector< string > names
Feature name.
Definition FeatureGenerator.h:60
A class for holding features data as a virtual matrix
Definition MedFeatures.h:47
Definition MedPidRepository.h:87
MedSamples represent a collection of samples per different id The data is conatined in a vector of ...
Definition MedSamples.h:129
Definition MedPidRepository.h:127
Definition SmokingGenerator.h:20
virtual int init(map< string, string > &mapper)
The parsed fields from init command.
Definition SmokingGenerator.cpp:26