Source code for med.medpython

# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.2.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

"""

    class Dictionary
        Methods:
            __init__(PidRepository rep) -> Dictionary
            get_members_to_all_sets(int section_id, int * members_array) -> IntVecIntMapAdaptor
            id(string & signame) -> int
            name(int id) -> string
            prep_sets_lookup_table(int section_id, StringVector set_names)
            section_id(string name) -> int


    class FeatureAttr
        Methods:
            imputed -> bool   (property getter)
            normalized -> bool   (property getter)
            imputed <- bool   (property setter)
            normalized <- bool   (property setter)
            __init__() -> FeatureAttr

        Data descriptors:
            imputed -> bool   (property getter)
            normalized -> bool   (property getter)


    class Features
        Methods:
            attributes -> StringFeatureAttrMapAdaptor   (property getter)
            data -> StringVecFloatMapAdaptor   (property getter)
            pid_pos_len -> IntPairIntIntMapAdaptor   (property getter)
            samples -> SampleVectorAdaptor   (property getter)
            tags -> StringUOSetStringMapAdaptor   (property getter)
            time_unit -> int   (property getter)
            weights    (property getter)
            time_unit <- int   (property setter)
            __init__() -> Features
            __init__(int _time_unit) -> Features
            __init__(Features other) -> Features
            append_samples(IdSamples in_samples)
            append_samples(Samples in_samples)
            clear()
            filter(StringVector selectedFeatures) -> int
            get_as_matrix(Mat mat)
            get_as_matrix(Mat mat, vector< string > names)
            get_as_matrix(Mat mat, vector< string > const names, int * int_in_buf)
            get_crc() -> unsigned int
            get_feature_names() -> StringVector
            get_max_serial_id_cnt() -> int
            get_pid_len(int pid) -> int
            get_pid_pos(int pid) -> int
            get_samples(Samples outSamples)
            init_all_samples(IdSamplesVectorAdaptor in_samples)
            init_pid_pos_len()
            insert_samples(IdSamples in_samples, int index)
            print_csv()
            read_from_csv_mat(string const & csv_fname) -> int
            set_as_matrix(Mat mat)
            set_time_unit(int _time_unit)
            version() -> int
            write_as_csv_mat(string const & csv_fname) -> int

        Static methods:
        global_serial_id_cnt    (property getter)
            global_serial_id_cnt -> int   (property getter)
        MEDPY_SET_global_serial_id_cnt(*args)
            MEDPY_SET_global_serial_id_cnt(int newval)

        Data descriptors:
            attributes -> StringFeatureAttrMapAdaptor   (property getter)
            data -> StringVecFloatMapAdaptor   (property getter)
        global_serial_id_cnt
            pid_pos_len -> IntPairIntIntMapAdaptor   (property getter)
            samples -> SampleVectorAdaptor   (property getter)
            tags -> StringUOSetStringMapAdaptor   (property getter)
            time_unit -> int   (property getter)
            weights    (property getter)


    class IdSamples
        Methods:
            id -> int   (property getter)
            samples -> SampleVectorAdaptor   (property getter)
            split -> int   (property getter)
            id <- int   (property setter)
            split <- int   (property setter)
            __init__(int _id) -> IdSamples
            __init__() -> IdSamples
            same_as(IdSamples other, int mode) -> bool
            set_split(int _split)

        Data descriptors:
            id -> int   (property getter)
            samples -> SampleVectorAdaptor   (property getter)
            split -> int   (property getter)


    class Mat
        Methods:
            avg    (property getter)
            missing_value -> float   (property getter)
            ncols -> int   (property getter)
            normalized_flag -> int   (property getter)
            nrows -> int   (property getter)
            row_ids    (property getter)
            signals -> StringVector   (property getter)
            std    (property getter)
            transposed_flag -> int   (property getter)
            missing_value <- float   (property setter)
            normalized_flag <- int   (property setter)
            row_ids <- int   (property setter)
            transposed_flag <- int   (property setter)
            __getitem__(IntVector index) -> float
            __init__() -> Mat
            __init__(int n_rows, int n_cols) -> Mat
            __init__(float * IN_ARRAY2) -> Mat
            __len__() -> unsigned long long
            __setitem__(IntVector index, float val)
            add_cols(Mat m_add)
            add_cols(float * m_add)
            add_rows(Mat m_add)
            add_rows(float * m_add)
            clear()
            get_col(int i_col)
            get_cols_avg_std()
            get_numpy_copy()
            get_numpy_view_unsafe()
            get_row(int i_row)
            get_sub_mat(vector< int > & rows_to_take, vector< int > & cols_to_take)
            get_sub_mat_by_flags(vector< int > & rows_to_take_flag, vector< int > & cols_to_take_flag)
            is_valid(bool output=False) -> bool
            is_valid() -> bool
            load(float * IN_ARRAY2)
            load(Mat x)
            load_numpy(float * IN_ARRAY2)
            load_transposed(float * IN_ARRAY2)
            normalize(int norm_type, float * wgts)
            normalize(int norm_type=Normalize_Cols)
            normalize()
            normalize(float * external_avg, float * external_std, int norm_type=1)
            normalize(float * external_avg, float * external_std)
            read_from_bin_file(string const & fname) -> int
            read_from_csv_file(string const & fname, int titles_line_flag) -> int
            resize(int n_rows, int n_cols)
            set_signals(StringVector sigs)
            set_val(float val)
            test(int n_rows, int n_cols)
            transpose()
            write_to_bin_file(string const & fname) -> int
            write_to_csv_file(string const & fname) -> int
            zero()

        Static methods:
        Normalize_Cols    (property getter)
            Normalize_Cols -> int   (property getter)
        Normalize_Rows    (property getter)
            Normalize_Rows -> int   (property getter)

        Data descriptors:
        Normalize_Cols
        Normalize_Rows
            avg    (property getter)
            missing_value -> float   (property getter)
            ncols -> int   (property getter)
            normalized_flag -> int   (property getter)
            nrows -> int   (property getter)
            row_ids    (property getter)
            signals -> StringVector   (property getter)
            std    (property getter)
            transposed_flag -> int   (property getter)


    class Model
        Methods:
            features -> Features   (property getter)
            verbosity -> int   (property getter)
            verbosity <- int   (property setter)
            __init__() -> Model
            add_age()
            add_feature_generator(string & name, string & signal)
            add_feature_generator_to_set(int i_set, string const & init_string)
            add_feature_generators(string & name, vector< string > & signals)
            add_feature_generators(string & name, vector< string > & signals, string init_string)
            add_feature_generators(string & name, string & signal, string init_string)
            add_feature_processor_to_set(int i_set, int duplicate, string const & init_string)
            add_gender()
            add_imputers()
            add_imputers(string init_string)
            add_imputers(vector< string > & features)
            add_imputers(vector< string > & features, string init_string)
            add_normalizers()
            add_normalizers(string init_string)
            add_normalizers(vector< string > & features)
            add_normalizers(vector< string > & features, string init_string)
            add_process_to_set(int i_set, int duplicate, string const & init_string)
            add_process_to_set(int i_set, string const & init_string)
            add_rep_processor_to_set(int i_set, string const & init_string)
            apply(PidRepository rep, Samples samples) -> int
            apply(PidRepository rep, Samples samples, int start_stage, int end_stage) -> int
            apply_feature_processors(Features features) -> int
            clear()
            collect_and_add_virtual_signals(PidRepository rep) -> int
            dprint_process(string const & pref, int rp_flag, int fg_flag, int fp_flag)
            filter_rep_processors()
            generate_all_features(PidRepository rep, Samples samples, Features features, StringVector req_feature_generators) -> int
            get_all_features_names(vector< string > & feat_names, int before_process_set)
            get_required_signal_names() -> StringVector
            init_from_json_file(std::string const & fname)
            init_from_json_file_with_alterations(std::string const & fname, StringVector json_alt) -> StringVector
            learn(PidRepository rep, Samples samples) -> int
            learn(PidRepository rep, Samples samples, int start_stage, int end_stage) -> int
            learn_and_apply_feature_processors(Features features) -> int
            learn_feature_generators(PidRepository rep, Samples learn_samples) -> int
            learn_feature_processors(Features features) -> int
            learn_rep_processors(PidRepository rep, Samples samples) -> int
            quick_learn_rep_processors(PidRepository rep, Samples samples) -> int
            read_from_file(string const & fname) -> int
            set_predictor(string name)
            set_predictor(string name, string init_string)
            write_feature_matrix(string const mat_fname) -> int
            write_to_file(std::string const & fname) -> int

        Data descriptors:
            features -> Features   (property getter)
            verbosity -> int   (property getter)


    class ModelStage
        Methods:
            __init__() -> ModelStage
        Data and other attributes:
        APPLY_FTR_GENERATORS = 2
        APPLY_FTR_PROCESSORS = 4
        APPLY_PREDICTOR = 6
        END = 8
        INSERT_PREDS = 7
        LEARN_FTR_GENERATORS = 1
        LEARN_FTR_PROCESSORS = 3
        LEARN_PREDICTOR = 5
        LEARN_REP_PROCESSORS = 0



    class PidRepository
        Methods:
            pids -> IntVector   (property getter)
            __init__() -> PidRepository
            dict_name(int_section_id, int_id) -> string
              returns name of section + id
            dict_prep_sets_lookup_table(int_section_id, list_String set_names) -> BoolVector
              returns a look-up-table for given set names
            dict_section_id(str_secName) -> int
              returns section id number for a given section name
            export_to_numpy(str_signame) -> SigExporter
              Returns the signal data represented as a list of numpy arrays, one for each field
        get_sig = __export_to_pandas(self, sig_name_str, translate=True, pids=None)
            get_sig(signame [, translate=True][, pids=None]) -> Pandas DataFrame
            translate : If True, will decode categorical fields into a readable representation in Pandas
            pid : If list is provided, will load only pids from the given list
                  If 'All' is provided, will use all available pids
            init(conf_file_name) -> int
            returns -1 if fails
            loadsig(str_signame) -> int
              load a signal
            read_all(conf_file_fname, [pids_to_take_array], [list_str_signals_to_take]) -> int
            returns -1 if fails
            reading a repository for a group of pids and signals.Empty group means all of it.
            read_all(conf_file_fname, [pids_to_take_array], [list_str_signals_to_take]) -> int
            returns -1 if fails
            reading a repository for a group of pids and signals.Empty group means all of it.
            read_all_i(std::string const & conf_fname, IntVector pids_to_take, IntVector signals_to_take) -> int
            sig_id(str_signame) -> int
              returns signal id number for a given signal name
            sig_type(str_signame) -> int
              returns signal type id for a given signal name
            uget(int_pid, int_sid) -> SigVectorAdaptor
              returns a vector of universal signals

        Data descriptors:
        dict
            PidRepository_dict_get() -> Dictionary
            pids -> IntVector   (property getter)


    class Sample
        Methods:
            id -> int   (property getter)
            outcome -> int   (property getter)
            outcomeTime -> int   (property getter)
            prediction    (property getter)
            split -> int   (property getter)
            time -> int   (property getter)
            id <- int   (property setter)
            outcome <- int   (property setter)
            outcomeTime <- int   (property setter)
            prediction <- float   (property setter)
            split <- int   (property setter)
            time <- int   (property setter)
            __copy__() -> Sample
            __init__() -> Sample
            parse_from_string(string & s, int time_unit) -> int
            print_(string const prefix)
            print_()
            write_to_string(string & s, int time_unit)

        Data descriptors:
            id -> int   (property getter)
            outcome -> int   (property getter)
            outcomeTime -> int   (property getter)
            prediction    (property getter)
            split -> int   (property getter)
            time -> int   (property getter)


    class Samples
        Methods:
            idSamples -> IdSamplesVectorAdaptor   (property getter)
            time_unit -> int   (property getter)
            time_unit <- int   (property setter)
            from_df(PandasAdaptor pandas_df)
            to_df() -> PandasAdaptor
            __init__() -> Samples
            append(Samples newSamples)
        as_df = __sample_export_to_pandas(self)
            clear()
            dilute(float prob)
            export_to_pandas_df() -> SampleVecExporter
            export_to_sample_vec() -> SampleVectorAdaptor
            get_attributes() -> StringVector
            get_categs()
            get_ids()
            get_predictions_size() -> int
            get_preds()
            get_str_attributes() -> StringVector
            get_y()
            insertRec(int pid, int time, float outcome, int outcomeTime)
            insertRec(int pid, int time, float outcome, int outcomeTime, float pred)
            insertRec(int pid, int time)
            insert_preds(Features featuresData) -> int
            nSamples() -> int
            normalize()
            read_from_bin_file(string const & file_name) -> int
            read_from_file(string const & file_name) -> int
            same_as(Samples other, int mode) -> bool
            sort_by_id_date()
            version() -> int
            write_to_bin_file(string const & file_name) -> int
            write_to_file(string const & fname) -> int

        Data descriptors:
            idSamples -> IdSamplesVectorAdaptor   (property getter)
            time_unit -> int   (property getter)


    class Sig
        Methods:
            __init__(Sig other) -> Sig
            date(int chan=0) -> int
            date() -> int
            days(int chan=0) -> int
            days() -> int
            hours(int chan=0) -> int
            hours() -> int
            minutes(int chan=0) -> int
            minutes() -> int
            months(int chan=0) -> int
            months() -> int
            time(int chan=0) -> int
            time() -> int
            timeU(int to_time_unit) -> int
            val(int chan=0) -> float
            val() -> float
            years(int chan=0) -> int
            years() -> int


    class Split
        Methods:
            nsplits -> int   (property getter)
            pid2split -> IntIntMapAdaptor   (property getter)
            __init__() -> Split
            clear()
            read_from_file(string const & fname) -> int
            write_to_file(string const & fname) -> int

        Data descriptors:
            nsplits -> int   (property getter)
            pid2split -> IntIntMapAdaptor   (property getter)


    class Time
        Methods:
            __init__() -> Time
        Data and other attributes:
        Date = 1
        DateTimeString = 7
        Days = 4
        Hours = 5
        Minutes = 6
        Months = 3
        Undefined = 0
        Years = 2


"""

from sys import version_info as _swig_python_version_info
# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _medpython
else:
    import _medpython

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


class SwigPyIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _medpython.delete_SwigPyIterator

    def value(self):
        return _medpython.SwigPyIterator_value(self)

    def incr(self, n=1):
        return _medpython.SwigPyIterator_incr(self, n)

    def decr(self, n=1):
        return _medpython.SwigPyIterator_decr(self, n)

    def distance(self, x):
        return _medpython.SwigPyIterator_distance(self, x)

    def equal(self, x):
        return _medpython.SwigPyIterator_equal(self, x)

    def copy(self):
        return _medpython.SwigPyIterator_copy(self)

    def next(self):
        return _medpython.SwigPyIterator_next(self)

    def __next__(self):
        return _medpython.SwigPyIterator___next__(self)

    def previous(self):
        return _medpython.SwigPyIterator_previous(self)

    def advance(self, n):
        return _medpython.SwigPyIterator_advance(self, n)

    def __eq__(self, x):
        return _medpython.SwigPyIterator___eq__(self, x)

    def __ne__(self, x):
        return _medpython.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n):
        return _medpython.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n):
        return _medpython.SwigPyIterator___isub__(self, n)

    def __add__(self, n):
        return _medpython.SwigPyIterator___add__(self, n)

    def __sub__(self, *args):
        return _medpython.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _medpython:
_medpython.SwigPyIterator_swigregister(SwigPyIterator)
class BoolVector(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self):
        return _medpython.BoolVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _medpython.BoolVector___nonzero__(self)

    def __bool__(self):
        return _medpython.BoolVector___bool__(self)

    def __len__(self):
        return _medpython.BoolVector___len__(self)

    def __getslice__(self, i, j):
        return _medpython.BoolVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _medpython.BoolVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _medpython.BoolVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _medpython.BoolVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _medpython.BoolVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _medpython.BoolVector___setitem__(self, *args)

    def pop(self):
        return _medpython.BoolVector_pop(self)

    def append(self, x):
        return _medpython.BoolVector_append(self, x)

    def empty(self):
        return _medpython.BoolVector_empty(self)

    def size(self):
        return _medpython.BoolVector_size(self)

    def swap(self, v):
        return _medpython.BoolVector_swap(self, v)

    def begin(self):
        return _medpython.BoolVector_begin(self)

    def end(self):
        return _medpython.BoolVector_end(self)

    def rbegin(self):
        return _medpython.BoolVector_rbegin(self)

    def rend(self):
        return _medpython.BoolVector_rend(self)

    def clear(self):
        return _medpython.BoolVector_clear(self)

    def get_allocator(self):
        return _medpython.BoolVector_get_allocator(self)

    def pop_back(self):
        return _medpython.BoolVector_pop_back(self)

    def erase(self, *args):
        return _medpython.BoolVector_erase(self, *args)

    def __init__(self, *args):
        _medpython.BoolVector_swiginit(self, _medpython.new_BoolVector(*args))

    def push_back(self, x):
        return _medpython.BoolVector_push_back(self, x)

    def front(self):
        return _medpython.BoolVector_front(self)

    def back(self):
        return _medpython.BoolVector_back(self)

    def assign(self, n, x):
        return _medpython.BoolVector_assign(self, n, x)

    def resize(self, *args):
        return _medpython.BoolVector_resize(self, *args)

    def insert(self, *args):
        return _medpython.BoolVector_insert(self, *args)

    def reserve(self, n):
        return _medpython.BoolVector_reserve(self, n)

    def capacity(self):
        return _medpython.BoolVector_capacity(self)
    __swig_destroy__ = _medpython.delete_BoolVector

