core.matrix
datasets have 3 attributes than can be accessed by treating the dataset as a map.
Let's take this example dataset:
(def dataset-test
(clojure.core.matrix.dataset/dataset [{:a 1 :b 11}
{:a 2 :b 12}
{:a 3 :b 13}]))
> dataset-test
| :a | :b |
|----+----|
| 1 | 11 |
| 2 | 12 |
| 3 | 13 |
You can use the keys
function on a dataset:
> (keys dataset-test)
(:column-names :columns :shape)
You can access the column headers:
> (:column-names dataset-test)
[:a :b]
And the data content:
> (:columns dataset-test)
[[1 2 3] [11 12 13]]
The :shape
returns the dimensions, so number of rows and number of columns:
> (:shape dataset-test)
[3 2]