alibi_detect.od.sklearn.gmm
GMMSklearn
GMMSklearnInherits from: SklearnOutlierDetector, FitMixinSklearn, ABC
Constructor
GMMSklearn(self, n_components: int)n_components
int
Number of components in gaussian mixture model.
Methods
fit
fitfit(x_ref: numpy.ndarray, tol: float = 0.001, max_iter: int = 100, n_init: int = 1, init_params: str = 'kmeans', verbose: int = 0) -> DictFit the SKLearn GMM model`.
x_ref
numpy.ndarray
Reference data.
tol
float
0.001
Convergence threshold. EM iterations will stop when the lower bound average gain is below this threshold.
max_iter
int
100
Maximum number of EM iterations to perform.
n_init
int
1
Number of initializations to perform.
init_params
str
'kmeans'
Method used to initialize the weights, the means and the precisions. Must be one of: 'kmeans' : responsibilities are initialized using kmeans. 'kmeans++' : responsibilities are initialized using kmeans++. 'random' : responsibilities are initialized randomly. 'random_from_data' : responsibilities are initialized randomly from the data.
verbose
int
0
Enable verbose output. If 1 then it prints the current initialization and each iteration step. If greater than 1 then it prints also the log probability and the time needed for each step.
Returns
Type:
Dict
format_fit_kwargs
format_fit_kwargsformat_fit_kwargs(fit_kwargs: Dict) -> DictFormat kwargs for fit method.
fit_kwargs
Dict
kwargs
dictionary of Kwargs to format. See fit method for details.
Returns
Type:
Dict
score
scorescore(x: numpy.ndarray) -> numpy.ndarrayComputes the score of x
x
numpy.ndarray
np.ndarray with leading batch dimension.
Returns
Type:
numpy.ndarray
Last updated
Was this helpful?

