-
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 an example for logistic regression
- Loading branch information
Showing
2 changed files
with
57 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
sknni: 0.1 | ||
|
||
# Datasource is how you specify which callable | ||
# sknni will invoke to get the data | ||
dataSource: | ||
reader: sknni.datasource.NpzClassificationSource | ||
params: | ||
# Note - dir_path is a parameter name for NpzClassificationSource | ||
# if you create another datasource then specify the arguments of the callable | ||
# as per your datasource | ||
dir_path: /Users/ksachdeva/Desktop/Dev/myoss/scikit-nni/examples/data/multiclass-classification | ||
|
||
# This is how you specify a pipeline and steps | ||
# In this example there are 3 steps - normalizer, pca and logistic regression | ||
# Please note that you would have to specify the fully qualified name for the classes | ||
sklearnPipeline: | ||
name: normalizer_svc | ||
steps: | ||
normalizer: sklearn.preprocessing.Normalizer | ||
pca: sklearn.decomposition.PCA | ||
logistic_regression: sklearn.linear_model.LogisticRegression | ||
|
||
# This section is more or less compliant with the NNI's | ||
# way of specifying the hyper parameters except that you | ||
# should specify them with their corresponding step using the | ||
# same name as you used earlier in the pipeline definition | ||
nniConfigSearchSpace: | ||
# do not need any params for normalizer as default is L2 | ||
# and for this classification task L2 is what is needed | ||
- pca: | ||
n_components: | ||
_type: choice | ||
_value: [64,128] | ||
- logistic_regression: | ||
C: | ||
_type: uniform | ||
_value: [0.1,1] | ||
|
||
|
||
# This is exactly same as the one that of NNI | ||
# except that you do not have to specify the command | ||
# and code fields. They are automatically added by the sknni generator | ||
nniConfig: | ||
authorName: ksachdeva | ||
experimentName: pca-logistic-regression | ||
trialConcurrency: 1 | ||
maxExecDuration: 1h | ||
maxTrialNum: 100 | ||
trainingServicePlatform: local | ||
useAnnotation: false | ||
tuner: | ||
builtinTunerName: TPE | ||
classArgs: | ||
optimize_mode: maximize | ||
trial: | ||
gpuNum: 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