actableai.clustering package

Submodules

actableai.clustering.config module

actableai.clustering.explain module

actableai.clustering.explain.generate_cluster_descriptions(tree, features, dummy_columns=None, min_precision=0.8)

actableai.clustering.metrics module

actableai.clustering.metrics.acc(y_true, y_pred)

Calculate clustering accuracy. Require scikit-learn installed

# Arguments
y: true labels, numpy.array with shape (n_samples,) y_pred: predicted labels, numpy.array with shape (n_samples,)
# Return
accuracy, in [0,1]

actableai.clustering.transform module

class actableai.clustering.transform.ClusteringDataTransformer(drop_low_info=True, drop_categorical=False)

Bases: sklearn.base.TransformerMixin, sklearn.base.BaseEstimator

Transform numeric columns using StandardScaler and categorical columns using OneHotEncoder.

fit_transform(X: pandas.core.frame.DataFrame)

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters
  • X (array-like of shape (n_samples, n_features)) – Input samples.
  • y (array-like of shape (n_samples,) or (n_samples, n_outputs), default=None) – Target values (None for unsupervised transformations).
  • **fit_params (dict) – Additional fit parameters.
Returns

X_new – Transformed array.

Return type

ndarray array of shape (n_samples, n_features_new)

inverse_transform(X)
transform(X: pandas.core.frame.DataFrame)
class actableai.clustering.transform.ImputeAndStandardScaler

Bases: sklearn.pipeline.Pipeline

steps: List[Any]

Module contents