MultiOutputRegressor<T>
Models & Types · AiDotNet.Regression.MultiOutput
Wraps a single-output regression model into a MULTI-OUTPUT one: given an n×H target, it trains H independent “head” models (one per target column, the direct-multi-horizon strategy) and predicts an n×H matrix. This is the regression analogue of the multi-label classifier chain, and the substrate the shape-polymorphic facade routes to when the training target has more than one column (e.g. a multi-horizon forecast vector).
Implements: IFeatureAware, IFullModel<T, Matrix<T>, Matrix<T>>
How It Works
For Beginners: some models (linear/forest/boosting) only predict a single number. To forecast several horizons at once (1, 5, 10, 20 bars ahead), this trains one copy per horizon behind a single object, so the caller trains once with an n×H target and gets an n×H prediction back — no per-horizon plumbing. Deep sequence models that emit a horizon vector natively don’t need this; they output n×H directly.
Constructors
| Constructor | Summary |
|---|---|
MultiOutputRegressor(Func<IFullModel<T, Matrix<T>, Vector<T>>> baseFactory) |
Properties
| Property | Summary |
|---|---|
ILossFunction<T> DefaultLossFunction { get; } |
|
bool SupportsParameterInitialization { get; } |
|
int OutputCount { get; } |
Number of output columns (horizons) the last Train produced. |
long ParameterCount { get; } |
Methods
| Method | Summary |
|---|---|
Dictionary<string, T> GetFeatureImportance() |
|
IEnumerable<int> GetActiveFeatureIndices() |
|
IFullModel<T, Matrix<T>, Matrix<T>> Clone() |
|
IFullModel<T, Matrix<T>, Matrix<T>> DeepCopy() |
|
IFullModel<T, Matrix<T>, Matrix<T>> WithParameters(Vector<T> parameters) |
|
Matrix<T> Predict(Matrix<T> input) |
|
ModelMetadata<T> GetModelMetadata() |
|
Vector<T> GetParameters() |
|
Vector<T> SanitizeParameters(Vector<T> parameters) |
|
bool IsFeatureUsed(int featureIndex) |
|
byte[] Serialize() |
|
void Deserialize(byte[] data) |
|
void Dispose() |
|
void LoadModel(string filePath) |
|
void LoadState(Stream stream) |
|
void SaveModel(string filePath) |
|
void SaveState(Stream stream) |
|
void SetActiveFeatureIndices(IEnumerable<int> featureIndices) |
|
void SetParameters(Vector<T> parameters) |
|
void Train(Matrix<T> input, Matrix<T> expectedOutput) |