FCA at Scale
This example sends unlabelled UCI Mushroom or Zoo observations to the native engine. The engine performs conceptual scaling, streams formal concepts, computes the Duquenne–Guigues implication basis, and replays the exported incidence, concepts and basis. The browser parses source rows and displays evidence.
Run the example
Section titled “Run the example”Use the original agaricus-lepiota.data from
UCI Mushroom, or zoo.data
from UCI Zoo. Both datasets are
distributed under CC BY 4.0; retain their UCI attribution when redistributing
them. The workbench checks the pinned file hash before ingestion.
Connect through your authenticated engine gateway. A local development engine
can use the docs proxy configured by FCA_E2E_BACKEND_URL. The bearer token
stays in this page’s memory. A fresh tenant keeps the example isolated.
Ready
- Objects
- —
- Scaled attributes
- —
- Streamed concepts
- —
- Basis implications
- —
| Phase | Milliseconds |
|---|
Read the verified basis
All implications below use native scaled labels. An empty premise means every observed object has the conclusion.
No publication yet
| Derived term | Features (including licence) |
|---|
Freeze the interpretation
Section titled “Freeze the interpretation”Mushroom contributes 8,124 rows and 22 nominal features. Its first column,
edible/poisonous, is removed before ingestion. A missing ? contributes no
feature: absence is open world. Native nominal scaling produces 116 attributes.
Zoo contributes 101 rows. Its animal name and final class column are removed.
True Boolean features are present; false flags are absent. The number of legs
uses a nominal scale, so legs=4 is an attribute distinct from legs=2.
const semantics = { kind: 'scaled', schemes: { legs: { kind: 'nominal' } },} satisfies Analysis.DiscoverySemantics;
for await (const event of client.analysis.streamConcepts({ sortNames: [sortName], semantics,})) { if (event.type === 'concept') consume(event); if (event.type === 'end' && !event.complete) { // Preserve the continuation; this is not an exhausted lattice. saveContinuation(event.continuation); }}The page counts concepts as they arrive without retaining every extent. The complete open-world Mushroom oracle is 226,921 concepts and 1,966 implications. Zoo’s unlabelled basis has 119 implications. These are verification targets, not stopping conditions. The stream must end with native completeness.
The historical labelled controls are separate: Mushroom with its class column has 118 attributes, 237,919 concepts and 2,256 implications; Zoo with its class column has 141 implications. The workbench excludes both class columns.
Read and verify the basis
Section titled “Read and verify the basis”A concept’s extent lists the observations sharing its closed intent. An
implication says that every object in this observed population satisfying its
premise also satisfies its conclusion. A native label such as odor=f denotes
a value of the source’s odor feature; it does not denote a hidden class.
The expandable basis above displays the engine’s actual attribute labels.
const exported = await client.analysis.exportFca({ termIds, semantics, includeBasis: true, minExtentSize: 82,});const verified = await client.analysis.verifyFcaExport(exported);if (!verified.conceptsComplete || !verified.basisComplete) { throw new Error('The native verification is incomplete.');}The Mushroom export keeps concepts with at least 82 objects (ceil of 1% of 8,124). This is an export filter, not a limit on enumeration or on the implication basis. Zoo exports every concept. Verification also checks the tenant-scoped source identities and returned counts; a successful HTTP response alone is insufficient evidence. This verifier checks the self-contained export. It does not reread the current stored terms or attest that their observations have stayed unchanged since export.
Factor the context
Section titled “Factor the context”A factor stream covers the same formal context with formal concepts instead of
enumerating all of them: their union reproduces every positive incidence (a
Boolean factorization). Each factor event is a concept that the engine closed
and verified natively. Its newlyCovered and uncovered counts are exact. The
engine selects factors greedily (GreConD). The stream makes no claim that no
smaller set of factors covers the context.
let continuation: Analysis.FcaFactorContinuation | null = null;do { for await (const event of client.analysis.streamFactors({ sortNames: [sortName], semantics, pageSize: 100, continuation, })) { if (event.type === 'factor') consume(event.intentAttributes, event.uncovered); if (event.type === 'end') { if (event.error !== null) throw new Error(event.error); continuation = event.continuation; } }} while (continuation !== null);Only an end with complete: true means full coverage. A positive
maximumUncovered stops early; targetReached: true with complete: false
means only that partial target was met, and the end still carries a
continuation. The continuation is opaque: on resume the engine rederives the
delivered prefix and refuses one it cannot reproduce (422, body.code
fca_factor_continuation_refused).
client.analysis.registerFactor({ sortNames, semantics, intent, name })
registers one factor as a Proposed sort. intent takes the factor’s
intentAttributes. The engine rereads the population, requires the intent to
be closed, and registers the sort only if its definition selects exactly the
factor’s extent. Otherwise it registers nothing: 400 for an invalid intent or
name, 422 (fca_factor_registration_refused) when the realization check
fails or the name is taken.
client.analysis.streamFuzzyFactors({ source, maximumUncovered }) streams
graded factors of a numeric source, which is the same declared source the other
fuzzy streams take. Paging uses source.pageSize and source.continuation. A
graded factor never exceeds an incidence degree. Its counts concern positive
cells that are reproduced exactly. degreeResidual is a diagnostic, not the
selection objective. The end event’s component is factors with the native
report, or failure after a native fault.
Guide the delivery order and estimate stability
Section titled “Guide the delivery order and estimate stability”guidance on streamConcepts lets the engine’s native UCB1 bandit choose which
top-level branch of the traversal is walked next, quantum steps at a time.
Guidance changes only the delivery order: every branch is still walked to its
end, so the concepts, the counters and complete are those of the unguided
stream. A guided stream’s end event carries guidance; an unguided one does
not.
for await (const event of client.analysis.streamConcepts({ sortNames: [sortName], semantics, guidance: { quantum: 64, prior: 'scorer' },})) { if (event.type === 'end' && event.guidance !== undefined) { // 'scorer' only when the scorer ranked every branch; otherwise // 'scorer_abstained' or 'no_scorer', and attribute order was used. console.log(event.guidance.prior, event.guidance.order); }}exploration (default √2) must be finite and non-negative, and quantum
positive, else 400. Guidance applies to a fresh stream: sent with a
continuation it is a 400, because a resumed page continues in native order.
A branch’s meanReward is the bandit’s reward, never evidence about a concept.
client.analysis.estimateConceptStability({ sortNames, semantics, intents, kind, samples | epsilon, delta, seed }) estimates the intensional or extensional
stability of named concepts by Monte Carlo sampling. Each intent (attribute
labels, as in intentAttributes) must be closed in the freshly read context,
else 422 (fca_stability_not_a_concept). Give exactly one of samples and
epsilon; for epsilon the engine derives the Hoeffding sample count at
delta (738 for epsilon: 0.05, delta: 0.05). The same seed reproduces the
estimates. Each estimate carries its trials, successes and per-concept interval
at delta. These are estimates, not acceptance evidence, and the intervals
give no simultaneous guarantee over the requested concepts, in particular
not for concepts selected by their estimates.
Profile interval classes and decide new records
Section titled “Profile interval classes and decide new records”client.analysis.intervalClasses describes a declared class of records by
ranges over numeric features, and decides other records against those
descriptions. Records are grouped by the exact values of groupBy; in each
group the profile is the interval class of the members’ hull (the records whose
memberFeature equals memberValue). Each declared policy chooses one
description of that class: threshold places a bounded side
(closed_pattern, strict at the excluded coordinate, midpoint of the gap,
or the most readable number in it), and order compares candidate
descriptions lexicographically.
const { groups, evaluated } = await client.analysis.intervalClasses({ sortNames: ['molecule'], features: ['mw', 'nat', 'nc'], groupBy: ['kind'], memberFeature: 'odour', memberValue: { type: 'String', value: 'pear' }, policies: [ { threshold: 'closed_pattern' }, { threshold: 'strict', order: ['restrictions'] }, { threshold: 'midpoint', order: ['restrictions', 'margin'] }, { threshold: 'readable', order: ['restrictions', 'digits'] }, ], enumerationLimitSeconds: 60, evaluateSortNames: ['candidate'],});for (const outcome of groups[0]?.outcomes ?? []) { if (outcome.status === 'chosen') console.log(outcome.description, outcome.margin);}console.log(evaluated?.[0]?.decisions);On the SDA 2026 slide molecules (three pear and three strawberry records), the
engine finds four minimal generators. The closed pattern bounds MW to
[128.24, 142.22], the strict generator to MW < 150.19 (unbounded below), and
the readable one to MW <= 150. A new molecule (MW 140, nAT 30, nC 10) is
["does_not_fit", "fits", "fits", "fits"]: only the closed pattern rejects it.
Every side is explicit: { kind: 'unbounded' }, or closed/open with its
value. margin is null when a description bounds no side. A group whose
generator enumeration reaches enumerationLimitSeconds has generators: null
and is undecided under the policies that need generators. A group without
members is profiled too: its extent is empty, so closedPattern is null, its
checked maximal empty boxes are in emptyGenerators, every policy is
not_applicable_empty_extent, and its records are no_representative. A record
whose categorical values match no group is no_profile. A record lacking a declared feature is a 422
(interval_class_incomplete_records), and so is a record whose group value is
not a string, integer, real or boolean. memberValue and each group key value
are typed like term features and compared exactly: { type: 'Integer', value: 3 }
does not select records stored with { type: 'Real', value: 3 }. A description summarizes the declared members: fits means the record
lies in it, not that the record belongs to the class.
Real case: intrusion detection on NSL-KDD
Section titled “Real case: intrusion detection on NSL-KDD”The same call profiles real network traffic. On NSL-KDD (Tavallaee et al.,
CISDA 2009; 125 973 training and 22 544 test sessions, 41 features), each
(protocol_type, service, flag) triple is a group. The other 38 features form
the point, and a group’s normal training sessions are its members. The
training sessions are written with a boolean normal, and the test sessions
carry no label at all: the engine never sees an attack name. One request fits
every group’s profile and decides both splits:
const { groups, evaluated } = await client.analysis.intervalClasses( { sortNames: ['nsl_kdd_train_session'], features: POINT_FEATURES, // duration, src_bytes, …, dst_host_srv_rerror_rate (38) groupBy: ['protocol_type', 'service', 'flag'], memberFeature: 'normal', memberValue: { type: 'Boolean', value: true }, policies: ['closed_pattern', 'strict', 'midpoint', 'readable'].map((threshold) => ({ threshold, order: ['restrictions', 'digits'], })), enumerationLimitSeconds: 600, evaluateSortNames: ['nsl_kdd_train_session', 'nsl_kdd_test_session'], }, { timeoutMs: 0 }, // the whole fit runs before the answer; 0: no client deadline);Measured on 2026-10-24 against a release engine, with labels kept on the client and the engine’s decisions tallied there (test split):
| Representative | Attacks detected | False alarms on normal traffic | Attacks undecided |
|---|---|---|---|
| closed pattern | 85.5 % | 10.1 % | 0 |
minimal generator (strict) |
46.3 % | 3.6 % | 2 765 |
| midpoint | 50.2 % | 8.7 % | 2 765 |
| readable | 50.0 % | 8.7 % | 2 765 |
88 groups have a normal profile. Generator enumeration completed for 85; the
other three stopped at the 600 s limit, and their sessions are undecided
under the three generator-based policies. Undecided sessions count as not
detected in this table. The closed pattern catches more attacks and raises
more false alarms, and the minimal generator is the reverse: choosing the
representative is a precision/recall decision, and the policy makes it
explicit.
Ingestion took 106 s and the fit with all 148 517 decisions took 2 043 s, on
a shared workstation at load 25–63. These are measurements, not performance
claims. Every count equals the engine’s native run of the same frozen
protocol: same groups, same stopped enumerations, zero differences. The
protocol, results and comparison are in the engine repository under
docs/plans/evidence/fca-scale-2026-10-18/d2-ids-sdk/, and the runner is
scripts/fca-d2-ids-run.ts in this repository.
Two practical points come from this run. On Node, fetch stops waiting for
response headers after 300 s whatever timeoutMs is, and this route answers
only when the fit is done. The runner therefore installs an undici Agent
with headersTimeout: 0 for its process. This is one fixed, simple model, not
a competitive intrusion detector.
Publish observations as licensed rules
Section titled “Publish observations as licensed rules”The checkbox authorizes confirmation of every native question only for this
frozen observed population. The page starts a scaled exploration with the
same sort and interpretation, confirms pending questions using their actual
question identifiers, and resumes suspended searches. It calls
completeExploration only when search.stop is exhausted.
Publication returns a native licence record, population record and installed rules. Forward chaining executes those rules. The table displays the derived facts that reference this publication’s licence, together with native fixpoint and residual-obligation status. These obligations do not establish biological laws or assign the hidden edible/poisonous or animal-class labels.
For individual expert confirmation, refutation and counterexamples, use the attribute exploration workbench.
Measurement scope
Section titled “Measurement scope”The live table reports four wall-clock phases: ingestion, streaming, export including basis computation, and native verification. These include HTTP, serialization and SDK work. The export route currently combines basis and export computation, so its duration is not a pure kernel benchmark.
An interrupted request remains incomplete. The page’s one-hour transport deadline does not change native search coverage. Completion is accepted only from the engine’s evidence, with every supplied source retained.
Frozen blind results
Section titled “Frozen blind results”The generation protocol d1-blind-crisp-v1 removed the class columns before
native ingestion. Both candidate seals were committed and pushed at engine
revision e817597fca654acd47d87a2cc71e7ce8b9c647d7 before evaluation.
Independent C implementations reproduce every concept intent and extent size,
every retained extent’s row identities, and the full implication bases.
| Result | Zoo | Mushroom |
|---|---|---|
| Streamed concepts | 357 | 226,921 |
| Concepts evaluated | 357 | 43,056 |
| Pure nonempty concepts | 118 | 13,694 |
| Impure concepts | 238 | 29,362 |
| Empty extents | 1 | 0 |
| Tied majority labels | 32 | 482 |
| Sort recommendations | 216 | 16,265 |
Zoo’s complete lattice contains exact concepts for five of its seven classes. Classes 3 and 7 have no exact concept; their best Jaccard scores are 0.5 and 0.2222. Among the recommendations, three exactly match a class, 17 have Jaccard at least 0.8 but less than 1, and 196 fall below 0.8. Of these recommendations, 145 cross class boundaries.
Mushroom evaluates only concepts with at least 82 observations. Its retained concepts include 9,404 pure edible and 4,290 pure poisonous extents. Of 16,265 recommendations, 4,059 are pure and 12,206 are impure. Every recommendation matched a retained sealed intent; none was silently discarded. The complete inventories retain all ties, lower-purity concepts and evaluated proposals.
For example, the largest pure edible extent has 2,688 observations and intent
gill-size=b, odor=n, ring-number=o, veil-type=p. The largest pure
poisonous extent has 2,228 observations and intent bruises=f, gill-spacing=c,
stalk-surface-above-ring=k, veil-color=w, veil-type=p. These relationships
to hidden labels were measured after sealing. They are descriptive results on
this dataset, not rules for deciding whether a mushroom is safe to eat.
The Zoo analyst had seen its public class-to-animal mapping during a source attribution lookup. The frozen generation program excluded that mapping and was not retuned, but this is not a claim of complete analyst blinding. The original preregistration also quoted the labelled Mushroom attribute count in its prose. Its prescribed unlabelled encoding was executed unchanged; the independent comparison establishes the 116-attribute result above.
The engine repository’s
docs/plans/evidence/fca-scale-2026-10-18/d1-blind/README.md contains every
class result, the five largest pure Mushroom concepts per class, applicable
basis implications, full inventories, seals and execution provenance. These
observed-population comparisons do not measure held-out prediction accuracy.