123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- # -*- coding: utf-8 -*-
- from collections import namedtuple
- from enum import Enum
- class Dataset(Enum):
- CMC = 'cmc'
- MGM = 'mgm'
- ADULT = 'adult'
- CAHOUSING = 'cahousing'
- def __str__(self):
- return self.value
- def __eq__(self, other):
- return str(other) == self.value
- class AnonMethod(Enum):
- OLA = 'ola'
- MONDRIAN = 'mondrian'
- TDG = 'tdg'
- CB = 'cb'
- def __str__(self):
- return self.value
- def __eq__(self, other):
- return str(other) == self.value
- class Classifier(Enum):
- RF = 'rf'
- KNN = 'knn'
- SVM = 'svm'
- XGB = 'xgb'
- def __str__(self):
- return self.value
- def __eq__(self, other):
- return str(other) == self.value
- MLRes = namedtuple("MLRes", ['acc', 'precision', 'recall', 'f1_score'])
- # python3.6
- MLRes.__new__.__defaults__ = (['accuracy'], ['precision'], ['recall'], ['f1'])
|