From 32279905e37a54c52d2f18d9d0b194376ccb0341 Mon Sep 17 00:00:00 2001 From: Simon Johnston Date: Thu, 28 Jun 2018 15:48:21 -0700 Subject: [PATCH] Added example --- README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aaf3a3a..63af8c4 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,36 @@ and match instances. ## Modules -* `data` - TBD +* `data` - manage data sets, load from CSV and JSON files, save and load snapshots as well as +manage partitions and statistics. ## Example -TBD +The following example loads a sample data set and displays some useful information before_script +writing a snapshot to the current output port. + +```scheme +(require rml/data.rkt) + +(define iris-data-set + (load-data-set "iris_training_data2.csv" + 'csv + (list + (make-feature "sepal-length" #:index 0) + (make-feature "sepal-width" #:index 1) + (make-feature "petal-length" #:index 2) + (make-feature "petal-width" #:index 3) + (make-classifier "classification" #:index 4)))) + +(displayln (classifier-product dataset)) +(newline) + +(displayln (feature-statistics dataset "sepal-width")) +(newline) + +(write-snapshot dataset (current-output-port)) +(newline) +``` ## Links