Versions in this module Expand all Collapse all v0 v0.2.0 Oct 26, 2026 Changes in this version + const DefaultThreshold + var ErrNoSpans = errors.New("snippetclassifier: match has no spans") + func ComputeFeatures(local, oss []string, spans []Span) map[string]float64 + func SplitLines(data []byte) []string + type Classifier struct + func New(opts ...Option) (*Classifier, error) + func (c *Classifier) Classify(m Match) (Result, error) + func (c *Classifier) ClassifyLines(local, oss []string, spans []Span) Result + func (c *Classifier) ModelVersion() string + func (c *Classifier) Threshold() float64 + type Contribution struct + Feature string + Logit float64 + Value float64 + type Match struct + Local []byte + OSS []byte + Spans []Span + type Model struct + Coef []float64 + EvalHuman json.RawMessage + Features []string + Intercept float64 + Stats map[string][2]float64 + TrainedOn json.RawMessage + Version string + func DefaultModel() *Model + func ParseModel(data []byte) (*Model, error) + func (m *Model) Probability(features map[string]float64) (float64, []Contribution) + type Option func(*Classifier) error + func WithModel(data []byte) Option + func WithThreshold(t float64) Option + type Result struct + Contributions []Contribution + Features map[string]float64 + ModelVersion string + Probability float64 + Verdict Verdict + type Span struct + LocalEnd int + LocalStart int + OSSEnd int + OSSStart int + type Verdict string + const VerdictFalsePositive + const VerdictReal