Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add xgboost example using Bayesian optimization #320

Merged
merged 2 commits into from
Jan 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions examples/xgboost-bayesian-example.yaml
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