Machine Learning-modellen ontwikkelen voor productie
Sinan Ozdemir
Data Scientist and Author
Een open-sourceplatform voor het tracken en beheren van ML-experimenten. MLflow kan:

# standard scikit-learn imports
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
# new imports from MLflow
import mlflow
import mlflow.sklearn
with mlflow.start_run(): # Start an MLflow run assuming we have data prepared
# Build and train model
rf = RandomForestClassifier()
rf.fit(X_train, y_train)
# Log parameters and model information
mlflow.log_param("n_estimators", rf.n_estimators)
mlflow.sklearn.log_model(rf, "model")
y_pred = rf.predict(X_test) # Evaluate model
accuracy = accuracy_score(y_test, y_pred)
mlflow.log_metric("accuracy", accuracy) # log the test accuracy metric


Machine Learning-modellen ontwikkelen voor productie