Skip to main content

ModelConfigPanel

ModelConfigPanel

#include <ModelConfigPanel.hpp>

Inherits from QWidget

Public Signals

Name
void trainRequested()
Emitted when the user clicks the Train button.
void modelChanged(QString const & name)
Emitted when the selected model changes.
void parametersChanged()
Emitted when any parameter value changes.
void balancingChanged()
Emitted when balancing settings change.

Public Functions

Name
ModelConfigPanel(std::shared_ptr< MLCoreWidgetState > state, std::shared_ptr< DataManager > data_manager, QWidget * parent =[nullptr])
Construct the model configuration panel.
~ModelConfigPanel() override
std::string selectedModelName() const
Get the currently selected model name.
std::unique_ptr< MLCore::MLModelParametersBase > currentParameters() const
Create a parameter object matching the current UI settings.
bool isBalancingEnabled() const
Whether class balancing is enabled.
MLCore::BalancingStrategy balancingStrategy() const
Get the selected balancing strategy.
double balancingMaxRatio() const
Get the balancing max ratio.
bool hasValidConfiguration() const
Whether a valid model configuration is ready for training.

Public Signals Documentation

signal trainRequested

void trainRequested()

Emitted when the user clicks the Train button.

The parent widget should connect this to trigger ClassificationPipeline or ClusteringPipeline execution.

signal modelChanged

void modelChanged(
    QString const & name
)

Emitted when the selected model changes.

Parameters:

  • name The new model name from the registry

signal parametersChanged

void parametersChanged()

Emitted when any parameter value changes.

signal balancingChanged

void balancingChanged()

Emitted when balancing settings change.

Public Functions Documentation

function ModelConfigPanel

explicit ModelConfigPanel(
    std::shared_ptr< MLCoreWidgetState > state,
    std::shared_ptr< DataManager > data_manager,
    QWidget * parent =nullptr
)

Construct the model configuration panel.

Parameters:

  • state Shared MLCoreWidgetState for reading/writing model settings
  • data_manager Shared DataManager (reserved for future use)
  • parent Optional parent widget

function ~ModelConfigPanel

~ModelConfigPanel() override

function selectedModelName

std::string selectedModelName() const

Get the currently selected model name.

Return: The MLModelRegistry name (e.g. “Random Forest”), or empty if none

function currentParameters

std::unique_ptr< MLCore::MLModelParametersBase > currentParameters() const

Create a parameter object matching the current UI settings.

Return: Owned parameter object, or nullptr if no model is selected

Returns a concrete MLModelParametersBase subclass populated from the spin boxes on the currently visible parameter page.

function isBalancingEnabled

bool isBalancingEnabled() const

Whether class balancing is enabled.

function balancingStrategy

MLCore::BalancingStrategy balancingStrategy() const

Get the selected balancing strategy.

function balancingMaxRatio

double balancingMaxRatio() const

Get the balancing max ratio.

function hasValidConfiguration

bool hasValidConfiguration() const

Whether a valid model configuration is ready for training.

True when an algorithm is selected and the parameter page is populated.


Updated on 2026-11-13 at 20:25:40 +0000