-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: добавлен "Линейный полином" (#74)
- Loading branch information
Showing
12 changed files
with
309 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,5 @@ def main(): | |
window.show() | ||
return app.exec_() | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# 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 linearPolynom | ||
from statapp.models.linear_polynom_model import LinearPolynomModel | ||
from statapp.ui.ui_linear_polynom_window import Ui_LinearPolynomWindow | ||
from statapp.utils import addIcon | ||
|
||
|
||
class LinearPolynomWindow(QDialog): | ||
def __init__(self, data): | ||
super().__init__() | ||
self.ui = Ui_LinearPolynomWindow() | ||
self.ui.setupUi(self) | ||
addIcon(self) | ||
|
||
result = linearPolynom(data) | ||
|
||
self.model = LinearPolynomModel(result.paramsAndImportance.round(2)) | ||
self.ui.tableView.setModel(self.model) | ||
header = self.ui.tableView.horizontalHeader() | ||
header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch) | ||
|
||
self.ui.residualVarianceValueLabel.setText(str(result.residualVariance)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# | ||
# 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.QtCore import QModelIndex | ||
|
||
from statapp.models.ro_table_model import ROTableModel | ||
|
||
|
||
class LinearPolynomModel(ROTableModel): | ||
def getHorizontalHeader(self): | ||
return ['Коэффициент регрессии', 'Коэффициент значимости'] | ||
|
||
def getVerticalHeader(self): | ||
count = (self.rowCount(QModelIndex())) | ||
return ['Свободный член'] + [f'X{i}' for i in range(1, count)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?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"/> | ||
</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.