criterion

package
v0.1.45 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package criterion judges candidates against the base by the criterion of the model, of the engine, or of a pair of both: the constraints, the score as the share of the path from the base to the ceiling, "better", the choice, the confirmation on held-out learners and the way out. It reads files of results that sim run wrote, the candidates' beside the base's on the same learners, and holds the paths fixed as the decisive run of the base read them before the first candidate.

Index

Constants

View Source
const (
	Model  = "model"
	Engine = "engine"
	Pair   = "pair"
)

The criteria.

View Source
const Decisive = 2000

Decisive is the learners of every cell a decisive run takes, and the recipe just decisive runs; a run of fewer is a rough look and decides nothing. It is the largest, in steps of 250, at which the run of the base on a free machine takes at most 41 minutes, within the hour with a margin.

View Source
const (
	RulesCandidate = "df338e58e35f97c51eca49be0064f19d0fcfc0a2"
)

The criterion of the short run of the three rules — a new learner's estimate starts low, an adult corrects the level, and a guard lowers the level after failures in a row —, written down before the run: the rules are learner-model at RulesCandidate; grade 5's M11.same holds above the base's at the low end of its interval; M12.false of the reference's cell holds at most guardCeiling at the high end of its interval; and the adult's correction, the cell of population.Rules, has the paired difference of M11.same against grade 1's above zero at its low end. fair is the constraint of the judgements as it is.

View Source
const Same = "M11.same"

Same is the target M11.same: the share of the learners of each grade but the reference's who come to the reference's estimate, the candidate's less the base's, pooled over the grades.

Variables

View Source
var ErrCriterion = errors.New("criterion")

ErrCriterion is a judgement the criterion refuses.

Functions

This section is empty.

Types

type Candidate

type Candidate struct {
	Name      string
	File      *bench.File
	Group     string
	Aim       string
	Constants int
	NewField  bool
	Distance  int
	Library   string
	EqualOn   []string
}

Candidate is a candidate rule: its file of results on the learners of the base, the group of the score it names its own, its aim, if it names one of the model's, and what the choice among equals reads — the constants it changes, whether it adds a field to the model's state or the engine's input, and its distance from the base, in the author's order. In a pair it names the library whose aim it is. EqualOn are the graphs, by the IDs of their modules joined by "+", on which it claims to give the same runs as the base: there every learner's sums are the base's, or it fails the check "neutral".

type Check

type Check struct {
	Kind    string // invariants, floor, no worse, aim, neutral, fair
	Cell    string
	Number  string
	Met     bool
	Skipped bool // the base reads no such number on the cell: there is nothing to hold
	NoGraph bool // a graph with no published package: neither met nor failed
	Detail  string
}

Check is one check of a candidate: a constraint on a cell and a number, or on its run.

type Confirm

type Confirm struct {
	Base, Candidate *bench.File
}

Confirm are the runs of the confirmation on the held-out learners of the choice: the base and the chosen candidate.

type Correction added in v0.1.28

type Correction struct {
	Name, Date, Version, Digest string
	Run                         *bench.File
	Pins                        map[string]Pin
}

Correction is an evaluation of the adult's correction against the truth: its name, as its folder evaluations/<name>/, the run of C-grade1 and D-grade1 and its SHA-256, the date, the version of sim that reads it and the libraries of the gate file, which the engine of the run is held to.

type CorrectionResult added in v0.1.28

type CorrectionResult struct {
	Correction
	Numbers             []measure.Pair
	Learners, Corrected int
	Holds               bool
}

CorrectionResult is what the evaluation of the correction reads: M13 of the cell of the correction against the same learners without it, each number by name, the learners and how many of them the adult corrected, and whether the criterion holds.

func EvaluateCorrection added in v0.1.28

func EvaluateCorrection(c Correction) (*CorrectionResult, error)

EvaluateCorrection reads the evaluation of the correction against the truth: a whole run of the rules, as EvaluateRules holds it, whose cells C-grade1 and D-grade1 of olympiad maths have the same learners in the same order, at least a decisive run's, each with the truth in its trace. It holds when the paired difference of M13.same, the correction's less grade 1's, is above zero at the low end of its interval.

func (*CorrectionResult) Write added in v0.1.28

func (r *CorrectionResult) Write(w io.Writer) error

Write writes the report of the evaluation of the correction in Markdown: the criterion, the run, M13 of both cells and their difference, the outcome, and the paragraph for the DPIA.

type Evaluation added in v0.1.18

type Evaluation struct {
	Name, Digest, Date, Version string
	Run                         *bench.File
	Pins                        map[string]Pin
}

Evaluation is an evaluation of the base by the criterion of fairness by the grade: its name, as its folder evaluations/<name>/, the decisive run of the base and its SHA-256, the date the evaluation is made on, the libraries the base is fixed at — those of the gate file — and the version of sim that reads it.

type Fairness added in v0.1.18

type Fairness struct {
	Evaluation
	Grades []Grade
	Holds  bool
}

Fairness is what an evaluation reads: each grade against the reference, and whether the base holds.

func Evaluate added in v0.1.18

func Evaluate(e Evaluation) (*Fairness, error)

Evaluate reads the evaluation of fairness by the grade off a decisive run of the base: under the engine, on the working learners, the whole run on the pinned packages and the libraries of the gate file, with no breach of an invariant and at least a decisive run's learners on each cell of fairness, which are every population of fairness on a published graph. Each grade but the reference's is read against the reference in pairs by learner, the resamples drawn by the reference's cell, so that every grade resamples the same learners.

func (*Fairness) Write added in v0.1.18

func (f *Fairness) Write(w io.Writer) error

Write writes the report of the evaluation in Markdown: the criterion, the base and the run, each grade's numbers with their intervals, whether the base holds, and the paragraph for the DPIA.

type GoalCellResult added in v0.1.44

type GoalCellResult struct {
	Cell, Twin, Item string
	Numbers          []measure.Value
	Learners         int
}

GoalCellResult is the cell of the goal against its twin, on its area: the numbers of measure.GoalPairNumbers, E7.ratio first, of Learners learners.

type GoalEnds added in v0.1.45

type GoalEnds struct {
	Cell                           string
	Learners, Ended, AtOnce, Month int
}

GoalEnds is the end of the goal in a cell that sets it: its learners, those whose goal ended by its result within the run, and of them those whose goal ended before their first answer, the area having nothing within reach from the setting; and those whose goal ended since a month had passed.

type GoalEvaluation added in v0.1.44

type GoalEvaluation struct {
	Name, Date, Version, Digest string
	Run                         *bench.File
	Exact                       bool
}

GoalEvaluation is an evaluation of the goal for the tutor: its name, as its folder evaluations/<name>/, the run with its SHA-256, the date, the version of sim that reads it, and Exact, which the evaluation file records — every number of the gate the same bits as recorded, with the engine of the goal in place of the gate file's and learner-model at the gate file's commit. The run is held to no library of the gate file: it is of the engine of the goal and of the learner-model its workspace named, both of which the report writes.

type GoalResult added in v0.1.44

type GoalResult struct {
	GoalEvaluation
	Cell GoalCellResult
	Fair []Check
	// Ends are the ends of the goal in each cell that sets it.
	Ends []GoalEnds
	// Holds are the conditions in their order — the area, fair, the gate to the bit —, and All
	// whether every one holds.
	Holds [3]bool
	All   bool
}

GoalResult is what the evaluation of the goal reads: E7 and E8 of the cell of the goal against its twin, the checks of fair under the goal, the ends of the goal by its result, each of the three conditions and whether all hold.

func EvaluateGoal added in v0.1.44

func EvaluateGoal(e GoalEvaluation) (*GoalResult, error)

EvaluateGoal reads the evaluation of the goal: a whole run under the engine on the working learners, with its invariants and no breach, goalCell with its twin, and the cells of fairness by the grade with and without the goal, each of at least a decisive run's learners.

func (*GoalResult) Write added in v0.1.44

func (r *GoalResult) Write(w io.Writer) error

Write writes the report of the evaluation of the goal in Markdown: the criterion, the run, the three conditions with their numbers and intervals, E7 and E8 of each side, the ends of the goal, the outcome, and the paragraph for the DPIA.

type Grade added in v0.1.18

type Grade struct {
	Cell, Reference      string
	Answers, Same, Band  measure.Value
	Learners             int
	SameHolds, BandHolds bool
}

Grade is one grade against the reference grade: its cell, the numbers of M11 with their 95 % intervals, and whether it holds the bounds.

type GroupScore added in v0.1.23

type GroupScore struct {
	Group string
	Score Score
}

GroupScore is the score of one group of a criterion.

type Input

