Skip to content

Trustworthiness metric - #521

Merged
andrewdalpino merged 14 commits into
3.3from
trustworthiness
Oct 16, 2026
Merged

andrewdalpino merged 14 commits into
3.3from
trustworthiness

Conversation

@andrewdalpino

@andrewdalpino andrewdalpino commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

The first metric for Embedders. Currently a standalone class - it does not implement the Metric interface or others. Delaying the API design until the future when we have more information at our disposal.

@andrewdalpino andrewdalpino changed the title Trustworthiness Trustworthiness metric Oct 13, 2026
@andrewdalpino
andrewdalpino requested a balanced review from Copilot October 13, 2026 22:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Odd-sized datasets reject valid neighbor counts, and the new metric lacks a common embedding-metric interface.

3 open findings
What changed in this PR

Adds Trustworthiness scoring for evaluating dimensionality-reduction embeddings.

Changes:

  • Implements and tests Trustworthiness scoring.
  • Adds usage documentation and navigation.
  • Adds benchmarking and changelog entries.
File Description
src/​CrossValidation/​Metrics/​Trustworthiness.php Implements the metric.
tests/​CrossValidation/​Metrics/​TrustworthinessTest.php Tests behavior and validation.
benchmarks/​CrossValidation/​Metrics/​TrustworthinessBench.php Benchmarks scoring.
docs/​cross-validation/​metrics/​trustworthiness.md Documents the metric.
docs/​cross-validation/​metrics/​api.md Documents embedding scoring.
mkdocs.yml Adds documentation navigation.
CHANGELOG.md Records the feature.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/CrossValidation/Metrics/Trustworthiness.php
Comment thread src/CrossValidation/Metrics/Trustworthiness.php Outdated
Comment thread tests/CrossValidation/Metrics/TrustworthinessTest.php Outdated
andrewdalpino and others added 2 commits October 13, 2026 19:17
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@andrewdalpino
andrewdalpino requested a review from a team October 14, 2026 17:59
Comment thread src/CrossValidation/Metrics/Trustworthiness.php Outdated
@andrewdalpino
andrewdalpino requested a review from apphp October 16, 2026 20:20
@andrewdalpino
andrewdalpino merged commit 4d30e71 into 3.3 Oct 16, 2026
6 checks passed
@andrewdalpino
andrewdalpino deleted the trustworthiness branch October 16, 2026 22:35
andrewdalpino added a commit that referenced this pull request Oct 20, 2026
* Ward clusterer (#520)

* Intial commit

* A little nicer

* A little nicer

* Remove AI slop

* A little nicer

* A little nicer

* Update distance calculation in Ward.php

Refactor distance calculation to use kernel method.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Initialize centroids and log training completion

Initialize centroids, sizes, and losses when maxMerges is 0. Log training completion if logger is available.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Remove AI slop

* Add max distance early stopping

* Add Squared Euclidean kernel

* Fix typo

* Clean up a bit

* Fix typo

* Fix typo

* Fix ordering

* Periodically rebuild min heap

* Appease stan

* A little nicer

* Fix coding style

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Update CHANGELOG

* OPTICS clusterer (#519)

* Bayesian Search (#509)

* Cosine Scheduler (#491)

* Ramp scheduler (#490)

* Initial commit

* Fix docs

* A little nicer

* Initial commit

* Add candidate selection from combinations

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fix calculation of spaceSize in BayesianSearch

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Change return type of base() to Estimator

Update return type of base() method and clarify hyper-parameter retrieval.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add Manhattan distance kernel for hyperparameter tuning

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* A little nicer

* K-medoids (#493)

* Initial commit

* A little nicer

* Clean up a bit

* Nicer

* A little nicer

* Nicer

* Assert kernel is symmetric

* Clean up a bit

* A little nicer

* Nicer

* Clean up a bit

* Remove comment

* Optimize PAM

* A little nicer

* Use set

* Nicer

* Stop if seed not in training set

* Fix typo

* Fix docs

* Fix tests

* Implement Iterative

* Nicer

* Fix test

* ARFF Extractor (#498)

* Intial commit

* A little nicer

* Even nicer

* Check balanced buffer after stripping comments

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Validate integer values using filter_var

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Throw exception for unterminated quoted strings

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Modify categoricalPlaceholder type in ARFF documentation

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Convert to static members

* Fix escaped apostrophe

* Remove AI slop

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Shuffler extractor (#499)

* Intial commit

* Validate buffer size in Shuffler constructor

Added validation for buffer size in constructor.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Update CHANGELOG

* Ensure array keys are reindexed after uniqueness

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Remove defunct interface

* Appease stan

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Power transformer (#505)

* Cosine Scheduler (#491)

* Ramp scheduler (#490)

* Initial commit

* Fix docs

* A little nicer

* Initial commit

* Refactor yeoJohnson function for better performance

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* A little nicer

* Optimize

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Word stemmer (#514)

* Cosine Scheduler (#491)

* Ramp scheduler (#490)

* Initial commit

* Fix docs

* A little nicer

* K-medoids (#493)

* Initial commit

* A little nicer

* Clean up a bit

* Nicer

* A little nicer

* Nicer

* Assert kernel is symmetric

* Clean up a bit

* A little nicer

* Nicer

* Clean up a bit

* Remove comment

* Optimize PAM

* A little nicer

* Use set

* Nicer

* Stop if seed not in training set

* Fix typo

* Fix docs

* Fix tests

* Implement Iterative

* Nicer

* Fix test

* ARFF Extractor (#498)

* Intial commit

* A little nicer

* Even nicer

* Check balanced buffer after stripping comments

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Validate integer values using filter_var

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Throw exception for unterminated quoted strings

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Modify categoricalPlaceholder type in ARFF documentation

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Convert to static members

* Fix escaped apostrophe

* Remove AI slop

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Shuffler extractor (#499)

* Intial commit

* Validate buffer size in Shuffler constructor

Added validation for buffer size in constructor.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Update CHANGELOG

* Intial commit

* Save game

* Save game

* Clean up a bit

* Rename language to stemmer

* Preserve punctuation

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Consistency with Grid Search

* Add setup method

* Better logging

* Add trial number to logs

* Change order of arguments

* Rename parameters

* Better sampling

* Make smoothing configurable

* Optimize power transformer

* Avoid stating the obvious

* A little nicer

* Initial commit

* Better naming

* Better benchmark

* Optimize

* Fix tests

* Make transients null by default

* A little nicer

* Remove progress()

* Use radius instead of coreDistance in range method

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Revert "Use radius instead of coreDistance in range method"

This reverts commit 10168cb.

* Fix

* Fair comparison

* Optimize

* Remove transient properties from class definition

* Fix OPTICS distance-label misalignment in range processing

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Trustworthiness metric (#521)

* Intial commit

* Remove AI slop

* Nicer docs

* Edit CHANGELOG

* Fix neighbor count condition in Trustworthiness.php

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Rename test method for clarity

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Clean up AI slop

* Save game

* Clean up a bit

* Clean up a bit

* Quadratic to linear memory scaling

* A little nicer

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* ROCAUC and Average Precision Metrics (#522)

* Initial commit

* Add average precision metric

* Simplify condition for returning zero in AveragePrecision

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Clarify the docs

* Align edge cases

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Update CHANGELOG

* Add trustworthiness test

* Add more trustworthiness tests

* Update CHANGELOG

* Softmax Ranks Features (#523)

* Initial commit

* Add test

* Add interface to docs

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants