Skip to content

Commit ff4c17f

Browse files
committed
:Merge branch 'release_01' of https://github.com/ECP-Candle/Benchmarks into release_01
2 parents f7ed4d1 + 6142754 commit ff4c17f

File tree

5 files changed

+675
-63
lines changed

5 files changed

+675
-63
lines changed

Pilot1/Combo/combo_default_model.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ rng_seed=2017
2525
save='save/combo'
2626
gen=False
2727
use_combo_score=False
28-
verbose=False
28+
verbose = False
2929

3030
[Monitor_Params]
3131
solr_root=''

Pilot1/Uno/skwrapper.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def categorize_dataframe(df, ycol='0', bins=5, cutoffs=None, verbose=False):
151151

152152

153153
def make_group_from_columns(df, groupcols):
154-
return df[groupcols].astype(str).sum(axis=1).as_matrix()
154+
return df[groupcols].astype(str).sum(axis=1).values
155155

156156

157157
def summarize(df, ycol='0', classify=False, bins=0, cutoffs=None, min_count=0):
@@ -188,8 +188,8 @@ def split_data(df, ycol='0', classify=False, cv=5, bins=0, cutoffs=None, groupco
188188
if ycol.isdigit():
189189
ycol = df.columns[int(ycol)]
190190

191-
y = df.loc[:, ycol].as_matrix()
192-
x = df.drop(ycol, axis=1).as_matrix()
191+
y = df.loc[:, ycol].values
192+
x = df.drop(ycol, axis=1).values
193193
features = df.drop(ycol, axis=1).columns.tolist()
194194

195195
if verbose:
@@ -242,10 +242,13 @@ def verify_path(path):
242242
os.makedirs(folder)
243243

244244

245-
def train(model, x, y, features=None, classify=False, threads=-1, prefix='', name=None, save=False):
245+
def train(model, x, y, features=None, classify=False, threads=-1, prefix='', name=None, save=False, verbose=True):
246246
verify_path(prefix)
247247
model, model_name = get_model(model, threads, classify=classify)
248248
model.fit(x, y)
249+
if verbose:
250+
train_score = model.score(x, y)
251+
print('Train score = {:.3f}'.format(train_score))
249252
name = name or model_name
250253
if save:
251254
model_desc_fname = "{}.{}.description".format(prefix, name)
@@ -284,7 +287,7 @@ def classify(model, x, y, splits, features, threads=-1, prefix='', seed=0):
284287
test_score = model.score(x_test, y_test)
285288
train_scores.append(train_score)
286289
test_scores.append(test_score)
287-
print(" fold {}/{}: score = {:.3f}".format(i+1, len(splits), test_score))
290+
print(" fold {}/{}: score = {:.3f} (train = {:.3f})".format(i+1, len(splits), test_score, train_score))
288291
if test_score > best_score:
289292
best_model = model
290293
best_score = test_score
@@ -360,7 +363,7 @@ def regress(model, x, y, splits, features, threads=-1, prefix='', seed=0):
360363
test_score = model.score(x_test, y_test)
361364
train_scores.append(train_score)
362365
test_scores.append(test_score)
363-
print(" fold {}/{}: score = {:.3f}".format(i+1, len(splits), test_score))
366+
print(" fold {}/{}: score = {:.3f} (train = {:.3f})".format(i+1, len(splits), test_score, train_score))
364367
if test_score > best_score:
365368
best_model = model
366369
best_score = test_score

Pilot2/P2B1/p2b1_default_model.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ drop_prob = 0.5
1717
data_set='3k_Ordered'
1818
sampling_density = 0.15
1919
save_path='.'
20+
backend = 'tensorflow'

0 commit comments

Comments
 (0)