Skip to content

Commit 3227990

Browse files
author
Simon Johnston
committed
Added example
1 parent f8daa54 commit 3227990

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,36 @@ and match instances.
2121

2222
## Modules
2323

24-
* `data` - TBD
24+
* `data` - manage data sets, load from CSV and JSON files, save and load snapshots as well as
25+
manage partitions and statistics.
2526

2627
## Example
2728

28-
TBD
29+
The following example loads a sample data set and displays some useful information before_script
30+
writing a snapshot to the current output port.
31+
32+
```scheme
33+
(require rml/data.rkt)
34+
35+
(define iris-data-set
36+
(load-data-set "iris_training_data2.csv"
37+
'csv
38+
(list
39+
(make-feature "sepal-length" #:index 0)
40+
(make-feature "sepal-width" #:index 1)
41+
(make-feature "petal-length" #:index 2)
42+
(make-feature "petal-width" #:index 3)
43+
(make-classifier "classification" #:index 4))))
44+
45+
(displayln (classifier-product dataset))
46+
(newline)
47+
48+
(displayln (feature-statistics dataset "sepal-width"))
49+
(newline)
50+
51+
(write-snapshot dataset (current-output-port))
52+
(newline)
53+
```
2954

3055
## Links
3156

0 commit comments

Comments
 (0)