Medial Code Documentation
Loading...
Searching...
No Matches
KpSmokingGenerator.h
1#pragma once
3
4typedef enum {
5 SMX_KP_CURRENT_SMOKER,
6 SMX_KP_EX_SMOKER,
7 SMX_KP_UNKNOWN_SMOKER,
8 SMX_KP_NEVER_SMOKER,
9 SMX_KP_PASSIVE_SMOKER,
10 SMX_KP_DAYS_SINCE_QUITTING,
11 SMX_KP_SMOK_PACK_YEARS_MAX,
12 SMX_KP_SMOK_PACK_YEARS_LAST,
13 NLST_CRITERION,
14 SMX_KP_LAST
15} KpSmokingGeneratorFields;
16
17#define KP_NEVER_SMOKER_QUIT_TIME (19000101)
19public:
20 float nlstPackYears, nlstQuitTimeYears, nlstMinAge, nlstMaxAge;
21 bool nonDefaultNlstCriterion;
22
23 // source_feature_names as specified by the user, will be resolved to decorated names
24 vector<string> raw_feature_names;
25 // Constructor/Destructor
27
29
32 virtual int init(map<string, string>& mapper);
33
34 // Name
35 void set_names();
36
37 // Copy
38 virtual void copy(FeatureGenerator *generator) { *this = *(dynamic_cast<KpSmokingGenerator *>(generator)); }
39
40 // Learn a generator
41 int _learn(MedPidRepository& rep, const MedSamples& samples, vector<RepProcessor *> processors) { return 0; }
42
43 // generate a new feature
44 int _generate(PidDynamicRec& rec, MedFeatures& features, int index, int num, vector<float *> &_p_data);
45
46 // get pointers to data
47 void get_p_data(MedFeatures& features, vector<float *> &_p_data);
48
49 int calcNlst(int age, int unknownSmoker, int daysSinceQuitting, float lastPackYears);
50
51 // Serialization
52 ADD_CLASS_NAME(KpSmokingGenerator)
53 ADD_SERIALIZATION_FUNCS(generator_type, raw_feature_names, names, tags, iGenerateWeights, req_signals)
54};
55
FeatureGenerator : creating features from raw signals.
@ FTR_GEN_KP_SMOKING
"kp_smoking" - creating smoking feature - KpSmokingGenerator
Definition FeatureGenerator.h:34
#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
float missing_val
Missing value.
Definition FeatureGenerator.h:66
vector< string > names
Feature name.
Definition FeatureGenerator.h:60
Definition KpSmokingGenerator.h:18
virtual int init(map< string, string > &mapper)
The parsed fields from init command.
Definition KpSmokingGenerator.cpp:24
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