pysad.models.RandomModel
- class pysad.models.RandomModel[source]
Random scorer that chooses a score between 0 and 1 ignoring the input.
Methods
__init__()fit(X[, y])Fits the model to all instances in order.
fit_partial(X[, y])This method is ignored.
fit_score(X[, y])This helper method applies fit_score_partial to all instances in order.
fit_score_partial(X[, y])Applies fit_partial and score_partial to the next instance, respectively.
score(X)Scores all instances via score_partial iteratively.
Randomly outputs a score from the uniform distribution.
- fit(X, y=None)
Fits the model to all instances in order.
- fit_partial(X, y=None)[source]
This method is ignored. Added for convenience.
- Parameters:
X – any
y – any
- Returns:
Returns the self.
- Return type:
- fit_score(X, y=None)
This helper method applies fit_score_partial to all instances in order.
- Parameters:
X (np.float64 array of shape (num_instances, num_features)) – The instances in order to fit.
y (np.int32 array of shape (num_instances, )) – The labels of the instances in order to fit (Optional for unsupervised models, default=None).
- Returns:
The anomalousness scores of the instances in order.
- Return type:
np.float64 array of shape (num_instances,)
- fit_score_partial(X, y=None)
Applies fit_partial and score_partial to the next instance, respectively.
- score(X)
Scores all instances via score_partial iteratively.
- Parameters:
X (np.float64 array of shape (num_instances, num_features)) – The instances in order to score.
- Returns:
The anomalousness scores of the instances in order.
- Return type:
np.float64 array of shape (num_instances,)