diff --git a/statapp/__main__.py b/statapp/__main__.py
index 85a118a..8d2a007 100644
--- a/statapp/__main__.py
+++ b/statapp/__main__.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/about_window.py b/statapp/about_window.py
index 1b5d14c..030d9d0 100644
--- a/statapp/about_window.py
+++ b/statapp/about_window.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/calculations.py b/statapp/calculations.py
index 001cf3b..5c646ef 100644
--- a/statapp/calculations.py
+++ b/statapp/calculations.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/combo_delegate.py b/statapp/combo_delegate.py
index aa7b05e..7af2f81 100644
--- a/statapp/combo_delegate.py
+++ b/statapp/combo_delegate.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/constants.py b/statapp/constants.py
index 2903c42..773bb68 100644
--- a/statapp/constants.py
+++ b/statapp/constants.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/correlation_analysis.py b/statapp/correlation_analysis.py
index a266a3f..02f4713 100644
--- a/statapp/correlation_analysis.py
+++ b/statapp/correlation_analysis.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/generate_factor_window.py b/statapp/generate_factor_window.py
index dbb488f..8fc9f8f 100644
--- a/statapp/generate_factor_window.py
+++ b/statapp/generate_factor_window.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/generate_window.py b/statapp/generate_window.py
index b3c8cfd..bf6bd61 100644
--- a/statapp/generate_window.py
+++ b/statapp/generate_window.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/main_window.py b/statapp/main_window.py
index a04dacc..4425a3f 100644
--- a/statapp/main_window.py
+++ b/statapp/main_window.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/mathtex_header_view.py b/statapp/mathtex_header_view.py
index ee21a80..eada796 100644
--- a/statapp/mathtex_header_view.py
+++ b/statapp/mathtex_header_view.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/combobox_model.py b/statapp/models/combobox_model.py
index 0d34633..c0b41af 100644
--- a/statapp/models/combobox_model.py
+++ b/statapp/models/combobox_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/correlation_analysis_model.py b/statapp/models/correlation_analysis_model.py
index 582789d..b382abb 100644
--- a/statapp/models/correlation_analysis_model.py
+++ b/statapp/models/correlation_analysis_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/editable_table_model.py b/statapp/models/editable_table_model.py
index 335f3d3..082ad6d 100644
--- a/statapp/models/editable_table_model.py
+++ b/statapp/models/editable_table_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/fileslc_model.py b/statapp/models/fileslc_model.py
index 9e286e4..143c291 100644
--- a/statapp/models/fileslc_model.py
+++ b/statapp/models/fileslc_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/input_values_model.py b/statapp/models/input_values_model.py
index 0b0de4c..6360eb4 100644
--- a/statapp/models/input_values_model.py
+++ b/statapp/models/input_values_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/prediction_table_model.py b/statapp/models/prediction_table_model.py
index e83e67d..49558d9 100644
--- a/statapp/models/prediction_table_model.py
+++ b/statapp/models/prediction_table_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/regression_result_model.py b/statapp/models/regression_result_model.py
index 855ea8a..059e6ea 100644
--- a/statapp/models/regression_result_model.py
+++ b/statapp/models/regression_result_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/ro_table_model.py b/statapp/models/ro_table_model.py
index 6e138b5..9ec1e21 100644
--- a/statapp/models/ro_table_model.py
+++ b/statapp/models/ro_table_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/transform_polynom_model.py b/statapp/models/transform_polynom_model.py
index 0568585..bca8ce4 100644
--- a/statapp/models/transform_polynom_model.py
+++ b/statapp/models/transform_polynom_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/utils.py b/statapp/models/utils.py
index 0b0712c..862275c 100644
--- a/statapp/models/utils.py
+++ b/statapp/models/utils.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/models/variance_analysis_model.py b/statapp/models/variance_analysis_model.py
index 08ba1df..bf76705 100644
--- a/statapp/models/variance_analysis_model.py
+++ b/statapp/models/variance_analysis_model.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/polynoms/linear_polynom_window.py b/statapp/polynoms/linear_polynom_window.py
index 9c0c29a..f319567 100644
--- a/statapp/polynoms/linear_polynom_window.py
+++ b/statapp/polynoms/linear_polynom_window.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/polynoms/polynom_window.py b/statapp/polynoms/polynom_window.py
index 5047a04..d8da55d 100644
--- a/statapp/polynoms/polynom_window.py
+++ b/statapp/polynoms/polynom_window.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
@@ -17,7 +17,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
+import numpy as np
from PySide2.QtWidgets import QDialog, QHeaderView
+import matplotlib
+from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
+from matplotlib.figure import Figure
from statapp.calculations import prediction
from statapp.mathtex_header_view import MathTexHeaderView
@@ -27,6 +31,15 @@ from statapp.ui.ui_polynom_window import Ui_PolynomWindow
from statapp.utils import addIcon, FloatDelegate
+matplotlib.use('Qt5Agg')
+
+class MplCanvas(FigureCanvasQTAgg):
+
+ def __init__(self, parent=None, width=5, height=4, dpi=100):
+ fig = Figure(figsize=(width, height), dpi=dpi)
+ self.axes = fig.add_subplot()
+ super().__init__(fig)
+
class PolynomWindow(QDialog):
def __init__(self, data, result, windowTitle):
super().__init__()
@@ -47,7 +60,30 @@ class PolynomWindow(QDialog):
self.ui.fStatisticValueLabel.setText(str(result.fStatistic))
self.ui.rSquaredValueLabel.setText(str(result.scaledResidualVariance))
- self.predictionModel = PreditionTableModel(prediction(data, result))
+ predictionResult = prediction(data, result)
+
+ self.predictionModel = PreditionTableModel(predictionResult)
self.ui.predictionTableView.setModel(self.predictionModel)
header = self.ui.predictionTableView.horizontalHeader()
header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch)
+
+ sc = MplCanvas(self, width=5, height=4, dpi=100)
+
+ xAxes = np.array(range(len(data[:, 0])))
+
+ realY = predictionResult[:, 0]
+ calculatedY = predictionResult[:, 1]
+
+ print(xAxes)
+ print(realY)
+ print(calculatedY)
+
+ sc.axes.scatter(xAxes, realY)
+
+ # xnew = np.linspace(xAxes.min(), xAxes.max(), 300)
+ # gfg = scipy.interpolate.make_interp_spline(xAxes, y, k=3)
+ # y_new = gfg(xnew)
+
+ sc.axes.plot(xAxes, calculatedY)
+
+ self.ui.plotContainer.addWidget(sc)
diff --git a/statapp/polynoms/squared_polynom_window.py b/statapp/polynoms/squared_polynom_window.py
index bb5397e..8f481d6 100644
--- a/statapp/polynoms/squared_polynom_window.py
+++ b/statapp/polynoms/squared_polynom_window.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/polynoms/transform_polynom_window.py b/statapp/polynoms/transform_polynom_window.py
index d62a684..e72b0b0 100644
--- a/statapp/polynoms/transform_polynom_window.py
+++ b/statapp/polynoms/transform_polynom_window.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
@@ -26,6 +26,7 @@ from statapp.combo_delegate import ComboDelegate
from statapp.mathtex_header_view import MathTexHeaderView
from statapp.models.prediction_table_model import PreditionTableModel
from statapp.models.transform_polynom_model import TransformPolynomModel, TRANSFORMS
+from statapp.polynoms.polynom_window import MplCanvas
from statapp.ui.ui_polynom_window import Ui_PolynomWindow
from statapp.utils import addIcon
@@ -41,11 +42,20 @@ class TransformPolynomWindow(QDialog):
self.data = data
result = linearPolynom(data)
- self.predictionModel = PreditionTableModel(prediction(data, result))
+ predictionResult = prediction(data, result)
+ self.predictionModel = PreditionTableModel(predictionResult)
self.ui.predictionTableView.setModel(self.predictionModel)
header = self.ui.predictionTableView.horizontalHeader()
header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch)
+ self.sc = MplCanvas(self, width=5, height=4, dpi=100)
+ xAxes = np.array(range(len(data[:, 0])))
+ realY = predictionResult[:, 0]
+ calculatedY = predictionResult[:, 1]
+ self.sc.axes.scatter(xAxes, realY)
+ self.sc.axes.plot(xAxes, calculatedY)
+ self.ui.plotContainer.addWidget(self.sc)
+
# Создание столбца из нулей
zeroCol = np.zeros((result.paramsAndImportance.shape[0], 1))
# Добавление столбца к исходному массиву
@@ -84,7 +94,17 @@ class TransformPolynomWindow(QDialog):
def rebuildData(self, data):
result = linearPolynom(data)
- self.predictionModel.updateAllData(prediction(data, result))
+ predictionResult = prediction(data, result)
+ self.predictionModel.updateAllData(predictionResult)
+ self.ui.plotContainer.removeWidget(self.sc)
+ self.sc = MplCanvas(self, width=5, height=4, dpi=100)
+ xAxes = np.array(range(len(data[:, 0])))
+ realY = predictionResult[:, 0]
+ calculatedY = predictionResult[:, 1]
+ self.sc.axes.scatter(xAxes, realY)
+ self.sc.axes.plot(xAxes, calculatedY)
+ self.ui.plotContainer.addWidget(self.sc)
+
zeroCol = np.zeros((result.paramsAndImportance.shape[0], 1))
result.paramsAndImportance = np.column_stack((zeroCol, result.paramsAndImportance))
self.model.updateAllData(result)
diff --git a/statapp/ui/polynom_window.ui b/statapp/ui/polynom_window.ui
index c067cbe..4ad142c 100644
--- a/statapp/ui/polynom_window.ui
+++ b/statapp/ui/polynom_window.ui
@@ -120,6 +120,16 @@
+
+
+ График
+
+
+ -
+
+
+
+
diff --git a/statapp/ui/ui_about_window.py b/statapp/ui/ui_about_window.py
index 8092997..0e730b7 100644
--- a/statapp/ui/ui_about_window.py
+++ b/statapp/ui/ui_about_window.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/ui/ui_correlation_analysis_window.py b/statapp/ui/ui_correlation_analysis_window.py
index a0e0528..6e57bce 100644
--- a/statapp/ui/ui_correlation_analysis_window.py
+++ b/statapp/ui/ui_correlation_analysis_window.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/ui/ui_generate_factor_window.py b/statapp/ui/ui_generate_factor_window.py
index 94d324b..cc6a141 100644
--- a/statapp/ui/ui_generate_factor_window.py
+++ b/statapp/ui/ui_generate_factor_window.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/ui/ui_generate_window.py b/statapp/ui/ui_generate_window.py
index 8514030..61aa4dd 100644
--- a/statapp/ui/ui_generate_window.py
+++ b/statapp/ui/ui_generate_window.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/ui/ui_main_window.py b/statapp/ui/ui_main_window.py
index e5692a5..5a1eb3f 100644
--- a/statapp/ui/ui_main_window.py
+++ b/statapp/ui/ui_main_window.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/ui/ui_polynom_window.py b/statapp/ui/ui_polynom_window.py
index 3d82727..44556b9 100644
--- a/statapp/ui/ui_polynom_window.py
+++ b/statapp/ui/ui_polynom_window.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
@@ -117,6 +117,16 @@ class Ui_PolynomWindow(object):
self.gridLayout_4.addWidget(self.predictionTableView, 0, 0, 1, 1)
self.tabWidget.addTab(self.prediction, "")
+ self.tab = QWidget()
+ self.tab.setObjectName(u"tab")
+ self.gridLayout_5 = QGridLayout(self.tab)
+ self.gridLayout_5.setObjectName(u"gridLayout_5")
+ self.plotContainer = QGridLayout()
+ self.plotContainer.setObjectName(u"plotContainer")
+
+ self.gridLayout_5.addLayout(self.plotContainer, 0, 0, 1, 1)
+
+ self.tabWidget.addTab(self.tab, "")
self.gridLayout_2.addWidget(self.tabWidget, 0, 6, 1, 1)
@@ -141,4 +151,5 @@ class Ui_PolynomWindow(object):
self.rSquaredValueLabel.setText(QCoreApplication.translate("PolynomWindow", u"undefined", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.model), QCoreApplication.translate("PolynomWindow", u"\u041c\u043e\u0434\u0435\u043b\u044c", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.prediction), QCoreApplication.translate("PolynomWindow", u"\u041f\u0440\u043e\u0433\u043d\u043e\u0437", None))
+ self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QCoreApplication.translate("PolynomWindow", u"\u0413\u0440\u0430\u0444\u0438\u043a", None))
# retranslateUi
diff --git a/statapp/ui/ui_variance_analysis_window.py b/statapp/ui/ui_variance_analysis_window.py
index 80dd0b6..2da62c1 100644
--- a/statapp/ui/ui_variance_analysis_window.py
+++ b/statapp/ui/ui_variance_analysis_window.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/utils.py b/statapp/utils.py
index 5039d6d..463767d 100644
--- a/statapp/utils.py
+++ b/statapp/utils.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
diff --git a/statapp/variance_analysis.py b/statapp/variance_analysis.py
index 2ca5b47..9c61587 100644
--- a/statapp/variance_analysis.py
+++ b/statapp/variance_analysis.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
+# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).