Versions in this module Expand all Collapse all v1 v1.0.0 Jul 13, 2026 Changes in this version + const MaxCategories + var ErrBadLabels = errors.New("cohenskappa: invalid label set") + var ErrBadMatrix = errors.New("cohenskappa: confusion matrix must be square, non-negative, and finite") + var ErrBadWeights = errors.New(...) + var ErrEmpty = errors.New("cohenskappa: no ratings provided") + var ErrLengthMismatch = errors.New("cohenskappa: rater slices have different lengths") + var ErrNoLabelOrder = errors.New(...) + var ErrOverflow = errors.New("cohenskappa: counts are too large to score in float64 without overflow") + var ErrUndefined = errors.New("cohenskappa: undefined (expected disagreement is zero)") + var ErrUnknownLabel = errors.New("cohenskappa: rating not present in the label set") + func ScoreOrdinal[T cmp.Ordered](a, b []T, w Weighting) (float64, error) + func Score[T comparable](a, b []T) (float64, error) + type Matrix struct + func NewMatrix(counts [][]float64) (*Matrix, error) + func (m *Matrix) Counts() [][]float64 + func (m *Matrix) ExpectedAgreement() float64 + func (m *Matrix) K() int + func (m *Matrix) Kappa(w Weighting) (float64, error) + func (m *Matrix) KappaWeights(w [][]float64) (float64, error) + func (m *Matrix) N() float64 + func (m *Matrix) ObservedAgreement() float64 + type Scorer struct + Labels []T + Weighting Weighting + Weights [][]float64 + func (s Scorer[T]) Matrix(a, b []T) (*Matrix, error) + func (s Scorer[T]) Score(a, b []T) (float64, error) + type Weighting int + const Linear + const Quadratic + const Unweighted + func (w Weighting) String() string