Add get started code
Browse files
README.md
CHANGED
|
@@ -169,7 +169,19 @@ This model is not ready to be used in production.
|
|
| 169 |
|
| 170 |
# How to Get Started with the Model
|
| 171 |
|
| 172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
# Model Card Authors
|
| 175 |
|
|
|
|
| 169 |
|
| 170 |
# How to Get Started with the Model
|
| 171 |
|
| 172 |
+
Use the following code to get started:
|
| 173 |
+
|
| 174 |
+
```python
|
| 175 |
+
import joblib
|
| 176 |
+
from skops.hub_utils import download
|
| 177 |
+
import json
|
| 178 |
+
import pandas as pd
|
| 179 |
+
download(repo_id="haizad/ames-housing-random-forest-predictor", dst='ames-housing-random-forest-predictor')
|
| 180 |
+
pipeline = joblib.load( "ames-housing-random-forest-predictor/model.pkl")
|
| 181 |
+
with open("ames-housing-random-forest-predictor/config.json") as f:
|
| 182 |
+
config = json.load(f)
|
| 183 |
+
pipeline.predict(pd.DataFrame.from_dict(config["sklearn"]["example_input"]))
|
| 184 |
+
```
|
| 185 |
|
| 186 |
# Model Card Authors
|
| 187 |
|