Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 59d1d48

Browse files
committed
small fix
1 parent 2ea0c08 commit 59d1d48

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

mljar/mljar.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ def _wait_till_all_models_trained(self):
196196
WAIT_INTERVAL = 10.0
197197
loop_max_counter = 24*360 # 24 hours of max waiting, is enough ;)
198198
results = None
199+
max_error_cnt = 5
200+
current_error_cnt = 0
199201
while True:
200202
loop_max_counter -= 1
201203
if loop_max_counter <= 0:
@@ -222,6 +224,9 @@ def _wait_till_all_models_trained(self):
222224
break
223225
except Exception as e:
224226
logger.error('There is some problem while waiting for models, %s' % str(e))
227+
current_error_cnt += 1
228+
if current_error_cnt >= max_error_cnt:
229+
break
225230
logger.info('Get the best result')
226231
print '' # add new line
227232
# get the best result!
@@ -325,11 +330,11 @@ def predict(self, X):
325330

326331

327332
@staticmethod
328-
def compute_prediction(X, model_id, project_id, keep_dataset = False):
333+
def compute_prediction(X, model_id, project_id, keep_dataset = False, dataset_title = None):
329334

330335

331336
# chack if dataset exists in mljar if not upload dataset for prediction
332-
dataset = DatasetClient(project_id).add_dataset_if_not_exists(X, y = None)
337+
dataset = DatasetClient(project_id).add_dataset_if_not_exists(X, y = None, title_prefix = 'Testing-', dataset_title = dataset_title)
333338

334339
# check if prediction is available
335340
total_checks = 1000

0 commit comments

Comments
 (0)