Skip to content

Commit

Permalink
add alg name in learner
Browse files Browse the repository at this point in the history
  • Loading branch information
pplonski committed Nov 12, 2018
1 parent e0e6e10 commit 4b83d72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion supervised/models/learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ class Learner():
def __init__(self, params):
self.params = params
self.stop_training = False
self.version = None
self.library_version = None
self.algorithm_name = 'Unknown'
self.algorithm_short_name = 'Unknown'
self.model = None
self.uid = str(uuid.uuid4())

Expand Down
4 changes: 3 additions & 1 deletion supervised/models/learner_xgboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class XgbLearner(Learner):
'''
def __init__(self, params):
Learner.__init__(self, params)
self.version = xgb.__version__
self.library_version = xgb.__version__
self.algorithm_name = 'Extreme Gradient Boosting'
self.algorithm_short_name = 'Xgboost'
self.model_file = self.uid + '.xgb.model'
self.model_file_path = '/tmp/' + self.model_file

Expand Down
1 change: 1 addition & 0 deletions supervised/models/tests/test_learner_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ def test_fit(self):
'eval_metric': 'logloss'
}
learner = LearnerFactory.get_learner(params)
self.assertEqual(learner.algorithm_short_name, 'Xgboost')

0 comments on commit 4b83d72

Please sign in to comment.