type Input struct {
	// Judgement is the judgement's name, its folder judgements/<name>/: a confirmation runs only on
	// its own held-out set. A judgement with no confirmation may leave it empty.
	Judgement string
	Criterion string
	// Target is the target the judgement goes by, when its criterion wrote one down before its
	// first candidate: M11.same of the grades pooled for model-fair-1, which alone decides "better"
	// and the choice there.
	Target     string
	Base       *bench.File
	Candidates []Candidate
	Confirm    *Confirm
	// Pins are the libraries of the gate file, by module path: the base runs on them, and a
	// candidate of one library on the other of them.
	Pins map[string]Pin
}

Input is a judgement: its name, the criterion, the base's run, the candidates on the same learners, the confirmation when it has run, and the libraries the base is fixed at.

type Note added in v0.1.15

type Note struct {
	Cell string
	measure.Pair
}

Note is a number of the note of consolidation in a lesson, E6, on a cell where the base or the candidate consolidated: the base's value, the candidate's and their difference, base − candidate, with the interval from the same resamples. No check, path or weight reads it.

type Path

type Path struct {
	Cell    string  `json:"cell"`
	Number  string  `json:"number"`
	Read    bool    `json:"read"`
	Base    float64 `json:"base"`
	Ceiling float64 `json:"ceiling"`
}

Path is the path of a number on a cell, fixed: the value of the base and of the ceiling, both turned by the number's direction, so that the path is base − ceiling. Read tells that both were read; the ceiling is zero for a number whose path goes to perfection, the ceiling of the engine for the engine's numbers and the oracle of the base for the model's.

type Paths

type Paths struct {
	Libraries map[string]string `json:"libraries"`
	Set       seed.Set          `json:"set"`
	Learners  int               `json:"learners"`
	Base      string            `json:"base"`
	Ceiling   string            `json:"ceiling"`
	Paths     []Path            `json:"paths"`
}

Paths are the paths the criteria hold, read on the decisive run of the base before the first candidate, and fixed: the libraries, the set and the learners of the runs they were read on, the SHA-256 of the files of results of the base and of the ceiling of the engine, and the path of every number of the groups of the score on every cell of a published graph.

func ReadPaths

func ReadPaths(r io.Reader) (*Paths, error)

ReadPaths reads a file of paths.

func RecordPaths

func RecordPaths(base, ceiling *bench.File, baseDigest, ceilingDigest string) (*Paths, error)

RecordPaths reads the paths off the decisive runs of the base and of the ceiling of the engine, whose files of results have the SHA-256 given: on the working learners, the whole runs and not a part, on the pinned packages, with every population of the groups of the score, at least a decisive run's learners on every cell, on the same libraries and the same learners, the base with no breach of an invariant. A cell on a graph with no published package has no path.

func (*Paths) Table

func (p *Paths) Table() string

Table gives the rows of the table of the paths in Markdown, as docs/measurements.md records them: the cell, the number, the base, the ceiling and the path, to four decimals with a decimal point, as the documents in English write numbers; a path not read is a dash.

func (*Paths) Write

func (p *Paths) Write(w io.Writer) error

Write writes a file of paths: JSON indented by two spaces, a number in its shortest form that reads back to the same bits.

type Pin added in v0.1.8

type Pin struct {
	Commit, Version string
}

Pin is the point a library of the base is fixed at: the full SHA of its commit, and the tag of the release on it, empty while it is in none.

func (Pin) String added in v0.1.8

func (p Pin) String() string

String names the point as the gate names it.

type Report

type Report struct {
	Judgement string
	Criterion string
	Target    string // the target the judgement goes by, if any
	Decisive  bool
	Learners  int      // the fewest learners of a cell over the runs
	Graphs    []string // the graphs the choice is made on: those of published packages
	NoGraph   []string // the cells on a graph with no published package
	Verdicts  []Verdict
	Chosen    string   // the candidate chosen, if any; on a rough look, the one a decisive run would choose
	Equals    []string // the candidates equal to the best, the chosen among them
	Confirmed *Verdict // the chosen on its held-out learners, when the confirmation has run
	HeldOut   string   // the experiment of those held-out learners
	Outcome   string
}

Report is what a judgement gives.

func Judge

func Judge(in Input) (*Report, error)

Judge judges the candidates of an input. A rough look — fewer learners a cell than a decisive run takes — decides nothing, and its outcome says so first.

func (*Report) Write

