lace.Codebook
- class lace.Codebook(codebook: Codebook)
Stores metadata about the lace
Engine
.The codebook stores information about the CRP priors on columns-to-views (
state_crp_alpha
) and rows-to-categories (view_crp_alpha
), the row names, and how to model each column including the type, the prior, and the hyper prior.- codebook
A reference to the underlying rust data structure
- Type:
core.Codebook
Properties
Get/set a column metadata.
Contains the name of each column.
Contains the name of each row.
A (n_rows, n_cols) tuple.
Methods
append_column_metadata
(col_metadata)Append new columns to the codebook.
empty
(name)Create an empty codebook with a given name.
from_df
(name, df[, cat_cutoff, no_hypers])Infer a codebook from a DataFrame.
json
()Return the codebook as a JSON string.
rename
(name)Return a copy of the codebook with a new name.
set_row_names
(row_names)Return a copy of the codebook with new row_names.
set_state_prior_process
(prior_process)Return a copy of the codebook with a new state PriorProcess.
set_view_prior_process
(prior_process)Return a copy of the codebook with a new view PriorProcess.
value_map
(col)Get the value map for a Categorical column if it exists.