dffml icon indicating copy to clipboard operation
dffml copied to clipboard

Tune function and CLI command

Open seraphimstreets opened this issue 3 years ago • 0 comments

Created tune function in high_level.ml, and allowed usage via CLI. First step as part of the AutoML GSOC project: #968.

Testing

Tested tune command with the tuner ParameterGrid and XGBClassifier model (iris dataset), XGBRegressor (Small housing dataset). Example CLI command is as follows:

Download Iris datasets:

wget http://download.tensorflow.org/data/iris_training.csv 
wget http://download.tensorflow.org/data/iris_test.csv 
sed -i 's/.*setosa,versicolor,virginica/SepalLength,SepalWidth,PetalLength,PetalWidth,classification/g' iris_training.csv iris_test.csv

xgbtest.json

{
    "learning_rate": [0.01, 0.05, 0.1],
    "n_estimators": [20, 100, 200],
    "max_depth": [3,5,8]
}

CLI command:

dffml tune \
-model xgbclassifier \
-model-features \
 SepalLength:float:1 \
 SepalWidth:float:1 \
 PetalLength:float:1 \
-model-predict classification \
-model-location tempDir \
-tuner parameter_grid \
-tuner-parameters @xgbtest.json \
-tuner-objective max \
-scorer clf \
-sources train=csv test=csv \
-source-train-filename iris_training.csv \
-source-test-filename iris_test.csv

seraphimstreets avatar Jun 19 '22 20:06 seraphimstreets