# Register BoolVector in _medpython:
_medpython.BoolVector_swigregister(BoolVector)
class IntVector(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self):
        return _medpython.IntVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _medpython.IntVector___nonzero__(self)

    def __bool__(self):
        return _medpython.IntVector___bool__(self)

    def __len__(self):
        return _medpython.IntVector___len__(self)

    def __getslice__(self, i, j):
        return _medpython.IntVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _medpython.IntVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _medpython.IntVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _medpython.IntVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _medpython.IntVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _medpython.IntVector___setitem__(self, *args)

    def pop(self):
        return _medpython.IntVector_pop(self)

    def append(self, x):
        return _medpython.IntVector_append(self, x)

    def empty(self):
        return _medpython.IntVector_empty(self)

    def size(self):
        return _medpython.IntVector_size(self)

    def swap(self, v):
        return _medpython.IntVector_swap(self, v)

    def begin(self):
        return _medpython.IntVector_begin(self)

    def end(self):
        return _medpython.IntVector_end(self)

    def rbegin(self):
        return _medpython.IntVector_rbegin(self)

    def rend(self):
        return _medpython.IntVector_rend(self)

    def clear(self):
        return _medpython.IntVector_clear(self)

    def get_allocator(self):
        return _medpython.IntVector_get_allocator(self)

    def pop_back(self):
        return _medpython.IntVector_pop_back(self)

    def erase(self, *args):
        return _medpython.IntVector_erase(self, *args)

    def __init__(self, *args):
        _medpython.IntVector_swiginit(self, _medpython.new_IntVector(*args))

    def push_back(self, x):
        return _medpython.IntVector_push_back(self, x)

    def front(self):
        return _medpython.IntVector_front(self)

    def back(self):
        return _medpython.IntVector_back(self)

    def assign(self, n, x):
        return _medpython.IntVector_assign(self, n, x)

    def resize(self, *args):
        return _medpython.IntVector_resize(self, *args)

    def insert(self, *args):
        return _medpython.IntVector_insert(self, *args)

    def reserve(self, n):
        return _medpython.IntVector_reserve(self, n)

    def capacity(self):
        return _medpython.IntVector_capacity(self)
    __swig_destroy__ = _medpython.delete_IntVector

# Register IntVector in _medpython:
_medpython.IntVector_swigregister(IntVector)
class CharVector(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self):
        return _medpython.CharVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _medpython.CharVector___nonzero__(self)

    def __bool__(self):
        return _medpython.CharVector___bool__(self)

    def __len__(self):
        return _medpython.CharVector___len__(self)

    def __getslice__(self, i, j):
        return _medpython.CharVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _medpython.CharVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _medpython.CharVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _medpython.CharVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _medpython.CharVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _medpython.CharVector___setitem__(self, *args)

    def pop(self):
        return _medpython.CharVector_pop(self)

    def append(self, x):
        return _medpython.CharVector_append(self, x)

    def empty(self):
        return _medpython.CharVector_empty(self)

    def size(self):
        return _medpython.CharVector_size(self)

    def swap(self, v):
        return _medpython.CharVector_swap(self, v)

    def begin(self):
        return _medpython.CharVector_begin(self)

    def end(self):
        return _medpython.CharVector_end(self)

    def rbegin(self):
        return _medpython.CharVector_rbegin(self)

    def rend(self):
        return _medpython.CharVector_rend(self)

    def clear(self):
        return _medpython.CharVector_clear(self)

    def get_allocator(self):
        return _medpython.CharVector_get_allocator(self)

    def pop_back(self):
        return _medpython.CharVector_pop_back(self)

    def erase(self, *args):
        return _medpython.CharVector_erase(self, *args)

    def __init__(self, *args):
        _medpython.CharVector_swiginit(self, _medpython.new_CharVector(*args))

    def push_back(self, x):
        return _medpython.CharVector_push_back(self, x)

    def front(self):
        return _medpython.CharVector_front(self)

    def back(self):
        return _medpython.CharVector_back(self)

    def assign(self, n, x):
        return _medpython.CharVector_assign(self, n, x)

    def resize(self, *args):
        return _medpython.CharVector_resize(self, *args)

    def insert(self, *args):
        return _medpython.CharVector_insert(self, *args)

    def reserve(self, n):
        return _medpython.CharVector_reserve(self, n)

    def capacity(self):
        return _medpython.CharVector_capacity(self)
    __swig_destroy__ = _medpython.delete_CharVector

# Register CharVector in _medpython:
_medpython.CharVector_swigregister(CharVector)
class DoubleVector(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self):
        return _medpython.DoubleVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _medpython.DoubleVector___nonzero__(self)

    def __bool__(self):
        return _medpython.DoubleVector___bool__(self)

    def __len__(self):
        return _medpython.DoubleVector___len__(self)

    def __getslice__(self, i, j):
        return _medpython.DoubleVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _medpython.DoubleVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _medpython.DoubleVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _medpython.DoubleVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _medpython.DoubleVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _medpython.DoubleVector___setitem__(self, *args)

    def pop(self):
        return _medpython.DoubleVector_pop(self)

    def append(self, x):
        return _medpython.DoubleVector_append(self, x)

    def empty(self):
        return _medpython.DoubleVector_empty(self)

    def size(self):
        return _medpython.DoubleVector_size(self)

    def swap(self, v):
        return _medpython.DoubleVector_swap(self, v)

    def begin(self):
        return _medpython.DoubleVector_begin(self)

    def end(self):
        return _medpython.DoubleVector_end(self)

    def rbegin(self):
        return _medpython.DoubleVector_rbegin(self)

    def rend(self):
        return _medpython.DoubleVector_rend(self)

    def clear(self):
        return _medpython.DoubleVector_clear(self)

    def get_allocator(self):
        return _medpython.DoubleVector_get_allocator(self)

    def pop_back(self):
        return _medpython.DoubleVector_pop_back(self)

    def erase(self, *args):
        return _medpython.DoubleVector_erase(self, *args)

    def __init__(self, *args):
        _medpython.DoubleVector_swiginit(self, _medpython.new_DoubleVector(*args))

    def push_back(self, x):
        return _medpython.DoubleVector_push_back(self, x)

    def front(self):
        return _medpython.DoubleVector_front(self)

    def back(self):
        return _medpython.DoubleVector_back(self)

    def assign(self, n, x):
        return _medpython.DoubleVector_assign(self, n, x)

    def resize(self, *args):
        return _medpython.DoubleVector_resize(self, *args)

    def insert(self, *args):
        return _medpython.DoubleVector_insert(self, *args)

    def reserve(self, n):
        return _medpython.DoubleVector_reserve(self, n)

    def capacity(self):
        return _medpython.DoubleVector_capacity(self)
    __swig_destroy__ = _medpython.delete_DoubleVector

# Register DoubleVector in _medpython:
_medpython.DoubleVector_swigregister(DoubleVector)
class StringVector(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self):
        return _medpython.StringVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _medpython.StringVector___nonzero__(self)

    def __bool__(self):
        return _medpython.StringVector___bool__(self)

    def __len__(self):
        return _medpython.StringVector___len__(self)

    def __getslice__(self, i, j):
        return _medpython.StringVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _medpython.StringVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _medpython.StringVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _medpython.StringVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _medpython.StringVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _medpython.StringVector___setitem__(self, *args)

    def pop(self):
        return _medpython.StringVector_pop(self)

    def append(self, x):
        return _medpython.StringVector_append(self, x)

    def empty(self):
        return _medpython.StringVector_empty(self)

    def size(self):
        return _medpython.StringVector_size(self)

    def swap(self, v):
        return _medpython.StringVector_swap(self, v)

    def begin(self):
        return _medpython.StringVector_begin(self)

    def end(self):
        return _medpython.StringVector_end(self)

    def rbegin(self):
        return _medpython.StringVector_rbegin(self)

    def rend(self):
        return _medpython.StringVector_rend(self)

    def clear(self):
        return _medpython.StringVector_clear(self)

    def get_allocator(self):
        return _medpython.StringVector_get_allocator(self)

    def pop_back(self):
        return _medpython.StringVector_pop_back(self)

    def erase(self, *args):
        return _medpython.StringVector_erase(self, *args)

    def __init__(self, *args):
        _medpython.StringVector_swiginit(self, _medpython.new_StringVector(*args))

    def push_back(self, x):
        return _medpython.StringVector_push_back(self, x)

    def front(self):
        return _medpython.StringVector_front(self)

    def back(self):
        return _medpython.StringVector_back(self)

    def assign(self, n, x):
        return _medpython.StringVector_assign(self, n, x)

    def resize(self, *args):
        return _medpython.StringVector_resize(self, *args)

    def insert(self, *args):
        return _medpython.StringVector_insert(self, *args)

    def reserve(self, n):
        return _medpython.StringVector_reserve(self, n)

    def capacity(self):
        return _medpython.StringVector_capacity(self)
    __swig_destroy__ = _medpython.delete_StringVector

# Register StringVector in _medpython:
_medpython.StringVector_swigregister(StringVector)
class FloatVector(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self):
        return _medpython.FloatVector_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _medpython.FloatVector___nonzero__(self)

    def __bool__(self):
        return _medpython.FloatVector___bool__(self)

    def __len__(self):
        return _medpython.FloatVector___len__(self)

    def __getslice__(self, i, j):
        return _medpython.FloatVector___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _medpython.FloatVector___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _medpython.FloatVector___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _medpython.FloatVector___delitem__(self, *args)

    def __getitem__(self, *args):
        return _medpython.FloatVector___getitem__(self, *args)

    def __setitem__(self, *args):
        return _medpython.FloatVector___setitem__(self, *args)

    def pop(self):
        return _medpython.FloatVector_pop(self)

    def append(self, x):
        return _medpython.FloatVector_append(self, x)

    def empty(self):
        return _medpython.FloatVector_empty(self)

    def size(self):
        return _medpython.FloatVector_size(self)

    def swap(self, v):
        return _medpython.FloatVector_swap(self, v)

    def begin(self):
        return _medpython.FloatVector_begin(self)

    def end(self):
        return _medpython.FloatVector_end(self)

    def rbegin(self):
        return _medpython.FloatVector_rbegin(self)

    def rend(self):
        return _medpython.FloatVector_rend(self)

    def clear(self):
        return _medpython.FloatVector_clear(self)

    def get_allocator(self):
        return _medpython.FloatVector_get_allocator(self)

    def pop_back(self):
        return _medpython.FloatVector_pop_back(self)

    def erase(self, *args):
        return _medpython.FloatVector_erase(self, *args)

    def __init__(self, *args):
        _medpython.FloatVector_swiginit(self, _medpython.new_FloatVector(*args))

    def push_back(self, x):
        return _medpython.FloatVector_push_back(self, x)

    def front(self):
        return _medpython.FloatVector_front(self)

    def back(self):
        return _medpython.FloatVector_back(self)

    def assign(self, n, x):
        return _medpython.FloatVector_assign(self, n, x)

    def resize(self, *args):
        return _medpython.FloatVector_resize(self, *args)

    def insert(self, *args):
        return _medpython.FloatVector_insert(self, *args)

    def reserve(self, n):
        return _medpython.FloatVector_reserve(self, n)

    def capacity(self):
        return _medpython.FloatVector_capacity(self)
    __swig_destroy__ = _medpython.delete_FloatVector

# Register FloatVector in _medpython:
_medpython.FloatVector_swigregister(FloatVector)
class StopIterator(object):
    r"""Proxy of C++ StopIterator class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(StopIterator self) -> StopIterator"""
        _medpython.StopIterator_swiginit(self, _medpython.new_StopIterator())
    __swig_destroy__ = _medpython.delete_StopIterator

# Register StopIterator in _medpython:
_medpython.StopIterator_swigregister(StopIterator)
class IntIntMapAdaptor(object):
    r"""Proxy of C++ MPIntIntMapAdaptor class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(IntIntMapAdaptor self) -> IntIntMapAdaptor"""
        _medpython.IntIntMapAdaptor_swiginit(self, _medpython.new_IntIntMapAdaptor())
    __swig_destroy__ = _medpython.delete_IntIntMapAdaptor

    def __len__(self):
        r"""__len__(IntIntMapAdaptor self) -> int"""
        return _medpython.IntIntMapAdaptor___len__(self)

    def __getitem__(self, i):
        r"""__getitem__(IntIntMapAdaptor self, int i) -> int"""
        return _medpython.IntIntMapAdaptor___getitem__(self, i)

    def __setitem__(self, i, val):
        r"""__setitem__(IntIntMapAdaptor self, int i, int val)"""
        return _medpython.IntIntMapAdaptor___setitem__(self, i, val)

    def keys(self):
        r"""keys(IntIntMapAdaptor self)"""
        return _medpython.IntIntMapAdaptor_keys(self)

# Register IntIntMapAdaptor in _medpython:
_medpython.IntIntMapAdaptor_swigregister(IntIntMapAdaptor)
class StringStringMapAdaptor(object):
    r"""Proxy of C++ MPStringStringMapAdaptor class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(StringStringMapAdaptor self) -> StringStringMapAdaptor"""
        _medpython.StringStringMapAdaptor_swiginit(self, _medpython.new_StringStringMapAdaptor())
    __swig_destroy__ = _medpython.delete_StringStringMapAdaptor

    def __len__(self):
        r"""__len__(StringStringMapAdaptor self) -> int"""
        return _medpython.StringStringMapAdaptor___len__(self)

    def __getitem__(self, i):
        r"""__getitem__(StringStringMapAdaptor self, std::string const & i) -> std::string"""
        return _medpython.StringStringMapAdaptor___getitem__(self, i)

    def __setitem__(self, i, val):
        r"""__setitem__(StringStringMapAdaptor self, std::string const & i, std::string const & val)"""
        return _medpython.StringStringMapAdaptor___setitem__(self, i, val)

    def keys(self):
        r"""keys(StringStringMapAdaptor self) -> StringVector"""
        return _medpython.StringStringMapAdaptor_keys(self)

# Register StringStringMapAdaptor in _medpython:
_medpython.StringStringMapAdaptor_swigregister(StringStringMapAdaptor)
class StringFloatMapAdaptor(object):
    r"""Proxy of C++ MPStringFloatMapAdaptor class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(StringFloatMapAdaptor self) -> StringFloatMapAdaptor"""
        _medpython.StringFloatMapAdaptor_swiginit(self, _medpython.new_StringFloatMapAdaptor())
    __swig_destroy__ = _medpython.delete_StringFloatMapAdaptor

    def __len__(self):
        r"""__len__(StringFloatMapAdaptor self) -> int"""
        return _medpython.StringFloatMapAdaptor___len__(self)

    def __getitem__(self, i):
        r"""__getitem__(StringFloatMapAdaptor self, std::string const & i) -> float"""
        return _medpython.StringFloatMapAdaptor___getitem__(self, i)

    def __setitem__(self, i, val):
        r"""__setitem__(StringFloatMapAdaptor self, std::string const & i, float val)"""
        return _medpython.StringFloatMapAdaptor___setitem__(self, i, val)

    def keys(self):
        r"""keys(StringFloatMapAdaptor self) -> StringVector"""
        return _medpython.StringFloatMapAdaptor_keys(self)

# Register StringFloatMapAdaptor in _medpython:
_medpython.StringFloatMapAdaptor_swigregister(StringFloatMapAdaptor)
class StringVecFloatMapAdaptor(object):
    r"""Proxy of C++ MPStringVecFloatMapAdaptor class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(StringVecFloatMapAdaptor self) -> StringVecFloatMapAdaptor"""
        _medpython.StringVecFloatMapAdaptor_swiginit(self, _medpython.new_StringVecFloatMapAdaptor())
    __swig_destroy__ = _medpython.delete_StringVecFloatMapAdaptor

    def __len__(self):
        r"""__len__(StringVecFloatMapAdaptor self) -> int"""
        return _medpython.StringVecFloatMapAdaptor___len__(self)

    def __getitem__(self, key):
        r"""__getitem__(StringVecFloatMapAdaptor self, std::string key)"""
        return _medpython.StringVecFloatMapAdaptor___getitem__(self, key)

    def __setitem__(self, key, float_in_buf):
        r"""__setitem__(StringVecFloatMapAdaptor self, std::string key, float * float_in_buf)"""
        return _medpython.StringVecFloatMapAdaptor___setitem__(self, key, float_in_buf)

    def keys(self):
        r"""keys(StringVecFloatMapAdaptor self) -> StringVector"""
        return _medpython.StringVecFloatMapAdaptor_keys(self)

# Register StringVecFloatMapAdaptor in _medpython:
_medpython.StringVecFloatMapAdaptor_swigregister(StringVecFloatMapAdaptor)
class IntPairIntIntMapAdaptor(object):
    r"""Proxy of C++ MPIntPairIntIntMapAdaptor class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(IntPairIntIntMapAdaptor self) -> IntPairIntIntMapAdaptor"""
        _medpython.IntPairIntIntMapAdaptor_swiginit(self, _medpython.new_IntPairIntIntMapAdaptor())
    __swig_destroy__ = _medpython.delete_IntPairIntIntMapAdaptor

    def __len__(self):
        r"""__len__(IntPairIntIntMapAdaptor self) -> int"""
        return _medpython.IntPairIntIntMapAdaptor___len__(self)

    def __getitem__(self, key):
        r"""__getitem__(IntPairIntIntMapAdaptor self, int key)"""
        return _medpython.IntPairIntIntMapAdaptor___getitem__(self, key)

    def __setitem__(self, key, int_in_buf):
        r"""__setitem__(IntPairIntIntMapAdaptor self, int key, int * int_in_buf)"""
        return _medpython.IntPairIntIntMapAdaptor___setitem__(self, key, int_in_buf)

    def keys(self):
        r"""keys(IntPairIntIntMapAdaptor self)"""
        return _medpython.IntPairIntIntMapAdaptor_keys(self)

# Register IntPairIntIntMapAdaptor in _medpython:
_medpython.IntPairIntIntMapAdaptor_swigregister(IntPairIntIntMapAdaptor)
class StringUOSetStringMapAdaptor(object):
    r"""Proxy of C++ MPStringUOSetStringMapAdaptor class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(StringUOSetStringMapAdaptor self) -> StringUOSetStringMapAdaptor"""
        _medpython.StringUOSetStringMapAdaptor_swiginit(self, _medpython.new_StringUOSetStringMapAdaptor())
    __swig_destroy__ = _medpython.delete_StringUOSetStringMapAdaptor

    def __len__(self):
        r"""__len__(StringUOSetStringMapAdaptor self) -> int"""
        return _medpython.StringUOSetStringMapAdaptor___len__(self)

    def __getitem__(self, key):
        r"""__getitem__(StringUOSetStringMapAdaptor self, std::string key) -> StringVector"""
        return _medpython.StringUOSetStringMapAdaptor___getitem__(self, key)

    def __setitem__(self, key, val):
        r"""__setitem__(StringUOSetStringMapAdaptor self, std::string key, StringVector val)"""
        return _medpython.StringUOSetStringMapAdaptor___setitem__(self, key, val)

    def keys(self):
        r"""keys(StringUOSetStringMapAdaptor self) -> StringVector"""
        return _medpython.StringUOSetStringMapAdaptor_keys(self)

