The cl-libsvm-format Reference Manual

This is the cl-libsvm-format Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:25:00 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-libsvm-format

A fast LibSVM data format reader for Common Lisp

Author

Satoshi Imai

License

MIT

Long Description

* Cl-Libsvm-Format

[[http://quickdocs.org/cl-libsvm-format/][http://quickdocs.org/badge/cl-libsvm-format.svg]] [[https://travis-ci.org/masatoi/cl-libsvm-format][https://travis-ci.org/masatoi/cl-libsvm-format.svg?branch=master]]

A fast LibSVM data format reader for Common Lisp.

** Installation

#+BEGIN_SRC
ros install masatoi/cl-libsvm-format
#+END_SRC

** Usage

SVMFORMAT:PARSE-FILE returns the dataset list and the estimated number of dimensions of the data.
One datum is a list in which the first element is a class label or a target of regression, and the rest are alternate with the index and its value.

#+BEGIN_SRC lisp
(ql:quickload :cl-libsvm-format)

(multiple-value-bind (dataset dim)
(svmformat:parse-file "/home/wiz/datasets/mnist.scale")
(defparameter mnist-dataset dataset)
(defparameter mnist-dimension dim))

;;; First datum

(car mnist-dataset)
;; (5 153 0.0117647005 154 0.0705882 155 0.0705882 156 0.0705882 157 0.494118 158
;; 0.533333 159 0.686275 160 0.101961 161 0.65098 162 1.0 163 0.968627 164
;; 0.498039 177 0.117647 178 0.141176 179 0.368627 180 0.603922 181 0.666667 182
;; 0.992157 183 0.992157 184 0.992157 185 0.992157 186 0.992157 187 0.882353 188
;; 0.67451 189 0.992157 190 0.94901997 191 0.764706 192 0.25098 204 0.192157 205
;; 0.933333 206 0.992157 207 0.992157 208 0.992157 209 0.992157 210 0.992157 211
;; 0.992157 212 0.992157 213 0.992157 214 0.984314 215 0.364706 216 0.321569 217
;; 0.321569 218 0.219608 219 0.152941 232 0.0705882 233 0.858824 234 0.992157 235
;; 0.992157 236 0.992157 237 0.992157 238 0.992157 239 0.776471 240 0.713725 241
;; 0.968627 242 0.945098 261 0.313725 262 0.611765 263 0.419608 264 0.992157 265
;; 0.992157 266 0.803922 267 0.0431373 269 0.168627 270 0.603922 290 0.054902 291
;; 0.00392157 292 0.603922 293 0.992157 294 0.352941 320 0.545098 321 0.992157
;; 322 0.745098 323 0.00784314 348 0.0431373 349 0.745098 350 0.992157 351
;; 0.27451 377 0.137255 378 0.945098 379 0.882353 380 0.627451 381 0.423529 382
;; 0.00392157 406 0.317647 407 0.941176 408 0.992157 409 0.992157 410 0.466667
;; 411 0.0980392 435 0.176471 436 0.729412 437 0.992157 438 0.992157 439 0.588235
;; 440 0.105882 464 0.0627451 465 0.364706 466 0.988235 467 0.992157 468 0.733333
;; 494 0.976471 495 0.992157 496 0.976471 497 0.25098 519 0.180392 520 0.509804
;; 521 0.717647 522 0.992157 523 0.992157 524 0.811765 525 0.00784314 545
;; 0.152941 546 0.580392 547 0.898039 548 0.992157 549 0.992157 550 0.992157 551
;; 0.980392 552 0.713725 571 0.094117604 572 0.447059 573 0.866667 574 0.992157
;; 575 0.992157 576 0.992157 577 0.992157 578 0.788235 579 0.305882 597 0.0901961
;; 598 0.258824 599 0.835294 600 0.992157 601 0.992157 602 0.992157 603 0.992157
;; 604 0.776471 605 0.317647 606 0.00784314 623 0.0705882 624 0.670588 625
;; 0.858824 626 0.992157 627 0.992157 628 0.992157 629 0.992157 630 0.764706 631
;; 0.313725 632 0.0352941 649 0.215686 650 0.67451 651 0.886275 652 0.992157 653
;; 0.992157 654 0.992157 655 0.992157 656 0.956863 657 0.521569 658 0.0431373 677
;; 0.533333 678 0.992157 679 0.992157 680 0.992157 681 0.831373 682 0.529412 683
;; 0.517647 684 0.0627451)

;;; Number of features

mnist-dimension ; => 780
#+END_SRC

** Author
Satoshi Imai (satoshi.imai@gmail.com)

** Licence
This software is released under the MIT License, see LICENSE.txt.

Version

0.1.0

Dependency

alexandria (system).

Source

cl-libsvm-format.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 cl-libsvm-format/src

Source

cl-libsvm-format.asd.

Parent Component

cl-libsvm-format (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 cl-libsvm-format/cl-libsvm-format.asd

Source

cl-libsvm-format.asd.

Parent Component

cl-libsvm-format (system).

ASDF Systems

cl-libsvm-format.


4.1.2 cl-libsvm-format/src/parse-float.lisp

Source

cl-libsvm-format.asd.

Parent Component

src (module).

Packages

svmformat.parse-float.

Public Interface

parse-float (function).

Internals

4.1.3 cl-libsvm-format/src/cl-libsvm-format.lisp

Dependency

parse-float.lisp (file).

Source

cl-libsvm-format.asd.

Parent Component

src (module).

Packages

cl-libsvm-format.

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 svmformat.parse-float

Source

parse-float.lisp.

Use List
  • alexandria.
  • common-lisp.
Used By List

cl-libsvm-format.

Public Interface

parse-float (function).

Internals

5.2 cl-libsvm-format

Source

cl-libsvm-format.lisp.

Nickname

svmformat

Use List
Public Interface
Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Ordinary functions

Function: parse-file (file &key external-format buffer-size field-size)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: parse-float (string &key start end radix junk-allowed decimal-character exponent-character)

Similar to PARSE-INTEGER, but parses a floating point value and returns the value as the specified TYPE (by default *READ-DEFAULT-FLOAT-FORMAT*). The DECIMAL-CHARACTER (by default #.) specifies the separator between the integer and decimal parts, and the EXPONENT-CHARACTER (by default #e, case insensitive) specifies the character before the exponent. Note that the exponent is only parsed if RADIX is 10.

Package

svmformat.parse-float.

Source

parse-float.lisp.

Function: parse-stream (stream &key buffer-size field-size label-type)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.


6.2 Internals


6.2.1 Constants

Constant: +whitespace-characters+

List of whitespace characters

Package

svmformat.parse-float.

Source

parse-float.lisp.


6.2.2 Special variables

Special Variable: *optimize-settings*
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.


6.2.3 Macros

Macro: defn (function-spec (&rest arg-specs) &body body)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Macro: tlet (bindings &body body)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.


6.2.4 Ordinary functions

Function: %make-state (&key buffer field offset space-count tag max-dim label-type row row-ptr result result-ptr)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: cell-finish (state)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: cell-input (state char)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: copy-state (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: finish (state)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: first-label-integer-p (file &key external-format)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: make-state (buffer-size field-size &key label-type)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: parse (size state)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: parse-integer-only (string &key start end radix allow-sign)

Parse an integer from a string, without skipping whitespaces. Returns three values: the integer, the position in the string that ended the parsing, and a boolean which is T if the parsing ended due to a whitespace or end of the string, and NIL otherwise. If allow-sign is NIL (T by default), also signs are not allowed in the string (i.e. cannot start with #+ or #-).

Package

svmformat.parse-float.

Source

parse-float.lisp.

Function: print-state1 (state)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: print-state2 (state)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: print-state3 (state)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: row-finish (state)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Function: sign-char-p (character)

Predicate for testing if CHARACTER is a sign character (i.e. #+ or #-).

Package

svmformat.parse-float.

Source

parse-float.lisp.

Reader: state-buffer (instance)
Writer: (setf state-buffer) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

buffer.

Reader: state-field (instance)
Writer: (setf state-field) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

field.

Reader: state-label-type (instance)
Writer: (setf state-label-type) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

label-type.

Reader: state-max-dim (instance)
Writer: (setf state-max-dim) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

max-dim.

Reader: state-offset (instance)
Writer: (setf state-offset) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

offset.

Function: state-p (object)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Reader: state-result (instance)
Writer: (setf state-result) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

result.

Reader: state-result-ptr (instance)
Writer: (setf state-result-ptr) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

result-ptr.

Reader: state-row (instance)
Writer: (setf state-row) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

row.

Reader: state-row-ptr (instance)
Writer: (setf state-row-ptr) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

row-ptr.

Reader: state-space-count (instance)
Writer: (setf state-space-count) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

space-count.

Reader: state-tag (instance)
Writer: (setf state-tag) (instance)
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Target Slot

tag.

Function: whitespace-char-p (character)

Predicate for testing if CHARACTER is a whitespace character.

Package

svmformat.parse-float.

Source

parse-float.lisp.


6.2.5 Structures

Structure: state
Package

cl-libsvm-format.

Source

cl-libsvm-format.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: buffer
Type

(simple-array character)

Initform

""

Readers

state-buffer.

Writers

(setf state-buffer).

Slot: field
Type

(simple-array character)

Initform

""

Readers

state-field.

Writers

(setf state-field).

Slot: offset
Type

fixnum

Initform

0

Readers

state-offset.

Writers

(setf state-offset).

Slot: space-count
Type

fixnum

Initform

0

Readers

state-space-count.

Writers

(setf state-space-count).

Slot: tag
Type

keyword

Initform

:start

Readers

state-tag.

Writers

(setf state-tag).

Slot: max-dim
Type

fixnum

Initform

0

Readers

state-max-dim.

Writers

(setf state-max-dim).

Slot: label-type
Readers

state-label-type.

Writers

(setf state-label-type).

Slot: row
Readers

state-row.

Writers

(setf state-row).

Slot: row-ptr
Readers

state-row-ptr.

Writers

(setf state-row-ptr).

Slot: result
Readers

state-result.

Writers

(setf state-result).

Slot: result-ptr
Readers

state-result-ptr.

Writers

(setf state-result-ptr).


6.2.6 Types

Type: bounding-index ()

A valid upper bound to a string.

Package

svmformat.parse-float.

Source

parse-float.lisp.

Type: string-index ()

A valid string index.

Package

svmformat.parse-float.

Source

parse-float.lisp.

Type: valid-radix ()

A valid Common Lisp radix.

Package

svmformat.parse-float.

Source

parse-float.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
C   D   F   M   P   R   S   T   W  
Index Entry  Section

%
%make-state: Private ordinary functions

(
(setf state-buffer): Private ordinary functions
(setf state-field): Private ordinary functions
(setf state-label-type): Private ordinary functions
(setf state-max-dim): Private ordinary functions
(setf state-offset): Private ordinary functions
(setf state-result): Private ordinary functions
(setf state-result-ptr): Private ordinary functions
(setf state-row): Private ordinary functions
(setf state-row-ptr): Private ordinary functions
(setf state-space-count): Private ordinary functions
(setf state-tag): Private ordinary functions

C
cell-finish: Private ordinary functions
cell-input: Private ordinary functions
copy-state: Private ordinary functions

D
defn: Private macros

F
finish: Private ordinary functions
first-label-integer-p: Private ordinary functions
Function, %make-state: Private ordinary functions
Function, (setf state-buffer): Private ordinary functions
Function, (setf state-field): Private ordinary functions
Function, (setf state-label-type): Private ordinary functions
Function, (setf state-max-dim): Private ordinary functions
Function, (setf state-offset): Private ordinary functions
Function, (setf state-result): Private ordinary functions
Function, (setf state-result-ptr): Private ordinary functions
Function, (setf state-row): Private ordinary functions
Function, (setf state-row-ptr): Private ordinary functions
Function, (setf state-space-count): Private ordinary functions
Function, (setf state-tag): Private ordinary functions
Function, cell-finish: Private ordinary functions
Function, cell-input: Private ordinary functions
Function, copy-state: Private ordinary functions
Function, finish: Private ordinary functions
Function, first-label-integer-p: Private ordinary functions
Function, make-state: Private ordinary functions
Function, parse: Private ordinary functions
Function, parse-file: Public ordinary functions
Function, parse-float: Public ordinary functions
Function, parse-integer-only: Private ordinary functions
Function, parse-stream: Public ordinary functions
Function, print-state1: Private ordinary functions
Function, print-state2: Private ordinary functions
Function, print-state3: Private ordinary functions
Function, row-finish: Private ordinary functions
Function, sign-char-p: Private ordinary functions
Function, state-buffer: Private ordinary functions
Function, state-field: Private ordinary functions
Function, state-label-type: Private ordinary functions
Function, state-max-dim: Private ordinary functions
Function, state-offset: Private ordinary functions
Function, state-p: Private ordinary functions
Function, state-result: Private ordinary functions
Function, state-result-ptr: Private ordinary functions
Function, state-row: Private ordinary functions
Function, state-row-ptr: Private ordinary functions
Function, state-space-count: Private ordinary functions
Function, state-tag: Private ordinary functions
Function, whitespace-char-p: Private ordinary functions

M
Macro, defn: Private macros
Macro, tlet: Private macros
make-state: Private ordinary functions

P
parse: Private ordinary functions
parse-file: Public ordinary functions
parse-float: Public ordinary functions
parse-integer-only: Private ordinary functions
parse-stream: Public ordinary functions
print-state1: Private ordinary functions
print-state2: Private ordinary functions
print-state3: Private ordinary functions

R
row-finish: Private ordinary functions

S
sign-char-p: Private ordinary functions
state-buffer: Private ordinary functions
state-field: Private ordinary functions
state-label-type: Private ordinary functions
state-max-dim: Private ordinary functions
state-offset: Private ordinary functions
state-p: Private ordinary functions
state-result: Private ordinary functions
state-result-ptr: Private ordinary functions
state-row: Private ordinary functions
state-row-ptr: Private ordinary functions
state-space-count: Private ordinary functions
state-tag: Private ordinary functions

T
tlet: Private macros

W
whitespace-char-p: Private ordinary functions