mirror of
https://github.com/shizand/statapp.git
synced 2025-10-08 13:10:19 +03:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
71e68a645d | ||
|
c36e1aa733 | ||
|
1c88acf772 | ||
bb1b2f1ec5 | |||
|
7cbb93e37c | ||
8ea3cffa7e | |||
|
51fc413fca | ||
f70be431cf |
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,5 +3,5 @@
|
|||||||
<component name="Black">
|
<component name="Black">
|
||||||
<option name="sdkName" value="Poetry (statapp)" />
|
<option name="sdkName" value="Poetry (statapp)" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Poetry (statapp)" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Poetry (statapp) (2)" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
||||||
|
4
.idea/runConfigurations/statapp.xml
generated
4
.idea/runConfigurations/statapp.xml
generated
@@ -1,15 +1,15 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="statapp" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
<configuration default="false" name="statapp" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
||||||
<module name="stat" />
|
<module name="stat" />
|
||||||
|
<option name="ENV_FILES" value="" />
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
<option name="PARENT_ENVS" value="true" />
|
<option name="PARENT_ENVS" value="true" />
|
||||||
<envs>
|
<envs>
|
||||||
<env name="PYTHONUNBUFFERED" value="1" />
|
<env name="PYTHONUNBUFFERED" value="1" />
|
||||||
</envs>
|
</envs>
|
||||||
<option name="SDK_HOME" value="" />
|
<option name="SDK_HOME" value="" />
|
||||||
<option name="SDK_NAME" value="Poetry (statapp)" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="" />
|
<option name="WORKING_DIRECTORY" value="" />
|
||||||
<option name="IS_MODULE_SDK" value="false" />
|
<option name="IS_MODULE_SDK" value="true" />
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
<option name="SCRIPT_NAME" value="statapp" />
|
<option name="SCRIPT_NAME" value="statapp" />
|
||||||
|
2
.idea/stat.iml
generated
2
.idea/stat.iml
generated
@@ -2,7 +2,7 @@
|
|||||||
<module type="PYTHON_MODULE" version="4">
|
<module type="PYTHON_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$" />
|
||||||
<orderEntry type="jdk" jdkName="Poetry (statapp)" jdkType="Python SDK" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
@@ -24,4 +24,5 @@ disable=
|
|||||||
missing-docstring,
|
missing-docstring,
|
||||||
too-many-public-methods,
|
too-many-public-methods,
|
||||||
too-few-public-methods,
|
too-few-public-methods,
|
||||||
too-many-arguments
|
too-many-arguments,
|
||||||
|
broad-except
|
||||||
|
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,5 +1,33 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.10.1](https://github.com/shizand/statapp/compare/v0.10.0...v0.10.1) (2024-01-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Исправления
|
||||||
|
|
||||||
|
* Добавлена обработка ошибок ([#98](https://github.com/shizand/statapp/issues/98)) ([c36e1aa](https://github.com/shizand/statapp/commit/c36e1aa733269720366c4d7dea48d2bdc966a59a))
|
||||||
|
|
||||||
|
## [0.10.0](https://github.com/shizand/statapp/compare/v0.9.0...v0.10.0) (2024-01-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Новые функции
|
||||||
|
|
||||||
|
* добавлен график ([#94](https://github.com/shizand/statapp/issues/94)) ([bb1b2f1](https://github.com/shizand/statapp/commit/bb1b2f1ec5b988bcb8ddd7500b95fe9e35c826f5)), closes [#86](https://github.com/shizand/statapp/issues/86)
|
||||||
|
|
||||||
|
## [0.9.0](https://github.com/shizand/statapp/compare/v0.8.0...v0.9.0) (2024-01-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Новые функции
|
||||||
|
|
||||||
|
* добавлен "Прогноз" ([#92](https://github.com/shizand/statapp/issues/92)) ([8ea3cff](https://github.com/shizand/statapp/commit/8ea3cffa7e0d920141c8eda71952ff02d2c02905)), closes [#85](https://github.com/shizand/statapp/issues/85)
|
||||||
|
|
||||||
|
## [0.8.0](https://github.com/shizand/statapp/compare/v0.7.0...v0.8.0) (2023-12-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Новые функции
|
||||||
|
|
||||||
|
* добавлены преобразования ([#90](https://github.com/shizand/statapp/issues/90)) ([f70be43](https://github.com/shizand/statapp/commit/f70be431cfb4ecda5c3e706f4ca95171bbe779b3))
|
||||||
|
|
||||||
## [0.7.0](https://github.com/shizand/statapp/compare/v0.6.0...v0.7.0) (2023-12-01)
|
## [0.7.0](https://github.com/shizand/statapp/compare/v0.6.0...v0.7.0) (2023-12-01)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "statapp"
|
name = "statapp"
|
||||||
version = "0.7.0"
|
version = "0.10.1"
|
||||||
description = ""
|
description = ""
|
||||||
authors = [
|
authors = [
|
||||||
"Maxim Slipenko <statapp@maks1ms.addy.io>"
|
"Maxim Slipenko <statapp@maks1ms.addy.io>"
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
@@ -39,5 +39,6 @@ def main():
|
|||||||
window.show()
|
window.show()
|
||||||
return app.exec_()
|
return app.exec_()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
@@ -21,6 +21,7 @@ from dataclasses import dataclass
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
import sympy as sp
|
||||||
from statapp._vendor.multipolyfit import multipolyfit, getTerms
|
from statapp._vendor.multipolyfit import multipolyfit, getTerms
|
||||||
|
|
||||||
DIRECT_LINK = 0
|
DIRECT_LINK = 0
|
||||||
@@ -135,3 +136,39 @@ def calculateStats(data, params, residues, y):
|
|||||||
out[1] = tStatistics
|
out[1] = tStatistics
|
||||||
|
|
||||||
return out, mse[0], scaledResidualVariance, rSquared, fStatistic
|
return out, mse[0], scaledResidualVariance, rSquared, fStatistic
|
||||||
|
|
||||||
|
|
||||||
|
def prediction(inputData, result: RegressionResult):
|
||||||
|
inputs = inputData[:, 1:]
|
||||||
|
outputs = inputData[:, 0]
|
||||||
|
|
||||||
|
params = result.paramsAndImportance[:, 0]
|
||||||
|
|
||||||
|
expr = sp.sympify(' '.join(
|
||||||
|
[
|
||||||
|
f'{param}' if m == 'c' else f' + ({param}) * {m}'
|
||||||
|
for param, m in zip(params, result.monomials)
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
|
results = []
|
||||||
|
|
||||||
|
for y, xValues in zip(outputs, inputs):
|
||||||
|
subsDict = dict(zip(expr.free_symbols, xValues))
|
||||||
|
predictedResult = expr.subs(subsDict)
|
||||||
|
difference = predictedResult - y
|
||||||
|
|
||||||
|
results.append([y, predictedResult, difference, 0.0])
|
||||||
|
|
||||||
|
results = np.array(results, dtype=np.float32)
|
||||||
|
|
||||||
|
# Расчет среднего значения и стандартного отклонения разностей
|
||||||
|
meanDifference = np.mean(results[:, 2])
|
||||||
|
stdDifference = np.std(results[:, 2])
|
||||||
|
|
||||||
|
# Установка флага 1.0, если разность выходит за пределы 3 стандартных отклонений
|
||||||
|
for row in results:
|
||||||
|
if abs(row[2] - meanDifference) > 3 * stdDifference:
|
||||||
|
row[3] = 1.0
|
||||||
|
|
||||||
|
return results
|
||||||
|
63
statapp/combo_delegate.py
Normal file
63
statapp/combo_delegate.py
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
|
#
|
||||||
|
# This file is part of Statapp
|
||||||
|
# (see https://github.com/shizand/statapp).
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
from PySide2 import QtCore
|
||||||
|
from PySide2.QtWidgets import QComboBox, QItemDelegate
|
||||||
|
|
||||||
|
|
||||||
|
class ComboDelegate(QItemDelegate):
|
||||||
|
commitData = QtCore.Signal(object)
|
||||||
|
"""
|
||||||
|
A delegate that places a fully functioning QComboBox in every
|
||||||
|
cell of the column to which it's applied
|
||||||
|
"""
|
||||||
|
def __init__(self, parent, objects, objectNames):
|
||||||
|
"""
|
||||||
|
Constructoe
|
||||||
|
:param parent: QTableView parent object
|
||||||
|
:param objects: List of objects to set. i.e. [True, False]
|
||||||
|
:param objectNames: List of Object names to display. i.e. ['True', 'False']
|
||||||
|
"""
|
||||||
|
QItemDelegate.__init__(self, parent)
|
||||||
|
|
||||||
|
# objects to sent to the model associated to the combobox. i.e. [True, False]
|
||||||
|
self.objects = objects
|
||||||
|
|
||||||
|
# object description to display in the combobox. i.e. ['True', 'False']
|
||||||
|
self.objectNames = objectNames
|
||||||
|
|
||||||
|
@QtCore.Slot()
|
||||||
|
def currentIndexChanged(self):
|
||||||
|
self.commitData.emit(self.sender())
|
||||||
|
|
||||||
|
def createEditor(self, parent, option, index):
|
||||||
|
combo = QComboBox(parent)
|
||||||
|
combo.addItems(self.objectNames)
|
||||||
|
combo.currentIndexChanged.connect(self.currentIndexChanged)
|
||||||
|
return combo
|
||||||
|
|
||||||
|
def setEditorData(self, editor, index):
|
||||||
|
editor.blockSignals(True)
|
||||||
|
val = index.model().data(index, role=QtCore.Qt.DisplayRole)
|
||||||
|
idx = self.objects.index(val)
|
||||||
|
editor.setCurrentIndex(idx)
|
||||||
|
editor.blockSignals(False)
|
||||||
|
|
||||||
|
def setModelData(self, editor, model, index):
|
||||||
|
model.setData(index, self.objects[editor.currentIndex()], QtCore.Qt.EditRole)
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
@@ -33,9 +33,10 @@ from statapp.about_window import AboutWindow
|
|||||||
from statapp.models.fileslc_model import FileSLCModel
|
from statapp.models.fileslc_model import FileSLCModel
|
||||||
from statapp.polynoms.squared_polynom_window import SquaredPolynomWindow
|
from statapp.polynoms.squared_polynom_window import SquaredPolynomWindow
|
||||||
from statapp.ui.ui_main_window import Ui_MainWindow
|
from statapp.ui.ui_main_window import Ui_MainWindow
|
||||||
from statapp.utils import buildMessageBox, addIcon, FloatDelegate
|
from statapp.utils import buildMessageBox, addIcon, FloatDelegate, onError
|
||||||
from statapp.variance_analysis import VarianceAnalysisWindow
|
from statapp.variance_analysis import VarianceAnalysisWindow
|
||||||
from statapp.correlation_analysis import CorrelationAnalysisWindow
|
from statapp.correlation_analysis import CorrelationAnalysisWindow
|
||||||
|
from statapp.polynoms.transform_polynom_window import TransformPolynomWindow
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
@@ -56,6 +57,7 @@ class MainWindow(QMainWindow):
|
|||||||
self.ui.correlationAnalisisAction,
|
self.ui.correlationAnalisisAction,
|
||||||
self.ui.linearPolynomAction,
|
self.ui.linearPolynomAction,
|
||||||
self.ui.squaredPolynomAction,
|
self.ui.squaredPolynomAction,
|
||||||
|
self.ui.transformPolynomAction,
|
||||||
]
|
]
|
||||||
|
|
||||||
self.aboutWindow = None
|
self.aboutWindow = None
|
||||||
@@ -101,71 +103,86 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_openfileaction_triggered(self):
|
def on_openfileaction_triggered(self):
|
||||||
currentData = self.model.getData()
|
try:
|
||||||
data = np.array([])
|
currentData = self.model.getData()
|
||||||
if currentData.size > 1:
|
data = np.array([])
|
||||||
file = ''
|
if currentData.size > 1:
|
||||||
if self.fileModel.fileName:
|
file = ''
|
||||||
file = '\nФайл сохранения: ' + self.fileModel.fileName
|
if self.fileModel.fileName:
|
||||||
|
file = '\nФайл сохранения: ' + self.fileModel.fileName
|
||||||
|
|
||||||
msgBox = buildMessageBox \
|
msgBox = buildMessageBox \
|
||||||
('Сохранение данных',
|
('Сохранение данных',
|
||||||
"Сохранить данные?" + file,
|
"Сохранить данные?" + file,
|
||||||
QMessageBox.Question,
|
QMessageBox.Question,
|
||||||
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel,
|
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel,
|
||||||
QMessageBox.Cancel)
|
QMessageBox.Cancel)
|
||||||
|
|
||||||
reply = msgBox.exec_()
|
reply = msgBox.exec_()
|
||||||
if reply == QMessageBox.StandardButton.Yes:
|
if reply == QMessageBox.StandardButton.Yes:
|
||||||
self.fileModel.saveFile(self.model.getData())
|
self.fileModel.saveFile(self.model.getData())
|
||||||
|
|
||||||
data = self.fileModel.loadFile()
|
data = self.fileModel.loadFile()
|
||||||
if data is not None and data.shape[0] > 0:
|
if data is not None and data.shape[0] > 0:
|
||||||
self.model.updateAllData(data)
|
self.model.updateAllData(data)
|
||||||
self.isDataChanged = False
|
self.isDataChanged = False
|
||||||
elif reply == QMessageBox.StandardButton.Cancel:
|
elif reply == QMessageBox.StandardButton.Cancel:
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
|
data = self.fileModel.loadFile()
|
||||||
|
if data is not None and data.shape[0] > 0:
|
||||||
|
self.model.updateAllData(data)
|
||||||
|
self.isDataChanged = False
|
||||||
else:
|
else:
|
||||||
data = self.fileModel.loadFile()
|
data = self.fileModel.loadFile()
|
||||||
if data is not None and data.shape[0] > 0:
|
if data is not None and data.shape[0] > 0:
|
||||||
self.model.updateAllData(data)
|
self.model.updateAllData(data)
|
||||||
self.isDataChanged = False
|
self.isDataChanged = False
|
||||||
else:
|
except Exception as error:
|
||||||
data = self.fileModel.loadFile()
|
onError(error)
|
||||||
if data is not None and data.shape[0] > 0:
|
|
||||||
self.model.updateAllData(data)
|
|
||||||
self.isDataChanged = False
|
|
||||||
|
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_savefileaction_triggered(self):
|
def on_savefileaction_triggered(self):
|
||||||
self.isDataChanged = not self.fileModel.saveFile(self.model.getData())
|
try:
|
||||||
|
self.isDataChanged = not self.fileModel.saveFile(self.model.getData())
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_closefileaction_triggered(self):
|
def on_closefileaction_triggered(self):
|
||||||
self.fileModel.closeFile()
|
try:
|
||||||
self.isDataChanged = False
|
self.fileModel.closeFile()
|
||||||
|
self.isDataChanged = False
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_generateYaction_triggered(self):
|
def on_generateYaction_triggered(self):
|
||||||
gw = GenerateWindow()
|
try:
|
||||||
|
gw = GenerateWindow()
|
||||||
|
|
||||||
if gw.exec():
|
if gw.exec():
|
||||||
y = generateYValues(gw.mat, gw.deviation, gw.count)
|
y = generateYValues(gw.mat, gw.deviation, gw.count)
|
||||||
self.model.updateAllData(y.round(NUMBERS_PRECISION))
|
self.model.updateAllData(y.round(NUMBERS_PRECISION))
|
||||||
self.isDataChanged = True
|
self.isDataChanged = True
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_generateXaction_triggered(self):
|
def on_generateXaction_triggered(self):
|
||||||
gfw = GenerateFactorWindow()
|
try:
|
||||||
|
gfw = GenerateFactorWindow()
|
||||||
|
|
||||||
if gfw.exec():
|
if gfw.exec():
|
||||||
data = self.model.getData()
|
data = self.model.getData()
|
||||||
y = self.model.getY()
|
y = self.model.getY()
|
||||||
xValues = generateXValues(gfw.mat, gfw.deviation, gfw.typeConnection, y)
|
xValues = generateXValues(gfw.mat, gfw.deviation, gfw.typeConnection, y)
|
||||||
data = np.concatenate((data, xValues.round(NUMBERS_PRECISION)), axis=1)
|
data = np.concatenate((data, xValues.round(NUMBERS_PRECISION)), axis=1)
|
||||||
self.model.updateAllData(data)
|
self.model.updateAllData(data)
|
||||||
self.isDataChanged = True
|
self.isDataChanged = True
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_aboutmenuaction_triggered(self):
|
def on_aboutmenuaction_triggered(self):
|
||||||
@@ -174,23 +191,43 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_varianceAnalysisAction_triggered(self):
|
def on_varianceAnalysisAction_triggered(self):
|
||||||
dw = VarianceAnalysisWindow(self.model.getData())
|
try:
|
||||||
dw.exec()
|
dw = VarianceAnalysisWindow(self.model.getData())
|
||||||
|
dw.exec()
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_correlationAnalisisAction_triggered(self):
|
def on_correlationAnalisisAction_triggered(self):
|
||||||
dw = CorrelationAnalysisWindow(self.model.getData())
|
try:
|
||||||
dw.exec()
|
dw = CorrelationAnalysisWindow(self.model.getData())
|
||||||
|
dw.exec()
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_linearPolynomAction_triggered(self):
|
def on_linearPolynomAction_triggered(self):
|
||||||
dw = LinearPolynomWindow(self.model.getData())
|
try:
|
||||||
dw.exec()
|
dw = LinearPolynomWindow(self.model.getData())
|
||||||
|
dw.exec()
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def on_squaredPolynomAction_triggered(self):
|
def on_squaredPolynomAction_triggered(self):
|
||||||
dw = SquaredPolynomWindow(self.model.getData())
|
try:
|
||||||
dw.exec()
|
dw = SquaredPolynomWindow(self.model.getData())
|
||||||
|
dw.exec()
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
|
@Slot()
|
||||||
|
def on_transformPolynomAction_triggered(self):
|
||||||
|
try:
|
||||||
|
dw = TransformPolynomWindow(self.model.getData())
|
||||||
|
dw.exec()
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
if self.isDataChanged:
|
if self.isDataChanged:
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
33
statapp/models/prediction_table_model.py
Normal file
33
statapp/models/prediction_table_model.py
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
|
#
|
||||||
|
# This file is part of Statapp
|
||||||
|
# (see https://github.com/shizand/statapp).
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
from PySide2.QtCore import Qt
|
||||||
|
|
||||||
|
from statapp.models.ro_table_model import ROTableModel
|
||||||
|
|
||||||
|
|
||||||
|
class PreditionTableModel(ROTableModel):
|
||||||
|
def getHorizontalHeader(self):
|
||||||
|
return ['Отклик', 'Прогноз', 'Отклонение', '1-3 сигмовые зоны']
|
||||||
|
|
||||||
|
def data(self, index, role):
|
||||||
|
if role == Qt.DisplayRole and index.column() == 3:
|
||||||
|
value = super().data(index, role)
|
||||||
|
return 'x' if value == 1 else ''
|
||||||
|
return super().data(index, role)
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
74
statapp/models/transform_polynom_model.py
Normal file
74
statapp/models/transform_polynom_model.py
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
|
#
|
||||||
|
# This file is part of Statapp
|
||||||
|
# (see https://github.com/shizand/statapp).
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
import numpy as np
|
||||||
|
from PySide2.QtCore import Qt
|
||||||
|
|
||||||
|
from statapp.models.editable_table_model import EditableTableModel
|
||||||
|
from statapp.models.regression_result_model import RegressionResultModel
|
||||||
|
|
||||||
|
def defaultX(x):
|
||||||
|
return x
|
||||||
|
|
||||||
|
TRANSFORMS = {
|
||||||
|
'-': defaultX,
|
||||||
|
'sin(x)': np.sin,
|
||||||
|
'cos(x)': np.cos,
|
||||||
|
'log(x)': np.log,
|
||||||
|
'exp(x)': np.exp,
|
||||||
|
}
|
||||||
|
|
||||||
|
class TransformPolynomModel(RegressionResultModel, EditableTableModel):
|
||||||
|
|
||||||
|
def __init__(self, result):
|
||||||
|
self._monomials = None
|
||||||
|
super().__init__(result)
|
||||||
|
n = result.paramsAndImportance.shape[0]
|
||||||
|
|
||||||
|
self._transforms = ['-'] * n
|
||||||
|
|
||||||
|
def columnCount(self, index):
|
||||||
|
return 3
|
||||||
|
|
||||||
|
def updateAllData(self, data):
|
||||||
|
d = data.paramsAndImportance
|
||||||
|
self._monomials = data.monomials
|
||||||
|
super().updateAllData(d)
|
||||||
|
|
||||||
|
def flags(self, index):
|
||||||
|
if index.column() == 0 and index.row() != 0:
|
||||||
|
return EditableTableModel.flags(self, index)
|
||||||
|
return RegressionResultModel.flags(self, index)
|
||||||
|
|
||||||
|
def data(self, index, role):
|
||||||
|
if role == Qt.DisplayRole and index.column() == 0:
|
||||||
|
return self._transforms[index.row()]
|
||||||
|
return super().data(index, role)
|
||||||
|
|
||||||
|
def setData(self, index, value, role):
|
||||||
|
if role == Qt.EditRole and index.column() == 0:
|
||||||
|
self._transforms[index.row()] = value
|
||||||
|
topLeftIndex = self.createIndex(index.row(), 0)
|
||||||
|
bottomRightIndex = self.createIndex(index.row(), 0)
|
||||||
|
self.dataChanged.emit(topLeftIndex, bottomRightIndex)
|
||||||
|
return True
|
||||||
|
return super().setData(index, value, role)
|
||||||
|
|
||||||
|
def getHorizontalHeader(self):
|
||||||
|
return ['Преобразования'] + super().getHorizontalHeader()
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
@@ -24,4 +24,4 @@ from statapp.polynoms.polynom_window import PolynomWindow
|
|||||||
class LinearPolynomWindow(PolynomWindow):
|
class LinearPolynomWindow(PolynomWindow):
|
||||||
def __init__(self, data):
|
def __init__(self, data):
|
||||||
result = linearPolynom(data)
|
result = linearPolynom(data)
|
||||||
super().__init__(result, "Линейный полином")
|
super().__init__(data, result, "Линейный полином")
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
@@ -17,15 +17,31 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
import numpy as np
|
||||||
from PySide2.QtWidgets import QDialog, QHeaderView
|
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
|
from statapp.mathtex_header_view import MathTexHeaderView
|
||||||
|
from statapp.models.prediction_table_model import PreditionTableModel
|
||||||
from statapp.models.regression_result_model import RegressionResultModel
|
from statapp.models.regression_result_model import RegressionResultModel
|
||||||
from statapp.ui.ui_polynom_window import Ui_PolynomWindow
|
from statapp.ui.ui_polynom_window import Ui_PolynomWindow
|
||||||
from statapp.utils import addIcon, FloatDelegate
|
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):
|
class PolynomWindow(QDialog):
|
||||||
def __init__(self, result, windowTitle):
|
def __init__(self, data, result, windowTitle):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.ui = Ui_PolynomWindow()
|
self.ui = Ui_PolynomWindow()
|
||||||
self.ui.setupUi(self)
|
self.ui.setupUi(self)
|
||||||
@@ -43,3 +59,31 @@ class PolynomWindow(QDialog):
|
|||||||
self.ui.scaledResidualVarianceValueLabel.setText(str(result.scaledResidualVariance))
|
self.ui.scaledResidualVarianceValueLabel.setText(str(result.scaledResidualVariance))
|
||||||
self.ui.fStatisticValueLabel.setText(str(result.fStatistic))
|
self.ui.fStatisticValueLabel.setText(str(result.fStatistic))
|
||||||
self.ui.rSquaredValueLabel.setText(str(result.scaledResidualVariance))
|
self.ui.rSquaredValueLabel.setText(str(result.scaledResidualVariance))
|
||||||
|
|
||||||
|
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)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
@@ -24,4 +24,4 @@ from statapp.polynoms.polynom_window import PolynomWindow
|
|||||||
class SquaredPolynomWindow(PolynomWindow):
|
class SquaredPolynomWindow(PolynomWindow):
|
||||||
def __init__(self, data):
|
def __init__(self, data):
|
||||||
result = squaredPolynom(data)
|
result = squaredPolynom(data)
|
||||||
super().__init__(result, "Квадратичный полином")
|
super().__init__(data, result, "Квадратичный полином")
|
||||||
|
120
statapp/polynoms/transform_polynom_window.py
Normal file
120
statapp/polynoms/transform_polynom_window.py
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
|
#
|
||||||
|
# This file is part of Statapp
|
||||||
|
# (see https://github.com/shizand/statapp).
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
import numpy as np
|
||||||
|
from PySide2.QtCore import Qt
|
||||||
|
from PySide2.QtWidgets import QDialog, QHeaderView
|
||||||
|
|
||||||
|
from statapp.calculations import linearPolynom, prediction
|
||||||
|
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, onError
|
||||||
|
|
||||||
|
|
||||||
|
class TransformPolynomWindow(QDialog):
|
||||||
|
def __init__(self, data):
|
||||||
|
super().__init__()
|
||||||
|
self.ui = Ui_PolynomWindow()
|
||||||
|
self.ui.setupUi(self)
|
||||||
|
addIcon(self)
|
||||||
|
self.setWindowTitle("Преобразования")
|
||||||
|
|
||||||
|
self.data = data
|
||||||
|
result = linearPolynom(data)
|
||||||
|
try:
|
||||||
|
predictionResult = prediction(data, result)
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
|
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))
|
||||||
|
# Добавление столбца к исходному массиву
|
||||||
|
result.paramsAndImportance = np.column_stack((zeroCol, result.paramsAndImportance))
|
||||||
|
|
||||||
|
# self.ui.tableView.setItemDelegate(FloatDelegate())
|
||||||
|
self.ui.tableView.setItemDelegate(
|
||||||
|
ComboDelegate(
|
||||||
|
self.ui.tableView,
|
||||||
|
list(TRANSFORMS.keys()),
|
||||||
|
list(TRANSFORMS.keys()),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
self.model = TransformPolynomModel(result)
|
||||||
|
self.ui.tableView.setModel(self.model)
|
||||||
|
self.ui.tableView.setVerticalHeader(MathTexHeaderView(self.ui.tableView))
|
||||||
|
header = self.ui.tableView.horizontalHeader()
|
||||||
|
header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch)
|
||||||
|
|
||||||
|
self.ui.residualVarianceValueLabel.setText(str(result.residualVariance))
|
||||||
|
self.ui.scaledResidualVarianceValueLabel.setText(str(result.scaledResidualVariance))
|
||||||
|
self.ui.fStatisticValueLabel.setText(str(result.fStatistic))
|
||||||
|
self.ui.rSquaredValueLabel.setText(str(result.scaledResidualVariance))
|
||||||
|
|
||||||
|
self.model.dataChanged.connect(self.on_data_changed)
|
||||||
|
|
||||||
|
def on_data_changed(self):
|
||||||
|
data = np.copy(self.data)
|
||||||
|
print(len(data[0:]))
|
||||||
|
for i in range(len(data[0:])):
|
||||||
|
for j in range(1, len(data[i])):
|
||||||
|
tr = self.model.data(self.model.createIndex(j, 0), Qt.DisplayRole)
|
||||||
|
data[i][j] = TRANSFORMS[tr](data[i][j])
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.rebuildData(data)
|
||||||
|
except Exception as error:
|
||||||
|
onError(error)
|
||||||
|
|
||||||
|
def rebuildData(self, data):
|
||||||
|
result = linearPolynom(data)
|
||||||
|
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)
|
||||||
|
self.ui.residualVarianceValueLabel.setText(str(result.residualVariance))
|
||||||
|
self.ui.scaledResidualVarianceValueLabel.setText(str(result.scaledResidualVariance))
|
||||||
|
self.ui.fStatisticValueLabel.setText(str(result.fStatistic))
|
||||||
|
self.ui.rSquaredValueLabel.setText(str(result.scaledResidualVariance))
|
@@ -40,7 +40,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>27</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="filemenu">
|
<widget class="QMenu" name="filemenu">
|
||||||
@@ -71,6 +71,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<addaction name="linearPolynomAction"/>
|
<addaction name="linearPolynomAction"/>
|
||||||
<addaction name="squaredPolynomAction"/>
|
<addaction name="squaredPolynomAction"/>
|
||||||
|
<addaction name="transformPolynomAction"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="helpmenu">
|
<widget class="QMenu" name="helpmenu">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@@ -135,6 +136,11 @@
|
|||||||
<string>Квадратичный полином</string>
|
<string>Квадратичный полином</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="transformPolynomAction">
|
||||||
|
<property name="text">
|
||||||
|
<string>Преобразования</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
@@ -6,93 +6,131 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>630</width>
|
<width>537</width>
|
||||||
<height>400</height>
|
<height>444</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Полином</string>
|
<string>Полином</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0">
|
<item row="0" column="6">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<item row="0" column="0">
|
<property name="currentIndex">
|
||||||
<widget class="QTableView" name="tableView">
|
<number>0</number>
|
||||||
<attribute name="horizontalHeaderMinimumSectionSize">
|
</property>
|
||||||
<number>40</number>
|
<widget class="QWidget" name="model">
|
||||||
</attribute>
|
<attribute name="title">
|
||||||
<attribute name="verticalHeaderMinimumSectionSize">
|
<string>Модель</string>
|
||||||
<number>40</number>
|
</attribute>
|
||||||
</attribute>
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<attribute name="verticalHeaderDefaultSectionSize">
|
|
||||||
<number>40</number>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<layout class="QGridLayout" name="polynomResult">
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLabel" name="residualVarianceValueLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>undefined</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLabel" name="scaledResidualVarianceValueLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>undefined</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="fStatisticLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>F1 - отношение Фишера</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="residualVarianceLabel">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="text">
|
<item row="1" column="3">
|
||||||
<string>Остаточная дисперсия:</string>
|
<widget class="QTableView" name="tableView">
|
||||||
</property>
|
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||||
</widget>
|
<number>40</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderMinimumSectionSize">
|
||||||
|
<number>40</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderDefaultSectionSize">
|
||||||
|
<number>40</number>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="3">
|
||||||
|
<layout class="QGridLayout" name="polynomResult">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="residualVarianceValueLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>undefined</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="scaledResidualVarianceValueLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>undefined</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="fStatisticLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>F1 - отношение Фишера</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="residualVarianceLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Остаточная дисперсия:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="scaledResidualVarianceLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Остаточная дисперсия (масштабированная):</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="rSquaredLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Коэффициент множественной дереминизации</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLabel" name="fStatisticValueLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>undefined</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLabel" name="rSquaredValueLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>undefined</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
</layout>
|
||||||
<widget class="QLabel" name="scaledResidualVarianceLabel">
|
</widget>
|
||||||
<property name="text">
|
<widget class="QWidget" name="prediction">
|
||||||
<string>Остаточная дисперсия (масштабированная):</string>
|
<attribute name="title">
|
||||||
</property>
|
<string>Прогноз</string>
|
||||||
</widget>
|
</attribute>
|
||||||
</item>
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<item row="3" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="rSquaredLabel">
|
<widget class="QTableView" name="predictionTableView">
|
||||||
<property name="text">
|
<attribute name="verticalHeaderVisible">
|
||||||
<string>Коэффициент множественной дереминизации</string>
|
<bool>false</bool>
|
||||||
</property>
|
</attribute>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLabel" name="fStatisticValueLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>undefined</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QLabel" name="rSquaredValueLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>undefined</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</widget>
|
||||||
</layout>
|
<widget class="QWidget" name="tab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>График</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QGridLayout" name="plotContainer"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
2
statapp/ui/ui_about_window.py
generated
2
statapp/ui/ui_about_window.py
generated
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
2
statapp/ui/ui_correlation_analysis_window.py
generated
2
statapp/ui/ui_correlation_analysis_window.py
generated
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
2
statapp/ui/ui_generate_factor_window.py
generated
2
statapp/ui/ui_generate_factor_window.py
generated
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
2
statapp/ui/ui_generate_window.py
generated
2
statapp/ui/ui_generate_window.py
generated
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
8
statapp/ui/ui_main_window.py
generated
8
statapp/ui/ui_main_window.py
generated
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
@@ -58,6 +58,8 @@ class Ui_MainWindow(object):
|
|||||||
self.linearPolynomAction.setObjectName(u"linearPolynomAction")
|
self.linearPolynomAction.setObjectName(u"linearPolynomAction")
|
||||||
self.squaredPolynomAction = QAction(MainWindow)
|
self.squaredPolynomAction = QAction(MainWindow)
|
||||||
self.squaredPolynomAction.setObjectName(u"squaredPolynomAction")
|
self.squaredPolynomAction.setObjectName(u"squaredPolynomAction")
|
||||||
|
self.transformPolynomAction = QAction(MainWindow)
|
||||||
|
self.transformPolynomAction.setObjectName(u"transformPolynomAction")
|
||||||
self.centralwidget = QWidget(MainWindow)
|
self.centralwidget = QWidget(MainWindow)
|
||||||
self.centralwidget.setObjectName(u"centralwidget")
|
self.centralwidget.setObjectName(u"centralwidget")
|
||||||
self.gridLayout = QGridLayout(self.centralwidget)
|
self.gridLayout = QGridLayout(self.centralwidget)
|
||||||
@@ -77,7 +79,7 @@ class Ui_MainWindow(object):
|
|||||||
MainWindow.setCentralWidget(self.centralwidget)
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
self.menubar = QMenuBar(MainWindow)
|
self.menubar = QMenuBar(MainWindow)
|
||||||
self.menubar.setObjectName(u"menubar")
|
self.menubar.setObjectName(u"menubar")
|
||||||
self.menubar.setGeometry(QRect(0, 0, 800, 27))
|
self.menubar.setGeometry(QRect(0, 0, 800, 21))
|
||||||
self.filemenu = QMenu(self.menubar)
|
self.filemenu = QMenu(self.menubar)
|
||||||
self.filemenu.setObjectName(u"filemenu")
|
self.filemenu.setObjectName(u"filemenu")
|
||||||
self.generatemenu = QMenu(self.menubar)
|
self.generatemenu = QMenu(self.menubar)
|
||||||
@@ -107,6 +109,7 @@ class Ui_MainWindow(object):
|
|||||||
self.analyzemenu.addAction(self.correlationAnalisisAction)
|
self.analyzemenu.addAction(self.correlationAnalisisAction)
|
||||||
self.modelmenu.addAction(self.linearPolynomAction)
|
self.modelmenu.addAction(self.linearPolynomAction)
|
||||||
self.modelmenu.addAction(self.squaredPolynomAction)
|
self.modelmenu.addAction(self.squaredPolynomAction)
|
||||||
|
self.modelmenu.addAction(self.transformPolynomAction)
|
||||||
self.helpmenu.addAction(self.aboutmenuaction)
|
self.helpmenu.addAction(self.aboutmenuaction)
|
||||||
|
|
||||||
self.retranslateUi(MainWindow)
|
self.retranslateUi(MainWindow)
|
||||||
@@ -126,6 +129,7 @@ class Ui_MainWindow(object):
|
|||||||
self.correlationAnalisisAction.setText(QCoreApplication.translate("MainWindow", u"\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437", None))
|
self.correlationAnalisisAction.setText(QCoreApplication.translate("MainWindow", u"\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437", None))
|
||||||
self.linearPolynomAction.setText(QCoreApplication.translate("MainWindow", u"\u041b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043f\u043e\u043b\u0438\u043d\u043e\u043c", None))
|
self.linearPolynomAction.setText(QCoreApplication.translate("MainWindow", u"\u041b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043f\u043e\u043b\u0438\u043d\u043e\u043c", None))
|
||||||
self.squaredPolynomAction.setText(QCoreApplication.translate("MainWindow", u"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u043b\u0438\u043d\u043e\u043c", None))
|
self.squaredPolynomAction.setText(QCoreApplication.translate("MainWindow", u"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u043b\u0438\u043d\u043e\u043c", None))
|
||||||
|
self.transformPolynomAction.setText(QCoreApplication.translate("MainWindow", u"\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f", None))
|
||||||
self.label.setText(QCoreApplication.translate("MainWindow", u"\u0421\u0422\u0410\u0422\u0418\u0421\u0422\u0418\u0427\u0415\u0421\u041a\u0418\u0415 \u0414\u0410\u041d\u041d\u042b\u0415", None))
|
self.label.setText(QCoreApplication.translate("MainWindow", u"\u0421\u0422\u0410\u0422\u0418\u0421\u0422\u0418\u0427\u0415\u0421\u041a\u0418\u0415 \u0414\u0410\u041d\u041d\u042b\u0415", None))
|
||||||
self.filemenu.setTitle(QCoreApplication.translate("MainWindow", u"\u0424\u0430\u0439\u043b", None))
|
self.filemenu.setTitle(QCoreApplication.translate("MainWindow", u"\u0424\u0430\u0439\u043b", None))
|
||||||
self.generatemenu.setTitle(QCoreApplication.translate("MainWindow", u"\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439", None))
|
self.generatemenu.setTitle(QCoreApplication.translate("MainWindow", u"\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439", None))
|
||||||
|
65
statapp/ui/ui_polynom_window.py
generated
65
statapp/ui/ui_polynom_window.py
generated
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
@@ -37,71 +37,105 @@ class Ui_PolynomWindow(object):
|
|||||||
def setupUi(self, PolynomWindow):
|
def setupUi(self, PolynomWindow):
|
||||||
if not PolynomWindow.objectName():
|
if not PolynomWindow.objectName():
|
||||||
PolynomWindow.setObjectName(u"PolynomWindow")
|
PolynomWindow.setObjectName(u"PolynomWindow")
|
||||||
PolynomWindow.resize(630, 400)
|
PolynomWindow.resize(537, 444)
|
||||||
self.gridLayout_2 = QGridLayout(PolynomWindow)
|
self.gridLayout_2 = QGridLayout(PolynomWindow)
|
||||||
self.gridLayout_2.setObjectName(u"gridLayout_2")
|
self.gridLayout_2.setObjectName(u"gridLayout_2")
|
||||||
|
self.tabWidget = QTabWidget(PolynomWindow)
|
||||||
|
self.tabWidget.setObjectName(u"tabWidget")
|
||||||
|
self.model = QWidget()
|
||||||
|
self.model.setObjectName(u"model")
|
||||||
|
self.gridLayout_3 = QGridLayout(self.model)
|
||||||
|
self.gridLayout_3.setObjectName(u"gridLayout_3")
|
||||||
self.gridLayout = QGridLayout()
|
self.gridLayout = QGridLayout()
|
||||||
self.gridLayout.setObjectName(u"gridLayout")
|
self.gridLayout.setObjectName(u"gridLayout")
|
||||||
self.tableView = QTableView(PolynomWindow)
|
self.tableView = QTableView(self.model)
|
||||||
self.tableView.setObjectName(u"tableView")
|
self.tableView.setObjectName(u"tableView")
|
||||||
self.tableView.horizontalHeader().setMinimumSectionSize(40)
|
self.tableView.horizontalHeader().setMinimumSectionSize(40)
|
||||||
self.tableView.verticalHeader().setMinimumSectionSize(40)
|
self.tableView.verticalHeader().setMinimumSectionSize(40)
|
||||||
self.tableView.verticalHeader().setDefaultSectionSize(40)
|
self.tableView.verticalHeader().setDefaultSectionSize(40)
|
||||||
|
|
||||||
self.gridLayout.addWidget(self.tableView, 0, 0, 1, 1)
|
self.gridLayout.addWidget(self.tableView, 1, 3, 1, 1)
|
||||||
|
|
||||||
self.polynomResult = QGridLayout()
|
self.polynomResult = QGridLayout()
|
||||||
self.polynomResult.setObjectName(u"polynomResult")
|
self.polynomResult.setObjectName(u"polynomResult")
|
||||||
self.polynomResult.setContentsMargins(-1, 10, -1, -1)
|
self.polynomResult.setContentsMargins(-1, 10, -1, -1)
|
||||||
self.residualVarianceValueLabel = QLabel(PolynomWindow)
|
self.residualVarianceValueLabel = QLabel(self.model)
|
||||||
self.residualVarianceValueLabel.setObjectName(u"residualVarianceValueLabel")
|
self.residualVarianceValueLabel.setObjectName(u"residualVarianceValueLabel")
|
||||||
|
|
||||||
self.polynomResult.addWidget(self.residualVarianceValueLabel, 0, 1, 1, 1)
|
self.polynomResult.addWidget(self.residualVarianceValueLabel, 0, 1, 1, 1)
|
||||||
|
|
||||||
self.scaledResidualVarianceValueLabel = QLabel(PolynomWindow)
|
self.scaledResidualVarianceValueLabel = QLabel(self.model)
|
||||||
self.scaledResidualVarianceValueLabel.setObjectName(u"scaledResidualVarianceValueLabel")
|
self.scaledResidualVarianceValueLabel.setObjectName(u"scaledResidualVarianceValueLabel")
|
||||||
|
|
||||||
self.polynomResult.addWidget(self.scaledResidualVarianceValueLabel, 1, 1, 1, 1)
|
self.polynomResult.addWidget(self.scaledResidualVarianceValueLabel, 1, 1, 1, 1)
|
||||||
|
|
||||||
self.fStatisticLabel = QLabel(PolynomWindow)
|
self.fStatisticLabel = QLabel(self.model)
|
||||||
self.fStatisticLabel.setObjectName(u"fStatisticLabel")
|
self.fStatisticLabel.setObjectName(u"fStatisticLabel")
|
||||||
|
|
||||||
self.polynomResult.addWidget(self.fStatisticLabel, 2, 0, 1, 1)
|
self.polynomResult.addWidget(self.fStatisticLabel, 2, 0, 1, 1)
|
||||||
|
|
||||||
self.residualVarianceLabel = QLabel(PolynomWindow)
|
self.residualVarianceLabel = QLabel(self.model)
|
||||||
self.residualVarianceLabel.setObjectName(u"residualVarianceLabel")
|
self.residualVarianceLabel.setObjectName(u"residualVarianceLabel")
|
||||||
|
|
||||||
self.polynomResult.addWidget(self.residualVarianceLabel, 0, 0, 1, 1)
|
self.polynomResult.addWidget(self.residualVarianceLabel, 0, 0, 1, 1)
|
||||||
|
|
||||||
self.scaledResidualVarianceLabel = QLabel(PolynomWindow)
|
self.scaledResidualVarianceLabel = QLabel(self.model)
|
||||||
self.scaledResidualVarianceLabel.setObjectName(u"scaledResidualVarianceLabel")
|
self.scaledResidualVarianceLabel.setObjectName(u"scaledResidualVarianceLabel")
|
||||||
|
|
||||||
self.polynomResult.addWidget(self.scaledResidualVarianceLabel, 1, 0, 1, 1)
|
self.polynomResult.addWidget(self.scaledResidualVarianceLabel, 1, 0, 1, 1)
|
||||||
|
|
||||||
self.rSquaredLabel = QLabel(PolynomWindow)
|
self.rSquaredLabel = QLabel(self.model)
|
||||||
self.rSquaredLabel.setObjectName(u"rSquaredLabel")
|
self.rSquaredLabel.setObjectName(u"rSquaredLabel")
|
||||||
|
|
||||||
self.polynomResult.addWidget(self.rSquaredLabel, 3, 0, 1, 1)
|
self.polynomResult.addWidget(self.rSquaredLabel, 3, 0, 1, 1)
|
||||||
|
|
||||||
self.fStatisticValueLabel = QLabel(PolynomWindow)
|
self.fStatisticValueLabel = QLabel(self.model)
|
||||||
self.fStatisticValueLabel.setObjectName(u"fStatisticValueLabel")
|
self.fStatisticValueLabel.setObjectName(u"fStatisticValueLabel")
|
||||||
|
|
||||||
self.polynomResult.addWidget(self.fStatisticValueLabel, 2, 1, 1, 1)
|
self.polynomResult.addWidget(self.fStatisticValueLabel, 2, 1, 1, 1)
|
||||||
|
|
||||||
self.rSquaredValueLabel = QLabel(PolynomWindow)
|
self.rSquaredValueLabel = QLabel(self.model)
|
||||||
self.rSquaredValueLabel.setObjectName(u"rSquaredValueLabel")
|
self.rSquaredValueLabel.setObjectName(u"rSquaredValueLabel")
|
||||||
|
|
||||||
self.polynomResult.addWidget(self.rSquaredValueLabel, 3, 1, 1, 1)
|
self.polynomResult.addWidget(self.rSquaredValueLabel, 3, 1, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
self.gridLayout.addLayout(self.polynomResult, 1, 0, 1, 1)
|
self.gridLayout.addLayout(self.polynomResult, 2, 3, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
|
self.gridLayout_3.addLayout(self.gridLayout, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
self.tabWidget.addTab(self.model, "")
|
||||||
|
self.prediction = QWidget()
|
||||||
|
self.prediction.setObjectName(u"prediction")
|
||||||
|
self.gridLayout_4 = QGridLayout(self.prediction)
|
||||||
|
self.gridLayout_4.setObjectName(u"gridLayout_4")
|
||||||
|
self.predictionTableView = QTableView(self.prediction)
|
||||||
|
self.predictionTableView.setObjectName(u"predictionTableView")
|
||||||
|
self.predictionTableView.verticalHeader().setVisible(False)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
self.retranslateUi(PolynomWindow)
|
self.retranslateUi(PolynomWindow)
|
||||||
|
|
||||||
|
self.tabWidget.setCurrentIndex(0)
|
||||||
|
|
||||||
|
|
||||||
QMetaObject.connectSlotsByName(PolynomWindow)
|
QMetaObject.connectSlotsByName(PolynomWindow)
|
||||||
# setupUi
|
# setupUi
|
||||||
|
|
||||||
@@ -115,4 +149,7 @@ class Ui_PolynomWindow(object):
|
|||||||
self.rSquaredLabel.setText(QCoreApplication.translate("PolynomWindow", u"\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0434\u0435\u0440\u0435\u043c\u0438\u043d\u0438\u0437\u0430\u0446\u0438\u0438", None))
|
self.rSquaredLabel.setText(QCoreApplication.translate("PolynomWindow", u"\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0434\u0435\u0440\u0435\u043c\u0438\u043d\u0438\u0437\u0430\u0446\u0438\u0438", None))
|
||||||
self.fStatisticValueLabel.setText(QCoreApplication.translate("PolynomWindow", u"undefined", None))
|
self.fStatisticValueLabel.setText(QCoreApplication.translate("PolynomWindow", u"undefined", None))
|
||||||
self.rSquaredValueLabel.setText(QCoreApplication.translate("PolynomWindow", u"undefined", None))
|
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
|
# retranslateUi
|
||||||
|
2
statapp/ui/ui_variance_analysis_window.py
generated
2
statapp/ui/ui_variance_analysis_window.py
generated
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
@@ -59,8 +59,19 @@ def buildMessageBox(title, text, icon, buttons, defaultButton):
|
|||||||
msgBox.setStandardButtons(buttons)
|
msgBox.setStandardButtons(buttons)
|
||||||
msgBox.setDefaultButton(defaultButton)
|
msgBox.setDefaultButton(defaultButton)
|
||||||
|
|
||||||
|
addIcon(msgBox)
|
||||||
|
|
||||||
return msgBox
|
return msgBox
|
||||||
|
|
||||||
|
def onError(errorName: Exception):
|
||||||
|
msgBox = buildMessageBox \
|
||||||
|
('Ошибка',
|
||||||
|
"Упс.. Произошла ошибка:\n" + str(errorName),
|
||||||
|
QMessageBox.Critical,
|
||||||
|
QMessageBox.Ok,
|
||||||
|
QMessageBox.Ok)
|
||||||
|
|
||||||
|
msgBox.exec_()
|
||||||
|
|
||||||
class FloatDelegate(QStyledItemDelegate):
|
class FloatDelegate(QStyledItemDelegate):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
|
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
|
||||||
#
|
#
|
||||||
# This file is part of Statapp
|
# This file is part of Statapp
|
||||||
# (see https://github.com/shizand/statapp).
|
# (see https://github.com/shizand/statapp).
|
||||||
|
Reference in New Issue
Block a user