(create-design-matrix ds targets-specs features-specs)Converts the given dataset into a full numeric dataset.
ds Is te tech.v3 dataset to transform
target-specs are the specifications how to transform the target variables
features-specs are the specifications how to transform the features
The 'spec' can express several types of dataset transformations in a compact way:
Function calls need to be given as lists (quoted by '), and can refer to column names. They get evaluated from top->bottom, and can refer to each other.
The followig aliases can be used as part of the spec. (Other functions need to be full qualified).
clojure.core can be used without full qailifying te symbols ds (tech.v3.dataset) tc (tablecloth.api) tcc (tablecloth.column.api)
Example:
(dm/create-design-matrix
ds
[:y]
[
[:sum '(+ :a :b :c)]
])
This will:
See design_matrix_test.clj for more examples.
Converts the given dataset into a full numeric dataset.
`ds` Is te tech.v3 dataset to transform
`target-specs` are the specifications how to transform the target variables
`features-specs` are the specifications how to transform the features
The 'spec' can express several types of dataset transformations in a compact way:
- add new derived columns
- remove columns
- rename columns
- convert columns to categorical
- set inference target
Function calls need to be given as lists (quoted by '), and can refer to column names.
They get evaluated from top->bottom, and can refer to each other.
The followig aliases can be used as part of the spec.
(Other functions need to be full qualified).
clojure.core can be used without full qailifying te symbols
ds (tech.v3.dataset)
tc (tablecloth.api)
tcc (tablecloth.column.api)
Example:
(dm/create-design-matrix
ds
[:y]
[
[:sum '(+ :a :b :c)]
])
This will:
- set inference target to y:
- create a new derived variables :sum
- remove all columns except :y and :sum
See `design_matrix_test.clj` for more examples.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |