The cl-arff-parser Reference Manual

This is the cl-arff-parser Reference Manual, version 0.8, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:43:05 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-arff-parser

A parser for Weka arff (Attribute-Relation File Format) Machine learning datasets.

Author

Pieter Wellens

License

see LICENSE.txt

Version

0.8

Source

cl-arff-parser.asd.

Child Component

cl-arff-parser.lisp (file).


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cl-arff-parser/cl-arff-parser.asd

Source

cl-arff-parser.asd.

Parent Component

cl-arff-parser (system).

ASDF Systems

cl-arff-parser.


3.1.2 cl-arff-parser/cl-arff-parser.lisp

Source

cl-arff-parser.asd.

Parent Component

cl-arff-parser (system).

Packages

cl-arff-parser.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-arff-parser

A parser and some manipulation for Weka Machine (ARFF) Learning datasets.

Source

cl-arff-parser.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: parse-arff (arff-path)

The arff-path should be a string pointing to an arff-file.

Package

cl-arff-parser.

Source

cl-arff-parser.lisp.


5.1.2 Generic functions

Generic Reader: arff-attributes (object)
Generic Writer: (setf arff-attributes) (object)
Package

cl-arff-parser.

Methods
Reader Method: arff-attributes ((arff arff))
Writer Method: (setf arff-attributes) ((arff arff))

The attributes as specified in the
header. Each attribute is a list that looks as follows: ("attribute-name" ("type")). In case of a nominal attribute it looks like
this: ("attribute-name" ("nominal" . values)).

Source

cl-arff-parser.lisp.

Target Slot

arff-attributes.

Generic Reader: arff-data (object)
Generic Writer: (setf arff-data) (object)
Package

cl-arff-parser.

Methods
Reader Method: arff-data ((arff arff))
Writer Method: (setf arff-data) ((arff arff))

All the data. The bulk of the file.

Source

cl-arff-parser.lisp.

Target Slot

arff-data.

Generic Reader: arff-path (object)
Generic Writer: (setf arff-path) (object)
Package

cl-arff-parser.

Methods
Reader Method: arff-path ((arff arff))
Writer Method: (setf arff-path) ((arff arff))

A string to the path of the arff
file. e.g. /home/user/myData/foo.arff

Source

cl-arff-parser.lisp.

Target Slot

arff-path.

Generic Reader: arff-relation (object)
Generic Writer: (setf arff-relation) (object)
Package

cl-arff-parser.

Methods
Reader Method: arff-relation ((arff arff))
Writer Method: (setf arff-relation) ((arff arff))

The string after @relation. This is essentially the name of the arff.

Source

cl-arff-parser.lisp.

Target Slot

arff-relation.

Generic Function: remove-attribute-by-name (arff name)

Removes the feature with the given name from the
arff object (not from the actual file). It will remove it both from that @attributes and the @data.

Package

cl-arff-parser.

Source

cl-arff-parser.lisp.

Methods
Method: remove-attribute-by-name ((arff arff) name)
Method: remove-attribute-by-name ((arff arff) (name string))

5.1.3 Standalone methods

Method: print-object ((arff arff) stream)
Source

cl-arff-parser.lisp.


5.1.4 Classes

Class: arff

An arff object contains all the data found in a parsed arff file.

Package

cl-arff-parser.

Source

cl-arff-parser.lisp.

Direct methods
Direct slots
Slot: arff-path

A string to the path of the arff
file. e.g. /home/user/myData/foo.arff

Initform

"~/"

Initargs

:arff-path

Readers

arff-path.

Writers

(setf arff-path).

Slot: arff-relation

The string after @relation. This is essentially the name of the arff.

Initform

""

Initargs

:arff-reltation

Readers

arff-relation.

Writers

(setf arff-relation).

Slot: arff-attributes

The attributes as specified in the
header. Each attribute is a list that looks as follows: ("attribute-name" ("type")). In case of a nominal attribute it looks like
this: ("attribute-name" ("nominal" . values)).

Type

list

Initargs

:arff-attributes

Readers

arff-attributes.

Writers

(setf arff-attributes).

Slot: arff-data

All the data. The bulk of the file.

Type

list

Initargs

:arff-data

Readers

arff-data.

Writers

(setf arff-data).


