Semagle.Data.Formats Library
Semagle.Data.Formats provides reading and writing functions for popular machine learning dataset formats.
LIBSVM
LIBSVM uses "sparse" vector format where zero values do not need to be stored.
Each vector is repsented by a separate text line. A first number of the line is
the label y
(class number or value of the approximated function), which is
followed by index/value pairs of non-zero elements of the feature vector x
.
1: 2: |
|
Read Data
Read the sequence of (y, x)
pairs from LIBSVM file:
1: 2: 3: 4: |
|
Write Data
Write the sequence of (y, x)
pairs to LIBSVM file:
1: 2: 3: 4: 5: 6: 7: 8: 9: |
|
val data : seq<float32 * obj>
Multiple items
module List
from Microsoft.FSharp.Collections
--------------------
type List<'T> =
| ( [] )
| ( :: ) of Head: 'T * Tail: 'T list
interface IReadOnlyList<'T>
interface IReadOnlyCollection<'T>
interface IEnumerable
interface IEnumerable<'T>
member GetSlice : startIndex:int option * endIndex:int option -> 'T list
member Head : 'T
member IsEmpty : bool
member Item : index:int -> 'T with get
member Length : int
member Tail : 'T list
...
module List
from Microsoft.FSharp.Collections
--------------------
type List<'T> =
| ( [] )
| ( :: ) of Head: 'T * Tail: 'T list
interface IReadOnlyList<'T>
interface IReadOnlyCollection<'T>
interface IEnumerable
interface IEnumerable<'T>
member GetSlice : startIndex:int option * endIndex:int option -> 'T list
member Head : 'T
member IsEmpty : bool
member Item : index:int -> 'T with get
member Length : int
member Tail : 'T list
...
val toSeq : list:'T list -> seq<'T>