openasce.extension package

Subpackages

Submodules

openasce.extension.debias_model module

class openasce.extension.debias_model.CausalDebiasModel[source]

Bases: Runtime

Debias Inference Class

Base class of the causal debias

Attributes:

__init__() None[source]
fit(*, X: Iterable[ndarray] = None, Y: Iterable[ndarray] = None, C: Dict[str, Iterable[ndarray]] = None, Z: Iterable[Tuple[ndarray, ndarray, Dict[str, ndarray]]] = None, num_epochs: int = 1, **kwargs) None[source]

Feed the sample data and train the model on the samples.

Parameters
  • X – Features of the samples.

  • Y – Outcomes of the samples.

  • C – Other concerned columns of the samples, e.g. {‘weight’: Iterable[np.ndarray]}

  • Z – The iterable object returning (a batch of X, a batch of Y, a batch of C) if having

  • num_epochs – number of the train epoch

Returns

None

get_result()[source]

Get the predict result

Arguments:

Returns

predict result

predict(*, X: Iterable[ndarray] = None, C: Dict[str, Iterable[ndarray]] = None, Z: Iterable[Tuple[ndarray, ndarray, Dict[str, ndarray]]] = None, **kwargs) None[source]

Feed the sample data

Estimate the effect on the samples, and get_result method can be used to get the result of prediction

Parameters
  • X – Features of the samples.

  • C – Other concerned columns of the samples, e.g. {‘weight’: Iterable[np.ndarray]}

  • Z – The iterable object returning (a batch of X, a batch of Y, a batch of C) if having

Returns

None