lace.Engine

class lace.Engine(core_engine: CoreEngine)

The cross-categorization model with states and data.

__init__(core_engine: CoreEngine) None

Create a new Engine with its internal representation.

In general, you will use Engine.from_df or Engine.load instead.

Properties

codebook

Return the codebook.

columns

A list of the column names appearing in their order in the table.

ftypes

A dictionary mapping column names to feature types.

index

The string row names of the engine.

n_cols

The number of columns in the table.

n_rows

The number of rows in the table.

n_states

The number of states (independent Markov chains).

shape

A tuple containing the number of rows and the number of columns in the table.

engine

Methods

append_columns(cols[, metadata, cat_cutoff, ...])

Append new columns to the Engine.

append_rows(rows)

Append new rows to the table.

clustermap(fn_name, *[, indices, ...])

Generate a clustermap of a pairwise function.

column_assignment(state_ix)

Return the assignment of columns to views.

del_column(col)

Delete a given column.

depprob(col_pairs)

Compute the dependence probability between pairs of columns.

diagnostics([name])

Get convergence diagnostics.

draw(row, col[, n])

Draw data from the distribution of a specific cell in the table.

edit_cell(row, col, value)

Edit the value of a cell in the table.

entropy(cols[, n_mc_samples])

Estimate the entropy or joint entropy of one or more features.

feature_params(col[, state_ixs])

Get the component parameters for a given column.

flatten_columns()

Flatten the column assignment.

from_df(df[, codebook, n_states, id_offset, ...])

Create a new Engine from a DataFrame.

ftype(col)

Get the feature type of a column.

impute(col[, rows, with_uncertainty])

Impute (predict) the value of a cell(s) in the lace table.

inconsistency(values[, given])

Compute inconsistency.

load(path)

Load an Engine from a path.

logp(values[, given, state_ixs, scaled])

Compute the log likelihood.

mi(col_pairs[, n_mc_samples, mi_type])

Compute the mutual information between pairs of columns.

novelty(row[, wrt])

Compute the novelty of a row.

pairwise_fn(fn_name[, indices])

Compute a function for a set of pairs of rows or columns.

predict(target[, given, state_ixs, ...])

Predict a single target from a conditional distribution.

remove_rows(indices)

Remove rows from the table.

row_assignments(state_ix)

Return the assignment of rows to categories for each view.

rowsim(row_pairs[, wrt, col_weighted])

Compute the row similarity between pairs of rows.

save(path)

Save the Engine metadata to path.

seed(rng_seed)

Set the state of the random number generator (RNG).

simulate(cols[, given, n, include_given])

Simulate data from a conditional distribution.

surprisal(col, *[, rows, values, state_ixs])

Compute the surprisal of a values in specific cells.

update(n_iters, *[, timeout, checkpoint, ...])

Update the Engine by advancing the Markov chains.

variability(target[, given, state_ixs])

Return the variability of a conditional distribution.