# Register StringUOSetStringMapAdaptor in _medpython:
_medpython.StringUOSetStringMapAdaptor_swigregister(StringUOSetStringMapAdaptor)
class IntStringMapAdaptor(object):
    r"""Proxy of C++ MPIntStringMapAdaptor class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r"""__init__(IntStringMapAdaptor self) -> IntStringMapAdaptor"""
        _medpython.IntStringMapAdaptor_swiginit(self, _medpython.new_IntStringMapAdaptor())
    __swig_destroy__ = _medpython.delete_IntStringMapAdaptor

    def __len__(self):
        r"""__len__(IntStringMapAdaptor self) -> int"""
        return _medpython.IntStringMapAdaptor___len__(self)

    def __getitem__(self, i):
        r"""__getitem__(IntStringMapAdaptor self, int i) -> std::string"""
        return _medpython.IntStringMapAdaptor___getitem__(self, i)

    def __setitem__(self, i, val):
        r"""__setitem__(IntStringMapAdaptor self, int i, string const & val)"""
        return _medpython.IntStringMapAdaptor___setitem__(self, i, val)

    def keys(self):
        r"""keys(IntStringMapAdaptor self) -> IntVector"""
        return _medpython.IntStringMapAdaptor_keys(self)

# Register IntStringMapAdaptor in _medpython:
_medpython.IntStringMapAdaptor_swigregister(IntStringMapAdaptor)
class IntVecIntMapAdaptor(object):
    r"""Proxy of C++ MPIntVecIntMapAdaptor class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    o = property(_medpython.IntVecIntMapAdaptor_o_get, _medpython.IntVecIntMapAdaptor_o_set, doc=r"""o : p.std::map<(int,std::vector<(int,std::allocator<(int)>)>)>""")

    def __init__(self):
        r"""__init__(IntVecIntMapAdaptor self) -> IntVecIntMapAdaptor"""
        _medpython.IntVecIntMapAdaptor_swiginit(self, _medpython.new_IntVecIntMapAdaptor())
    __swig_destroy__ = _medpython.delete_IntVecIntMapAdaptor

    def __len__(self):
        r"""__len__(IntVecIntMapAdaptor self) -> int"""
        return _medpython.IntVecIntMapAdaptor___len__(self)

    def __getitem__(self, key):
        r"""__getitem__(IntVecIntMapAdaptor self, int key)"""
        return _medpython.IntVecIntMapAdaptor___getitem__(self, key)

    def __setitem__(self, key, int_in_buf):
        r"""__setitem__(IntVecIntMapAdaptor self, int key, int * int_in_buf)"""
        return _medpython.IntVecIntMapAdaptor___setitem__(self, key, int_in_buf)

    def keys(self):
        r"""keys(IntVecIntMapAdaptor self) -> IntVector"""
        return _medpython.IntVecIntMapAdaptor_keys(self)

# Register IntVecIntMapAdaptor in _medpython:
_medpython.IntVecIntMapAdaptor_swigregister(IntVecIntMapAdaptor)

