calibrate

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package calibrate compares two coupling scorers over a coupling.Index and reports per-edge agreement between them.

It is pure: no I/O, no os/exec, no YAML — only coupling model types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EdgeAgreement

type EdgeAgreement struct {
	// EdgeKey is the coupling.Index key (from\x00to\x00kind).
	EdgeKey    string
	Strength   coupling.Strength
	Distance   coupling.Distance
	Volatility coupling.Volatility
	// ScoreA is the result from scorerA (AdditiveScorer).
	ScoreA coupling.EdgeScore
	// ScoreB is the result from scorerB (MultiplicativeScorer).
	ScoreB    coupling.EdgeScore
	BandAgree bool // ScoreA.Band == ScoreB.Band
}

EdgeAgreement records one edge's scores from both scorers.

type Report

type Report struct {
	RepoPath   string
	EdgeCount  int
	AgreeCount int
	Edges      []EdgeAgreement
}

Report is the calibration result for one repo.

func Compare

func Compare(repoPath string, idx coupling.Index, scorerA, scorerB coupling.Scorer) Report

Compare runs both scorers over idx and returns a Report.

Only cross-boundary edges are included — same_module and unknown distance edges are skipped, matching what classify.Run scores.

func (Report) BandAgreementRate

func (r Report) BandAgreementRate() float64

BandAgreementRate returns AgreeCount/EdgeCount as a float64. Returns 0 when EdgeCount is 0.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL