Skip to content
Back to skills

Mixtures And Classifiers

ASecurity

"Guides pomegranate GeneralMixtureModel and BayesClassifier

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
developmentpythonrailsapi

Works with

  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill mixtures-and-classifiers --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mixtures And Classifiers?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mixtures And Classifiers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-mixtures-and-classifiers/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-mixtures-and-classifiers)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mixtures-and-classifiers
description: "Guides pomegranate GeneralMixtureModel and BayesClassifier
  workflows, including heterogeneous mixture fitting, supervised probabilistic
  classification, posterior probabilities, priors, EM settings, and component
  distributions."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# mixtures-and-classifiers

## Use this sub-skill when

Use this sub-skill for unsupervised mixture modeling with `GeneralMixtureModel` and supervised probabilistic classification with `BayesClassifier`. These models are useful when a task asks for Gaussian mixtures, heterogeneous mixtures, EM fitting, class-conditional distributions, posterior component/class probabilities, prior-weighted inference, or semi-supervised-style hard priors.

## Start here

Typical imports:

```python
from pomegranate.distributions import Normal, Exponential
from pomegranate.gmm import GeneralMixtureModel
from pomegranate.bayes_classifier import BayesClassifier
```

Read [references/api-reference.md](references/api-reference.md) for constructor signatures, fitting recipes, and priors. Run [scripts/smoke_mixtures_classifiers.py](scripts/smoke_mixtures_classifiers.py) after installation for a tiny check that both model families fit and predict.

## Core workflow

1. **Build component distributions.** Create one pomegranate distribution or probabilistic model per component/class. Use [../distributions/SKILL.md](../distributions/SKILL.md) if component selection is the hard part.
2. **Choose unsupervised vs supervised.** Use `GeneralMixtureModel(distributions, ...)` when labels are unknown; use `BayesClassifier(distributions, ...)` when class labels `y` are provided.
3. **Fit on 2D data.** Mixtures and classifiers expect feature matrices shaped `(n, d)`.
4. **Inspect posterior assignments.** Use `predict`, `predict_proba`, or `predict_log_proba` for component/class assignment probabilities.
5. **Use priors deliberately.** Priors must be probabilities with valid shape and row sums. Read [../../references/feature-guide.md](../../references/feature-guide.md) before using hard labels or soft prior weights.
6. **Tune EM only when necessary.** `max_iter`, `tol`, `init`, `random_state`, and `verbose` affect mixture fitting and initialization.

## Route elsewhere when

- The task is only about selecting or fitting a base distribution: read [../distributions/SKILL.md](../distributions/SKILL.md).
- The model is a Bayesian network or factor graph: read [../graph-models/SKILL.md](../graph-models/SKILL.md).
- The model is a Markov chain or HMM over sequences: read [../sequence-models/SKILL.md](../sequence-models/SKILL.md).
- The task is KMeans clustering or centroid initialization directly: read [../clustering/SKILL.md](../clustering/SKILL.md).

## Guardrails

- `BayesClassifier.fit` requires `y`; `GeneralMixtureModel.fit` does not.
- The order of distributions defines component/class indices, so record the mapping before interpreting predictions.
- If uninitialized component distributions are supplied to `GeneralMixtureModel`, pomegranate initializes them with KMeans before EM.
- Validate a small example before disabling `check_data` or moving to mixed precision/compiled execution.
- Read [references/troubleshooting.md](references/troubleshooting.md) when priors, labels, component initialization, or EM convergence fails.

Files in this skill

  • SKILL.md3.3 KB
  • references/api-reference.md3.6 KB
  • references/troubleshooting.md2.9 KB
  • scripts/smoke_mixtures_classifiers.py1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…