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
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-mltable.md
+16-7Lines changed: 16 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -203,20 +203,29 @@ You can optionally choose to load the MLTable object into Pandas, using:
203
203
```
204
204
205
205
#### Save the data loading steps
206
-
Next, save all your data loading steps into an MLTable file. If you save your data loading steps, you can reproduce your Pandas data frame at a later point in time, and you don't need to redefine the data loading steps in your code.
206
+
Next, save all your data loading steps into an MLTable file. Saving your data loading steps in an MLTable file allows you to reproduce your Pandas data frame at a later point in time, without need to redefine the code each time.
207
207
208
+
You can choose to save the MLTable yaml file to a cloud storage, or you can also save it to local paths.
208
209
```python
209
-
# serialize the data loading steps into an MLTable file
210
-
tbl.save("./nyc_taxi")
210
+
# save the data loading steps in an MLTable file to a cloud storage
211
+
#NOTE: the tbl object was defined in the previous snippet.
You can optionally view the contents of the MLTable file, to understand how the data loading steps are serialized into a file:
214
-
215
215
```python
216
-
withopen("./nyc_taxi/MLTable", "r") as f:
217
-
print(f.read())
216
+
# save the data loading steps in an MLTable file to local
217
+
#NOTE: the tbl object was defined in the previous snippet.
218
+
tbl.save("./titanic")
218
219
```
219
220
221
+
> [!IMPORTANT]
222
+
> - If collocated == True, then we will copy the data to the same folder with MLTable yaml file if they are not currently collocated, and we will use relative paths in MLTable yaml.
223
+
> - If collocated == False, we will not move the data and we will use absolute paths for cloud data and use relative paths for local data.
224
+
> - We don’t support this parameter combination: data is in local, collocated == False, `save_path_dirc` is a cloud directory. Please upload your local data to cloud and use the cloud data paths for MLTable instead.
225
+
> - Parameters `show_progress` (default as True), `allow_copy_errors` (default as False), `overwrite`(default as True) are optional.
226
+
>
227
+
228
+
220
229
### Reproduce data loading steps
221
230
Now that the data loading steps have been serialized into a file, you can reproduce them at any point in time, with the load() method. This way, you don't need to redefine your data loading steps in code, and you can more easily share the file.
0 commit comments