judithabk6 / med_bench

BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

refactorizing parts of the code #60

Open houssamzenati opened 6 months ago

houssamzenati commented 6 months ago

some functions inside estimators have common blocks that need to be refactorize, for example the block :

 if regularization:
        cs = ALPHAS
    else:
        cs = [np.inf]
    n = len(t)
    if crossfit < 2:
        train_test_list = [[np.arange(n), np.arange(n)]]
    else:
        kf = KFold(n_splits=crossfit)
        train_test_list = list()
        for train_index, test_index in kf.split(x):
            train_test_list.append([train_index, test_index])

is present in many estimators.

I will create a PR very soon to propose updates on the code.