mirror of
https://github.com/shizand/statapp.git
synced 2024-12-23 20:22:58 +03:00
parent
dc7c4875d7
commit
b12db5a300
@ -9,8 +9,7 @@
|
|||||||
# See the GPL-3.0 license for details.
|
# See the GPL-3.0 license for details.
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import numpy as np
|
from numpy import linalg, zeros, ones, hstack, asarray
|
||||||
from numpy import linalg, zeros, ones, hstack, asarray, diagonal
|
|
||||||
from sympy import symbols, Mul, Add, S
|
from sympy import symbols, Mul, Add, S
|
||||||
|
|
||||||
|
|
||||||
@ -90,15 +89,7 @@ def multipolyfit(xs, y, deg, full=False, modelOut=False, powersOut=False):
|
|||||||
return beta, powers
|
return beta, powers
|
||||||
|
|
||||||
if full:
|
if full:
|
||||||
residues = result[1]
|
return result, powers, a
|
||||||
dof = len(a) - len(beta)
|
|
||||||
|
|
||||||
mse = residues / dof
|
|
||||||
cov = mse * diagonal(linalg.inv(a.T @ a))
|
|
||||||
se = np.sqrt(cov)
|
|
||||||
tStatistics = beta / se
|
|
||||||
|
|
||||||
return result, powers, tStatistics, mse
|
|
||||||
|
|
||||||
return beta
|
return beta
|
||||||
|
|
||||||
|
@ -66,54 +66,72 @@ class RegressionResult:
|
|||||||
Attributes:
|
Attributes:
|
||||||
paramsAndImportance (np.ndarray): Параметры модели. Первая колонка -
|
paramsAndImportance (np.ndarray): Параметры модели. Первая колонка -
|
||||||
residualVariance (np.float64): Остаточная дисперсия
|
residualVariance (np.float64): Остаточная дисперсия
|
||||||
|
scaledResidualVariance (np.float64): Остаточная дисперсия (масштабированная)
|
||||||
monomials (list): Список одночленов в строковом виде без коэффициентов. Свободный член - c
|
monomials (list): Список одночленов в строковом виде без коэффициентов. Свободный член - c
|
||||||
"""
|
"""
|
||||||
paramsAndImportance: np.ndarray
|
paramsAndImportance: np.ndarray
|
||||||
residualVariance: np.float64
|
residualVariance: np.float64
|
||||||
|
scaledResidualVariance: np.float64
|
||||||
|
rSquared: np.float64
|
||||||
|
fStatistic: np.float64
|
||||||
monomials: list
|
monomials: list
|
||||||
|
|
||||||
|
|
||||||
def linearPolynom(inputData) -> RegressionResult:
|
def commonPolynom(inputData, deg) -> RegressionResult:
|
||||||
x = inputData[:, 1:]
|
x = inputData[:, 1:]
|
||||||
y = inputData[:, 0]
|
y = inputData[:, 0]
|
||||||
data = pd.DataFrame(x)
|
result, powers, data = multipolyfit(x, y, deg, full=True)
|
||||||
data.insert(0, 'const', 1)
|
(out, mse, scaledResidualVariance,
|
||||||
# ---
|
rSquared, fStatistic) = calculateStats(data, result[0], result[1], y)
|
||||||
result = np.linalg.lstsq(data, y, rcond=None)
|
|
||||||
# Коэффициенты регрессии
|
return RegressionResult(
|
||||||
params = result[0]
|
out.to_numpy(),
|
||||||
# Остатки
|
np.float64(mse),
|
||||||
residues = result[1]
|
np.float64(scaledResidualVariance),
|
||||||
dof = len(data) - len(params)
|
np.float64(rSquared),
|
||||||
|
np.float64(fStatistic),
|
||||||
|
['c' if str(x) == '1' else str(x) for x in getTerms(powers)]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def linearPolynom(inputData) -> RegressionResult:
|
||||||
|
return commonPolynom(inputData, 1)
|
||||||
|
|
||||||
|
|
||||||
|
def squaredPolynom(inputData) -> RegressionResult:
|
||||||
|
return commonPolynom(inputData, 2)
|
||||||
|
|
||||||
|
|
||||||
|
def calculateStats(data, params, residues, y):
|
||||||
|
# pylint: disable-msg=too-many-locals
|
||||||
|
|
||||||
|
k = len(params) # Количество оцениваемых параметров (коэффициентов)
|
||||||
|
n = len(data) # Количество наблюдений
|
||||||
|
|
||||||
|
# Степень свободы (degrees of freedom) для остатков
|
||||||
|
dof = n - k # Количество наблюдений минус количество оцениваемых параметров
|
||||||
|
# Остаточная дисперсия (Mean Squared Error, MSE)
|
||||||
mse = residues / dof
|
mse = residues / dof
|
||||||
|
# Среднее значение остатков
|
||||||
|
meanResiduals = np.sum(residues) / dof
|
||||||
|
# Масштабированная остаточная дисперсия
|
||||||
|
scaledResidualVariance = residues / meanResiduals ** 2
|
||||||
|
# Ковариационная матрица коэффициентов
|
||||||
cov = mse * np.diagonal(np.linalg.inv(data.T @ data))
|
cov = mse * np.diagonal(np.linalg.inv(data.T @ data))
|
||||||
|
# Стандартные ошибки коэффициентов
|
||||||
se = np.sqrt(cov)
|
se = np.sqrt(cov)
|
||||||
|
# T-статистики для каждого коэффициента регрессии
|
||||||
tStatistics = params / se
|
tStatistics = params / se
|
||||||
|
|
||||||
# возможно стоит сделать через np.reshape + np.concatenate
|
# R-squared (коэффициент множественной детерминации)
|
||||||
|
sst = np.sum((y - np.mean(y)) ** 2) # Сумма квадратов отклонений
|
||||||
|
rSquared = 1 - (mse[0] / sst)
|
||||||
|
|
||||||
|
# F-statistic (статистика Фишера)
|
||||||
|
fStatistic = (rSquared / (k - 1)) / ((1 - rSquared) / (n - k))
|
||||||
|
|
||||||
out = pd.DataFrame()
|
out = pd.DataFrame()
|
||||||
out[0] = params
|
out[0] = params
|
||||||
out[1] = tStatistics
|
out[1] = tStatistics
|
||||||
|
|
||||||
return RegressionResult(
|
return out, mse[0], scaledResidualVariance, rSquared, fStatistic
|
||||||
out.to_numpy(),
|
|
||||||
np.float64(mse[0]),
|
|
||||||
['c'] + [f'x{i}' for i in range(1, len(params))]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def squaredPolynom(inputData):
|
|
||||||
x = inputData[:, 1:]
|
|
||||||
y = inputData[:, 0]
|
|
||||||
result, powers, tStatistics, mse = multipolyfit(x, y, 2, full=True)
|
|
||||||
betas = result[0]
|
|
||||||
|
|
||||||
out = pd.DataFrame()
|
|
||||||
out[0] = betas
|
|
||||||
out[1] = tStatistics
|
|
||||||
|
|
||||||
return RegressionResult(
|
|
||||||
out.to_numpy(),
|
|
||||||
np.float64(mse[0]),
|
|
||||||
['c' if str(x) == '1' else str(x) for x in getTerms(powers)]
|
|
||||||
)
|
|
||||||
|
@ -25,13 +25,13 @@ from PySide2.QtWidgets import QMainWindow, QMessageBox
|
|||||||
from statapp.calculations import generateXValues, generateYValues
|
from statapp.calculations import generateXValues, generateYValues
|
||||||
from statapp.constants import NUMBERS_PRECISION
|
from statapp.constants import NUMBERS_PRECISION
|
||||||
from statapp.generate_factor_window import GenerateFactorWindow
|
from statapp.generate_factor_window import GenerateFactorWindow
|
||||||
from statapp.linear_polynom_window import LinearPolynomWindow
|
from statapp.polynoms.linear_polynom_window import LinearPolynomWindow
|
||||||
from statapp.mathtex_header_view import MathTexHeaderView
|
from statapp.mathtex_header_view import MathTexHeaderView
|
||||||
from statapp.models.input_values_model import InputValuesModel
|
from statapp.models.input_values_model import InputValuesModel
|
||||||
from statapp.generate_window import GenerateWindow
|
from statapp.generate_window import GenerateWindow
|
||||||
from statapp.about_window import AboutWindow
|
from statapp.about_window import AboutWindow
|
||||||
from statapp.models.fileslc_model import FileSLCModel
|
from statapp.models.fileslc_model import FileSLCModel
|
||||||
from statapp.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
|
||||||
from statapp.variance_analysis import VarianceAnalysisWindow
|
from statapp.variance_analysis import VarianceAnalysisWindow
|
||||||
|
27
statapp/polynoms/linear_polynom_window.py
Normal file
27
statapp/polynoms/linear_polynom_window.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2023 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 statapp.calculations import linearPolynom
|
||||||
|
from statapp.polynoms.polynom_window import PolynomWindow
|
||||||
|
|
||||||
|
|
||||||
|
class LinearPolynomWindow(PolynomWindow):
|
||||||
|
def __init__(self, data):
|
||||||
|
result = linearPolynom(data)
|
||||||
|
super().__init__(result, "Линейный полином")
|
@ -18,22 +18,19 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
from PySide2.QtWidgets import QDialog, QHeaderView
|
from PySide2.QtWidgets import QDialog, QHeaderView
|
||||||
|
|
||||||
from statapp.calculations import linearPolynom
|
|
||||||
from statapp.mathtex_header_view import MathTexHeaderView
|
from statapp.mathtex_header_view import MathTexHeaderView
|
||||||
from statapp.models.regression_result_model import RegressionResultModel
|
from statapp.models.regression_result_model import RegressionResultModel
|
||||||
from statapp.ui.ui_linear_polynom_window import Ui_LinearPolynomWindow
|
from statapp.ui.ui_polynom_window import Ui_PolynomWindow
|
||||||
from statapp.utils import addIcon, FloatDelegate
|
from statapp.utils import addIcon, FloatDelegate
|
||||||
|
|
||||||
|
|
||||||
class LinearPolynomWindow(QDialog):
|
class PolynomWindow(QDialog):
|
||||||
def __init__(self, data):
|
def __init__(self, result, windowTitle):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.ui = Ui_LinearPolynomWindow()
|
self.ui = Ui_PolynomWindow()
|
||||||
self.ui.setupUi(self)
|
self.ui.setupUi(self)
|
||||||
addIcon(self)
|
addIcon(self)
|
||||||
|
self.setWindowTitle(windowTitle)
|
||||||
result = linearPolynom(data)
|
|
||||||
|
|
||||||
self.model = RegressionResultModel(result)
|
self.model = RegressionResultModel(result)
|
||||||
self.ui.tableView.setItemDelegate(FloatDelegate())
|
self.ui.tableView.setItemDelegate(FloatDelegate())
|
||||||
@ -43,3 +40,6 @@ class LinearPolynomWindow(QDialog):
|
|||||||
header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch)
|
header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch)
|
||||||
|
|
||||||
self.ui.residualVarianceValueLabel.setText(str(result.residualVariance))
|
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))
|
27
statapp/polynoms/squared_polynom_window.py
Normal file
27
statapp/polynoms/squared_polynom_window.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2023 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 statapp.calculations import squaredPolynom
|
||||||
|
from statapp.polynoms.polynom_window import PolynomWindow
|
||||||
|
|
||||||
|
|
||||||
|
class SquaredPolynomWindow(PolynomWindow):
|
||||||
|
def __init__(self, data):
|
||||||
|
result = squaredPolynom(data)
|
||||||
|
super().__init__(result, "Квадратичный полином")
|
@ -1,45 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2023 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.QtWidgets import QDialog, QHeaderView
|
|
||||||
|
|
||||||
from statapp.calculations import squaredPolynom
|
|
||||||
from statapp.mathtex_header_view import MathTexHeaderView
|
|
||||||
from statapp.models.regression_result_model import RegressionResultModel
|
|
||||||
from statapp.ui.ui_squared_polynom_window import Ui_SquaredPolynomWindow
|
|
||||||
from statapp.utils import addIcon, FloatDelegate
|
|
||||||
|
|
||||||
|
|
||||||
class SquaredPolynomWindow(QDialog):
|
|
||||||
def __init__(self, data):
|
|
||||||
super().__init__()
|
|
||||||
self.ui = Ui_SquaredPolynomWindow()
|
|
||||||
self.ui.setupUi(self)
|
|
||||||
addIcon(self)
|
|
||||||
|
|
||||||
result = squaredPolynom(data)
|
|
||||||
|
|
||||||
self.model = RegressionResultModel(result)
|
|
||||||
self.ui.tableView.setItemDelegate(FloatDelegate())
|
|
||||||
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))
|
|
@ -1,59 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>LinearPolynomWindow</class>
|
|
||||||
<widget class="QDialog" name="LinearPolynomWindow">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>630</width>
|
|
||||||
<height>400</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Линейный полином</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QTableView" name="tableView">
|
|
||||||
<attribute name="horizontalHeaderMinimumSectionSize">
|
|
||||||
<number>40</number>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="verticalHeaderMinimumSectionSize">
|
|
||||||
<number>40</number>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="verticalHeaderDefaultSectionSize">
|
|
||||||
<number>40</number>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="residualVarianceLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Остаточная дисперсия:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLabel" name="residualVarianceValueLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>undefined</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
101
statapp/ui/polynom_window.ui
Normal file
101
statapp/ui/polynom_window.ui
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>PolynomWindow</class>
|
||||||
|
<widget class="QDialog" name="PolynomWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>630</width>
|
||||||
|
<height>400</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Полином</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QTableView" name="tableView">
|
||||||
|
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||||
|
<number>40</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderMinimumSectionSize">
|
||||||
|
<number>40</number>
|
||||||
|
</attribute>
|
||||||
|
<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">
|
||||||
|
<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>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -1,49 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>SquaredPolynomWindow</class>
|
|
||||||
<widget class="QDialog" name="SquaredPolynomWindow">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>630</width>
|
|
||||||
<height>400</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Квадратичный полином</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QTableView" name="tableView"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="residualVarianceLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Остаточная дисперсия:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLabel" name="residualVarianceValueLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>undefined</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
82
statapp/ui/ui_linear_polynom_window.py
generated
82
statapp/ui/ui_linear_polynom_window.py
generated
@ -1,82 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2023 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/>.
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Form generated from reading UI file 'linear_polynom_window.ui'
|
|
||||||
##
|
|
||||||
## Created by: Qt User Interface Compiler version 5.15.2
|
|
||||||
##
|
|
||||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
from PySide2.QtCore import *
|
|
||||||
from PySide2.QtGui import *
|
|
||||||
from PySide2.QtWidgets import *
|
|
||||||
|
|
||||||
|
|
||||||
class Ui_LinearPolynomWindow(object):
|
|
||||||
def setupUi(self, LinearPolynomWindow):
|
|
||||||
if not LinearPolynomWindow.objectName():
|
|
||||||
LinearPolynomWindow.setObjectName(u"LinearPolynomWindow")
|
|
||||||
LinearPolynomWindow.resize(630, 400)
|
|
||||||
self.gridLayout_2 = QGridLayout(LinearPolynomWindow)
|
|
||||||
self.gridLayout_2.setObjectName(u"gridLayout_2")
|
|
||||||
self.gridLayout = QGridLayout()
|
|
||||||
self.gridLayout.setObjectName(u"gridLayout")
|
|
||||||
self.tableView = QTableView(LinearPolynomWindow)
|
|
||||||
self.tableView.setObjectName(u"tableView")
|
|
||||||
self.tableView.horizontalHeader().setMinimumSectionSize(40)
|
|
||||||
self.tableView.verticalHeader().setMinimumSectionSize(40)
|
|
||||||
self.tableView.verticalHeader().setDefaultSectionSize(40)
|
|
||||||
|
|
||||||
self.gridLayout.addWidget(self.tableView, 0, 0, 1, 1)
|
|
||||||
|
|
||||||
self.gridLayout_3 = QGridLayout()
|
|
||||||
self.gridLayout_3.setObjectName(u"gridLayout_3")
|
|
||||||
self.gridLayout_3.setContentsMargins(-1, 10, -1, -1)
|
|
||||||
self.residualVarianceLabel = QLabel(LinearPolynomWindow)
|
|
||||||
self.residualVarianceLabel.setObjectName(u"residualVarianceLabel")
|
|
||||||
|
|
||||||
self.gridLayout_3.addWidget(self.residualVarianceLabel, 0, 0, 1, 1)
|
|
||||||
|
|
||||||
self.residualVarianceValueLabel = QLabel(LinearPolynomWindow)
|
|
||||||
self.residualVarianceValueLabel.setObjectName(u"residualVarianceValueLabel")
|
|
||||||
|
|
||||||
self.gridLayout_3.addWidget(self.residualVarianceValueLabel, 0, 1, 1, 1)
|
|
||||||
|
|
||||||
|
|
||||||
self.gridLayout.addLayout(self.gridLayout_3, 1, 0, 1, 1)
|
|
||||||
|
|
||||||
|
|
||||||
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
|
|
||||||
|
|
||||||
|
|
||||||
self.retranslateUi(LinearPolynomWindow)
|
|
||||||
|
|
||||||
QMetaObject.connectSlotsByName(LinearPolynomWindow)
|
|
||||||
# setupUi
|
|
||||||
|
|
||||||
def retranslateUi(self, LinearPolynomWindow):
|
|
||||||
LinearPolynomWindow.setWindowTitle(QCoreApplication.translate("LinearPolynomWindow", u"\u041b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043f\u043e\u043b\u0438\u043d\u043e\u043c", None))
|
|
||||||
self.residualVarianceLabel.setText(QCoreApplication.translate("LinearPolynomWindow", u"\u041e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f:", None))
|
|
||||||
self.residualVarianceValueLabel.setText(QCoreApplication.translate("LinearPolynomWindow", u"undefined", None))
|
|
||||||
# retranslateUi
|
|
118
statapp/ui/ui_polynom_window.py
generated
Normal file
118
statapp/ui/ui_polynom_window.py
generated
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright (c) 2023 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/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
## Form generated from reading UI file 'polynom_window.ui'
|
||||||
|
##
|
||||||
|
## Created by: Qt User Interface Compiler version 5.15.2
|
||||||
|
##
|
||||||
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
from PySide2.QtCore import *
|
||||||
|
from PySide2.QtGui import *
|
||||||
|
from PySide2.QtWidgets import *
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_PolynomWindow(object):
|
||||||
|
def setupUi(self, PolynomWindow):
|
||||||
|
if not PolynomWindow.objectName():
|
||||||
|
PolynomWindow.setObjectName(u"PolynomWindow")
|
||||||
|
PolynomWindow.resize(630, 400)
|
||||||
|
self.gridLayout_2 = QGridLayout(PolynomWindow)
|
||||||
|
self.gridLayout_2.setObjectName(u"gridLayout_2")
|
||||||
|
self.gridLayout = QGridLayout()
|
||||||
|
self.gridLayout.setObjectName(u"gridLayout")
|
||||||
|
self.tableView = QTableView(PolynomWindow)
|
||||||
|
self.tableView.setObjectName(u"tableView")
|
||||||
|
self.tableView.horizontalHeader().setMinimumSectionSize(40)
|
||||||
|
self.tableView.verticalHeader().setMinimumSectionSize(40)
|
||||||
|
self.tableView.verticalHeader().setDefaultSectionSize(40)
|
||||||
|
|
||||||
|
self.gridLayout.addWidget(self.tableView, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
self.polynomResult = QGridLayout()
|
||||||
|
self.polynomResult.setObjectName(u"polynomResult")
|
||||||
|
self.polynomResult.setContentsMargins(-1, 10, -1, -1)
|
||||||
|
self.residualVarianceValueLabel = QLabel(PolynomWindow)
|
||||||
|
self.residualVarianceValueLabel.setObjectName(u"residualVarianceValueLabel")
|
||||||
|
|
||||||
|
self.polynomResult.addWidget(self.residualVarianceValueLabel, 0, 1, 1, 1)
|
||||||
|
|
||||||
|
self.scaledResidualVarianceValueLabel = QLabel(PolynomWindow)
|
||||||
|
self.scaledResidualVarianceValueLabel.setObjectName(u"scaledResidualVarianceValueLabel")
|
||||||
|
|
||||||
|
self.polynomResult.addWidget(self.scaledResidualVarianceValueLabel, 1, 1, 1, 1)
|
||||||
|
|
||||||
|
self.fStatisticLabel = QLabel(PolynomWindow)
|
||||||
|
self.fStatisticLabel.setObjectName(u"fStatisticLabel")
|
||||||
|
|
||||||
|
self.polynomResult.addWidget(self.fStatisticLabel, 2, 0, 1, 1)
|
||||||
|
|
||||||
|
self.residualVarianceLabel = QLabel(PolynomWindow)
|
||||||
|
self.residualVarianceLabel.setObjectName(u"residualVarianceLabel")
|
||||||
|
|
||||||
|
self.polynomResult.addWidget(self.residualVarianceLabel, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
self.scaledResidualVarianceLabel = QLabel(PolynomWindow)
|
||||||
|
self.scaledResidualVarianceLabel.setObjectName(u"scaledResidualVarianceLabel")
|
||||||
|
|
||||||
|
self.polynomResult.addWidget(self.scaledResidualVarianceLabel, 1, 0, 1, 1)
|
||||||
|
|
||||||
|
self.rSquaredLabel = QLabel(PolynomWindow)
|
||||||
|
self.rSquaredLabel.setObjectName(u"rSquaredLabel")
|
||||||
|
|
||||||
|
self.polynomResult.addWidget(self.rSquaredLabel, 3, 0, 1, 1)
|
||||||
|
|
||||||
|
self.fStatisticValueLabel = QLabel(PolynomWindow)
|
||||||
|
self.fStatisticValueLabel.setObjectName(u"fStatisticValueLabel")
|
||||||
|
|
||||||
|
self.polynomResult.addWidget(self.fStatisticValueLabel, 2, 1, 1, 1)
|
||||||
|
|
||||||
|
self.rSquaredValueLabel = QLabel(PolynomWindow)
|
||||||
|
self.rSquaredValueLabel.setObjectName(u"rSquaredValueLabel")
|
||||||
|
|
||||||
|
self.polynomResult.addWidget(self.rSquaredValueLabel, 3, 1, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
self.gridLayout.addLayout(self.polynomResult, 1, 0, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
self.retranslateUi(PolynomWindow)
|
||||||
|
|
||||||
|
QMetaObject.connectSlotsByName(PolynomWindow)
|
||||||
|
# setupUi
|
||||||
|
|
||||||
|
def retranslateUi(self, PolynomWindow):
|
||||||
|
PolynomWindow.setWindowTitle(QCoreApplication.translate("PolynomWindow", u"\u041f\u043e\u043b\u0438\u043d\u043e\u043c", None))
|
||||||
|
self.residualVarianceValueLabel.setText(QCoreApplication.translate("PolynomWindow", u"undefined", None))
|
||||||
|
self.scaledResidualVarianceValueLabel.setText(QCoreApplication.translate("PolynomWindow", u"undefined", None))
|
||||||
|
self.fStatisticLabel.setText(QCoreApplication.translate("PolynomWindow", u"F1 - \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0424\u0438\u0448\u0435\u0440\u0430", None))
|
||||||
|
self.residualVarianceLabel.setText(QCoreApplication.translate("PolynomWindow", u"\u041e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f:", None))
|
||||||
|
self.scaledResidualVarianceLabel.setText(QCoreApplication.translate("PolynomWindow", u"\u041e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f (\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f):", 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.rSquaredValueLabel.setText(QCoreApplication.translate("PolynomWindow", u"undefined", None))
|
||||||
|
# retranslateUi
|
79
statapp/ui/ui_squared_polynom_window.py
generated
79
statapp/ui/ui_squared_polynom_window.py
generated
@ -1,79 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
#
|
|
||||||
# Copyright (c) 2023 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/>.
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Form generated from reading UI file 'squared_polynom_window.ui'
|
|
||||||
##
|
|
||||||
## Created by: Qt User Interface Compiler version 5.15.2
|
|
||||||
##
|
|
||||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
from PySide2.QtCore import *
|
|
||||||
from PySide2.QtGui import *
|
|
||||||
from PySide2.QtWidgets import *
|
|
||||||
|
|
||||||
|
|
||||||
class Ui_SquaredPolynomWindow(object):
|
|
||||||
def setupUi(self, SquaredPolynomWindow):
|
|
||||||
if not SquaredPolynomWindow.objectName():
|
|
||||||
SquaredPolynomWindow.setObjectName(u"SquaredPolynomWindow")
|
|
||||||
SquaredPolynomWindow.resize(630, 400)
|
|
||||||
self.gridLayout_2 = QGridLayout(SquaredPolynomWindow)
|
|
||||||
self.gridLayout_2.setObjectName(u"gridLayout_2")
|
|
||||||
self.gridLayout = QGridLayout()
|
|
||||||
self.gridLayout.setObjectName(u"gridLayout")
|
|
||||||
self.tableView = QTableView(SquaredPolynomWindow)
|
|
||||||
self.tableView.setObjectName(u"tableView")
|
|
||||||
|
|
||||||
self.gridLayout.addWidget(self.tableView, 0, 0, 1, 1)
|
|
||||||
|
|
||||||
self.gridLayout_3 = QGridLayout()
|
|
||||||
self.gridLayout_3.setObjectName(u"gridLayout_3")
|
|
||||||
self.gridLayout_3.setContentsMargins(-1, 10, -1, -1)
|
|
||||||
self.residualVarianceLabel = QLabel(SquaredPolynomWindow)
|
|
||||||
self.residualVarianceLabel.setObjectName(u"residualVarianceLabel")
|
|
||||||
|
|
||||||
self.gridLayout_3.addWidget(self.residualVarianceLabel, 0, 0, 1, 1)
|
|
||||||
|
|
||||||
self.residualVarianceValueLabel = QLabel(SquaredPolynomWindow)
|
|
||||||
self.residualVarianceValueLabel.setObjectName(u"residualVarianceValueLabel")
|
|
||||||
|
|
||||||
self.gridLayout_3.addWidget(self.residualVarianceValueLabel, 0, 1, 1, 1)
|
|
||||||
|
|
||||||
|
|
||||||
self.gridLayout.addLayout(self.gridLayout_3, 1, 0, 1, 1)
|
|
||||||
|
|
||||||
|
|
||||||
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
|
|
||||||
|
|
||||||
|
|
||||||
self.retranslateUi(SquaredPolynomWindow)
|
|
||||||
|
|
||||||
QMetaObject.connectSlotsByName(SquaredPolynomWindow)
|
|
||||||
# setupUi
|
|
||||||
|
|
||||||
def retranslateUi(self, SquaredPolynomWindow):
|
|
||||||
SquaredPolynomWindow.setWindowTitle(QCoreApplication.translate("SquaredPolynomWindow", u"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u043b\u0438\u043d\u043e\u043c", None))
|
|
||||||
self.residualVarianceLabel.setText(QCoreApplication.translate("SquaredPolynomWindow", u"\u041e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0430\u044f \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u044f:", None))
|
|
||||||
self.residualVarianceValueLabel.setText(QCoreApplication.translate("SquaredPolynomWindow", u"undefined", None))
|
|
||||||
# retranslateUi
|
|
Loading…
Reference in New Issue
Block a user