discopt.decomposition.learning.features

discopt.decomposition.learning.features#

Feature extraction and instance fingerprinting for learning.

Turns a StructureReport into the scalar InstanceFeatures the learners consume, and computes a stable fingerprint so re-solves of the same instance group together in the store.

Functions#

extract_features(...)

Build InstanceFeatures from a structure report (no extra passes).

fingerprint(→ str)

Stable structural fingerprint of an instance.

Module Contents#

discopt.decomposition.learning.features.extract_features(report: discopt.decomposition.advisor.analyzer.StructureReport) → discopt.decomposition.learning.record.InstanceFeatures#

Build InstanceFeatures from a structure report (no extra passes).

discopt.decomposition.learning.features.fingerprint(report: discopt.decomposition.advisor.analyzer.StructureReport) → str#

Stable structural fingerprint of an instance.

Hashes the structural summary (sizes, integer fraction, coupling density, block counts, nonlinearity) rounded to avoid float jitter. Two instances with the same structure share a fingerprint even if variable names differ, so re-solves and near-duplicates group together.