From 73daa4efd089e8d9be64c975e603ed16de4fe35c Mon Sep 17 00:00:00 2001 From: Swargam-Udayasri Date: Sat, 3 Jan 2026 21:36:53 +0530 Subject: [PATCH] feat(ui): add training parameters for GaussianNB model --- ArtificialIntelligence.qml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/ArtificialIntelligence.qml b/ArtificialIntelligence.qml index 65487ecf..cb66a1ab 100644 --- a/ArtificialIntelligence.qml +++ b/ArtificialIntelligence.qml @@ -44,6 +44,8 @@ Rectangle { property int rfMinSamplesLeaf: 1 property string rfMaxFeatures: "auto" // auto|sqrt|log2 property string rfCriterion: "gini" // gini|entropy + // GaussianNB params (UI state only for now) + property real gnbVarSmoothing: 1e-9 // Derived property bool paramsEnabled: mode === "Train" @@ -146,7 +148,7 @@ Rectangle { Math.min(root.height * 0.08, 90)) radius: 8 color: "#2d7a4a" - border.color: currentModel === "GaussianNB" ? "#439566" : "#2d7a4a" + border.color: currentModel === "GaussianNB" ? "yellow" : "#2d7a4a" border.width: currentModel === "GaussianNB" ? 3 : 1 Text { @@ -993,7 +995,36 @@ Rectangle { } } } + // GAUSSIAN NB PARAMS ---------------------------------- + ColumnLayout { + visible: currentModel === "GaussianNB" + spacing: 6 + Layout.fillWidth: true + + RowLayout { + Layout.fillWidth: true + spacing: 4 + Text { + text: "var_smoothing:" + color: "white" + Layout.preferredWidth: 120 + font.pixelSize: Math.max(10, + Math.min(16, root.height * 0.02)) + } + + TextField { + text: gnbVarSmoothing.toString() + onEditingFinished: { + var v = parseFloat(text) + if (!isNaN(v) && v > 0) + gnbVarSmoothing = v + text = gnbVarSmoothing.toString() + } + Layout.fillWidth: true + } + } + } Item { Layout.fillHeight: true } // spacer } }