Skip to content

Commit

Permalink
Fix filesystem doc
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Foti <foti.giuseppe@gmail.com>
  • Loading branch information
MocioF committed Apr 21, 2024
1 parent e1851ed commit 8cbf37b
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/persisters/filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,33 @@ Filesystems are local or remote storage drives that are organized by files and f
|---|---|---|---|---|
| 1 | path | | string | The path to the model file on the filesystem. |
| 2 | history | false | bool | Should we keep a history of past saves? |
| 3 | serializer | RBX | Serializer | The serializer used to convert to and from storage format. |

## Example
```php
use Rubix\ML\Persisters\Filesystem;
use Rubix\ML\Serializers\RBX;
use Rubix\ML\Classifiers\KNearestNeighbors;
use Rubix\ML\Kernels\Distance\Manhattan;

$persister = new Filesystem('/path/to/example.model', true, new RBX());
$persistable = new KNearestNeighbors(3, false, new Manhattan());
$persister = new Filesystem('/path/to/example.rbx', true);
$serializer = new RBX(6);
$encoding = $serializer->serialize($persistable);
$persister->save($encoding);

```

## Example
```php
use Rubix\ML\Persisters\Filesystem;
use Rubix\ML\Serializers\RBX;
use Rubix\ML\Classifiers\KNearestNeighbors;
use Rubix\ML\Kernels\Distance\Manhattan;

$persister = new Filesystem('/path/to/example.rbx', true);
$encoding = $persister->load();
$serializer = new RBX(6);
$persistable = $serializer->deserialize($encoding);
```

## Additional Methods
Expand Down

0 comments on commit 8cbf37b

Please sign in to comment.