5.2 Internals


5.2.1 Ordinary functions

Function: csv->list (string &optional separator)

Given a string like ’1,2,3, 6, foo’ will return list (’1’ ’2’ ’3’ ’6’ ’foo’)

Package

cl-arff-parser.

Source

cl-arff-parser.lisp.

Function: parse-@attribute (line)

@attribute <attribute-name> <datatype>. Returns a list containing the attribute-name and then a list containing datatype information as parsed by parse-datatype.

Package

cl-arff-parser.

Source

cl-arff-parser.lisp.

Function: parse-attribute-name (line)

Assumes the beginning of this line is the attribute-name. If spaces are to be included in the name then the entire name must be quoted. As second return value it also returns the rest of the line which should be the datatype.

Package

cl-arff-parser.

Source

cl-arff-parser.lisp.

Function: parse-data (line)
Package

cl-arff-parser.

Source

cl-arff-parser.lisp.

Function: parse-datatype (line)

Assumes that the line starts with the datatype.Look at http://www.cs.waikato.ac.nz/~ml/weka/arff.html for information about the datatype. There is no support for the date datatype.

Package

cl-arff-parser.

Source

cl-arff-parser.lisp.

Function: search-space-or-tab (line)
Package

cl-arff-parser.

Source

cl-arff-parser.lisp.

Function: string-replace (str1 sub1 sub2)

Nondestructively replaces all occurences of sub1 in str1 by sub2

Package

cl-arff-parser.

Source

cl-arff-parser.lisp.

Function: trim-comments-and-spaces (string &optional comment-marker)
Package

cl-arff-parser.

Source

cl-arff-parser.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   F   G   M   P   R   S   T  
Index Entry  Section

(
(setf arff-attributes): Public generic functions
(setf arff-attributes): Public generic functions
(setf arff-data): Public generic functions
(setf arff-data): Public generic functions
(setf arff-path): Public generic functions
(setf arff-path): Public generic functions
(setf arff-relation): Public generic functions
(setf arff-relation): Public generic functions

A
arff-attributes: Public generic functions
arff-attributes: Public generic functions
arff-data: Public generic functions
arff-data: Public generic functions
arff-path: Public generic functions
arff-path: Public generic functions
arff-relation: Public generic functions
arff-relation: Public generic functions

C
csv->list: Private ordinary functions

F
Function, csv->list: Private ordinary functions
Function, parse-@attribute: Private ordinary functions
Function, parse-arff: Public ordinary functions
Function, parse-attribute-name: Private ordinary functions
Function, parse-data: Private ordinary functions
Function, parse-datatype: Private ordinary functions
Function, search-space-or-tab: Private ordinary functions
Function, string-replace: Private ordinary functions
Function, trim-comments-and-spaces: Private ordinary functions

G
Generic Function, (setf arff-attributes): Public generic functions
Generic Function, (setf arff-data): Public generic functions
Generic Function, (setf arff-path): Public generic functions
Generic Function, (setf arff-relation): Public generic functions
Generic Function, arff-attributes: Public generic functions
Generic Function, arff-data: Public generic functions
Generic Function, arff-path: Public generic functions
Generic Function, arff-relation: Public generic functions
Generic Function, remove-attribute-by-name: Public generic functions

M
Method, (setf arff-attributes): Public generic functions
Method, (setf arff-data): Public generic functions
Method, (setf arff-path): Public generic functions
Method, (setf arff-relation): Public generic functions
Method, arff-attributes: Public generic functions
Method, arff-data: Public generic functions
Method, arff-path: Public generic functions
Method, arff-relation: Public generic functions
Method, print-object: Public standalone methods
Method, remove-attribute-by-name: Public generic functions
Method, remove-attribute-by-name: Public generic functions

P
parse-@attribute: Private ordinary functions
parse-arff: Public ordinary functions
parse-attribute-name: Private ordinary functions
parse-data: Private ordinary functions
parse-datatype: Private ordinary functions
print-object: Public standalone methods

R
remove-attribute-by-name: Public generic functions
remove-attribute-by-name: Public generic functions
remove-attribute-by-name: Public generic functions

S
search-space-or-tab: Private ordinary functions
string-replace: Private ordinary functions

T
trim-comments-and-spaces: Private ordinary functions