populations
Provide utility functions for generating antibody populations in immunological algorithms.
Module:
aisp.base.immune
Import:from aisp.base.immune import populations
Functions
generate_random_antibodies
def generate_random_antibodies(
n_samples: int,
n_features: int,
feature_type: FeatureTypeAll = "continuous-features",
bounds: Optional[npt.NDArray[np.float64]] = None,
) -> npt.NDArray:
...
Generate a random antibody population.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
n_samples | int | - | Number of antibodies (samples) to generate. |
n_features | int | - | Number of features (dimensions) for each antibody. |
feature_type | FeatureTypeAll | "continuous-features" | Specifies the type of features: "continuous-features", "binary-features", "ranged-features", or "permutation-features". |
bounds | npt.NDArray[np.float64] | None | Array (n_features, 2) with min and max per dimension. |
Returns
| Type | Description |
|---|---|
npt.NDArray | Array of shape (n_samples, n_features) containing the generated antibodies. |
Raises
| Exception | Description |
|---|---|
ValueError | If the number of features is less than or equal to zero. |