Incremental Classification ECOC Predict — Machine Learning/Incremental Learning
Machine_Learning/Incremental_Learning/Incremental_Classification_ECOC_Predict · 2 input / 3 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++
Description#
The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.
Incremental Classification ECOC Predict
Machine Learning / Incremental Learning
Predicts the class of each row of x from the model bus an Incremental Classification ECOC Fit block writes, as Simulink's IncrementalClassificationECOC Predict block decodes it. Each of the L binary learners scores the row, f = ((x − Mu) ./ Sigma)·Beta + Bias (0 for a learner that has not yet seen both its classes); each class k adds up its loss along row k of the coding matrix, left to right, and scores −(sum / d) / 2; the label is the class of the largest score.
Ports
- mdl (
bus) – the model, from an Incremental Classification ECOC Fit block with the same Class Names and Coding. - x – the n observations to classify, [n,P].
- label – the predicted class of each row, [n,1]: the first class of the largest score. When no learner can predict yet it is the model's MajorityClass index (not the class name), as Simulink's block answers; NaN when every score is NaN.
- score – the K class scores of each row, [n,K].
- pbscore – the L binary learners' scores of each row, [n,L].
Parameters
- Class Names – the K labels, [1 2 3] by default: the Fit block's.
- Coding – onevsone (the default), onevsall or custom: the Fit block's, since the coding matrix is not on the bus.
- Coding Matrix – the K-by-L matrix read when Coding is custom.
- Binary Loss – the loss of a binary score s against a coding
entry m:
- hinge (the default) – max(0, 1 − m·s);
- linear – 1 − m·s;
- exponential – exp(−m·s);
- binodeviance – log(1 + exp(−2m·s)) / log 2;
- logit – log(1 + exp(−m·s)) / log 2;
- hamming – 1 − sign(m·s).
- Decoding – lossweighted (the default): d is the number of learners that use the class, and with the hinge and linear losses a learner that ignores the class (m = 0) counts 1 less; lossbased: d is L.
- Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.
When a run is refused
Class Names that are not two or more different numbers, a coding matrix that is not K-by-L of −1, 0 and +1 with a +1 and a −1 in every column, a bus that is not the shape these say for x's P, and a loss or decoding that is not one of the above.
Code export
Six targets: Python, MATLAB, Java, Rust, C and C++, reading the bus and decoding in the live block's arithmetic order. The hardware targets (VHDL, Verilog, SystemVerilog) and PLC Structured Text carry no bus, so an export to one stops and names the block.
Simulink bridge
None. Simulink's block takes its learner as InitialLearner, the name of an incrementalClassificationECOC object in the MATLAB workspace, rather than as dialog parameters, so there is nothing in its dialog to map these configs onto or read them back from.
Notes
- Algebraic in x: the model is whatever the bus carries this step, and the bus at a step has already learnt that step's rows.
- Ties go to the earlier class, as the left-to-right sums decide them in Simulink's block; one-vs-all rows with equal binary scores tie exactly.
- Both of Simulink's optional outputs (score and pbscore) are always shown.
- Verified against R2026a: every svm loss under both decodings matched Simulink's Predict block bit for bit, and the incremental_ecoc suite pins this block against those runs.
Code facts#
| Fact | Value |
|---|---|
| registered type | Machine_Learning/Incremental_Learning/Incremental_Classification_ECOC_Predict |
| family | Machine_Learning/Incremental_Learning |
| solver environment class | ICoreBlock_0_Machine_Learning_1_Incremental_Learning_2_Incremental_Classification_ECOC_Predict |
| source | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Machine_Learning/Incremental_Learning/Incremental_Classification_ECOC_Predict/ICoreBlock_0_Machine_Learning_1_Incremental_Learning_2_Incremental_Classification_ECOC_Predict.cpp |
| header | src/ICoreBlocks/ICoreBlockLibrary/Blocks/Machine_Learning/Incremental_Learning/Incremental_Classification_ECOC_Predict/ICoreBlock_0_Machine_Learning_1_Incremental_Learning_2_Incremental_Classification_ECOC_Predict.h |
| default size on canvas | 170 × 90 px |
| ports at insert | 2 in, 3 out |
| code generators implemented | Python, MATLAB, Java, Rust, C, C++ |
Ports#
| # | Direction | Signal type | Description label |
|---|---|---|---|
| 1 | in | ICoreBus | mdl |
| 2 | in | ICoreDouble | x |
| 3 | out | ICoreDouble | label |
| 4 | out | ICoreDouble | score |
| 5 | out | ICoreDouble | pbscore |
Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.
Configuration variables#
| Config variable | Default | Simulink parameter |
|---|---|---|
Class Names | [1 2 3] | — |
Coding | onevsone%~%onevsall%~%custom~~onevsone | — |
Coding Matrix | [1 1 0; -1 0 1; 0 -1 -1] | — |
Binary Loss | hinge%~%hamming%~%linear%~%logit%~%exponential%~%binodevi… | — |
Decoding | lossweighted%~%lossbased~~lossweighted | — |
Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.
Simulink bridge#
| support | Support::None |
| Simulink path | statsIncremental/Classification/ECOC/IncrementalClassificationECOC Predict |
| port-count rule | PortsParam::None |
SampleTime parameter | yes |
Caveat (shown to the user): no bridge: Simulink's IncrementalClassificationECOC Predict block takes its learner as InitialLearner, the NAME of an incrementalClassificationECOC object in the MATLAB workspace, not as dialog parameters -- there is nothing in its dialog to map the learner configs onto, or read them back from
Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h
Description vs code#
The checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:
B0every stimulus in the sample errored — cross-checks skipped
The verdict above is
tools/docs/check_block_descriptions.py(P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.
File banner (developer view)#
The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).
IncrementalClassificationECOC Predict -- the class an ECOC model predicts, and its scores statsIncremental/Classification/ECOC/IncrementalClassificationECOC Predict, MEASURED on R2026a 2026-10-03 (BLOCKS_TO_ADD_TOOLBOXES.md statsIncremental, on FEATURES_TO_ADD.md BF1). It reads the bus an IncrementalClassificationECOC Fit block writes; the class names and the coding matrix are not on that bus (Simulink's Predict re-derives them from its own InitialLearner), so they are configs here and must match the Fit block's. Binary Loss and Decoding are the Simulink block's own mask parameters (its mask's, not the object's: measured).
For each row: the L binary scores f = (x - Mu) ./ Sigma . Beta + Bias (0*f for a learner that has not seen both its classes), each class's loss summed left to right along its coding row, score = -(sum / d) / 2, and the label the first class of the largest score -- or the MajorityClass INDEX when no learner can predict. Every svm loss and both decodings matched the Simulink block bit for bit (ICoreIncrementalEcocSupport).
Sample results#
No stimulus produced a sampled output in this rig — Incorrect bus shape reaching port: ICore Blocks/Home/Incremental Classification ECOC Predict/ICoreBus-In-0 requires { AllBeta: ICoreDouble [1x3], AllBias: ICoreDouble [3x1], AllMu: ICoreDouble [1x3], AllSigma: ICoreDouble [1x3], AllMajorityClass: ICoreUInt8 [3x1], AllCanPredict: ICoreBool [3x1], IsWarm: ICoreBool [1x1], MajorityClass: ICoreUInt16 [1x1], SeenBothClasses: ICoreBool [3x1] }, ICore Blocks/Home/Bus Creator/ICoreBus-Out-0 carries { a: ICoreDouble [1x1], b: ICoreDouble [1x1] }. That is a fact about the single-block rig, not a verdict on the block: an offline batch fit, a block whose output only appears at onSolverFinish, or one that needs a driven environment cannot be exercised alone.
Category unsampled · sample time 0.1 · 60 steps · commit 6e08e972e · produced by docsSample --out <folder> --blocks Incremental_Classification_ECOC_Fit Incremental_Classification_ECOC_Predict --steps 60
Sample data: docs/generated/samples/Machine_Learning__Incremental_Learning__Incremental_Classification_ECOC_Predict.json