[docs] def logger_use_stdout(): r"""logger_use_stdout()""" return _medpython.logger_use_stdout()
class StringBtResultMap(object): r"""Proxy of C++ MPStringBtResultMap class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(StringBtResultMap self) -> StringBtResultMap""" _medpython.StringBtResultMap_swiginit(self, _medpython.new_StringBtResultMap()) __swig_destroy__ = _medpython.delete_StringBtResultMap def __len__(self): r"""__len__(StringBtResultMap self) -> int""" return _medpython.StringBtResultMap___len__(self) def __getitem__(self, key): r"""__getitem__(StringBtResultMap self, std::string const & key) -> StringFloatMapAdaptor""" return _medpython.StringBtResultMap___getitem__(self, key) def __setitem__(self, key, val): r"""__setitem__(StringBtResultMap self, std::string const & key, StringFloatMapAdaptor val)""" return _medpython.StringBtResultMap___setitem__(self, key, val) def keys(self): r"""keys(StringBtResultMap self) -> StringVector""" return _medpython.StringBtResultMap_keys(self) def to_file(self, file_path): r"""to_file(StringBtResultMap self, std::string const & file_path)""" return _medpython.StringBtResultMap_to_file(self, file_path) # Register StringBtResultMap in _medpython: _medpython.StringBtResultMap_swigregister(StringBtResultMap)
[docs] class Bootstrap(object): r"""Proxy of C++ MPBootstrap class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(Bootstrap self) -> Bootstrap""" _medpython.Bootstrap_swiginit(self, _medpython.new_Bootstrap()) __swig_destroy__ = _medpython.delete_Bootstrap
[docs] def MEDPY_GET_sample_per_pid(self): r"""MEDPY_GET_sample_per_pid(Bootstrap self) -> int""" return _medpython.Bootstrap_MEDPY_GET_sample_per_pid(self)
[docs] def MEDPY_SET_sample_per_pid(self, _sample_per_pid): r"""MEDPY_SET_sample_per_pid(Bootstrap self, int _sample_per_pid)""" return _medpython.Bootstrap_MEDPY_SET_sample_per_pid(self, _sample_per_pid)
[docs] def MEDPY_GET_nbootstrap(self): r"""MEDPY_GET_nbootstrap(Bootstrap self) -> int""" return _medpython.Bootstrap_MEDPY_GET_nbootstrap(self)
[docs] def MEDPY_SET_nbootstrap(self, _nbootstrap): r"""MEDPY_SET_nbootstrap(Bootstrap self, int _nbootstrap)""" return _medpython.Bootstrap_MEDPY_SET_nbootstrap(self, _nbootstrap)
[docs] def MEDPY_GET_ROC_score_min_samples(self): r"""MEDPY_GET_ROC_score_min_samples(Bootstrap self) -> int""" return _medpython.Bootstrap_MEDPY_GET_ROC_score_min_samples(self)
[docs] def MEDPY_SET_ROC_score_min_samples(self, _ROC_score_min_samples): r"""MEDPY_SET_ROC_score_min_samples(Bootstrap self, int _ROC_score_min_samples)""" return _medpython.Bootstrap_MEDPY_SET_ROC_score_min_samples(self, _ROC_score_min_samples)
[docs] def MEDPY_GET_ROC_score_bins(self): r"""MEDPY_GET_ROC_score_bins(Bootstrap self) -> int""" return _medpython.Bootstrap_MEDPY_GET_ROC_score_bins(self)
[docs] def MEDPY_SET_ROC_score_bins(self, _ROC_score_bins): r"""MEDPY_SET_ROC_score_bins(Bootstrap self, int _ROC_score_bins)""" return _medpython.Bootstrap_MEDPY_SET_ROC_score_bins(self, _ROC_score_bins)
[docs] def MEDPY_GET_ROC_max_diff_working_point(self): r"""MEDPY_GET_ROC_max_diff_working_point(Bootstrap self) -> float""" return _medpython.Bootstrap_MEDPY_GET_ROC_max_diff_working_point(self)
[docs] def MEDPY_SET_ROC_max_diff_working_point(self, _ROC_max_diff_working_point): r"""MEDPY_SET_ROC_max_diff_working_point(Bootstrap self, float _ROC_max_diff_working_point)""" return _medpython.Bootstrap_MEDPY_SET_ROC_max_diff_working_point(self, _ROC_max_diff_working_point)
[docs] def MEDPY_GET_ROC_score_resolution(self): r"""MEDPY_GET_ROC_score_resolution(Bootstrap self) -> float""" return _medpython.Bootstrap_MEDPY_GET_ROC_score_resolution(self)
[docs] def MEDPY_SET_ROC_score_resolution(self, _ROC_score_resolutiont): r"""MEDPY_SET_ROC_score_resolution(Bootstrap self, float _ROC_score_resolutiont)""" return _medpython.Bootstrap_MEDPY_SET_ROC_score_resolution(self, _ROC_score_resolutiont)
[docs] def MEDPY_GET_ROC_use_score_working_points(self): r"""MEDPY_GET_ROC_use_score_working_points(Bootstrap self) -> bool""" return _medpython.Bootstrap_MEDPY_GET_ROC_use_score_working_points(self)
[docs] def MEDPY_SET_ROC_use_score_working_points(self, _ROC_use_score_working_points): r"""MEDPY_SET_ROC_use_score_working_points(Bootstrap self, bool _ROC_use_score_working_points)""" return _medpython.Bootstrap_MEDPY_SET_ROC_use_score_working_points(self, _ROC_use_score_working_points)
[docs] def MEDPY_GET_ROC_working_point_FPR(self): r"""MEDPY_GET_ROC_working_point_FPR(Bootstrap self) -> FloatVector""" return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_FPR(self)
[docs] def MEDPY_SET_ROC_working_point_FPR(self, _ROC_working_point_FPR): r"""MEDPY_SET_ROC_working_point_FPR(Bootstrap self, FloatVector _ROC_working_point_FPR)""" return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_FPR(self, _ROC_working_point_FPR)
[docs] def MEDPY_GET_ROC_working_point_PR(self): r"""MEDPY_GET_ROC_working_point_PR(Bootstrap self) -> FloatVector""" return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_PR(self)
[docs] def MEDPY_SET_ROC_working_point_PR(self, _ROC_working_point_PR): r"""MEDPY_SET_ROC_working_point_PR(Bootstrap self, FloatVector _ROC_working_point_PR)""" return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_PR(self, _ROC_working_point_PR)
[docs] def MEDPY_GET_ROC_working_point_SENS(self): r"""MEDPY_GET_ROC_working_point_SENS(Bootstrap self) -> FloatVector""" return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_SENS(self)
[docs] def MEDPY_SET_ROC_working_point_SENS(self, _ROC_working_point_SENS): r"""MEDPY_SET_ROC_working_point_SENS(Bootstrap self, FloatVector _ROC_working_point_SENS)""" return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_SENS(self, _ROC_working_point_SENS)
[docs] def MEDPY_GET_ROC_working_point_Score(self): r"""MEDPY_GET_ROC_working_point_Score(Bootstrap self) -> FloatVector""" return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_Score(self)
[docs] def MEDPY_SET_ROC_working_point_Score(self, _ROC_working_point_Score): r"""MEDPY_SET_ROC_working_point_Score(Bootstrap self, FloatVector _ROC_working_point_Score)""" return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_Score(self, _ROC_working_point_Score)
[docs] def MEDPY_GET_ROC_working_point_TOPN(self): r"""MEDPY_GET_ROC_working_point_TOPN(Bootstrap self) -> IntVector""" return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_TOPN(self)
[docs] def MEDPY_SET_ROC_working_point_TOPN(self, MEDPY_GET_ROC_working_point_TOPN): r"""MEDPY_SET_ROC_working_point_TOPN(Bootstrap self, IntVector MEDPY_GET_ROC_working_point_TOPN)""" return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_TOPN(self, MEDPY_GET_ROC_working_point_TOPN)
[docs] def parse_cohort_line(self, line): r"""parse_cohort_line(Bootstrap self, string const & line)""" return _medpython.Bootstrap_parse_cohort_line(self, line)
[docs] def get_cohort_from_arg(self, single_cohort): r"""get_cohort_from_arg(Bootstrap self, string const & single_cohort)""" return _medpython.Bootstrap_get_cohort_from_arg(self, single_cohort)
[docs] def parse_cohort_file(self, cohorts_path): r"""parse_cohort_file(Bootstrap self, string const & cohorts_path)""" return _medpython.Bootstrap_parse_cohort_file(self, cohorts_path)
[docs] def init_from_str(self, str): r"""init_from_str(Bootstrap self, string const & str)""" return _medpython.Bootstrap_init_from_str(self, str)
[docs] def bootstrap_cohort(self, samples, rep_path, json_model, cohorts_path): r"""bootstrap_cohort(Bootstrap self, Samples samples, string const & rep_path, string const & json_model, string const & cohorts_path) -> StringBtResultMap""" return _medpython.Bootstrap_bootstrap_cohort(self, samples, rep_path, json_model, cohorts_path)
def _bootstrap(self, preds, labels): r"""_bootstrap(Bootstrap self, FloatVector preds, FloatVector labels) -> StringFloatMapAdaptor""" return _medpython.Bootstrap__bootstrap(self, preds, labels) def _bootstrap_pid(self, pids, preds, labels): r"""_bootstrap_pid(Bootstrap self, FloatVector pids, FloatVector preds, FloatVector labels) -> StringFloatMapAdaptor""" return _medpython.Bootstrap__bootstrap_pid(self, pids, preds, labels) sample_per_pid = property(MEDPY_GET_sample_per_pid,MEDPY_SET_sample_per_pid) nbootstrap = property(MEDPY_GET_nbootstrap,MEDPY_SET_nbootstrap) ROC_score_min_samples = property(MEDPY_GET_ROC_score_min_samples,MEDPY_SET_ROC_score_min_samples) ROC_score_bins = property(MEDPY_GET_ROC_score_bins,MEDPY_SET_ROC_score_bins) ROC_max_diff_working_point = property(MEDPY_GET_ROC_max_diff_working_point,MEDPY_SET_ROC_max_diff_working_point) ROC_score_resolution = property(MEDPY_GET_ROC_score_resolution,MEDPY_SET_ROC_score_resolution) ROC_use_score_working_points = property(MEDPY_GET_ROC_use_score_working_points,MEDPY_SET_ROC_use_score_working_points) ROC_working_point_FPR = property(MEDPY_GET_ROC_working_point_FPR,MEDPY_SET_ROC_working_point_FPR) ROC_working_point_PR = property(MEDPY_GET_ROC_working_point_PR,MEDPY_SET_ROC_working_point_PR) ROC_working_point_SENS = property(MEDPY_GET_ROC_working_point_SENS,MEDPY_SET_ROC_working_point_SENS) ROC_working_point_Score = property(MEDPY_GET_ROC_working_point_Score,MEDPY_SET_ROC_working_point_Score) ROC_working_point_TOPN = property(MEDPY_GET_ROC_working_point_TOPN,MEDPY_SET_ROC_working_point_TOPN)
# Register Bootstrap in _medpython: _medpython.Bootstrap_swigregister(Bootstrap)
[docs] class Dictionary(object): r"""Proxy of C++ MPDictionary class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, rep): r"""__init__(Dictionary self, PidRepository rep) -> Dictionary""" _medpython.Dictionary_swiginit(self, _medpython.new_Dictionary(rep))
[docs] def section_id(self, name): r"""section_id(Dictionary self, string name) -> int""" return _medpython.Dictionary_section_id(self, name)
[docs] def id(self, section_id, signame): r"""id(Dictionary self, int section_id, string & signame) -> int""" return _medpython.Dictionary_id(self, section_id, signame)
[docs] def name(self, section_id, id): r"""name(Dictionary self, int section_id, int id) -> string""" return _medpython.Dictionary_name(self, section_id, id)
[docs] def prep_sets_lookup_table(self, section_id, set_names): r"""prep_sets_lookup_table(Dictionary self, int section_id, StringVector set_names)""" return _medpython.Dictionary_prep_sets_lookup_table(self, section_id, set_names)
[docs] def get_members_to_all_sets(self, section_id, members_array): r"""get_members_to_all_sets(Dictionary self, int section_id, int * members_array) -> IntVecIntMapAdaptor""" return _medpython.Dictionary_get_members_to_all_sets(self, section_id, members_array)
__swig_destroy__ = _medpython.delete_Dictionary
# Register Dictionary in _medpython: _medpython.Dictionary_swigregister(Dictionary)
[docs] class FeatureAttr(object): r"""Proxy of C++ MPFeatureAttr class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(FeatureAttr self) -> FeatureAttr""" _medpython.FeatureAttr_swiginit(self, _medpython.new_FeatureAttr()) __swig_destroy__ = _medpython.delete_FeatureAttr
[docs] def MEDPY_SET_normalized(self, _normalized): r"""MEDPY_SET_normalized(FeatureAttr self, bool _normalized)""" return _medpython.FeatureAttr_MEDPY_SET_normalized(self, _normalized)
[docs] def MEDPY_GET_normalized(self): r"""MEDPY_GET_normalized(FeatureAttr self) -> bool""" return _medpython.FeatureAttr_MEDPY_GET_normalized(self)
[docs] def MEDPY_SET_imputed(self, _imputed): r"""MEDPY_SET_imputed(FeatureAttr self, bool _imputed)""" return _medpython.FeatureAttr_MEDPY_SET_imputed(self, _imputed)
[docs] def MEDPY_GET_imputed(self): r"""MEDPY_GET_imputed(FeatureAttr self) -> bool""" return _medpython.FeatureAttr_MEDPY_GET_imputed(self)
[docs] def MEDPY_SET_denorm_mean(self, _denorm_mean): r"""MEDPY_SET_denorm_mean(FeatureAttr self, float _denorm_mean)""" return _medpython.FeatureAttr_MEDPY_SET_denorm_mean(self, _denorm_mean)
[docs] def MEDPY_GET_denorm_mean(self): r"""MEDPY_GET_denorm_mean(FeatureAttr self) -> float""" return _medpython.FeatureAttr_MEDPY_GET_denorm_mean(self)
[docs] def MEDPY_SET_denorm_sdv(self, _denorm_sdv): r"""MEDPY_SET_denorm_sdv(FeatureAttr self, float _denorm_sdv)""" return _medpython.FeatureAttr_MEDPY_SET_denorm_sdv(self, _denorm_sdv)
[docs] def MEDPY_GET_denorm_sdv(self): r"""MEDPY_GET_denorm_sdv(FeatureAttr self) -> float""" return _medpython.FeatureAttr_MEDPY_GET_denorm_sdv(self)
[docs] def asSerializable(self): r"""asSerializable(FeatureAttr self) -> SerializableObject""" return _medpython.FeatureAttr_asSerializable(self)
normalized = property(MEDPY_GET_normalized,MEDPY_SET_normalized) imputed = property(MEDPY_GET_imputed,MEDPY_SET_imputed) denorm_mean = property(MEDPY_GET_denorm_mean,MEDPY_SET_denorm_mean) denorm_sdv = property(MEDPY_GET_denorm_sdv,MEDPY_SET_denorm_sdv)
# Register FeatureAttr in _medpython: _medpython.FeatureAttr_swigregister(FeatureAttr) class StringFeatureAttrMapAdaptor(object): r"""Proxy of C++ MPStringFeatureAttrMapAdaptor class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(StringFeatureAttrMapAdaptor self) -> StringFeatureAttrMapAdaptor""" _medpython.StringFeatureAttrMapAdaptor_swiginit(self, _medpython.new_StringFeatureAttrMapAdaptor()) __swig_destroy__ = _medpython.delete_StringFeatureAttrMapAdaptor def __len__(self): r"""__len__(StringFeatureAttrMapAdaptor self) -> int""" return _medpython.StringFeatureAttrMapAdaptor___len__(self) def __getitem__(self, key): r"""__getitem__(StringFeatureAttrMapAdaptor self, std::string key) -> FeatureAttr""" return _medpython.StringFeatureAttrMapAdaptor___getitem__(self, key) def __setitem__(self, key, val): r"""__setitem__(StringFeatureAttrMapAdaptor self, std::string key, FeatureAttr val)""" return _medpython.StringFeatureAttrMapAdaptor___setitem__(self, key, val) def keys(self): r"""keys(StringFeatureAttrMapAdaptor self) -> StringVector""" return _medpython.StringFeatureAttrMapAdaptor_keys(self) # Register StringFeatureAttrMapAdaptor in _medpython: _medpython.StringFeatureAttrMapAdaptor_swigregister(StringFeatureAttrMapAdaptor)
[docs] class Features(object): r"""Proxy of C++ MPFeatures class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _medpython.delete_Features def __init__(self, *args): r""" __init__(Features self) -> Features __init__(Features self, int _time_unit) -> Features __init__(Features self, Features other) -> Features """ _medpython.Features_swiginit(self, _medpython.new_Features(*args))
[docs] def MEDPY_GET_data(self): r"""MEDPY_GET_data(Features self) -> StringVecFloatMapAdaptor""" return _medpython.Features_MEDPY_GET_data(self)
[docs] def MEDPY_GET_weights(self): r"""MEDPY_GET_weights(Features self)""" return _medpython.Features_MEDPY_GET_weights(self)
[docs] def MEDPY_GET_samples(self): r"""MEDPY_GET_samples(Features self) -> SampleVectorAdaptor""" return _medpython.Features_MEDPY_GET_samples(self)
[docs] def MEDPY_GET_pid_pos_len(self): r"""MEDPY_GET_pid_pos_len(Features self) -> IntPairIntIntMapAdaptor""" return _medpython.Features_MEDPY_GET_pid_pos_len(self)
[docs] def MEDPY_GET_attributes(self): r"""MEDPY_GET_attributes(Features self) -> StringFeatureAttrMapAdaptor""" return _medpython.Features_MEDPY_GET_attributes(self)
[docs] def MEDPY_GET_tags(self): r"""MEDPY_GET_tags(Features self) -> StringUOSetStringMapAdaptor""" return _medpython.Features_MEDPY_GET_tags(self)
[docs] def MEDPY_GET_time_unit(self): r"""MEDPY_GET_time_unit(Features self) -> int""" return _medpython.Features_MEDPY_GET_time_unit(self)
[docs] def MEDPY_SET_time_unit(self, new_time_unit): r"""MEDPY_SET_time_unit(Features self, int new_time_unit)""" return _medpython.Features_MEDPY_SET_time_unit(self, new_time_unit)
[docs] @staticmethod def MEDPY_GET_global_serial_id_cnt(): r"""MEDPY_GET_global_serial_id_cnt() -> int""" return _medpython.Features_MEDPY_GET_global_serial_id_cnt()
[docs] @staticmethod def MEDPY_SET_global_serial_id_cnt(newval): r"""MEDPY_SET_global_serial_id_cnt(int newval)""" return _medpython.Features_MEDPY_SET_global_serial_id_cnt(newval)
[docs] def clear(self): r"""clear(Features self)""" return _medpython.Features_clear(self)
[docs] def set_time_unit(self, _time_unit): r"""set_time_unit(Features self, int _time_unit)""" return _medpython.Features_set_time_unit(self, _time_unit)
[docs] def get_feature_names(self): r"""get_feature_names(Features self) -> StringVector""" return _medpython.Features_get_feature_names(self)
[docs] def get_as_matrix(self, *args): r""" get_as_matrix(Features self, Mat mat) get_as_matrix(Features self, Mat mat, StringVector names) get_as_matrix(Features self, Mat mat, StringVector names, int * int_in_buf) """ return _medpython.Features_get_as_matrix(self, *args)
[docs] def set_as_matrix(self, mat): r"""set_as_matrix(Features self, Mat mat)""" return _medpython.Features_set_as_matrix(self, mat)
[docs] def append_samples(self, *args): r""" append_samples(Features self, IdSamples in_samples) append_samples(Features self, Samples in_samples) """ return _medpython.Features_append_samples(self, *args)
[docs] def insert_samples(self, in_samples, index): r"""insert_samples(Features self, IdSamples in_samples, int index)""" return _medpython.Features_insert_samples(self, in_samples, index)
[docs] def init_all_samples(self, in_samples): r"""init_all_samples(Features self, IdSamplesVectorAdaptor in_samples)""" return _medpython.Features_init_all_samples(self, in_samples)
[docs] def init_pid_pos_len(self): r"""init_pid_pos_len(Features self)""" return _medpython.Features_init_pid_pos_len(self)
[docs] def get_pid_pos(self, pid): r"""get_pid_pos(Features self, int pid) -> int""" return _medpython.Features_get_pid_pos(self, pid)
[docs] def get_pid_len(self, pid): r"""get_pid_len(Features self, int pid) -> int""" return _medpython.Features_get_pid_len(self, pid)
[docs] def get_crc(self): r"""get_crc(Features self) -> unsigned int""" return _medpython.Features_get_crc(self)
[docs] def print_csv(self): r"""print_csv(Features self)""" return _medpython.Features_print_csv(self)
[docs] def get_samples(self, outSamples): r"""get_samples(Features self, Samples outSamples)""" return _medpython.Features_get_samples(self, outSamples)
[docs] def get_max_serial_id_cnt(self): r"""get_max_serial_id_cnt(Features self) -> int""" return _medpython.Features_get_max_serial_id_cnt(self)
[docs] def write_as_csv_mat(self, csv_fname): r"""write_as_csv_mat(Features self, string const & csv_fname) -> int""" return _medpython.Features_write_as_csv_mat(self, csv_fname)
[docs] def read_from_csv_mat(self, csv_fname): r"""read_from_csv_mat(Features self, string const & csv_fname) -> int""" return _medpython.Features_read_from_csv_mat(self, csv_fname)
[docs] def filter(self, selectedFeatures): r"""filter(Features self, StringVector selectedFeatures) -> int""" return _medpython.Features_filter(self, selectedFeatures)
[docs] def version(self): r"""version(Features self) -> int""" return _medpython.Features_version(self)
[docs] def asSerializable(self): r"""asSerializable(Features self) -> SerializableObject""" return _medpython.Features_asSerializable(self)
[docs] def split_by_fold(self, outMatrix, iFold, isLearning): r"""split_by_fold(Features self, Features outMatrix, int iFold, bool isLearning)""" return _medpython.Features_split_by_fold(self, outMatrix, iFold, isLearning)
data = property(MEDPY_GET_data,None) weights = property(MEDPY_GET_weights,None) samples = property(MEDPY_GET_samples,None) pid_pos_len = property(MEDPY_GET_pid_pos_len,None) attributes = property(MEDPY_GET_attributes,None) tags = property(MEDPY_GET_tags,None) time_unit = property(MEDPY_GET_time_unit,MEDPY_SET_time_unit) global_serial_id_cnt = property(MEDPY_GET_global_serial_id_cnt,MEDPY_SET_global_serial_id_cnt)
# Register Features in _medpython: _medpython.Features_swigregister(Features) class RNG(object): r"""Proxy of C++ MPRNG class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def rand(self): r"""rand(RNG self) -> int""" return _medpython.RNG_rand(self) def rand30(self): r"""rand30(RNG self) -> int""" return _medpython.RNG_rand30(self) def srand(self, val): r"""srand(RNG self, int val)""" return _medpython.RNG_srand(self, val) def max(self): r"""max(RNG self) -> int""" return _medpython.RNG_max(self) def __init__(self): r"""__init__(RNG self) -> RNG""" _medpython.RNG_swiginit(self, _medpython.new_RNG()) __swig_destroy__ = _medpython.delete_RNG # Register RNG in _medpython: _medpython.RNG_swigregister(RNG) class GlobalClass(object): r"""Proxy of C++ MPGlobalClass class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def MEDPY_GET_default_time_unit(self): r"""MEDPY_GET_default_time_unit(GlobalClass self) -> int""" return _medpython.GlobalClass_MEDPY_GET_default_time_unit(self) def MEDPY_SET_default_time_unit(self, new_val): r"""MEDPY_SET_default_time_unit(GlobalClass self, int new_val)""" return _medpython.GlobalClass_MEDPY_SET_default_time_unit(self, new_val) def MEDPY_GET_default_windows_time_unit(self): r"""MEDPY_GET_default_windows_time_unit(GlobalClass self) -> int""" return _medpython.GlobalClass_MEDPY_GET_default_windows_time_unit(self) def MEDPY_SET_default_windows_time_unit(self, new_val): r"""MEDPY_SET_default_windows_time_unit(GlobalClass self, int new_val)""" return _medpython.GlobalClass_MEDPY_SET_default_windows_time_unit(self, new_val) RNG = property(_medpython.GlobalClass_RNG_get, _medpython.GlobalClass_RNG_set, doc=r"""RNG : MPRNG""") logger = property(_medpython.GlobalClass_logger_get, _medpython.GlobalClass_logger_set, doc=r"""logger : MPLogger""") version_info = property(_medpython.GlobalClass_version_info_get, _medpython.GlobalClass_version_info_set, doc=r"""version_info : string""") def __init__(self): r"""__init__(GlobalClass self) -> GlobalClass""" _medpython.GlobalClass_swiginit(self, _medpython.new_GlobalClass()) default_time_unit = property(MEDPY_GET_default_time_unit,MEDPY_SET_default_time_unit) default_windows_time_unit = property(MEDPY_GET_default_windows_time_unit,MEDPY_SET_default_windows_time_unit) __swig_destroy__ = _medpython.delete_GlobalClass # Register GlobalClass in _medpython: _medpython.GlobalClass_swigregister(GlobalClass)
[docs] class CommonLib(object): r"""Proxy of C++ MPCommonLib class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr
[docs] @staticmethod def print_auc_performance(samples, folds, outFile): r"""print_auc_performance(Samples samples, int * folds, string outFile)""" return _medpython.CommonLib_print_auc_performance(samples, folds, outFile)
[docs] @staticmethod def shuffleMatrix(matrix): r"""shuffleMatrix(Features matrix)""" return _medpython.CommonLib_shuffleMatrix(matrix)
[docs] @staticmethod def read_predictor_from_file(pred, predictorFile): r"""read_predictor_from_file(Predictor pred, string predictorFile)""" return _medpython.CommonLib_read_predictor_from_file(pred, predictorFile)
def __init__(self): r"""__init__(CommonLib self) -> CommonLib""" _medpython.CommonLib_swiginit(self, _medpython.new_CommonLib()) __swig_destroy__ = _medpython.delete_CommonLib
# Register CommonLib in _medpython: _medpython.CommonLib_swigregister(CommonLib)
[docs] class Logger(object): r"""Proxy of C++ MPLogger class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr
[docs] def init_all_levels(self, level): r"""init_all_levels(Logger self, int level)""" return _medpython.Logger_init_all_levels(self, level)
[docs] def init_all_files(self, fname): r"""init_all_files(Logger self, string const & fname) -> int""" return _medpython.Logger_init_all_files(self, fname)
[docs] def init_level(self, section, level): r"""init_level(Logger self, int section, int level)""" return _medpython.Logger_init_level(self, section, level)
[docs] def init_file(self, section, fname): r"""init_file(Logger self, int section, string const & fname) -> int""" return _medpython.Logger_init_file(self, section, fname)
[docs] def add_file(self, section, fname): r"""add_file(Logger self, int section, string const & fname) -> int""" return _medpython.Logger_add_file(self, section, fname)
[docs] def init_out(self, *args): r"""init_out(Logger self, string const & fname="")""" return _medpython.Logger_init_out(self, *args)
def __init__(self): r"""__init__(Logger self) -> Logger""" _medpython.Logger_swiginit(self, _medpython.new_Logger()) __swig_destroy__ = _medpython.delete_Logger
# Register Logger in _medpython: _medpython.Logger_swigregister(Logger) cvar = _medpython.cvar Logger.LOG_APP_ = _medpython.cvar.Logger_LOG_APP_ Logger.LOG_DEF_ = _medpython.cvar.Logger_LOG_DEF_ Logger.LOG_INFRA_ = _medpython.cvar.Logger_LOG_INFRA_ Logger.LOG_REP_ = _medpython.cvar.Logger_LOG_REP_ Logger.LOG_INDEX_ = _medpython.cvar.Logger_LOG_INDEX_ Logger.LOG_DICT_ = _medpython.cvar.Logger_LOG_DICT_ Logger.LOG_SIG_ = _medpython.cvar.Logger_LOG_SIG_ Logger.LOG_CONVERT_ = _medpython.cvar.Logger_LOG_CONVERT_ Logger.LOG_MED_UTILS_ = _medpython.cvar.Logger_LOG_MED_UTILS_ Logger.LOG_MEDMAT_ = _medpython.cvar.Logger_LOG_MEDMAT_ Logger.LOG_MEDIO_ = _medpython.cvar.Logger_LOG_MEDIO_ Logger.LOG_DATA_STRUCTURES_ = _medpython.cvar.Logger_LOG_DATA_STRUCTURES_ Logger.LOG_MEDALGO_ = _medpython.cvar.Logger_LOG_MEDALGO_ Logger.LOG_MEDFEAT_ = _medpython.cvar.Logger_LOG_MEDFEAT_ Logger.LOG_MEDSTAT_ = _medpython.cvar.Logger_LOG_MEDSTAT_ Logger.LOG_REPCLEANER_ = _medpython.cvar.Logger_LOG_REPCLEANER_ Logger.LOG_FTRGNRTR_ = _medpython.cvar.Logger_LOG_FTRGNRTR_ Logger.LOG_CV_ = _medpython.cvar.Logger_LOG_CV_ Logger.LOG_FEATCLEANER_ = _medpython.cvar.Logger_LOG_FEATCLEANER_ Logger.LOG_VALCLNR_ = _medpython.cvar.Logger_LOG_VALCLNR_ Logger.MED_SAMPLES_CV_ = _medpython.cvar.Logger_MED_SAMPLES_CV_ Logger.LOG_FEAT_SELECTOR_ = _medpython.cvar.Logger_LOG_FEAT_SELECTOR_ Logger.LOG_SMPL_FILTER_ = _medpython.cvar.Logger_LOG_SMPL_FILTER_ Logger.LOG_SRL_ = _medpython.cvar.Logger_LOG_SRL_ Logger.LOG_MED_MODEL_ = _medpython.cvar.Logger_LOG_MED_MODEL_ Logger.LOG_REPTYPE_ = _medpython.cvar.Logger_LOG_REPTYPE_ Logger.MAX_LOG_SECTION_ = _medpython.cvar.Logger_MAX_LOG_SECTION_ Logger.NO_LOG_LEVEL_ = _medpython.cvar.Logger_NO_LOG_LEVEL_ Logger.MIN_LOG_LEVEL_ = _medpython.cvar.Logger_MIN_LOG_LEVEL_ Logger.DEBUG_LOG_LEVEL_ = _medpython.cvar.Logger_DEBUG_LOG_LEVEL_ Logger.LOG_DEF_LEVEL_ = _medpython.cvar.Logger_LOG_DEF_LEVEL_ Logger.MAX_LOG_LEVEL_ = _medpython.cvar.Logger_MAX_LOG_LEVEL_ Logger.VERBOSE_LOG_LEVEL_ = _medpython.cvar.Logger_VERBOSE_LOG_LEVEL_
[docs] class Mat(object): r"""Proxy of C++ MPMat class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" __init__(Mat self) -> Mat __init__(Mat self, int n_rows, int n_cols) -> Mat __init__(Mat self, float * IN_ARRAY2) -> Mat """ _medpython.Mat_swiginit(self, _medpython.new_Mat(*args)) __swig_destroy__ = _medpython.delete_Mat
[docs] def get_numpy_copy(self): r"""get_numpy_copy(Mat self)""" return _medpython.Mat_get_numpy_copy(self)
[docs] def get_numpy_view_unsafe(self): r"""get_numpy_view_unsafe(Mat self)""" return _medpython.Mat_get_numpy_view_unsafe(self)
[docs] def test(self, n_rows, n_cols): r"""test(Mat self, int n_rows, int n_cols)""" return _medpython.Mat_test(self, n_rows, n_cols)
[docs] def load_numpy(self, IN_ARRAY2): r"""load_numpy(Mat self, float * IN_ARRAY2)""" return _medpython.Mat_load_numpy(self, IN_ARRAY2)
[docs] @staticmethod def MEDPY_GET_Normalize_Cols(): r"""MEDPY_GET_Normalize_Cols() -> int""" return _medpython.Mat_MEDPY_GET_Normalize_Cols()
[docs] @staticmethod def MEDPY_GET_Normalize_Rows(): r"""MEDPY_GET_Normalize_Rows() -> int""" return _medpython.Mat_MEDPY_GET_Normalize_Rows()
[docs] def MEDPY_GET_nrows(self): r"""MEDPY_GET_nrows(Mat self) -> int""" return _medpython.Mat_MEDPY_GET_nrows(self)
[docs] def MEDPY_GET_ncols(self): r"""MEDPY_GET_ncols(Mat self) -> int""" return _medpython.Mat_MEDPY_GET_ncols(self)
def __len__(self): r"""__len__(Mat self) -> unsigned long long""" return _medpython.Mat___len__(self)
[docs] def is_valid(self, output=False): r"""is_valid(Mat self, bool output=False) -> bool""" return _medpython.Mat_is_valid(self, output)
def __getitem__(self, index): r"""__getitem__(Mat self, IntVector index) -> float""" return _medpython.Mat___getitem__(self, index) def __setitem__(self, index, val): r"""__setitem__(Mat self, IntVector index, float val)""" return _medpython.Mat___setitem__(self, index, val)
[docs] def MEDPY_GET_row_ids(self): r"""MEDPY_GET_row_ids(Mat self)""" return _medpython.Mat_MEDPY_GET_row_ids(self)
[docs] def MEDPY_SET_row_ids(self, row_ids_buf): r"""MEDPY_SET_row_ids(Mat self, int * row_ids_buf)""" return _medpython.Mat_MEDPY_SET_row_ids(self, row_ids_buf)
[docs] def MEDPY_GET_signals(self): r"""MEDPY_GET_signals(Mat self) -> StringVector""" return _medpython.Mat_MEDPY_GET_signals(self)
[docs] def MEDPY_GET_avg(self): r"""MEDPY_GET_avg(Mat self)""" return _medpython.Mat_MEDPY_GET_avg(self)
[docs] def MEDPY_GET_std(self): r"""MEDPY_GET_std(Mat self)""" return _medpython.Mat_MEDPY_GET_std(self)
[docs] def MEDPY_GET_normalized_flag(self): r"""MEDPY_GET_normalized_flag(Mat self) -> int""" return _medpython.Mat_MEDPY_GET_normalized_flag(self)
[docs] def MEDPY_SET_normalized_flag(self, newval): r"""MEDPY_SET_normalized_flag(Mat self, int newval)""" return _medpython.Mat_MEDPY_SET_normalized_flag(self, newval)
[docs] def MEDPY_GET_transposed_flag(self): r"""MEDPY_GET_transposed_flag(Mat self) -> int""" return _medpython.Mat_MEDPY_GET_transposed_flag(self)
[docs] def MEDPY_SET_transposed_flag(self, newval): r"""MEDPY_SET_transposed_flag(Mat self, int newval)""" return _medpython.Mat_MEDPY_SET_transposed_flag(self, newval)
[docs] def MEDPY_GET_missing_value(self): r"""MEDPY_GET_missing_value(Mat self) -> float""" return _medpython.Mat_MEDPY_GET_missing_value(self)
[docs] def MEDPY_SET_missing_value(self, newval): r"""MEDPY_SET_missing_value(Mat self, float newval)""" return _medpython.Mat_MEDPY_SET_missing_value(self, newval)
[docs] def zero(self): r"""zero(Mat self)""" return _medpython.Mat_zero(self)
[docs] def set_val(self, val): r"""set_val(Mat self, float val)""" return _medpython.Mat_set_val(self, val)
[docs] def clear(self): r"""clear(Mat self)""" return _medpython.Mat_clear(self)
[docs] def resize(self, n_rows, n_cols): r"""resize(Mat self, int n_rows, int n_cols)""" return _medpython.Mat_resize(self, n_rows, n_cols)
[docs] def read_from_bin_file(self, fname): r"""read_from_bin_file(Mat self, string const & fname) -> int""" return _medpython.Mat_read_from_bin_file(self, fname)
[docs] def write_to_bin_file(self, fname): r"""write_to_bin_file(Mat self, string const & fname) -> int""" return _medpython.Mat_write_to_bin_file(self, fname)
[docs] def write_to_csv_file(self, fname): r"""write_to_csv_file(Mat self, string const & fname) -> int""" return _medpython.Mat_write_to_csv_file(self, fname)
[docs] def read_from_csv_file(self, fname, titles_line_flag): r"""read_from_csv_file(Mat self, string const & fname, int titles_line_flag) -> int""" return _medpython.Mat_read_from_csv_file(self, fname, titles_line_flag)
[docs] def transpose(self): r"""transpose(Mat self)""" return _medpython.Mat_transpose(self)
[docs] def get_sub_mat(self, rows_to_take, cols_to_take): r"""get_sub_mat(Mat self, IntVector rows_to_take, IntVector cols_to_take)""" return _medpython.Mat_get_sub_mat(self, rows_to_take, cols_to_take)
[docs] def get_sub_mat_by_flags(self, rows_to_take_flag, cols_to_take_flag): r"""get_sub_mat_by_flags(Mat self, IntVector rows_to_take_flag, IntVector cols_to_take_flag)""" return _medpython.Mat_get_sub_mat_by_flags(self, rows_to_take_flag, cols_to_take_flag)
[docs] def add_rows(self, *args): r""" add_rows(Mat self, Mat m_add) add_rows(Mat self, float * m_add) """ return _medpython.Mat_add_rows(self, *args)
[docs] def add_cols(self, *args): r""" add_cols(Mat self, Mat m_add) add_cols(Mat self, float * m_add) """ return _medpython.Mat_add_cols(self, *args)
[docs] def get_row(self, i_row): r"""get_row(Mat self, int i_row)""" return _medpython.Mat_get_row(self, i_row)
[docs] def get_col(self, i_col): r"""get_col(Mat self, int i_col)""" return _medpython.Mat_get_col(self, i_col)
[docs] def normalize(self, *args): r""" normalize(Mat self, int norm_type, float * wgts) normalize(Mat self, int norm_type=Normalize_Cols) normalize(Mat self, float * external_avg, float * external_std, int norm_type=1) """ return _medpython.Mat_normalize(self, *args)
[docs] def get_cols_avg_std(self): r"""get_cols_avg_std(Mat self)""" return _medpython.Mat_get_cols_avg_std(self)
[docs] def set_signals(self, sigs): r"""set_signals(Mat self, StringVector sigs)""" return _medpython.Mat_set_signals(self, sigs)
[docs] def load_transposed(self, IN_ARRAY2): r"""load_transposed(Mat self, float * IN_ARRAY2)""" return _medpython.Mat_load_transposed(self, IN_ARRAY2)
[docs] def load(self, *args): r""" load(Mat self, float * IN_ARRAY2) load(Mat self, Mat x) """ return _medpython.Mat_load(self, *args)
[docs] def asSerializable(self): r"""asSerializable(Mat self) -> SerializableObject""" return _medpython.Mat_asSerializable(self)
Normalize_Cols = property(MEDPY_GET_Normalize_Cols,None) Normalize_Rows = property(MEDPY_GET_Normalize_Rows,None) nrows = property(MEDPY_GET_nrows,None) ncols = property(MEDPY_GET_ncols,None) row_ids = property(MEDPY_GET_row_ids,MEDPY_SET_row_ids) signals = property(MEDPY_GET_signals,None) avg = property(MEDPY_GET_avg,None) std = property(MEDPY_GET_std,None) normalized_flag = property(MEDPY_GET_normalized_flag,MEDPY_SET_normalized_flag) transposed_flag = property(MEDPY_GET_transposed_flag,MEDPY_SET_transposed_flag) missing_value = property(MEDPY_GET_missing_value,MEDPY_SET_missing_value)
# Register Mat in _medpython: _medpython.Mat_swigregister(Mat) Mat.Normalize_Cols = _medpython.cvar.Mat_Normalize_Cols Mat.Normalize_Rows = _medpython.cvar.Mat_Normalize_Rows Mat.MISSING_VALUE = _medpython.cvar.Mat_MISSING_VALUE
[docs] class ModelStage(object): r"""Proxy of C++ MPModelStage class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(ModelStage self) -> ModelStage""" _medpython.ModelStage_swiginit(self, _medpython.new_ModelStage()) __swig_destroy__ = _medpython.delete_ModelStage
# Register ModelStage in _medpython: _medpython.ModelStage_swigregister(ModelStage) ModelStage.LEARN_REP_PROCESSORS = _medpython.cvar.ModelStage_LEARN_REP_PROCESSORS ModelStage.LEARN_FTR_GENERATORS = _medpython.cvar.ModelStage_LEARN_FTR_GENERATORS ModelStage.APPLY_FTR_GENERATORS = _medpython.cvar.ModelStage_APPLY_FTR_GENERATORS ModelStage.LEARN_FTR_PROCESSORS = _medpython.cvar.ModelStage_LEARN_FTR_PROCESSORS ModelStage.APPLY_FTR_PROCESSORS = _medpython.cvar.ModelStage_APPLY_FTR_PROCESSORS ModelStage.LEARN_PREDICTOR = _medpython.cvar.ModelStage_LEARN_PREDICTOR ModelStage.APPLY_PREDICTOR = _medpython.cvar.ModelStage_APPLY_PREDICTOR ModelStage.INSERT_PREDS = _medpython.cvar.ModelStage_INSERT_PREDS ModelStage.LEARN_POST_PROCESSORS = _medpython.cvar.ModelStage_LEARN_POST_PROCESSORS ModelStage.APPLY_POST_PROCESSORS = _medpython.cvar.ModelStage_APPLY_POST_PROCESSORS ModelStage.END = _medpython.cvar.ModelStage_END
[docs] class Model(object): r"""Proxy of C++ MPModel class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(Model self) -> Model""" _medpython.Model_swiginit(self, _medpython.new_Model()) __swig_destroy__ = _medpython.delete_Model
[docs] def init_from_json_file(self, fname): r"""init_from_json_file(Model self, std::string const & fname)""" return _medpython.Model_init_from_json_file(self, fname)
[docs] def init_from_json_file_with_alterations(self, fname, json_alt): r"""init_from_json_file_with_alterations(Model self, std::string const & fname, StringVector json_alt) -> StringVector""" return _medpython.Model_init_from_json_file_with_alterations(self, fname, json_alt)
[docs] def add_pre_processors_json_string_to_model(self, in_json, fname): r"""add_pre_processors_json_string_to_model(Model self, string in_json, string fname)""" return _medpython.Model_add_pre_processors_json_string_to_model(self, in_json, fname)
[docs] def get_required_signal_names(self): r"""get_required_signal_names(Model self) -> StringVector""" return _medpython.Model_get_required_signal_names(self)
[docs] def learn(self, *args): r""" learn(Model self, PidRepository rep, Samples samples) -> int learn(Model self, PidRepository rep, Samples samples, int start_stage, int end_stage) -> int """ return _medpython.Model_learn(self, *args)
[docs] def apply(self, *args): r""" apply(Model self, PidRepository rep, Samples samples) -> int apply(Model self, PidRepository rep, Samples samples, int start_stage, int end_stage) -> int """ return _medpython.Model_apply(self, *args)
[docs] def write_to_file(self, fname): r"""write_to_file(Model self, std::string const & fname) -> int""" return _medpython.Model_write_to_file(self, fname)
[docs] def read_from_file(self, fname): r"""read_from_file(Model self, string const & fname) -> int""" return _medpython.Model_read_from_file(self, fname)
[docs] def MEDPY_GET_features(self): r"""MEDPY_GET_features(Model self) -> Features""" return _medpython.Model_MEDPY_GET_features(self)
[docs] def clear(self): r"""clear(Model self)""" return _medpython.Model_clear(self)
[docs] def MEDPY_GET_verbosity(self): r"""MEDPY_GET_verbosity(Model self) -> int""" return _medpython.Model_MEDPY_GET_verbosity(self)
[docs] def MEDPY_SET_verbosity(self, new_vval): r"""MEDPY_SET_verbosity(Model self, int new_vval)""" return _medpython.Model_MEDPY_SET_verbosity(self, new_vval)
[docs] def add_feature_generator(self, name, signal): r"""add_feature_generator(Model self, string & name, string & signal)""" return _medpython.Model_add_feature_generator(self, name, signal)
[docs] def add_feature_generators(self, *args): r""" add_feature_generators(Model self, string & name, StringVector signals) add_feature_generators(Model self, string & name, StringVector signals, string init_string) add_feature_generators(Model self, string & name, string & signal, string init_string) """ return _medpython.Model_add_feature_generators(self, *args)
[docs] def add_age(self): r"""add_age(Model self)""" return _medpython.Model_add_age(self)
[docs] def add_gender(self): r"""add_gender(Model self)""" return _medpython.Model_add_gender(self)
[docs] def get_all_features_names(self, feat_names, before_process_set): r"""get_all_features_names(Model self, StringVector feat_names, int before_process_set)""" return _medpython.Model_get_all_features_names(self, feat_names, before_process_set)
[docs] def add_normalizers(self, *args): r""" add_normalizers(Model self) add_normalizers(Model self, string init_string) add_normalizers(Model self, StringVector features) add_normalizers(Model self, StringVector features, string init_string) """ return _medpython.Model_add_normalizers(self, *args)
[docs] def add_imputers(self, *args): r""" add_imputers(Model self) add_imputers(Model self, string init_string) add_imputers(Model self, StringVector features) add_imputers(Model self, StringVector features, string init_string) """ return _medpython.Model_add_imputers(self, *args)
[docs] def add_rep_processor_to_set(self, i_set, init_string): r"""add_rep_processor_to_set(Model self, int i_set, string const & init_string)""" return _medpython.Model_add_rep_processor_to_set(self, i_set, init_string)
[docs] def add_feature_generator_to_set(self, i_set, init_string): r"""add_feature_generator_to_set(Model self, int i_set, string const & init_string)""" return _medpython.Model_add_feature_generator_to_set(self, i_set, init_string)
[docs] def add_feature_processor_to_set(self, i_set, duplicate, init_string): r"""add_feature_processor_to_set(Model self, int i_set, int duplicate, string const & init_string)""" return _medpython.Model_add_feature_processor_to_set(self, i_set, duplicate, init_string)
[docs] def add_process_to_set(self, *args): r""" add_process_to_set(Model self, int i_set, int duplicate, string const & init_string) add_process_to_set(Model self, int i_set, string const & init_string) """ return _medpython.Model_add_process_to_set(self, *args)
[docs] def make_predictor(self, name): r"""make_predictor(Model self, string name)""" return _medpython.Model_make_predictor(self, name)
[docs] def set_predictor(self, *args): r""" set_predictor(Model self, Predictor _predictor) set_predictor(Model self, string name, string init_string) """ return _medpython.Model_set_predictor(self, *args)
[docs] def collect_and_add_virtual_signals(self, rep): r"""collect_and_add_virtual_signals(Model self, PidRepository rep) -> int""" return _medpython.Model_collect_and_add_virtual_signals(self, rep)
[docs] def quick_learn_rep_processors(self, rep, samples): r"""quick_learn_rep_processors(Model self, PidRepository rep, Samples samples) -> int""" return _medpython.Model_quick_learn_rep_processors(self, rep, samples)
[docs] def learn_rep_processors(self, rep, samples): r"""learn_rep_processors(Model self, PidRepository rep, Samples samples) -> int""" return _medpython.Model_learn_rep_processors(self, rep, samples)
[docs] def filter_rep_processors(self): r"""filter_rep_processors(Model self)""" return _medpython.Model_filter_rep_processors(self)
[docs] def learn_feature_generators(self, rep, learn_samples): r"""learn_feature_generators(Model self, PidRepository rep, Samples learn_samples) -> int""" return _medpython.Model_learn_feature_generators(self, rep, learn_samples)
[docs] def generate_all_features(self, rep, samples, features, req_feature_generators): r"""generate_all_features(Model self, PidRepository rep, Samples samples, Features features, StringVector req_feature_generators) -> int""" return _medpython.Model_generate_all_features(self, rep, samples, features, req_feature_generators)
[docs] def learn_and_apply_feature_processors(self, features): r"""learn_and_apply_feature_processors(Model self, Features features) -> int""" return _medpython.Model_learn_and_apply_feature_processors(self, features)
[docs] def learn_feature_processors(self, features): r"""learn_feature_processors(Model self, Features features) -> int""" return _medpython.Model_learn_feature_processors(self, features)
[docs] def apply_feature_processors(self, features, learning): r"""apply_feature_processors(Model self, Features features, bool learning) -> int""" return _medpython.Model_apply_feature_processors(self, features, learning)
[docs] def fit_for_repository(self, rep): r"""fit_for_repository(Model self, PidRepository rep)""" return _medpython.Model_fit_for_repository(self, rep)
[docs] def calc_contribs(self, mat, mat_out): r"""calc_contribs(Model self, Mat mat, Mat mat_out)""" return _medpython.Model_calc_contribs(self, mat, mat_out)
[docs] def calc_feature_contribs_conditional(self, mat_x_in, features_cond_string, features_cond_float, mat_x_out, mat_contribs): r"""calc_feature_contribs_conditional(Model self, Mat mat_x_in, string const & features_cond_string, float features_cond_float, Mat mat_x_out, Mat mat_contribs)""" return _medpython.Model_calc_feature_contribs_conditional(self, mat_x_in, features_cond_string, features_cond_float, mat_x_out, mat_contribs)
[docs] def dprint_process(self, pref, rp_flag, fg_flag, fp_flag, pp_flag, predictor_type): r"""dprint_process(Model self, string const & pref, int rp_flag, int fg_flag, int fp_flag, bool pp_flag, bool predictor_type)""" return _medpython.Model_dprint_process(self, pref, rp_flag, fg_flag, fp_flag, pp_flag, predictor_type)
[docs] def write_feature_matrix(self, mat_fname): r"""write_feature_matrix(Model self, string const mat_fname) -> int""" return _medpython.Model_write_feature_matrix(self, mat_fname)
[docs] def asSerializable(self): r"""asSerializable(Model self) -> SerializableObject""" return _medpython.Model_asSerializable(self)
features = property(MEDPY_GET_features,None) verbosity = property(MEDPY_GET_verbosity,MEDPY_SET_verbosity)
# Register Model in _medpython: _medpython.Model_swigregister(Model) class PandasAdaptor(object): r"""Proxy of C++ MPPandasAdaptor class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr type_requirements = property(_medpython.PandasAdaptor_type_requirements_get, _medpython.PandasAdaptor_type_requirements_set, doc=r"""type_requirements : MPStringStringMapAdaptor""") def keys(self): r"""keys(PandasAdaptor self) -> StringVector""" return _medpython.PandasAdaptor_keys(self) __swig_destroy__ = _medpython.delete_PandasAdaptor def clear(self): r"""clear(PandasAdaptor self)""" return _medpython.PandasAdaptor_clear(self) def export_column(self, key): r"""export_column(PandasAdaptor self, std::string const & key)""" return _medpython.PandasAdaptor_export_column(self, key) def __getitem__(self, key): r"""__getitem__(PandasAdaptor self, std::string const & key)""" return _medpython.PandasAdaptor___getitem__(self, key) def __iter__(self): r"""__iter__(PandasAdaptor self) -> MPPandasAdaptor_iter""" return _medpython.PandasAdaptor___iter__(self) def get_categorial_col_dict(self, col_name): r"""get_categorial_col_dict(PandasAdaptor self, std::string const & col_name) -> IntStringMapAdaptor""" return _medpython.PandasAdaptor_get_categorial_col_dict(self, col_name) def get_categorical_cols(self): r"""get_categorical_cols(PandasAdaptor self) -> StringVector""" return _medpython.PandasAdaptor_get_categorical_cols(self) def import_column(self, col_name, IN_ARRAY1, make_a_copy=False): r"""import_column(PandasAdaptor self, string const & col_name, void * IN_ARRAY1, bool make_a_copy=False)""" return _medpython.PandasAdaptor_import_column(self, col_name, IN_ARRAY1, make_a_copy) def __init__(self): r"""__init__(PandasAdaptor self) -> PandasAdaptor""" _medpython.PandasAdaptor_swiginit(self, _medpython.new_PandasAdaptor()) # Register PandasAdaptor in _medpython: _medpython.PandasAdaptor_swigregister(PandasAdaptor) class MPPandasAdaptor_iter(object): r"""Proxy of C++ MPPandasAdaptor_iter class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args): r""" __init__(MPPandasAdaptor_iter self, PandasAdaptor o, StringVector keys_param) -> MPPandasAdaptor_iter __init__(MPPandasAdaptor_iter self, MPPandasAdaptor_iter orig) -> MPPandasAdaptor_iter """ _medpython.MPPandasAdaptor_iter_swiginit(self, _medpython.new_MPPandasAdaptor_iter(*args)) def next(self): r"""next(MPPandasAdaptor_iter self) -> std::string""" return _medpython.MPPandasAdaptor_iter_next(self) def __repr__(self): r"""__repr__(MPPandasAdaptor_iter self) -> std::string""" return _medpython.MPPandasAdaptor_iter___repr__(self) __swig_destroy__ = _medpython.delete_MPPandasAdaptor_iter # Register MPPandasAdaptor_iter in _medpython: _medpython.MPPandasAdaptor_iter_swigregister(MPPandasAdaptor_iter)
[docs] class PidRepository(object): r"""Proxy of C++ MPPidRepository class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr dict = property(_medpython.PidRepository_dict_get, _medpython.PidRepository_dict_set, doc=r"""dict : MPDictionary""") def __init__(self): r"""__init__(PidRepository self) -> PidRepository""" _medpython.PidRepository_swiginit(self, _medpython.new_PidRepository()) __swig_destroy__ = _medpython.delete_PidRepository
[docs] def read_all(self, *args): r""" read_all(conf_file_fname, [pids_to_take_array], [list_str_signals_to_take]) -> int returns -1 if fails reading a repository for a group of pids and signals.Empty group means all of it.read_all(conf_file_fname, [pids_to_take_array], [list_str_signals_to_take]) -> int returns -1 if fails reading a repository for a group of pids and signals.Empty group means all of it. """ return _medpython.PidRepository_read_all(self, *args)
[docs] def read_all_i(self, conf_fname, pids_to_take, signals_to_take): r"""read_all_i(PidRepository self, std::string const & conf_fname, IntVector pids_to_take, IntVector signals_to_take) -> int""" return _medpython.PidRepository_read_all_i(self, conf_fname, pids_to_take, signals_to_take)
[docs] def init(self, conf_fname): r""" init(conf_file_name) -> int returns -1 if fails """ return _medpython.PidRepository_init(self, conf_fname)
[docs] def loadsig(self, signame): r""" loadsig(str_signame) -> int load a signal """ return _medpython.PidRepository_loadsig(self, signame)
[docs] def loadsig_pids(self, signame, pids_to_take): r"""loadsig_pids(PidRepository self, std::string const & signame, int * pids_to_take) -> int""" return _medpython.PidRepository_loadsig_pids(self, signame, pids_to_take)
[docs] def list_signals(self): r"""list_signals(PidRepository self) -> StringVector""" return _medpython.PidRepository_list_signals(self)
[docs] def sig_id(self, signame): r""" sig_id(str_signame) -> int returns signal id number for a given signal name """ return _medpython.PidRepository_sig_id(self, signame)
[docs] def sig_type(self, signame): r""" sig_type(str_signame) -> int returns signal type """ return _medpython.PidRepository_sig_type(self, signame)
[docs] def sig_description(self, signame): r""" sig_description(str_signame) -> string returns signal string description """ return _medpython.PidRepository_sig_description(self, signame)
[docs] def is_categorical(self, signame, val_channel): r""" is_categorical(str_signame, int_val_channel) -> bool returns True is channel is categorical """ return _medpython.PidRepository_is_categorical(self, signame, val_channel)
[docs] def MEDPY_GET_pids(self): r"""MEDPY_GET_pids(PidRepository self) -> IntVector""" return _medpython.PidRepository_MEDPY_GET_pids(self)
[docs] def uget(self, pid, sid): r""" uget(int_pid, int_sid) -> SigVectorAdaptor returns a vector of universal signals """ return _medpython.PidRepository_uget(self, pid, sid)
[docs] def dict_section_id(self, secName): r""" dict_section_id(str_secName) -> int returns section id number for a given section name """ return _medpython.PidRepository_dict_section_id(self, secName)
[docs] def dict_name(self, section_id, id): r""" dict_name(int_section_id, int_id) -> string returns name of section + id """ return _medpython.PidRepository_dict_name(self, section_id, id)
[docs] def dict_prep_sets_lookup_table(self, section_id, set_names): r""" dict_prep_sets_lookup_table(int_section_id, list_String set_names) -> BoolVector returns a look-up-table for given set names """ return _medpython.PidRepository_dict_prep_sets_lookup_table(self, section_id, set_names)
[docs] def get_lut_from_regex(self, section_id, regex_s): r""" get get_lut_from_regex to names -> BoolVector returns a lut - boolean vector """ return _medpython.PidRepository_get_lut_from_regex(self, section_id, regex_s)
[docs] def export_to_numpy(self, signame, pids_to_take, use_all_pids, translate_flag, free_sig, filter_regex_str): r""" export_to_numpy(str_signame) -> SigExporter Returns the signal data represented as a list of numpy arrays, one for each field """ return _medpython.PidRepository_export_to_numpy(self, signame, pids_to_take, use_all_pids, translate_flag, free_sig, filter_regex_str)
[docs] def free(self, signame): r""" free(signame) -> int Free the signal data specified by signame """ return _medpython.PidRepository_free(self, signame)
[docs] def switch_to_in_mem(self): r""" switch_to_in_mem() Switch to in mem repository mode """ return _medpython.PidRepository_switch_to_in_mem(self)
[docs] def load_from_json(self, json_file_path): r""" load_from_json(json_file_path) Loads patient data into in-mem repository. If patient exists, adds more data """ return _medpython.PidRepository_load_from_json(self, json_file_path)
[docs] def load_from_json_str(self, json_content): r""" load_from_json_str(json_string) Loads patient data into in-mem repository. If patient exists, adds more data """ return _medpython.PidRepository_load_from_json_str(self, json_content)
[docs] def clear(self): r""" load_from_json() Clear repository memory. erase in-memory patient data """ return _medpython.PidRepository_clear(self)
[docs] def finish_load_data(self): r""" finish_load_data() prepare for model apply. not need to call it specifically. """ return _medpython.PidRepository_finish_load_data(self)
[docs] def get_sig(self, sig_name_str, translate=True, pids=None, float32to64=True, free_signal=True, regex_str=None, regex_filter=None): r"""get_sig(PidRepository self, char const * sig_name_str, bool translate=True, IntVector pids=None, bool float32to64=True, bool free_signal=True, char const * regex_str=None, char const * regex_filter=None)""" return _medpython.PidRepository_get_sig(self, sig_name_str, translate, pids, float32to64, free_signal, regex_str, regex_filter)
pids = property(MEDPY_GET_pids,None)
# Register PidRepository in _medpython: _medpython.PidRepository_swigregister(PidRepository)
[docs] class Sig(object): r"""Proxy of C++ MPSig class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, other): r"""__init__(Sig self, Sig other) -> Sig""" _medpython.Sig_swiginit(self, _medpython.new_Sig(other))
[docs] def time(self, chan=0): r"""time(Sig self, int chan=0) -> int""" return _medpython.Sig_time(self, chan)
[docs] def val(self, chan=0): r"""val(Sig self, int chan=0) -> float""" return _medpython.Sig_val(self, chan)
[docs] def timeU(self, to_time_unit): r"""timeU(Sig self, int to_time_unit) -> int""" return _medpython.Sig_timeU(self, to_time_unit)
[docs] def date(self, chan=0): r"""date(Sig self, int chan=0) -> int""" return _medpython.Sig_date(self, chan)
[docs] def years(self, chan=0): r"""years(Sig self, int chan=0) -> int""" return _medpython.Sig_years(self, chan)
[docs] def months(self, chan=0): r"""months(Sig self, int chan=0) -> int""" return _medpython.Sig_months(self, chan)
[docs] def days(self, chan=0): r"""days(Sig self, int chan=0) -> int""" return _medpython.Sig_days(self, chan)
[docs] def hours(self, chan=0): r"""hours(Sig self, int chan=0) -> int""" return _medpython.Sig_hours(self, chan)
[docs] def minutes(self, chan=0): r"""minutes(Sig self, int chan=0) -> int""" return _medpython.Sig_minutes(self, chan)
__swig_destroy__ = _medpython.delete_Sig
# Register Sig in _medpython: _medpython.Sig_swigregister(Sig) class SigVectorAdaptor(object): r"""Proxy of C++ MPSigVectorAdaptor class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, other): r"""__init__(SigVectorAdaptor self, SigVectorAdaptor other) -> SigVectorAdaptor""" _medpython.SigVectorAdaptor_swiginit(self, _medpython.new_SigVectorAdaptor(other)) __swig_destroy__ = _medpython.delete_SigVectorAdaptor def __len__(self): r"""__len__(SigVectorAdaptor self) -> int""" return _medpython.SigVectorAdaptor___len__(self) def __getitem__(self, i): r"""__getitem__(SigVectorAdaptor self, int i) -> Sig""" return _medpython.SigVectorAdaptor___getitem__(self, i) def MEDPY_GET_type(self): r"""MEDPY_GET_type(SigVectorAdaptor self) -> int""" return _medpython.SigVectorAdaptor_MEDPY_GET_type(self) def MEDPY_GET_n_time_channels(self): r"""MEDPY_GET_n_time_channels(SigVectorAdaptor self) -> int""" return _medpython.SigVectorAdaptor_MEDPY_GET_n_time_channels(self) def MEDPY_GET_n_val_channels(self): r"""MEDPY_GET_n_val_channels(SigVectorAdaptor self) -> int""" return _medpython.SigVectorAdaptor_MEDPY_GET_n_val_channels(self) def MEDPY_GET_time_unit(self): r"""MEDPY_GET_time_unit(SigVectorAdaptor self) -> int""" return _medpython.SigVectorAdaptor_MEDPY_GET_time_unit(self) def MEDPY_GET_size(self): r"""MEDPY_GET_size(SigVectorAdaptor self) -> int""" return _medpython.SigVectorAdaptor_MEDPY_GET_size(self) type = property(MEDPY_GET_type,None) n_time_channels = property(MEDPY_GET_n_time_channels,None) n_val_channels = property(MEDPY_GET_n_val_channels,None) time_unit = property(MEDPY_GET_time_unit,None) size = property(MEDPY_GET_size,None) # Register SigVectorAdaptor in _medpython: _medpython.SigVectorAdaptor_swigregister(SigVectorAdaptor)
[docs] class MedConvert(object): r"""Proxy of C++ MPMedConvert class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(MedConvert self) -> MedConvert""" _medpython.MedConvert_swiginit(self, _medpython.new_MedConvert()) __swig_destroy__ = _medpython.delete_MedConvert
[docs] def init_load_params(self, load_args): r"""init_load_params(MedConvert self, std::string const & load_args)""" return _medpython.MedConvert_init_load_params(self, load_args)
[docs] def create_rep(self, conf_fname): r"""create_rep(MedConvert self, std::string const & conf_fname)""" return _medpython.MedConvert_create_rep(self, conf_fname)
[docs] def create_index(self, conf_fname): r"""create_index(MedConvert self, std::string & conf_fname) -> int""" return _medpython.MedConvert_create_index(self, conf_fname)
# Register MedConvert in _medpython: _medpython.MedConvert_swigregister(MedConvert)
[docs] class PredictorTypes(object): r"""Proxy of C++ MPPredictorTypes class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(PredictorTypes self) -> PredictorTypes""" _medpython.PredictorTypes_swiginit(self, _medpython.new_PredictorTypes()) __swig_destroy__ = _medpython.delete_PredictorTypes
# Register PredictorTypes in _medpython: _medpython.PredictorTypes_swigregister(PredictorTypes) PredictorTypes.LINEAR_MODEL = _medpython.cvar.PredictorTypes_LINEAR_MODEL PredictorTypes.QRF = _medpython.cvar.PredictorTypes_QRF PredictorTypes.GBM = _medpython.cvar.PredictorTypes_GBM PredictorTypes.KNN = _medpython.cvar.PredictorTypes_KNN PredictorTypes.BP = _medpython.cvar.PredictorTypes_BP PredictorTypes.MARS = _medpython.cvar.PredictorTypes_MARS PredictorTypes.GD_LINEAR = _medpython.cvar.PredictorTypes_GD_LINEAR PredictorTypes.MULTI_CLASS = _medpython.cvar.PredictorTypes_MULTI_CLASS PredictorTypes.XGB = _medpython.cvar.PredictorTypes_XGB PredictorTypes.LASSO = _medpython.cvar.PredictorTypes_LASSO PredictorTypes.MIC_NET = _medpython.cvar.PredictorTypes_MIC_NET PredictorTypes.BOOSTER = _medpython.cvar.PredictorTypes_BOOSTER PredictorTypes.DEEP_BIT = _medpython.cvar.PredictorTypes_DEEP_BIT PredictorTypes.LIGHTGBM = _medpython.cvar.PredictorTypes_LIGHTGBM PredictorTypes.SPECIFIC_GROUPS_MODELS = _medpython.cvar.PredictorTypes_SPECIFIC_GROUPS_MODELS PredictorTypes.SVM = _medpython.cvar.PredictorTypes_SVM PredictorTypes.LINEAR_SGD = _medpython.cvar.PredictorTypes_LINEAR_SGD PredictorTypes.VW = _medpython.cvar.PredictorTypes_VW PredictorTypes.TQRF = _medpython.cvar.PredictorTypes_TQRF PredictorTypes.BART = _medpython.cvar.PredictorTypes_BART
[docs] class Predictor(object): r"""Proxy of C++ MPPredictor class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr
[docs] def asSerializable(self): r"""asSerializable(Predictor self) -> SerializableObject""" return _medpython.Predictor_asSerializable(self)
def __init__(self, *args): r""" __init__(Predictor self) -> Predictor __init__(Predictor self, string model_type, string params="") -> Predictor """ _medpython.Predictor_swiginit(self, _medpython.new_Predictor(*args))
[docs] def MEDPY_GET_transpose_for_learn(self): r"""MEDPY_GET_transpose_for_learn(Predictor self) -> bool""" return _medpython.Predictor_MEDPY_GET_transpose_for_learn(self)
[docs] def MEDPY_SET_transpose_for_learn(self, new_val): r"""MEDPY_SET_transpose_for_learn(Predictor self, bool new_val)""" return _medpython.Predictor_MEDPY_SET_transpose_for_learn(self, new_val)
[docs] def MEDPY_GET_normalize_for_learn(self): r"""MEDPY_GET_normalize_for_learn(Predictor self) -> bool""" return _medpython.Predictor_MEDPY_GET_normalize_for_learn(self)
[docs] def MEDPY_SET_normalize_for_learn(self, new_val): r"""MEDPY_SET_normalize_for_learn(Predictor self, bool new_val)""" return _medpython.Predictor_MEDPY_SET_normalize_for_learn(self, new_val)
[docs] def MEDPY_GET_normalize_y_for_learn(self): r"""MEDPY_GET_normalize_y_for_learn(Predictor self) -> bool""" return _medpython.Predictor_MEDPY_GET_normalize_y_for_learn(self)
[docs] def MEDPY_SET_normalize_y_for_learn(self, new_val): r"""MEDPY_SET_normalize_y_for_learn(Predictor self, bool new_val)""" return _medpython.Predictor_MEDPY_SET_normalize_y_for_learn(self, new_val)
[docs] def MEDPY_GET_transpose_for_predict(self): r"""MEDPY_GET_transpose_for_predict(Predictor self) -> bool""" return _medpython.Predictor_MEDPY_GET_transpose_for_predict(self)
[docs] def MEDPY_SET_transpose_for_predict(self, new_val): r"""MEDPY_SET_transpose_for_predict(Predictor self, bool new_val)""" return _medpython.Predictor_MEDPY_SET_transpose_for_predict(self, new_val)
[docs] def MEDPY_GET_normalize_for_predict(self): r"""MEDPY_GET_normalize_for_predict(Predictor self) -> bool""" return _medpython.Predictor_MEDPY_GET_normalize_for_predict(self)
[docs] def MEDPY_SET_normalize_for_predict(self, new_val): r"""MEDPY_SET_normalize_for_predict(Predictor self, bool new_val)""" return _medpython.Predictor_MEDPY_SET_normalize_for_predict(self, new_val)
[docs] def MEDPY_GET_model_features(self): r"""MEDPY_GET_model_features(Predictor self) -> StringVector""" return _medpython.Predictor_MEDPY_GET_model_features(self)
[docs] def MEDPY_SET_model_features(self, new_val): r"""MEDPY_SET_model_features(Predictor self, StringVector new_val)""" return _medpython.Predictor_MEDPY_SET_model_features(self, new_val)
[docs] def MEDPY_GET_features_count(self): r"""MEDPY_GET_features_count(Predictor self) -> int""" return _medpython.Predictor_MEDPY_GET_features_count(self)
[docs] def MEDPY_SET_features_count(self, new_val): r"""MEDPY_SET_features_count(Predictor self, int new_val)""" return _medpython.Predictor_MEDPY_SET_features_count(self, new_val)
[docs] @staticmethod def make_predictor(*args): r""" make_predictor(string model_type) -> Predictor make_predictor(string model_type, string params) -> Predictor """ return _medpython.Predictor_make_predictor(*args)
[docs] def learn(self, features): r"""learn(Predictor self, Features features) -> int""" return _medpython.Predictor_learn(self, features)
[docs] def predict(self, features): r"""predict(Predictor self, Features features) -> int""" return _medpython.Predictor_predict(self, features)
[docs] def write_predictor_to_file(self, outFile): r"""write_predictor_to_file(Predictor self, string & outFile)""" return _medpython.Predictor_write_predictor_to_file(self, outFile)
transpose_for_learn = property(MEDPY_GET_transpose_for_learn,MEDPY_SET_transpose_for_learn) normalize_for_learn = property(MEDPY_GET_normalize_for_learn,MEDPY_SET_normalize_for_learn) normalize_y_for_learn = property(MEDPY_GET_normalize_y_for_learn,MEDPY_SET_normalize_y_for_learn) transpose_for_predict = property(MEDPY_GET_transpose_for_predict,MEDPY_SET_transpose_for_predict) normalize_for_predict = property(MEDPY_GET_normalize_for_predict,MEDPY_SET_normalize_for_predict) model_features = property(MEDPY_GET_model_features,MEDPY_SET_model_features) features_count = property(MEDPY_GET_features_count,MEDPY_SET_features_count) __swig_destroy__ = _medpython.delete_Predictor
# Register Predictor in _medpython: _medpython.Predictor_swigregister(Predictor)
[docs] class SampleFilter(object): r"""Proxy of C++ MPSampleFilter class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr
[docs] @staticmethod def from_name(name): r"""from_name(string name) -> SampleFilter""" return _medpython.SampleFilter_from_name(name)
[docs] @staticmethod def from_type(type): r"""from_type(int type) -> SampleFilter""" return _medpython.SampleFilter_from_type(type)
[docs] @staticmethod def from_name_params(name, params): r"""from_name_params(string name, string params) -> SampleFilter""" return _medpython.SampleFilter_from_name_params(name, params)
[docs] @staticmethod def from_type_params(type, params): r"""from_type_params(int type, string params) -> SampleFilter""" return _medpython.SampleFilter_from_type_params(type, params)
__swig_destroy__ = _medpython.delete_SampleFilter
[docs] def filter(self, rep, samples): r""" filter(rep, samples) -> int in-place filtering with repository. returns -1 if fails. """ return _medpython.SampleFilter_filter(self, rep, samples)
[docs] def asSerializable(self): r"""asSerializable(SampleFilter self) -> SerializableObject""" return _medpython.SampleFilter_asSerializable(self)
def __init__(self): r"""__init__(SampleFilter self) -> SampleFilter""" _medpython.SampleFilter_swiginit(self, _medpython.new_SampleFilter())
# Register SampleFilter in _medpython: _medpython.SampleFilter_swigregister(SampleFilter) SampleFilter.SMPL_FILTER_TRN_ = _medpython.cvar.SampleFilter_SMPL_FILTER_TRN_ SampleFilter.SMPL_FILTER_TST_ = _medpython.cvar.SampleFilter_SMPL_FILTER_TST_ SampleFilter.SMPL_FILTER_OUTLIERS_ = _medpython.cvar.SampleFilter_SMPL_FILTER_OUTLIERS_ SampleFilter.SMPL_FILTER_MATCH_ = _medpython.cvar.SampleFilter_SMPL_FILTER_MATCH_ SampleFilter.SMPL_FILTER_REQ_SIGNAL_ = _medpython.cvar.SampleFilter_SMPL_FILTER_REQ_SIGNAL_ SampleFilter.SMPL_FILTER_BASIC_ = _medpython.cvar.SampleFilter_SMPL_FILTER_BASIC_ SampleFilter.SMPL_FILTER_LAST_ = _medpython.cvar.SampleFilter_SMPL_FILTER_LAST_
[docs] class Sample(object): r"""Proxy of C++ MPSample class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr
[docs] def MEDPY_GET_id(self): r"""MEDPY_GET_id(Sample self) -> int""" return _medpython.Sample_MEDPY_GET_id(self)
[docs] def MEDPY_SET_id(self, new_id): r"""MEDPY_SET_id(Sample self, int new_id)""" return _medpython.Sample_MEDPY_SET_id(self, new_id)
[docs] def MEDPY_GET_split(self): r"""MEDPY_GET_split(Sample self) -> int""" return _medpython.Sample_MEDPY_GET_split(self)
[docs] def MEDPY_SET_split(self, new_sp): r"""MEDPY_SET_split(Sample self, int new_sp)""" return _medpython.Sample_MEDPY_SET_split(self, new_sp)
[docs] def MEDPY_GET_time(self): r"""MEDPY_GET_time(Sample self) -> int""" return _medpython.Sample_MEDPY_GET_time(self)
[docs] def MEDPY_SET_time(self, new_time): r"""MEDPY_SET_time(Sample self, int new_time)""" return _medpython.Sample_MEDPY_SET_time(self, new_time)
[docs] def MEDPY_GET_outcome(self): r"""MEDPY_GET_outcome(Sample self) -> int""" return _medpython.Sample_MEDPY_GET_outcome(self)
[docs] def MEDPY_SET_outcome(self, new_outcome): r"""MEDPY_SET_outcome(Sample self, int new_outcome)""" return _medpython.Sample_MEDPY_SET_outcome(self, new_outcome)
[docs] def MEDPY_GET_outcomeTime(self): r"""MEDPY_GET_outcomeTime(Sample self) -> int""" return _medpython.Sample_MEDPY_GET_outcomeTime(self)
[docs] def MEDPY_SET_outcomeTime(self, new_outcome_time): r"""MEDPY_SET_outcomeTime(Sample self, int new_outcome_time)""" return _medpython.Sample_MEDPY_SET_outcomeTime(self, new_outcome_time)
[docs] def MEDPY_GET_prediction(self): r"""MEDPY_GET_prediction(Sample self)""" return _medpython.Sample_MEDPY_GET_prediction(self)
[docs] def MEDPY_SET_prediction(self, in_predbuf): r"""MEDPY_SET_prediction(Sample self, float * in_predbuf)""" return _medpython.Sample_MEDPY_SET_prediction(self, in_predbuf)
def __init__(self): r"""__init__(Sample self) -> Sample""" _medpython.Sample_swiginit(self, _medpython.new_Sample()) __swig_destroy__ = _medpython.delete_Sample
[docs] def print_(self, *args): r""" print_(Sample self, string const prefix) print_(Sample self) """ return _medpython.Sample_print_(self, *args)
[docs] def parse_from_string(self, s, time_unit): r"""parse_from_string(Sample self, string & s, int time_unit) -> int""" return _medpython.Sample_parse_from_string(self, s, time_unit)
[docs] def write_to_string(self, s, time_unit): r"""write_to_string(Sample self, string & s, int time_unit)""" return _medpython.Sample_write_to_string(self, s, time_unit)
def __copy__(self): r"""__copy__(Sample self) -> Sample""" return _medpython.Sample___copy__(self)
[docs] def asSerializable(self): r"""asSerializable(Sample self) -> SerializableObject""" return _medpython.Sample_asSerializable(self)
id = property(MEDPY_GET_id,MEDPY_SET_id) split = property(MEDPY_GET_split,MEDPY_SET_split) time = property(MEDPY_GET_time,MEDPY_SET_time) outcome = property(MEDPY_GET_outcome,MEDPY_SET_outcome) outcomeTime = property(MEDPY_GET_outcomeTime,MEDPY_SET_outcomeTime) prediction = property(MEDPY_GET_prediction,MEDPY_SET_prediction)
# Register Sample in _medpython: _medpython.Sample_swigregister(Sample)
[docs] class SampleVectorAdaptor(object): r"""Proxy of C++ MPSampleVectorAdaptor class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(SampleVectorAdaptor self) -> SampleVectorAdaptor""" _medpython.SampleVectorAdaptor_swiginit(self, _medpython.new_SampleVectorAdaptor()) __swig_destroy__ = _medpython.delete_SampleVectorAdaptor def __len__(self): r"""__len__(SampleVectorAdaptor self) -> int""" return _medpython.SampleVectorAdaptor___len__(self) def __getitem__(self, i): r"""__getitem__(SampleVectorAdaptor self, int i) -> Sample""" return _medpython.SampleVectorAdaptor___getitem__(self, i) def __setitem__(self, i, val): r"""__setitem__(SampleVectorAdaptor self, int i, Sample val)""" return _medpython.SampleVectorAdaptor___setitem__(self, i, val)
[docs] def append(self, val): r"""append(SampleVectorAdaptor self, Sample val)""" return _medpython.SampleVectorAdaptor_append(self, val)
[docs] def append_vec(self, other): r"""append_vec(SampleVectorAdaptor self, SampleVectorAdaptor other)""" return _medpython.SampleVectorAdaptor_append_vec(self, other)
[docs] def override_splits(self, nfolds): r"""override_splits(SampleVectorAdaptor self, int nfolds)""" return _medpython.SampleVectorAdaptor_override_splits(self, nfolds)
[docs] def nSplits(self): r"""nSplits(SampleVectorAdaptor self) -> int""" return _medpython.SampleVectorAdaptor_nSplits(self)
# Register SampleVectorAdaptor in _medpython: _medpython.SampleVectorAdaptor_swigregister(SampleVectorAdaptor)
[docs] class IdSamples(object): r"""Proxy of C++ MPIdSamples class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr
[docs] def MEDPY_GET_id(self): r"""MEDPY_GET_id(IdSamples self) -> int""" return _medpython.IdSamples_MEDPY_GET_id(self)
[docs] def MEDPY_SET_id(self, new_id): r"""MEDPY_SET_id(IdSamples self, int new_id)""" return _medpython.IdSamples_MEDPY_SET_id(self, new_id)
[docs] def MEDPY_GET_split(self): r"""MEDPY_GET_split(IdSamples self) -> int""" return _medpython.IdSamples_MEDPY_GET_split(self)
[docs] def MEDPY_SET_split(self, new_id): r"""MEDPY_SET_split(IdSamples self, int new_id)""" return _medpython.IdSamples_MEDPY_SET_split(self, new_id)
[docs] def MEDPY_GET_samples(self): r"""MEDPY_GET_samples(IdSamples self) -> SampleVectorAdaptor""" return _medpython.IdSamples_MEDPY_GET_samples(self)
def __init__(self, *args): r""" __init__(IdSamples self, int _id) -> IdSamples __init__(IdSamples self) -> IdSamples """ _medpython.IdSamples_swiginit(self, _medpython.new_IdSamples(*args)) __swig_destroy__ = _medpython.delete_IdSamples
[docs] def set_split(self, _split): r"""set_split(IdSamples self, int _split)""" return _medpython.IdSamples_set_split(self, _split)
[docs] def same_as(self, other, mode): r"""same_as(IdSamples self, IdSamples other, int mode) -> bool""" return _medpython.IdSamples_same_as(self, other, mode)
[docs] def asSerializable(self): r"""asSerializable(IdSamples self) -> SerializableObject""" return _medpython.IdSamples_asSerializable(self)
id = property(MEDPY_GET_id,MEDPY_SET_id) split = property(MEDPY_GET_split,MEDPY_SET_split) samples = property(MEDPY_GET_samples,None)
# Register IdSamples in _medpython: _medpython.IdSamples_swigregister(IdSamples) class IdSamplesVectorAdaptor(object): r"""Proxy of C++ MPIdSamplesVectorAdaptor class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self, *args): r""" __init__(IdSamplesVectorAdaptor self) -> IdSamplesVectorAdaptor __init__(IdSamplesVectorAdaptor self, vector< MedIdSamples > * ptr) -> IdSamplesVectorAdaptor """ _medpython.IdSamplesVectorAdaptor_swiginit(self, _medpython.new_IdSamplesVectorAdaptor(*args)) __swig_destroy__ = _medpython.delete_IdSamplesVectorAdaptor def __len__(self): r"""__len__(IdSamplesVectorAdaptor self) -> int""" return _medpython.IdSamplesVectorAdaptor___len__(self) def __getitem__(self, i): r"""__getitem__(IdSamplesVectorAdaptor self, int i) -> IdSamples""" return _medpython.IdSamplesVectorAdaptor___getitem__(self, i) def __setitem__(self, i, val): r"""__setitem__(IdSamplesVectorAdaptor self, int i, IdSamples val)""" return _medpython.IdSamplesVectorAdaptor___setitem__(self, i, val) def append(self, val): r"""append(IdSamplesVectorAdaptor self, IdSamples val)""" return _medpython.IdSamplesVectorAdaptor_append(self, val) # Register IdSamplesVectorAdaptor in _medpython: _medpython.IdSamplesVectorAdaptor_swigregister(IdSamplesVectorAdaptor)
[docs] class Samples(object): r"""Proxy of C++ MPSamples class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr
[docs] def MEDPY_GET_time_unit(self): r"""MEDPY_GET_time_unit(Samples self) -> int""" return _medpython.Samples_MEDPY_GET_time_unit(self)
[docs] def MEDPY_SET_time_unit(self, new_time_unit): r"""MEDPY_SET_time_unit(Samples self, int new_time_unit)""" return _medpython.Samples_MEDPY_SET_time_unit(self, new_time_unit)
[docs] def MEDPY_GET_idSamples(self): r"""MEDPY_GET_idSamples(Samples self) -> IdSamplesVectorAdaptor""" return _medpython.Samples_MEDPY_GET_idSamples(self)
def __init__(self): r"""__init__(Samples self) -> Samples""" _medpython.Samples_swiginit(self, _medpython.new_Samples()) __swig_destroy__ = _medpython.delete_Samples
[docs] def clear(self): r"""clear(Samples self)""" return _medpython.Samples_clear(self)
[docs] def insert_preds(self, featuresData): r"""insert_preds(Samples self, Features featuresData) -> int""" return _medpython.Samples_insert_preds(self, featuresData)
[docs] def get_ids(self): r"""get_ids(Samples self)""" return _medpython.Samples_get_ids(self)
[docs] def append(self, newSamples): r"""append(Samples self, Samples newSamples)""" return _medpython.Samples_append(self, newSamples)
[docs] def subtract(self, _dont_use): r"""subtract(Samples self, Samples _dont_use)""" return _medpython.Samples_subtract(self, _dont_use)
[docs] def split_train_test(self, train, test, p_test): r"""split_train_test(Samples self, Samples train, Samples test, float p_test)""" return _medpython.Samples_split_train_test(self, train, test, p_test)
[docs] def read_from_bin_file(self, file_name): r"""read_from_bin_file(Samples self, string const & file_name) -> int""" return _medpython.Samples_read_from_bin_file(self, file_name)
[docs] def write_to_bin_file(self, file_name): r"""write_to_bin_file(Samples self, string const & file_name) -> int""" return _medpython.Samples_write_to_bin_file(self, file_name)
[docs] def read_from_file(self, file_name): r"""read_from_file(Samples self, string const & file_name) -> int""" return _medpython.Samples_read_from_file(self, file_name)
[docs] def write_to_file(self, fname): r"""write_to_file(Samples self, string const & fname) -> int""" return _medpython.Samples_write_to_file(self, fname)
[docs] def get_preds(self): r"""get_preds(Samples self)""" return _medpython.Samples_get_preds(self)
[docs] def get_y(self): r"""get_y(Samples self)""" return _medpython.Samples_get_y(self)
[docs] def get_categs(self): r"""get_categs(Samples self)""" return _medpython.Samples_get_categs(self)
[docs] def export_to_sample_vec(self): r"""export_to_sample_vec(Samples self) -> SampleVectorAdaptor""" return _medpython.Samples_export_to_sample_vec(self)
[docs] def import_from_sample_vec(self, vec_samples, allow_split_inconsistency=False): r"""import_from_sample_vec(Samples self, SampleVectorAdaptor vec_samples, bool allow_split_inconsistency=False)""" return _medpython.Samples_import_from_sample_vec(self, vec_samples, allow_split_inconsistency)
[docs] def MEDPY__from_df(self, pandas_df): r"""MEDPY__from_df(Samples self, PandasAdaptor pandas_df)""" return _medpython.Samples_MEDPY__from_df(self, pandas_df)
[docs] def MEDPY__from_df_adaptor(self): r"""MEDPY__from_df_adaptor(Samples self) -> PandasAdaptor""" return _medpython.Samples_MEDPY__from_df_adaptor(self)
[docs] def MEDPY__to_df(self): r"""MEDPY__to_df(Samples self) -> PandasAdaptor""" return _medpython.Samples_MEDPY__to_df(self)
[docs] def sort_by_id_date(self): r"""sort_by_id_date(Samples self)""" return _medpython.Samples_sort_by_id_date(self)
[docs] def normalize(self): r"""normalize(Samples self)""" return _medpython.Samples_normalize(self)
[docs] def same_as(self, other, mode): r"""same_as(Samples self, Samples other, int mode) -> bool""" return _medpython.Samples_same_as(self, other, mode)
[docs] def nSamples(self): r"""nSamples(Samples self) -> int""" return _medpython.Samples_nSamples(self)
[docs] def nSplits(self): r""" nSplits() -> int Return number of splits, also check mismatches between idSample and internal MedSamples and set idSamples.split if missing """ return _medpython.Samples_nSplits(self)
[docs] def get_predictions_size(self): r"""get_predictions_size(Samples self) -> int""" return _medpython.Samples_get_predictions_size(self)
[docs] def get_attributes(self): r"""get_attributes(Samples self) -> StringVector""" return _medpython.Samples_get_attributes(self)
[docs] def get_str_attributes(self): r"""get_str_attributes(Samples self) -> StringVector""" return _medpython.Samples_get_str_attributes(self)
[docs] def dilute(self, prob): r"""dilute(Samples self, float prob)""" return _medpython.Samples_dilute(self, prob)
[docs] def insertRec(self, *args): r""" insertRec(Samples self, int pid, int time, float outcome, int outcomeTime) insertRec(Samples self, int pid, int time, float outcome, int outcomeTime, float pred) insertRec(Samples self, int pid, int time) """ return _medpython.Samples_insertRec(self, *args)
[docs] def version(self): r"""version(Samples self) -> int""" return _medpython.Samples_version(self)
[docs] def asSerializable(self): r"""asSerializable(Samples self) -> SerializableObject""" return _medpython.Samples_asSerializable(self)
[docs] def override_splits(self, nfolds): r"""override_splits(Samples self, int nfolds)""" return _medpython.Samples_override_splits(self, nfolds)
[docs] def set_samples(self, patients, _time=-1): r"""set_samples(Samples self, int * patients, int _time=-1)""" return _medpython.Samples_set_samples(self, patients, _time)
time_unit = property(MEDPY_GET_time_unit,MEDPY_SET_time_unit) idSamples = property(MEDPY_GET_idSamples,None)
# Register Samples in _medpython: _medpython.Samples_swigregister(Samples) class SerializableObject(object): r"""Proxy of C++ MPSerializableObject class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(SerializableObject self) -> SerializableObject""" _medpython.SerializableObject_swiginit(self, _medpython.new_SerializableObject()) __swig_destroy__ = _medpython.delete_SerializableObject def version(self): r"""version(SerializableObject self) -> int""" return _medpython.SerializableObject_version(self) def my_class_name(self): r"""my_class_name(SerializableObject self) -> string""" return _medpython.SerializableObject_my_class_name(self) def get_size(self): r""" get_size() -> int Gets bytes sizes for serializations """ return _medpython.SerializableObject_get_size(self) def read_from_file(self, fname): r""" read_from_file(fname) -> int read and deserialize object """ return _medpython.SerializableObject_read_from_file(self, fname) def write_to_file(self, fname): r""" write_to_file(fname) -> int serialize object and write to file """ return _medpython.SerializableObject_write_to_file(self, fname) def read_from_file_unsafe(self, fname): r""" read_from_file_unsafe(fname) -> int read and deserialize model without checking version number - unsafe read """ return _medpython.SerializableObject_read_from_file_unsafe(self, fname) # Register SerializableObject in _medpython: _medpython.SerializableObject_swigregister(SerializableObject) class SigExporter(object): r"""Proxy of C++ MPSigExporter class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def keys(self): r"""keys(SigExporter self) -> StringVector""" return _medpython.SigExporter_keys(self) sig_name = property(_medpython.SigExporter_sig_name_get, _medpython.SigExporter_sig_name_set, doc=r"""sig_name : std::string""") sig_id = property(_medpython.SigExporter_sig_id_get, _medpython.SigExporter_sig_id_set, doc=r"""sig_id : int""") sig_type = property(_medpython.SigExporter_sig_type_get, _medpython.SigExporter_sig_type_set, doc=r"""sig_type : int""") record_count = property(_medpython.SigExporter_record_count_get, _medpython.SigExporter_record_count_set, doc=r"""record_count : size_t""") record_count_updated = property(_medpython.SigExporter_record_count_updated_get, _medpython.SigExporter_record_count_updated_set, doc=r"""record_count_updated : bool""") def __init__(self, rep, signame_str, pids_to_take, use_all_pids, translate_flag, free_sig_flag, filter_regex_str): r"""__init__(SigExporter self, PidRepository rep, std::string signame_str, int * pids_to_take, int use_all_pids, int translate_flag, int free_sig_flag, std::string filter_regex_str) -> SigExporter""" _medpython.SigExporter_swiginit(self, _medpython.new_SigExporter(rep, signame_str, pids_to_take, use_all_pids, translate_flag, free_sig_flag, filter_regex_str)) def update_record_count(self): r"""update_record_count(SigExporter self)""" return _medpython.SigExporter_update_record_count(self) def get_all_data(self): r"""get_all_data(SigExporter self)""" return _medpython.SigExporter_get_all_data(self) def clear(self): r"""clear(SigExporter self)""" return _medpython.SigExporter_clear(self) def transfer_column(self, key): r"""transfer_column(SigExporter self, std::string const & key)""" return _medpython.SigExporter_transfer_column(self, key) def __getitem__(self, key): r"""__getitem__(SigExporter self, std::string const & key)""" return _medpython.SigExporter___getitem__(self, key) def __iter__(self): r"""__iter__(SigExporter self) -> MPSigExporter_iter""" return _medpython.SigExporter___iter__(self) def get_categorical_field_dict(self, field): r"""get_categorical_field_dict(SigExporter self, std::string const & field) -> StringVector""" return _medpython.SigExporter_get_categorical_field_dict(self, field) def get_categorical_field_dict_int(self, field): r"""get_categorical_field_dict_int(SigExporter self, std::string const & field) -> IntVector""" return _medpython.SigExporter_get_categorical_field_dict_int(self, field) def get_categorical_fields(self): r"""get_categorical_fields(SigExporter self) -> StringVector""" return _medpython.SigExporter_get_categorical_fields(self) __swig_destroy__ = _medpython.delete_SigExporter # Register SigExporter in _medpython: _medpython.SigExporter_swigregister(SigExporter) class MPSigExporter_iter(object): r"""Proxy of C++ MPSigExporter_iter class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args): r""" __init__(MPSigExporter_iter self, SigExporter o, StringVector keys_param) -> MPSigExporter_iter __init__(MPSigExporter_iter self, MPSigExporter_iter orig) -> MPSigExporter_iter """ _medpython.MPSigExporter_iter_swiginit(self, _medpython.new_MPSigExporter_iter(*args)) def next(self): r"""next(MPSigExporter_iter self) -> std::string""" return _medpython.MPSigExporter_iter_next(self) def __repr__(self): r"""__repr__(MPSigExporter_iter self) -> std::string""" return _medpython.MPSigExporter_iter___repr__(self) __swig_destroy__ = _medpython.delete_MPSigExporter_iter # Register MPSigExporter_iter in _medpython: _medpython.MPSigExporter_iter_swigregister(MPSigExporter_iter)
[docs] class Split(object): r"""Proxy of C++ MPSplit class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(Split self) -> Split""" _medpython.Split_swiginit(self, _medpython.new_Split()) __swig_destroy__ = _medpython.delete_Split
[docs] def MEDPY_GET_nsplits(self): r"""MEDPY_GET_nsplits(Split self) -> int""" return _medpython.Split_MEDPY_GET_nsplits(self)
[docs] def MEDPY_GET_pid2split(self): r"""MEDPY_GET_pid2split(Split self) -> IntIntMapAdaptor""" return _medpython.Split_MEDPY_GET_pid2split(self)
[docs] def clear(self): r"""clear(Split self)""" return _medpython.Split_clear(self)
[docs] def read_from_file(self, fname): r"""read_from_file(Split self, string const & fname) -> int""" return _medpython.Split_read_from_file(self, fname)
[docs] def write_to_file(self, fname): r"""write_to_file(Split self, string const & fname) -> int""" return _medpython.Split_write_to_file(self, fname)
nsplits = property(MEDPY_GET_nsplits,None) pid2split = property(MEDPY_GET_pid2split,None)
# Register Split in _medpython: _medpython.Split_swigregister(Split)
[docs] class Time(object): r"""Proxy of C++ MPTime class.""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr def __init__(self): r"""__init__(Time self) -> Time""" _medpython.Time_swiginit(self, _medpython.new_Time()) __swig_destroy__ = _medpython.delete_Time
# Register Time in _medpython: _medpython.Time_swigregister(Time) Time.Undefined = _medpython.cvar.Time_Undefined Time.Date = _medpython.cvar.Time_Date Time.Years = _medpython.cvar.Time_Years Time.Months = _medpython.cvar.Time_Months Time.Days = _medpython.cvar.Time_Days Time.Hours = _medpython.cvar.Time_Hours Time.Minutes = _medpython.cvar.Time_Minutes Time.DateTimeString = _medpython.cvar.Time_DateTimeString def get_public_objects(): r"""get_public_objects() -> StringVector""" return _medpython.get_public_objects() __all__ = list(_medpython.get_public_objects()) """ Enable stderr capturing under ipynb """ class _stderr_fix: STDERR_FD = 2 prevfd = None tmp = None reader = None is_in_ipynb = None def in_ipynb(self): try: if str(type(get_ipython())) == "<class 'ipykernel.zmqshell.ZMQInteractiveShell'>": return True else: return False except NameError: return False def __init__(self): from os import dup,dup2 from tempfile import NamedTemporaryFile self.is_in_ipynb = self.in_ipynb() if self.is_in_ipynb: self.tmp = NamedTemporaryFile() self.prevfd = dup(self.STDERR_FD) dup2(self.tmp.fileno(), self.STDERR_FD) self.reader = open(self.tmp.name) def __del__(self): if self.is_in_ipynb: from os import dup2 dup2(self.prevfd, self.STDERR_FD) def get_cerr(self): if self.is_in_ipynb: return self.reader.read() return '' _stderr_fix_instance = _stderr_fix() def cerr(): return _stderr_fix_instance.get_cerr() """ Enable iterators on vector and map adaptor objects """ class MapAdaptorKeyIter: def __init__(self,o): self.obj = o.keys() self.i = 0 self.prev_i = None self.max_i = len(self.obj) def __next__(self): if self.i >= self.max_i: raise StopIteration else: self.prev_i, self.i = self.i, self.i+1 return self.obj[self.prev_i] def next(self): return self.__next__() class IntIndexIter: def __init__(self,o): self.obj = o self.i = 0 self.prev_i = None self.max_i = len(o) def __next__(self): if self.i >= self.max_i: raise StopIteration else: self.prev_i, self.i = self.i, self.i+1 return self.obj[self.prev_i] def next(self): return self.__next__() def __to_df_imp(self): import pandas as pd return pd.DataFrame.from_dict(dict(self.MEDPY__to_df())) def __from_df_imp(self, df): import re adaptor = self.MEDPY__from_df_adaptor() type_requirements = dict(adaptor.type_requirements) for col_name in df.columns: for col_req_name in type_requirements: if re.match('^'+col_req_name+'$',col_name): if str(df[col_name].dtype) != type_requirements[col_req_name]: df[col_name] = df[col_name].astype(type_requirements[col_req_name],copy=False) adaptor.import_column(col_name ,df[col_name].values) self.MEDPY__from_df(adaptor) def ___fix_vecmap_iter(): from inspect import isclass glob = globals() for i in glob: o = glob[i] try: if (isclass(o) and '__len__' in dir(o) and '__getitem__' in dir(o) and not '__iter__' in dir(o) and i.endswith('VectorAdaptor')) : setattr(o, '__iter__', lambda x: IntIndexIter(x)) elif (isclass(o) and '__getitem__' in dir(o) and 'keys' in dir(o) and not '__iter__' in dir(o) and i.endswith('MapAdaptor')) : setattr(o, '__iter__', lambda x: MapAdaptorKeyIter(x)) if (isclass(o) and 'MEDPY__from_df' in dir(o) and 'MEDPY__from_df_adaptor' in dir(o)): setattr(o, 'from_df', __from_df_imp) if (isclass(o) and 'MEDPY__to_df' in dir(o)): setattr(o, 'to_df', __to_df_imp) except: pass ___fix_vecmap_iter() """ External Methods in addition to api """ def __export_to_pandas(self, sig_name_str:str, translate:bool=True, pids:list[int]|str|None=None, float32to64:bool=True, free_signal:bool=True, regex_str:str|None = None, regex_filter:str = '') -> 'pd.DataFrame': """get_sig(signame [, translate=True][, pids=None, float32to64=True][,regex_str = None]) -> Pandas DataFrame translate : If True, will decode categorical fields into a readable representation in Pandas pid : If list is provided, will load only pids from the given list If 'All' is provided, will use all available pids float32to64 : If True, will convert all float32 columns to float64 free_signal : If True, will free signal memory as soon as it is loaded into export arrays regex_str : string (if string, defualt column is 'val') or dictionary between column name (e.g, 'val') to regex string to filter regex_filter : string to filter categories paretns this match regex """ import pandas as pd import numpy as np use_all_pids = 0 if isinstance(pids, str) and pids.upper()=='ALL': use_all_pids = 1 pids=list() if pids is None: pids=list() df = self.export_to_numpy(sig_name_str, pids, use_all_pids, int(translate), int(free_signal), regex_filter) cat_dict = dict() cat_dict_int = dict() if translate: for fld in df.get_categorical_fields(): cat_dict[fld] = df.get_categorical_field_dict(fld) cat_dict_int[fld] = df.get_categorical_field_dict_int(fld) df = dict(df) df = pd.DataFrame.from_dict(df) if not (regex_str is None): dict_id = self.dict_section_id(sig_name_str) if (dict_id == 0): print("Invalid sig name - skip filter") else: if not(type(regex_str) == dict): regex_str = {'val' : regex_str} for fld in regex_str: lut = self.get_lut_from_regex(dict_id, regex_str[fld]) lut_np = np.array(lut) if translate: lut_np = lut_np[np.array(cat_dict_int[fld])] tt = df[fld].astype(int).values df = df[lut_np[tt - 1]].reset_index(drop=True) # values start from 1 if float32to64: for column_name in df: if df[column_name].dtype == np.float32: df[column_name] = df[column_name].astype(np.float64) if not translate: return df for fld in cat_dict: df[fld] = pd.Categorical.from_codes(codes=df[fld],categories=cat_dict[fld]) return df def __features__to_df_imp(self): import pandas as pd featMatFull = Mat() self.get_as_matrix(featMatFull) featMatFullNew = featMatFull.get_numpy_view_unsafe() col_names = self.get_feature_names() dfFeatures2 = pd.DataFrame(data = featMatFullNew, columns = col_names ) samps = Samples() self.get_samples(samps) samps_df = samps.to_df() out = pd.concat([samps_df,dfFeatures2], axis=1, copy=False) return out def __features__from_df_imp(self, features_df): # Dataframe to MedFeatures: mat = Mat() samples = Samples() ind_sampes = features_df.columns.str.contains('pred_\\d+') | features_df.columns.isin(['id', 'split', 'time', 'outcome', 'outcomeTime']) featuresNames = features_df.columns[~(ind_sampes)] # Build data matrix mat.set_signals(StringVector(list(featuresNames))) mat.load_numpy(features_df.loc[:,features_df.columns[~(ind_sampes)]].values) self.set_as_matrix(mat) # append Samples samples.from_df(features_df.loc[:,features_df.columns[ind_sampes]]) self.append_samples(samples) def __bootstrapResult_to_df(self): import pandas as pd dict_obj={'Cohort' : [], 'Measurement': [], 'Value': []} for cohort in self.keys(): cohort_res=self[cohort] for measure in cohort_res.keys(): dict_obj['Cohort'].append(cohort) dict_obj['Measurement'].append(measure) dict_obj['Value'].append(cohort_res[measure]) df=pd.DataFrame(dict_obj) return df def convert_to_bootstrap_input(x, arg_name=None): import pandas as pd import numpy as np if type(x) is list: x=np.array(x) if type(x) is np.ndarray: x=x.astype(float) if type(x) is pd.Series: x=x.astype(float).to_numpy() if np.isnan(x).sum()>0: if arg_name is None: raise NameError('Error - input array has nan inside') else: raise NameError('Error - input array %s has nan inside'%(arg_name)) return x def __bootstrap_wrapper(self, preds, labels): import pandas as pd import numpy as np preds=convert_to_bootstrap_input(preds, 'preds') labels=convert_to_bootstrap_input(labels, 'labels') res = self._bootstrap(preds, labels) return res def __bootstrap_pid_wrapper(self, pids, preds, labels): import pandas as pd import numpy as np pids=convert_to_bootstrap_input(pids, 'pids') preds=convert_to_bootstrap_input(preds, 'preds') labels=convert_to_bootstrap_input(labels, 'labels') res = self._bootstrap_pid(pids, preds, labels) return res def __btsimple_to_df(self): import pandas as pd dict_obj={'Measurement': [], 'Value': []} for measure in self.keys(): dict_obj['Measurement'].append(measure) dict_obj['Value'].append(self[measure]) df=pd.DataFrame(dict_obj) return df def __bind_external_methods(): setattr(globals()['PidRepository'],'get_sig', __export_to_pandas) setattr(globals()['Features'],'to_df', __features__to_df_imp) setattr(globals()['Features'],'from_df', __features__from_df_imp) setattr(globals()['StringBtResultMap'],'to_df', __bootstrapResult_to_df) setattr(globals()['StringFloatMapAdaptor'],'to_df', __btsimple_to_df) setattr(globals()['Bootstrap'],'bootstrap', __bootstrap_wrapper) setattr(globals()['Bootstrap'],'bootstrap_pid', __bootstrap_pid_wrapper) __bind_external_methods() """ Remove SWIG's global variable access which makes issues for reflection actions #if 'cvar' in __dict__: del cvar """ try: del cvar except: pass Global = GlobalClass()