lace.Engine.feature_params
- Engine.feature_params(col: int | str, state_ixs: List[int] | None = None) Dict
Get the component parameters for a given column.
- Parameters:
col (int or str) – The index or name of the column from which to retrieve parameters
state_ixs (List[int], optional) – And optional list of state indices from which to return parameters
- Returns:
params – params[state_ix][component_ix] is the component parameters for the given component in the given state
- Return type:
Dict[List]
Examples
Get Gaussian component parameters from the Satellites dataset
>>> from lace.examples import Satellites >>> sats = Satellites() >>> gauss_params = sats.feature_params("Period_minutes") >>> g = gauss_params[1][0] >>> g Gaussian(mu=2216.995855497483, sigma=2809.7999447423026) >>> g.mu 2216.995855497483
Get categorical weights from the Satellites dataset
>>> cat_params = sats.feature_params("Class_of_Orbit", state_ixs=[2]) >>> c = cat_params[2][0] >>> c Categorical_4(weights=[0.23464953242044007, ..., 0.04544555912284563]) >>> c.weights [0.23464953242044007, ..., 0.04544555912284563]
You can also select columns by integer index
>>> sats.columns[3] 'Class_of_Orbit' >>> params = sats.feature_params(3) >>> params[0][1] Categorical_4(weights=[0.0010264756471345055, ..., 0.9963828657821786])