Compare commits

...

99 Commits
v0.3.5 ... main

Author SHA1 Message Date
github-actions[bot]
08fd512a79
chore(main): release 0.13.0 (#125)
🤖 I have created a release *beep* *boop*
---


##
[0.13.0](https://github.com/shizand/statapp/compare/v0.12.5...v0.13.0)
(2024-02-29)


### Новые функции

* добавлены весовые коэффициенты
([#126](https://github.com/shizand/statapp/issues/126))
([1900785](1900785502))


### Исправления

* исправлена "Остаточная дисперсия (масштабированная)"
([#124](https://github.com/shizand/statapp/issues/124))
([babfd48](babfd48ee1))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-29 21:39:28 +03:00
1900785502
feat: добавлены весовые коэффициенты (#126) 2024-02-29 21:16:55 +03:00
babfd48ee1
fix: исправлена "Остаточная дисперсия (масштабированная)" (#124) 2024-02-29 19:14:03 +03:00
github-actions[bot]
7ad23735ce
chore(main): release 0.12.5 (#123)
🤖 I have created a release *beep* *boop*
---


##
[0.12.5](https://github.com/shizand/statapp/compare/v0.12.4...v0.12.5)
(2024-02-22)


### Исправления

* заменён алгоритм моделирования полиномов и исправлен прогноз
([#122](https://github.com/shizand/statapp/issues/122))
([f17644d](f17644dd15))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-22 20:37:37 +03:00
ba7449544d chore: попытка исправить сборку 2024-02-22 20:03:52 +03:00
771bf66d79 chore: попытка исправить сборку 2024-02-22 19:50:01 +03:00
3cf58f5af7 chore: попытка исправить сборку 2024-02-22 19:33:37 +03:00
5f2cc93353 chore: попытка исправить сборку 2024-02-22 19:12:00 +03:00
a3970b827c chore: попытка исправить сборку 2024-02-22 19:09:05 +03:00
aaeb86e780 chore: попытка исправить сборку 2024-02-22 18:33:49 +03:00
ce95ae94ae chore: попытка исправить сборку 2024-02-22 18:20:59 +03:00
cc7e24f5d8 chore: попытка исправить сборку 2024-02-22 16:22:21 +03:00
8e95b41c2b chore: попытка исправить сборку 2024-02-22 16:14:54 +03:00
9e5125c1db chore: попытка исправить сборку 2024-02-22 15:56:04 +03:00
04cafcf13c chore: попытка исправить сборку 2024-02-22 15:45:56 +03:00
f17644dd15
fix: заменён алгоритм моделирования полиномов и исправлен прогноз (#122) 2024-02-22 15:15:56 +03:00
github-actions[bot]
23edbdf371
chore(main): release 0.12.4 (#121)
🤖 I have created a release *beep* *boop*
---


##
[0.12.4](https://github.com/shizand/statapp/compare/v0.12.3...v0.12.4)
(2024-02-15)


### Исправления

* исправлен вывод коэффициента множественной детерминации в
"Преобразования"
([da68523](da68523913))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-15 14:32:22 +03:00
da68523913 fix: исправлен вывод коэффициента множественной детерминации в "Преобразования" 2024-02-15 14:23:59 +03:00
bc4c46a050 Merge branch 'main' of https://github.com/shizand/statapp 2024-02-15 13:52:53 +03:00
d361c06985 удален .idea
Closes #115
2024-02-15 13:52:15 +03:00
github-actions[bot]
c69229ce28
chore(main): release 0.12.3 (#120)
🤖 I have created a release *beep* *boop*
---


##
[0.12.3](https://github.com/shizand/statapp/compare/v0.12.2...v0.12.3)
(2024-02-14)


### Исправления

* добавлен более подробный вывод ошибок в консоль
([780d5b3](780d5b30fd))
* исправлен вывод коэффициента множественной детерминации
([260cc99](260cc99afa))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-14 15:47:17 +03:00
780d5b30fd fix: добавлен более подробный вывод ошибок в консоль 2024-02-14 15:40:41 +03:00
d6c03ca3c8 Merge remote-tracking branch 'origin/main' 2024-02-14 15:33:45 +03:00
260cc99afa fix: исправлен вывод коэффициента множественной детерминации 2024-02-14 15:33:24 +03:00
github-actions[bot]
3f1bd27535
chore(main): release 0.12.2 (#119)
🤖 I have created a release *beep* *boop*
---


##
[0.12.2](https://github.com/shizand/statapp/compare/v0.12.1...v0.12.2)
(2024-02-12)


### Исправления

* Добавлены краткие теоретические сведения README
([34bcee2](34bcee2acf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-12 16:46:13 +03:00
34bcee2acf fix: Добавлены краткие теоретические сведения README 2024-02-12 16:25:26 +03:00
github-actions[bot]
78f59a4574
chore(main): release 0.12.1 (#118)
🤖 I have created a release *beep* *boop*
---


##
[0.12.1](https://github.com/shizand/statapp/compare/v0.12.0...v0.12.1)
(2024-02-11)


### Исправления

* добавлено отключение "Распределения" при отсутствии отклика
([8ca535c](8ca535cc8f))
* исправлены ссылки на некоторую дополнительную литературу
([c23e1f8](c23e1f81a9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-11 22:03:35 +03:00
8ca535cc8f fix: добавлено отключение "Распределения" при отсутствии отклика 2024-02-11 21:54:46 +03:00
918cd6fb9b Merge remote-tracking branch 'origin/main' 2024-02-11 21:46:00 +03:00
c23e1f81a9 fix: исправлены ссылки на некоторую дополнительную литературу 2024-02-11 21:45:50 +03:00
github-actions[bot]
8ba4c15f08
chore(main): release 0.12.0 (#109)
🤖 I have created a release *beep* *boop*
---


##
[0.12.0](https://github.com/shizand/statapp/compare/v0.11.0...v0.12.0)
(2024-02-11)


### Новые функции

* Добавлена дополнительная литература
([#117](https://github.com/shizand/statapp/issues/117))
([ded55cb](ded55cb5d7)),
closes [#114](https://github.com/shizand/statapp/issues/114)
* добавлены "Распределения"
([#116](https://github.com/shizand/statapp/issues/116))
([981580f](981580f46d)),
closes [#111](https://github.com/shizand/statapp/issues/111)
[#112](https://github.com/shizand/statapp/issues/112)


### Исправления

* Дополнил README
([9766ecb](9766ecb7f5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-11 21:30:32 +03:00
db4e791823 chore: try fix 2024-02-11 21:22:08 +03:00
981580f46d
feat: добавлены "Распределения" (#116)
Closes #110 
Closes #111
Closes #112
2024-02-11 21:09:52 +03:00
ded55cb5d7
feat: Добавлена дополнительная литература (#117)
Closes #114
2024-02-11 21:08:52 +03:00
9766ecb7f5 fix: Дополнил README 2024-02-05 11:38:09 +03:00
github-actions[bot]
8b09a76b32
chore(main): release 0.11.0 (#107)
🤖 I have created a release *beep* *boop*
---


##
[0.11.0](https://github.com/shizand/statapp/compare/v0.10.2...v0.11.0)
(2024-02-03)


### Новые функции

* добавлен пункт "Использование"
([#108](https://github.com/shizand/statapp/issues/108))
([aafa5a0](aafa5a0ebb)),
closes [#70](https://github.com/shizand/statapp/issues/70)
* добавлена возможность удалить факторы
([#103](https://github.com/shizand/statapp/issues/103))
([30447a8](30447a801a)),
closes [#102](https://github.com/shizand/statapp/issues/102)


### Исправления

* добавлена легенда графика
([#104](https://github.com/shizand/statapp/issues/104))
([240a517](240a517dd6)),
closes [#101](https://github.com/shizand/statapp/issues/101)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-03 18:05:02 +03:00
aafa5a0ebb
feat: добавлен пункт "Использование" (#108)
Closes #70
2024-02-03 17:57:49 +03:00
30447a801a
feat: добавлена возможность удалить факторы (#103)
Closes #102
2024-02-03 16:20:33 +03:00
240a517dd6
fix: добавлена легенда графика (#104)
Closes #101
2024-02-03 16:20:23 +03:00
27c1455120 docs: Добавлен README.html 2024-02-03 15:33:01 +03:00
63f80819d2 docs: Обновлён README.md 2024-02-03 15:06:35 +03:00
d0053df261
docs: обновлён README.md (#106)
Co-authored-by: MisterMLiL <eugenelazurenko@gmail.com>
2024-02-03 14:49:25 +03:00
fcddf84839
docs: добавлена документация (#105)
Co-authored-by: MisterMLiL <eugenelazurenko@gmail.com>
2024-02-03 14:39:34 +03:00
github-actions[bot]
6b18bb1f82
chore(main): release 0.10.2 (#100)
🤖 I have created a release *beep* *boop*
---


##
[0.10.2](https://github.com/shizand/statapp/compare/v0.10.1...v0.10.2)
(2024-02-01)


### Исправления

* исправлена опечатка в характеристиках модели
([871d9ad](871d9ad746))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-01 17:52:03 +03:00
871d9ad746 fix: исправлена опечатка в характеристиках модели 2024-02-01 17:30:10 +03:00
github-actions[bot]
71e68a645d
chore(main): release 0.10.1 (#99)
🤖 I have created a release *beep* *boop*
---


##
[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](c36e1aa733))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-29 11:19:48 +03:00
MisterMLiL
c36e1aa733
fix: Добавлена обработка ошибок (#98)
Closes #83
Closes #96
Closes #97 

Добавлена обобщенная обработка на большинство методов.
Один из вариантов временно (а может и постоянно)  решить проблемы.
2024-01-29 11:11:53 +03:00
github-actions[bot]
1c88acf772
chore(main): release 0.10.0 (#95)
🤖 I have created a release *beep* *boop*
---


## [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](bb1b2f1ec5)),
closes [#86](https://github.com/shizand/statapp/issues/86)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-08 18:57:33 +03:00
bb1b2f1ec5
feat: добавлен график (#94)
Closes #86
2024-01-08 16:09:12 +03:00
github-actions[bot]
7cbb93e37c
chore(main): release 0.9.0 (#93)
🤖 I have created a release *beep* *boop*
---


## [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](8ea3cffa7e)),
closes [#85](https://github.com/shizand/statapp/issues/85)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-02 17:29:45 +03:00
8ea3cffa7e
feat: добавлен "Прогноз" (#92)
Closes #85
2024-01-02 17:22:59 +03:00
github-actions[bot]
51fc413fca
chore(main): release 0.8.0 (#91)
🤖 I have created a release *beep* *boop*
---


## [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](f70be431cf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-31 10:17:56 +03:00
f70be431cf
feat: добавлены преобразования (#90)
Closes #41

---------

Co-authored-by: MisterMLiL <eugenelazurenko@gmail.com>
2023-12-31 10:12:01 +03:00
github-actions[bot]
4f1f610822
chore(main): release 0.7.0 (#88)
🤖 I have created a release *beep* *boop*
---


## [0.7.0](https://github.com/shizand/statapp/compare/v0.6.0...v0.7.0)
(2023-12-01)


### Новые функции

* добавлена возможность ввода чисел до 5 знаков
([#87](https://github.com/shizand/statapp/issues/87))
([dc7c487](dc7c4875d7)),
closes [#82](https://github.com/shizand/statapp/issues/82)
* Добавлены новые характеристики
([#89](https://github.com/shizand/statapp/issues/89))
([b12db5a](b12db5a300)),
closes [#84](https://github.com/shizand/statapp/issues/84)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-01 14:11:49 +03:00
b12db5a300
feat: Добавлены новые характеристики (#89)
Closes #84
2023-12-01 14:03:20 +03:00
dc7c4875d7
feat: добавлена возможность ввода чисел до 5 знаков (#87)
Closes #82
2023-11-25 14:21:05 +03:00
2f5988a2eb
chore: исправляет форматирование 2023-10-25 17:11:09 +03:00
9348138094
chore: исправляет описание в "Установка" 2023-10-25 17:09:30 +03:00
c35b9ca308
chore: исправляет опечатки 2023-10-25 15:58:06 +03:00
e6ba0fc610 ci: Revert "добавил сборку linux x86"
This reverts commit 4be89269b9.
2023-10-20 14:46:57 +03:00
cddacb21b2 Merge remote-tracking branch 'origin/main' 2023-10-20 14:20:27 +03:00
4be89269b9 ci: добавил сборку linux x86 2023-10-20 14:20:12 +03:00
github-actions[bot]
9f7181513b
chore(main): release 0.6.0 (#80)
🤖 I have created a release *beep* *boop*
---


## [0.6.0](https://github.com/shizand/statapp/compare/v0.5.0...v0.6.0)
(2023-10-20)


### Новые функции

* добавлен "Квадратичный полином"
([#81](https://github.com/shizand/statapp/issues/81))
([9033770](9033770406))


### Исправления

* исправлен формат сохранения файлов
([#79](https://github.com/shizand/statapp/issues/79))
([044d2b6](044d2b61cf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-20 13:53:26 +03:00
725289ca06 chore: понизил версию Pillow 2023-10-20 13:47:45 +03:00
a6cda1ab3d chore: удалена отладка 2023-10-20 13:47:15 +03:00
9033770406
feat: добавлен "Квадратичный полином" (#81)
Closes #34.
2023-10-20 13:26:49 +03:00
MisterMLiL
044d2b61cf
fix: исправлен формат сохранения файлов (#79) 2023-10-13 22:06:24 +03:00
github-actions[bot]
dd765ae981
chore(main): release 0.5.0 (#75)
🤖 I have created a release *beep* *boop*
---


## [0.5.0](https://github.com/shizand/statapp/compare/v0.4.2...v0.5.0)
(2023-10-06)


### Новые функции

* добавлен "Линейный полином"
([#74](https://github.com/shizand/statapp/issues/74))
([232de9f](232de9f145))


### Исправления

* добавлены переводы для QMessageBox
([#73](https://github.com/shizand/statapp/issues/73))
([e653c3d](e653c3df29))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-06 09:51:47 +03:00
bdb346fd17 ci: try fix ci 2023-10-06 09:44:00 +03:00
79297850df ci: try fix ci 2023-10-06 09:23:03 +03:00
232de9f145
feat: добавлен "Линейный полином" (#74) 2023-10-05 21:28:11 +03:00
e653c3df29
fix: добавлены переводы для QMessageBox (#73) 2023-10-05 21:27:51 +03:00
a89d7896e3
refactor: исправлены ВСЕ замечания pylint (#72) 2023-10-04 14:38:42 +03:00
d387a79d6d ci: fix version 2023-10-04 14:29:32 +03:00
dd3ab2e1cf ci: добавляет permissions для labeler 2023-10-04 14:21:58 +03:00
2115490b2c ci: добавляет labeler 2023-10-04 14:20:28 +03:00
d89837e34a chore: заменил codacy badge 2023-10-04 09:04:23 +03:00
af8d9cbdde chore: добавил too-few-public-methods 2023-10-04 09:02:24 +03:00
18157b9e82 chore: переименовал файл pylint 2023-10-04 08:55:13 +03:00
25bc63ee51
chore: добавлен pylint (#71) 2023-10-04 08:42:16 +03:00
fea99f0985
chore: добавлен файл README.md (#69)
Closes #26.

---------

Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
2023-10-03 20:49:35 +03:00
github-actions[bot]
390dbdc087
chore(main): release 0.4.2 (#68)
🤖 I have created a release *beep* *boop*
---


## [0.4.2](https://github.com/shizand/statapp/compare/v0.4.1...v0.4.2)
(2023-10-03)


### Исправления

* добавлены иконки во все окна
([#67](https://github.com/shizand/statapp/issues/67))
([9310a5e](9310a5e622))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-03 18:41:46 +03:00
MisterMLiL
9310a5e622
fix: добавлены иконки во все окна (#67)
Closes #65

---------

Co-authored-by: Maxim Slipenko <no-reply@maxim.slipenko.com>
2023-10-03 18:18:32 +03:00
github-actions[bot]
1d76b7cb76
chore(main): release 0.4.1 (#64)
🤖 I have created a release *beep* *boop*
---


## [0.4.1](https://github.com/shizand/statapp/compare/v0.4.0...v0.4.1)
(2023-10-03)


### Исправления

* исправлена ошибка "Все кнопки заблокированы"
([#63](https://github.com/shizand/statapp/issues/63))
([60f479e](60f479ea7d)),
closes [#62](https://github.com/shizand/statapp/issues/62)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-03 16:10:40 +03:00
MisterMLiL
60f479ea7d
fix: исправлена ошибка "Все кнопки заблокированы" (#63)
Closes #62
2023-10-03 16:05:34 +03:00
github-actions[bot]
7497f71665
chore(main): release 0.4.0 (#51)
🤖 I have created a release *beep* *boop*
---


## [0.4.0](https://github.com/shizand/statapp/compare/v0.3.6...v0.4.0)
(2023-10-03)


### Новые функции

* добавлен дисперсионный анализ
([#46](https://github.com/shizand/statapp/issues/46))
([c77ed6a](c77ed6a82f)),
closes [#30](https://github.com/shizand/statapp/issues/30)
* добавлен Корреляционный анализ
([#54](https://github.com/shizand/statapp/issues/54))
([3a65517](3a655178d4)),
closes [#31](https://github.com/shizand/statapp/issues/31)


### Исправления

* добавлена иконка для окна "О программе"
([#55](https://github.com/shizand/statapp/issues/55))
([023a4a5](023a4a5142))
* добавлены заголовки диалоговых окон
([#49](https://github.com/shizand/statapp/issues/49))
([a3f7c1a](a3f7c1ac0b)),
closes [#44](https://github.com/shizand/statapp/issues/44)
* исправлен баг "index 0 is out of bounds"
([#59](https://github.com/shizand/statapp/issues/59))
([15825c2](15825c2200)),
closes [#43](https://github.com/shizand/statapp/issues/43)
* исправлена генерация значений фактора
([#53](https://github.com/shizand/statapp/issues/53))
([4854a14](4854a14e70)),
closes [#50](https://github.com/shizand/statapp/issues/50)
* исправлены баги с отображением и считыванием исходных данных
([#58](https://github.com/shizand/statapp/issues/58))
([fbf359e](fbf359e515))
* ограничена генерация чисел до сотых
([#48](https://github.com/shizand/statapp/issues/48))
([0779941](0779941dc9)),
closes [#32](https://github.com/shizand/statapp/issues/32)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-03 15:00:50 +03:00
88ceabf019
chore: добавлены заголовки о лицензии (#60) 2023-10-03 14:47:35 +03:00
MisterMLiL
15825c2200
fix: исправлен баг "index 0 is out of bounds" (#59)
Closes #43
2023-10-03 13:54:47 +03:00
fbf359e515
fix: исправлены баги с отображением и считыванием исходных данных (#58)
Сloses #56, #57.
2023-10-03 13:38:33 +03:00
MisterMLiL
023a4a5142
fix: добавлена иконка для окна "О программе" (#55)
Closes #45.
2023-10-03 12:49:10 +03:00
MisterMLiL
3a655178d4
feat: добавлен Корреляционный анализ (#54)
Closes #31
2023-10-03 12:43:00 +03:00
MisterMLiL
4854a14e70
fix: исправлена генерация значений фактора (#53)
Closes #50
2023-10-03 11:00:34 +03:00
86346b9c5b
refactor: переписаны модели (#52)
Closes #47
2023-10-02 21:24:28 +03:00
a3f7c1ac0b
fix: добавлены заголовки диалоговых окон (#49)
Closes #44
2023-10-02 21:23:22 +03:00
0779941dc9
fix: ограничена генерация чисел до сотых (#48)
В качестве решения выбрано округление до сотых

Closes #32
2023-10-02 21:23:08 +03:00
0a32e4baee
chore: удалил ненужную папку 2023-10-02 11:13:28 +03:00
c77ed6a82f
feat: добавлен дисперсионный анализ (#46)
Closes #30
2023-10-01 21:53:06 +03:00
github-actions[bot]
7f01052aa5
chore(main): release 0.3.6 (#40)
🤖 I have created a release *beep* *boop*
---


## [0.3.6](https://github.com/shizand/statapp/compare/v0.3.5...v0.3.6)
(2023-09-29)


### Исправления

* добавляет иконку приложения
([#39](https://github.com/shizand/statapp/issues/39))
([d3cd358](d3cd3589a7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-09-29 12:23:53 +03:00
d3cd3589a7
fix: добавляет иконку приложения (#39)
Closes #38.

---------

Co-authored-by: MisterMLiL <eugenelazurenko@gmail.com>
2023-09-29 12:13:24 +03:00
109 changed files with 185517 additions and 552 deletions

17
.copyright.tmpl Normal file
View File

@ -0,0 +1,17 @@
Copyright (c) ${years} 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/>.

2
.gitattributes vendored
View File

@ -1 +1 @@
statapp/ui/ui_*.py linguist-generated=true
statapp/ui/ui_*.py linguist-generated=true

View File

@ -13,4 +13,4 @@ jobs:
- uses: actions-ecosystem/action-add-assignees@v1
with:
github_token: ${{ secrets.github_token }}
assignees: ${{ github.actor }}
assignees: ${{ github.actor }}

View File

@ -18,4 +18,4 @@ jobs:
- uses: pixta-dev/repository-mirroring-action@674e65a7d483ca28dafaacba0d07351bdcc8bd75 # v1.1.1
with:
target_repo_url: "git@gitflic.ru:shizand/statapp.git"
ssh_private_key: ${{ secrets.GITFLIC_SSH }}
ssh_private_key: ${{ secrets.GITFLIC_SSH }}

View File

@ -15,7 +15,7 @@ jobs:
matrix:
os: [ubuntu-20.04, windows-latest]
spec: [statapp-onefile, statapp]
arch: [x86, x64]
arch: [x64] # [x86, x64]
include:
- os: ubuntu-20.04
target: linux
@ -47,7 +47,7 @@ jobs:
- name: Установка зависимостей
run: poetry install
- name: Сборка
run: poetry run pyinstaller ${{ matrix.spec }}.spec\
run: poetry run pyinstaller statapp.spec -- -- ${{ matrix.spec == 'statapp-onefile' && '--one-file' || '' }}
- name: Архивация
uses: thedoctor0/zip-release@0.7.1
with:

31
.github/workflows/size-labeler.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: labeler
on: [pull_request]
jobs:
labeler:
runs-on: ubuntu-latest
name: Label the PR size
permissions:
issues: write
pull-requests: write
steps:
- uses: codelytv/pr-size-labeler@v1.7.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/xs'
xs_max_size: '10'
s_label: 'size/s'
s_max_size: '100'
m_label: 'size/m'
m_max_size: '500'
l_label: 'size/l'
l_max_size: '1000'
xl_label: 'size/xl'
fail_if_xl: 'false'
message_if_xl: >
Этот PR превышает рекомендуемый размер в 1000 строк.
Пожалуйста, убедитесь, что вы НЕ решаете несколько проблем с помощью одного PR.
github_api_url: 'api.github.com'
files_to_ignore: |
"ui_*.py"

2
.gitignore vendored
View File

@ -161,7 +161,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/
### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration

3
.idea/.gitignore vendored
View File

@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -1,14 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
<option value="N803" />
<option value="N806" />
</list>
</option>
</inspection_tool>
</profile>
</component>

View File

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Poetry (statapp)" project-jdk-type="Python SDK" />
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/stat.iml" filepath="$PROJECT_DIR$/.idea/stat.iml" />
</modules>
</component>
</project>

View File

@ -1,24 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="statapp" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="stat" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="SDK_NAME" value="Poetry (statapp)" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="statapp" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="true" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Poetry (statapp)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,5 +1,9 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
autofix_commit_msg: 'chore: [pre-commit.ci] auto fixes from pre-commit.com hooks'
autoupdate_commit_msg: 'chore: [pre-commit.ci] pre-commit autoupdate'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
@ -7,4 +11,23 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
#- id: check-added-large-files
- repo: https://github.com/johann-petrak/licenseheaders.git
rev: v0.8.8
hooks:
- id: licenseheaders
args: ["-t", ".copyright.tmpl", "-cy", "-f", "-d", "statapp", "-x", "statapp/_vendor/*.py"]
pass_filenames: false
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
"--rcfile=.pylintrc",
]

29
.pylintrc Normal file
View File

@ -0,0 +1,29 @@
[MAIN]
ignored-modules=PySide2
extension-pkg-whitelist=PySide2
[MASTER]
init-hook="import sys; sys.path.append('.')"
ignore-patterns=ui_.+\.py
[BASIC]
attr-rgx=^_?[a-z][a-zA-Z0-9]+$|^_?[a-z0-9]+$|^_?[a-z0-9]+(_[a-z0-9]+)*$ # camelCase, lowercase, snake_case
class-attribute-rgx=^_?[a-z][a-zA-Z0-9]+$|^_?[a-z0-9]+$|^_?[a-z0-9]+(_[a-z0-9]+)*$ # camelCase, lowercase
variable-rgx=^_?[a-z][a-zA-Z0-9]+$|^_?[a-z0-9]+$ # camelCase, lowercase
argument-rgx=^_?[a-z][a-zA-Z0-9]+$|^_?[a-z0-9]+$ # camelCase, lowercase
function-rgx=^_?[a-z][a-zA-Z0-9]+$ # camelCase
method-rgx=^_?[a-z][a-zA-Z0-9]+$|^_?on_[a-z][a-zA-Z]+_[a-z][a-zA-Z]+|^__init__$ # camelCase, on_camelCaseWidget_camelCaseSignal and __init__
[SIMILARITIES]
min-similarity-lines=8
[MESSAGES CONTROL]
disable=
unused-argument,
fixme,
missing-docstring,
too-many-public-methods,
too-many-locals,
too-few-public-methods,
too-many-arguments,
broad-except

View File

@ -1,5 +1,186 @@
# Changelog
## [0.13.0](https://github.com/shizand/statapp/compare/v0.12.5...v0.13.0) (2024-02-29)
### Новые функции
* добавлены весовые коэффициенты ([#126](https://github.com/shizand/statapp/issues/126)) ([1900785](https://github.com/shizand/statapp/commit/1900785502d9066b31ed5311fab334f21eb9454e))
### Исправления
* исправлена "Остаточная дисперсия (масштабированная)" ([#124](https://github.com/shizand/statapp/issues/124)) ([babfd48](https://github.com/shizand/statapp/commit/babfd48ee15504342b01d9a1a98fcc1aafc890dc))
## [0.12.5](https://github.com/shizand/statapp/compare/v0.12.4...v0.12.5) (2024-02-22)
### Исправления
* заменён алгоритм моделирования полиномов и исправлен прогноз ([#122](https://github.com/shizand/statapp/issues/122)) ([f17644d](https://github.com/shizand/statapp/commit/f17644dd15bd8999196c994c1634fe27d621fabc))
## [0.12.4](https://github.com/shizand/statapp/compare/v0.12.3...v0.12.4) (2024-02-15)
### Исправления
* исправлен вывод коэффициента множественной детерминации в "Преобразования" ([da68523](https://github.com/shizand/statapp/commit/da685239136c7047ecaa5f63b7d52d25930ce895))
## [0.12.3](https://github.com/shizand/statapp/compare/v0.12.2...v0.12.3) (2024-02-14)
### Исправления
* добавлен более подробный вывод ошибок в консоль ([780d5b3](https://github.com/shizand/statapp/commit/780d5b30fdc271f670c09369c1a0a692f89e7fc2))
* исправлен вывод коэффициента множественной детерминации ([260cc99](https://github.com/shizand/statapp/commit/260cc99afa3e5bc0aaf0fbad8870eebd909e558c))
## [0.12.2](https://github.com/shizand/statapp/compare/v0.12.1...v0.12.2) (2024-02-12)
### Исправления
* Добавлены краткие теоретические сведения README ([34bcee2](https://github.com/shizand/statapp/commit/34bcee2acf3a7cee806d2da49ca0e546df8d1e3f))
## [0.12.1](https://github.com/shizand/statapp/compare/v0.12.0...v0.12.1) (2024-02-11)
### Исправления
* добавлено отключение "Распределения" при отсутствии отклика ([8ca535c](https://github.com/shizand/statapp/commit/8ca535cc8fb3c97d049afaef30ade033781a6e8e))
* исправлены ссылки на некоторую дополнительную литературу ([c23e1f8](https://github.com/shizand/statapp/commit/c23e1f81a9243d81a3e8f00f9f2b2ede941f5691))
## [0.12.0](https://github.com/shizand/statapp/compare/v0.11.0...v0.12.0) (2024-02-11)
### Новые функции
* Добавлена дополнительная литература ([#117](https://github.com/shizand/statapp/issues/117)) ([ded55cb](https://github.com/shizand/statapp/commit/ded55cb5d73e5b1d118c8f2ceaaf107a563f0e5e)), closes [#114](https://github.com/shizand/statapp/issues/114)
* добавлены "Распределения" ([#116](https://github.com/shizand/statapp/issues/116)) ([981580f](https://github.com/shizand/statapp/commit/981580f46d55b949af440973660a5b9b946827bd)), closes [#111](https://github.com/shizand/statapp/issues/111) [#112](https://github.com/shizand/statapp/issues/112)
### Исправления
* Дополнил README ([9766ecb](https://github.com/shizand/statapp/commit/9766ecb7f5f4bb4b960ad9519bbe28919ecda41d))
## [0.11.0](https://github.com/shizand/statapp/compare/v0.10.2...v0.11.0) (2024-02-03)
### Новые функции
* добавлен пункт "Использование" ([#108](https://github.com/shizand/statapp/issues/108)) ([aafa5a0](https://github.com/shizand/statapp/commit/aafa5a0ebbb772b6aa55699d8a50587a8fe6c8e0)), closes [#70](https://github.com/shizand/statapp/issues/70)
* добавлена возможность удалить факторы ([#103](https://github.com/shizand/statapp/issues/103)) ([30447a8](https://github.com/shizand/statapp/commit/30447a801afdac80da948a6f0961ce7b08591f4f)), closes [#102](https://github.com/shizand/statapp/issues/102)
### Исправления
* добавлена легенда графика ([#104](https://github.com/shizand/statapp/issues/104)) ([240a517](https://github.com/shizand/statapp/commit/240a517dd6691d45253b5863b54b4b035aaea8f1)), closes [#101](https://github.com/shizand/statapp/issues/101)
## [0.10.2](https://github.com/shizand/statapp/compare/v0.10.1...v0.10.2) (2024-02-01)
### Исправления
* исправлена опечатка в характеристиках модели ([871d9ad](https://github.com/shizand/statapp/commit/871d9ad746c51351bee9097d9f56903c8e1d1873))
## [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)
### Новые функции
* добавлена возможность ввода чисел до 5 знаков ([#87](https://github.com/shizand/statapp/issues/87)) ([dc7c487](https://github.com/shizand/statapp/commit/dc7c4875d7e15ad8c9ae5fa16b4b589d156632dd)), closes [#82](https://github.com/shizand/statapp/issues/82)
* Добавлены новые характеристики ([#89](https://github.com/shizand/statapp/issues/89)) ([b12db5a](https://github.com/shizand/statapp/commit/b12db5a3003802830784e26a14097ee9d68a0e64)), closes [#84](https://github.com/shizand/statapp/issues/84)
## [0.6.0](https://github.com/shizand/statapp/compare/v0.5.0...v0.6.0) (2023-10-20)
### Новые функции
* добавлен "Квадратичный полином" ([#81](https://github.com/shizand/statapp/issues/81)) ([9033770](https://github.com/shizand/statapp/commit/9033770406a6163bee794be80da9d5eebf0fcb87))
### Исправления
* исправлен формат сохранения файлов ([#79](https://github.com/shizand/statapp/issues/79)) ([044d2b6](https://github.com/shizand/statapp/commit/044d2b61cf068065a0fa0f33c8b0be94753eb84b))
## [0.5.0](https://github.com/shizand/statapp/compare/v0.4.2...v0.5.0) (2023-10-06)
### Новые функции
* добавлен "Линейный полином" ([#74](https://github.com/shizand/statapp/issues/74)) ([232de9f](https://github.com/shizand/statapp/commit/232de9f145862a1a1e493478ba5fe8a6e4866e5a))
### Исправления
* добавлены переводы для QMessageBox ([#73](https://github.com/shizand/statapp/issues/73)) ([e653c3d](https://github.com/shizand/statapp/commit/e653c3df29355e84f5845d428d2265b902f5abeb))
## [0.4.2](https://github.com/shizand/statapp/compare/v0.4.1...v0.4.2) (2023-10-03)
### Исправления
* добавлены иконки во все окна ([#67](https://github.com/shizand/statapp/issues/67)) ([9310a5e](https://github.com/shizand/statapp/commit/9310a5e6226bfaff4a7fe4fb9395d5cd1553fee9))
## [0.4.1](https://github.com/shizand/statapp/compare/v0.4.0...v0.4.1) (2023-10-03)
### Исправления
* исправлена ошибка "Все кнопки заблокированы" ([#63](https://github.com/shizand/statapp/issues/63)) ([60f479e](https://github.com/shizand/statapp/commit/60f479ea7ddd87f2a8b9d0e62442ba9faf45e9d7)), closes [#62](https://github.com/shizand/statapp/issues/62)
## [0.4.0](https://github.com/shizand/statapp/compare/v0.3.6...v0.4.0) (2023-10-03)
### Новые функции
* добавлен дисперсионный анализ ([#46](https://github.com/shizand/statapp/issues/46)) ([c77ed6a](https://github.com/shizand/statapp/commit/c77ed6a82fefbbf8879ba87d62bd895ebfd1e6fa)), closes [#30](https://github.com/shizand/statapp/issues/30)
* добавлен Корреляционный анализ ([#54](https://github.com/shizand/statapp/issues/54)) ([3a65517](https://github.com/shizand/statapp/commit/3a655178d4e262c7df42b9c1567dcaf997c58071)), closes [#31](https://github.com/shizand/statapp/issues/31)
### Исправления
* добавлена иконка для окна "О программе" ([#55](https://github.com/shizand/statapp/issues/55)) ([023a4a5](https://github.com/shizand/statapp/commit/023a4a514221ab22bb29f87aeccd20b5595d1b2e))
* добавлены заголовки диалоговых окон ([#49](https://github.com/shizand/statapp/issues/49)) ([a3f7c1a](https://github.com/shizand/statapp/commit/a3f7c1ac0b1bd16a2954dce83996c2e3677a7164)), closes [#44](https://github.com/shizand/statapp/issues/44)
* исправлен баг "index 0 is out of bounds" ([#59](https://github.com/shizand/statapp/issues/59)) ([15825c2](https://github.com/shizand/statapp/commit/15825c22007baeceebee98d19515ff038c1c2ae4)), closes [#43](https://github.com/shizand/statapp/issues/43)
* исправлена генерация значений фактора ([#53](https://github.com/shizand/statapp/issues/53)) ([4854a14](https://github.com/shizand/statapp/commit/4854a14e709272fe92463ac43d29f9a73a5f9875)), closes [#50](https://github.com/shizand/statapp/issues/50)
* исправлены баги с отображением и считыванием исходных данных ([#58](https://github.com/shizand/statapp/issues/58)) ([fbf359e](https://github.com/shizand/statapp/commit/fbf359e515f962dd5e079d7a13b5b7dc39339764))
* ограничена генерация чисел до сотых ([#48](https://github.com/shizand/statapp/issues/48)) ([0779941](https://github.com/shizand/statapp/commit/0779941dc9d9e83c35aff9f07a563da31e5c62c4)), closes [#32](https://github.com/shizand/statapp/issues/32)
## [0.3.6](https://github.com/shizand/statapp/compare/v0.3.5...v0.3.6) (2023-09-29)
### Исправления
* добавляет иконку приложения ([#39](https://github.com/shizand/statapp/issues/39)) ([d3cd358](https://github.com/shizand/statapp/commit/d3cd3589a781df47e6d0e9d669a376aefd9090fe))
## [0.3.5](https://github.com/shizand/statapp/compare/v0.3.4...v0.3.5) (2023-09-28)

View File

@ -1 +1 @@
* @Maks1mS @MisterMLiL
* @Maks1mS @MisterMLiL

View File

@ -0,0 +1,68 @@
# Statapp
![Release info](https://img.shields.io/github/v/release/shizand/statapp)
![Python version](https://img.shields.io/badge/python-3.8-blue.svg)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/c4e370d74a8a4575b79afa8b9b74d130)](https://app.codacy.com/gh/shizand/statapp/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
![License info](https://img.shields.io/github/license/shizand/statapp)
Автоматизированное программное средство по статистическому анализу и регрессионному моделированию. Является идейным продолжателем программы STAT.exe (Produced by Reutov V.N., Donetsk University, 1990).
Разработано двумя студентами ФГБОУ ВО «ДонНТУ» для своего университета.
## Поддерживаемые ОС и архитектуры
В теории, должно работать на любой архитектуре и ОС, где запускается Python 3.8 и есть Qt 5.
Работоспособность проверена на x64:
* на Windows 7, 10;
* на ALT Linux 10.2.
## Установка
Программа распространяется с помощью [PyInstaller](https://pyinstaller.org/en/stable/).
Существует две версиии: **statapp** и **statapp-onefile**.
Различия в том, что onefile версия поставляется одним единственным бинарным файлом. На Windows системах с включенным антивирусом это может вызывать [некоторые проблемы](https://qna.habr.com/q/988553).
### Готовые двоичные файлы
[Скачайте архив](https://github.com/shizand/statapp/releases) под вашу платформу и распакуйте в любом месте.
### Сборка из исходников
В этом проекте используется [poetry](https://python-poetry.org/).
```bash
poetry install
pyinstaller statapp.spec # или pyinstaller statapp.spec -- --one-file
```
Документация собирается с помощью [grip](https://github.com/joeyespo/grip)
```bash
echo "STYLE_URLS = [\"https://cdn.jsdelivr.net/gh/shizand/statapp@main/statapp/docs/grip.css\"]" > ~/.grip/settings.py
cd docs
grip .
```
## Использование
Использование описано в [Руководстве пользователя](docs/README.md).
## Чем я могу помочь проекту?
* [Сообщить об ошибке](https://github.com/shizand/statapp/issues/new?labels=%D0%B1%D0%B0%D0%B3)
## Исходный код
Исходный код доступен на [GitHub](https://github.com/shizand/statapp).
Также есть зеркала:
* [GitFic](https://gitflic.ru/project/shizand/statapp);
* [Gitea сервер](https://git.slipenko.com/shizand/statapp).
## Лицензия
[GPL-3.0 © Maxim Slipenko, Eugene Lazurenko.](https://github.com/shizand/statapp/blob/main/LICENSE)

155
environment.yml Normal file
View File

@ -0,0 +1,155 @@
name: statapp
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_gnu
- alsa-lib=1.2.10=hd590300_0
- attr=2.5.1=h166bdaf_1
- bzip2=1.0.8=hd590300_5
- ca-certificates=2024.2.2=hbcca054_0
- cairo=1.16.0=h6cf1ce9_1008
- dbus=1.13.6=h48d8840_2
- expat=2.5.0=hcb278e6_1
- font-ttf-dejavu-sans-mono=2.37=hab24e00_0
- font-ttf-inconsolata=3.000=h77eed37_0
- font-ttf-source-code-pro=2.038=h77eed37_0
- font-ttf-ubuntu=0.83=h77eed37_1
- fontconfig=2.14.2=h14ed4e7_0
- fonts-conda-ecosystem=1=0
- fonts-conda-forge=1=0
- freetype=2.12.1=h267a509_2
- gettext=0.21.1=h27087fc_0
- glib=2.68.4=h9c3ff4c_0
- glib-tools=2.68.4=h9c3ff4c_0
- graphite2=1.3.13=h58526e2_1001
- gst-plugins-base=1.18.4=h29181c9_0
- gstreamer=1.18.5=h76c114f_0
- harfbuzz=3.0.0=h83ec7ef_1
- icu=68.2=h9c3ff4c_0
- jpeg=9e=h166bdaf_2
- keyutils=1.6.1=h166bdaf_0
- krb5=1.19.3=h3790be6_0
- lame=3.100=h166bdaf_1003
- ld_impl_linux-64=2.38=h1181459_1
- libcap=2.69=h0f662aa_0
- libclang=11.1.0=default_ha53f305_1
- libclang13=14.0.6=default_h9986a30_1
- libcups=2.3.3=h3e49a29_2
- libedit=3.1.20191231=he28a2e2_2
- libevent=2.1.10=h9b69904_4
- libexpat=2.5.0=hcb278e6_1
- libffi=3.3=h58526e2_2
- libflac=1.4.3=h59595ed_0
- libgcc-ng=13.2.0=h807b86a_5
- libgcrypt=1.10.3=hd590300_0
- libglib=2.68.4=h3e27bee_0
- libgomp=13.2.0=h807b86a_5
- libgpg-error=1.47=h71f35ed_0
- libiconv=1.17=hd590300_2
- libjpeg-turbo=2.1.4=h166bdaf_0
- libllvm11=11.1.0=he0ac6c6_5
- libllvm14=14.0.6=hcd5def8_4
- libogg=1.3.4=h7f98852_1
- libopus=1.3.1=h7f98852_1
- libpng=1.6.42=h2797004_0
- libpq=13.8=hd77ab85_0
- libsndfile=1.2.2=hc60ed4a_1
- libsqlite=3.44.2=h2797004_0
- libstdcxx-ng=13.2.0=h7e041cc_5
- libsystemd0=255=h3516f8a_0
- libuuid=2.38.1=h0b41bf4_0
- libvorbis=1.3.7=h9c3ff4c_0
- libxcb=1.15=h0b41bf4_0
- libxkbcommon=1.0.3=he3ba5ed_0
- libxml2=2.9.12=h72842e0_0
- libxslt=1.1.33=h15afd5d_2
- libzlib=1.2.13=hd590300_5
- lz4-c=1.9.4=hcb278e6_0
- mpg123=1.32.4=h59595ed_0
- mysql-common=8.0.32=h14678bc_0
- mysql-libs=8.0.32=h54cf53e_0
- ncurses=6.4=h6a678d5_0
- nspr=4.35=h27087fc_0
- nss=3.97=h1d7d5a4_0
- openssl=1.1.1w=hd590300_0
- pcre=8.45=h9c3ff4c_0
- pcre2=10.42=hcad00b1_0
- pip=23.3.1=py38h06a4308_0
- pixman=0.43.2=h59595ed_0
- pthread-stubs=0.4=h36c2ea0_1001
- pyside2=5.13.2=py38h2009f50_7
- python=3.8.10=h49503c6_1_cpython
- python_abi=3.8=2_cp38
- qt=5.12.9=hda022c4_4
- readline=8.2=h5eee18b_0
- setuptools=68.2.2=py38h06a4308_0
- sqlite=3.41.2=h5eee18b_0
- tk=8.6.12=h1ccaba5_0
- wheel=0.41.2=py38h06a4308_0
- xcb-util=0.4.0=hd590300_1
- xcb-util-image=0.4.0=h8ee46fc_1
- xcb-util-keysyms=0.4.0=h8ee46fc_1
- xcb-util-renderutil=0.3.9=hd590300_1
- xcb-util-wm=0.4.1=h8ee46fc_1
- xkeyboard-config=2.40=hd590300_0
- xorg-kbproto=1.0.7=h7f98852_1002
- xorg-libice=1.1.1=hd590300_0
- xorg-libsm=1.2.4=h7391055_0
- xorg-libx11=1.8.7=h8ee46fc_0
- xorg-libxau=1.0.11=hd590300_0
- xorg-libxdmcp=1.1.3=h7f98852_0
- xorg-libxext=1.3.4=h0b41bf4_2
- xorg-libxrender=0.9.11=hd590300_0
- xorg-renderproto=0.11.1=h7f98852_1002
- xorg-xextproto=7.3.0=h0b41bf4_1003
- xorg-xf86vidmodeproto=2.3.1=h7f98852_1002
- xorg-xproto=7.0.31=h7f98852_1007
- xz=5.4.5=h5eee18b_0
- zlib=1.2.13=hd590300_5
- zstd=1.5.5=hfc55251_0
- pip:
- altgraph==0.17.4
- astroid==2.15.8
- cfgv==3.4.0
- contourpy==1.1.1
- cycler==0.12.1
- dill==0.3.7
- distlib==0.3.7
- filelock==3.12.4
- fonttools==4.43.1
- identify==2.5.30
- importlib-metadata==6.8.0
- importlib-resources==6.1.0
- isort==5.12.0
- kiwisolver==1.4.5
- lazy-object-proxy==1.9.0
- matplotlib==3.7.3
- mccabe==0.7.0
- mpmath==1.3.0
- nodeenv==1.8.0
- numpy==1.24.4
- packaging==23.2
- pandas==2.0.3
- pillow==9.5.0
- platformdirs==3.11.0
- pre-commit==3.5.0
- pyinstaller==6.1.0
- pyinstaller-hooks-contrib==2023.10
- pylint==2.17.7
- pyparsing==3.1.1
- python-dateutil==2.8.2
- pytz==2023.3.post1
- pyyaml==6.0.1
- setuptools-scm==8.0.4
- six==1.16.0
- sympy==1.12
- tomli==2.0.1
- tomlkit==0.12.1
- typing-extensions==4.8.0
- tzdata==2023.3
- virtualenv==20.24.5
- wrapt==1.15.0
- zipp==3.17.0
prefix: /home/maxim/miniconda3/envs/statapp

967
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "statapp"
version = "0.3.5"
version = "0.13.0"
description = ""
authors = [
"Maxim Slipenko <statapp@maks1ms.addy.io>"
@ -12,8 +12,17 @@ readme = "README.md"
python = ">=3.8,<3.9"
pre-commit = "^3.4.0"
pyinstaller = "^6.0.0"
pandas = "^2.0"
pyside2 = "^5.15.2.1"
pandas = { version = "^2", markers = "python_version < '3.9'" }
pylint = { version = "^2", markers = "python_version < '3.9'" }
# scipy = { version = "^1", markers = "python_version < '3.9'" }
# openpyxl = "^3.1.2"
sympy = "^1.12"
matplotlib = "^3.7.0"
pillow = "9.5"
scikit-learn = "1.3.2"
[build-system]

View File

@ -1,3 +0,0 @@
#!/usr/bin/env bash
poetry version "$@"

View File

@ -1,58 +0,0 @@
# -*- mode: python ; coding: utf-8 -*-
import sys
import typing
from pprint import pprint
if typing.TYPE_CHECKING:
from PyInstaller.building.api import COLLECT, EXE, MERGE, PYZ # noqa: F401
from PyInstaller.building.build_main import Analysis # noqa: F401
from PyInstaller.building.datastruct import TOC, Target, Tree # noqa: F401
from PyInstaller.building.osx import BUNDLE # noqa: F401
from PyInstaller.building.splash import Splash # noqa: F401
from PyInstaller.utils.hooks import copy_metadata
datas = [('statapp/images/sticker.gif', 'images')]
datas += copy_metadata('statapp')
a = Analysis(
['statapp/__main__.py'],
pathex=[],
binaries=[],
datas=datas,
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
prev_binaries = set(a.binaries)
if sys.platform in ('linux', 'darwin'):
a.exclude_system_libraries(list_of_exceptions=[]) # glob expression
print('\n\nSTRIPPED SYSTEM LIBS')
pprint(sorted(set(prev_binaries) - set(a.binaries)))
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='statapp',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)

View File

@ -1,4 +1,5 @@
# -*- mode: python ; coding: utf-8 -*-
import argparse
import sys
import typing
from pprint import pprint
@ -12,7 +13,15 @@ if typing.TYPE_CHECKING:
from PyInstaller.utils.hooks import copy_metadata
datas = [('statapp/images/sticker.gif', 'images')]
parser = argparse.ArgumentParser()
parser.add_argument("--one-file", action="store_true")
options = parser.parse_args()
datas = [
('statapp/ui/images/*', 'ui/images'),
('statapp/docs/files/*', 'docs/files'),
('statapp/docs/README.html', 'docs')
]
datas += copy_metadata('statapp')
@ -35,31 +44,69 @@ if sys.platform in ('linux', 'darwin'):
print('\n\nSTRIPPED SYSTEM LIBS')
pprint(sorted(set(prev_binaries) - set(a.binaries)))
LOCALES = ['ru', 'en']
def remove_unused_translation(item):
dest = str(item[0])
if not dest.startswith('PySide2/Qt/translations'):
return True
for l in LOCALES:
if l in dest:
return True
return False
a.datas = list(filter(remove_unused_translation, a.datas))
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='statapp',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='statapp',
)
if options.one_file:
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='statapp',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='statapp/ui/images/logo.ico',
)
else:
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='statapp',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='statapp/ui/images/logo.ico',
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='statapp',
)

View File

@ -1,3 +1,22 @@
#
# 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 sys
from PySide2 import QtCore
@ -7,14 +26,14 @@ from statapp.main_window import MainWindow
def main():
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)
app = QApplication(sys.argv)
translator = QtCore.QTranslator(app)
locale = QtCore.QLocale.system().name()
path = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)
translator.load('qt_%s' % locale, path)
translator.load(f'qt_{locale}', path)
translator.load(f'qtbase_{locale}', path)
app.installTranslator(translator)
window = MainWindow()
window.show()
return app.exec_()

View File

@ -1,9 +1,29 @@
#
# 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 sys
from PySide2.QtGui import QMovie
from PySide2.QtWidgets import QMainWindow
from statapp.ui.ui_about_window import Ui_AboutWindow
from statapp.utils import resource_path
from statapp.utils import resourcePath, addIcon
if sys.version_info < (3, 8):
import importlib_metadata
@ -19,8 +39,8 @@ class AboutWindow(QMainWindow):
self.ui = Ui_AboutWindow()
self.ui.setupUi(self)
image_path = resource_path('images/sticker.gif')
movie = QMovie(image_path)
gifPath = resourcePath('ui/images/sticker.gif')
movie = QMovie(gifPath)
self.ui.labelgif.setMovie(movie)
movie.start()
self.movie = movie
@ -28,3 +48,5 @@ class AboutWindow(QMainWindow):
version = importlib_metadata.version(__package__ or __name__)
self.ui.versionLabel.setText(f"Версия: {version}")
addIcon(self)

213
statapp/calculations.py Normal file
View File

@ -0,0 +1,213 @@
#
# 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 dataclasses import dataclass
import numpy as np
import pandas as pd
import sympy as sp
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
from sklearn.metrics import r2_score
DIRECT_LINK = 0
INDIRECT_LINK = 1
def generateYValues(mean, std, count):
return np.random.normal(mean, std, size=(count, 1))
def generateXValues(mean, std, typeConnection, yColumn):
yMean = np.mean(yColumn)
values = []
for y in yColumn:
raz = np.abs(mean - np.random.normal(mean, std))
if typeConnection == INDIRECT_LINK:
raz *= -1
if y > yMean:
x = mean + raz
elif y < yMean:
x = mean - raz
else:
x = mean
values.append(x)
res = np.array(values)
return res.reshape(len(res), 1)
def varianceAnalysis(data):
return np.array([
[np.mean(col), np.std(col), np.min(col), np.max(col)] for col in data.T
])
def correlationAnalysis(data):
return pd.DataFrame(data).corr().to_numpy()
@dataclass()
class RegressionResult:
"""
Attributes:
paramsAndImportance (np.ndarray): Параметры модели. Первая колонка -
residualVariance (np.float64): Остаточная дисперсия
scaledResidualVariance (np.float64): Остаточная дисперсия (масштабированная)
monomials (list): Список одночленов в строковом виде без коэффициентов. Свободный член - c
"""
paramsAndImportance: np.ndarray
residualVariance: np.float64
scaledResidualVariance: np.float64
rSquared: np.float64
fStatistic: np.float64
monomials: list
def _prepareDataAndFeatures(data, degree):
y = data[:, 0]
x = data[:, 1:]
polyFeatures = PolynomialFeatures(degree=degree, include_bias=False)
xPoly = polyFeatures.fit_transform(x)
return y, x, xPoly, polyFeatures
def _trainModelAndPredict(y, xPoly):
model = LinearRegression(fit_intercept=True)
model.fit(xPoly, y)
predictions = model.predict(xPoly)
return model, predictions
def _calculateStatistics(y, x, xPoly, predictions, model, polyFeatures):
# Рассчитываем Среднеквадратическую ошибку (MSE) между фактическими и прогнозируемыми значениями
mse = mean_squared_error(y, predictions)
# Рассчитываем коэффициент детерминации R^2, который
# показывает долю вариации зависимой переменной, объясненную моделью
rSquared = r2_score(y, predictions)
# Определяем количество наблюдений
n = xPoly.shape[0]
# Определяем количество предикторов (признаков) плюс один для свободного члена
k = xPoly.shape[1] + 1
# Рассчитываем F-статистику для оценки значимости всей регрессионной модели
fStatistic = (rSquared / (k - 1)) / ((1 - rSquared) / (n - k))
# Собираем параметры модели, включая свободный член и коэффициенты перед переменными
params = np.hstack([model.intercept_, model.coef_])
# Вычисляем остатки модели как разницу между фактическими и прогнозируемыми значениями
residuals = y - predictions
# Добавляем столбец единиц к матрице признаков для учета свободного члена в регрессионной модели
xWithIntercept = np.hstack([np.ones((n, 1)), xPoly])
# Рассчитываем дисперсии коэффициентов модели
varB = mse * np.linalg.pinv(xWithIntercept.T @ xWithIntercept).diagonal()
# Вычисляем стандартные ошибки коэффициентов, берем корень из дисперсий
seB = np.sqrt(np.maximum(varB, 0))
# Рассчитываем t-статистики для каждого коэффициента
tStats = params / seB
# Рассчитываем дисперсию остатков с поправкой на количество параметров
residualVariance = np.var(residuals, ddof=k)
# Рассчитываем скорректированную дисперсию остатков
scaledResidualVariance = 1 - rSquared
# Генерируем список мономов (названий признаков после
# полиномиализации), добавляя константу для свободного члена
monomials = ['c'] + list(
polyFeatures.get_feature_names_out(['x' + str(i) for i in range(1, x.shape[1] + 1)])
)
# Заменяем пробелы на звездочки для представления умножения в названиях мономов
monomials = [monomial.replace(' ', '*') for monomial in monomials]
weightsCoef = np.concatenate((np.array([0]), tStats[1:] / np.sum(tStats[1:])))
# Возвращаем рассчитанные статистики и названия мономов
return (params, tStats, weightsCoef,
residualVariance, scaledResidualVariance,
rSquared, fStatistic, monomials)
def _regressionAnalysis(data, degree):
y, x, xPoly, polyFeatures = _prepareDataAndFeatures(
data, degree
)
model, predictions = _trainModelAndPredict(y, xPoly)
(params, tStats, weightsCoef, residualVariance,
scaledResidualVariance, rSquared, fStatistic, monomials) = (
_calculateStatistics(
y,
x,
xPoly,
predictions,
model,
polyFeatures
))
return RegressionResult(
np.vstack((params, tStats, weightsCoef)).T,
residualVariance,
scaledResidualVariance,
rSquared,
fStatistic,
monomials
)
def linearPolynom(data):
return _regressionAnalysis(data, 1)
def squaredPolynom(data):
return _regressionAnalysis(data, 2)
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 = []
numVars = inputs.shape[1]
symbolsStr = ' '.join([f'x{i}' for i in range(1, numVars + 1)])
symbols = sp.symbols(symbolsStr)
for y, xValues in zip(outputs, inputs):
subsDict = dict(zip(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
View 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)

20
statapp/constants.py Normal file
View File

@ -0,0 +1,20 @@
#
# 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/>.
#
NUMBERS_PRECISION = 5

View File

@ -0,0 +1,53 @@
#
# 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.QtCore import QSize
from PySide2.QtGui import QIcon
from PySide2.QtWidgets import QDialog, QHeaderView
from statapp.calculations import correlationAnalysis
from statapp.constants import NUMBERS_PRECISION
from statapp.mathtex_header_view import MathTexHeaderView
from statapp.models.correlation_analysis_model import CorrelationAnalysisModel
from statapp.ui.ui_correlation_analysis_window import Ui_CorrelationAnalysisWindow
from statapp.utils import resourcePath
class CorrelationAnalysisWindow(QDialog):
def __init__(self, data):
super().__init__()
self.ui = Ui_CorrelationAnalysisWindow()
self.ui.setupUi(self)
res = correlationAnalysis(data)
self.model = CorrelationAnalysisModel(res.round(NUMBERS_PRECISION))
self.ui.tableView.setModel(self.model)
self.ui.tableView.setVerticalHeader(
MathTexHeaderView(self.ui.tableView)
)
self.ui.tableView.setHorizontalHeader(
MathTexHeaderView(self.ui.tableView,orientation=QtCore.Qt.Horizontal)
)
header = self.ui.tableView.horizontalHeader()
header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch)
icon = QIcon()
icon.addFile(resourcePath("ui/images/logo.ico"), QSize(), QIcon.Normal, QIcon.Off)
self.setWindowIcon(icon)

View File

@ -0,0 +1,105 @@
#
# 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.QtWidgets import QDialog, QVBoxLayout, QComboBox
from statapp.polynoms.polynom_window import MplCanvas
from statapp.utils import addIcon
from statapp.models.utils import yxHeader
class DistributionWindow(QDialog):
def __init__(self, title: str, data: np.ndarray):
super().__init__()
self.setWindowTitle(title)
addIcon(self)
self.layout = QVBoxLayout()
self.setLayout(self.layout)
self.data = data
self.values = yxHeader(data.shape[1])
self.comboBox = QComboBox()
self.comboBox.addItems(self.values)
self.comboBox.currentIndexChanged.connect(self.onChange)
self.sc = self.getSc(data[:, 0])
self.layout.addWidget(self.comboBox)
self.l = QVBoxLayout()
self.l.addWidget(self.sc)
self.layout.addLayout(self.l)
def onChange(self):
while ((child := self.l.takeAt(0)) is not None):
child.widget().deleteLater()
self.sc = self.getSc(self.data[:, self.comboBox.currentIndex()])
self.l.addWidget(self.sc)
class UniformDistributionWindow(DistributionWindow):
def __init__(self, data: np.array):
super().__init__("Равномерное распределение", data)
def getSc(self, points):
sc = MplCanvas(self, width=5, height=4, dpi=100)
points = np.sort(points)
points = np.array(
[points[0]] +
[pt for pt, next_pt in zip(points[:-1], points[1:]) if pt != next_pt]
)
differences = np.diff(points)
inverseDifferences = 1 / differences
for i, (start, end) in enumerate(zip(points[:-1], points[1:])):
sc.axes.hlines(inverseDifferences[i], start, end, colors='r', linestyles='solid')
return sc
def normalDensity(x, mu, sigmaSquared):
return 1 / np.sqrt(2 * np.pi * sigmaSquared) * np.exp(-(x - mu) ** 2 / (2 * sigmaSquared))
class NormalDistributionWindow(DistributionWindow):
def __init__(self, data: np.array):
super().__init__("Нормальное распределение", data)
def getSc(self, points):
sc = MplCanvas(self, width=5, height=4, dpi=100)
points = np.sort(points)
mu = np.mean(points)
sigmaSquared = np.var(points)
yValues = normalDensity(points, mu, sigmaSquared)
sc.axes.plot(points, yValues)
return sc
class ExponentialDistributionWindow(DistributionWindow):
def __init__(self, data: np.array):
super().__init__("Экспоненциальное распределение", data)
def getSc(self, points):
sc = MplCanvas(self, width=5, height=4, dpi=100)
points = np.sort(points)
mu = np.mean(points)
lambdaParam = 1 / mu
yValues = lambdaParam * np.exp(-lambdaParam * points)
sc.axes.plot(points, yValues)
return sc

604
statapp/docs/README.html Normal file

File diff suppressed because one or more lines are too long

277
statapp/docs/README.md Normal file
View File

@ -0,0 +1,277 @@
<!--
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/>.
-->
# Руководство пользователя для программы "Statapp"
## Условные обозначения
`Взаимодействие` - так отображается интерфестные части приложения с которыми пользователь может и должен взаимодействовать. к тами относятся кнопки, пункты меню, окна приложения, страницы в моделировании и тд.
*Пример* - так отображаются комментарии или описания. Обычно используются в качестве подписей к картинкам.
***Параметр*** - так отображаются параметры, которые пользователь может получить в результате вычислений в приложении.
## Введение
"Statapp" — это программное решение для статистического анализа и регрессионного моделирования, позволяющее специалистам в области данных проводить глубокий анализ и создавать точные прогностические модели.
## Дополнительная литература
- [Гмурман В. Е. Теория вероятностей и математическая статистика. Учеб. пособие для вузов.pdf](https://raw.githubusercontent.com/shizand/statapp/v0.12.0/literature/%D0%93%D0%BC%D1%83%D1%80%D0%BC%D0%B0%D0%BD%20%D0%92.%20%D0%95.%20%D0%A2%D0%B5%D0%BE%D1%80%D0%B8%D1%8F%20%D0%B2%D0%B5%D1%80%D0%BE%D1%8F%D1%82%D0%BD%D0%BE%D1%81%D1%82%D0%B5%D0%B9%20%D0%B8%20%D0%BC%D0%B0%D1%82%D0%B5%D0%BC%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B0%D1%8F%20%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0.%20%D0%A3%D1%87%D0%B5%D0%B1.%20%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D0%B8%D0%B5%20%D0%B4%D0%BB%D1%8F%20%D0%B2%D1%83%D0%B7%D0%BE%D0%B2.pdf)
- [Гмурман В.Е. Руководство к решению задач по теории вероятностей и математической статистике](https://raw.githubusercontent.com/shizand/statapp/v0.12.0/literature/%D0%93%D0%BC%D1%83%D1%80%D0%BC%D0%B0%D0%BD%20%D0%92.%D0%95.%20%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE%20%D0%BA%20%D1%80%D0%B5%D1%88%D0%B5%D0%BD%D0%B8%D1%8E%20%D0%B7%D0%B0%D0%B4%D0%B0%D1%87%20%D0%BF%D0%BE%20%D1%82%D0%B5%D0%BE%D1%80%D0%B8%D0%B8%20%D0%B2%D0%B5%D1%80%D0%BE%D1%8F%D1%82%D0%BD%D0%BE%D1%81%D1%82%D0%B5%D0%B9%20%D0%B8%20%D0%BC%D0%B0%D1%82%D0%B5%D0%BC%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%BE%D0%B9%20%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B5.pdf)
- [Горяинов В. Т., Журавлев А. Г., Тихонов В. И. Статистическая радиотехника: Примеры и задачи](https://raw.githubusercontent.com/shizand/statapp/v0.12.0/literature/%D0%93%D0%BE%D1%80%D1%8F%D0%B8%D0%BD%D0%BE%D0%B2%20%D0%92.%20%D0%A2.%2C%20%D0%96%D1%83%D1%80%D0%B0%D0%B2%D0%BB%D0%B5%D0%B2%20%D0%90.%20%D0%93.%2C%20%D0%A2%D0%B8%D1%85%D0%BE%D0%BD%D0%BE%D0%B2%20%D0%92.%20%D0%98.%20%D0%A1%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B0%D1%8F%20%D1%80%D0%B0%D0%B4%D0%B8%D0%BE%D1%82%D0%B5%D1%85%D0%BD%D0%B8%D0%BA%D0%B0%20%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B%20%D0%B8%20%D0%B7%D0%B0%D0%B4%D0%B0%D1%87%D0%B8.pdf)
- [Григорьев-Голубев, В. В. Теория вероятностей и математическая статистика. Руководство по решению задач](https://raw.githubusercontent.com/shizand/statapp/v0.12.0/literature/%D0%93%D1%80%D0%B8%D0%B3%D0%BE%D1%80%D1%8C%D0%B5%D0%B2-%D0%93%D0%BE%D0%BB%D1%83%D0%B1%D0%B5%D0%B2%2C%20%D0%92.%20%D0%92.%20%D0%A2%D0%B5%D0%BE%D1%80%D0%B8%D1%8F%20%D0%B2%D0%B5%D1%80%D0%BE%D1%8F%D1%82%D0%BD%D0%BE%D1%81%D1%82%D0%B5%D0%B9%20%D0%B8%20%D0%BC%D0%B0%D1%82%D0%B5%D0%BC%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B0%D1%8F%20%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0.%20%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE%20%D0%BF%D0%BE%20%D1%80%D0%B5%D1%88%D0%B5%D0%BD%D0%B8%D1%8E%20%D0%B7%D0%B0%D0%B4%D0%B0%D1%87.pdf)
- [Кадочникова Е. И. Эконометрика. Конспект лекций](https://raw.githubusercontent.com/shizand/statapp/v0.12.0/literature/%D0%9A%D0%B0%D0%B4%D0%BE%D1%87%D0%BD%D0%B8%D0%BA%D0%BE%D0%B2%D0%B0%20%D0%95.%20%D0%98.%20%D0%AD%D0%BA%D0%BE%D0%BD%D0%BE%D0%BC%D0%B5%D1%82%D1%80%D0%B8%D0%BA%D0%B0.%20%D0%9A%D0%BE%D0%BD%D1%81%D0%BF%D0%B5%D0%BA%D1%82%20%D0%BB%D0%B5%D0%BA%D1%86%D0%B8%D0%B9.pdf)
- [Касьянов В. А. Эконометрика](https://raw.githubusercontent.com/shizand/statapp/v0.12.0/literature/%D0%9A%D0%B0%D1%81%D1%8C%D1%8F%D0%BD%D0%BE%D0%B2%20%D0%92.%20%D0%90.%20%D0%AD%D0%BA%D0%BE%D0%BD%D0%BE%D0%BC%D0%B5%D1%82%D1%80%D0%B8%D0%BA%D0%B0.pdf)
- [Садовникова Н.А., Шмойлова Р.А. Анализ временных рядов и прогнозирование. Вып. 3](https://raw.githubusercontent.com/shizand/statapp/v0.12.0/literature/%D0%A1%D0%B0%D0%B4%D0%BE%D0%B2%D0%BD%D0%B8%D0%BA%D0%BE%D0%B2%D0%B0%20%D0%9D.%D0%90.%2C%20%D0%A8%D0%BC%D0%BE%D0%B9%D0%BB%D0%BE%D0%B2%D0%B0%20%D0%A0.%D0%90.%20%D0%90%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7%20%D0%B2%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%BD%D1%8B%D1%85%20%D1%80%D1%8F%D0%B4%D0%BE%D0%B2%20%D0%B8%20%D0%BF%D1%80%D0%BE%D0%B3%D0%BD%D0%BE%D0%B7%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5.%20%D0%92%D1%8B%D0%BF.%203.pdf)
## Краткие теоретические сведения
В рамках ***дисперсионного анализа*** для каждой величины вычисляются следующие характеристики.
***Математическое ожидание*** характеризует среднее значение величины:
<image src="files/Формула 1.PNG">
*где n количество значений величины, i номер значения.*
***Дисперсия*** характеризует разброс величины относительно среднего значения:
<image src="files/Формула 2.PNG">
***Среднеквадратичное отклонение*** характеризует разброс величины относительно среднего значения:
<image src="files/Формула 3.PNG">
В результате ***корреляционного анализа*** вычисляется ***корреляционная матрица***. ***Коэффициент корреляции*** (rij) характеризует взаимосвязь между величинами. Взаимосвязь считается сильной, если выполняется условие:
<image src="files/Формула 4.PNG">
Знак ***коэффициента корреляции*** показывает характер влияния величин. Если знак положительный (прямая связь), то увеличение значения одной величины приводит к увеличению значения другой. Иначе увеличение значения одной величины приводит к уменьшению значения другой (обратная связь).
При осуществлении каскадного регрессионного анализа вычисляются параметры и оценки модели. В основе анализа лежит понятие коэффициента значимости (tj), который характеризует степень влияния фактора на модель. Фактор считается значимым, если выполняется условие:
<image src="files/Формула 5.PNG">
На каждом шаге вычисляются оценки полученной зависимости.
***Остаточная дисперсия масштабированная*** показывает, какая часть статистического материала не была охвачена полученной зависимостью.
<image src="files/Формула 6.PNG">
***Отношение Фишера*** (F1) показывает во сколько раз полученная зависимость лучше полинома y=yср, где yср математическое ожидание y.
<image src="files/Формула 7.PNG">
***Коэффициент множественной детерминации*** (R) характеризует степень близости полученной зависимости к реальному поведению объекта.
<image src="files/Формула 8.PNG">
Механизм процедуры ***каскадного регрессионного анализа***.
На 1-м шаге анализа строится модель, которая включает все ***факторы***. Далее производится исключение ***фактора*** tj с наименьшим по модулю значением ***коэффициента значимости*** и строится новая модель. Если оценки модели ухудшились, то ***каскадная процедура исключения факторов*** останавливается и лучшей считается модель, полученная на предыдущем шаге. Иначе исключение ***факторов*** продолжается до тех пор, пока не ухудшатся оценки модели либо пока для всех ***факторов*** будет выполняться условие.
## Начало работы
### Генерация показателей
<hr>
### Генерация отклика
Перед тем как начать анализ, необходимо сгенерировать ***отклики***, которые будут использоваться как зависимые переменные в моделях:
1. Перейдите в меню `Генерация показателей`.
2. Выберите `Генерация отклика`.
После этого откроется окно `Генерация отклика`:
<image src="files/Генерация показателей - Генерация отклика.PNG">
*Пример пункта меню* `Генерация отклика`
3. Укажите необходимые параметры для генерации данных и нажмите кнопку `Сгенерировать`.
<image src="files/Окно - Генерация отклика.PNG" width=400>
*Пример окна* `Генерация отклика`
После этого окно должно закрыться и на `Белом листе` в `Главном окне` появится колонка со случайно сгенерированными данными отклика по заданным показателям.
<hr>
### Генерация фактора
После генерации ***откликов*** следует сгенерировать ***факторы***, которые будут служить независимыми переменными. Для генерации ***факторов*** необходимо выполнить следующие шаги:
1. Перейдите в меню `Генерация показателей`.
2. Выберите `Генерация фактора`.
После этого откроется окно `Генерация фактора`:
<image src="files/Генерация показателей - Генерация фактора.PNG">
*Пример пункта меню* `Генерация фактора`
3. Выберите нужный тип связи к ***отклику*** (прямая или обратная).
4. Укажите оставшиеся параметры для генерации данных и нажмите кнопку `Сгенерировать`.
<image src="files/Окно - Генерация фактора.PNG" width=400>
*Пример окна* `Генерация отклика`
Можно добавлять несколько факторов.
<hr>
### Удаление факторов
Так как программа `Statapp` генерирует показатели ***Факторов*** случайным образом в границах заданого ***Среднеквадратического отклонения*** то при генерации нескольких ***Факторов*** может возникнуть необходимость удаления некоторых из них. Для этого необходимо выполнить следующие шаги:
1. Выберите необходимый ***Фактор*** для удаления и кликните по `Заголовку` с обозначением `Xn` правой кнопкой мыши.
2. Нажмите на появившуюся кнопку `Удалить` для удаления выбранного ***Фактора***.
*Внимание после удаления ***Фактора*** действие уже нельзя будет отменить*
<image src="files/Окно - Удаление.PNG">
*Пример появившейся кнопки* `Удалить`
Удаленный ***Фактор*** пропадет из таблицы и более не будет учитываться в `Анализе` и `Моделировании`.
<hr>
### Анализ данных
После генерации ***отклика*** и ***факторов*** можно приступать к анализу данных.
<hr>
### Дисперсионный анализ
1. Перейдите в меню `Анализ данных`.
2. Выберите `Дисперсионный анализ`.
<image src="files/Анализ данных - Дисперсионный анализ.PNG">
*Пример пункта меню* `Дисперсионный анализ`
После этого откроется окно `Дисперсионный анализ`:
<image src="files/Окно - Дисперсионный анализ.PNG">
*Пример окна* `Дисперсионный анализ`
<hr>
### Корреляционный анализ
1. Перейдите в меню `Анализ данных`.
2. Выберите `Корреляционный анализ`.
<image src="files/Анализ данных - Корреляционный анализ.PNG">
*Пример пункта меню* `Корреляционный анализ`
После этого откроется окно `Корреляционный анализ`:
<image src="files/Окно - Корреляционный анализ.PNG">
*Пример окна* `Корреляционный анализ`
<hr>
### Моделирование
После генерации отклика и факторов можно перейти к построению регрессионных моделей.
Здесь вы можете увидеть параметры модели, её характеристики, прогноз и отклонения, а также график прогноза и отклонения.
1. Перейдите на вкладку `Моделирование`.
2. Выберите тип модели для построения: `Линейный полином`, `Квадратичный полином` или `Преобразования`.
<image src="files/Моделирование - Линейный полином.PNG">
*Пример список пунктов меню* `Моделирование`
На странице `Модель` любого окна из `Моделирование` можно увидеть данные ***Коэффициент регрессии*** и ***Коэффициент значимости*** в виде таблицы для отклика и каждого из факторов. В нижней части окна располагаются вычисленные значения для параметров: ***Остаточная дисперсия***, ***Остаточная дисперсия (масштабированная)***, ***F1 - отношение Фишера***, ***Коэффициент множественной детерминации***,
<image src="files/Окно - Полином (Линейный полином).PNG">
*Пример страницы* `Модель` *окна* `Линейный полином`
На странице `Прогноз` любого окна из `Моделирование` можно увидеть значения ***Прогноза*** и ***Отклонения*** для каждого ранее сгенерированного значения ***Отклика***.
<image src="files/Окно - Полином - Прогноз.PNG">
*Пример страницы* `Прогноз` *окна* `Линейный полином`
На странице `График` любого окна из `Моделирование` можно увидеть график ***Прогноза*** (график) и ***Отклонения*** (точки).
<image src="files/Окно - Полином - График.PNG">
*Пример страницы* `График` *окна* `Линейный полином`
При необходимости, в окне `Моделирование` - `Преобразования` для каждого фактора вы можете выбрать одно из доступных преобразований.
<image src="files/Окно - Полином (Преобразования).PNG">
*Пример окна* `Преобразования`
Для выбора преобразования для определенного фактора необходимо выполнить следующие шаги:
1. Перейдите на страницу `Модель` в окне `Преобразования`.
2. Дважды нажмите на нужную ячейку в колонке ***Преобразования***.
3. Выберите необходимое преобразование из выпадающего списка.
<image src="files/Преобразования - Выбор преобразования.PNG">
*Пример списка выбора* ***Преобразования*** *фактора в окне* `Преобразования`
*Комментарий: если значения не персчитались попробуйте снять выделение с ячейки, путем нажатия на другую ячейку*
<hr>
### Сохранение и открытие файла
Сгенерированные значения ***отклика*** и ***фактора*** из таблицы в `Главном окне` можно сохранить или зугрузить из файла ***.txt*** и ***.csv***.
### Сохранение файла
1. Перейдите в меню `Файл`.
2. Выберите `Сохранить`.
<image src="files/Файл - Сохранить.PNG">
*Пример пункта меню* `Сохранить файл`
3. Выберите путь сохранения и тип файла и нажмите кнопку `Сохранить`.
Теперь файл будет сохранен по указаному вами пути, его можно переместить куда необходимо и при необходимости загрузить обратно в приложение.
### Открытие файла
1. Перейдите в меню `Файл`.
2. Выберите `Открыть`.
<image src="files/Файл - Открыть.PNG">
*Пример пункта меню* `Открыть файл`
3. Выберите путь до открываемого файла и нажмите кнопку `Открыть`.
Приложение загрузит нужный вам файл, и при необходимости спросит нужно ли сохранять ваши текущие данные.

BIN
statapp/docs/README.pdf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

36
statapp/docs/grip.css Normal file
View File

@ -0,0 +1,36 @@
/*
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/>.
*/
#preview-page {
margin-top: 0px;
margin-bottom: 0px;
}
#readme {
border: none;
}
#readme > .Box-header {
border: none;
display: none !important;
}
#readme > .Box-body {
border: none;
}

View File

@ -1,9 +1,28 @@
#
# 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 Slot
from PySide2.QtWidgets import QDialog
from statapp.ui.ui_generate_factor_window import Ui_GenerateFactorWindow
from statapp.models.combobox_model import ComboBoxModel
from statapp.utils import addIcon
DIRECT_LINK = 0
INDIRECT_LINK = 1
@ -24,6 +43,8 @@ class GenerateFactorWindow(QDialog):
self.ui.setupUi(self)
self.ui.typeComboBox.setModel(self._typeComboBox)
addIcon(self)
@Slot()
def on_generatePushButton_clicked(self):
self.typeConnection = self._typeComboBox.rawData(self.ui.typeComboBox.currentIndex())[0]

View File

@ -1,7 +1,27 @@
#
# 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 Slot
from PySide2.QtWidgets import QDialog
from statapp.ui.ui_generate_window import Ui_GenerateWindow
from statapp.utils import addIcon
class GenerateWindow(QDialog):
@ -13,6 +33,9 @@ class GenerateWindow(QDialog):
self.ui = Ui_GenerateWindow()
self.ui.setupUi(self)
addIcon(self)
@Slot()
def on_generatePushButton_clicked(self):

View File

@ -1,13 +1,45 @@
#
# 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 Slot, QLocale
from PySide2.QtWidgets import QMainWindow, QMessageBox, QApplication
from PySide2 import QtCore
from PySide2.QtCore import Slot, Qt, QPoint
from PySide2.QtWidgets import QMainWindow, QMessageBox, QAction, QMenu
from statapp.generate_factor_window import GenerateFactorWindow, INDIRECT_LINK
from statapp.models.data_model import DataModel
from statapp.calculations import generateXValues, generateYValues
from statapp.constants import NUMBERS_PRECISION
from statapp.distribution_window import NormalDistributionWindow, UniformDistributionWindow, \
ExponentialDistributionWindow
from statapp.generate_factor_window import GenerateFactorWindow
from statapp.polynoms.linear_polynom_window import LinearPolynomWindow
from statapp.mathtex_header_view import MathTexHeaderView
from statapp.models.input_values_model import InputValuesModel
from statapp.generate_window import GenerateWindow
from statapp.about_window import AboutWindow
from statapp.models.fileslc_model import FileSLCModel
from statapp.polynoms.squared_polynom_window import SquaredPolynomWindow
from statapp.ui.ui_main_window import Ui_MainWindow
from statapp.usage_window import UsageWindow
from statapp.utils import buildMessageBox, addIcon, FloatDelegate, onError
from statapp.variance_analysis import VarianceAnalysisWindow
from statapp.correlation_analysis import CorrelationAnalysisWindow
from statapp.polynoms.transform_polynom_window import TransformPolynomWindow
class MainWindow(QMainWindow):
@ -17,120 +49,252 @@ class MainWindow(QMainWindow):
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
addIcon(self)
self.mainActions = [
self.ui.varianceAnalysisAction,
self.ui.correlationAnalisisAction,
self.ui.linearPolynomAction,
self.ui.squaredPolynomAction,
self.ui.transformPolynomAction,
]
self.aboutWindow = None
self.usageWindow = None
self.isDataChanged = False
self.model = DataModel()
self.model = InputValuesModel()
self.fileModel = FileSLCModel()
self.ui.tableView.setItemDelegate(FloatDelegate())
self.ui.tableView.setModel(self.model)
self.ui.tableView.setHorizontalHeader(
MathTexHeaderView(self.ui.tableView, orientation=QtCore.Qt.Horizontal)
)
self.model.layoutChanged.connect(self.updateActionsEnabled)
self.updateActionsEnabled()
#
# Для быстрой отладки
# n = 10
# y = generateYValues(100, 5, n)
# x1 = generateXValues(20, 2, 0, y)
# x2 = generateXValues(10, 1, 0, y)
# self.model.updateAllData(np.concatenate([y, x1, x2], axis=1))
self.ui.tableView.horizontalHeader().setContextMenuPolicy(Qt.CustomContextMenu)
self.ui.tableView.horizontalHeader().customContextMenuRequested.connect(self.removeColumn)
def removeColumn(self, event: QPoint):
menu = QMenu(self)
col = self.ui.tableView.columnAt(event.x())
if col == 0:
return
def fun():
self.model.removeCol(col)
self.isDataChanged = True
selectAction = QAction("Удалить", self)
selectAction.triggered.connect(fun)
menu.addAction(selectAction)
menu.exec_(self.ui.tableView.mapToGlobal(event))
def updateActionsEnabled(self):
data = self.model.getData()
# есть только отклик
if data.shape[1] == 1:
self.ui.generateXaction.setEnabled(True)
self.ui.uniformDistributionAction.setEnabled(True)
self.ui.normalDistributionAction.setEnabled(True)
self.ui.exponentialDistributionAction.setEnabled(True)
self.setEnabledMainActions(False)
# есть отклик и фактор(ы)
elif data.shape[1] > 1:
self.ui.generateXaction.setEnabled(True)
self.ui.uniformDistributionAction.setEnabled(True)
self.ui.normalDistributionAction.setEnabled(True)
self.ui.exponentialDistributionAction.setEnabled(True)
self.setEnabledMainActions(True)
else:
self.ui.generateXaction.setEnabled(False)
self.ui.uniformDistributionAction.setEnabled(False)
self.ui.normalDistributionAction.setEnabled(False)
self.ui.exponentialDistributionAction.setEnabled(False)
self.setEnabledMainActions(False)
def setEnabledMainActions(self, enabled):
for action in self.mainActions:
action.setEnabled(enabled)
@Slot()
def on_openfileaction_triggered(self):
current_data = self.model.getData()
if current_data.size > 1:
file = ''
if self.fileModel.file_name:
file = '\nФайл сохранения:' + self.fileModel.file_name
try:
currentData = self.model.getData()
data = np.array([])
if currentData.size > 1:
file = ''
if self.fileModel.fileName:
file = '\nФайл сохранения: ' + self.fileModel.fileName
msgBox = self.createMessageBox \
('Сохранение данных',
"Сохранить данные?" + file,
QMessageBox.Question,
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel,
QMessageBox.Cancel)
msgBox = buildMessageBox \
('Сохранение данных',
"Сохранить данные?" + file,
QMessageBox.Question,
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel,
QMessageBox.Cancel)
reply = msgBox.exec_()
if reply == QMessageBox.StandardButton.Yes:
self.fileModel.saveFile(self.model.getData())
elif reply == QMessageBox.StandardButton.Cancel:
return
reply = msgBox.exec_()
if reply == QMessageBox.StandardButton.Yes:
self.fileModel.saveFile(self.model.getData())
data = self.fileModel.loadFile()
if data is not None and data.shape[0] > 0:
self.model.updateAllData(data)
self.isDataChanged = False
elif reply == QMessageBox.StandardButton.Cancel:
return
else:
data = self.fileModel.loadFile()
if data is not None and data.shape[0] > 0:
self.model.updateAllData(data)
self.isDataChanged = False
else:
data = self.fileModel.loadFile()
if data is not None:
if data is not None and data.shape[0] > 0:
self.model.updateAllData(data)
self.isDataChanged = True
else:
data = self.fileModel.loadFile()
if data is not None:
self.model.updateAllData(data)
self.isDataChanged = True
self.isDataChanged = False
except Exception as error:
onError(error)
@Slot()
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()
def on_closefileaction_triggered(self):
self.fileModel.closeFile()
self.isDataChanged = False
try:
self.fileModel.closeFile()
self.isDataChanged = False
except Exception as error:
onError(error)
@Slot()
def on_generateYaction_triggered(self):
gw = GenerateWindow()
if gw.exec():
y = np.random.normal(gw.mat, gw.deviation, size=(gw.count, 1))
self.model.updateAllData(y)
self.isDataChanged = True
try:
gw = GenerateWindow()
if gw.exec():
y = generateYValues(gw.mat, gw.deviation, gw.count)
self.model.updateAllData(y.round(NUMBERS_PRECISION))
self.isDataChanged = True
except Exception as error:
onError(error)
@Slot()
def on_generateXaction_triggered(self):
gfw = GenerateFactorWindow()
try:
gfw = GenerateFactorWindow()
# dd = np.array([])
if gfw.exec():
y = self.model.getY()
yMat = np.mean(y)
x_arr = np.array([])
for cur_y in y:
k = np.abs(cur_y / yMat)
if k > 1:
k = 2 - 1 / k
if gfw.typeConnection == INDIRECT_LINK:
k = 1 / k
if gfw.deviation == 0:
k = 1
x = np.random.normal(gfw.mat * (k ** 3), gfw.deviation * k, size=1)
x_arr = np.append(x_arr, x)
# if (x > gfw.mat and cur_y > yMat) or (x < gfw.mat and cur_y < yMat):
# dd = np.append(dd, 1)
# else:
# dd = np.append(dd, 0)
data = self.model.getData()
x_arr = x_arr.reshape(len(x_arr), 1)
# dd = dd.reshape(len(dd), 1)
data = np.concatenate((data, x_arr), axis=1)
# data = np.concatenate((data, dd), axis=1)
self.model.updateAllData(data)
self.isDataChanged = True
if gfw.exec():
data = self.model.getData()
y = self.model.getY()
xValues = generateXValues(gfw.mat, gfw.deviation, gfw.typeConnection, y)
data = np.concatenate((data, xValues.round(NUMBERS_PRECISION)), axis=1)
self.model.updateAllData(data)
self.isDataChanged = True
except Exception as error:
onError(error)
@Slot()
def on_aboutmenuaction_triggered(self):
global about_window
about_window = AboutWindow()
about_window.show()
self.aboutWindow = AboutWindow()
self.aboutWindow.show()
def createMessageBox(self, title, text, icon, buttons, defaultButton):
msgBox = QMessageBox()
@Slot()
def on_usageaction_triggered(self):
self.usageWindow = UsageWindow()
self.usageWindow.show()
msgBox.setIcon(icon)
msgBox.setWindowTitle(title)
msgBox.setText(text)
msgBox.setStandardButtons(buttons)
msgBox.setDefaultButton(defaultButton)
@Slot()
def on_varianceAnalysisAction_triggered(self):
try:
dw = VarianceAnalysisWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
return msgBox
@Slot()
def on_correlationAnalisisAction_triggered(self):
try:
dw = CorrelationAnalysisWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
@Slot()
def on_linearPolynomAction_triggered(self):
try:
dw = LinearPolynomWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
@Slot()
def on_squaredPolynomAction_triggered(self):
try:
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)
@Slot()
def on_uniformDistributionAction_triggered(self):
try:
dw = UniformDistributionWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
@Slot()
def on_normalDistributionAction_triggered(self):
try:
dw = NormalDistributionWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
@Slot()
def on_exponentialDistributionAction_triggered(self):
try:
dw = ExponentialDistributionWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
def closeEvent(self, event):
if self.isDataChanged:
file = ''
if self.fileModel.file_name:
file = '\nФайл сохранения:' + self.fileModel.file_name
if self.fileModel.fileName:
file = '\nФайл сохранения: ' + self.fileModel.fileName
msgBox = self.createMessageBox \
msgBox = buildMessageBox \
('Завершение работы',
"Сохранить данные?" + file,
QMessageBox.Question,

View File

@ -0,0 +1,107 @@
#
# 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 matplotlib.pyplot as plt
import matplotlib as mpl
import sympy
from PySide2 import QtCore, QtGui
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QHeaderView, QStyleOptionHeader, QStyle
from matplotlib.backends.backend_agg import FigureCanvasAgg
# Основано на https://stackoverflow.com/questions/32035251/
plt.rc('mathtext', fontset='cm')
def mathTexToQPixMap(mathTex, fs):
# ---- set up a mpl figure instance ----
fig = mpl.figure.Figure()
fig.patch.set_facecolor('none')
fig.set_canvas(FigureCanvasAgg(fig))
renderer = fig.canvas.get_renderer()
# ---- plot the mathTex expression ----
ax = fig.add_axes([0, 0, 1, 1])
ax.axis('off')
ax.patch.set_facecolor('none')
t = ax.text(0, 0, f'${mathTex}$', ha='left', va='bottom', fontsize=fs)
# ---- fit figure size to text artist ----
fWidth, fHeight = fig.get_size_inches()
figBBox = fig.get_window_extent(renderer)
textBBox = t.get_window_extent(renderer)
tightFWidth = textBBox.width * fWidth / figBBox.width
tightFHeight = textBBox.height * fHeight / figBBox.height
fig.set_size_inches(tightFWidth, tightFHeight)
# ---- convert mpl figure to QPixmap ----
buf, size = fig.canvas.print_to_buffer()
return QtGui.QPixmap(
QtGui.QImage.rgbSwapped(
QtGui.QImage(
buf, size[0], size[1], QtGui.QImage.Format_ARGB32
)
)
)
class CacheQPixMap(dict):
def get(self, __key):
v = super().get(__key)
if v is None:
v = mathTexToQPixMap(sympy.latex(sympy.sympify(__key)), 14)
super().__setitem__(__key, v)
return v
class MathTexHeaderView(QHeaderView):
def __init__(self, view, orientation=QtCore.Qt.Vertical):
super().__init__(orientation, view)
if orientation == QtCore.Qt.Vertical:
self.setStyleSheet(
"QHeaderView::section { padding-left: 15px; padding-right: 15px }"
)
self.converter = CacheQPixMap()
def paintSection(self, painter, rect, logicalIndex):
opt = QStyleOptionHeader()
self.initStyleOption(opt)
opt.rect = rect
opt.section = logicalIndex
opt.text = ""
mousePos = self.mapFromGlobal(QtGui.QCursor.pos())
if rect.contains(mousePos):
opt.state |= QStyle.State_MouseOver
painter.save()
self.style().drawControl(QStyle.CE_Header, opt, painter, self)
painter.restore()
data = self.model().headerData(logicalIndex, self.orientation(), Qt.DisplayRole)
if data:
qPixMap = self.converter.get(data)
xPix = (rect.width() - qPixMap.size().width()) / 2. + rect.x()
yPix = (rect.height() - qPixMap.size().height()) / 2. + rect.y()
rect = QtCore.QRect(xPix, yPix, qPixMap.size().width(),
qPixMap.size().height())
painter.drawPixmap(rect, qPixMap)

View File

@ -1,3 +1,22 @@
#
# 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 QAbstractListModel, Qt

View File

@ -0,0 +1,39 @@
#
# 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 QModelIndex, Qt
from statapp.models.ro_table_model import ROTableModel
from statapp.models.utils import yxHeader
class CorrelationAnalysisModel(ROTableModel):
def __init__(self, data):
super().__init__(data)
def getHorizontalHeader(self):
return yxHeader(self.columnCount(QModelIndex()))
def getVerticalHeader(self):
return yxHeader(self.rowCount(QModelIndex()))
def data(self, index, role):
if role == Qt.DisplayRole and index.column() <= index.row():
return super().data(index, role)
return None

View File

@ -1,59 +0,0 @@
import numpy as np
from PySide2 import QtCore
from PySide2.QtCore import Qt
class DataModel(QtCore.QAbstractTableModel):
def __init__(self, data=np.array([[]], dtype=np.float32)):
super().__init__()
self._data = data
def updateAllData(self, data):
self.layoutAboutToBeChanged.emit()
self._data = data
self.layoutChanged.emit()
def rowCount(self, index):
return self._data.shape[0]
def columnCount(self, index):
return self._data.shape[1]
def headerData(self, section: int, orientation: Qt.Orientation, role: int = ...):
if role == Qt.DisplayRole:
# if orientation == Qt.Orientation.Horizontal:
if section == 0:
return 'Y'
return f'X{section}'
return None
def flags(self, index):
return Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsEditable
def setData(self, index, value, role):
if role == Qt.EditRole:
try:
value = float(value)
except ValueError:
return False
self._data[index.row(), index.column()] = value
return True
return False
def getData(self):
return self._data
def getY(self):
return self._data[:, 0]
def data(self, index, role):
if role == Qt.DisplayRole or role == Qt.EditRole:
# ?
return float(self._data[index.row(), index.column()])
return None

View File

@ -0,0 +1,49 @@
#
# 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.ro_table_model import ROTableModel
class EditableTableModel(ROTableModel):
def __init__(self, data=np.array([[]], dtype=np.float32)):
super().__init__()
self._data = data
def flags(self, index):
return Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsEditable
def setData(self, index, value, role):
if role == Qt.EditRole:
try:
value = float(value)
except ValueError:
return False
self._data[index.row(), index.column()] = value
return True
return False
def data(self, index, role):
if role in (Qt.DisplayRole, Qt.EditRole):
return super().data(index, Qt.DisplayRole)
return None

View File

@ -1,33 +1,85 @@
#
# 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.QtWidgets import QFileDialog, QMessageBox
from statapp.constants import NUMBERS_PRECISION
from statapp.utils import buildMessageBox
class FileSLCModel:
def __init__(self):
super().__init__()
self.file_name = None
self.fileName = None
def saveFile(self, data):
if not self.file_name:
self.file_name, _ = QFileDialog.getSaveFileName(None, "Сохранить файл", "", "Text Files (*.txt);;CSV Files (*.csv)")
if self.file_name:
np.savetxt(self.file_name, data, delimiter=",")
return True
# pylint: disable=duplicate-code
if self.fileName:
file = '\nФайл сохранения: ' + self.fileName
msgBox = buildMessageBox \
('Сохранение данных',
"Сохранить данные в текущий файл?" + file,
QMessageBox.Question,
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel,
QMessageBox.Cancel)
reply = msgBox.exec_()
if reply == QMessageBox.StandardButton.Yes:
np.savetxt(self.fileName, data, delimiter=",", fmt='%10.5f')
return True
if reply == QMessageBox.StandardButton.No:
self.fileName, _ = QFileDialog.getSaveFileName(
None, "Сохранить файл", "", "Text Files (*.txt);;CSV Files (*.csv)"
)
if self.fileName:
np.savetxt(self.fileName, data, delimiter=",", fmt='%10.5f')
return True
else:
self.fileName, _ = QFileDialog.getSaveFileName(
None, "Сохранить файл", "", "Text Files (*.txt);;CSV Files (*.csv)"
)
if self.fileName:
np.savetxt(self.fileName, data, delimiter=",", fmt=f"%.{NUMBERS_PRECISION}f")
return True
return False
def loadFile(self):
self.file_name, _ = QFileDialog.getOpenFileName(None, "Загрузить файл", "", "Files (*.txt *.csv)")
if self.file_name:
self.fileName, _ = QFileDialog.getOpenFileName(
None, "Загрузить файл", "", "Files (*.txt *.csv)"
)
if self.fileName:
try:
content = np.genfromtxt(self.file_name, delimiter=',', invalid_raise=True)
except ValueError as e:
content = np.genfromtxt(self.fileName, delimiter=',', invalid_raise=True, ndmin=2)
except ValueError:
QMessageBox.warning \
(None,
'Ошибка',
"Ошибка чтения файла!\nФайл нельзя открыть или файл неверного формата")
self.fileName = None
return None
return content
return None
def closeFile(self):
self.file_name = None
pass
self.fileName = None

View File

@ -0,0 +1,38 @@
#
# 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 QModelIndex
from statapp.models.editable_table_model import EditableTableModel
from statapp.models.utils import yxHeader
class InputValuesModel(EditableTableModel):
def __init__(self, data=np.array([[]], dtype=np.float32)):
super().__init__(data)
def getHorizontalHeader(self):
return yxHeader(self.columnCount(QModelIndex()))
def getY(self):
return self._data[:, 0]
def removeCol(self, index: int):
self.updateAllData(np.delete(self._data, index, axis=1))

View 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)

View File

@ -0,0 +1,34 @@
#
# 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 statapp.calculations import RegressionResult
from statapp.models.ro_table_model import ROTableModel
class RegressionResultModel(ROTableModel):
def __init__(self, result: RegressionResult):
data = result.paramsAndImportance
super().__init__(data)
self._monomials = result.monomials
def getHorizontalHeader(self):
return ['Коэффициент регрессии', 'Коэффициент значимости', 'Весовые коэффициенты']
def getVerticalHeader(self):
return self._monomials

View File

@ -0,0 +1,67 @@
#
# 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 import QtCore
from PySide2.QtCore import Qt
from statapp.utils import safeListGet
class ROTableModel(QtCore.QAbstractTableModel):
def __init__(self,
data=np.array([[]], dtype=np.float32),
):
super().__init__()
self._data = data
self._headers = {
Qt.Vertical: self.getVerticalHeader,
Qt.Horizontal: self.getHorizontalHeader,
}
def updateAllData(self, data):
self.layoutAboutToBeChanged.emit()
self._data = data
self.layoutChanged.emit()
def rowCount(self, index):
return self._data.shape[0]
def columnCount(self, index):
return self._data.shape[1]
def getVerticalHeader(self):
return []
def getHorizontalHeader(self):
return []
def headerData(self, section: int, orientation: Qt.Orientation, role: int = ...):
if role == Qt.DisplayRole:
return safeListGet(self._headers[orientation](), section, None)
return None
def getData(self):
return self._data
def data(self, index, role):
if role == Qt.DisplayRole:
return float(self._data[index.row(), index.column()])
return None

View 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()

21
statapp/models/utils.py Normal file
View File

@ -0,0 +1,21 @@
#
# 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/>.
#
def yxHeader(count):
return ['y'] + [f'x{i}' for i in range(1, count)]

View File

@ -0,0 +1,34 @@
#
# 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 QModelIndex
from statapp.models.ro_table_model import ROTableModel
from statapp.models.utils import yxHeader
class VarianceAnalysisModel(ROTableModel):
def __init__(self, data):
super().__init__(data)
def getHorizontalHeader(self):
return ['Мат. ожидание', 'Среднекв. отклонение', 'Минимум', 'Максимум']
def getVerticalHeader(self):
return yxHeader(self.rowCount(QModelIndex()))

View File

@ -0,0 +1,27 @@
#
# 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 statapp.calculations import linearPolynom
from statapp.polynoms.polynom_window import PolynomWindow
class LinearPolynomWindow(PolynomWindow):
def __init__(self, data):
result = linearPolynom(data)
super().__init__(data, result, "Линейный полином")

View File

@ -0,0 +1,85 @@
#
# 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.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.models.prediction_table_model import PreditionTableModel
from statapp.models.regression_result_model import RegressionResultModel
from statapp.ui.ui_polynom_window import Ui_PolynomWindow
from statapp.utils import addIcon, FloatDelegate
matplotlib.use('Qt5Agg')
class MplCanvas(FigureCanvasQTAgg):
def __init__(self, parent=None, width=5, height=4, dpi=100):
fig = Figure(figsize=(width, height), dpi=dpi)
self.axes = fig.add_subplot()
super().__init__(fig)
class PolynomWindow(QDialog):
def __init__(self, data, result, windowTitle):
super().__init__()
self.ui = Ui_PolynomWindow()
self.ui.setupUi(self)
addIcon(self)
self.setWindowTitle(windowTitle)
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))
self.ui.scaledResidualVarianceValueLabel.setText(str(result.scaledResidualVariance))
self.ui.fStatisticValueLabel.setText(str(result.fStatistic))
self.ui.rSquaredValueLabel.setText(str(result.rSquared))
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]
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)

View File

@ -0,0 +1,27 @@
#
# 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 statapp.calculations import squaredPolynom
from statapp.polynoms.polynom_window import PolynomWindow
class SquaredPolynomWindow(PolynomWindow):
def __init__(self, data):
result = squaredPolynom(data)
super().__init__(data, result, "Квадратичный полином")

View File

@ -0,0 +1,119 @@
#
# 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.rSquared))
self.model.dataChanged.connect(self.on_data_changed)
def on_data_changed(self):
data = np.copy(self.data)
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.rSquared))

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CorrelationAnalysisWindow</class>
<widget class="QDialog" name="CorrelationAnalysisWindow">
<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>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Генерация факторов</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
@ -71,6 +71,9 @@
<pointsize>12</pointsize>
</font>
</property>
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>1000000.000000000000000</double>
</property>
@ -83,6 +86,9 @@
<pointsize>12</pointsize>
</font>
</property>
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>1000000.000000000000000</double>
</property>
@ -95,15 +101,6 @@
<pointsize>12</pointsize>
</font>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string/>
</property>
<property name="placeholderText">
<string/>
</property>
</widget>
</item>
</layout>

View File

@ -16,7 +16,7 @@
</font>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Генерация откликов</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
@ -44,6 +44,9 @@
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="matSpinBox">
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>1000000.000000000000000</double>
</property>
@ -68,6 +71,9 @@
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="deviationSpinBox">
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>1000000.000000000000000</double>
</property>

BIN
statapp/ui/images/logo.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 2.9 MiB

View File

@ -40,7 +40,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>21</height>
<height>29</height>
</rect>
</property>
<widget class="QMenu" name="filemenu">
@ -62,22 +62,37 @@
<property name="title">
<string>Анализ данных</string>
</property>
<addaction name="varianceAnalysisAction"/>
<addaction name="correlationAnalisisAction"/>
</widget>
<widget class="QMenu" name="modelmenu">
<property name="title">
<string>Моделирование</string>
</property>
<addaction name="linearPolynomAction"/>
<addaction name="squaredPolynomAction"/>
<addaction name="transformPolynomAction"/>
</widget>
<widget class="QMenu" name="helpmenu">
<property name="title">
<string>Справка</string>
</property>
<addaction name="usageaction"/>
<addaction name="aboutmenuaction"/>
</widget>
<widget class="QMenu" name="menu">
<property name="title">
<string>Распределения</string>
</property>
<addaction name="uniformDistributionAction"/>
<addaction name="normalDistributionAction"/>
<addaction name="exponentialDistributionAction"/>
</widget>
<addaction name="filemenu"/>
<addaction name="generatemenu"/>
<addaction name="analyzemenu"/>
<addaction name="modelmenu"/>
<addaction name="menu"/>
<addaction name="helpmenu"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
@ -111,6 +126,51 @@
<string>Закрыть</string>
</property>
</action>
<action name="varianceAnalysisAction">
<property name="text">
<string>Дисперсионный анализ</string>
</property>
</action>
<action name="correlationAnalisisAction">
<property name="text">
<string>Корреляционный анализ</string>
</property>
</action>
<action name="linearPolynomAction">
<property name="text">
<string>Линейный полином</string>
</property>
</action>
<action name="squaredPolynomAction">
<property name="text">
<string>Квадратичный полином</string>
</property>
</action>
<action name="transformPolynomAction">
<property name="text">
<string>Преобразования</string>
</property>
</action>
<action name="usageaction">
<property name="text">
<string>Использование</string>
</property>
</action>
<action name="uniformDistributionAction">
<property name="text">
<string>Равномерное</string>
</property>
</action>
<action name="normalDistributionAction">
<property name="text">
<string>Нормальное</string>
</property>
</action>
<action name="exponentialDistributionAction">
<property name="text">
<string>Экспоненциальное</string>
</property>
</action>
</widget>
<resources/>
<connections/>

View File

@ -0,0 +1,146 @@
<?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>537</width>
<height>444</height>
</rect>
</property>
<property name="windowTitle">
<string>Полином</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="6">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="model">
<attribute name="title">
<string>Модель</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="3">
<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="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>
</layout>
</widget>
<widget class="QWidget" name="prediction">
<attribute name="title">
<string>Прогноз</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QTableView" name="predictionTableView">
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>График</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5" rowstretch="1,0">
<item row="0" column="0">
<layout class="QGridLayout" name="plotContainer"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Точки - отклик. Линия - прогноз</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,4 +1,24 @@
# -*- coding: utf-8 -*-
#
# 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/>.
#
################################################################################
## Form generated from reading UI file 'about_window.ui'

View File

@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
#
# 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/>.
#
################################################################################
## Form generated from reading UI file 'correlation_analysis_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_CorrelationAnalysisWindow(object):
def setupUi(self, CorrelationAnalysisWindow):
if not CorrelationAnalysisWindow.objectName():
CorrelationAnalysisWindow.setObjectName(u"CorrelationAnalysisWindow")
CorrelationAnalysisWindow.resize(630, 400)
self.gridLayout_2 = QGridLayout(CorrelationAnalysisWindow)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.gridLayout = QGridLayout()
self.gridLayout.setObjectName(u"gridLayout")
self.tableView = QTableView(CorrelationAnalysisWindow)
self.tableView.setObjectName(u"tableView")
self.gridLayout.addWidget(self.tableView, 0, 0, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
self.retranslateUi(CorrelationAnalysisWindow)
QMetaObject.connectSlotsByName(CorrelationAnalysisWindow)
# setupUi
def retranslateUi(self, CorrelationAnalysisWindow):
CorrelationAnalysisWindow.setWindowTitle(QCoreApplication.translate("CorrelationAnalysisWindow", u"\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437", None))
# retranslateUi

View File

@ -1,89 +1,89 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'generate_factor_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 *
#
# 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, QtGui, QtWidgets
class Ui_GenerateFactorWindow(object):
def setupUi(self, GenerateFactorWindow):
if not GenerateFactorWindow.objectName():
GenerateFactorWindow.setObjectName(u"GenerateFactorWindow")
GenerateFactorWindow.setObjectName("GenerateFactorWindow")
GenerateFactorWindow.resize(503, 193)
self.gridLayout_2 = QGridLayout(GenerateFactorWindow)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.gridLayout = QGridLayout()
self.gridLayout.setObjectName(u"gridLayout")
self.label = QLabel(GenerateFactorWindow)
self.label.setObjectName(u"label")
font = QFont()
self.gridLayout_2 = QtWidgets.QGridLayout(GenerateFactorWindow)
self.gridLayout_2.setObjectName("gridLayout_2")
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(GenerateFactorWindow)
font = QtGui.QFont()
font.setPointSize(12)
self.label.setFont(font)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.label_3 = QLabel(GenerateFactorWindow)
self.label_3.setObjectName(u"label_3")
self.label_3 = QtWidgets.QLabel(GenerateFactorWindow)
font = QtGui.QFont()
font.setPointSize(12)
self.label_3.setFont(font)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
self.generatePushButton = QPushButton(GenerateFactorWindow)
self.generatePushButton.setObjectName(u"generatePushButton")
self.generatePushButton = QtWidgets.QPushButton(GenerateFactorWindow)
font = QtGui.QFont()
font.setPointSize(12)
self.generatePushButton.setFont(font)
self.generatePushButton.setObjectName("generatePushButton")
self.gridLayout.addWidget(self.generatePushButton, 3, 0, 1, 2)
self.label_2 = QLabel(GenerateFactorWindow)
self.label_2.setObjectName(u"label_2")
self.label_2 = QtWidgets.QLabel(GenerateFactorWindow)
font = QtGui.QFont()
font.setPointSize(12)
self.label_2.setFont(font)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
self.matSpinBox = QDoubleSpinBox(GenerateFactorWindow)
self.matSpinBox.setObjectName(u"matSpinBox")
self.matSpinBox = QtWidgets.QDoubleSpinBox(GenerateFactorWindow)
font = QtGui.QFont()
font.setPointSize(12)
self.matSpinBox.setFont(font)
self.matSpinBox.setMaximum(1000000.000000000000000)
self.matSpinBox.setDecimals(5)
self.matSpinBox.setMaximum(1000000.0)
self.matSpinBox.setObjectName("matSpinBox")
self.gridLayout.addWidget(self.matSpinBox, 1, 1, 1, 1)
self.deviationSpinBox = QDoubleSpinBox(GenerateFactorWindow)
self.deviationSpinBox.setObjectName(u"deviationSpinBox")
self.deviationSpinBox = QtWidgets.QDoubleSpinBox(GenerateFactorWindow)
font = QtGui.QFont()
font.setPointSize(12)
self.deviationSpinBox.setFont(font)
self.deviationSpinBox.setMaximum(1000000.000000000000000)
self.deviationSpinBox.setDecimals(5)
self.deviationSpinBox.setMaximum(1000000.0)
self.deviationSpinBox.setObjectName("deviationSpinBox")
self.gridLayout.addWidget(self.deviationSpinBox, 2, 1, 1, 1)
self.typeComboBox = QComboBox(GenerateFactorWindow)
self.typeComboBox.setObjectName(u"typeComboBox")
self.typeComboBox = QtWidgets.QComboBox(GenerateFactorWindow)
font = QtGui.QFont()
font.setPointSize(12)
self.typeComboBox.setFont(font)
self.typeComboBox.setEditable(False)
self.typeComboBox.setObjectName("typeComboBox")
self.gridLayout.addWidget(self.typeComboBox, 0, 1, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
self.retranslateUi(GenerateFactorWindow)
QMetaObject.connectSlotsByName(GenerateFactorWindow)
# setupUi
QtCore.QMetaObject.connectSlotsByName(GenerateFactorWindow)
def retranslateUi(self, GenerateFactorWindow):
GenerateFactorWindow.setWindowTitle(QCoreApplication.translate("GenerateFactorWindow", u"Dialog", None))
self.label.setText(QCoreApplication.translate("GenerateFactorWindow", u"\u0422\u0438\u043f \u0441\u0432\u044f\u0437\u0438", None))
self.label_3.setText(QCoreApplication.translate("GenerateFactorWindow", u"\u0421\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435", None))
self.generatePushButton.setText(QCoreApplication.translate("GenerateFactorWindow", u"\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c", None))
self.label_2.setText(QCoreApplication.translate("GenerateFactorWindow", u"\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435", None))
self.typeComboBox.setCurrentText("")
self.typeComboBox.setPlaceholderText("")
# retranslateUi
GenerateFactorWindow.setWindowTitle(QtWidgets.QApplication.translate("GenerateFactorWindow", "Генерация факторов", None, -1))
self.label.setText(QtWidgets.QApplication.translate("GenerateFactorWindow", "Тип связи", None, -1))
self.label_3.setText(QtWidgets.QApplication.translate("GenerateFactorWindow", "Среднеквадратичное отклонение", None, -1))
self.generatePushButton.setText(QtWidgets.QApplication.translate("GenerateFactorWindow", "Сгенерировать", None, -1))
self.label_2.setText(QtWidgets.QApplication.translate("GenerateFactorWindow", "Математическое ожидание", None, -1))

View File

@ -1,4 +1,24 @@
# -*- coding: utf-8 -*-
#
# 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/>.
#
################################################################################
## Form generated from reading UI file 'generate_window.ui'
@ -42,6 +62,7 @@ class Ui_GenerateWindow(object):
self.matSpinBox = QDoubleSpinBox(GenerateWindow)
self.matSpinBox.setObjectName(u"matSpinBox")
self.matSpinBox.setDecimals(5)
self.matSpinBox.setMaximum(1000000.000000000000000)
self.gridLayout.addWidget(self.matSpinBox, 1, 1, 1, 1)
@ -60,6 +81,7 @@ class Ui_GenerateWindow(object):
self.deviationSpinBox = QDoubleSpinBox(GenerateWindow)
self.deviationSpinBox.setObjectName(u"deviationSpinBox")
self.deviationSpinBox.setDecimals(5)
self.deviationSpinBox.setMaximum(1000000.000000000000000)
self.gridLayout.addWidget(self.deviationSpinBox, 2, 1, 1, 1)
@ -77,7 +99,7 @@ class Ui_GenerateWindow(object):
# setupUi
def retranslateUi(self, GenerateWindow):
GenerateWindow.setWindowTitle(QCoreApplication.translate("GenerateWindow", u"Dialog", None))
GenerateWindow.setWindowTitle(QCoreApplication.translate("GenerateWindow", u"\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u043e\u0432", None))
self.generatePushButton.setText(QCoreApplication.translate("GenerateWindow", u"\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c", None))
self.label_2.setText(QCoreApplication.translate("GenerateWindow", u"\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435", None))
self.label_3.setText(QCoreApplication.translate("GenerateWindow", u"\u0421\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435", None))

Some files were not shown because too many files have changed in this diff Show More