medpython 1.2.0__cp314-cp314-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of medpython might be problematic. Click here for more details.

med/medpython.py ADDED
@@ -0,0 +1,3995 @@
1
+ # This file was automatically generated by SWIG (https://www.swig.org).
2
+ # Version 4.4.1
3
+ #
4
+ # Do not make changes to this file unless you know what you are doing - modify
5
+ # the SWIG interface file instead.
6
+
7
+ """
8
+
9
+ class Dictionary
10
+ Methods:
11
+ __init__(PidRepository rep) -> Dictionary
12
+ get_members_to_all_sets(int section_id, int * members_array) -> IntVecIntMapAdaptor
13
+ id(string & signame) -> int
14
+ name(int id) -> string
15
+ prep_sets_lookup_table(int section_id, StringVector set_names)
16
+ section_id(string name) -> int
17
+
18
+
19
+ class FeatureAttr
20
+ Methods:
21
+ imputed -> bool (property getter)
22
+ normalized -> bool (property getter)
23
+ imputed <- bool (property setter)
24
+ normalized <- bool (property setter)
25
+ __init__() -> FeatureAttr
26
+
27
+ Data descriptors:
28
+ imputed -> bool (property getter)
29
+ normalized -> bool (property getter)
30
+
31
+
32
+ class Features
33
+ Methods:
34
+ attributes -> StringFeatureAttrMapAdaptor (property getter)
35
+ data -> StringVecFloatMapAdaptor (property getter)
36
+ pid_pos_len -> IntPairIntIntMapAdaptor (property getter)
37
+ samples -> SampleVectorAdaptor (property getter)
38
+ tags -> StringUOSetStringMapAdaptor (property getter)
39
+ time_unit -> int (property getter)
40
+ weights (property getter)
41
+ time_unit <- int (property setter)
42
+ __init__() -> Features
43
+ __init__(int _time_unit) -> Features
44
+ __init__(Features other) -> Features
45
+ append_samples(IdSamples in_samples)
46
+ append_samples(Samples in_samples)
47
+ clear()
48
+ filter(StringVector selectedFeatures) -> int
49
+ get_as_matrix(Mat mat)
50
+ get_as_matrix(Mat mat, vector< string > names)
51
+ get_as_matrix(Mat mat, vector< string > const names, int * int_in_buf)
52
+ get_crc() -> unsigned int
53
+ get_feature_names() -> StringVector
54
+ get_max_serial_id_cnt() -> int
55
+ get_pid_len(int pid) -> int
56
+ get_pid_pos(int pid) -> int
57
+ get_samples(Samples outSamples)
58
+ init_all_samples(IdSamplesVectorAdaptor in_samples)
59
+ init_pid_pos_len()
60
+ insert_samples(IdSamples in_samples, int index)
61
+ print_csv()
62
+ read_from_csv_mat(string const & csv_fname) -> int
63
+ set_as_matrix(Mat mat)
64
+ set_time_unit(int _time_unit)
65
+ version() -> int
66
+ write_as_csv_mat(string const & csv_fname) -> int
67
+
68
+ Static methods:
69
+ global_serial_id_cnt (property getter)
70
+ global_serial_id_cnt -> int (property getter)
71
+ MEDPY_SET_global_serial_id_cnt(*args)
72
+ MEDPY_SET_global_serial_id_cnt(int newval)
73
+
74
+ Data descriptors:
75
+ attributes -> StringFeatureAttrMapAdaptor (property getter)
76
+ data -> StringVecFloatMapAdaptor (property getter)
77
+ global_serial_id_cnt
78
+ pid_pos_len -> IntPairIntIntMapAdaptor (property getter)
79
+ samples -> SampleVectorAdaptor (property getter)
80
+ tags -> StringUOSetStringMapAdaptor (property getter)
81
+ time_unit -> int (property getter)
82
+ weights (property getter)
83
+
84
+
85
+ class IdSamples
86
+ Methods:
87
+ id -> int (property getter)
88
+ samples -> SampleVectorAdaptor (property getter)
89
+ split -> int (property getter)
90
+ id <- int (property setter)
91
+ split <- int (property setter)
92
+ __init__(int _id) -> IdSamples
93
+ __init__() -> IdSamples
94
+ same_as(IdSamples other, int mode) -> bool
95
+ set_split(int _split)
96
+
97
+ Data descriptors:
98
+ id -> int (property getter)
99
+ samples -> SampleVectorAdaptor (property getter)
100
+ split -> int (property getter)
101
+
102
+
103
+ class Mat
104
+ Methods:
105
+ avg (property getter)
106
+ missing_value -> float (property getter)
107
+ ncols -> int (property getter)
108
+ normalized_flag -> int (property getter)
109
+ nrows -> int (property getter)
110
+ row_ids (property getter)
111
+ signals -> StringVector (property getter)
112
+ std (property getter)
113
+ transposed_flag -> int (property getter)
114
+ missing_value <- float (property setter)
115
+ normalized_flag <- int (property setter)
116
+ row_ids <- int (property setter)
117
+ transposed_flag <- int (property setter)
118
+ __getitem__(IntVector index) -> float
119
+ __init__() -> Mat
120
+ __init__(int n_rows, int n_cols) -> Mat
121
+ __init__(float * IN_ARRAY2) -> Mat
122
+ __len__() -> unsigned long long
123
+ __setitem__(IntVector index, float val)
124
+ add_cols(Mat m_add)
125
+ add_cols(float * m_add)
126
+ add_rows(Mat m_add)
127
+ add_rows(float * m_add)
128
+ clear()
129
+ get_col(int i_col)
130
+ get_cols_avg_std()
131
+ get_numpy_copy()
132
+ get_numpy_view_unsafe()
133
+ get_row(int i_row)
134
+ get_sub_mat(vector< int > & rows_to_take, vector< int > & cols_to_take)
135
+ get_sub_mat_by_flags(vector< int > & rows_to_take_flag, vector< int > & cols_to_take_flag)
136
+ is_valid(bool output=False) -> bool
137
+ is_valid() -> bool
138
+ load(float * IN_ARRAY2)
139
+ load(Mat x)
140
+ load_numpy(float * IN_ARRAY2)
141
+ load_transposed(float * IN_ARRAY2)
142
+ normalize(int norm_type, float * wgts)
143
+ normalize(int norm_type=Normalize_Cols)
144
+ normalize()
145
+ normalize(float * external_avg, float * external_std, int norm_type=1)
146
+ normalize(float * external_avg, float * external_std)
147
+ read_from_bin_file(string const & fname) -> int
148
+ read_from_csv_file(string const & fname, int titles_line_flag) -> int
149
+ resize(int n_rows, int n_cols)
150
+ set_signals(StringVector sigs)
151
+ set_val(float val)
152
+ test(int n_rows, int n_cols)
153
+ transpose()
154
+ write_to_bin_file(string const & fname) -> int
155
+ write_to_csv_file(string const & fname) -> int
156
+ zero()
157
+
158
+ Static methods:
159
+ Normalize_Cols (property getter)
160
+ Normalize_Cols -> int (property getter)
161
+ Normalize_Rows (property getter)
162
+ Normalize_Rows -> int (property getter)
163
+
164
+ Data descriptors:
165
+ Normalize_Cols
166
+ Normalize_Rows
167
+ avg (property getter)
168
+ missing_value -> float (property getter)
169
+ ncols -> int (property getter)
170
+ normalized_flag -> int (property getter)
171
+ nrows -> int (property getter)
172
+ row_ids (property getter)
173
+ signals -> StringVector (property getter)
174
+ std (property getter)
175
+ transposed_flag -> int (property getter)
176
+
177
+
178
+ class Model
179
+ Methods:
180
+ features -> Features (property getter)
181
+ verbosity -> int (property getter)
182
+ verbosity <- int (property setter)
183
+ __init__() -> Model
184
+ add_age()
185
+ add_feature_generator(string & name, string & signal)
186
+ add_feature_generator_to_set(int i_set, string const & init_string)
187
+ add_feature_generators(string & name, vector< string > & signals)
188
+ add_feature_generators(string & name, vector< string > & signals, string init_string)
189
+ add_feature_generators(string & name, string & signal, string init_string)
190
+ add_feature_processor_to_set(int i_set, int duplicate, string const & init_string)
191
+ add_gender()
192
+ add_imputers()
193
+ add_imputers(string init_string)
194
+ add_imputers(vector< string > & features)
195
+ add_imputers(vector< string > & features, string init_string)
196
+ add_normalizers()
197
+ add_normalizers(string init_string)
198
+ add_normalizers(vector< string > & features)
199
+ add_normalizers(vector< string > & features, string init_string)
200
+ add_process_to_set(int i_set, int duplicate, string const & init_string)
201
+ add_process_to_set(int i_set, string const & init_string)
202
+ add_rep_processor_to_set(int i_set, string const & init_string)
203
+ apply(PidRepository rep, Samples samples) -> int
204
+ apply(PidRepository rep, Samples samples, int start_stage, int end_stage) -> int
205
+ apply_feature_processors(Features features) -> int
206
+ clear()
207
+ collect_and_add_virtual_signals(PidRepository rep) -> int
208
+ dprint_process(string const & pref, int rp_flag, int fg_flag, int fp_flag)
209
+ filter_rep_processors()
210
+ generate_all_features(PidRepository rep, Samples samples, Features features, StringVector req_feature_generators) -> int
211
+ get_all_features_names(vector< string > & feat_names, int before_process_set)
212
+ get_required_signal_names() -> StringVector
213
+ init_from_json_file(std::string const & fname)
214
+ init_from_json_file_with_alterations(std::string const & fname, StringVector json_alt) -> StringVector
215
+ learn(PidRepository rep, Samples samples) -> int
216
+ learn(PidRepository rep, Samples samples, int start_stage, int end_stage) -> int
217
+ learn_and_apply_feature_processors(Features features) -> int
218
+ learn_feature_generators(PidRepository rep, Samples learn_samples) -> int
219
+ learn_feature_processors(Features features) -> int
220
+ learn_rep_processors(PidRepository rep, Samples samples) -> int
221
+ quick_learn_rep_processors(PidRepository rep, Samples samples) -> int
222
+ read_from_file(string const & fname) -> int
223
+ set_predictor(string name)
224
+ set_predictor(string name, string init_string)
225
+ write_feature_matrix(string const mat_fname) -> int
226
+ write_to_file(std::string const & fname) -> int
227
+
228
+ Data descriptors:
229
+ features -> Features (property getter)
230
+ verbosity -> int (property getter)
231
+
232
+
233
+ class ModelStage
234
+ Methods:
235
+ __init__() -> ModelStage
236
+ Data and other attributes:
237
+ APPLY_FTR_GENERATORS = 2
238
+ APPLY_FTR_PROCESSORS = 4
239
+ APPLY_PREDICTOR = 6
240
+ END = 8
241
+ INSERT_PREDS = 7
242
+ LEARN_FTR_GENERATORS = 1
243
+ LEARN_FTR_PROCESSORS = 3
244
+ LEARN_PREDICTOR = 5
245
+ LEARN_REP_PROCESSORS = 0
246
+
247
+
248
+
249
+ class PidRepository
250
+ Methods:
251
+ pids -> IntVector (property getter)
252
+ __init__() -> PidRepository
253
+ dict_name(int_section_id, int_id) -> string
254
+ returns name of section + id
255
+ dict_prep_sets_lookup_table(int_section_id, list_String set_names) -> BoolVector
256
+ returns a look-up-table for given set names
257
+ dict_section_id(str_secName) -> int
258
+ returns section id number for a given section name
259
+ export_to_numpy(str_signame) -> SigExporter
260
+ Returns the signal data represented as a list of numpy arrays, one for each field
261
+ get_sig = __export_to_pandas(self, sig_name_str, translate=True, pids=None)
262
+ get_sig(signame [, translate=True][, pids=None]) -> Pandas DataFrame
263
+ translate : If True, will decode categorical fields into a readable representation in Pandas
264
+ pid : If list is provided, will load only pids from the given list
265
+ If 'All' is provided, will use all available pids
266
+ init(conf_file_name) -> int
267
+ returns -1 if fails
268
+ loadsig(str_signame) -> int
269
+ load a signal
270
+ read_all(conf_file_fname, [pids_to_take_array], [list_str_signals_to_take]) -> int
271
+ returns -1 if fails
272
+ reading a repository for a group of pids and signals.Empty group means all of it.
273
+ read_all(conf_file_fname, [pids_to_take_array], [list_str_signals_to_take]) -> int
274
+ returns -1 if fails
275
+ reading a repository for a group of pids and signals.Empty group means all of it.
276
+ read_all_i(std::string const & conf_fname, IntVector pids_to_take, IntVector signals_to_take) -> int
277
+ sig_id(str_signame) -> int
278
+ returns signal id number for a given signal name
279
+ sig_type(str_signame) -> int
280
+ returns signal type id for a given signal name
281
+ uget(int_pid, int_sid) -> SigVectorAdaptor
282
+ returns a vector of universal signals
283
+
284
+ Data descriptors:
285
+ dict
286
+ PidRepository_dict_get() -> Dictionary
287
+ pids -> IntVector (property getter)
288
+
289
+
290
+ class Sample
291
+ Methods:
292
+ id -> int (property getter)
293
+ outcome -> int (property getter)
294
+ outcomeTime -> int (property getter)
295
+ prediction (property getter)
296
+ split -> int (property getter)
297
+ time -> int (property getter)
298
+ id <- int (property setter)
299
+ outcome <- int (property setter)
300
+ outcomeTime <- int (property setter)
301
+ prediction <- float (property setter)
302
+ split <- int (property setter)
303
+ time <- int (property setter)
304
+ __copy__() -> Sample
305
+ __init__() -> Sample
306
+ parse_from_string(string & s, int time_unit) -> int
307
+ print_(string const prefix)
308
+ print_()
309
+ write_to_string(string & s, int time_unit)
310
+
311
+ Data descriptors:
312
+ id -> int (property getter)
313
+ outcome -> int (property getter)
314
+ outcomeTime -> int (property getter)
315
+ prediction (property getter)
316
+ split -> int (property getter)
317
+ time -> int (property getter)
318
+
319
+
320
+ class Samples
321
+ Methods:
322
+ idSamples -> IdSamplesVectorAdaptor (property getter)
323
+ time_unit -> int (property getter)
324
+ time_unit <- int (property setter)
325
+ from_df(PandasAdaptor pandas_df)
326
+ to_df() -> PandasAdaptor
327
+ __init__() -> Samples
328
+ append(Samples newSamples)
329
+ as_df = __sample_export_to_pandas(self)
330
+ clear()
331
+ dilute(float prob)
332
+ export_to_pandas_df() -> SampleVecExporter
333
+ export_to_sample_vec() -> SampleVectorAdaptor
334
+ get_attributes() -> StringVector
335
+ get_categs()
336
+ get_ids()
337
+ get_predictions_size() -> int
338
+ get_preds()
339
+ get_str_attributes() -> StringVector
340
+ get_y()
341
+ insertRec(int pid, int time, float outcome, int outcomeTime)
342
+ insertRec(int pid, int time, float outcome, int outcomeTime, float pred)
343
+ insertRec(int pid, int time)
344
+ insert_preds(Features featuresData) -> int
345
+ nSamples() -> int
346
+ normalize()
347
+ read_from_bin_file(string const & file_name) -> int
348
+ read_from_file(string const & file_name) -> int
349
+ same_as(Samples other, int mode) -> bool
350
+ sort_by_id_date()
351
+ version() -> int
352
+ write_to_bin_file(string const & file_name) -> int
353
+ write_to_file(string const & fname) -> int
354
+
355
+ Data descriptors:
356
+ idSamples -> IdSamplesVectorAdaptor (property getter)
357
+ time_unit -> int (property getter)
358
+
359
+
360
+ class Sig
361
+ Methods:
362
+ __init__(Sig other) -> Sig
363
+ date(int chan=0) -> int
364
+ date() -> int
365
+ days(int chan=0) -> int
366
+ days() -> int
367
+ hours(int chan=0) -> int
368
+ hours() -> int
369
+ minutes(int chan=0) -> int
370
+ minutes() -> int
371
+ months(int chan=0) -> int
372
+ months() -> int
373
+ time(int chan=0) -> int
374
+ time() -> int
375
+ timeU(int to_time_unit) -> int
376
+ val(int chan=0) -> float
377
+ val() -> float
378
+ years(int chan=0) -> int
379
+ years() -> int
380
+
381
+
382
+ class Split
383
+ Methods:
384
+ nsplits -> int (property getter)
385
+ pid2split -> IntIntMapAdaptor (property getter)
386
+ __init__() -> Split
387
+ clear()
388
+ read_from_file(string const & fname) -> int
389
+ write_to_file(string const & fname) -> int
390
+
391
+ Data descriptors:
392
+ nsplits -> int (property getter)
393
+ pid2split -> IntIntMapAdaptor (property getter)
394
+
395
+
396
+ class Time
397
+ Methods:
398
+ __init__() -> Time
399
+ Data and other attributes:
400
+ Date = 1
401
+ DateTimeString = 7
402
+ Days = 4
403
+ Hours = 5
404
+ Minutes = 6
405
+ Months = 3
406
+ Undefined = 0
407
+ Years = 2
408
+
409
+
410
+ """
411
+
412
+ from sys import version_info as _swig_python_version_info
413
+ # Import the low-level C/C++ module
414
+ if getattr(globals().get("__spec__"), "parent", None) or __package__ or "." in __name__:
415
+ from . import _medpython
416
+ else:
417
+ import _medpython
418
+
419
+ try:
420
+ import builtins as __builtin__
421
+ except ImportError:
422
+ import __builtin__
423
+
424
+ def _swig_repr(self):
425
+ try:
426
+ strthis = "proxy of " + self.this.__repr__()
427
+ except __builtin__.Exception:
428
+ strthis = ""
429
+ return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
430
+
431
+
432
+ def _swig_setattr_nondynamic_instance_variable(set):
433
+ def set_instance_attr(self, name, value):
434
+ if name == "this":
435
+ set(self, name, value)
436
+ elif name == "thisown":
437
+ self.this.own(value)
438
+ elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
439
+ set(self, name, value)
440
+ else:
441
+ raise AttributeError("You cannot add instance attributes to %s" % self)
442
+ return set_instance_attr
443
+
444
+
445
+ def _swig_setattr_nondynamic_class_variable(set):
446
+ def set_class_attr(cls, name, value):
447
+ if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
448
+ set(cls, name, value)
449
+ else:
450
+ raise AttributeError("You cannot add class attributes to %s" % cls)
451
+ return set_class_attr
452
+
453
+
454
+ def _swig_add_metaclass(metaclass):
455
+ """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
456
+ def wrapper(cls):
457
+ return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
458
+ return wrapper
459
+
460
+
461
+ class _SwigNonDynamicMeta(type):
462
+ """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
463
+ __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
464
+
465
+
466
+ class SwigPyIterator(object):
467
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
468
+
469
+ def __init__(self, *args, **kwargs):
470
+ raise AttributeError("No constructor defined - class is abstract")
471
+ __repr__ = _swig_repr
472
+ __swig_destroy__ = _medpython.delete_SwigPyIterator
473
+
474
+ def value(self):
475
+ return _medpython.SwigPyIterator_value(self)
476
+
477
+ def incr(self, n=1):
478
+ return _medpython.SwigPyIterator_incr(self, n)
479
+
480
+ def decr(self, n=1):
481
+ return _medpython.SwigPyIterator_decr(self, n)
482
+
483
+ def distance(self, x):
484
+ return _medpython.SwigPyIterator_distance(self, x)
485
+
486
+ def equal(self, x):
487
+ return _medpython.SwigPyIterator_equal(self, x)
488
+
489
+ def copy(self):
490
+ return _medpython.SwigPyIterator_copy(self)
491
+
492
+ def next(self):
493
+ return _medpython.SwigPyIterator_next(self)
494
+
495
+ def __next__(self):
496
+ return _medpython.SwigPyIterator___next__(self)
497
+
498
+ def previous(self):
499
+ return _medpython.SwigPyIterator_previous(self)
500
+
501
+ def advance(self, n):
502
+ return _medpython.SwigPyIterator_advance(self, n)
503
+
504
+ def __eq__(self, x):
505
+ return _medpython.SwigPyIterator___eq__(self, x)
506
+
507
+ def __ne__(self, x):
508
+ return _medpython.SwigPyIterator___ne__(self, x)
509
+
510
+ def __iadd__(self, n):
511
+ return _medpython.SwigPyIterator___iadd__(self, n)
512
+
513
+ def __isub__(self, n):
514
+ return _medpython.SwigPyIterator___isub__(self, n)
515
+
516
+ def __add__(self, n):
517
+ return _medpython.SwigPyIterator___add__(self, n)
518
+
519
+ def __sub__(self, *args):
520
+ return _medpython.SwigPyIterator___sub__(self, *args)
521
+ def __iter__(self):
522
+ return self
523
+
524
+ # Register SwigPyIterator in _medpython:
525
+ _medpython.SwigPyIterator_swigregister(SwigPyIterator)
526
+ class BoolVector(object):
527
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
528
+ __repr__ = _swig_repr
529
+
530
+ def iterator(self):
531
+ return _medpython.BoolVector_iterator(self)
532
+ def __iter__(self):
533
+ return self.iterator()
534
+
535
+ def __nonzero__(self):
536
+ return _medpython.BoolVector___nonzero__(self)
537
+
538
+ def __bool__(self):
539
+ return _medpython.BoolVector___bool__(self)
540
+
541
+ def __len__(self):
542
+ return _medpython.BoolVector___len__(self)
543
+
544
+ def __getslice__(self, i, j):
545
+ return _medpython.BoolVector___getslice__(self, i, j)
546
+
547
+ def __setslice__(self, *args):
548
+ return _medpython.BoolVector___setslice__(self, *args)
549
+
550
+ def __delslice__(self, i, j):
551
+ return _medpython.BoolVector___delslice__(self, i, j)
552
+
553
+ def __delitem__(self, *args):
554
+ return _medpython.BoolVector___delitem__(self, *args)
555
+
556
+ def __getitem__(self, *args):
557
+ return _medpython.BoolVector___getitem__(self, *args)
558
+
559
+ def __setitem__(self, *args):
560
+ return _medpython.BoolVector___setitem__(self, *args)
561
+
562
+ def pop(self):
563
+ return _medpython.BoolVector_pop(self)
564
+
565
+ def append(self, x):
566
+ return _medpython.BoolVector_append(self, x)
567
+
568
+ def empty(self):
569
+ return _medpython.BoolVector_empty(self)
570
+
571
+ def size(self):
572
+ return _medpython.BoolVector_size(self)
573
+
574
+ def swap(self, v):
575
+ return _medpython.BoolVector_swap(self, v)
576
+
577
+ def begin(self):
578
+ return _medpython.BoolVector_begin(self)
579
+
580
+ def end(self):
581
+ return _medpython.BoolVector_end(self)
582
+
583
+ def rbegin(self):
584
+ return _medpython.BoolVector_rbegin(self)
585
+
586
+ def rend(self):
587
+ return _medpython.BoolVector_rend(self)
588
+
589
+ def clear(self):
590
+ return _medpython.BoolVector_clear(self)
591
+
592
+ def get_allocator(self):
593
+ return _medpython.BoolVector_get_allocator(self)
594
+
595
+ def pop_back(self):
596
+ return _medpython.BoolVector_pop_back(self)
597
+
598
+ def erase(self, *args):
599
+ return _medpython.BoolVector_erase(self, *args)
600
+
601
+ def __init__(self, *args):
602
+ _medpython.BoolVector_swiginit(self, _medpython.new_BoolVector(*args))
603
+
604
+ def push_back(self, x):
605
+ return _medpython.BoolVector_push_back(self, x)
606
+
607
+ def front(self):
608
+ return _medpython.BoolVector_front(self)
609
+
610
+ def back(self):
611
+ return _medpython.BoolVector_back(self)
612
+
613
+ def assign(self, n, x):
614
+ return _medpython.BoolVector_assign(self, n, x)
615
+
616
+ def resize(self, *args):
617
+ return _medpython.BoolVector_resize(self, *args)
618
+
619
+ def insert(self, *args):
620
+ return _medpython.BoolVector_insert(self, *args)
621
+
622
+ def reserve(self, n):
623
+ return _medpython.BoolVector_reserve(self, n)
624
+
625
+ def capacity(self):
626
+ return _medpython.BoolVector_capacity(self)
627
+ __swig_destroy__ = _medpython.delete_BoolVector
628
+
629
+ # Register BoolVector in _medpython:
630
+ _medpython.BoolVector_swigregister(BoolVector)
631
+ class IntVector(object):
632
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
633
+ __repr__ = _swig_repr
634
+
635
+ def iterator(self):
636
+ return _medpython.IntVector_iterator(self)
637
+ def __iter__(self):
638
+ return self.iterator()
639
+
640
+ def __nonzero__(self):
641
+ return _medpython.IntVector___nonzero__(self)
642
+
643
+ def __bool__(self):
644
+ return _medpython.IntVector___bool__(self)
645
+
646
+ def __len__(self):
647
+ return _medpython.IntVector___len__(self)
648
+
649
+ def __getslice__(self, i, j):
650
+ return _medpython.IntVector___getslice__(self, i, j)
651
+
652
+ def __setslice__(self, *args):
653
+ return _medpython.IntVector___setslice__(self, *args)
654
+
655
+ def __delslice__(self, i, j):
656
+ return _medpython.IntVector___delslice__(self, i, j)
657
+
658
+ def __delitem__(self, *args):
659
+ return _medpython.IntVector___delitem__(self, *args)
660
+
661
+ def __getitem__(self, *args):
662
+ return _medpython.IntVector___getitem__(self, *args)
663
+
664
+ def __setitem__(self, *args):
665
+ return _medpython.IntVector___setitem__(self, *args)
666
+
667
+ def pop(self):
668
+ return _medpython.IntVector_pop(self)
669
+
670
+ def append(self, x):
671
+ return _medpython.IntVector_append(self, x)
672
+
673
+ def empty(self):
674
+ return _medpython.IntVector_empty(self)
675
+
676
+ def size(self):
677
+ return _medpython.IntVector_size(self)
678
+
679
+ def swap(self, v):
680
+ return _medpython.IntVector_swap(self, v)
681
+
682
+ def begin(self):
683
+ return _medpython.IntVector_begin(self)
684
+
685
+ def end(self):
686
+ return _medpython.IntVector_end(self)
687
+
688
+ def rbegin(self):
689
+ return _medpython.IntVector_rbegin(self)
690
+
691
+ def rend(self):
692
+ return _medpython.IntVector_rend(self)
693
+
694
+ def clear(self):
695
+ return _medpython.IntVector_clear(self)
696
+
697
+ def get_allocator(self):
698
+ return _medpython.IntVector_get_allocator(self)
699
+
700
+ def pop_back(self):
701
+ return _medpython.IntVector_pop_back(self)
702
+
703
+ def erase(self, *args):
704
+ return _medpython.IntVector_erase(self, *args)
705
+
706
+ def __init__(self, *args):
707
+ _medpython.IntVector_swiginit(self, _medpython.new_IntVector(*args))
708
+
709
+ def push_back(self, x):
710
+ return _medpython.IntVector_push_back(self, x)
711
+
712
+ def front(self):
713
+ return _medpython.IntVector_front(self)
714
+
715
+ def back(self):
716
+ return _medpython.IntVector_back(self)
717
+
718
+ def assign(self, n, x):
719
+ return _medpython.IntVector_assign(self, n, x)
720
+
721
+ def resize(self, *args):
722
+ return _medpython.IntVector_resize(self, *args)
723
+
724
+ def insert(self, *args):
725
+ return _medpython.IntVector_insert(self, *args)
726
+
727
+ def reserve(self, n):
728
+ return _medpython.IntVector_reserve(self, n)
729
+
730
+ def capacity(self):
731
+ return _medpython.IntVector_capacity(self)
732
+ __swig_destroy__ = _medpython.delete_IntVector
733
+
734
+ # Register IntVector in _medpython:
735
+ _medpython.IntVector_swigregister(IntVector)
736
+ class CharVector(object):
737
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
738
+ __repr__ = _swig_repr
739
+
740
+ def iterator(self):
741
+ return _medpython.CharVector_iterator(self)
742
+ def __iter__(self):
743
+ return self.iterator()
744
+
745
+ def __nonzero__(self):
746
+ return _medpython.CharVector___nonzero__(self)
747
+
748
+ def __bool__(self):
749
+ return _medpython.CharVector___bool__(self)
750
+
751
+ def __len__(self):
752
+ return _medpython.CharVector___len__(self)
753
+
754
+ def __getslice__(self, i, j):
755
+ return _medpython.CharVector___getslice__(self, i, j)
756
+
757
+ def __setslice__(self, *args):
758
+ return _medpython.CharVector___setslice__(self, *args)
759
+
760
+ def __delslice__(self, i, j):
761
+ return _medpython.CharVector___delslice__(self, i, j)
762
+
763
+ def __delitem__(self, *args):
764
+ return _medpython.CharVector___delitem__(self, *args)
765
+
766
+ def __getitem__(self, *args):
767
+ return _medpython.CharVector___getitem__(self, *args)
768
+
769
+ def __setitem__(self, *args):
770
+ return _medpython.CharVector___setitem__(self, *args)
771
+
772
+ def pop(self):
773
+ return _medpython.CharVector_pop(self)
774
+
775
+ def append(self, x):
776
+ return _medpython.CharVector_append(self, x)
777
+
778
+ def empty(self):
779
+ return _medpython.CharVector_empty(self)
780
+
781
+ def size(self):
782
+ return _medpython.CharVector_size(self)
783
+
784
+ def swap(self, v):
785
+ return _medpython.CharVector_swap(self, v)
786
+
787
+ def begin(self):
788
+ return _medpython.CharVector_begin(self)
789
+
790
+ def end(self):
791
+ return _medpython.CharVector_end(self)
792
+
793
+ def rbegin(self):
794
+ return _medpython.CharVector_rbegin(self)
795
+
796
+ def rend(self):
797
+ return _medpython.CharVector_rend(self)
798
+
799
+ def clear(self):
800
+ return _medpython.CharVector_clear(self)
801
+
802
+ def get_allocator(self):
803
+ return _medpython.CharVector_get_allocator(self)
804
+
805
+ def pop_back(self):
806
+ return _medpython.CharVector_pop_back(self)
807
+
808
+ def erase(self, *args):
809
+ return _medpython.CharVector_erase(self, *args)
810
+
811
+ def __init__(self, *args):
812
+ _medpython.CharVector_swiginit(self, _medpython.new_CharVector(*args))
813
+
814
+ def push_back(self, x):
815
+ return _medpython.CharVector_push_back(self, x)
816
+
817
+ def front(self):
818
+ return _medpython.CharVector_front(self)
819
+
820
+ def back(self):
821
+ return _medpython.CharVector_back(self)
822
+
823
+ def assign(self, n, x):
824
+ return _medpython.CharVector_assign(self, n, x)
825
+
826
+ def resize(self, *args):
827
+ return _medpython.CharVector_resize(self, *args)
828
+
829
+ def insert(self, *args):
830
+ return _medpython.CharVector_insert(self, *args)
831
+
832
+ def reserve(self, n):
833
+ return _medpython.CharVector_reserve(self, n)
834
+
835
+ def capacity(self):
836
+ return _medpython.CharVector_capacity(self)
837
+ __swig_destroy__ = _medpython.delete_CharVector
838
+
839
+ # Register CharVector in _medpython:
840
+ _medpython.CharVector_swigregister(CharVector)
841
+ class DoubleVector(object):
842
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
843
+ __repr__ = _swig_repr
844
+
845
+ def iterator(self):
846
+ return _medpython.DoubleVector_iterator(self)
847
+ def __iter__(self):
848
+ return self.iterator()
849
+
850
+ def __nonzero__(self):
851
+ return _medpython.DoubleVector___nonzero__(self)
852
+
853
+ def __bool__(self):
854
+ return _medpython.DoubleVector___bool__(self)
855
+
856
+ def __len__(self):
857
+ return _medpython.DoubleVector___len__(self)
858
+
859
+ def __getslice__(self, i, j):
860
+ return _medpython.DoubleVector___getslice__(self, i, j)
861
+
862
+ def __setslice__(self, *args):
863
+ return _medpython.DoubleVector___setslice__(self, *args)
864
+
865
+ def __delslice__(self, i, j):
866
+ return _medpython.DoubleVector___delslice__(self, i, j)
867
+
868
+ def __delitem__(self, *args):
869
+ return _medpython.DoubleVector___delitem__(self, *args)
870
+
871
+ def __getitem__(self, *args):
872
+ return _medpython.DoubleVector___getitem__(self, *args)
873
+
874
+ def __setitem__(self, *args):
875
+ return _medpython.DoubleVector___setitem__(self, *args)
876
+
877
+ def pop(self):
878
+ return _medpython.DoubleVector_pop(self)
879
+
880
+ def append(self, x):
881
+ return _medpython.DoubleVector_append(self, x)
882
+
883
+ def empty(self):
884
+ return _medpython.DoubleVector_empty(self)
885
+
886
+ def size(self):
887
+ return _medpython.DoubleVector_size(self)
888
+
889
+ def swap(self, v):
890
+ return _medpython.DoubleVector_swap(self, v)
891
+
892
+ def begin(self):
893
+ return _medpython.DoubleVector_begin(self)
894
+
895
+ def end(self):
896
+ return _medpython.DoubleVector_end(self)
897
+
898
+ def rbegin(self):
899
+ return _medpython.DoubleVector_rbegin(self)
900
+
901
+ def rend(self):
902
+ return _medpython.DoubleVector_rend(self)
903
+
904
+ def clear(self):
905
+ return _medpython.DoubleVector_clear(self)
906
+
907
+ def get_allocator(self):
908
+ return _medpython.DoubleVector_get_allocator(self)
909
+
910
+ def pop_back(self):
911
+ return _medpython.DoubleVector_pop_back(self)
912
+
913
+ def erase(self, *args):
914
+ return _medpython.DoubleVector_erase(self, *args)
915
+
916
+ def __init__(self, *args):
917
+ _medpython.DoubleVector_swiginit(self, _medpython.new_DoubleVector(*args))
918
+
919
+ def push_back(self, x):
920
+ return _medpython.DoubleVector_push_back(self, x)
921
+
922
+ def front(self):
923
+ return _medpython.DoubleVector_front(self)
924
+
925
+ def back(self):
926
+ return _medpython.DoubleVector_back(self)
927
+
928
+ def assign(self, n, x):
929
+ return _medpython.DoubleVector_assign(self, n, x)
930
+
931
+ def resize(self, *args):
932
+ return _medpython.DoubleVector_resize(self, *args)
933
+
934
+ def insert(self, *args):
935
+ return _medpython.DoubleVector_insert(self, *args)
936
+
937
+ def reserve(self, n):
938
+ return _medpython.DoubleVector_reserve(self, n)
939
+
940
+ def capacity(self):
941
+ return _medpython.DoubleVector_capacity(self)
942
+ __swig_destroy__ = _medpython.delete_DoubleVector
943
+
944
+ # Register DoubleVector in _medpython:
945
+ _medpython.DoubleVector_swigregister(DoubleVector)
946
+ class StringVector(object):
947
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
948
+ __repr__ = _swig_repr
949
+
950
+ def iterator(self):
951
+ return _medpython.StringVector_iterator(self)
952
+ def __iter__(self):
953
+ return self.iterator()
954
+
955
+ def __nonzero__(self):
956
+ return _medpython.StringVector___nonzero__(self)
957
+
958
+ def __bool__(self):
959
+ return _medpython.StringVector___bool__(self)
960
+
961
+ def __len__(self):
962
+ return _medpython.StringVector___len__(self)
963
+
964
+ def __getslice__(self, i, j):
965
+ return _medpython.StringVector___getslice__(self, i, j)
966
+
967
+ def __setslice__(self, *args):
968
+ return _medpython.StringVector___setslice__(self, *args)
969
+
970
+ def __delslice__(self, i, j):
971
+ return _medpython.StringVector___delslice__(self, i, j)
972
+
973
+ def __delitem__(self, *args):
974
+ return _medpython.StringVector___delitem__(self, *args)
975
+
976
+ def __getitem__(self, *args):
977
+ return _medpython.StringVector___getitem__(self, *args)
978
+
979
+ def __setitem__(self, *args):
980
+ return _medpython.StringVector___setitem__(self, *args)
981
+
982
+ def pop(self):
983
+ return _medpython.StringVector_pop(self)
984
+
985
+ def append(self, x):
986
+ return _medpython.StringVector_append(self, x)
987
+
988
+ def empty(self):
989
+ return _medpython.StringVector_empty(self)
990
+
991
+ def size(self):
992
+ return _medpython.StringVector_size(self)
993
+
994
+ def swap(self, v):
995
+ return _medpython.StringVector_swap(self, v)
996
+
997
+ def begin(self):
998
+ return _medpython.StringVector_begin(self)
999
+
1000
+ def end(self):
1001
+ return _medpython.StringVector_end(self)
1002
+
1003
+ def rbegin(self):
1004
+ return _medpython.StringVector_rbegin(self)
1005
+
1006
+ def rend(self):
1007
+ return _medpython.StringVector_rend(self)
1008
+
1009
+ def clear(self):
1010
+ return _medpython.StringVector_clear(self)
1011
+
1012
+ def get_allocator(self):
1013
+ return _medpython.StringVector_get_allocator(self)
1014
+
1015
+ def pop_back(self):
1016
+ return _medpython.StringVector_pop_back(self)
1017
+
1018
+ def erase(self, *args):
1019
+ return _medpython.StringVector_erase(self, *args)
1020
+
1021
+ def __init__(self, *args):
1022
+ _medpython.StringVector_swiginit(self, _medpython.new_StringVector(*args))
1023
+
1024
+ def push_back(self, x):
1025
+ return _medpython.StringVector_push_back(self, x)
1026
+
1027
+ def front(self):
1028
+ return _medpython.StringVector_front(self)
1029
+
1030
+ def back(self):
1031
+ return _medpython.StringVector_back(self)
1032
+
1033
+ def assign(self, n, x):
1034
+ return _medpython.StringVector_assign(self, n, x)
1035
+
1036
+ def resize(self, *args):
1037
+ return _medpython.StringVector_resize(self, *args)
1038
+
1039
+ def insert(self, *args):
1040
+ return _medpython.StringVector_insert(self, *args)
1041
+
1042
+ def reserve(self, n):
1043
+ return _medpython.StringVector_reserve(self, n)
1044
+
1045
+ def capacity(self):
1046
+ return _medpython.StringVector_capacity(self)
1047
+ __swig_destroy__ = _medpython.delete_StringVector
1048
+
1049
+ # Register StringVector in _medpython:
1050
+ _medpython.StringVector_swigregister(StringVector)
1051
+ class FloatVector(object):
1052
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1053
+ __repr__ = _swig_repr
1054
+
1055
+ def iterator(self):
1056
+ return _medpython.FloatVector_iterator(self)
1057
+ def __iter__(self):
1058
+ return self.iterator()
1059
+
1060
+ def __nonzero__(self):
1061
+ return _medpython.FloatVector___nonzero__(self)
1062
+
1063
+ def __bool__(self):
1064
+ return _medpython.FloatVector___bool__(self)
1065
+
1066
+ def __len__(self):
1067
+ return _medpython.FloatVector___len__(self)
1068
+
1069
+ def __getslice__(self, i, j):
1070
+ return _medpython.FloatVector___getslice__(self, i, j)
1071
+
1072
+ def __setslice__(self, *args):
1073
+ return _medpython.FloatVector___setslice__(self, *args)
1074
+
1075
+ def __delslice__(self, i, j):
1076
+ return _medpython.FloatVector___delslice__(self, i, j)
1077
+
1078
+ def __delitem__(self, *args):
1079
+ return _medpython.FloatVector___delitem__(self, *args)
1080
+
1081
+ def __getitem__(self, *args):
1082
+ return _medpython.FloatVector___getitem__(self, *args)
1083
+
1084
+ def __setitem__(self, *args):
1085
+ return _medpython.FloatVector___setitem__(self, *args)
1086
+
1087
+ def pop(self):
1088
+ return _medpython.FloatVector_pop(self)
1089
+
1090
+ def append(self, x):
1091
+ return _medpython.FloatVector_append(self, x)
1092
+
1093
+ def empty(self):
1094
+ return _medpython.FloatVector_empty(self)
1095
+
1096
+ def size(self):
1097
+ return _medpython.FloatVector_size(self)
1098
+
1099
+ def swap(self, v):
1100
+ return _medpython.FloatVector_swap(self, v)
1101
+
1102
+ def begin(self):
1103
+ return _medpython.FloatVector_begin(self)
1104
+
1105
+ def end(self):
1106
+ return _medpython.FloatVector_end(self)
1107
+
1108
+ def rbegin(self):
1109
+ return _medpython.FloatVector_rbegin(self)
1110
+
1111
+ def rend(self):
1112
+ return _medpython.FloatVector_rend(self)
1113
+
1114
+ def clear(self):
1115
+ return _medpython.FloatVector_clear(self)
1116
+
1117
+ def get_allocator(self):
1118
+ return _medpython.FloatVector_get_allocator(self)
1119
+
1120
+ def pop_back(self):
1121
+ return _medpython.FloatVector_pop_back(self)
1122
+
1123
+ def erase(self, *args):
1124
+ return _medpython.FloatVector_erase(self, *args)
1125
+
1126
+ def __init__(self, *args):
1127
+ _medpython.FloatVector_swiginit(self, _medpython.new_FloatVector(*args))
1128
+
1129
+ def push_back(self, x):
1130
+ return _medpython.FloatVector_push_back(self, x)
1131
+
1132
+ def front(self):
1133
+ return _medpython.FloatVector_front(self)
1134
+
1135
+ def back(self):
1136
+ return _medpython.FloatVector_back(self)
1137
+
1138
+ def assign(self, n, x):
1139
+ return _medpython.FloatVector_assign(self, n, x)
1140
+
1141
+ def resize(self, *args):
1142
+ return _medpython.FloatVector_resize(self, *args)
1143
+
1144
+ def insert(self, *args):
1145
+ return _medpython.FloatVector_insert(self, *args)
1146
+
1147
+ def reserve(self, n):
1148
+ return _medpython.FloatVector_reserve(self, n)
1149
+
1150
+ def capacity(self):
1151
+ return _medpython.FloatVector_capacity(self)
1152
+ __swig_destroy__ = _medpython.delete_FloatVector
1153
+
1154
+ # Register FloatVector in _medpython:
1155
+ _medpython.FloatVector_swigregister(FloatVector)
1156
+ class StopIterator(object):
1157
+ r"""Proxy of C++ StopIterator class."""
1158
+
1159
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1160
+ __repr__ = _swig_repr
1161
+
1162
+ def __init__(self):
1163
+ r"""__init__(StopIterator self) -> StopIterator"""
1164
+ _medpython.StopIterator_swiginit(self, _medpython.new_StopIterator())
1165
+ __swig_destroy__ = _medpython.delete_StopIterator
1166
+
1167
+ # Register StopIterator in _medpython:
1168
+ _medpython.StopIterator_swigregister(StopIterator)
1169
+ class IntIntMapAdaptor(object):
1170
+ r"""Proxy of C++ MPIntIntMapAdaptor class."""
1171
+
1172
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1173
+ __repr__ = _swig_repr
1174
+
1175
+ def __init__(self):
1176
+ r"""__init__(IntIntMapAdaptor self) -> IntIntMapAdaptor"""
1177
+ _medpython.IntIntMapAdaptor_swiginit(self, _medpython.new_IntIntMapAdaptor())
1178
+ __swig_destroy__ = _medpython.delete_IntIntMapAdaptor
1179
+
1180
+ def __len__(self):
1181
+ r"""__len__(IntIntMapAdaptor self) -> int"""
1182
+ return _medpython.IntIntMapAdaptor___len__(self)
1183
+
1184
+ def __getitem__(self, i):
1185
+ r"""__getitem__(IntIntMapAdaptor self, int i) -> int"""
1186
+ return _medpython.IntIntMapAdaptor___getitem__(self, i)
1187
+
1188
+ def __setitem__(self, i, val):
1189
+ r"""__setitem__(IntIntMapAdaptor self, int i, int val)"""
1190
+ return _medpython.IntIntMapAdaptor___setitem__(self, i, val)
1191
+
1192
+ def keys(self):
1193
+ r"""keys(IntIntMapAdaptor self)"""
1194
+ return _medpython.IntIntMapAdaptor_keys(self)
1195
+
1196
+ # Register IntIntMapAdaptor in _medpython:
1197
+ _medpython.IntIntMapAdaptor_swigregister(IntIntMapAdaptor)
1198
+ class StringStringMapAdaptor(object):
1199
+ r"""Proxy of C++ MPStringStringMapAdaptor class."""
1200
+
1201
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1202
+ __repr__ = _swig_repr
1203
+
1204
+ def __init__(self):
1205
+ r"""__init__(StringStringMapAdaptor self) -> StringStringMapAdaptor"""
1206
+ _medpython.StringStringMapAdaptor_swiginit(self, _medpython.new_StringStringMapAdaptor())
1207
+ __swig_destroy__ = _medpython.delete_StringStringMapAdaptor
1208
+
1209
+ def __len__(self):
1210
+ r"""__len__(StringStringMapAdaptor self) -> int"""
1211
+ return _medpython.StringStringMapAdaptor___len__(self)
1212
+
1213
+ def __getitem__(self, i):
1214
+ r"""__getitem__(StringStringMapAdaptor self, std::string const & i) -> std::string"""
1215
+ return _medpython.StringStringMapAdaptor___getitem__(self, i)
1216
+
1217
+ def __setitem__(self, i, val):
1218
+ r"""__setitem__(StringStringMapAdaptor self, std::string const & i, std::string const & val)"""
1219
+ return _medpython.StringStringMapAdaptor___setitem__(self, i, val)
1220
+
1221
+ def keys(self):
1222
+ r"""keys(StringStringMapAdaptor self) -> StringVector"""
1223
+ return _medpython.StringStringMapAdaptor_keys(self)
1224
+
1225
+ # Register StringStringMapAdaptor in _medpython:
1226
+ _medpython.StringStringMapAdaptor_swigregister(StringStringMapAdaptor)
1227
+ class StringFloatMapAdaptor(object):
1228
+ r"""Proxy of C++ MPStringFloatMapAdaptor class."""
1229
+
1230
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1231
+ __repr__ = _swig_repr
1232
+
1233
+ def __init__(self):
1234
+ r"""__init__(StringFloatMapAdaptor self) -> StringFloatMapAdaptor"""
1235
+ _medpython.StringFloatMapAdaptor_swiginit(self, _medpython.new_StringFloatMapAdaptor())
1236
+ __swig_destroy__ = _medpython.delete_StringFloatMapAdaptor
1237
+
1238
+ def __len__(self):
1239
+ r"""__len__(StringFloatMapAdaptor self) -> int"""
1240
+ return _medpython.StringFloatMapAdaptor___len__(self)
1241
+
1242
+ def __getitem__(self, i):
1243
+ r"""__getitem__(StringFloatMapAdaptor self, std::string const & i) -> float"""
1244
+ return _medpython.StringFloatMapAdaptor___getitem__(self, i)
1245
+
1246
+ def __setitem__(self, i, val):
1247
+ r"""__setitem__(StringFloatMapAdaptor self, std::string const & i, float val)"""
1248
+ return _medpython.StringFloatMapAdaptor___setitem__(self, i, val)
1249
+
1250
+ def keys(self):
1251
+ r"""keys(StringFloatMapAdaptor self) -> StringVector"""
1252
+ return _medpython.StringFloatMapAdaptor_keys(self)
1253
+
1254
+ # Register StringFloatMapAdaptor in _medpython:
1255
+ _medpython.StringFloatMapAdaptor_swigregister(StringFloatMapAdaptor)
1256
+ class StringVecFloatMapAdaptor(object):
1257
+ r"""Proxy of C++ MPStringVecFloatMapAdaptor class."""
1258
+
1259
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1260
+ __repr__ = _swig_repr
1261
+
1262
+ def __init__(self):
1263
+ r"""__init__(StringVecFloatMapAdaptor self) -> StringVecFloatMapAdaptor"""
1264
+ _medpython.StringVecFloatMapAdaptor_swiginit(self, _medpython.new_StringVecFloatMapAdaptor())
1265
+ __swig_destroy__ = _medpython.delete_StringVecFloatMapAdaptor
1266
+
1267
+ def __len__(self):
1268
+ r"""__len__(StringVecFloatMapAdaptor self) -> int"""
1269
+ return _medpython.StringVecFloatMapAdaptor___len__(self)
1270
+
1271
+ def __getitem__(self, key):
1272
+ r"""__getitem__(StringVecFloatMapAdaptor self, std::string key)"""
1273
+ return _medpython.StringVecFloatMapAdaptor___getitem__(self, key)
1274
+
1275
+ def __setitem__(self, key, float_in_buf):
1276
+ r"""__setitem__(StringVecFloatMapAdaptor self, std::string key, float * float_in_buf)"""
1277
+ return _medpython.StringVecFloatMapAdaptor___setitem__(self, key, float_in_buf)
1278
+
1279
+ def keys(self):
1280
+ r"""keys(StringVecFloatMapAdaptor self) -> StringVector"""
1281
+ return _medpython.StringVecFloatMapAdaptor_keys(self)
1282
+
1283
+ # Register StringVecFloatMapAdaptor in _medpython:
1284
+ _medpython.StringVecFloatMapAdaptor_swigregister(StringVecFloatMapAdaptor)
1285
+ class IntPairIntIntMapAdaptor(object):
1286
+ r"""Proxy of C++ MPIntPairIntIntMapAdaptor class."""
1287
+
1288
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1289
+ __repr__ = _swig_repr
1290
+
1291
+ def __init__(self):
1292
+ r"""__init__(IntPairIntIntMapAdaptor self) -> IntPairIntIntMapAdaptor"""
1293
+ _medpython.IntPairIntIntMapAdaptor_swiginit(self, _medpython.new_IntPairIntIntMapAdaptor())
1294
+ __swig_destroy__ = _medpython.delete_IntPairIntIntMapAdaptor
1295
+
1296
+ def __len__(self):
1297
+ r"""__len__(IntPairIntIntMapAdaptor self) -> int"""
1298
+ return _medpython.IntPairIntIntMapAdaptor___len__(self)
1299
+
1300
+ def __getitem__(self, key):
1301
+ r"""__getitem__(IntPairIntIntMapAdaptor self, int key)"""
1302
+ return _medpython.IntPairIntIntMapAdaptor___getitem__(self, key)
1303
+
1304
+ def __setitem__(self, key, int_in_buf):
1305
+ r"""__setitem__(IntPairIntIntMapAdaptor self, int key, int * int_in_buf)"""
1306
+ return _medpython.IntPairIntIntMapAdaptor___setitem__(self, key, int_in_buf)
1307
+
1308
+ def keys(self):
1309
+ r"""keys(IntPairIntIntMapAdaptor self)"""
1310
+ return _medpython.IntPairIntIntMapAdaptor_keys(self)
1311
+
1312
+ # Register IntPairIntIntMapAdaptor in _medpython:
1313
+ _medpython.IntPairIntIntMapAdaptor_swigregister(IntPairIntIntMapAdaptor)
1314
+ class StringUOSetStringMapAdaptor(object):
1315
+ r"""Proxy of C++ MPStringUOSetStringMapAdaptor class."""
1316
+
1317
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1318
+ __repr__ = _swig_repr
1319
+
1320
+ def __init__(self):
1321
+ r"""__init__(StringUOSetStringMapAdaptor self) -> StringUOSetStringMapAdaptor"""
1322
+ _medpython.StringUOSetStringMapAdaptor_swiginit(self, _medpython.new_StringUOSetStringMapAdaptor())
1323
+ __swig_destroy__ = _medpython.delete_StringUOSetStringMapAdaptor
1324
+
1325
+ def __len__(self):
1326
+ r"""__len__(StringUOSetStringMapAdaptor self) -> int"""
1327
+ return _medpython.StringUOSetStringMapAdaptor___len__(self)
1328
+
1329
+ def __getitem__(self, key):
1330
+ r"""__getitem__(StringUOSetStringMapAdaptor self, std::string key) -> StringVector"""
1331
+ return _medpython.StringUOSetStringMapAdaptor___getitem__(self, key)
1332
+
1333
+ def __setitem__(self, key, val):
1334
+ r"""__setitem__(StringUOSetStringMapAdaptor self, std::string key, StringVector val)"""
1335
+ return _medpython.StringUOSetStringMapAdaptor___setitem__(self, key, val)
1336
+
1337
+ def keys(self):
1338
+ r"""keys(StringUOSetStringMapAdaptor self) -> StringVector"""
1339
+ return _medpython.StringUOSetStringMapAdaptor_keys(self)
1340
+
1341
+ # Register StringUOSetStringMapAdaptor in _medpython:
1342
+ _medpython.StringUOSetStringMapAdaptor_swigregister(StringUOSetStringMapAdaptor)
1343
+ class IntStringMapAdaptor(object):
1344
+ r"""Proxy of C++ MPIntStringMapAdaptor class."""
1345
+
1346
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1347
+ __repr__ = _swig_repr
1348
+
1349
+ def __init__(self):
1350
+ r"""__init__(IntStringMapAdaptor self) -> IntStringMapAdaptor"""
1351
+ _medpython.IntStringMapAdaptor_swiginit(self, _medpython.new_IntStringMapAdaptor())
1352
+ __swig_destroy__ = _medpython.delete_IntStringMapAdaptor
1353
+
1354
+ def __len__(self):
1355
+ r"""__len__(IntStringMapAdaptor self) -> int"""
1356
+ return _medpython.IntStringMapAdaptor___len__(self)
1357
+
1358
+ def __getitem__(self, i):
1359
+ r"""__getitem__(IntStringMapAdaptor self, int i) -> std::string"""
1360
+ return _medpython.IntStringMapAdaptor___getitem__(self, i)
1361
+
1362
+ def __setitem__(self, i, val):
1363
+ r"""__setitem__(IntStringMapAdaptor self, int i, string const & val)"""
1364
+ return _medpython.IntStringMapAdaptor___setitem__(self, i, val)
1365
+
1366
+ def keys(self):
1367
+ r"""keys(IntStringMapAdaptor self) -> IntVector"""
1368
+ return _medpython.IntStringMapAdaptor_keys(self)
1369
+
1370
+ # Register IntStringMapAdaptor in _medpython:
1371
+ _medpython.IntStringMapAdaptor_swigregister(IntStringMapAdaptor)
1372
+ class IntVecIntMapAdaptor(object):
1373
+ r"""Proxy of C++ MPIntVecIntMapAdaptor class."""
1374
+
1375
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1376
+ __repr__ = _swig_repr
1377
+ o = property(_medpython.IntVecIntMapAdaptor_o_get, _medpython.IntVecIntMapAdaptor_o_set, doc=r"""o : p.std::map<(int,std::vector<(int,std::allocator<(int)>)>)>""")
1378
+
1379
+ def __init__(self):
1380
+ r"""__init__(IntVecIntMapAdaptor self) -> IntVecIntMapAdaptor"""
1381
+ _medpython.IntVecIntMapAdaptor_swiginit(self, _medpython.new_IntVecIntMapAdaptor())
1382
+ __swig_destroy__ = _medpython.delete_IntVecIntMapAdaptor
1383
+
1384
+ def __len__(self):
1385
+ r"""__len__(IntVecIntMapAdaptor self) -> int"""
1386
+ return _medpython.IntVecIntMapAdaptor___len__(self)
1387
+
1388
+ def __getitem__(self, key):
1389
+ r"""__getitem__(IntVecIntMapAdaptor self, int key)"""
1390
+ return _medpython.IntVecIntMapAdaptor___getitem__(self, key)
1391
+
1392
+ def __setitem__(self, key, int_in_buf):
1393
+ r"""__setitem__(IntVecIntMapAdaptor self, int key, int * int_in_buf)"""
1394
+ return _medpython.IntVecIntMapAdaptor___setitem__(self, key, int_in_buf)
1395
+
1396
+ def keys(self):
1397
+ r"""keys(IntVecIntMapAdaptor self) -> IntVector"""
1398
+ return _medpython.IntVecIntMapAdaptor_keys(self)
1399
+
1400
+ # Register IntVecIntMapAdaptor in _medpython:
1401
+ _medpython.IntVecIntMapAdaptor_swigregister(IntVecIntMapAdaptor)
1402
+
1403
+ def logger_use_stdout():
1404
+ r"""logger_use_stdout()"""
1405
+ return _medpython.logger_use_stdout()
1406
+ class StringBtResultMap(object):
1407
+ r"""Proxy of C++ MPStringBtResultMap class."""
1408
+
1409
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1410
+ __repr__ = _swig_repr
1411
+
1412
+ def __init__(self):
1413
+ r"""__init__(StringBtResultMap self) -> StringBtResultMap"""
1414
+ _medpython.StringBtResultMap_swiginit(self, _medpython.new_StringBtResultMap())
1415
+ __swig_destroy__ = _medpython.delete_StringBtResultMap
1416
+
1417
+ def __len__(self):
1418
+ r"""__len__(StringBtResultMap self) -> int"""
1419
+ return _medpython.StringBtResultMap___len__(self)
1420
+
1421
+ def __getitem__(self, key):
1422
+ r"""__getitem__(StringBtResultMap self, std::string const & key) -> StringFloatMapAdaptor"""
1423
+ return _medpython.StringBtResultMap___getitem__(self, key)
1424
+
1425
+ def __setitem__(self, key, val):
1426
+ r"""__setitem__(StringBtResultMap self, std::string const & key, StringFloatMapAdaptor val)"""
1427
+ return _medpython.StringBtResultMap___setitem__(self, key, val)
1428
+
1429
+ def keys(self):
1430
+ r"""keys(StringBtResultMap self) -> StringVector"""
1431
+ return _medpython.StringBtResultMap_keys(self)
1432
+
1433
+ def to_file(self, file_path):
1434
+ r"""to_file(StringBtResultMap self, std::string const & file_path)"""
1435
+ return _medpython.StringBtResultMap_to_file(self, file_path)
1436
+
1437
+ # Register StringBtResultMap in _medpython:
1438
+ _medpython.StringBtResultMap_swigregister(StringBtResultMap)
1439
+ class Bootstrap(object):
1440
+ r"""Proxy of C++ MPBootstrap class."""
1441
+
1442
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1443
+ __repr__ = _swig_repr
1444
+
1445
+ def __init__(self):
1446
+ r"""__init__(Bootstrap self) -> Bootstrap"""
1447
+ _medpython.Bootstrap_swiginit(self, _medpython.new_Bootstrap())
1448
+ __swig_destroy__ = _medpython.delete_Bootstrap
1449
+
1450
+ def MEDPY_GET_sample_per_pid(self):
1451
+ r"""MEDPY_GET_sample_per_pid(Bootstrap self) -> int"""
1452
+ return _medpython.Bootstrap_MEDPY_GET_sample_per_pid(self)
1453
+
1454
+ def MEDPY_SET_sample_per_pid(self, _sample_per_pid):
1455
+ r"""MEDPY_SET_sample_per_pid(Bootstrap self, int _sample_per_pid)"""
1456
+ return _medpython.Bootstrap_MEDPY_SET_sample_per_pid(self, _sample_per_pid)
1457
+
1458
+ def MEDPY_GET_nbootstrap(self):
1459
+ r"""MEDPY_GET_nbootstrap(Bootstrap self) -> int"""
1460
+ return _medpython.Bootstrap_MEDPY_GET_nbootstrap(self)
1461
+
1462
+ def MEDPY_SET_nbootstrap(self, _nbootstrap):
1463
+ r"""MEDPY_SET_nbootstrap(Bootstrap self, int _nbootstrap)"""
1464
+ return _medpython.Bootstrap_MEDPY_SET_nbootstrap(self, _nbootstrap)
1465
+
1466
+ def MEDPY_GET_ROC_score_min_samples(self):
1467
+ r"""MEDPY_GET_ROC_score_min_samples(Bootstrap self) -> int"""
1468
+ return _medpython.Bootstrap_MEDPY_GET_ROC_score_min_samples(self)
1469
+
1470
+ def MEDPY_SET_ROC_score_min_samples(self, _ROC_score_min_samples):
1471
+ r"""MEDPY_SET_ROC_score_min_samples(Bootstrap self, int _ROC_score_min_samples)"""
1472
+ return _medpython.Bootstrap_MEDPY_SET_ROC_score_min_samples(self, _ROC_score_min_samples)
1473
+
1474
+ def MEDPY_GET_ROC_score_bins(self):
1475
+ r"""MEDPY_GET_ROC_score_bins(Bootstrap self) -> int"""
1476
+ return _medpython.Bootstrap_MEDPY_GET_ROC_score_bins(self)
1477
+
1478
+ def MEDPY_SET_ROC_score_bins(self, _ROC_score_bins):
1479
+ r"""MEDPY_SET_ROC_score_bins(Bootstrap self, int _ROC_score_bins)"""
1480
+ return _medpython.Bootstrap_MEDPY_SET_ROC_score_bins(self, _ROC_score_bins)
1481
+
1482
+ def MEDPY_GET_ROC_max_diff_working_point(self):
1483
+ r"""MEDPY_GET_ROC_max_diff_working_point(Bootstrap self) -> float"""
1484
+ return _medpython.Bootstrap_MEDPY_GET_ROC_max_diff_working_point(self)
1485
+
1486
+ def MEDPY_SET_ROC_max_diff_working_point(self, _ROC_max_diff_working_point):
1487
+ r"""MEDPY_SET_ROC_max_diff_working_point(Bootstrap self, float _ROC_max_diff_working_point)"""
1488
+ return _medpython.Bootstrap_MEDPY_SET_ROC_max_diff_working_point(self, _ROC_max_diff_working_point)
1489
+
1490
+ def MEDPY_GET_ROC_score_resolution(self):
1491
+ r"""MEDPY_GET_ROC_score_resolution(Bootstrap self) -> float"""
1492
+ return _medpython.Bootstrap_MEDPY_GET_ROC_score_resolution(self)
1493
+
1494
+ def MEDPY_SET_ROC_score_resolution(self, _ROC_score_resolutiont):
1495
+ r"""MEDPY_SET_ROC_score_resolution(Bootstrap self, float _ROC_score_resolutiont)"""
1496
+ return _medpython.Bootstrap_MEDPY_SET_ROC_score_resolution(self, _ROC_score_resolutiont)
1497
+
1498
+ def MEDPY_GET_ROC_use_score_working_points(self):
1499
+ r"""MEDPY_GET_ROC_use_score_working_points(Bootstrap self) -> bool"""
1500
+ return _medpython.Bootstrap_MEDPY_GET_ROC_use_score_working_points(self)
1501
+
1502
+ def MEDPY_SET_ROC_use_score_working_points(self, _ROC_use_score_working_points):
1503
+ r"""MEDPY_SET_ROC_use_score_working_points(Bootstrap self, bool _ROC_use_score_working_points)"""
1504
+ return _medpython.Bootstrap_MEDPY_SET_ROC_use_score_working_points(self, _ROC_use_score_working_points)
1505
+
1506
+ def MEDPY_GET_ROC_working_point_FPR(self):
1507
+ r"""MEDPY_GET_ROC_working_point_FPR(Bootstrap self) -> FloatVector"""
1508
+ return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_FPR(self)
1509
+
1510
+ def MEDPY_SET_ROC_working_point_FPR(self, _ROC_working_point_FPR):
1511
+ r"""MEDPY_SET_ROC_working_point_FPR(Bootstrap self, FloatVector _ROC_working_point_FPR)"""
1512
+ return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_FPR(self, _ROC_working_point_FPR)
1513
+
1514
+ def MEDPY_GET_ROC_working_point_PR(self):
1515
+ r"""MEDPY_GET_ROC_working_point_PR(Bootstrap self) -> FloatVector"""
1516
+ return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_PR(self)
1517
+
1518
+ def MEDPY_SET_ROC_working_point_PR(self, _ROC_working_point_PR):
1519
+ r"""MEDPY_SET_ROC_working_point_PR(Bootstrap self, FloatVector _ROC_working_point_PR)"""
1520
+ return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_PR(self, _ROC_working_point_PR)
1521
+
1522
+ def MEDPY_GET_ROC_working_point_SENS(self):
1523
+ r"""MEDPY_GET_ROC_working_point_SENS(Bootstrap self) -> FloatVector"""
1524
+ return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_SENS(self)
1525
+
1526
+ def MEDPY_SET_ROC_working_point_SENS(self, _ROC_working_point_SENS):
1527
+ r"""MEDPY_SET_ROC_working_point_SENS(Bootstrap self, FloatVector _ROC_working_point_SENS)"""
1528
+ return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_SENS(self, _ROC_working_point_SENS)
1529
+
1530
+ def MEDPY_GET_ROC_working_point_Score(self):
1531
+ r"""MEDPY_GET_ROC_working_point_Score(Bootstrap self) -> FloatVector"""
1532
+ return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_Score(self)
1533
+
1534
+ def MEDPY_SET_ROC_working_point_Score(self, _ROC_working_point_Score):
1535
+ r"""MEDPY_SET_ROC_working_point_Score(Bootstrap self, FloatVector _ROC_working_point_Score)"""
1536
+ return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_Score(self, _ROC_working_point_Score)
1537
+
1538
+ def MEDPY_GET_ROC_working_point_TOPN(self):
1539
+ r"""MEDPY_GET_ROC_working_point_TOPN(Bootstrap self) -> IntVector"""
1540
+ return _medpython.Bootstrap_MEDPY_GET_ROC_working_point_TOPN(self)
1541
+
1542
+ def MEDPY_SET_ROC_working_point_TOPN(self, MEDPY_GET_ROC_working_point_TOPN):
1543
+ r"""MEDPY_SET_ROC_working_point_TOPN(Bootstrap self, IntVector MEDPY_GET_ROC_working_point_TOPN)"""
1544
+ return _medpython.Bootstrap_MEDPY_SET_ROC_working_point_TOPN(self, MEDPY_GET_ROC_working_point_TOPN)
1545
+
1546
+ def parse_cohort_line(self, line):
1547
+ r"""parse_cohort_line(Bootstrap self, string const & line)"""
1548
+ return _medpython.Bootstrap_parse_cohort_line(self, line)
1549
+
1550
+ def get_cohort_from_arg(self, single_cohort):
1551
+ r"""get_cohort_from_arg(Bootstrap self, string const & single_cohort)"""
1552
+ return _medpython.Bootstrap_get_cohort_from_arg(self, single_cohort)
1553
+
1554
+ def parse_cohort_file(self, cohorts_path):
1555
+ r"""parse_cohort_file(Bootstrap self, string const & cohorts_path)"""
1556
+ return _medpython.Bootstrap_parse_cohort_file(self, cohorts_path)
1557
+
1558
+ def init_from_str(self, str):
1559
+ r"""init_from_str(Bootstrap self, string const & str)"""
1560
+ return _medpython.Bootstrap_init_from_str(self, str)
1561
+
1562
+ def bootstrap_cohort(self, samples, rep_path, json_model, cohorts_path):
1563
+ r"""bootstrap_cohort(Bootstrap self, Samples samples, string const & rep_path, string const & json_model, string const & cohorts_path) -> StringBtResultMap"""
1564
+ return _medpython.Bootstrap_bootstrap_cohort(self, samples, rep_path, json_model, cohorts_path)
1565
+
1566
+ def _bootstrap(self, preds, labels):
1567
+ r"""_bootstrap(Bootstrap self, FloatVector preds, FloatVector labels) -> StringFloatMapAdaptor"""
1568
+ return _medpython.Bootstrap__bootstrap(self, preds, labels)
1569
+
1570
+ def _bootstrap_pid(self, pids, preds, labels):
1571
+ r"""_bootstrap_pid(Bootstrap self, FloatVector pids, FloatVector preds, FloatVector labels) -> StringFloatMapAdaptor"""
1572
+ return _medpython.Bootstrap__bootstrap_pid(self, pids, preds, labels)
1573
+
1574
+ sample_per_pid = property(MEDPY_GET_sample_per_pid,MEDPY_SET_sample_per_pid)
1575
+ nbootstrap = property(MEDPY_GET_nbootstrap,MEDPY_SET_nbootstrap)
1576
+ ROC_score_min_samples = property(MEDPY_GET_ROC_score_min_samples,MEDPY_SET_ROC_score_min_samples)
1577
+ ROC_score_bins = property(MEDPY_GET_ROC_score_bins,MEDPY_SET_ROC_score_bins)
1578
+ ROC_max_diff_working_point = property(MEDPY_GET_ROC_max_diff_working_point,MEDPY_SET_ROC_max_diff_working_point)
1579
+ ROC_score_resolution = property(MEDPY_GET_ROC_score_resolution,MEDPY_SET_ROC_score_resolution)
1580
+ ROC_use_score_working_points = property(MEDPY_GET_ROC_use_score_working_points,MEDPY_SET_ROC_use_score_working_points)
1581
+ ROC_working_point_FPR = property(MEDPY_GET_ROC_working_point_FPR,MEDPY_SET_ROC_working_point_FPR)
1582
+ ROC_working_point_PR = property(MEDPY_GET_ROC_working_point_PR,MEDPY_SET_ROC_working_point_PR)
1583
+ ROC_working_point_SENS = property(MEDPY_GET_ROC_working_point_SENS,MEDPY_SET_ROC_working_point_SENS)
1584
+ ROC_working_point_Score = property(MEDPY_GET_ROC_working_point_Score,MEDPY_SET_ROC_working_point_Score)
1585
+ ROC_working_point_TOPN = property(MEDPY_GET_ROC_working_point_TOPN,MEDPY_SET_ROC_working_point_TOPN)
1586
+
1587
+
1588
+ # Register Bootstrap in _medpython:
1589
+ _medpython.Bootstrap_swigregister(Bootstrap)
1590
+ class Dictionary(object):
1591
+ r"""Proxy of C++ MPDictionary class."""
1592
+
1593
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1594
+ __repr__ = _swig_repr
1595
+
1596
+ def __init__(self, rep):
1597
+ r"""__init__(Dictionary self, PidRepository rep) -> Dictionary"""
1598
+ _medpython.Dictionary_swiginit(self, _medpython.new_Dictionary(rep))
1599
+
1600
+ def section_id(self, name):
1601
+ r"""section_id(Dictionary self, string name) -> int"""
1602
+ return _medpython.Dictionary_section_id(self, name)
1603
+
1604
+ def id(self, section_id, signame):
1605
+ r"""id(Dictionary self, int section_id, string & signame) -> int"""
1606
+ return _medpython.Dictionary_id(self, section_id, signame)
1607
+
1608
+ def name(self, section_id, id):
1609
+ r"""name(Dictionary self, int section_id, int id) -> string"""
1610
+ return _medpython.Dictionary_name(self, section_id, id)
1611
+
1612
+ def prep_sets_lookup_table(self, section_id, set_names):
1613
+ r"""prep_sets_lookup_table(Dictionary self, int section_id, StringVector set_names)"""
1614
+ return _medpython.Dictionary_prep_sets_lookup_table(self, section_id, set_names)
1615
+
1616
+ def get_members_to_all_sets(self, section_id, members_array):
1617
+ r"""get_members_to_all_sets(Dictionary self, int section_id, int * members_array) -> IntVecIntMapAdaptor"""
1618
+ return _medpython.Dictionary_get_members_to_all_sets(self, section_id, members_array)
1619
+ __swig_destroy__ = _medpython.delete_Dictionary
1620
+
1621
+ # Register Dictionary in _medpython:
1622
+ _medpython.Dictionary_swigregister(Dictionary)
1623
+ class FeatureAttr(object):
1624
+ r"""Proxy of C++ MPFeatureAttr class."""
1625
+
1626
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1627
+ __repr__ = _swig_repr
1628
+
1629
+ def __init__(self):
1630
+ r"""__init__(FeatureAttr self) -> FeatureAttr"""
1631
+ _medpython.FeatureAttr_swiginit(self, _medpython.new_FeatureAttr())
1632
+ __swig_destroy__ = _medpython.delete_FeatureAttr
1633
+
1634
+ def MEDPY_SET_normalized(self, _normalized):
1635
+ r"""MEDPY_SET_normalized(FeatureAttr self, bool _normalized)"""
1636
+ return _medpython.FeatureAttr_MEDPY_SET_normalized(self, _normalized)
1637
+
1638
+ def MEDPY_GET_normalized(self):
1639
+ r"""MEDPY_GET_normalized(FeatureAttr self) -> bool"""
1640
+ return _medpython.FeatureAttr_MEDPY_GET_normalized(self)
1641
+
1642
+ def MEDPY_SET_imputed(self, _imputed):
1643
+ r"""MEDPY_SET_imputed(FeatureAttr self, bool _imputed)"""
1644
+ return _medpython.FeatureAttr_MEDPY_SET_imputed(self, _imputed)
1645
+
1646
+ def MEDPY_GET_imputed(self):
1647
+ r"""MEDPY_GET_imputed(FeatureAttr self) -> bool"""
1648
+ return _medpython.FeatureAttr_MEDPY_GET_imputed(self)
1649
+
1650
+ def MEDPY_SET_denorm_mean(self, _denorm_mean):
1651
+ r"""MEDPY_SET_denorm_mean(FeatureAttr self, float _denorm_mean)"""
1652
+ return _medpython.FeatureAttr_MEDPY_SET_denorm_mean(self, _denorm_mean)
1653
+
1654
+ def MEDPY_GET_denorm_mean(self):
1655
+ r"""MEDPY_GET_denorm_mean(FeatureAttr self) -> float"""
1656
+ return _medpython.FeatureAttr_MEDPY_GET_denorm_mean(self)
1657
+
1658
+ def MEDPY_SET_denorm_sdv(self, _denorm_sdv):
1659
+ r"""MEDPY_SET_denorm_sdv(FeatureAttr self, float _denorm_sdv)"""
1660
+ return _medpython.FeatureAttr_MEDPY_SET_denorm_sdv(self, _denorm_sdv)
1661
+
1662
+ def MEDPY_GET_denorm_sdv(self):
1663
+ r"""MEDPY_GET_denorm_sdv(FeatureAttr self) -> float"""
1664
+ return _medpython.FeatureAttr_MEDPY_GET_denorm_sdv(self)
1665
+
1666
+ def asSerializable(self):
1667
+ r"""asSerializable(FeatureAttr self) -> SerializableObject"""
1668
+ return _medpython.FeatureAttr_asSerializable(self)
1669
+
1670
+ normalized = property(MEDPY_GET_normalized,MEDPY_SET_normalized)
1671
+ imputed = property(MEDPY_GET_imputed,MEDPY_SET_imputed)
1672
+ denorm_mean = property(MEDPY_GET_denorm_mean,MEDPY_SET_denorm_mean)
1673
+ denorm_sdv = property(MEDPY_GET_denorm_sdv,MEDPY_SET_denorm_sdv)
1674
+
1675
+
1676
+ # Register FeatureAttr in _medpython:
1677
+ _medpython.FeatureAttr_swigregister(FeatureAttr)
1678
+ class StringFeatureAttrMapAdaptor(object):
1679
+ r"""Proxy of C++ MPStringFeatureAttrMapAdaptor class."""
1680
+
1681
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1682
+ __repr__ = _swig_repr
1683
+
1684
+ def __init__(self):
1685
+ r"""__init__(StringFeatureAttrMapAdaptor self) -> StringFeatureAttrMapAdaptor"""
1686
+ _medpython.StringFeatureAttrMapAdaptor_swiginit(self, _medpython.new_StringFeatureAttrMapAdaptor())
1687
+ __swig_destroy__ = _medpython.delete_StringFeatureAttrMapAdaptor
1688
+
1689
+ def __len__(self):
1690
+ r"""__len__(StringFeatureAttrMapAdaptor self) -> int"""
1691
+ return _medpython.StringFeatureAttrMapAdaptor___len__(self)
1692
+
1693
+ def __getitem__(self, key):
1694
+ r"""__getitem__(StringFeatureAttrMapAdaptor self, std::string key) -> FeatureAttr"""
1695
+ return _medpython.StringFeatureAttrMapAdaptor___getitem__(self, key)
1696
+
1697
+ def __setitem__(self, key, val):
1698
+ r"""__setitem__(StringFeatureAttrMapAdaptor self, std::string key, FeatureAttr val)"""
1699
+ return _medpython.StringFeatureAttrMapAdaptor___setitem__(self, key, val)
1700
+
1701
+ def keys(self):
1702
+ r"""keys(StringFeatureAttrMapAdaptor self) -> StringVector"""
1703
+ return _medpython.StringFeatureAttrMapAdaptor_keys(self)
1704
+
1705
+ # Register StringFeatureAttrMapAdaptor in _medpython:
1706
+ _medpython.StringFeatureAttrMapAdaptor_swigregister(StringFeatureAttrMapAdaptor)
1707
+ class Features(object):
1708
+ r"""Proxy of C++ MPFeatures class."""
1709
+
1710
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1711
+ __repr__ = _swig_repr
1712
+ __swig_destroy__ = _medpython.delete_Features
1713
+
1714
+ def __init__(self, *args):
1715
+ r"""
1716
+ __init__(Features self) -> Features
1717
+ __init__(Features self, int _time_unit) -> Features
1718
+ __init__(Features self, Features other) -> Features
1719
+ """
1720
+ _medpython.Features_swiginit(self, _medpython.new_Features(*args))
1721
+
1722
+ def MEDPY_GET_data(self):
1723
+ r"""MEDPY_GET_data(Features self) -> StringVecFloatMapAdaptor"""
1724
+ return _medpython.Features_MEDPY_GET_data(self)
1725
+
1726
+ def MEDPY_GET_weights(self):
1727
+ r"""MEDPY_GET_weights(Features self)"""
1728
+ return _medpython.Features_MEDPY_GET_weights(self)
1729
+
1730
+ def MEDPY_GET_samples(self):
1731
+ r"""MEDPY_GET_samples(Features self) -> SampleVectorAdaptor"""
1732
+ return _medpython.Features_MEDPY_GET_samples(self)
1733
+
1734
+ def MEDPY_GET_pid_pos_len(self):
1735
+ r"""MEDPY_GET_pid_pos_len(Features self) -> IntPairIntIntMapAdaptor"""
1736
+ return _medpython.Features_MEDPY_GET_pid_pos_len(self)
1737
+
1738
+ def MEDPY_GET_attributes(self):
1739
+ r"""MEDPY_GET_attributes(Features self) -> StringFeatureAttrMapAdaptor"""
1740
+ return _medpython.Features_MEDPY_GET_attributes(self)
1741
+
1742
+ def MEDPY_GET_tags(self):
1743
+ r"""MEDPY_GET_tags(Features self) -> StringUOSetStringMapAdaptor"""
1744
+ return _medpython.Features_MEDPY_GET_tags(self)
1745
+
1746
+ def MEDPY_GET_time_unit(self):
1747
+ r"""MEDPY_GET_time_unit(Features self) -> int"""
1748
+ return _medpython.Features_MEDPY_GET_time_unit(self)
1749
+
1750
+ def MEDPY_SET_time_unit(self, new_time_unit):
1751
+ r"""MEDPY_SET_time_unit(Features self, int new_time_unit)"""
1752
+ return _medpython.Features_MEDPY_SET_time_unit(self, new_time_unit)
1753
+
1754
+ @staticmethod
1755
+ def MEDPY_GET_global_serial_id_cnt():
1756
+ r"""MEDPY_GET_global_serial_id_cnt() -> int"""
1757
+ return _medpython.Features_MEDPY_GET_global_serial_id_cnt()
1758
+
1759
+ @staticmethod
1760
+ def MEDPY_SET_global_serial_id_cnt(newval):
1761
+ r"""MEDPY_SET_global_serial_id_cnt(int newval)"""
1762
+ return _medpython.Features_MEDPY_SET_global_serial_id_cnt(newval)
1763
+
1764
+ def clear(self):
1765
+ r"""clear(Features self)"""
1766
+ return _medpython.Features_clear(self)
1767
+
1768
+ def set_time_unit(self, _time_unit):
1769
+ r"""set_time_unit(Features self, int _time_unit)"""
1770
+ return _medpython.Features_set_time_unit(self, _time_unit)
1771
+
1772
+ def get_feature_names(self):
1773
+ r"""get_feature_names(Features self) -> StringVector"""
1774
+ return _medpython.Features_get_feature_names(self)
1775
+
1776
+ def get_as_matrix(self, *args):
1777
+ r"""
1778
+ get_as_matrix(Features self, Mat mat)
1779
+ get_as_matrix(Features self, Mat mat, StringVector names)
1780
+ get_as_matrix(Features self, Mat mat, StringVector names, int * int_in_buf)
1781
+ """
1782
+ return _medpython.Features_get_as_matrix(self, *args)
1783
+
1784
+ def set_as_matrix(self, mat):
1785
+ r"""set_as_matrix(Features self, Mat mat)"""
1786
+ return _medpython.Features_set_as_matrix(self, mat)
1787
+
1788
+ def append_samples(self, *args):
1789
+ r"""
1790
+ append_samples(Features self, IdSamples in_samples)
1791
+ append_samples(Features self, Samples in_samples)
1792
+ """
1793
+ return _medpython.Features_append_samples(self, *args)
1794
+
1795
+ def insert_samples(self, in_samples, index):
1796
+ r"""insert_samples(Features self, IdSamples in_samples, int index)"""
1797
+ return _medpython.Features_insert_samples(self, in_samples, index)
1798
+
1799
+ def init_all_samples(self, in_samples):
1800
+ r"""init_all_samples(Features self, IdSamplesVectorAdaptor in_samples)"""
1801
+ return _medpython.Features_init_all_samples(self, in_samples)
1802
+
1803
+ def init_pid_pos_len(self):
1804
+ r"""init_pid_pos_len(Features self)"""
1805
+ return _medpython.Features_init_pid_pos_len(self)
1806
+
1807
+ def get_pid_pos(self, pid):
1808
+ r"""get_pid_pos(Features self, int pid) -> int"""
1809
+ return _medpython.Features_get_pid_pos(self, pid)
1810
+
1811
+ def get_pid_len(self, pid):
1812
+ r"""get_pid_len(Features self, int pid) -> int"""
1813
+ return _medpython.Features_get_pid_len(self, pid)
1814
+
1815
+ def get_crc(self):
1816
+ r"""get_crc(Features self) -> unsigned int"""
1817
+ return _medpython.Features_get_crc(self)
1818
+
1819
+ def print_csv(self):
1820
+ r"""print_csv(Features self)"""
1821
+ return _medpython.Features_print_csv(self)
1822
+
1823
+ def get_samples(self, outSamples):
1824
+ r"""get_samples(Features self, Samples outSamples)"""
1825
+ return _medpython.Features_get_samples(self, outSamples)
1826
+
1827
+ def get_max_serial_id_cnt(self):
1828
+ r"""get_max_serial_id_cnt(Features self) -> int"""
1829
+ return _medpython.Features_get_max_serial_id_cnt(self)
1830
+
1831
+ def write_as_csv_mat(self, csv_fname):
1832
+ r"""write_as_csv_mat(Features self, string const & csv_fname) -> int"""
1833
+ return _medpython.Features_write_as_csv_mat(self, csv_fname)
1834
+
1835
+ def read_from_csv_mat(self, csv_fname):
1836
+ r"""read_from_csv_mat(Features self, string const & csv_fname) -> int"""
1837
+ return _medpython.Features_read_from_csv_mat(self, csv_fname)
1838
+
1839
+ def filter(self, selectedFeatures):
1840
+ r"""filter(Features self, StringVector selectedFeatures) -> int"""
1841
+ return _medpython.Features_filter(self, selectedFeatures)
1842
+
1843
+ def version(self):
1844
+ r"""version(Features self) -> int"""
1845
+ return _medpython.Features_version(self)
1846
+
1847
+ def asSerializable(self):
1848
+ r"""asSerializable(Features self) -> SerializableObject"""
1849
+ return _medpython.Features_asSerializable(self)
1850
+
1851
+ def split_by_fold(self, outMatrix, iFold, isLearning):
1852
+ r"""split_by_fold(Features self, Features outMatrix, int iFold, bool isLearning)"""
1853
+ return _medpython.Features_split_by_fold(self, outMatrix, iFold, isLearning)
1854
+
1855
+ data = property(MEDPY_GET_data,None)
1856
+ weights = property(MEDPY_GET_weights,None)
1857
+ samples = property(MEDPY_GET_samples,None)
1858
+ pid_pos_len = property(MEDPY_GET_pid_pos_len,None)
1859
+ attributes = property(MEDPY_GET_attributes,None)
1860
+ tags = property(MEDPY_GET_tags,None)
1861
+ time_unit = property(MEDPY_GET_time_unit,MEDPY_SET_time_unit)
1862
+ global_serial_id_cnt = property(MEDPY_GET_global_serial_id_cnt,MEDPY_SET_global_serial_id_cnt)
1863
+
1864
+
1865
+ # Register Features in _medpython:
1866
+ _medpython.Features_swigregister(Features)
1867
+ class RNG(object):
1868
+ r"""Proxy of C++ MPRNG class."""
1869
+
1870
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1871
+ __repr__ = _swig_repr
1872
+
1873
+ def rand(self):
1874
+ r"""rand(RNG self) -> int"""
1875
+ return _medpython.RNG_rand(self)
1876
+
1877
+ def rand30(self):
1878
+ r"""rand30(RNG self) -> int"""
1879
+ return _medpython.RNG_rand30(self)
1880
+
1881
+ def srand(self, val):
1882
+ r"""srand(RNG self, int val)"""
1883
+ return _medpython.RNG_srand(self, val)
1884
+
1885
+ def max(self):
1886
+ r"""max(RNG self) -> int"""
1887
+ return _medpython.RNG_max(self)
1888
+
1889
+ def __init__(self):
1890
+ r"""__init__(RNG self) -> RNG"""
1891
+ _medpython.RNG_swiginit(self, _medpython.new_RNG())
1892
+ __swig_destroy__ = _medpython.delete_RNG
1893
+
1894
+ # Register RNG in _medpython:
1895
+ _medpython.RNG_swigregister(RNG)
1896
+ class GlobalClass(object):
1897
+ r"""Proxy of C++ MPGlobalClass class."""
1898
+
1899
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1900
+ __repr__ = _swig_repr
1901
+
1902
+ def MEDPY_GET_default_time_unit(self):
1903
+ r"""MEDPY_GET_default_time_unit(GlobalClass self) -> int"""
1904
+ return _medpython.GlobalClass_MEDPY_GET_default_time_unit(self)
1905
+
1906
+ def MEDPY_SET_default_time_unit(self, new_val):
1907
+ r"""MEDPY_SET_default_time_unit(GlobalClass self, int new_val)"""
1908
+ return _medpython.GlobalClass_MEDPY_SET_default_time_unit(self, new_val)
1909
+
1910
+ def MEDPY_GET_default_windows_time_unit(self):
1911
+ r"""MEDPY_GET_default_windows_time_unit(GlobalClass self) -> int"""
1912
+ return _medpython.GlobalClass_MEDPY_GET_default_windows_time_unit(self)
1913
+
1914
+ def MEDPY_SET_default_windows_time_unit(self, new_val):
1915
+ r"""MEDPY_SET_default_windows_time_unit(GlobalClass self, int new_val)"""
1916
+ return _medpython.GlobalClass_MEDPY_SET_default_windows_time_unit(self, new_val)
1917
+ RNG = property(_medpython.GlobalClass_RNG_get, _medpython.GlobalClass_RNG_set, doc=r"""RNG : MPRNG""")
1918
+ logger = property(_medpython.GlobalClass_logger_get, _medpython.GlobalClass_logger_set, doc=r"""logger : MPLogger""")
1919
+ version_info = property(_medpython.GlobalClass_version_info_get, _medpython.GlobalClass_version_info_set, doc=r"""version_info : string""")
1920
+
1921
+ def __init__(self):
1922
+ r"""__init__(GlobalClass self) -> GlobalClass"""
1923
+ _medpython.GlobalClass_swiginit(self, _medpython.new_GlobalClass())
1924
+
1925
+ default_time_unit = property(MEDPY_GET_default_time_unit,MEDPY_SET_default_time_unit)
1926
+ default_windows_time_unit = property(MEDPY_GET_default_windows_time_unit,MEDPY_SET_default_windows_time_unit)
1927
+
1928
+ __swig_destroy__ = _medpython.delete_GlobalClass
1929
+
1930
+ # Register GlobalClass in _medpython:
1931
+ _medpython.GlobalClass_swigregister(GlobalClass)
1932
+ class CommonLib(object):
1933
+ r"""Proxy of C++ MPCommonLib class."""
1934
+
1935
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1936
+ __repr__ = _swig_repr
1937
+
1938
+ @staticmethod
1939
+ def print_auc_performance(samples, folds, outFile):
1940
+ r"""print_auc_performance(Samples samples, int * folds, string outFile)"""
1941
+ return _medpython.CommonLib_print_auc_performance(samples, folds, outFile)
1942
+
1943
+ @staticmethod
1944
+ def shuffleMatrix(matrix):
1945
+ r"""shuffleMatrix(Features matrix)"""
1946
+ return _medpython.CommonLib_shuffleMatrix(matrix)
1947
+
1948
+ @staticmethod
1949
+ def read_predictor_from_file(pred, predictorFile):
1950
+ r"""read_predictor_from_file(Predictor pred, string predictorFile)"""
1951
+ return _medpython.CommonLib_read_predictor_from_file(pred, predictorFile)
1952
+
1953
+ def __init__(self):
1954
+ r"""__init__(CommonLib self) -> CommonLib"""
1955
+ _medpython.CommonLib_swiginit(self, _medpython.new_CommonLib())
1956
+ __swig_destroy__ = _medpython.delete_CommonLib
1957
+
1958
+ # Register CommonLib in _medpython:
1959
+ _medpython.CommonLib_swigregister(CommonLib)
1960
+ class Logger(object):
1961
+ r"""Proxy of C++ MPLogger class."""
1962
+
1963
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1964
+ __repr__ = _swig_repr
1965
+
1966
+ def init_all_levels(self, level):
1967
+ r"""init_all_levels(Logger self, int level)"""
1968
+ return _medpython.Logger_init_all_levels(self, level)
1969
+
1970
+ def init_all_files(self, fname):
1971
+ r"""init_all_files(Logger self, string const & fname) -> int"""
1972
+ return _medpython.Logger_init_all_files(self, fname)
1973
+
1974
+ def init_level(self, section, level):
1975
+ r"""init_level(Logger self, int section, int level)"""
1976
+ return _medpython.Logger_init_level(self, section, level)
1977
+
1978
+ def init_file(self, section, fname):
1979
+ r"""init_file(Logger self, int section, string const & fname) -> int"""
1980
+ return _medpython.Logger_init_file(self, section, fname)
1981
+
1982
+ def add_file(self, section, fname):
1983
+ r"""add_file(Logger self, int section, string const & fname) -> int"""
1984
+ return _medpython.Logger_add_file(self, section, fname)
1985
+
1986
+ def init_out(self, *args):
1987
+ r"""init_out(Logger self, string const & fname="")"""
1988
+ return _medpython.Logger_init_out(self, *args)
1989
+
1990
+ def __init__(self):
1991
+ r"""__init__(Logger self) -> Logger"""
1992
+ _medpython.Logger_swiginit(self, _medpython.new_Logger())
1993
+ __swig_destroy__ = _medpython.delete_Logger
1994
+
1995
+ # Register Logger in _medpython:
1996
+ _medpython.Logger_swigregister(Logger)
1997
+ cvar = _medpython.cvar
1998
+ Logger.LOG_APP_ = _medpython.cvar.Logger_LOG_APP_
1999
+ Logger.LOG_DEF_ = _medpython.cvar.Logger_LOG_DEF_
2000
+ Logger.LOG_INFRA_ = _medpython.cvar.Logger_LOG_INFRA_
2001
+ Logger.LOG_REP_ = _medpython.cvar.Logger_LOG_REP_
2002
+ Logger.LOG_INDEX_ = _medpython.cvar.Logger_LOG_INDEX_
2003
+ Logger.LOG_DICT_ = _medpython.cvar.Logger_LOG_DICT_
2004
+ Logger.LOG_SIG_ = _medpython.cvar.Logger_LOG_SIG_
2005
+ Logger.LOG_CONVERT_ = _medpython.cvar.Logger_LOG_CONVERT_
2006
+ Logger.LOG_MED_UTILS_ = _medpython.cvar.Logger_LOG_MED_UTILS_
2007
+ Logger.LOG_MEDMAT_ = _medpython.cvar.Logger_LOG_MEDMAT_
2008
+ Logger.LOG_MEDIO_ = _medpython.cvar.Logger_LOG_MEDIO_
2009
+ Logger.LOG_DATA_STRUCTURES_ = _medpython.cvar.Logger_LOG_DATA_STRUCTURES_
2010
+ Logger.LOG_MEDALGO_ = _medpython.cvar.Logger_LOG_MEDALGO_
2011
+ Logger.LOG_MEDFEAT_ = _medpython.cvar.Logger_LOG_MEDFEAT_
2012
+ Logger.LOG_MEDSTAT_ = _medpython.cvar.Logger_LOG_MEDSTAT_
2013
+ Logger.LOG_REPCLEANER_ = _medpython.cvar.Logger_LOG_REPCLEANER_
2014
+ Logger.LOG_FTRGNRTR_ = _medpython.cvar.Logger_LOG_FTRGNRTR_
2015
+ Logger.LOG_CV_ = _medpython.cvar.Logger_LOG_CV_
2016
+ Logger.LOG_FEATCLEANER_ = _medpython.cvar.Logger_LOG_FEATCLEANER_
2017
+ Logger.LOG_VALCLNR_ = _medpython.cvar.Logger_LOG_VALCLNR_
2018
+ Logger.MED_SAMPLES_CV_ = _medpython.cvar.Logger_MED_SAMPLES_CV_
2019
+ Logger.LOG_FEAT_SELECTOR_ = _medpython.cvar.Logger_LOG_FEAT_SELECTOR_
2020
+ Logger.LOG_SMPL_FILTER_ = _medpython.cvar.Logger_LOG_SMPL_FILTER_
2021
+ Logger.LOG_SRL_ = _medpython.cvar.Logger_LOG_SRL_
2022
+ Logger.LOG_MED_MODEL_ = _medpython.cvar.Logger_LOG_MED_MODEL_
2023
+ Logger.LOG_REPTYPE_ = _medpython.cvar.Logger_LOG_REPTYPE_
2024
+ Logger.MAX_LOG_SECTION_ = _medpython.cvar.Logger_MAX_LOG_SECTION_
2025
+ Logger.NO_LOG_LEVEL_ = _medpython.cvar.Logger_NO_LOG_LEVEL_
2026
+ Logger.MIN_LOG_LEVEL_ = _medpython.cvar.Logger_MIN_LOG_LEVEL_
2027
+ Logger.DEBUG_LOG_LEVEL_ = _medpython.cvar.Logger_DEBUG_LOG_LEVEL_
2028
+ Logger.LOG_DEF_LEVEL_ = _medpython.cvar.Logger_LOG_DEF_LEVEL_
2029
+ Logger.MAX_LOG_LEVEL_ = _medpython.cvar.Logger_MAX_LOG_LEVEL_
2030
+ Logger.VERBOSE_LOG_LEVEL_ = _medpython.cvar.Logger_VERBOSE_LOG_LEVEL_
2031
+
2032
+ class Mat(object):
2033
+ r"""Proxy of C++ MPMat class."""
2034
+
2035
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2036
+ __repr__ = _swig_repr
2037
+
2038
+ def __init__(self, *args):
2039
+ r"""
2040
+ __init__(Mat self) -> Mat
2041
+ __init__(Mat self, int n_rows, int n_cols) -> Mat
2042
+ __init__(Mat self, float * IN_ARRAY2) -> Mat
2043
+ """
2044
+ _medpython.Mat_swiginit(self, _medpython.new_Mat(*args))
2045
+ __swig_destroy__ = _medpython.delete_Mat
2046
+
2047
+ def get_numpy_copy(self):
2048
+ r"""get_numpy_copy(Mat self)"""
2049
+ return _medpython.Mat_get_numpy_copy(self)
2050
+
2051
+ def get_numpy_view_unsafe(self):
2052
+ r"""get_numpy_view_unsafe(Mat self)"""
2053
+ return _medpython.Mat_get_numpy_view_unsafe(self)
2054
+
2055
+ def test(self, n_rows, n_cols):
2056
+ r"""test(Mat self, int n_rows, int n_cols)"""
2057
+ return _medpython.Mat_test(self, n_rows, n_cols)
2058
+
2059
+ def load_numpy(self, IN_ARRAY2):
2060
+ r"""load_numpy(Mat self, float * IN_ARRAY2)"""
2061
+ return _medpython.Mat_load_numpy(self, IN_ARRAY2)
2062
+
2063
+ @staticmethod
2064
+ def MEDPY_GET_Normalize_Cols():
2065
+ r"""MEDPY_GET_Normalize_Cols() -> int"""
2066
+ return _medpython.Mat_MEDPY_GET_Normalize_Cols()
2067
+
2068
+ @staticmethod
2069
+ def MEDPY_GET_Normalize_Rows():
2070
+ r"""MEDPY_GET_Normalize_Rows() -> int"""
2071
+ return _medpython.Mat_MEDPY_GET_Normalize_Rows()
2072
+
2073
+ def MEDPY_GET_nrows(self):
2074
+ r"""MEDPY_GET_nrows(Mat self) -> int"""
2075
+ return _medpython.Mat_MEDPY_GET_nrows(self)
2076
+
2077
+ def MEDPY_GET_ncols(self):
2078
+ r"""MEDPY_GET_ncols(Mat self) -> int"""
2079
+ return _medpython.Mat_MEDPY_GET_ncols(self)
2080
+
2081
+ def __len__(self):
2082
+ r"""__len__(Mat self) -> unsigned long long"""
2083
+ return _medpython.Mat___len__(self)
2084
+
2085
+ def is_valid(self, output=False):
2086
+ r"""is_valid(Mat self, bool output=False) -> bool"""
2087
+ return _medpython.Mat_is_valid(self, output)
2088
+
2089
+ def __getitem__(self, index):
2090
+ r"""__getitem__(Mat self, IntVector index) -> float"""
2091
+ return _medpython.Mat___getitem__(self, index)
2092
+
2093
+ def __setitem__(self, index, val):
2094
+ r"""__setitem__(Mat self, IntVector index, float val)"""
2095
+ return _medpython.Mat___setitem__(self, index, val)
2096
+
2097
+ def MEDPY_GET_row_ids(self):
2098
+ r"""MEDPY_GET_row_ids(Mat self)"""
2099
+ return _medpython.Mat_MEDPY_GET_row_ids(self)
2100
+
2101
+ def MEDPY_SET_row_ids(self, row_ids_buf):
2102
+ r"""MEDPY_SET_row_ids(Mat self, int * row_ids_buf)"""
2103
+ return _medpython.Mat_MEDPY_SET_row_ids(self, row_ids_buf)
2104
+
2105
+ def MEDPY_GET_signals(self):
2106
+ r"""MEDPY_GET_signals(Mat self) -> StringVector"""
2107
+ return _medpython.Mat_MEDPY_GET_signals(self)
2108
+
2109
+ def MEDPY_GET_avg(self):
2110
+ r"""MEDPY_GET_avg(Mat self)"""
2111
+ return _medpython.Mat_MEDPY_GET_avg(self)
2112
+
2113
+ def MEDPY_GET_std(self):
2114
+ r"""MEDPY_GET_std(Mat self)"""
2115
+ return _medpython.Mat_MEDPY_GET_std(self)
2116
+
2117
+ def MEDPY_GET_normalized_flag(self):
2118
+ r"""MEDPY_GET_normalized_flag(Mat self) -> int"""
2119
+ return _medpython.Mat_MEDPY_GET_normalized_flag(self)
2120
+
2121
+ def MEDPY_SET_normalized_flag(self, newval):
2122
+ r"""MEDPY_SET_normalized_flag(Mat self, int newval)"""
2123
+ return _medpython.Mat_MEDPY_SET_normalized_flag(self, newval)
2124
+
2125
+ def MEDPY_GET_transposed_flag(self):
2126
+ r"""MEDPY_GET_transposed_flag(Mat self) -> int"""
2127
+ return _medpython.Mat_MEDPY_GET_transposed_flag(self)
2128
+
2129
+ def MEDPY_SET_transposed_flag(self, newval):
2130
+ r"""MEDPY_SET_transposed_flag(Mat self, int newval)"""
2131
+ return _medpython.Mat_MEDPY_SET_transposed_flag(self, newval)
2132
+
2133
+ def MEDPY_GET_missing_value(self):
2134
+ r"""MEDPY_GET_missing_value(Mat self) -> float"""
2135
+ return _medpython.Mat_MEDPY_GET_missing_value(self)
2136
+
2137
+ def MEDPY_SET_missing_value(self, newval):
2138
+ r"""MEDPY_SET_missing_value(Mat self, float newval)"""
2139
+ return _medpython.Mat_MEDPY_SET_missing_value(self, newval)
2140
+
2141
+ def zero(self):
2142
+ r"""zero(Mat self)"""
2143
+ return _medpython.Mat_zero(self)
2144
+
2145
+ def set_val(self, val):
2146
+ r"""set_val(Mat self, float val)"""
2147
+ return _medpython.Mat_set_val(self, val)
2148
+
2149
+ def clear(self):
2150
+ r"""clear(Mat self)"""
2151
+ return _medpython.Mat_clear(self)
2152
+
2153
+ def resize(self, n_rows, n_cols):
2154
+ r"""resize(Mat self, int n_rows, int n_cols)"""
2155
+ return _medpython.Mat_resize(self, n_rows, n_cols)
2156
+
2157
+ def read_from_bin_file(self, fname):
2158
+ r"""read_from_bin_file(Mat self, string const & fname) -> int"""
2159
+ return _medpython.Mat_read_from_bin_file(self, fname)
2160
+
2161
+ def write_to_bin_file(self, fname):
2162
+ r"""write_to_bin_file(Mat self, string const & fname) -> int"""
2163
+ return _medpython.Mat_write_to_bin_file(self, fname)
2164
+
2165
+ def write_to_csv_file(self, fname):
2166
+ r"""write_to_csv_file(Mat self, string const & fname) -> int"""
2167
+ return _medpython.Mat_write_to_csv_file(self, fname)
2168
+
2169
+ def read_from_csv_file(self, fname, titles_line_flag):
2170
+ r"""read_from_csv_file(Mat self, string const & fname, int titles_line_flag) -> int"""
2171
+ return _medpython.Mat_read_from_csv_file(self, fname, titles_line_flag)
2172
+
2173
+ def transpose(self):
2174
+ r"""transpose(Mat self)"""
2175
+ return _medpython.Mat_transpose(self)
2176
+
2177
+ def get_sub_mat(self, rows_to_take, cols_to_take):
2178
+ r"""get_sub_mat(Mat self, IntVector rows_to_take, IntVector cols_to_take)"""
2179
+ return _medpython.Mat_get_sub_mat(self, rows_to_take, cols_to_take)
2180
+
2181
+ def get_sub_mat_by_flags(self, rows_to_take_flag, cols_to_take_flag):
2182
+ r"""get_sub_mat_by_flags(Mat self, IntVector rows_to_take_flag, IntVector cols_to_take_flag)"""
2183
+ return _medpython.Mat_get_sub_mat_by_flags(self, rows_to_take_flag, cols_to_take_flag)
2184
+
2185
+ def add_rows(self, *args):
2186
+ r"""
2187
+ add_rows(Mat self, Mat m_add)
2188
+ add_rows(Mat self, float * m_add)
2189
+ """
2190
+ return _medpython.Mat_add_rows(self, *args)
2191
+
2192
+ def add_cols(self, *args):
2193
+ r"""
2194
+ add_cols(Mat self, Mat m_add)
2195
+ add_cols(Mat self, float * m_add)
2196
+ """
2197
+ return _medpython.Mat_add_cols(self, *args)
2198
+
2199
+ def get_row(self, i_row):
2200
+ r"""get_row(Mat self, int i_row)"""
2201
+ return _medpython.Mat_get_row(self, i_row)
2202
+
2203
+ def get_col(self, i_col):
2204
+ r"""get_col(Mat self, int i_col)"""
2205
+ return _medpython.Mat_get_col(self, i_col)
2206
+
2207
+ def normalize(self, *args):
2208
+ r"""
2209
+ normalize(Mat self, int norm_type, float * wgts)
2210
+ normalize(Mat self, int norm_type=Normalize_Cols)
2211
+ normalize(Mat self, float * external_avg, float * external_std, int norm_type=1)
2212
+ """
2213
+ return _medpython.Mat_normalize(self, *args)
2214
+
2215
+ def get_cols_avg_std(self):
2216
+ r"""get_cols_avg_std(Mat self)"""
2217
+ return _medpython.Mat_get_cols_avg_std(self)
2218
+
2219
+ def set_signals(self, sigs):
2220
+ r"""set_signals(Mat self, StringVector sigs)"""
2221
+ return _medpython.Mat_set_signals(self, sigs)
2222
+
2223
+ def load_transposed(self, IN_ARRAY2):
2224
+ r"""load_transposed(Mat self, float * IN_ARRAY2)"""
2225
+ return _medpython.Mat_load_transposed(self, IN_ARRAY2)
2226
+
2227
+ def load(self, *args):
2228
+ r"""
2229
+ load(Mat self, float * IN_ARRAY2)
2230
+ load(Mat self, Mat x)
2231
+ """
2232
+ return _medpython.Mat_load(self, *args)
2233
+
2234
+ def asSerializable(self):
2235
+ r"""asSerializable(Mat self) -> SerializableObject"""
2236
+ return _medpython.Mat_asSerializable(self)
2237
+
2238
+ Normalize_Cols = property(MEDPY_GET_Normalize_Cols,None)
2239
+ Normalize_Rows = property(MEDPY_GET_Normalize_Rows,None)
2240
+ nrows = property(MEDPY_GET_nrows,None)
2241
+ ncols = property(MEDPY_GET_ncols,None)
2242
+ row_ids = property(MEDPY_GET_row_ids,MEDPY_SET_row_ids)
2243
+ signals = property(MEDPY_GET_signals,None)
2244
+ avg = property(MEDPY_GET_avg,None)
2245
+ std = property(MEDPY_GET_std,None)
2246
+ normalized_flag = property(MEDPY_GET_normalized_flag,MEDPY_SET_normalized_flag)
2247
+ transposed_flag = property(MEDPY_GET_transposed_flag,MEDPY_SET_transposed_flag)
2248
+ missing_value = property(MEDPY_GET_missing_value,MEDPY_SET_missing_value)
2249
+
2250
+
2251
+ # Register Mat in _medpython:
2252
+ _medpython.Mat_swigregister(Mat)
2253
+ Mat.Normalize_Cols = _medpython.cvar.Mat_Normalize_Cols
2254
+ Mat.Normalize_Rows = _medpython.cvar.Mat_Normalize_Rows
2255
+ Mat.MISSING_VALUE = _medpython.cvar.Mat_MISSING_VALUE
2256
+
2257
+ class ModelStage(object):
2258
+ r"""Proxy of C++ MPModelStage class."""
2259
+
2260
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2261
+ __repr__ = _swig_repr
2262
+
2263
+ def __init__(self):
2264
+ r"""__init__(ModelStage self) -> ModelStage"""
2265
+ _medpython.ModelStage_swiginit(self, _medpython.new_ModelStage())
2266
+ __swig_destroy__ = _medpython.delete_ModelStage
2267
+
2268
+ # Register ModelStage in _medpython:
2269
+ _medpython.ModelStage_swigregister(ModelStage)
2270
+ ModelStage.LEARN_REP_PROCESSORS = _medpython.cvar.ModelStage_LEARN_REP_PROCESSORS
2271
+ ModelStage.LEARN_FTR_GENERATORS = _medpython.cvar.ModelStage_LEARN_FTR_GENERATORS
2272
+ ModelStage.APPLY_FTR_GENERATORS = _medpython.cvar.ModelStage_APPLY_FTR_GENERATORS
2273
+ ModelStage.LEARN_FTR_PROCESSORS = _medpython.cvar.ModelStage_LEARN_FTR_PROCESSORS
2274
+ ModelStage.APPLY_FTR_PROCESSORS = _medpython.cvar.ModelStage_APPLY_FTR_PROCESSORS
2275
+ ModelStage.LEARN_PREDICTOR = _medpython.cvar.ModelStage_LEARN_PREDICTOR
2276
+ ModelStage.APPLY_PREDICTOR = _medpython.cvar.ModelStage_APPLY_PREDICTOR
2277
+ ModelStage.INSERT_PREDS = _medpython.cvar.ModelStage_INSERT_PREDS
2278
+ ModelStage.LEARN_POST_PROCESSORS = _medpython.cvar.ModelStage_LEARN_POST_PROCESSORS
2279
+ ModelStage.APPLY_POST_PROCESSORS = _medpython.cvar.ModelStage_APPLY_POST_PROCESSORS
2280
+ ModelStage.END = _medpython.cvar.ModelStage_END
2281
+
2282
+ class Model(object):
2283
+ r"""Proxy of C++ MPModel class."""
2284
+
2285
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2286
+ __repr__ = _swig_repr
2287
+
2288
+ def __init__(self):
2289
+ r"""__init__(Model self) -> Model"""
2290
+ _medpython.Model_swiginit(self, _medpython.new_Model())
2291
+ __swig_destroy__ = _medpython.delete_Model
2292
+
2293
+ def init_from_json_file(self, fname):
2294
+ r"""init_from_json_file(Model self, std::string const & fname)"""
2295
+ return _medpython.Model_init_from_json_file(self, fname)
2296
+
2297
+ def init_from_json_file_with_alterations(self, fname, json_alt):
2298
+ r"""init_from_json_file_with_alterations(Model self, std::string const & fname, StringVector json_alt) -> StringVector"""
2299
+ return _medpython.Model_init_from_json_file_with_alterations(self, fname, json_alt)
2300
+
2301
+ def add_pre_processors_json_string_to_model(self, in_json, fname, add_rep_first):
2302
+ r"""add_pre_processors_json_string_to_model(Model self, std::string const & in_json, std::string const & fname, bool add_rep_first)"""
2303
+ return _medpython.Model_add_pre_processors_json_string_to_model(self, in_json, fname, add_rep_first)
2304
+
2305
+ def add_post_processors_json_string_to_model(self, in_json, fname):
2306
+ r"""add_post_processors_json_string_to_model(Model self, std::string const & in_json, std::string const & fname)"""
2307
+ return _medpython.Model_add_post_processors_json_string_to_model(self, in_json, fname)
2308
+
2309
+ def get_required_signal_names(self):
2310
+ r"""get_required_signal_names(Model self) -> StringVector"""
2311
+ return _medpython.Model_get_required_signal_names(self)
2312
+
2313
+ def learn(self, *args):
2314
+ r"""
2315
+ learn(Model self, PidRepository rep, Samples samples) -> int
2316
+ learn(Model self, PidRepository rep, Samples samples, int start_stage, int end_stage) -> int
2317
+ """
2318
+ return _medpython.Model_learn(self, *args)
2319
+
2320
+ def apply(self, *args):
2321
+ r"""
2322
+ apply(Model self, PidRepository rep, Samples samples) -> int
2323
+ apply(Model self, PidRepository rep, Samples samples, int start_stage, int end_stage) -> int
2324
+ """
2325
+ return _medpython.Model_apply(self, *args)
2326
+
2327
+ def write_to_file(self, fname):
2328
+ r"""write_to_file(Model self, std::string const & fname) -> int"""
2329
+ return _medpython.Model_write_to_file(self, fname)
2330
+
2331
+ def read_from_file(self, fname):
2332
+ r"""read_from_file(Model self, std::string const & fname) -> int"""
2333
+ return _medpython.Model_read_from_file(self, fname)
2334
+
2335
+ def MEDPY_GET_features(self):
2336
+ r"""MEDPY_GET_features(Model self) -> Features"""
2337
+ return _medpython.Model_MEDPY_GET_features(self)
2338
+
2339
+ def MEDPY_GET_predictor(self):
2340
+ r"""MEDPY_GET_predictor(Model self) -> Predictor"""
2341
+ return _medpython.Model_MEDPY_GET_predictor(self)
2342
+
2343
+ def clear(self):
2344
+ r"""clear(Model self)"""
2345
+ return _medpython.Model_clear(self)
2346
+
2347
+ def MEDPY_GET_verbosity(self):
2348
+ r"""MEDPY_GET_verbosity(Model self) -> int"""
2349
+ return _medpython.Model_MEDPY_GET_verbosity(self)
2350
+
2351
+ def MEDPY_SET_verbosity(self, new_vval):
2352
+ r"""MEDPY_SET_verbosity(Model self, int new_vval)"""
2353
+ return _medpython.Model_MEDPY_SET_verbosity(self, new_vval)
2354
+
2355
+ def add_feature_generator(self, name, signal):
2356
+ r"""add_feature_generator(Model self, std::string & name, std::string & signal)"""
2357
+ return _medpython.Model_add_feature_generator(self, name, signal)
2358
+
2359
+ def add_feature_generators(self, *args):
2360
+ r"""
2361
+ add_feature_generators(Model self, std::string & name, StringVector signals)
2362
+ add_feature_generators(Model self, std::string & name, StringVector signals, string init_string)
2363
+ add_feature_generators(Model self, std::string & name, std::string & signal, std::string init_string)
2364
+ """
2365
+ return _medpython.Model_add_feature_generators(self, *args)
2366
+
2367
+ def add_age(self):
2368
+ r"""add_age(Model self)"""
2369
+ return _medpython.Model_add_age(self)
2370
+
2371
+ def add_gender(self):
2372
+ r"""add_gender(Model self)"""
2373
+ return _medpython.Model_add_gender(self)
2374
+
2375
+ def get_all_features_names(self, feat_names, before_process_set):
2376
+ r"""get_all_features_names(Model self, StringVector feat_names, int before_process_set)"""
2377
+ return _medpython.Model_get_all_features_names(self, feat_names, before_process_set)
2378
+
2379
+ def add_normalizers(self, *args):
2380
+ r"""
2381
+ add_normalizers(Model self)
2382
+ add_normalizers(Model self, std::string init_string)
2383
+ add_normalizers(Model self, StringVector features)
2384
+ add_normalizers(Model self, StringVector features, std::string init_string)
2385
+ """
2386
+ return _medpython.Model_add_normalizers(self, *args)
2387
+
2388
+ def add_imputers(self, *args):
2389
+ r"""
2390
+ add_imputers(Model self)
2391
+ add_imputers(Model self, std::string init_string)
2392
+ add_imputers(Model self, StringVector features)
2393
+ add_imputers(Model self, StringVector features, std::string init_string)
2394
+ """
2395
+ return _medpython.Model_add_imputers(self, *args)
2396
+
2397
+ def add_rep_processor_to_set(self, i_set, init_string):
2398
+ r"""add_rep_processor_to_set(Model self, int i_set, std::string const & init_string)"""
2399
+ return _medpython.Model_add_rep_processor_to_set(self, i_set, init_string)
2400
+
2401
+ def add_feature_generator_to_set(self, i_set, init_string):
2402
+ r"""add_feature_generator_to_set(Model self, int i_set, std::string const & init_string)"""
2403
+ return _medpython.Model_add_feature_generator_to_set(self, i_set, init_string)
2404
+
2405
+ def add_feature_processor_to_set(self, i_set, duplicate, init_string):
2406
+ r"""add_feature_processor_to_set(Model self, int i_set, int duplicate, std::string const & init_string)"""
2407
+ return _medpython.Model_add_feature_processor_to_set(self, i_set, duplicate, init_string)
2408
+
2409
+ def add_process_to_set(self, *args):
2410
+ r"""
2411
+ add_process_to_set(Model self, int i_set, int duplicate, std::string const & init_string)
2412
+ add_process_to_set(Model self, int i_set, std::string const & init_string)
2413
+ """
2414
+ return _medpython.Model_add_process_to_set(self, *args)
2415
+
2416
+ def make_predictor(self, name):
2417
+ r"""make_predictor(Model self, std::string name)"""
2418
+ return _medpython.Model_make_predictor(self, name)
2419
+
2420
+ def set_predictor(self, *args):
2421
+ r"""
2422
+ set_predictor(Model self, Predictor _predictor)
2423
+ set_predictor(Model self, std::string name, std::string init_string)
2424
+ """
2425
+ return _medpython.Model_set_predictor(self, *args)
2426
+
2427
+ def collect_and_add_virtual_signals(self, rep):
2428
+ r"""collect_and_add_virtual_signals(Model self, PidRepository rep) -> int"""
2429
+ return _medpython.Model_collect_and_add_virtual_signals(self, rep)
2430
+
2431
+ def quick_learn_rep_processors(self, rep, samples):
2432
+ r"""quick_learn_rep_processors(Model self, PidRepository rep, Samples samples) -> int"""
2433
+ return _medpython.Model_quick_learn_rep_processors(self, rep, samples)
2434
+
2435
+ def learn_rep_processors(self, rep, samples):
2436
+ r"""learn_rep_processors(Model self, PidRepository rep, Samples samples) -> int"""
2437
+ return _medpython.Model_learn_rep_processors(self, rep, samples)
2438
+
2439
+ def filter_rep_processors(self):
2440
+ r"""filter_rep_processors(Model self)"""
2441
+ return _medpython.Model_filter_rep_processors(self)
2442
+
2443
+ def learn_feature_generators(self, rep, learn_samples):
2444
+ r"""learn_feature_generators(Model self, PidRepository rep, Samples learn_samples) -> int"""
2445
+ return _medpython.Model_learn_feature_generators(self, rep, learn_samples)
2446
+
2447
+ def generate_all_features(self, rep, samples, features, req_feature_generators):
2448
+ r"""generate_all_features(Model self, PidRepository rep, Samples samples, Features features, StringVector req_feature_generators) -> int"""
2449
+ return _medpython.Model_generate_all_features(self, rep, samples, features, req_feature_generators)
2450
+
2451
+ def learn_and_apply_feature_processors(self, features):
2452
+ r"""learn_and_apply_feature_processors(Model self, Features features) -> int"""
2453
+ return _medpython.Model_learn_and_apply_feature_processors(self, features)
2454
+
2455
+ def learn_feature_processors(self, features):
2456
+ r"""learn_feature_processors(Model self, Features features) -> int"""
2457
+ return _medpython.Model_learn_feature_processors(self, features)
2458
+
2459
+ def apply_feature_processors(self, features, learning):
2460
+ r"""apply_feature_processors(Model self, Features features, bool learning) -> int"""
2461
+ return _medpython.Model_apply_feature_processors(self, features, learning)
2462
+
2463
+ def fit_for_repository(self, rep):
2464
+ r"""fit_for_repository(Model self, PidRepository rep)"""
2465
+ return _medpython.Model_fit_for_repository(self, rep)
2466
+
2467
+ def calc_contribs(self, mat, mat_out):
2468
+ r"""calc_contribs(Model self, Mat mat, Mat mat_out)"""
2469
+ return _medpython.Model_calc_contribs(self, mat, mat_out)
2470
+
2471
+ def calc_feature_contribs_conditional(self, mat_x_in, features_cond_string, features_cond_float, mat_x_out, mat_contribs):
2472
+ r"""calc_feature_contribs_conditional(Model self, Mat mat_x_in, std::string const & features_cond_string, float features_cond_float, Mat mat_x_out, Mat mat_contribs)"""
2473
+ return _medpython.Model_calc_feature_contribs_conditional(self, mat_x_in, features_cond_string, features_cond_float, mat_x_out, mat_contribs)
2474
+
2475
+ def dprint_process(self, pref, rp_flag, fg_flag, fp_flag, pp_flag, predictor_type):
2476
+ r"""dprint_process(Model self, std::string const & pref, int rp_flag, int fg_flag, int fp_flag, bool pp_flag, bool predictor_type)"""
2477
+ return _medpython.Model_dprint_process(self, pref, rp_flag, fg_flag, fp_flag, pp_flag, predictor_type)
2478
+
2479
+ def write_feature_matrix(self, mat_fname):
2480
+ r"""write_feature_matrix(Model self, std::string const mat_fname) -> int"""
2481
+ return _medpython.Model_write_feature_matrix(self, mat_fname)
2482
+
2483
+ def asSerializable(self):
2484
+ r"""asSerializable(Model self) -> SerializableObject"""
2485
+ return _medpython.Model_asSerializable(self)
2486
+
2487
+ def apply_model_change(self, change_json_content):
2488
+ r"""apply_model_change(Model self, std::string const & change_json_content)"""
2489
+ return _medpython.Model_apply_model_change(self, change_json_content)
2490
+
2491
+ def get_model_weights_info(self):
2492
+ r"""get_model_weights_info(Model self) -> std::string"""
2493
+ return _medpython.Model_get_model_weights_info(self)
2494
+
2495
+ def get_model_version_info(self):
2496
+ r"""get_model_version_info(Model self) -> std::string"""
2497
+ return _medpython.Model_get_model_version_info(self)
2498
+
2499
+ def get_model_processors_info(self):
2500
+ r"""get_model_processors_info(Model self) -> std::string"""
2501
+ return _medpython.Model_get_model_processors_info(self)
2502
+
2503
+ def train_rep_processor_by_index(self, index, rep, samples):
2504
+ r"""train_rep_processor_by_index(Model self, int index, PidRepository rep, Samples samples)"""
2505
+ return _medpython.Model_train_rep_processor_by_index(self, index, rep, samples)
2506
+
2507
+ def print_rep_processor_by_index(self, index):
2508
+ r"""print_rep_processor_by_index(Model self, int index) -> std::string"""
2509
+ return _medpython.Model_print_rep_processor_by_index(self, index)
2510
+
2511
+ def delete_rep_processor_by_index(self, index):
2512
+ r"""delete_rep_processor_by_index(Model self, int index)"""
2513
+ return _medpython.Model_delete_rep_processor_by_index(self, index)
2514
+
2515
+ def print_feature_generator_by_index(self, index):
2516
+ r"""print_feature_generator_by_index(Model self, int index) -> std::string"""
2517
+ return _medpython.Model_print_feature_generator_by_index(self, index)
2518
+
2519
+ def print_feature_processor_by_index(self, index):
2520
+ r"""print_feature_processor_by_index(Model self, int index) -> std::string"""
2521
+ return _medpython.Model_print_feature_processor_by_index(self, index)
2522
+
2523
+ def delete_feature_processor_by_index(self, index):
2524
+ r"""delete_feature_processor_by_index(Model self, int index)"""
2525
+ return _medpython.Model_delete_feature_processor_by_index(self, index)
2526
+
2527
+ def print_post_processor_by_index(self, index):
2528
+ r"""print_post_processor_by_index(Model self, int index) -> std::string"""
2529
+ return _medpython.Model_print_post_processor_by_index(self, index)
2530
+
2531
+ def delete_post_processor_by_index(self, index):
2532
+ r"""delete_post_processor_by_index(Model self, int index)"""
2533
+ return _medpython.Model_delete_post_processor_by_index(self, index)
2534
+
2535
+ def train_post_processor_by_index(self, index, features):
2536
+ r"""train_post_processor_by_index(Model self, int index, Features features)"""
2537
+ return _medpython.Model_train_post_processor_by_index(self, index, features)
2538
+
2539
+ def debug_rep_processor_signal(self, rep, signal_name, pid, prediction_time):
2540
+ r"""debug_rep_processor_signal(Model self, PidRepository rep, std::string & signal_name, int pid, int prediction_time) -> SigVectorAdaptor"""
2541
+ return _medpython.Model_debug_rep_processor_signal(self, rep, signal_name, pid, prediction_time)
2542
+
2543
+ features = property(MEDPY_GET_features,None)
2544
+ predictor = property(MEDPY_GET_predictor,None)
2545
+ verbosity = property(MEDPY_GET_verbosity,MEDPY_SET_verbosity)
2546
+
2547
+
2548
+ # Register Model in _medpython:
2549
+ _medpython.Model_swigregister(Model)
2550
+ class PandasAdaptor(object):
2551
+ r"""Proxy of C++ MPPandasAdaptor class."""
2552
+
2553
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2554
+ __repr__ = _swig_repr
2555
+ type_requirements = property(_medpython.PandasAdaptor_type_requirements_get, _medpython.PandasAdaptor_type_requirements_set, doc=r"""type_requirements : MPStringStringMapAdaptor""")
2556
+
2557
+ def keys(self):
2558
+ r"""keys(PandasAdaptor self) -> StringVector"""
2559
+ return _medpython.PandasAdaptor_keys(self)
2560
+ __swig_destroy__ = _medpython.delete_PandasAdaptor
2561
+
2562
+ def clear(self):
2563
+ r"""clear(PandasAdaptor self)"""
2564
+ return _medpython.PandasAdaptor_clear(self)
2565
+
2566
+ def export_column(self, key):
2567
+ r"""export_column(PandasAdaptor self, std::string const & key)"""
2568
+ return _medpython.PandasAdaptor_export_column(self, key)
2569
+
2570
+ def __getitem__(self, key):
2571
+ r"""__getitem__(PandasAdaptor self, std::string const & key)"""
2572
+ return _medpython.PandasAdaptor___getitem__(self, key)
2573
+
2574
+ def __iter__(self):
2575
+ r"""__iter__(PandasAdaptor self) -> MPPandasAdaptor_iter"""
2576
+ return _medpython.PandasAdaptor___iter__(self)
2577
+
2578
+ def get_categorial_col_dict(self, col_name):
2579
+ r"""get_categorial_col_dict(PandasAdaptor self, std::string const & col_name) -> IntStringMapAdaptor"""
2580
+ return _medpython.PandasAdaptor_get_categorial_col_dict(self, col_name)
2581
+
2582
+ def get_categorical_cols(self):
2583
+ r"""get_categorical_cols(PandasAdaptor self) -> StringVector"""
2584
+ return _medpython.PandasAdaptor_get_categorical_cols(self)
2585
+
2586
+ def import_column(self, col_name, IN_ARRAY1, make_a_copy=False):
2587
+ r"""import_column(PandasAdaptor self, string const & col_name, void * IN_ARRAY1, bool make_a_copy=False)"""
2588
+ return _medpython.PandasAdaptor_import_column(self, col_name, IN_ARRAY1, make_a_copy)
2589
+
2590
+ def __init__(self):
2591
+ r"""__init__(PandasAdaptor self) -> PandasAdaptor"""
2592
+ _medpython.PandasAdaptor_swiginit(self, _medpython.new_PandasAdaptor())
2593
+
2594
+ # Register PandasAdaptor in _medpython:
2595
+ _medpython.PandasAdaptor_swigregister(PandasAdaptor)
2596
+ class MPPandasAdaptor_iter(object):
2597
+ r"""Proxy of C++ MPPandasAdaptor_iter class."""
2598
+
2599
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2600
+
2601
+ def __init__(self, *args):
2602
+ r"""
2603
+ __init__(MPPandasAdaptor_iter self, PandasAdaptor o, StringVector keys_param) -> MPPandasAdaptor_iter
2604
+ __init__(MPPandasAdaptor_iter self, MPPandasAdaptor_iter orig) -> MPPandasAdaptor_iter
2605
+ """
2606
+ _medpython.MPPandasAdaptor_iter_swiginit(self, _medpython.new_MPPandasAdaptor_iter(*args))
2607
+
2608
+ def next(self):
2609
+ r"""next(MPPandasAdaptor_iter self) -> std::string"""
2610
+ return _medpython.MPPandasAdaptor_iter_next(self)
2611
+
2612
+ def __repr__(self):
2613
+ r"""__repr__(MPPandasAdaptor_iter self) -> std::string"""
2614
+ return _medpython.MPPandasAdaptor_iter___repr__(self)
2615
+ __swig_destroy__ = _medpython.delete_MPPandasAdaptor_iter
2616
+
2617
+ # Register MPPandasAdaptor_iter in _medpython:
2618
+ _medpython.MPPandasAdaptor_iter_swigregister(MPPandasAdaptor_iter)
2619
+ class PidRepository(object):
2620
+ r"""Proxy of C++ MPPidRepository class."""
2621
+
2622
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2623
+ __repr__ = _swig_repr
2624
+ dict = property(_medpython.PidRepository_dict_get, _medpython.PidRepository_dict_set, doc=r"""dict : MPDictionary""")
2625
+
2626
+ def __init__(self):
2627
+ r"""__init__(PidRepository self) -> PidRepository"""
2628
+ _medpython.PidRepository_swiginit(self, _medpython.new_PidRepository())
2629
+ __swig_destroy__ = _medpython.delete_PidRepository
2630
+
2631
+ def read_all(self, *args):
2632
+ r"""
2633
+ read_all(conf_file_fname, [pids_to_take_array], [list_str_signals_to_take]) -> int
2634
+ returns -1 if fails
2635
+ 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
2636
+ returns -1 if fails
2637
+ reading a repository for a group of pids and signals.Empty group means all of it.
2638
+ """
2639
+ return _medpython.PidRepository_read_all(self, *args)
2640
+
2641
+ def read_all_i(self, conf_fname, pids_to_take, signals_to_take):
2642
+ r"""read_all_i(PidRepository self, std::string const & conf_fname, IntVector pids_to_take, IntVector signals_to_take) -> int"""
2643
+ return _medpython.PidRepository_read_all_i(self, conf_fname, pids_to_take, signals_to_take)
2644
+
2645
+ def init(self, conf_fname):
2646
+ r"""
2647
+ init(conf_file_name) -> int
2648
+ returns -1 if fails
2649
+ """
2650
+ return _medpython.PidRepository_init(self, conf_fname)
2651
+
2652
+ def loadsig(self, signame):
2653
+ r"""
2654
+ loadsig(str_signame) -> int
2655
+ load a signal
2656
+ """
2657
+ return _medpython.PidRepository_loadsig(self, signame)
2658
+
2659
+ def loadsig_pids(self, signame, pids_to_take):
2660
+ r"""loadsig_pids(PidRepository self, std::string const & signame, int * pids_to_take) -> int"""
2661
+ return _medpython.PidRepository_loadsig_pids(self, signame, pids_to_take)
2662
+
2663
+ def list_signals(self):
2664
+ r"""list_signals(PidRepository self) -> StringVector"""
2665
+ return _medpython.PidRepository_list_signals(self)
2666
+
2667
+ def sig_id(self, signame):
2668
+ r"""
2669
+ sig_id(str_signame) -> int
2670
+ returns signal id number for a given signal name
2671
+ """
2672
+ return _medpython.PidRepository_sig_id(self, signame)
2673
+
2674
+ def sig_type(self, signame):
2675
+ r"""
2676
+ sig_type(str_signame) -> int
2677
+ returns signal type
2678
+ """
2679
+ return _medpython.PidRepository_sig_type(self, signame)
2680
+
2681
+ def sig_description(self, signame):
2682
+ r"""
2683
+ sig_description(str_signame) -> string
2684
+ returns signal string description
2685
+ """
2686
+ return _medpython.PidRepository_sig_description(self, signame)
2687
+
2688
+ def is_categorical(self, signame, val_channel):
2689
+ r"""
2690
+ is_categorical(str_signame, int_val_channel) -> bool
2691
+ returns True is channel is categorical
2692
+ """
2693
+ return _medpython.PidRepository_is_categorical(self, signame, val_channel)
2694
+
2695
+ def MEDPY_GET_pids(self):
2696
+ r"""MEDPY_GET_pids(PidRepository self) -> IntVector"""
2697
+ return _medpython.PidRepository_MEDPY_GET_pids(self)
2698
+
2699
+ def uget(self, pid, sid):
2700
+ r"""
2701
+ uget(int_pid, int_sid) -> SigVectorAdaptor
2702
+ returns a vector of universal signals
2703
+ """
2704
+ return _medpython.PidRepository_uget(self, pid, sid)
2705
+
2706
+ def dict_section_id(self, secName):
2707
+ r"""
2708
+ dict_section_id(str_secName) -> int
2709
+ returns section id number for a given section name
2710
+ """
2711
+ return _medpython.PidRepository_dict_section_id(self, secName)
2712
+
2713
+ def dict_name(self, section_id, id):
2714
+ r"""
2715
+ dict_name(int_section_id, int_id) -> string
2716
+ returns name of section + id
2717
+ """
2718
+ return _medpython.PidRepository_dict_name(self, section_id, id)
2719
+
2720
+ def dict_prep_sets_lookup_table(self, section_id, set_names):
2721
+ r"""
2722
+ dict_prep_sets_lookup_table(int_section_id, list_String set_names) -> BoolVector
2723
+ returns a look-up-table for given set names
2724
+ """
2725
+ return _medpython.PidRepository_dict_prep_sets_lookup_table(self, section_id, set_names)
2726
+
2727
+ def get_lut_from_regex(self, section_id, regex_s):
2728
+ r"""
2729
+ get get_lut_from_regex to names -> BoolVector
2730
+ returns a lut - boolean vector
2731
+ """
2732
+ return _medpython.PidRepository_get_lut_from_regex(self, section_id, regex_s)
2733
+
2734
+ def export_to_numpy(self, signame, pids_to_take, use_all_pids, translate_flag, free_sig, filter_regex_str):
2735
+ r"""
2736
+ export_to_numpy(str_signame) -> SigExporter
2737
+ Returns the signal data represented as a list of numpy arrays, one for each field
2738
+ """
2739
+ return _medpython.PidRepository_export_to_numpy(self, signame, pids_to_take, use_all_pids, translate_flag, free_sig, filter_regex_str)
2740
+
2741
+ def free(self, signame):
2742
+ r"""
2743
+ free(signame) -> int
2744
+ Free the signal data specified by signame
2745
+ """
2746
+ return _medpython.PidRepository_free(self, signame)
2747
+
2748
+ def switch_to_in_mem(self):
2749
+ r"""
2750
+ switch_to_in_mem()
2751
+ Switch to in mem repository mode
2752
+ """
2753
+ return _medpython.PidRepository_switch_to_in_mem(self)
2754
+
2755
+ def load_from_json(self, json_file_path):
2756
+ r"""
2757
+ load_from_json(json_file_path)
2758
+ Loads patient data into in-mem repository. If patient exists, adds more data
2759
+ """
2760
+ return _medpython.PidRepository_load_from_json(self, json_file_path)
2761
+
2762
+ def load_from_json_str(self, json_content):
2763
+ r"""
2764
+ load_from_json_str(json_string)
2765
+ Loads patient data into in-mem repository. If patient exists, adds more data
2766
+ """
2767
+ return _medpython.PidRepository_load_from_json_str(self, json_content)
2768
+
2769
+ def clear(self):
2770
+ r"""
2771
+ load_from_json()
2772
+ Clear repository memory. erase in-memory patient data
2773
+ """
2774
+ return _medpython.PidRepository_clear(self)
2775
+
2776
+ def finish_load_data(self):
2777
+ r"""
2778
+ finish_load_data()
2779
+ prepare for model apply. not need to call it specifically.
2780
+ """
2781
+ return _medpython.PidRepository_finish_load_data(self)
2782
+
2783
+ def get_sig(self, sig_name_str, translate=True, pids=None, float32to64=True, free_signal=True, regex_str=None, regex_filter=None):
2784
+ 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)"""
2785
+ return _medpython.PidRepository_get_sig(self, sig_name_str, translate, pids, float32to64, free_signal, regex_str, regex_filter)
2786
+
2787
+ pids = property(MEDPY_GET_pids,None)
2788
+
2789
+
2790
+ # Register PidRepository in _medpython:
2791
+ _medpython.PidRepository_swigregister(PidRepository)
2792
+ class Sig(object):
2793
+ r"""Proxy of C++ MPSig class."""
2794
+
2795
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2796
+ __repr__ = _swig_repr
2797
+
2798
+ def __init__(self, other):
2799
+ r"""__init__(Sig self, Sig other) -> Sig"""
2800
+ _medpython.Sig_swiginit(self, _medpython.new_Sig(other))
2801
+
2802
+ def time(self, chan=0):
2803
+ r"""time(Sig self, int chan=0) -> int"""
2804
+ return _medpython.Sig_time(self, chan)
2805
+
2806
+ def val(self, chan=0):
2807
+ r"""val(Sig self, int chan=0) -> float"""
2808
+ return _medpython.Sig_val(self, chan)
2809
+
2810
+ def timeU(self, to_time_unit):
2811
+ r"""timeU(Sig self, int to_time_unit) -> int"""
2812
+ return _medpython.Sig_timeU(self, to_time_unit)
2813
+
2814
+ def date(self, chan=0):
2815
+ r"""date(Sig self, int chan=0) -> int"""
2816
+ return _medpython.Sig_date(self, chan)
2817
+
2818
+ def years(self, chan=0):
2819
+ r"""years(Sig self, int chan=0) -> int"""
2820
+ return _medpython.Sig_years(self, chan)
2821
+
2822
+ def months(self, chan=0):
2823
+ r"""months(Sig self, int chan=0) -> int"""
2824
+ return _medpython.Sig_months(self, chan)
2825
+
2826
+ def days(self, chan=0):
2827
+ r"""days(Sig self, int chan=0) -> int"""
2828
+ return _medpython.Sig_days(self, chan)
2829
+
2830
+ def hours(self, chan=0):
2831
+ r"""hours(Sig self, int chan=0) -> int"""
2832
+ return _medpython.Sig_hours(self, chan)
2833
+
2834
+ def minutes(self, chan=0):
2835
+ r"""minutes(Sig self, int chan=0) -> int"""
2836
+ return _medpython.Sig_minutes(self, chan)
2837
+ __swig_destroy__ = _medpython.delete_Sig
2838
+
2839
+ # Register Sig in _medpython:
2840
+ _medpython.Sig_swigregister(Sig)
2841
+ class SigVectorAdaptor(object):
2842
+ r"""Proxy of C++ MPSigVectorAdaptor class."""
2843
+
2844
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2845
+ __repr__ = _swig_repr
2846
+
2847
+ def __init__(self, other):
2848
+ r"""__init__(SigVectorAdaptor self, SigVectorAdaptor other) -> SigVectorAdaptor"""
2849
+ _medpython.SigVectorAdaptor_swiginit(self, _medpython.new_SigVectorAdaptor(other))
2850
+ __swig_destroy__ = _medpython.delete_SigVectorAdaptor
2851
+
2852
+ def __len__(self):
2853
+ r"""__len__(SigVectorAdaptor self) -> int"""
2854
+ return _medpython.SigVectorAdaptor___len__(self)
2855
+
2856
+ def __getitem__(self, i):
2857
+ r"""__getitem__(SigVectorAdaptor self, int i) -> Sig"""
2858
+ return _medpython.SigVectorAdaptor___getitem__(self, i)
2859
+
2860
+ def MEDPY_GET_type(self):
2861
+ r"""MEDPY_GET_type(SigVectorAdaptor self) -> int"""
2862
+ return _medpython.SigVectorAdaptor_MEDPY_GET_type(self)
2863
+
2864
+ def MEDPY_GET_n_time_channels(self):
2865
+ r"""MEDPY_GET_n_time_channels(SigVectorAdaptor self) -> int"""
2866
+ return _medpython.SigVectorAdaptor_MEDPY_GET_n_time_channels(self)
2867
+
2868
+ def MEDPY_GET_n_val_channels(self):
2869
+ r"""MEDPY_GET_n_val_channels(SigVectorAdaptor self) -> int"""
2870
+ return _medpython.SigVectorAdaptor_MEDPY_GET_n_val_channels(self)
2871
+
2872
+ def MEDPY_GET_time_unit(self):
2873
+ r"""MEDPY_GET_time_unit(SigVectorAdaptor self) -> int"""
2874
+ return _medpython.SigVectorAdaptor_MEDPY_GET_time_unit(self)
2875
+
2876
+ def MEDPY_GET_size(self):
2877
+ r"""MEDPY_GET_size(SigVectorAdaptor self) -> int"""
2878
+ return _medpython.SigVectorAdaptor_MEDPY_GET_size(self)
2879
+
2880
+ type = property(MEDPY_GET_type,None)
2881
+ n_time_channels = property(MEDPY_GET_n_time_channels,None)
2882
+ n_val_channels = property(MEDPY_GET_n_val_channels,None)
2883
+ time_unit = property(MEDPY_GET_time_unit,None)
2884
+ size = property(MEDPY_GET_size,None)
2885
+
2886
+
2887
+ # Register SigVectorAdaptor in _medpython:
2888
+ _medpython.SigVectorAdaptor_swigregister(SigVectorAdaptor)
2889
+ class MedConvert(object):
2890
+ r"""Proxy of C++ MPMedConvert class."""
2891
+
2892
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2893
+ __repr__ = _swig_repr
2894
+
2895
+ def __init__(self):
2896
+ r"""__init__(MedConvert self) -> MedConvert"""
2897
+ _medpython.MedConvert_swiginit(self, _medpython.new_MedConvert())
2898
+ __swig_destroy__ = _medpython.delete_MedConvert
2899
+
2900
+ def init_load_params(self, load_args):
2901
+ r"""init_load_params(MedConvert self, std::string const & load_args)"""
2902
+ return _medpython.MedConvert_init_load_params(self, load_args)
2903
+
2904
+ def create_rep(self, conf_fname):
2905
+ r"""create_rep(MedConvert self, std::string const & conf_fname)"""
2906
+ return _medpython.MedConvert_create_rep(self, conf_fname)
2907
+
2908
+ def create_index(self, conf_fname):
2909
+ r"""create_index(MedConvert self, std::string & conf_fname) -> int"""
2910
+ return _medpython.MedConvert_create_index(self, conf_fname)
2911
+
2912
+ # Register MedConvert in _medpython:
2913
+ _medpython.MedConvert_swigregister(MedConvert)
2914
+ class PredictorTypes(object):
2915
+ r"""Proxy of C++ MPPredictorTypes class."""
2916
+
2917
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2918
+ __repr__ = _swig_repr
2919
+
2920
+ def __init__(self):
2921
+ r"""__init__(PredictorTypes self) -> PredictorTypes"""
2922
+ _medpython.PredictorTypes_swiginit(self, _medpython.new_PredictorTypes())
2923
+ __swig_destroy__ = _medpython.delete_PredictorTypes
2924
+
2925
+ # Register PredictorTypes in _medpython:
2926
+ _medpython.PredictorTypes_swigregister(PredictorTypes)
2927
+ PredictorTypes.LINEAR_MODEL = _medpython.cvar.PredictorTypes_LINEAR_MODEL
2928
+ PredictorTypes.QRF = _medpython.cvar.PredictorTypes_QRF
2929
+ PredictorTypes.GBM = _medpython.cvar.PredictorTypes_GBM
2930
+ PredictorTypes.KNN = _medpython.cvar.PredictorTypes_KNN
2931
+ PredictorTypes.BP = _medpython.cvar.PredictorTypes_BP
2932
+ PredictorTypes.MARS = _medpython.cvar.PredictorTypes_MARS
2933
+ PredictorTypes.GD_LINEAR = _medpython.cvar.PredictorTypes_GD_LINEAR
2934
+ PredictorTypes.MULTI_CLASS = _medpython.cvar.PredictorTypes_MULTI_CLASS
2935
+ PredictorTypes.XGB = _medpython.cvar.PredictorTypes_XGB
2936
+ PredictorTypes.LASSO = _medpython.cvar.PredictorTypes_LASSO
2937
+ PredictorTypes.MIC_NET = _medpython.cvar.PredictorTypes_MIC_NET
2938
+ PredictorTypes.BOOSTER = _medpython.cvar.PredictorTypes_BOOSTER
2939
+ PredictorTypes.DEEP_BIT = _medpython.cvar.PredictorTypes_DEEP_BIT
2940
+ PredictorTypes.LIGHTGBM = _medpython.cvar.PredictorTypes_LIGHTGBM
2941
+ PredictorTypes.SPECIFIC_GROUPS_MODELS = _medpython.cvar.PredictorTypes_SPECIFIC_GROUPS_MODELS
2942
+ PredictorTypes.SVM = _medpython.cvar.PredictorTypes_SVM
2943
+ PredictorTypes.LINEAR_SGD = _medpython.cvar.PredictorTypes_LINEAR_SGD
2944
+ PredictorTypes.VW = _medpython.cvar.PredictorTypes_VW
2945
+ PredictorTypes.TQRF = _medpython.cvar.PredictorTypes_TQRF
2946
+ PredictorTypes.BART = _medpython.cvar.PredictorTypes_BART
2947
+
2948
+ class Predictor(object):
2949
+ r"""Proxy of C++ MPPredictor class."""
2950
+
2951
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2952
+ __repr__ = _swig_repr
2953
+
2954
+ def asSerializable(self):
2955
+ r"""asSerializable(Predictor self) -> SerializableObject"""
2956
+ return _medpython.Predictor_asSerializable(self)
2957
+
2958
+ def __init__(self, *args):
2959
+ r"""
2960
+ __init__(Predictor self) -> Predictor
2961
+ __init__(Predictor self, string model_type, string params="") -> Predictor
2962
+ """
2963
+ _medpython.Predictor_swiginit(self, _medpython.new_Predictor(*args))
2964
+
2965
+ def MEDPY_GET_transpose_for_learn(self):
2966
+ r"""MEDPY_GET_transpose_for_learn(Predictor self) -> bool"""
2967
+ return _medpython.Predictor_MEDPY_GET_transpose_for_learn(self)
2968
+
2969
+ def MEDPY_SET_transpose_for_learn(self, new_val):
2970
+ r"""MEDPY_SET_transpose_for_learn(Predictor self, bool new_val)"""
2971
+ return _medpython.Predictor_MEDPY_SET_transpose_for_learn(self, new_val)
2972
+
2973
+ def MEDPY_GET_normalize_for_learn(self):
2974
+ r"""MEDPY_GET_normalize_for_learn(Predictor self) -> bool"""
2975
+ return _medpython.Predictor_MEDPY_GET_normalize_for_learn(self)
2976
+
2977
+ def MEDPY_SET_normalize_for_learn(self, new_val):
2978
+ r"""MEDPY_SET_normalize_for_learn(Predictor self, bool new_val)"""
2979
+ return _medpython.Predictor_MEDPY_SET_normalize_for_learn(self, new_val)
2980
+
2981
+ def MEDPY_GET_normalize_y_for_learn(self):
2982
+ r"""MEDPY_GET_normalize_y_for_learn(Predictor self) -> bool"""
2983
+ return _medpython.Predictor_MEDPY_GET_normalize_y_for_learn(self)
2984
+
2985
+ def MEDPY_SET_normalize_y_for_learn(self, new_val):
2986
+ r"""MEDPY_SET_normalize_y_for_learn(Predictor self, bool new_val)"""
2987
+ return _medpython.Predictor_MEDPY_SET_normalize_y_for_learn(self, new_val)
2988
+
2989
+ def MEDPY_GET_transpose_for_predict(self):
2990
+ r"""MEDPY_GET_transpose_for_predict(Predictor self) -> bool"""
2991
+ return _medpython.Predictor_MEDPY_GET_transpose_for_predict(self)
2992
+
2993
+ def MEDPY_SET_transpose_for_predict(self, new_val):
2994
+ r"""MEDPY_SET_transpose_for_predict(Predictor self, bool new_val)"""
2995
+ return _medpython.Predictor_MEDPY_SET_transpose_for_predict(self, new_val)
2996
+
2997
+ def MEDPY_GET_normalize_for_predict(self):
2998
+ r"""MEDPY_GET_normalize_for_predict(Predictor self) -> bool"""
2999
+ return _medpython.Predictor_MEDPY_GET_normalize_for_predict(self)
3000
+
3001
+ def MEDPY_SET_normalize_for_predict(self, new_val):
3002
+ r"""MEDPY_SET_normalize_for_predict(Predictor self, bool new_val)"""
3003
+ return _medpython.Predictor_MEDPY_SET_normalize_for_predict(self, new_val)
3004
+
3005
+ def MEDPY_GET_model_features(self):
3006
+ r"""MEDPY_GET_model_features(Predictor self) -> StringVector"""
3007
+ return _medpython.Predictor_MEDPY_GET_model_features(self)
3008
+
3009
+ def MEDPY_SET_model_features(self, new_val):
3010
+ r"""MEDPY_SET_model_features(Predictor self, StringVector new_val)"""
3011
+ return _medpython.Predictor_MEDPY_SET_model_features(self, new_val)
3012
+
3013
+ def MEDPY_GET_features_count(self):
3014
+ r"""MEDPY_GET_features_count(Predictor self) -> int"""
3015
+ return _medpython.Predictor_MEDPY_GET_features_count(self)
3016
+
3017
+ def MEDPY_SET_features_count(self, new_val):
3018
+ r"""MEDPY_SET_features_count(Predictor self, int new_val)"""
3019
+ return _medpython.Predictor_MEDPY_SET_features_count(self, new_val)
3020
+
3021
+ @staticmethod
3022
+ def make_predictor(*args):
3023
+ r"""
3024
+ make_predictor(string model_type) -> Predictor
3025
+ make_predictor(string model_type, string params) -> Predictor
3026
+ """
3027
+ return _medpython.Predictor_make_predictor(*args)
3028
+
3029
+ def learn(self, features):
3030
+ r"""learn(Predictor self, Features features) -> int"""
3031
+ return _medpython.Predictor_learn(self, features)
3032
+
3033
+ def predict(self, features):
3034
+ r"""predict(Predictor self, Features features) -> int"""
3035
+ return _medpython.Predictor_predict(self, features)
3036
+
3037
+ def calc_feature_contribs(self, features, res):
3038
+ r"""calc_feature_contribs(Predictor self, Features features, Features res)"""
3039
+ return _medpython.Predictor_calc_feature_contribs(self, features, res)
3040
+
3041
+ def write_predictor_to_file(self, outFile):
3042
+ r"""write_predictor_to_file(Predictor self, string & outFile)"""
3043
+ return _medpython.Predictor_write_predictor_to_file(self, outFile)
3044
+
3045
+ def export_predictor(self, outFile):
3046
+ r"""export_predictor(Predictor self, string & outFile)"""
3047
+ return _medpython.Predictor_export_predictor(self, outFile)
3048
+
3049
+ transpose_for_learn = property(MEDPY_GET_transpose_for_learn,MEDPY_SET_transpose_for_learn)
3050
+ normalize_for_learn = property(MEDPY_GET_normalize_for_learn,MEDPY_SET_normalize_for_learn)
3051
+ normalize_y_for_learn = property(MEDPY_GET_normalize_y_for_learn,MEDPY_SET_normalize_y_for_learn)
3052
+ transpose_for_predict = property(MEDPY_GET_transpose_for_predict,MEDPY_SET_transpose_for_predict)
3053
+ normalize_for_predict = property(MEDPY_GET_normalize_for_predict,MEDPY_SET_normalize_for_predict)
3054
+ model_features = property(MEDPY_GET_model_features,MEDPY_SET_model_features)
3055
+ features_count = property(MEDPY_GET_features_count,MEDPY_SET_features_count)
3056
+
3057
+ __swig_destroy__ = _medpython.delete_Predictor
3058
+
3059
+ # Register Predictor in _medpython:
3060
+ _medpython.Predictor_swigregister(Predictor)
3061
+ class SampleFilter(object):
3062
+ r"""Proxy of C++ MPSampleFilter class."""
3063
+
3064
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3065
+ __repr__ = _swig_repr
3066
+
3067
+ @staticmethod
3068
+ def from_name(name):
3069
+ r"""from_name(string name) -> SampleFilter"""
3070
+ return _medpython.SampleFilter_from_name(name)
3071
+
3072
+ @staticmethod
3073
+ def from_type(type):
3074
+ r"""from_type(int type) -> SampleFilter"""
3075
+ return _medpython.SampleFilter_from_type(type)
3076
+
3077
+ @staticmethod
3078
+ def from_name_params(name, params):
3079
+ r"""from_name_params(string name, string params) -> SampleFilter"""
3080
+ return _medpython.SampleFilter_from_name_params(name, params)
3081
+
3082
+ @staticmethod
3083
+ def from_type_params(type, params):
3084
+ r"""from_type_params(int type, string params) -> SampleFilter"""
3085
+ return _medpython.SampleFilter_from_type_params(type, params)
3086
+ __swig_destroy__ = _medpython.delete_SampleFilter
3087
+
3088
+ def filter(self, rep, samples):
3089
+ r"""
3090
+ filter(rep, samples) -> int
3091
+ in-place filtering with repository. returns -1 if fails.
3092
+ """
3093
+ return _medpython.SampleFilter_filter(self, rep, samples)
3094
+
3095
+ def asSerializable(self):
3096
+ r"""asSerializable(SampleFilter self) -> SerializableObject"""
3097
+ return _medpython.SampleFilter_asSerializable(self)
3098
+
3099
+ def __init__(self):
3100
+ r"""__init__(SampleFilter self) -> SampleFilter"""
3101
+ _medpython.SampleFilter_swiginit(self, _medpython.new_SampleFilter())
3102
+
3103
+ # Register SampleFilter in _medpython:
3104
+ _medpython.SampleFilter_swigregister(SampleFilter)
3105
+ SampleFilter.SMPL_FILTER_TRN_ = _medpython.cvar.SampleFilter_SMPL_FILTER_TRN_
3106
+ SampleFilter.SMPL_FILTER_TST_ = _medpython.cvar.SampleFilter_SMPL_FILTER_TST_
3107
+ SampleFilter.SMPL_FILTER_OUTLIERS_ = _medpython.cvar.SampleFilter_SMPL_FILTER_OUTLIERS_
3108
+ SampleFilter.SMPL_FILTER_MATCH_ = _medpython.cvar.SampleFilter_SMPL_FILTER_MATCH_
3109
+ SampleFilter.SMPL_FILTER_REQ_SIGNAL_ = _medpython.cvar.SampleFilter_SMPL_FILTER_REQ_SIGNAL_
3110
+ SampleFilter.SMPL_FILTER_BASIC_ = _medpython.cvar.SampleFilter_SMPL_FILTER_BASIC_
3111
+ SampleFilter.SMPL_FILTER_LAST_ = _medpython.cvar.SampleFilter_SMPL_FILTER_LAST_
3112
+
3113
+ class Sample(object):
3114
+ r"""Proxy of C++ MPSample class."""
3115
+
3116
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3117
+ __repr__ = _swig_repr
3118
+
3119
+ def MEDPY_GET_id(self):
3120
+ r"""MEDPY_GET_id(Sample self) -> int"""
3121
+ return _medpython.Sample_MEDPY_GET_id(self)
3122
+
3123
+ def MEDPY_SET_id(self, new_id):
3124
+ r"""MEDPY_SET_id(Sample self, int new_id)"""
3125
+ return _medpython.Sample_MEDPY_SET_id(self, new_id)
3126
+
3127
+ def MEDPY_GET_split(self):
3128
+ r"""MEDPY_GET_split(Sample self) -> int"""
3129
+ return _medpython.Sample_MEDPY_GET_split(self)
3130
+
3131
+ def MEDPY_SET_split(self, new_sp):
3132
+ r"""MEDPY_SET_split(Sample self, int new_sp)"""
3133
+ return _medpython.Sample_MEDPY_SET_split(self, new_sp)
3134
+
3135
+ def MEDPY_GET_time(self):
3136
+ r"""MEDPY_GET_time(Sample self) -> int"""
3137
+ return _medpython.Sample_MEDPY_GET_time(self)
3138
+
3139
+ def MEDPY_SET_time(self, new_time):
3140
+ r"""MEDPY_SET_time(Sample self, int new_time)"""
3141
+ return _medpython.Sample_MEDPY_SET_time(self, new_time)
3142
+
3143
+ def MEDPY_GET_outcome(self):
3144
+ r"""MEDPY_GET_outcome(Sample self) -> int"""
3145
+ return _medpython.Sample_MEDPY_GET_outcome(self)
3146
+
3147
+ def MEDPY_SET_outcome(self, new_outcome):
3148
+ r"""MEDPY_SET_outcome(Sample self, int new_outcome)"""
3149
+ return _medpython.Sample_MEDPY_SET_outcome(self, new_outcome)
3150
+
3151
+ def MEDPY_GET_outcomeTime(self):
3152
+ r"""MEDPY_GET_outcomeTime(Sample self) -> int"""
3153
+ return _medpython.Sample_MEDPY_GET_outcomeTime(self)
3154
+
3155
+ def MEDPY_SET_outcomeTime(self, new_outcome_time):
3156
+ r"""MEDPY_SET_outcomeTime(Sample self, int new_outcome_time)"""
3157
+ return _medpython.Sample_MEDPY_SET_outcomeTime(self, new_outcome_time)
3158
+
3159
+ def MEDPY_GET_prediction(self):
3160
+ r"""MEDPY_GET_prediction(Sample self)"""
3161
+ return _medpython.Sample_MEDPY_GET_prediction(self)
3162
+
3163
+ def MEDPY_SET_prediction(self, in_predbuf):
3164
+ r"""MEDPY_SET_prediction(Sample self, float * in_predbuf)"""
3165
+ return _medpython.Sample_MEDPY_SET_prediction(self, in_predbuf)
3166
+
3167
+ def __init__(self):
3168
+ r"""__init__(Sample self) -> Sample"""
3169
+ _medpython.Sample_swiginit(self, _medpython.new_Sample())
3170
+ __swig_destroy__ = _medpython.delete_Sample
3171
+
3172
+ def print_(self, *args):
3173
+ r"""
3174
+ print_(Sample self, string const prefix)
3175
+ print_(Sample self)
3176
+ """
3177
+ return _medpython.Sample_print_(self, *args)
3178
+
3179
+ def parse_from_string(self, s, time_unit):
3180
+ r"""parse_from_string(Sample self, string & s, int time_unit) -> int"""
3181
+ return _medpython.Sample_parse_from_string(self, s, time_unit)
3182
+
3183
+ def write_to_string(self, s, time_unit):
3184
+ r"""write_to_string(Sample self, string & s, int time_unit)"""
3185
+ return _medpython.Sample_write_to_string(self, s, time_unit)
3186
+
3187
+ def __copy__(self):
3188
+ r"""__copy__(Sample self) -> Sample"""
3189
+ return _medpython.Sample___copy__(self)
3190
+
3191
+ def asSerializable(self):
3192
+ r"""asSerializable(Sample self) -> SerializableObject"""
3193
+ return _medpython.Sample_asSerializable(self)
3194
+
3195
+ id = property(MEDPY_GET_id,MEDPY_SET_id)
3196
+ split = property(MEDPY_GET_split,MEDPY_SET_split)
3197
+ time = property(MEDPY_GET_time,MEDPY_SET_time)
3198
+ outcome = property(MEDPY_GET_outcome,MEDPY_SET_outcome)
3199
+ outcomeTime = property(MEDPY_GET_outcomeTime,MEDPY_SET_outcomeTime)
3200
+ prediction = property(MEDPY_GET_prediction,MEDPY_SET_prediction)
3201
+
3202
+
3203
+ # Register Sample in _medpython:
3204
+ _medpython.Sample_swigregister(Sample)
3205
+ class SampleVectorAdaptor(object):
3206
+ r"""Proxy of C++ MPSampleVectorAdaptor class."""
3207
+
3208
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3209
+ __repr__ = _swig_repr
3210
+
3211
+ def __init__(self):
3212
+ r"""__init__(SampleVectorAdaptor self) -> SampleVectorAdaptor"""
3213
+ _medpython.SampleVectorAdaptor_swiginit(self, _medpython.new_SampleVectorAdaptor())
3214
+ __swig_destroy__ = _medpython.delete_SampleVectorAdaptor
3215
+
3216
+ def __len__(self):
3217
+ r"""__len__(SampleVectorAdaptor self) -> int"""
3218
+ return _medpython.SampleVectorAdaptor___len__(self)
3219
+
3220
+ def __getitem__(self, i):
3221
+ r"""__getitem__(SampleVectorAdaptor self, int i) -> Sample"""
3222
+ return _medpython.SampleVectorAdaptor___getitem__(self, i)
3223
+
3224
+ def __setitem__(self, i, val):
3225
+ r"""__setitem__(SampleVectorAdaptor self, int i, Sample val)"""
3226
+ return _medpython.SampleVectorAdaptor___setitem__(self, i, val)
3227
+
3228
+ def append(self, val):
3229
+ r"""append(SampleVectorAdaptor self, Sample val)"""
3230
+ return _medpython.SampleVectorAdaptor_append(self, val)
3231
+
3232
+ def append_vec(self, other):
3233
+ r"""append_vec(SampleVectorAdaptor self, SampleVectorAdaptor other)"""
3234
+ return _medpython.SampleVectorAdaptor_append_vec(self, other)
3235
+
3236
+ def override_splits(self, nfolds):
3237
+ r"""override_splits(SampleVectorAdaptor self, int nfolds)"""
3238
+ return _medpython.SampleVectorAdaptor_override_splits(self, nfolds)
3239
+
3240
+ def nSplits(self):
3241
+ r"""nSplits(SampleVectorAdaptor self) -> int"""
3242
+ return _medpython.SampleVectorAdaptor_nSplits(self)
3243
+
3244
+ # Register SampleVectorAdaptor in _medpython:
3245
+ _medpython.SampleVectorAdaptor_swigregister(SampleVectorAdaptor)
3246
+ class IdSamples(object):
3247
+ r"""Proxy of C++ MPIdSamples class."""
3248
+
3249
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3250
+ __repr__ = _swig_repr
3251
+
3252
+ def MEDPY_GET_id(self):
3253
+ r"""MEDPY_GET_id(IdSamples self) -> int"""
3254
+ return _medpython.IdSamples_MEDPY_GET_id(self)
3255
+
3256
+ def MEDPY_SET_id(self, new_id):
3257
+ r"""MEDPY_SET_id(IdSamples self, int new_id)"""
3258
+ return _medpython.IdSamples_MEDPY_SET_id(self, new_id)
3259
+
3260
+ def MEDPY_GET_split(self):
3261
+ r"""MEDPY_GET_split(IdSamples self) -> int"""
3262
+ return _medpython.IdSamples_MEDPY_GET_split(self)
3263
+
3264
+ def MEDPY_SET_split(self, new_id):
3265
+ r"""MEDPY_SET_split(IdSamples self, int new_id)"""
3266
+ return _medpython.IdSamples_MEDPY_SET_split(self, new_id)
3267
+
3268
+ def MEDPY_GET_samples(self):
3269
+ r"""MEDPY_GET_samples(IdSamples self) -> SampleVectorAdaptor"""
3270
+ return _medpython.IdSamples_MEDPY_GET_samples(self)
3271
+
3272
+ def __init__(self, *args):
3273
+ r"""
3274
+ __init__(IdSamples self, int _id) -> IdSamples
3275
+ __init__(IdSamples self) -> IdSamples
3276
+ """
3277
+ _medpython.IdSamples_swiginit(self, _medpython.new_IdSamples(*args))
3278
+ __swig_destroy__ = _medpython.delete_IdSamples
3279
+
3280
+ def set_split(self, _split):
3281
+ r"""set_split(IdSamples self, int _split)"""
3282
+ return _medpython.IdSamples_set_split(self, _split)
3283
+
3284
+ def same_as(self, other, mode):
3285
+ r"""same_as(IdSamples self, IdSamples other, int mode) -> bool"""
3286
+ return _medpython.IdSamples_same_as(self, other, mode)
3287
+
3288
+ def asSerializable(self):
3289
+ r"""asSerializable(IdSamples self) -> SerializableObject"""
3290
+ return _medpython.IdSamples_asSerializable(self)
3291
+
3292
+ id = property(MEDPY_GET_id,MEDPY_SET_id)
3293
+ split = property(MEDPY_GET_split,MEDPY_SET_split)
3294
+ samples = property(MEDPY_GET_samples,None)
3295
+
3296
+
3297
+ # Register IdSamples in _medpython:
3298
+ _medpython.IdSamples_swigregister(IdSamples)
3299
+ class IdSamplesVectorAdaptor(object):
3300
+ r"""Proxy of C++ MPIdSamplesVectorAdaptor class."""
3301
+
3302
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3303
+ __repr__ = _swig_repr
3304
+
3305
+ def __init__(self, *args):
3306
+ r"""
3307
+ __init__(IdSamplesVectorAdaptor self) -> IdSamplesVectorAdaptor
3308
+ __init__(IdSamplesVectorAdaptor self, vector< MedIdSamples > * ptr) -> IdSamplesVectorAdaptor
3309
+ """
3310
+ _medpython.IdSamplesVectorAdaptor_swiginit(self, _medpython.new_IdSamplesVectorAdaptor(*args))
3311
+ __swig_destroy__ = _medpython.delete_IdSamplesVectorAdaptor
3312
+
3313
+ def __len__(self):
3314
+ r"""__len__(IdSamplesVectorAdaptor self) -> int"""
3315
+ return _medpython.IdSamplesVectorAdaptor___len__(self)
3316
+
3317
+ def __getitem__(self, i):
3318
+ r"""__getitem__(IdSamplesVectorAdaptor self, int i) -> IdSamples"""
3319
+ return _medpython.IdSamplesVectorAdaptor___getitem__(self, i)
3320
+
3321
+ def __setitem__(self, i, val):
3322
+ r"""__setitem__(IdSamplesVectorAdaptor self, int i, IdSamples val)"""
3323
+ return _medpython.IdSamplesVectorAdaptor___setitem__(self, i, val)
3324
+
3325
+ def append(self, val):
3326
+ r"""append(IdSamplesVectorAdaptor self, IdSamples val)"""
3327
+ return _medpython.IdSamplesVectorAdaptor_append(self, val)
3328
+
3329
+ # Register IdSamplesVectorAdaptor in _medpython:
3330
+ _medpython.IdSamplesVectorAdaptor_swigregister(IdSamplesVectorAdaptor)
3331
+ class Samples(object):
3332
+ r"""Proxy of C++ MPSamples class."""
3333
+
3334
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3335
+ __repr__ = _swig_repr
3336
+
3337
+ def MEDPY_GET_time_unit(self):
3338
+ r"""MEDPY_GET_time_unit(Samples self) -> int"""
3339
+ return _medpython.Samples_MEDPY_GET_time_unit(self)
3340
+
3341
+ def MEDPY_SET_time_unit(self, new_time_unit):
3342
+ r"""MEDPY_SET_time_unit(Samples self, int new_time_unit)"""
3343
+ return _medpython.Samples_MEDPY_SET_time_unit(self, new_time_unit)
3344
+
3345
+ def MEDPY_GET_idSamples(self):
3346
+ r"""MEDPY_GET_idSamples(Samples self) -> IdSamplesVectorAdaptor"""
3347
+ return _medpython.Samples_MEDPY_GET_idSamples(self)
3348
+
3349
+ def __init__(self):
3350
+ r"""__init__(Samples self) -> Samples"""
3351
+ _medpython.Samples_swiginit(self, _medpython.new_Samples())
3352
+ __swig_destroy__ = _medpython.delete_Samples
3353
+
3354
+ def clear(self):
3355
+ r"""clear(Samples self)"""
3356
+ return _medpython.Samples_clear(self)
3357
+
3358
+ def insert_preds(self, featuresData):
3359
+ r"""insert_preds(Samples self, Features featuresData) -> int"""
3360
+ return _medpython.Samples_insert_preds(self, featuresData)
3361
+
3362
+ def get_ids(self):
3363
+ r"""get_ids(Samples self)"""
3364
+ return _medpython.Samples_get_ids(self)
3365
+
3366
+ def append(self, newSamples):
3367
+ r"""append(Samples self, Samples newSamples)"""
3368
+ return _medpython.Samples_append(self, newSamples)
3369
+
3370
+ def subtract(self, _dont_use):
3371
+ r"""subtract(Samples self, Samples _dont_use)"""
3372
+ return _medpython.Samples_subtract(self, _dont_use)
3373
+
3374
+ def split_train_test(self, train, test, p_test):
3375
+ r"""split_train_test(Samples self, Samples train, Samples test, float p_test)"""
3376
+ return _medpython.Samples_split_train_test(self, train, test, p_test)
3377
+
3378
+ def read_from_bin_file(self, file_name):
3379
+ r"""read_from_bin_file(Samples self, string const & file_name) -> int"""
3380
+ return _medpython.Samples_read_from_bin_file(self, file_name)
3381
+
3382
+ def write_to_bin_file(self, file_name):
3383
+ r"""write_to_bin_file(Samples self, string const & file_name) -> int"""
3384
+ return _medpython.Samples_write_to_bin_file(self, file_name)
3385
+
3386
+ def read_from_file(self, file_name):
3387
+ r"""read_from_file(Samples self, string const & file_name) -> int"""
3388
+ return _medpython.Samples_read_from_file(self, file_name)
3389
+
3390
+ def write_to_file(self, fname):
3391
+ r"""write_to_file(Samples self, string const & fname) -> int"""
3392
+ return _medpython.Samples_write_to_file(self, fname)
3393
+
3394
+ def get_preds(self):
3395
+ r"""get_preds(Samples self)"""
3396
+ return _medpython.Samples_get_preds(self)
3397
+
3398
+ def get_y(self):
3399
+ r"""get_y(Samples self)"""
3400
+ return _medpython.Samples_get_y(self)
3401
+
3402
+ def get_categs(self):
3403
+ r"""get_categs(Samples self)"""
3404
+ return _medpython.Samples_get_categs(self)
3405
+
3406
+ def filter_by_bt(self, rep_path, json_mat, bt_cohort):
3407
+ r"""filter_by_bt(Samples self, string const & rep_path, string const & json_mat, string const & bt_cohort)"""
3408
+ return _medpython.Samples_filter_by_bt(self, rep_path, json_mat, bt_cohort)
3409
+
3410
+ def export_to_sample_vec(self):
3411
+ r"""export_to_sample_vec(Samples self) -> SampleVectorAdaptor"""
3412
+ return _medpython.Samples_export_to_sample_vec(self)
3413
+
3414
+ def import_from_sample_vec(self, vec_samples, allow_split_inconsistency=False):
3415
+ r"""import_from_sample_vec(Samples self, SampleVectorAdaptor vec_samples, bool allow_split_inconsistency=False)"""
3416
+ return _medpython.Samples_import_from_sample_vec(self, vec_samples, allow_split_inconsistency)
3417
+
3418
+ def MEDPY__from_df(self, pandas_df):
3419
+ r"""MEDPY__from_df(Samples self, PandasAdaptor pandas_df)"""
3420
+ return _medpython.Samples_MEDPY__from_df(self, pandas_df)
3421
+
3422
+ def MEDPY__from_df_adaptor(self):
3423
+ r"""MEDPY__from_df_adaptor(Samples self) -> PandasAdaptor"""
3424
+ return _medpython.Samples_MEDPY__from_df_adaptor(self)
3425
+
3426
+ def MEDPY__to_df(self):
3427
+ r"""MEDPY__to_df(Samples self) -> PandasAdaptor"""
3428
+ return _medpython.Samples_MEDPY__to_df(self)
3429
+
3430
+ def sort_by_id_date(self):
3431
+ r"""sort_by_id_date(Samples self)"""
3432
+ return _medpython.Samples_sort_by_id_date(self)
3433
+
3434
+ def normalize(self):
3435
+ r"""normalize(Samples self)"""
3436
+ return _medpython.Samples_normalize(self)
3437
+
3438
+ def same_as(self, other, mode):
3439
+ r"""same_as(Samples self, Samples other, int mode) -> bool"""
3440
+ return _medpython.Samples_same_as(self, other, mode)
3441
+
3442
+ def nSamples(self):
3443
+ r"""nSamples(Samples self) -> int"""
3444
+ return _medpython.Samples_nSamples(self)
3445
+
3446
+ def nSplits(self):
3447
+ r"""
3448
+ nSplits() -> int
3449
+ Return number of splits, also check mismatches between idSample and internal MedSamples and set idSamples.split if missing
3450
+ """
3451
+ return _medpython.Samples_nSplits(self)
3452
+
3453
+ def get_predictions_size(self):
3454
+ r"""get_predictions_size(Samples self) -> int"""
3455
+ return _medpython.Samples_get_predictions_size(self)
3456
+
3457
+ def get_attributes(self):
3458
+ r"""get_attributes(Samples self) -> StringVector"""
3459
+ return _medpython.Samples_get_attributes(self)
3460
+
3461
+ def get_str_attributes(self):
3462
+ r"""get_str_attributes(Samples self) -> StringVector"""
3463
+ return _medpython.Samples_get_str_attributes(self)
3464
+
3465
+ def get_str_attributes_by_name(self, attr_name):
3466
+ r"""get_str_attributes_by_name(Samples self, string const & attr_name) -> StringVector"""
3467
+ return _medpython.Samples_get_str_attributes_by_name(self, attr_name)
3468
+
3469
+ def dilute(self, prob):
3470
+ r"""dilute(Samples self, float prob)"""
3471
+ return _medpython.Samples_dilute(self, prob)
3472
+
3473
+ def insertRec(self, *args):
3474
+ r"""
3475
+ insertRec(Samples self, int pid, int time, float outcome, int outcomeTime)
3476
+ insertRec(Samples self, int pid, int time, float outcome, int outcomeTime, float pred)
3477
+ insertRec(Samples self, int pid, int time)
3478
+ """
3479
+ return _medpython.Samples_insertRec(self, *args)
3480
+
3481
+ def version(self):
3482
+ r"""version(Samples self) -> int"""
3483
+ return _medpython.Samples_version(self)
3484
+
3485
+ def asSerializable(self):
3486
+ r"""asSerializable(Samples self) -> SerializableObject"""
3487
+ return _medpython.Samples_asSerializable(self)
3488
+
3489
+ def override_splits(self, nfolds):
3490
+ r"""override_splits(Samples self, int nfolds)"""
3491
+ return _medpython.Samples_override_splits(self, nfolds)
3492
+
3493
+ def set_samples(self, patients, _time=-1):
3494
+ r"""set_samples(Samples self, int * patients, int _time=-1)"""
3495
+ return _medpython.Samples_set_samples(self, patients, _time)
3496
+
3497
+ time_unit = property(MEDPY_GET_time_unit,MEDPY_SET_time_unit)
3498
+ idSamples = property(MEDPY_GET_idSamples,None)
3499
+
3500
+
3501
+ # Register Samples in _medpython:
3502
+ _medpython.Samples_swigregister(Samples)
3503
+ class SerializableObject(object):
3504
+ r"""Proxy of C++ MPSerializableObject class."""
3505
+
3506
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3507
+ __repr__ = _swig_repr
3508
+
3509
+ def __init__(self):
3510
+ r"""__init__(SerializableObject self) -> SerializableObject"""
3511
+ _medpython.SerializableObject_swiginit(self, _medpython.new_SerializableObject())
3512
+ __swig_destroy__ = _medpython.delete_SerializableObject
3513
+
3514
+ def version(self):
3515
+ r"""version(SerializableObject self) -> int"""
3516
+ return _medpython.SerializableObject_version(self)
3517
+
3518
+ def my_class_name(self):
3519
+ r"""my_class_name(SerializableObject self) -> string"""
3520
+ return _medpython.SerializableObject_my_class_name(self)
3521
+
3522
+ def get_size(self):
3523
+ r"""
3524
+ get_size() -> int
3525
+ Gets bytes sizes for serializations
3526
+ """
3527
+ return _medpython.SerializableObject_get_size(self)
3528
+
3529
+ def read_from_file(self, fname):
3530
+ r"""
3531
+ read_from_file(fname) -> int
3532
+ read and deserialize object
3533
+ """
3534
+ return _medpython.SerializableObject_read_from_file(self, fname)
3535
+
3536
+ def write_to_file(self, fname):
3537
+ r"""
3538
+ write_to_file(fname) -> int
3539
+ serialize object and write to file
3540
+ """
3541
+ return _medpython.SerializableObject_write_to_file(self, fname)
3542
+
3543
+ def read_from_file_unsafe(self, fname):
3544
+ r"""
3545
+ read_from_file_unsafe(fname) -> int
3546
+ read and deserialize model without checking version number - unsafe read
3547
+ """
3548
+ return _medpython.SerializableObject_read_from_file_unsafe(self, fname)
3549
+
3550
+ # Register SerializableObject in _medpython:
3551
+ _medpython.SerializableObject_swigregister(SerializableObject)
3552
+ class SigExporter(object):
3553
+ r"""Proxy of C++ MPSigExporter class."""
3554
+
3555
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3556
+ __repr__ = _swig_repr
3557
+
3558
+ def keys(self):
3559
+ r"""keys(SigExporter self) -> StringVector"""
3560
+ return _medpython.SigExporter_keys(self)
3561
+ sig_name = property(_medpython.SigExporter_sig_name_get, _medpython.SigExporter_sig_name_set, doc=r"""sig_name : std::string""")
3562
+ sig_id = property(_medpython.SigExporter_sig_id_get, _medpython.SigExporter_sig_id_set, doc=r"""sig_id : int""")
3563
+ sig_type = property(_medpython.SigExporter_sig_type_get, _medpython.SigExporter_sig_type_set, doc=r"""sig_type : int""")
3564
+ record_count = property(_medpython.SigExporter_record_count_get, _medpython.SigExporter_record_count_set, doc=r"""record_count : size_t""")
3565
+ record_count_updated = property(_medpython.SigExporter_record_count_updated_get, _medpython.SigExporter_record_count_updated_set, doc=r"""record_count_updated : bool""")
3566
+
3567
+ def __init__(self, rep, signame_str, pids_to_take, use_all_pids, translate_flag, free_sig_flag, filter_regex_str):
3568
+ 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"""
3569
+ _medpython.SigExporter_swiginit(self, _medpython.new_SigExporter(rep, signame_str, pids_to_take, use_all_pids, translate_flag, free_sig_flag, filter_regex_str))
3570
+
3571
+ def update_record_count(self):
3572
+ r"""update_record_count(SigExporter self)"""
3573
+ return _medpython.SigExporter_update_record_count(self)
3574
+
3575
+ def get_all_data(self):
3576
+ r"""get_all_data(SigExporter self)"""
3577
+ return _medpython.SigExporter_get_all_data(self)
3578
+
3579
+ def clear(self):
3580
+ r"""clear(SigExporter self)"""
3581
+ return _medpython.SigExporter_clear(self)
3582
+
3583
+ def transfer_column(self, key):
3584
+ r"""transfer_column(SigExporter self, std::string const & key)"""
3585
+ return _medpython.SigExporter_transfer_column(self, key)
3586
+
3587
+ def __getitem__(self, key):
3588
+ r"""__getitem__(SigExporter self, std::string const & key)"""
3589
+ return _medpython.SigExporter___getitem__(self, key)
3590
+
3591
+ def __iter__(self):
3592
+ r"""__iter__(SigExporter self) -> MPSigExporter_iter"""
3593
+ return _medpython.SigExporter___iter__(self)
3594
+
3595
+ def get_categorical_field_dict(self, field):
3596
+ r"""get_categorical_field_dict(SigExporter self, std::string const & field) -> StringVector"""
3597
+ return _medpython.SigExporter_get_categorical_field_dict(self, field)
3598
+
3599
+ def get_categorical_field_dict_int(self, field):
3600
+ r"""get_categorical_field_dict_int(SigExporter self, std::string const & field) -> IntVector"""
3601
+ return _medpython.SigExporter_get_categorical_field_dict_int(self, field)
3602
+
3603
+ def get_categorical_fields(self):
3604
+ r"""get_categorical_fields(SigExporter self) -> StringVector"""
3605
+ return _medpython.SigExporter_get_categorical_fields(self)
3606
+ __swig_destroy__ = _medpython.delete_SigExporter
3607
+
3608
+ # Register SigExporter in _medpython:
3609
+ _medpython.SigExporter_swigregister(SigExporter)
3610
+ class MPSigExporter_iter(object):
3611
+ r"""Proxy of C++ MPSigExporter_iter class."""
3612
+
3613
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3614
+
3615
+ def __init__(self, *args):
3616
+ r"""
3617
+ __init__(MPSigExporter_iter self, SigExporter o, StringVector keys_param) -> MPSigExporter_iter
3618
+ __init__(MPSigExporter_iter self, MPSigExporter_iter orig) -> MPSigExporter_iter
3619
+ """
3620
+ _medpython.MPSigExporter_iter_swiginit(self, _medpython.new_MPSigExporter_iter(*args))
3621
+
3622
+ def __next__(self):
3623
+ r"""__next__(MPSigExporter_iter self) -> std::string"""
3624
+ return _medpython.MPSigExporter_iter___next__(self)
3625
+
3626
+ def __repr__(self):
3627
+ r"""__repr__(MPSigExporter_iter self) -> std::string"""
3628
+ return _medpython.MPSigExporter_iter___repr__(self)
3629
+ __swig_destroy__ = _medpython.delete_MPSigExporter_iter
3630
+
3631
+ # Register MPSigExporter_iter in _medpython:
3632
+ _medpython.MPSigExporter_iter_swigregister(MPSigExporter_iter)
3633
+ class Split(object):
3634
+ r"""Proxy of C++ MPSplit class."""
3635
+
3636
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3637
+ __repr__ = _swig_repr
3638
+
3639
+ def __init__(self):
3640
+ r"""__init__(Split self) -> Split"""
3641
+ _medpython.Split_swiginit(self, _medpython.new_Split())
3642
+ __swig_destroy__ = _medpython.delete_Split
3643
+
3644
+ def MEDPY_GET_nsplits(self):
3645
+ r"""MEDPY_GET_nsplits(Split self) -> int"""
3646
+ return _medpython.Split_MEDPY_GET_nsplits(self)
3647
+
3648
+ def MEDPY_GET_pid2split(self):
3649
+ r"""MEDPY_GET_pid2split(Split self) -> IntIntMapAdaptor"""
3650
+ return _medpython.Split_MEDPY_GET_pid2split(self)
3651
+
3652
+ def clear(self):
3653
+ r"""clear(Split self)"""
3654
+ return _medpython.Split_clear(self)
3655
+
3656
+ def read_from_file(self, fname):
3657
+ r"""read_from_file(Split self, string const & fname) -> int"""
3658
+ return _medpython.Split_read_from_file(self, fname)
3659
+
3660
+ def write_to_file(self, fname):
3661
+ r"""write_to_file(Split self, string const & fname) -> int"""
3662
+ return _medpython.Split_write_to_file(self, fname)
3663
+
3664
+ nsplits = property(MEDPY_GET_nsplits,None)
3665
+ pid2split = property(MEDPY_GET_pid2split,None)
3666
+
3667
+
3668
+ # Register Split in _medpython:
3669
+ _medpython.Split_swigregister(Split)
3670
+ class Time(object):
3671
+ r"""Proxy of C++ MPTime class."""
3672
+
3673
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
3674
+ __repr__ = _swig_repr
3675
+
3676
+ def __init__(self):
3677
+ r"""__init__(Time self) -> Time"""
3678
+ _medpython.Time_swiginit(self, _medpython.new_Time())
3679
+ __swig_destroy__ = _medpython.delete_Time
3680
+
3681
+ # Register Time in _medpython:
3682
+ _medpython.Time_swigregister(Time)
3683
+ Time.Undefined = _medpython.cvar.Time_Undefined
3684
+ Time.Date = _medpython.cvar.Time_Date
3685
+ Time.Years = _medpython.cvar.Time_Years
3686
+ Time.Months = _medpython.cvar.Time_Months
3687
+ Time.Days = _medpython.cvar.Time_Days
3688
+ Time.Hours = _medpython.cvar.Time_Hours
3689
+ Time.Minutes = _medpython.cvar.Time_Minutes
3690
+ Time.DateTimeString = _medpython.cvar.Time_DateTimeString
3691
+
3692
+
3693
+ def get_public_objects():
3694
+ r"""get_public_objects() -> StringVector"""
3695
+ return _medpython.get_public_objects()
3696
+
3697
+
3698
+ __all__ = list(_medpython.get_public_objects())
3699
+
3700
+ """
3701
+ Enable stderr capturing under ipynb
3702
+ """
3703
+ class _stderr_fix:
3704
+ STDERR_FD = 2
3705
+ prevfd = None
3706
+ tmp = None
3707
+ reader = None
3708
+ is_in_ipynb = None
3709
+
3710
+ def in_ipynb(self):
3711
+ try:
3712
+ if str(type(get_ipython())) == "<class 'ipykernel.zmqshell.ZMQInteractiveShell'>":
3713
+ return True
3714
+ else:
3715
+ return False
3716
+ except NameError:
3717
+ return False
3718
+
3719
+ def __init__(self):
3720
+ from os import dup,dup2
3721
+ from tempfile import NamedTemporaryFile
3722
+ self.is_in_ipynb = self.in_ipynb()
3723
+ if self.is_in_ipynb:
3724
+ self.tmp = NamedTemporaryFile()
3725
+ self.prevfd = dup(self.STDERR_FD)
3726
+ dup2(self.tmp.fileno(), self.STDERR_FD)
3727
+ self.reader = open(self.tmp.name)
3728
+
3729
+ def __del__(self):
3730
+ if self.is_in_ipynb:
3731
+ from os import dup2
3732
+ dup2(self.prevfd, self.STDERR_FD)
3733
+
3734
+ def get_cerr(self):
3735
+ if self.is_in_ipynb:
3736
+ return self.reader.read()
3737
+ return ''
3738
+
3739
+
3740
+ _stderr_fix_instance = _stderr_fix()
3741
+
3742
+
3743
+ def cerr():
3744
+ return _stderr_fix_instance.get_cerr()
3745
+
3746
+
3747
+ """
3748
+ Enable iterators on vector and map adaptor objects
3749
+ """
3750
+
3751
+
3752
+ class MapAdaptorKeyIter:
3753
+ def __init__(self,o):
3754
+ self.obj = o.keys()
3755
+ self.i = 0
3756
+ self.prev_i = None
3757
+ self.max_i = len(self.obj)
3758
+ def __next__(self):
3759
+ if self.i >= self.max_i:
3760
+ raise StopIteration
3761
+ else:
3762
+ self.prev_i, self.i = self.i, self.i+1
3763
+ return self.obj[self.prev_i]
3764
+ def next(self):
3765
+ return self.__next__()
3766
+
3767
+
3768
+ class IntIndexIter:
3769
+ def __init__(self,o):
3770
+ self.obj = o
3771
+ self.i = 0
3772
+ self.prev_i = None
3773
+ self.max_i = len(o)
3774
+ def __next__(self):
3775
+ if self.i >= self.max_i:
3776
+ raise StopIteration
3777
+ else:
3778
+ self.prev_i, self.i = self.i, self.i+1
3779
+ return self.obj[self.prev_i]
3780
+ def next(self):
3781
+ return self.__next__()
3782
+
3783
+ def __to_df_imp(self):
3784
+ import pandas as pd
3785
+ return pd.DataFrame.from_dict(dict(self.MEDPY__to_df()))
3786
+
3787
+ def __from_df_imp(self, df):
3788
+ import re
3789
+ adaptor = self.MEDPY__from_df_adaptor()
3790
+ type_requirements = dict(adaptor.type_requirements)
3791
+ for col_name in df.columns:
3792
+ for col_req_name in type_requirements:
3793
+ if re.match('^'+col_req_name+'$',col_name):
3794
+ if str(df[col_name].dtype) != type_requirements[col_req_name]:
3795
+ df[col_name] = df[col_name].astype(type_requirements[col_req_name],copy=False)
3796
+ adaptor.import_column(col_name ,df[col_name].values)
3797
+ self.MEDPY__from_df(adaptor)
3798
+
3799
+
3800
+ def ___fix_vecmap_iter():
3801
+ from inspect import isclass
3802
+ glob = globals()
3803
+ for i in glob:
3804
+ o = glob[i]
3805
+ try:
3806
+ if (isclass(o) and '__len__' in dir(o) and '__getitem__' in dir(o) and not '__iter__' in dir(o)
3807
+ and i.endswith('VectorAdaptor')) :
3808
+ setattr(o, '__iter__', lambda x: IntIndexIter(x))
3809
+ elif (isclass(o) and '__getitem__' in dir(o) and 'keys' in dir(o) and not '__iter__' in dir(o)
3810
+ and i.endswith('MapAdaptor')) :
3811
+ setattr(o, '__iter__', lambda x: MapAdaptorKeyIter(x))
3812
+ if (isclass(o) and 'MEDPY__from_df' in dir(o) and 'MEDPY__from_df_adaptor' in dir(o)):
3813
+ setattr(o, 'from_df', __from_df_imp)
3814
+ if (isclass(o) and 'MEDPY__to_df' in dir(o)):
3815
+ setattr(o, 'to_df', __to_df_imp)
3816
+ except: pass
3817
+
3818
+ ___fix_vecmap_iter()
3819
+
3820
+
3821
+
3822
+ """
3823
+ External Methods in addition to api
3824
+ """
3825
+ 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':
3826
+ """get_sig(signame [, translate=True][, pids=None, float32to64=True][,regex_str = None]) -> Pandas DataFrame
3827
+ translate : If True, will decode categorical fields into a readable representation in Pandas
3828
+ pid : If list is provided, will load only pids from the given list
3829
+ If 'All' is provided, will use all available pids
3830
+ float32to64 : If True, will convert all float32 columns to float64
3831
+ free_signal : If True, will free signal memory as soon as it is loaded into export arrays
3832
+ regex_str : string (if string, defualt column is 'val') or dictionary between column name (e.g, 'val') to regex string to filter
3833
+ regex_filter : string to filter categories paretns this match regex
3834
+ """
3835
+ import pandas as pd
3836
+ import numpy as np
3837
+ use_all_pids = 0
3838
+ if isinstance(pids, str) and pids.upper()=='ALL':
3839
+ use_all_pids = 1
3840
+ pids=list()
3841
+ if pids is None: pids=list()
3842
+ df = self.export_to_numpy(sig_name_str, pids, use_all_pids, int(translate), int(free_signal), regex_filter)
3843
+
3844
+
3845
+ cat_dict = dict()
3846
+ cat_dict_int = dict()
3847
+ if translate:
3848
+ for fld in df.get_categorical_fields():
3849
+ cat_dict[fld] = df.get_categorical_field_dict(fld)
3850
+ cat_dict_int[fld] = df.get_categorical_field_dict_int(fld)
3851
+ df = dict(df)
3852
+ df = pd.DataFrame.from_dict(df)
3853
+
3854
+ if not (regex_str is None):
3855
+ dict_id = self.dict_section_id(sig_name_str)
3856
+ if (dict_id == 0):
3857
+ print("Invalid sig name - skip filter")
3858
+ else:
3859
+ if not(type(regex_str) == dict):
3860
+ regex_str = {'val' : regex_str}
3861
+
3862
+ for fld in regex_str:
3863
+ lut = self.get_lut_from_regex(dict_id, regex_str[fld])
3864
+ lut_np = np.array(lut)
3865
+ if translate:
3866
+ lut_np = lut_np[np.array(cat_dict_int[fld])]
3867
+ tt = df[fld].astype(int).values
3868
+ df = df[lut_np[tt - 1]].reset_index(drop=True) # values start from 1
3869
+ if float32to64:
3870
+ for column_name in df:
3871
+ if df[column_name].dtype == np.float32:
3872
+ df[column_name] = df[column_name].astype(np.float64)
3873
+ if not translate:
3874
+ return df
3875
+ for fld in cat_dict:
3876
+ df[fld] = pd.Categorical.from_codes(codes=df[fld],categories=cat_dict[fld])
3877
+ return df
3878
+
3879
+ def __features__to_df_imp(self):
3880
+ import pandas as pd
3881
+ featMatFull = Mat()
3882
+ self.get_as_matrix(featMatFull)
3883
+ featMatFullNew = featMatFull.get_numpy_view_unsafe()
3884
+ col_names = self.get_feature_names()
3885
+ dfFeatures2 = pd.DataFrame(data = featMatFullNew, columns = col_names )
3886
+
3887
+ samps = Samples()
3888
+ self.get_samples(samps)
3889
+ samps_df = samps.to_df()
3890
+ out = pd.concat([samps_df,dfFeatures2], axis=1, copy=False)
3891
+ return out
3892
+
3893
+ def __features__from_df_imp(self, features_df):
3894
+ # Dataframe to MedFeatures:
3895
+
3896
+ mat = Mat()
3897
+ samples = Samples()
3898
+ ind_sampes = features_df.columns.str.contains('pred_\\d+') | features_df.columns.isin(['id', 'split', 'time', 'outcome', 'outcomeTime'])
3899
+ featuresNames = features_df.columns[~(ind_sampes)]
3900
+ # Build data matrix
3901
+ mat.set_signals(StringVector(list(featuresNames)))
3902
+ mat.load_numpy(features_df.loc[:,features_df.columns[~(ind_sampes)]].values)
3903
+ self.set_as_matrix(mat)
3904
+ # append Samples
3905
+ samples.from_df(features_df.loc[:,features_df.columns[ind_sampes]])
3906
+ self.append_samples(samples)
3907
+
3908
+ def __bootstrapResult_to_df(self):
3909
+ import pandas as pd
3910
+ dict_obj={'Cohort' : [], 'Measurement': [], 'Value': []}
3911
+ for cohort in self.keys():
3912
+ cohort_res=self[cohort]
3913
+ for measure in cohort_res.keys():
3914
+ dict_obj['Cohort'].append(cohort)
3915
+ dict_obj['Measurement'].append(measure)
3916
+ dict_obj['Value'].append(cohort_res[measure])
3917
+ df=pd.DataFrame(dict_obj)
3918
+ return df
3919
+
3920
+ def convert_to_bootstrap_input(x, arg_name=None):
3921
+ import pandas as pd
3922
+ import numpy as np
3923
+ if type(x) is list:
3924
+ x=np.array(x)
3925
+ if type(x) is np.ndarray:
3926
+ x=x.astype(float)
3927
+ if type(x) is pd.Series:
3928
+ x=x.astype(float).to_numpy()
3929
+ if np.isnan(x).sum()>0:
3930
+ if arg_name is None:
3931
+ raise NameError('Error - input array has nan inside')
3932
+ else:
3933
+ raise NameError('Error - input array %s has nan inside'%(arg_name))
3934
+ return x
3935
+
3936
+ def __bootstrap_wrapper(self, preds, labels):
3937
+ import pandas as pd
3938
+ import numpy as np
3939
+ preds=convert_to_bootstrap_input(preds, 'preds')
3940
+ labels=convert_to_bootstrap_input(labels, 'labels')
3941
+ res = self._bootstrap(preds, labels)
3942
+ return res
3943
+
3944
+ def __bootstrap_pid_wrapper(self, pids, preds, labels):
3945
+ import pandas as pd
3946
+ import numpy as np
3947
+ pids=convert_to_bootstrap_input(pids, 'pids')
3948
+ preds=convert_to_bootstrap_input(preds, 'preds')
3949
+ labels=convert_to_bootstrap_input(labels, 'labels')
3950
+ res = self._bootstrap_pid(pids, preds, labels)
3951
+ return res
3952
+
3953
+ def __btsimple_to_df(self):
3954
+ import pandas as pd
3955
+ dict_obj={'Measurement': [], 'Value': []}
3956
+ for measure in self.keys():
3957
+ dict_obj['Measurement'].append(measure)
3958
+ dict_obj['Value'].append(self[measure])
3959
+ df=pd.DataFrame(dict_obj)
3960
+ return df
3961
+
3962
+ def __get_model_weights(self) -> str:
3963
+ """
3964
+ Returns the model as json
3965
+ """
3966
+ import re
3967
+ js_model_outputs = self.get_model_weights_info()
3968
+ reg_unquoted = re.compile(r'(?<=[:\[,])\s*(?![{\["\'\d])([A-Za-z]+::[0-9]+)(?=\s*[,}\]])')
3969
+ fixed_text = reg_unquoted.sub(r'"\1"', js_model_outputs)
3970
+ return fixed_text
3971
+
3972
+ def __bind_external_methods():
3973
+ setattr(globals()['PidRepository'],'get_sig', __export_to_pandas)
3974
+ setattr(globals()['Features'],'to_df', __features__to_df_imp)
3975
+ setattr(globals()['Features'],'from_df', __features__from_df_imp)
3976
+ setattr(globals()['StringBtResultMap'],'to_df', __bootstrapResult_to_df)
3977
+ setattr(globals()['StringFloatMapAdaptor'],'to_df', __btsimple_to_df)
3978
+ setattr(globals()['Bootstrap'],'bootstrap', __bootstrap_wrapper)
3979
+ setattr(globals()['Bootstrap'],'bootstrap_pid', __bootstrap_pid_wrapper)
3980
+ setattr(globals()['Model'],'get_model_arch_json', __get_model_weights)
3981
+
3982
+ __bind_external_methods()
3983
+
3984
+ """
3985
+ Remove SWIG's global variable access which makes issues for reflection actions
3986
+ #if 'cvar' in __dict__: del cvar
3987
+ """
3988
+ try:
3989
+ del cvar
3990
+ except: pass
3991
+
3992
+ Global = GlobalClass()
3993
+
3994
+
3995
+