mescla.types.MixingResult

class mescla.types.MixingResult(ratios, endmembers, fitted, residuals, objective, method, converged=True, samples=None, diagnostics=<factory>)[source]

Bases: object

Mixing ratios for a set of samples, plus whatever the estimator revised.

Variables:
  • ratios (ndarray, shape (n_samples, ne)) – Mixing ratios. Rows sum to 1 and entries are non-negative.

  • endmembers (EndMembers) – The end-members used. For maximum-likelihood estimation these are the revised compositions; compare them with the measured ones.

  • fitted (ndarray, shape (n_samples, ns)) – Concentrations implied by the ratios and end-members.

  • residuals (ndarray, shape (n_samples, ns)) – observed - fitted. Structure here is chemistry, not noise: see mescla.reactions.

  • objective (float) – Value of the minimised objective (weighted sum of squares, or -log L).

  • method (str) – Which estimator produced this.

  • converged (bool)

  • diagnostics (dict) – Estimator-specific extras (iterations, active constraints, restarts, …).

Parameters:
ratios: ndarray
endmembers: EndMembers
fitted: ndarray
residuals: ndarray
objective: float
method: str
converged: bool = True
samples: tuple[str, ...] = None
diagnostics: dict[str, Any]
property n_endmembers: int
ratios_frame()[source]
Return type:

pd.DataFrame

mean_ratios()[source]

Average contribution of each end-member across all samples.

Return type:

pd.Series