Medial Code Documentation
|
Matching filter
More...
#include <SampleFilter.h>
Public Member Functions | |
MatchingSampleFilter () | |
Constructor. | |
int | init (map< string, string > &mapper) |
init from map | |
void | init_defaults () |
init to defaults | |
int | addMatchingStrata (string &init_string) |
Add a matching stratum defined by a string. | |
bool | isRepRequired () |
Check if repository is needed for matching (e.g. strata includes signal/age) | |
bool | isAgeRequired () |
Check if age is needed for matching. | |
int | getSampleSignature (MedSample &sample, MedFeatures &features, int i, MedRepository &rep, string &signature) |
Indexing of a single sample according to strata. | |
int | addToSampleSignature (MedSample &sample, matchingParams &stratum, MedFeatures &features, int i, MedRepository &rep, string &signature) |
add indexing of a single sample according to a single stratum to sample's index | |
int | initHelpers (MedSamples &inSamples, MedFeatures &features, MedRepository &rep) |
initialize values of requried helpers | |
void | get_required_signals (vector< string > &req_sigs) |
Get all signals required for matching. | |
int | _filter (MedRepository &rep, MedSamples &inSamples, MedSamples &outSamples) |
Filter with repository. | |
int | _filter (MedSamples &inSamples, MedSamples &outSamples) |
Filter without repository. | |
int | _filter (MedFeatures &features, MedRepository &rep, MedSamples &inSamples, MedSamples &outSamples) |
Filter with matrix + repository. | |
int | _filter (MedFeatures &features, MedSamples &inSamples, MedSamples &outSamples) |
Filter with matrix
| |
![]() | |
virtual int | init (void *params) |
initialize from a params object : Should be implemented for inheriting classes that have parameters | |
virtual int | _learn (MedRepository &rep, MedSamples &samples) |
learn with repository : Should be implemented for inheriting classes that learn parameters using Repository information | |
virtual int | _learn (MedSamples &samples) |
learn without repository : Should be implemented for inheriting classes that learn parameters | |
virtual int | learn (MedRepository &rep, MedSamples &samples) |
learn with repository | |
virtual int | learn (MedSamples &samples) |
learn without repository | |
virtual int | filter (MedRepository &rep, MedSamples &inSamples, MedSamples &outSamples) |
filter with repository | |
int | filter (MedRepository &rep, MedSamples &samples) |
in-place filtering with repository | |
virtual int | filter (MedSamples &inSamples, MedSamples &outSamples) |
filter without repository : Should be implemented for all inheriting classes | |
int | filter (MedSamples &samples) |
in-place filtering without repository | |
virtual void * | new_polymorphic (string derived_class_name) |
for polymorphic classes that want to be able to serialize/deserialize a pointer * to the derived class given its type one needs to implement this function to return a new to the derived class given its type (as in my_type) | |
size_t | get_filter_size () |
get size of filter + filter_type | |
size_t | filter_serialize (unsigned char *blob) |
seialize filter + filter_type | |
![]() | |
virtual int | version () const |
Relevant for serializations. | |
virtual string | my_class_name () const |
For better handling of serializations it is highly recommended that each SerializableObject inheriting class will implement the next method. | |
virtual void | serialized_fields_name (vector< string > &field_names) const |
The names of the serialized fields. | |
virtual void | pre_serialization () |
virtual void | post_deserialization () |
virtual size_t | get_size () |
Gets bytes sizes for serializations. | |
virtual size_t | serialize (unsigned char *blob) |
Serialiazing object to blob memory. return number ob bytes wrote to memory. | |
virtual size_t | deserialize (unsigned char *blob) |
Deserialiazing blob to object. returns number of bytes read. | |
size_t | serialize_vec (vector< unsigned char > &blob) |
size_t | deserialize_vec (vector< unsigned char > &blob) |
virtual size_t | serialize (vector< unsigned char > &blob) |
virtual size_t | deserialize (vector< unsigned char > &blob) |
virtual int | read_from_file (const string &fname) |
read and deserialize model | |
virtual int | write_to_file (const string &fname) |
serialize model and write to file | |
virtual int | read_from_file_unsafe (const string &fname) |
read and deserialize model without checking version number - unsafe read | |
int | init_from_string (string init_string) |
Init from string. | |
int | init_params_from_file (string init_file) |
int | init_param_from_file (string file_str, string ¶m) |
int | update_from_string (const string &init_string) |
virtual int | update (map< string, string > &map) |
Virtual to update object from parsed fields. | |
virtual string | object_json () const |
Data Fields | |
vector< matchingParams > | matchingStrata |
Matching parameters. | |
float | eventToControlPriceRatio = 100.0 |
Cost of removing case relative to removing control. | |
int | min_group_size = 5 |
minimal group size to take - smaller than that, will drop | |
float | maxControlToEventRatio = -1.0 |
maximal allowed control/case ratio | |
int | verbose = 0 |
control level of debug printing | |
float | match_to_prior = -1 |
If given (0-1) will ignore price ratio and will match to this prior. | |
int | samplesTimeUnit |
Time unit of samples. | |
int | bdateId |
signal-id for byear | |
![]() | |
SampleFilterTypes | filter_type |
The type of the filter. | |
Additional Inherited Members | |
![]() | |
static SampleFilter * | make_filter (string name) |
create a new sample filter from name | |
static SampleFilter * | make_filter (SampleFilterTypes type) |
create a new sample filter from type | |
static SampleFilter * | make_filter (string name, string params) |
create a new sample filter from name and a parameters string | |
static SampleFilter * | make_filter (SampleFilterTypes type, string params) |
create a new sample filter from type and a parameters string | |
Matching filter
|
virtual |
Filter with repository.
Reimplemented from SampleFilter.
|
virtual |
Filter without repository.
Implements SampleFilter.
int MatchingSampleFilter::addToSampleSignature | ( | MedSample & | sample, |
matchingParams & | stratum, | ||
MedFeatures & | features, | ||
int | i, | ||
MedRepository & | rep, | ||
string & | signature | ||
) |
add indexing of a single sample according to a single stratum to sample's index
|
virtual |
Get all signals required for matching.
Reimplemented from SampleFilter.
int MatchingSampleFilter::getSampleSignature | ( | MedSample & | sample, |
MedFeatures & | features, | ||
int | i, | ||
MedRepository & | rep, | ||
string & | signature | ||
) |
Indexing of a single sample according to strata.
|
virtual |
init from map
Reimplemented from SampleFilter.
|
inlinevirtual |
init to defaults
Reimplemented from SampleFilter.
int MatchingSampleFilter::initHelpers | ( | MedSamples & | inSamples, |
MedFeatures & | features, | ||
MedRepository & | rep | ||
) |
initialize values of requried helpers