File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,30 @@ Filesystems are local or remote storage drives that are organized by files and f
8
8
| ---| ---| ---| ---| ---|
9
9
| 1 | path | | string | The path to the model file on the filesystem. |
10
10
| 2 | history | false | bool | Should we keep a history of past saves? |
11
- | 3 | serializer | RBX | Serializer | The serializer used to convert to and from storage format. |
12
11
13
12
## Example
14
13
``` php
15
14
use Rubix\ML\Persisters\Filesystem;
16
15
use Rubix\ML\Serializers\RBX;
16
+ use Rubix\ML\Classifiers\KNearestNeighbors;
17
+ use Rubix\ML\Kernels\Distance\Manhattan;
17
18
18
- $persister = new Filesystem('/path/to/example.model', true, new RBX());
19
+ $persistable = new KNearestNeighbors(3, false, new Manhattan());
20
+ $persister = new Filesystem('/path/to/example.rbx', true);
21
+ $serializer = new RBX(6);
22
+ $encoding = $serializer->serialize($persistable);
23
+ $persister->save($encoding);
24
+ ```
25
+
26
+ ## Example
27
+ ``` php
28
+ use Rubix\ML\Persisters\Filesystem;
29
+ use Rubix\ML\Serializers\RBX;
30
+
31
+ $persister = new Filesystem('/path/to/example.rbx', true);
32
+ $encoding = $persister->load();
33
+ $serializer = new RBX(6);
34
+ $persistable = $serializer->deserialize($encoding);
19
35
```
20
36
21
37
## Additional Methods
You can’t perform that action at this time.
0 commit comments