You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**PR Checklist**
- [x] A description of the changes is added to the description of this
PR.
- [ ] If there is a related issue, make sure it is linked to this PR.
- [ ] If you've fixed a bug or added code that should be tested, add
tests!
- [ ] If you've added or modified a feature, documentation in `docs` is
updated
**Description of changes**
Initial version of model documentation.
Quickstart manually verified on my local machine.
---------
Co-authored-by: Matthew Powers <[email protected]>
At this point, your MLflow environment is ready for use with the newly started MLflow tracking server and the Unity Catalog server acting as your model registry.
188
+
189
+
You can quickly train a test model and validate that the MLflow/Unity catalog integration is fully working.
190
+
191
+
```python
192
+
import os
193
+
from sklearn import datasets
194
+
from sklearn.ensemble import RandomForestClassifier
195
+
from sklearn.model_selection import train_test_split
196
+
import pandas as pd
197
+
198
+
X, y = datasets.load_iris(return_X_y=True, as_frame=True)
199
+
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
200
+
201
+
with mlflow.start_run():
202
+
# Train a sklearn model on the iris dataset
203
+
clf = RandomForestClassifier(max_depth=7)
204
+
clf.fit(X_train, y_train)
205
+
# Take the first row of the training dataset as the model input example.
206
+
input_example = X_train.iloc[[0]]
207
+
# Log the model and register it as a new version in UC.
208
+
mlflow.sklearn.log_model(
209
+
sk_model=clf,
210
+
artifact_path="model",
211
+
# The signature is automatically inferred from the input example and its predicted output.
result = pd.DataFrame(X_test, columns=iris_feature_names)
220
+
result["actual_class"] = y_test
221
+
result["predicted_class"] = predictions
222
+
result[:4]
223
+
```
224
+
225
+
This code snippet will create a registered model `default.unity.iris` and log the trained model as model version 1. It then loads the model from the Unity Catalog server, and performs batch inference on the test set using the loaded model.
226
+
149
227
## APIs and Compatibility
150
228
151
229
- Open API specification: See the Unity Catalog Rest API.
Copy file name to clipboardexpand all lines: docs/usage/cli.md
+5-1
Original file line number
Diff line number
Diff line change
@@ -415,7 +415,11 @@ bin/uc function delete --full_name <catalog>.<schema>.<function_name>
415
415
-`schema` : The name of the schema.
416
416
-`function_name` : The name of the function.
417
417
418
-
## 6. CLI Server Configuration
418
+
## 6. Registered model and model version management
419
+
420
+
Please refer to [MLflow documentation](https://mlflow.org/docs/latest/index.html) to learn how to use MLflow to create, register, update, use, and delete registered models and model versions.
421
+
422
+
## 7. CLI Server Configuration
419
423
420
424
By default, the CLI tool is configured to interact with a local reference server running at `http://localhost:8080`.
421
425
The CLI can be configured to talk to Databricks Unity Catalog by one of the following methods:
0 commit comments