Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliendelplanque/arff
An Arff generator written in Pharo.
https://github.com/juliendelplanque/arff
arff arff-generator arff-strings pharo smalltalk weka
Last synced: 4 days ago
JSON representation
An Arff generator written in Pharo.
- Host: GitHub
- URL: https://github.com/juliendelplanque/arff
- Owner: juliendelplanque
- License: mit
- Created: 2016-04-24T22:02:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-16T13:59:27.000Z (over 6 years ago)
- Last Synced: 2024-11-17T06:40:19.690Z (about 1 month ago)
- Topics: arff, arff-generator, arff-strings, pharo, smalltalk, weka
- Language: Smalltalk
- Size: 36.1 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Arff
An Arff generator written in Pharo.Arff is a format defined by [Weka](http://www.cs.waikato.ac.nz/ml/weka/) to be used for data importation.
This project implements a representation of weka's arff concepts as objects in Pharo and is able to generate valid arff strings.See [Arff file spec](https://weka.wikispaces.com/ARFF) to learn more about this format.
## Install
You can install this project using the Catalog Browser or by evaluating the following code in a fresh image:
~~~
Metacello new
baseline: 'Arff';
repository: 'github://juliendelplanque/Arff/repository';
load
~~~## Use this project as a dependency
Simply add this code snippet to your baseline:
~~~
spec baseline: 'Arff' with: [
spec repository: 'github://juliendelplanque/Arff/repository' ].
~~~## Example
The following code:
~~~
doc := ArffDocument new.
doc
relation: 'temperature';
addDateAttribute: 'time' format: 'yyyy-MM-dd HH:mm:ss';
addNumericAttribute: 'temperature';
addNominalAttribute: 'weather' specification: #('sunny' 'cloudy').doc
addInstance: #('2015-01-01 12:00:00' 5 'sunny');
addInstance: #('2015-02-01 18:40:00' 8 'sunny');
addInstance: #('2015-03-01 05:04:00' 3 'cloudy');
addInstance: #('2015-04-01 13:01:20' 15 'cloudy');
addInstance: #('2015-05-01 09:07:00' 12 'sunny');
addInstance: #('2015-06-01 12:20:00' 6 'cloudy').doc asString
~~~Generates the arff string:
~~~
@relation temperature
@attribute time date "yyyy-MM-dd HH:mm:ss"
@attribute temperature numeric
@attribute weather {sunny,cloudy}
@data
"2015-01-01 12:00:00",5,"sunny"
"2015-02-01 18:40:00",8,"sunny"
"2015-03-01 05:04:00",3,"cloudy"
"2015-04-01 13:01:20",15,"cloudy"
"2015-05-01 09:07:00",12,"sunny"
"2015-06-01 12:20:00",6,"cloudy"
~~~## TODO
- Add messages in ArffDocument to make the DSL simpler.
- Add possibility to add comment in an ArffDocument.Pull requests are welcome. :)