-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat - add support to specify the arguments for various steps in pipe…
…line / requires changes to the syntax in sklearnPipeline section
- Loading branch information
Showing
10 changed files
with
115 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[bumpversion] | ||
current_version = 0.1.1 | ||
current_version = 0.2.0 | ||
commit = True | ||
tag = True | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Top-level package for scikit-nni.""" | ||
|
||
__author__ = """Kapil Sachdeva""" | ||
__email__ = 'notanemail@email.com' | ||
__version__ = '0.1.1' | ||
__version__ = '0.2.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env python | ||
|
||
import unittest | ||
import yaml | ||
|
||
from sknni.internals import PipelineBuilder | ||
from sklearn.preprocessing import Normalizer | ||
|
||
from lightgbm import LGBMClassifier | ||
|
||
|
||
class TestPipelineBuilder(unittest.TestCase): | ||
"""Tests for `sknni` package.""" | ||
def setUp(self): | ||
"""Set up test fixtures, if any.""" | ||
pass | ||
|
||
def tearDown(self): | ||
"""Tear down test fixtures, if any.""" | ||
pass | ||
|
||
def test_estimator_arguments(self): | ||
""" Tests setting the arguments which are not in the search space """ | ||
simple_config = yaml.load(""" | ||
sklearnPipeline: | ||
name: normalizer_lightgbm | ||
steps: | ||
normalizer: | ||
type: sklearn.preprocessing.Normalizer | ||
lightgbm: | ||
type: lightgbm.LGBMClassifier | ||
classArgs: | ||
objective: multiclass | ||
nniConfigSearchSpace: | ||
- lightgbm: | ||
num_leaves: | ||
_type: choice | ||
_value: [31,41,51] | ||
boosting_type: | ||
_type: choice | ||
_value: [gbdt, goss, dart] | ||
""") | ||
|
||
print(simple_config) | ||
|
||
pipeline = PipelineBuilder(simple_config)({ | ||
'lightgbm_num_leaves': | ||
31, | ||
'lightgbm_boosting_type': | ||
'goss' | ||
}) | ||
|
||
assert len(pipeline.named_steps.keys()) == 2 | ||
assert isinstance(pipeline.named_steps['normalizer'], Normalizer) | ||
assert isinstance(pipeline.named_steps['lightgbm'], LGBMClassifier) | ||
|
||
assert pipeline.named_steps['lightgbm'].num_leaves == 31 | ||
assert pipeline.named_steps['lightgbm'].objective == 'multiclass' | ||
assert pipeline.named_steps['lightgbm'].boosting_type == 'goss' | ||
|
||
def test_command_line_interface(self): | ||
pass |