Beispiel #1
0
    def __init__(self, km, fh):
        self.utils_cl = MyUtils()
        self.km = km
        self.fh = fh
        self.cm = ClusteringMachine()

        logging.info("Wrappers instantiated")
Beispiel #2
0
    def __init__(self):
        logging.info(pk.getKhiopsInfo())
        self.this_file_dir = os.path.dirname(os.path.realpath(__file__))

        # path mgmt
        # use timestamp of each exec in paths
        self.fh = FileHelper()
        self.dictionary_file = os.path.join(self.this_file_dir, "dic",
                                            "series.kdic")
        self.classif_res = os.path.join(self.this_file_dir, "res",
                                        "khiops_res", "classif")
        self.coclus_res = os.path.join(self.this_file_dir, "res", "khiops_res",
                                       "coclus")
        self.pred_res = os.path.join(self.this_file_dir, "res", "khiops_res",
                                     "pred_res")

        self.fh.ensure_dirs_exist([
            self.dictionary_file, self.classif_res, self.coclus_res,
            self.pred_res
        ])

        self.ccr = CoclusteringResults()
        self.utils = MyUtils()
        logging.info("Khiops manager instantiated")
        logging.info("dictionary_file used: %s", self.dictionary_file)
 def __init__(self, file_name):
     self.utils_cl = MyUtils()
     self.this_file_dir = os.path.dirname(os.path.realpath(__file__))
     self.fh = FileHelper()
     self.hm = HmmMachine()
     self.cm = ClusteringMachine()
     self.pm = PredictMachine()
     self.my_metric = "euclidean"
     self.file_name = file_name
     self.out_fcasts_f = os.path.join(self.this_file_dir, "res", "fcasts", file_name, "ecml")
     self.fh.ensure_dirs_exist([self.out_fcasts_f])
     logging.info("Instantiated ECML_operator")
Beispiel #4
0
    }, requests.codes.bad, "error"),
    ({
        "email": "peter@klaven"
    }, requests.codes.bad, "error"),
    ({
        "email": "1",
        "password": "******"
    }, requests.codes.not_found, "error"),
    ({}, requests.codes.bad, "error"),
]

ids_list = [
    "successful", "w/o email", "w/o password", "invalid email/password",
    "w/o parameters"
]
u = MyUtils()


@pytest.fixture(scope='function', params=param_list, ids=ids_list)
def param_test(request):
    return request.param


class TestClass():

    login_request = "api/login"
    email = "peter@klaven"
    password = "******"

    @allure.feature("Login")
    @allure.testcase("Login")
Beispiel #5
0
# Bunch of cleanings for empty files
from file_helper import FileHelper
fh = FileHelper(tstmp)
fh.clean_zips_folder()
fh.clean_res_folder(out_dir_res)
fh.ensure_dirs_exist([out_path_res, in_dir, out_dir_res, out_dir_khiops, out_dir_fcasts])

# After cleaning, zip the code which is executed now
fh.zip_code()

# Init objects
from khiops import KhiopsManager
km    = KhiopsManager()

from my_utils import MyUtils
utils = MyUtils()

from ecml_machine import ECMLMachine

from clustering_machine import ClusteringMachine
cm    = ClusteringMachine()

from wrappers import Wrappers
wrapper = Wrappers(km, fh)

# Read configuration file: which input data to use?
import json
with open(os.path.join(this_file_dir, "conf", "conf_lite.json"), 'r') as f:
    confs = json.load(f)

# Init res files
Beispiel #6
0
# one-hotエンコード用
OHE_COLUMNS = ['sales', 'salary']

# 評価指標を選択
# metrics
# accuracy, precision, recall, f1, auc
metrics = 'accuracy'
# metrics = 'precision'
# metrics = 'recall'
# metrics = 'f1'
# metrics = 'auc'

selector_method = 'RFE'
# selector_method = 'PCA'

myutils = MyUtils('./param_clf.yml', OBJ_TYPE, metrics)

print(myutils.get_str_timestamp())

# mode = 'train'
mode = 'score'

if mode == 'train':

    # データ読み込み
    _, X, y = myutils.read_data(TRAIN_PATH)

    # 前処理
    X = myutils.train_data__preprocessing_with_imputer(X, OHE_COLUMNS)

    # 初回探索
 def __init__(self):
     self.utils_cl = MyUtils()
     logging.info("HMM machine instantiated")