forked from kubeflow/kubeflow
-
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.
Add xgboost example using Bayesian optimization (kubeflow#320)
* Add xgboost example * Add comments for ames example
- Loading branch information
1 parent
4a69776
commit 0ed361c
Showing
1 changed file
with
71 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
apiVersion: "kubeflow.org/v1alpha1" | ||
kind: StudyJob | ||
metadata: | ||
namespace: kubeflow | ||
labels: | ||
controller-tools.k8s.io: "1.0" | ||
name: xgboost-example | ||
|
||
spec: | ||
studyName: xgboost-example | ||
owner: crd | ||
optimizationtype: minimize | ||
objectivevaluename: mean_absolute_error | ||
optimizationgoal: 10000 | ||
requestcount: 10 | ||
|
||
parameterconfigs: | ||
- name: --learning-rate | ||
parametertype: double | ||
feasible: | ||
min: "0.05" | ||
max: "0.15" | ||
- name: --n-estimators | ||
parametertype: int | ||
feasible: | ||
min: "10000" | ||
max: "30000" | ||
|
||
workerSpec: | ||
goTemplate: | ||
rawTemplate: |- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{.WorkerID}} | ||
namespace: kubeflow | ||
spec: | ||
template: | ||
# The training worker uses the Ames housing example found at | ||
# https://github.com/kubeflow/examples/tree/master/xgboost_ames_housing. | ||
# Please first follow the steps and create the required prerequisites. | ||
spec: | ||
containers: | ||
- name: {{.WorkerID}} | ||
image: gcr.io/kubeflow-examples/ames-housing:latest | ||
volumeMounts: | ||
- mountPath: "/mnt/xgboost" | ||
name: datadir | ||
command: | ||
- "python" | ||
- "housing.py" | ||
- "--train-input=/ames_dataset/train.csv" | ||
- "--model-file=/ames_dataset/housing_{{.WorkerID}}.dat" | ||
{{- with .HyperParameters}} | ||
{{- range .}} | ||
- "{{.Name}}={{.Value}}" | ||
{{- end}} | ||
{{- end}} | ||
volumes: | ||
- name: datadir | ||
persistentVolumeClaim: | ||
claimName: claim | ||
restartPolicy: Never | ||
suggestionSpec: | ||
suggestionAlgorithm: "bayesianoptimization" | ||
suggestionParameters: | ||
- | ||
name: "burn_in" | ||
value: "5" | ||
requestNumber: 10 |