__init__.py 839 Bytes
Newer Older
1 2 3 4 5 6
from .classifier import Classifier

try:
    import weka.core.jvm as jvm
    jvm.start()

7
    from .weka_classifiers import WekaClassifiers
8
except:
9
    WekaClassifiers = None
10 11 12 13 14 15 16 17 18 19

__all__ = ["classifier",
           "weka_classifiers"]


from collections import OrderedDict
from util.config import Config


_classifier_list = OrderedDict( [ 
20 21
                            ["weka_classifiers", Config("Invalid" if WekaClassifiers is None else WekaClassifiers().get_name(),
                                WekaClassifiers is not None, bool, meta=WekaClassifiers, hidden=WekaClassifiers is None)]
22 23 24 25 26 27 28
                        ] )

def get_classifier_config():
    return _classifier_list

def set_classifier_config(configs):
    _classifier_list["weka_classifiers"] = Config.nvl_config(configs["weka_classifiers"], _classifier_list["weka_classifiers"])