fisher_lda_fit — SEGMENTATION classify op

• Data kinds: matrix × signal → table

• Call: import fullseye as fs; fs.ledger.fisher_lda_fit(X, y, *, ridge: 'float' = 1e-06, prior1: 'Optional[float]' = None) -> 'Dict[str, object]' (to call the implementation directly, import cropweed; cropweed.fisher_lda_fit(X, y, *, ridge: 'float' = 1e-06, prior1: 'Optional[float]' = None) -> 'Dict[str, object]'; from the registry, opssegmentation.get("fisher_lda_fit"))

Usage

Fit a two-class Fisher linear discriminant (closed form, no iteration).

X is (N, D) features (the dict returned by superpixel_color_texture_features can be passed as is), y is N class labels 0 / 1. Features are standardised by the overall mean and standard deviation (columns with zero variance keep scale 1 and are recorded in constant_columns); ridge × tr(Σ)/D is added to the pooled within-class covariance Σ = (S₀ + S₁)/(N − 2), then w = Σ⁻¹(μ₁ − μ₀). The intercept is the point where the log-likelihood ratio of the two equal-variance normals w·z − w·(μ₀ + μ₁)/2 + log(π₁/π₀) is 0 (prior1 = π₁, default = the share in the training data).

Returns: w, bias (score = z·w + bias, positive = class 1), mean, scale, mu0, mu1, fisher_ratio (J = (w·Δμ)²/(wᵀΣw), separation strength), n0, n1, prior1, constant_columns, cond. Empty input, y not 0/1, fewer than 2 samples per class, N ≤ 2, covariance condition number above 1e12 (direction undetermined) and equal class means (J = 0) raise ValueError.

Detailed usage guide

• halcon_segmentation family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_weed_rice_ratio — py -3.11 examples/poc_weed_rice_ratio.py

Ops the type connects to (they accept table as input)

class_ndim_norm · fisher_lda_score

Same category (classify)

class_2dim_sup · class_2dim_unsup · learn_ndim_norm · class_ndim_norm · classify_image_class_lut · fisher_lda_score


*Provenance: cropweed.py — SEGMENTATION operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.