func (r *Report) Write(w io.Writer) error

Write writes the report in Markdown: whether the run decides or is a rough look, the graphs of the choice and the cells of no graph, each candidate's score, group, the checks it fails and the note of consolidation in a lesson, the choice, and the confirmation.

type Rules added in v0.1.28

type Rules struct {
	Name, Date, Version   string
	Run, Base             *bench.File
	RunDigest, BaseDigest string
	Pins                  map[string]Pin
}

Rules is an evaluation of the three rules: its name, as its folder evaluations/<name>/, the run of the rules and the base's run with their SHA-256, the date, the version of sim that reads them and the libraries of the gate file, which the engine of the run is held to.

type RulesGrade added in v0.1.28

type RulesGrade struct {
	Cell        string
	Rules, Base []measure.Value
}

RulesGrade is M11 of one grade's cell under the rules and under the base.

type RulesResult added in v0.1.28

type RulesResult struct {
	Rules
	// Better is M11.same of grade 5 under the rules, BaseSame the same of the base's run.
	Better, BaseSame measure.Value
	// Grades are M11 of grades 1 and 5 under the rules and under the base, each number by name.
	Grades []RulesGrade
	// Fair are the checks of the constraint fair, the rules against the base.
	Fair []Check
	// Guard is M12.false of the reference's cell, of Learners learners.
	Guard    measure.Value
	Learners int
	// Correction is M11 of the cell of the correction against the same learners without it, each
	// number by name; Corrected is how many of its CorrectionLearners the adult corrected.
	Correction                    []measure.Pair
	Corrected, CorrectionLearners int
	// Holds are the four conditions in their order, and All whether every one holds.
	Holds [4]bool
	All   bool
}

RulesResult is what the evaluation of the three rules reads: each of the four conditions of the criterion, its numbers and whether it holds, and whether all hold.

func EvaluateRules added in v0.1.28

func EvaluateRules(r Rules) (*RulesResult, error)

EvaluateRules reads the evaluation of the three rules: the run of the rules — under the engine, on the working learners, a whole run on the pinned packages with its invariants and no breach, learner-model at RulesCandidate and the engine at the gate file's pin, the cells of population.Fairness and of population.Rules of at least a decisive run's learners each — against the base's run, the file paths.json names.

func (*RulesResult) Write added in v0.1.28

func (r *RulesResult) Write(w io.Writer) error

Write writes the report of the evaluation of the rules in Markdown: the criterion, the two runs, the four conditions with their numbers and intervals, the outcome, and the paragraph for the DPIA.

type Score

type Score struct {
	Value, Low, High float64
	Read             bool
	Resampled        []float64
	Left             []string // left the score: the path not read, or not above zero
	Small            []string // left the score: the path above zero but within the author's tolerance
}

Score is a score: its value, its 95 % interval, its values over the resamples, and the numbers that left it — a number with no fixed path: none recorded, none read, or one of zero or less.

type Target added in v0.1.23

type Target struct {
	Name   string
	Grades []TargetGrade
	Score  Score
	Groups []GroupScore
}

Target is a candidate's target against the base: each grade's numbers of M11 and Δ, the target's score, the mean of the grades' Δ with its 95 % interval, and the score of each group of the criterion, which stands beside its whole score as a reference and decides nothing.

type TargetGrade added in v0.1.23

type TargetGrade struct {
	Cell                 string
	Numbers              []measure.Pair
	Same, Band           measure.Pair
	Delta                measure.Value
	SameHolds, BandHolds bool
}

TargetGrade is one grade of the target: its cell; M11.answers, M11.same and M11.band as they are, in the order of measure.FairNumbers, A the base's and B the candidate's, each with its interval, and Diff, base − candidate; Δ, the candidate's M11.same less the base's; and whether the candidate holds the bounds of fairness on the grade, which the report writes for the confirmation and which decide nothing.

type Verdict

type Verdict struct {
	Candidate string
	Checks    []Check
	Holds     bool
	Score     Score
	Group     *Score // the score of the group it names, if it names one
	Other     *Score
	Target    *Target // the judgement's target, when it names one: it, not the score, decides "better"
	Better    bool
	Note      []Note
}

Verdict is how a candidate stands: its checks, whether it holds them all, its score, its group's, and in a pair the other library's score; whether it is better than the base; and the note of consolidation in a lesson, which decides nothing.

Jump to

Keyboard shortcuts

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