Liking cljdoc? Tell your friends :D

scicloj.metamorph.ml.design-matrix


create-design-matrixclj

(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:

  • 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.

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.

sourceraw docstring

map-column->columnsclj

(map-column->columns ds src-col)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close