DeepPortfolioManager<T>
Models & Types · AiDotNet.Finance.Portfolio
Deep Portfolio Manager for end-to-end portfolio weight optimization.
Inheritance: NeuralNetworkBase<T> → FinancialModelBase<T> → PortfolioOptimizerBase<T> → DeepPortfolioManager<T>
For Beginners
Managing a portfolio means deciding exactly what percentage of your money should go into each stock (e.g., 10% Apple, 5% Microsoft). While traditional methods use complex math formulas, this AI model looks at historical performance and current trends to “guess” the best weights that will give you the most profit with the least risk.
How It Works
DeepPortfolioManager uses deep learning to directly map market input data to optimal portfolio weights, typically maximizing a risk-adjusted return metric.
Reference: Zhang et al., “Deep Learning for Portfolio Management”, 2020.
Example
// Create a Deep Portfolio Manager for end-to-end weight optimization
var architecture = new NeuralNetworkArchitecture<double>(
inputType: InputType.OneDimensional,
taskType: NeuralNetworkTaskType.Regression,
inputHeight: 60, inputWidth: 10, inputDepth: 1, outputSize: 10);
var model = new DeepPortfolioManager<double>(architecture);
// Or load a pre-trained ONNX model for portfolio weight prediction
var onnxModel = new DeepPortfolioManager<double>(architecture, "deepportfolio.onnx");
Constructors
| Constructor | Summary |
|---|---|
DeepPortfolioManager(NeuralNetworkArchitecture<T> architecture, DeepPortfolioManagerOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) |
Creates a DeepPortfolioManager in native mode for training. |
DeepPortfolioManager(NeuralNetworkArchitecture<T> architecture, string onnxModelPath, DeepPortfolioManagerOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer) |
Creates a DeepPortfolioManager in native mode for training. |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
Executes GetModelMetadata for the DeepPortfolioManager. |
Vector<T> OptimizePortfolio(Tensor<T> marketData) |