Classify and Ensemble¶
Trainer¶
-
class
caver.
Trainer
(model_name, data_path, **kwargs)[source]¶ -
You can pass your own config as parameters to replace default value in
caver.config.Config
.GPU will be used if available.
Caver¶
-
class
caver.
Caver
(model_name, model_path, data_path='', **kwargs)[source]¶ - Parameters
You can pass your own config as parameters to replace default value in
caver.config.Config
and model config.
Ensemble¶
-
class
caver.
EnsembleModel
(models, model_ratio)[source]¶ - Parameters
For now, this only support soft voting methods.
-
gmean
(models_preds)[source]¶ geometric mean
when class parameter model_ratio is not empty list, calculate weighted harmonic mean
- Parameters
models_preds (list) – list of model predict probability
- Returns
ensemble predict probability for sentences
-
hmean
(models_preds)[source]¶ harmonic mean
when class parameter model_ratio is not empty list, calculate weighted harmonic mean
- Parameters
models_preds (list) – list of model predict probability
- Returns
ensemble predict probability for sentences
-
mean
(models_preds)[source]¶ arithmetic mean
when class parameter model_ratio is not empty list, calculate weighted arithmetic mean
- Parameters
models_preds (list) – list of model predict probability
- Returns
ensemble predict probability for sentences