probinet.model_selection.labeling

probinet.model_selection.labeling#

Module for extracting true labels and predicting labels.

Functions

extract_true_label(X[, mask])

Extract true labels from the design matrix X.

predict_label(X, u, v, beta[, mask])

Compute predicted labels.

probinet.model_selection.labeling.extract_true_label(X: DataFrame, mask: ndarray | None = None) ndarray[source]#

Extract true labels from the design matrix X.

Parameters:
  • X – Pandas DataFrame object representing the one-hot encoding version of the design matrix.

  • mask – Mask for selecting a subset of the design matrix.

Returns:

Array of true labels.

Return type:

np.ndarray

probinet.model_selection.labeling.predict_label(X: DataFrame, u: ndarray, v: ndarray, beta: ndarray, mask: ndarray | None = None) List[str][source]#

Compute predicted labels.

Parameters:
  • X – Pandas DataFrame object representing the one-hot encoding version of the design matrix.

  • u (Membership matrix (out-degree).) – Membership matrix (out-degree).

  • v (Membership matrix (in-degree).) – Membership matrix (in-degree).

  • beta (Beta parameter matrix.) – Beta parameter matrix.

  • mask (Mask for selecting a subset of the design matrix.) – Mask for selecting a subset of the design matrix.

Returns:

List of predicted labels.

Return type:

List[str]