|
@@ -41,23 +41,21 @@ run:
|
|
|
source:
|
|
|
launchCommand: "python vib_test.py"
|
|
|
configMap:
|
|
|
- # Example taken from the MLFlow UI
|
|
|
+ # Example taken from the MLFlow UI (https://mlflow.org/docs/latest/ml/tracking/tutorials/local-database#step-3-start-logging)
|
|
|
vib_test.py: |
|
|
|
import mlflow
|
|
|
+
|
|
|
from sklearn.model_selection import train_test_split
|
|
|
from sklearn.datasets import load_diabetes
|
|
|
- import sklearn.ensemble
|
|
|
+ from sklearn.ensemble import RandomForestRegressor
|
|
|
|
|
|
- # set the experiment id
|
|
|
- mlflow.set_experiment(experiment_id="0")
|
|
|
+ mlflow.sklearn.autolog()
|
|
|
|
|
|
- mlflow.autolog()
|
|
|
db = load_diabetes()
|
|
|
-
|
|
|
X_train, X_test, y_train, y_test = train_test_split(db.data, db.target)
|
|
|
|
|
|
# Create and train models.
|
|
|
- rf = sklearn.ensemble.RandomForestRegressor(n_estimators=100, max_depth=6, max_features=3)
|
|
|
+ rf = RandomForestRegressor(n_estimators=100, max_depth=6, max_features=3)
|
|
|
rf.fit(X_train, y_train)
|
|
|
|
|
|
# Use the model to make predictions on the test dataset.
|