Liking cljdoc? Tell your friends :D

scicloj.metamorph.ml.tools


debugclj

(debug & s)

Prints formatted debug messages with timestamp and elapsed time.

s - Variable number of arguments to print

Prints current time, elapsed seconds since last debug call, and the message. Resets the internal timer on each call.

Example output: (5) HH:mm:ss.SSSS - Debug message here

Prints formatted debug messages with timestamp and elapsed time.

`s` - Variable number of arguments to print

Prints current time, elapsed seconds since last debug call, and the message.
Resets the internal timer on each call.

Example output: `  (5) HH:mm:ss.SSSS - Debug message here`
sourceraw docstring

dissoc-inclj

(dissoc-in m ks)

Dissociate a value in a nested assocative structure, identified by a sequence of keys. Any collections left empty by the operation will be dissociated from their containing structures.

Dissociate a value in a nested assocative structure, identified by a sequence
of keys. Any collections left empty by the operation will be dissociated from
their containing structures.
sourceraw docstring

get-put-tokenclj

(get-put-token token-lookup-table new-token-behaviour token)

Gets token ID from lookup table or assigns new ID based on strategy.

token-lookup-table - Mutable Map from tokens (String) to IDs (int) new-token-behaviour - Strategy for unknown tokens: :store, :fail, or :as-unknown token - String token to look up or add

Returns the token's integer ID. Behavior for new tokens:

  • :store - Adds token to table with next ID (requires mutable map)
  • :fail - Throws exception
  • :as-unknown - Returns token-idx-for-unknown (0)

Used internally for categorical and text encoding.

Gets token ID from lookup table or assigns new ID based on strategy.

`token-lookup-table` - Mutable Map from tokens (String) to IDs (int)
`new-token-behaviour` - Strategy for unknown tokens: `:store`, `:fail`, or `:as-unknown`
`token` - String token to look up or add

Returns the token's integer ID. Behavior for new tokens:

* `:store` - Adds token to table with next ID (requires mutable map)
* `:fail` - Throws exception
* `:as-unknown` - Returns `token-idx-for-unknown` (0)

Used internally for categorical and text encoding.
sourceraw docstring

keys-inclj

(keys-in m)

Returns a sequence of all key paths in a given map using DFS walk.

Returns a sequence of all key paths in a given map using DFS walk.
sourceraw docstring

multi-dissoc-inclj

(multi-dissoc-in m kss)

Removes multiple nested key paths from a map.

m - Map to dissociate from kss - Sequence of key path vectors to remove

Returns the map with all specified paths removed. Applies dissoc-in to each path in sequence. Empty collections left by removals are automatically dissociated.

Example: (multi-dissoc-in {:a {:b 1 :c 2}} [[:a :b] [:a :c]]) => {}

Removes multiple nested key paths from a map.

`m` - Map to dissociate from
`kss` - Sequence of key path vectors to remove

Returns the map with all specified paths removed. Applies `dissoc-in` to each
path in sequence. Empty collections left by removals are automatically dissociated.

Example: `(multi-dissoc-in {:a {:b 1 :c 2}} [[:a :b] [:a :c]]) => {}`
sourceraw docstring

pp-strclj

(pp-str x)

Pretty-prints a value to a string.

x - Value to pretty-print

Returns a string containing the pretty-printed representation using clojure.pprint/pprint. Useful for readable logging and debugging output.

Pretty-prints a value to a string.

`x` - Value to pretty-print

Returns a string containing the pretty-printed representation using
`clojure.pprint/pprint`. Useful for readable logging and debugging output.
sourceraw docstring

prevoius-debug-timeclj

Atom tracking the last debug timestamp for duration calculations.

Atom tracking the last debug timestamp for duration calculations.
sourceraw docstring

process-fileclj

(process-file lines-source lines-seq-fn line-func line-acc max-lines skip-lines)

Generic file line processor with skip/take support.

lines-source - java.io.Reader or any sequence source lines-seq-fn - Function to convert source to line sequence line-func - Reducer function (fn [acc line] ...) line-acc - Initial accumulator value max-lines - Maximum number of lines to process skip-lines - Number of lines to skip at start

Returns the final accumulator after processing. Automatically manages Reader lifecycle with with-open for Reader sources.

Generic file line processor with skip/take support.

`lines-source` - java.io.Reader or any sequence source
`lines-seq-fn` - Function to convert source to line sequence
`line-func` - Reducer function `(fn [acc line] ...)`
`line-acc` - Initial accumulator value
`max-lines` - Maximum number of lines to process
`skip-lines` - Number of lines to skip at start

Returns the final accumulator after processing. Automatically manages Reader
lifecycle with `with-open` for Reader sources.
sourceraw docstring

reduce-resultclj

(reduce-result r result-dissoc-in-seq)

Removes multiple nested paths from a result map.

r - Result map result-dissoc-in-seq - Sequence of key path vectors to remove

Returns the result map with all specified paths removed using dissoc-in. Alias for multi-dissoc-in used in evaluation result handling.

See also: multi-dissoc-in, scicloj.metamorph.ml.evaluation-handler/default-result-dissoc-in-seq

Removes multiple nested paths from a result map.

`r` - Result map
`result-dissoc-in-seq` - Sequence of key path vectors to remove

Returns the result map with all specified paths removed using `dissoc-in`.
Alias for `multi-dissoc-in` used in evaluation result handling.

See also: `multi-dissoc-in`, `scicloj.metamorph.ml.evaluation-handler/default-result-dissoc-in-seq`
sourceraw docstring

time-formatclj

SimpleDateFormat for debug output (HH:mm:ss.SSSS format).

SimpleDateFormat for debug output (HH:mm:ss.SSSS format).
sourceraw docstring

token-idx-for-unknownclj

Integer index assigned to unknown tokens in categorical encoding.

Value: 0. Used when :new-token-behaviour is :as-unknown to map all out-of-vocabulary tokens to this index.

Integer index assigned to unknown tokens in categorical encoding.

Value: `0`. Used when `:new-token-behaviour` is `:as-unknown` to map all
out-of-vocabulary tokens to this index.
sourceraw docstring

token-of-unknownclj

String constant representing unknown tokens in categorical encoding.

Value: "[UNKNOWN]". Used as a placeholder when encountering tokens not in the training vocabulary, depending on :new-token-behaviour setting.

String constant representing unknown tokens in categorical encoding.

Value: `"[UNKNOWN]"`. Used as a placeholder when encountering tokens not
in the training vocabulary, depending on `:new-token-behaviour` setting.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close