phylokrr-dev 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/PKG-INFO +1 -1
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/phylokrr_dev.egg-info/PKG-INFO +1 -1
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/setup.py +1 -1
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/src/block_cross_validation.py +8 -5
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/src/utils.py +1 -1
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/README.md +0 -0
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/phylokrr_dev.egg-info/SOURCES.txt +0 -0
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/phylokrr_dev.egg-info/dependency_links.txt +0 -0
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/phylokrr_dev.egg-info/not-zip-safe +0 -0
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/phylokrr_dev.egg-info/requires.txt +0 -0
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/phylokrr_dev.egg-info/top_level.txt +0 -0
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/setup.cfg +0 -0
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/src/__init__.py +0 -0
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/src/alpha_beta_weighting.py +0 -0
- {phylokrr_dev-0.2.0 → phylokrr_dev-0.2.1}/src/phyloKPQL.py +0 -0
|
@@ -11,7 +11,7 @@ with open('README.md') as readme_file:
|
|
|
11
11
|
readme = readme_file.read()
|
|
12
12
|
|
|
13
13
|
setup(name = "phylokrr_dev",
|
|
14
|
-
version = '0.2.
|
|
14
|
+
version = '0.2.1',
|
|
15
15
|
# long_description = readme,
|
|
16
16
|
# long_description_content_type = 'text/markdown',
|
|
17
17
|
packages = ['phylokrr_dev'],
|
|
@@ -79,7 +79,7 @@ def pick_init_index(P_index, P_r, seed):
|
|
|
79
79
|
return init_idx
|
|
80
80
|
|
|
81
81
|
def init_model(X_train, y_train, vcv_train, model,
|
|
82
|
-
param_init,
|
|
82
|
+
param_init, verbose = False):
|
|
83
83
|
"""
|
|
84
84
|
Initialize the model.
|
|
85
85
|
This initialization of the model is used at the beginning of every
|
|
@@ -111,7 +111,8 @@ def init_model(X_train, y_train, vcv_train, model,
|
|
|
111
111
|
time_start = time.time()
|
|
112
112
|
model.fit(X_train, y_train, vcv_train)
|
|
113
113
|
time_end = time.time()
|
|
114
|
-
|
|
114
|
+
if verbose:
|
|
115
|
+
print(f"Initial model fit time: {time_end - time_start:.2f} seconds")
|
|
115
116
|
|
|
116
117
|
# for the next iteration alpha is used
|
|
117
118
|
model.warm_start = False
|
|
@@ -168,7 +169,8 @@ def k_fold_cv_weigthed(X, y, vcv, model, W,
|
|
|
168
169
|
|
|
169
170
|
# O(n^3*folds*sample)
|
|
170
171
|
for i, (train_idx, test_idx) in enumerate(myfolds):
|
|
171
|
-
|
|
172
|
+
if verbose:
|
|
173
|
+
print("Fold: ", i)
|
|
172
174
|
# print(test_idx)
|
|
173
175
|
X_train, X_test = X[train_idx, :], X[test_idx, :]
|
|
174
176
|
y_train, y_test = y[train_idx], y[test_idx]
|
|
@@ -198,7 +200,7 @@ def k_fold_cv_weigthed(X, y, vcv, model, W,
|
|
|
198
200
|
# specified hyperparameter. This initial alpha is
|
|
199
201
|
# used for all the folds
|
|
200
202
|
init_model(X_train, y_train, vcv_train,
|
|
201
|
-
model, param_init,
|
|
203
|
+
model, param_init, verbose = verbose)
|
|
202
204
|
|
|
203
205
|
# init_err1 = model.score(X_test, y_test, vcv_test_12)*len(y_test)
|
|
204
206
|
# init_err2 = model.score(X_test, y_test, None)*len(y_test)
|
|
@@ -208,8 +210,9 @@ def k_fold_cv_weigthed(X, y, vcv, model, W,
|
|
|
208
210
|
|
|
209
211
|
all_errors.append([init_idx, init_err])
|
|
210
212
|
|
|
213
|
+
pb = progressbar(P_r, prefix = "Evaluating hyperparameters: ", size=40) if verbose else P_r
|
|
211
214
|
j = 0
|
|
212
|
-
for p_j in
|
|
215
|
+
for p_j in pb:
|
|
213
216
|
|
|
214
217
|
if j == init_idx:
|
|
215
218
|
continue
|
|
@@ -15,7 +15,7 @@ def progressbar(it, prefix="", size=60, out=sys.stdout):
|
|
|
15
15
|
remaining = ((time.time() - start) / j) * (count - j)
|
|
16
16
|
mins, sec = divmod(remaining, 60) # limited to minutes
|
|
17
17
|
time_str = f"{int(mins):02}:{sec:03.1f}"
|
|
18
|
-
print(f"{prefix}[{u'
|
|
18
|
+
print(f"{prefix}[{u'*'*x}{('.'*(size-x))}] {j}/{count} Est wait {time_str}", end='\r', file=out, flush=True)
|
|
19
19
|
show(0.1) # avoid div/0
|
|
20
20
|
for i, item in enumerate(it):
|
|
21
21
|
yield item
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|