hossam 0.3.20__py3-none-any.whl → 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hossam/__init__.py +21 -26
- hossam/data_loader.py +16 -10
- hossam/hs_classroom.py +48 -38
- hossam/hs_gis.py +10 -6
- hossam/hs_plot.py +153 -150
- hossam/hs_prep.py +95 -85
- hossam/hs_stats.py +426 -548
- hossam/hs_timeserise.py +161 -152
- hossam/hs_util.py +44 -17
- {hossam-0.3.20.dist-info → hossam-0.4.1.dist-info}/METADATA +6 -107
- hossam-0.4.1.dist-info/RECORD +16 -0
- hossam/mcp/__init__.py +0 -12
- hossam/mcp/hs_classroom.py +0 -22
- hossam/mcp/hs_gis.py +0 -30
- hossam/mcp/hs_plot.py +0 -53
- hossam/mcp/hs_prep.py +0 -61
- hossam/mcp/hs_stats.py +0 -25
- hossam/mcp/hs_timeserise.py +0 -22
- hossam/mcp/hs_util.py +0 -30
- hossam/mcp/loader.py +0 -29
- hossam/mcp/server.py +0 -675
- hossam-0.3.20.dist-info/RECORD +0 -27
- hossam-0.3.20.dist-info/entry_points.txt +0 -2
- {hossam-0.3.20.dist-info → hossam-0.4.1.dist-info}/WHEEL +0 -0
- {hossam-0.3.20.dist-info → hossam-0.4.1.dist-info}/licenses/LICENSE +0 -0
- {hossam-0.3.20.dist-info → hossam-0.4.1.dist-info}/top_level.txt +0 -0
hossam/hs_plot.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
from __future__ import annotations
|
|
3
|
+
from types import SimpleNamespace
|
|
3
4
|
|
|
4
|
-
# ===================================================================
|
|
5
|
-
#
|
|
6
5
|
# ===================================================================
|
|
7
6
|
import numpy as np
|
|
8
7
|
import pandas as pd
|
|
@@ -11,23 +10,16 @@ import matplotlib.pyplot as plt
|
|
|
11
10
|
from matplotlib.pyplot import Axes
|
|
12
11
|
from math import sqrt
|
|
13
12
|
from pandas import DataFrame
|
|
14
|
-
from . import hs_fig
|
|
15
13
|
|
|
16
|
-
# ===================================================================
|
|
17
|
-
#
|
|
18
14
|
# ===================================================================
|
|
19
15
|
from scipy.stats import t
|
|
20
16
|
from scipy.spatial import ConvexHull
|
|
21
17
|
from statsmodels.graphics.gofplots import qqplot as sm_qqplot
|
|
22
18
|
from statsmodels.nonparametric.smoothers_lowess import lowess
|
|
23
19
|
|
|
24
|
-
# ===================================================================
|
|
25
|
-
#
|
|
26
20
|
# ===================================================================
|
|
27
21
|
from statannotations.Annotator import Annotator
|
|
28
22
|
|
|
29
|
-
# ===================================================================
|
|
30
|
-
#
|
|
31
23
|
# ===================================================================
|
|
32
24
|
from sklearn.metrics import (
|
|
33
25
|
mean_squared_error,
|
|
@@ -37,17 +29,27 @@ from sklearn.metrics import (
|
|
|
37
29
|
confusion_matrix
|
|
38
30
|
)
|
|
39
31
|
|
|
40
|
-
# ===================================================================
|
|
41
|
-
#
|
|
42
32
|
# ===================================================================
|
|
43
33
|
if pd.__version__ > "2.0.0":
|
|
44
34
|
pd.DataFrame.iteritems = pd.DataFrame.items
|
|
45
35
|
|
|
36
|
+
config = SimpleNamespace(
|
|
37
|
+
dpi=200,
|
|
38
|
+
width=800,
|
|
39
|
+
height=520,
|
|
40
|
+
font_size=10,
|
|
41
|
+
font_weight="normal",
|
|
42
|
+
frame_width=0.7,
|
|
43
|
+
line_width=1.5,
|
|
44
|
+
grid_alpha=0.3,
|
|
45
|
+
grid_width=0.5,
|
|
46
|
+
fill_alpha=0.3
|
|
47
|
+
)
|
|
46
48
|
|
|
47
49
|
# ===================================================================
|
|
48
50
|
# 기본 크기가 설정된 Figure와 Axes를 생성한다
|
|
49
51
|
# ===================================================================
|
|
50
|
-
def get_default_ax(width: int =
|
|
52
|
+
def get_default_ax(width: int = config.width, height: int = config.height, rows: int = 1, cols: int = 1, dpi: int = config.dpi, flatten: bool = False, ws: int | None = None, hs: int | None = None):
|
|
51
53
|
"""기본 크기의 Figure와 Axes를 생성한다.
|
|
52
54
|
|
|
53
55
|
Args:
|
|
@@ -80,14 +82,14 @@ def get_default_ax(width: int = hs_fig.width, height: int = hs_fig.height, rows:
|
|
|
80
82
|
if flatten and isinstance(ax, list):
|
|
81
83
|
for a in ax:
|
|
82
84
|
for spine in a.spines.values():
|
|
83
|
-
spine.set_linewidth(
|
|
85
|
+
spine.set_linewidth(config.frame_width)
|
|
84
86
|
elif isinstance(ax, np.ndarray):
|
|
85
87
|
for a in ax.flat:
|
|
86
88
|
for spine in a.spines.values():
|
|
87
|
-
spine.set_linewidth(
|
|
89
|
+
spine.set_linewidth(config.frame_width)
|
|
88
90
|
else:
|
|
89
91
|
for spine in ax.spines.values():
|
|
90
|
-
spine.set_linewidth(
|
|
92
|
+
spine.set_linewidth(config.frame_width)
|
|
91
93
|
|
|
92
94
|
return fig, ax
|
|
93
95
|
|
|
@@ -123,14 +125,14 @@ def finalize_plot(ax: Axes, callback: any = None, outparams: bool = False, save_
|
|
|
123
125
|
if grid:
|
|
124
126
|
if is_array:
|
|
125
127
|
for a in (ax.flat if isinstance(ax, np.ndarray) else ax):
|
|
126
|
-
a.grid(True, alpha=
|
|
128
|
+
a.grid(True, alpha=config.grid_alpha, linewidth=config.grid_width)
|
|
127
129
|
else:
|
|
128
|
-
ax.grid(True, alpha=
|
|
130
|
+
ax.grid(True, alpha=config.grid_alpha, linewidth=config.grid_width)
|
|
129
131
|
|
|
130
132
|
plt.tight_layout()
|
|
131
133
|
|
|
132
134
|
if save_path is not None:
|
|
133
|
-
plt.savefig(save_path, dpi=
|
|
135
|
+
plt.savefig(save_path, dpi=config.dpi * 2, bbox_inches='tight')
|
|
134
136
|
|
|
135
137
|
if outparams:
|
|
136
138
|
plt.show()
|
|
@@ -147,10 +149,10 @@ def lineplot(
|
|
|
147
149
|
hue: str = None,
|
|
148
150
|
marker: str = None,
|
|
149
151
|
palette: str = None,
|
|
150
|
-
width: int =
|
|
151
|
-
height: int =
|
|
152
|
-
linewidth: float =
|
|
153
|
-
dpi: int =
|
|
152
|
+
width: int = config.width,
|
|
153
|
+
height: int = config.height,
|
|
154
|
+
linewidth: float = config.line_width,
|
|
155
|
+
dpi: int = config.dpi,
|
|
154
156
|
save_path: str = None,
|
|
155
157
|
callback: any = None,
|
|
156
158
|
ax: Axes = None,
|
|
@@ -213,10 +215,10 @@ def boxplot(
|
|
|
213
215
|
yname: str = None,
|
|
214
216
|
orient: str = "v",
|
|
215
217
|
palette: str = None,
|
|
216
|
-
width: int =
|
|
217
|
-
height: int =
|
|
218
|
-
linewidth: float =
|
|
219
|
-
dpi: int =
|
|
218
|
+
width: int = config.width,
|
|
219
|
+
height: int = config.height,
|
|
220
|
+
linewidth: float = config.line_width,
|
|
221
|
+
dpi: int = config.dpi,
|
|
220
222
|
save_path: str = None,
|
|
221
223
|
callback: any = None,
|
|
222
224
|
ax: Axes = None,
|
|
@@ -283,12 +285,12 @@ def kdeplot(
|
|
|
283
285
|
hue: str = None,
|
|
284
286
|
palette: str = None,
|
|
285
287
|
fill: bool = False,
|
|
286
|
-
fill_alpha: float =
|
|
287
|
-
linewidth: float =
|
|
288
|
+
fill_alpha: float = config.fill_alpha,
|
|
289
|
+
linewidth: float = config.line_width,
|
|
288
290
|
quartile_split: bool = False,
|
|
289
|
-
width: int =
|
|
290
|
-
height: int =
|
|
291
|
-
dpi: int =
|
|
291
|
+
width: int = config.width,
|
|
292
|
+
height: int = config.height,
|
|
293
|
+
dpi: int = config.dpi,
|
|
292
294
|
save_path: str = None,
|
|
293
295
|
callback: any = None,
|
|
294
296
|
ax: Axes = None,
|
|
@@ -365,7 +367,7 @@ def kdeplot(
|
|
|
365
367
|
|
|
366
368
|
sb.kdeplot(**kdeplot_kwargs)
|
|
367
369
|
axes[idx].set_title(f"Q{idx+1}: [{lo:.3g}, {hi:.3g}]")
|
|
368
|
-
axes[idx].grid(True, alpha=
|
|
370
|
+
axes[idx].grid(True, alpha=config.grid_alpha, linewidth=config.grid_width)
|
|
369
371
|
|
|
370
372
|
finalize_plot(axes[0], callback, outparams, save_path)
|
|
371
373
|
return
|
|
@@ -414,10 +416,10 @@ def histplot(
|
|
|
414
416
|
bins=None,
|
|
415
417
|
kde: bool = True,
|
|
416
418
|
palette: str = None,
|
|
417
|
-
width: int =
|
|
418
|
-
height: int =
|
|
419
|
-
linewidth: float =
|
|
420
|
-
dpi: int =
|
|
419
|
+
width: int = config.width,
|
|
420
|
+
height: int = config.height,
|
|
421
|
+
linewidth: float = config.line_width,
|
|
422
|
+
dpi: int = config.dpi,
|
|
421
423
|
save_path: str = None,
|
|
422
424
|
callback: any = None,
|
|
423
425
|
ax: Axes = None,
|
|
@@ -496,10 +498,10 @@ def stackplot(
|
|
|
496
498
|
xname: str,
|
|
497
499
|
hue: str,
|
|
498
500
|
palette: str = None,
|
|
499
|
-
width: int =
|
|
500
|
-
height: int =
|
|
501
|
+
width: int = config.width,
|
|
502
|
+
height: int = config.height,
|
|
501
503
|
linewidth: float = 0.25,
|
|
502
|
-
dpi: int =
|
|
504
|
+
dpi: int = config.dpi,
|
|
503
505
|
save_path: str = None,
|
|
504
506
|
callback: any = None,
|
|
505
507
|
ax: Axes = None,
|
|
@@ -581,10 +583,10 @@ def scatterplot(
|
|
|
581
583
|
yname: str,
|
|
582
584
|
hue=None,
|
|
583
585
|
palette: str = None,
|
|
584
|
-
width: int =
|
|
585
|
-
height: int =
|
|
586
|
-
linewidth: float =
|
|
587
|
-
dpi: int =
|
|
586
|
+
width: int = config.width,
|
|
587
|
+
height: int = config.height,
|
|
588
|
+
linewidth: float = config.line_width,
|
|
589
|
+
dpi: int = config.dpi,
|
|
588
590
|
save_path: str = None,
|
|
589
591
|
callback: any = None,
|
|
590
592
|
ax: Axes = None,
|
|
@@ -645,10 +647,10 @@ def regplot(
|
|
|
645
647
|
xname: str,
|
|
646
648
|
yname: str,
|
|
647
649
|
palette: str = None,
|
|
648
|
-
width: int =
|
|
649
|
-
height: int =
|
|
650
|
-
linewidth: float =
|
|
651
|
-
dpi: int =
|
|
650
|
+
width: int = config.width,
|
|
651
|
+
height: int = config.height,
|
|
652
|
+
linewidth: float = config.line_width,
|
|
653
|
+
dpi: int = config.dpi,
|
|
652
654
|
save_path: str = None,
|
|
653
655
|
callback: any = None,
|
|
654
656
|
ax: Axes = None,
|
|
@@ -712,10 +714,10 @@ def lmplot(
|
|
|
712
714
|
yname: str,
|
|
713
715
|
hue=None,
|
|
714
716
|
palette: str = None,
|
|
715
|
-
width: int =
|
|
716
|
-
height: int =
|
|
717
|
-
linewidth: float =
|
|
718
|
-
dpi: int =
|
|
717
|
+
width: int = config.width,
|
|
718
|
+
height: int = config.height,
|
|
719
|
+
linewidth: float = config.line_width,
|
|
720
|
+
dpi: int = config.dpi,
|
|
719
721
|
save_path: str = None,
|
|
720
722
|
**params,
|
|
721
723
|
) -> None:
|
|
@@ -762,7 +764,7 @@ def lmplot(
|
|
|
762
764
|
continue
|
|
763
765
|
line.set_linewidth(linewidth)
|
|
764
766
|
|
|
765
|
-
g.fig.grid(True, alpha=
|
|
767
|
+
g.fig.grid(True, alpha=config.grid_alpha, linewidth=config.grid_width)
|
|
766
768
|
|
|
767
769
|
plt.tight_layout()
|
|
768
770
|
|
|
@@ -782,10 +784,10 @@ def pairplot(
|
|
|
782
784
|
diag_kind: str = "kde",
|
|
783
785
|
hue=None,
|
|
784
786
|
palette: str = None,
|
|
785
|
-
width: int =
|
|
786
|
-
height: int =
|
|
787
|
-
linewidth: float =
|
|
788
|
-
dpi: int =
|
|
787
|
+
width: int = config.height,
|
|
788
|
+
height: int = config.height,
|
|
789
|
+
linewidth: float = config.line_width,
|
|
790
|
+
dpi: int = config.dpi,
|
|
789
791
|
save_path: str = None,
|
|
790
792
|
**params,
|
|
791
793
|
) -> None:
|
|
@@ -850,7 +852,7 @@ def pairplot(
|
|
|
850
852
|
scale = len(target_cols)
|
|
851
853
|
g.fig.set_size_inches(w=(width / dpi) * scale, h=(height / dpi) * scale)
|
|
852
854
|
g.fig.set_dpi(dpi)
|
|
853
|
-
g.map_lower(func=sb.kdeplot, fill=True, alpha=
|
|
855
|
+
g.map_lower(func=sb.kdeplot, fill=True, alpha=config.fill_alpha, linewidth=linewidth)
|
|
854
856
|
g.map_upper(func=sb.scatterplot, linewidth=linewidth)
|
|
855
857
|
|
|
856
858
|
# KDE 대각선에도 linewidth 적용
|
|
@@ -876,10 +878,10 @@ def countplot(
|
|
|
876
878
|
hue=None,
|
|
877
879
|
palette: str = None,
|
|
878
880
|
order: int = 1,
|
|
879
|
-
width: int =
|
|
880
|
-
height: int =
|
|
881
|
-
linewidth: float =
|
|
882
|
-
dpi: int =
|
|
881
|
+
width: int = config.width,
|
|
882
|
+
height: int = config.height,
|
|
883
|
+
linewidth: float = config.line_width,
|
|
884
|
+
dpi: int = config.dpi,
|
|
883
885
|
save_path: str = None,
|
|
884
886
|
callback: any = None,
|
|
885
887
|
ax: Axes = None,
|
|
@@ -948,10 +950,10 @@ def barplot(
|
|
|
948
950
|
yname: str,
|
|
949
951
|
hue=None,
|
|
950
952
|
palette: str = None,
|
|
951
|
-
width: int =
|
|
952
|
-
height: int =
|
|
953
|
-
linewidth: float =
|
|
954
|
-
dpi: int =
|
|
953
|
+
width: int = config.width,
|
|
954
|
+
height: int = config.height,
|
|
955
|
+
linewidth: float = config.line_width,
|
|
956
|
+
dpi: int = config.dpi,
|
|
955
957
|
save_path: str = None,
|
|
956
958
|
callback: any = None,
|
|
957
959
|
ax: Axes = None,
|
|
@@ -1012,10 +1014,10 @@ def boxenplot(
|
|
|
1012
1014
|
yname: str,
|
|
1013
1015
|
hue=None,
|
|
1014
1016
|
palette: str = None,
|
|
1015
|
-
width: int =
|
|
1016
|
-
height: int =
|
|
1017
|
-
linewidth: float =
|
|
1018
|
-
dpi: int =
|
|
1017
|
+
width: int = config.width,
|
|
1018
|
+
height: int = config.height,
|
|
1019
|
+
linewidth: float = config.line_width,
|
|
1020
|
+
dpi: int = config.dpi,
|
|
1019
1021
|
save_path: str = None,
|
|
1020
1022
|
callback: any = None,
|
|
1021
1023
|
ax: Axes = None,
|
|
@@ -1074,10 +1076,10 @@ def violinplot(
|
|
|
1074
1076
|
yname: str,
|
|
1075
1077
|
hue=None,
|
|
1076
1078
|
palette: str = None,
|
|
1077
|
-
width: int =
|
|
1078
|
-
height: int =
|
|
1079
|
-
linewidth: float =
|
|
1080
|
-
dpi: int =
|
|
1079
|
+
width: int = config.width,
|
|
1080
|
+
height: int = config.height,
|
|
1081
|
+
linewidth: float = config.line_width,
|
|
1082
|
+
dpi: int = config.dpi,
|
|
1081
1083
|
save_path: str = None,
|
|
1082
1084
|
callback: any = None,
|
|
1083
1085
|
ax: Axes = None,
|
|
@@ -1135,10 +1137,10 @@ def pointplot(
|
|
|
1135
1137
|
yname: str,
|
|
1136
1138
|
hue=None,
|
|
1137
1139
|
palette: str = None,
|
|
1138
|
-
width: int =
|
|
1139
|
-
height: int =
|
|
1140
|
-
linewidth: float =
|
|
1141
|
-
dpi: int =
|
|
1140
|
+
width: int = config.width,
|
|
1141
|
+
height: int = config.height,
|
|
1142
|
+
linewidth: float = config.line_width,
|
|
1143
|
+
dpi: int = config.dpi,
|
|
1142
1144
|
save_path: str = None,
|
|
1143
1145
|
callback: any = None,
|
|
1144
1146
|
ax: Axes = None,
|
|
@@ -1198,10 +1200,10 @@ def jointplot(
|
|
|
1198
1200
|
yname: str,
|
|
1199
1201
|
hue=None,
|
|
1200
1202
|
palette: str = None,
|
|
1201
|
-
width: int =
|
|
1202
|
-
height: int =
|
|
1203
|
-
linewidth: float =
|
|
1204
|
-
dpi: int =
|
|
1203
|
+
width: int = config.width,
|
|
1204
|
+
height: int = config.height,
|
|
1205
|
+
linewidth: float = config.line_width,
|
|
1206
|
+
dpi: int = config.dpi,
|
|
1205
1207
|
save_path: str = None,
|
|
1206
1208
|
**params,
|
|
1207
1209
|
) -> None:
|
|
@@ -1242,9 +1244,9 @@ def jointplot(
|
|
|
1242
1244
|
g.fig.set_dpi(dpi)
|
|
1243
1245
|
|
|
1244
1246
|
# 중앙 및 주변 플롯에 grid 추가
|
|
1245
|
-
g.ax_joint.grid(True, alpha=
|
|
1246
|
-
g.ax_marg_x.grid(True, alpha=
|
|
1247
|
-
g.ax_marg_y.grid(True, alpha=
|
|
1247
|
+
g.ax_joint.grid(True, alpha=config.grid_alpha, linewidth=config.grid_width)
|
|
1248
|
+
g.ax_marg_x.grid(True, alpha=config.grid_alpha, linewidth=config.grid_width)
|
|
1249
|
+
g.ax_marg_y.grid(True, alpha=config.grid_alpha, linewidth=config.grid_width)
|
|
1248
1250
|
|
|
1249
1251
|
plt.tight_layout()
|
|
1250
1252
|
|
|
@@ -1264,7 +1266,7 @@ def heatmap(
|
|
|
1264
1266
|
width: int | None = None,
|
|
1265
1267
|
height: int | None = None,
|
|
1266
1268
|
linewidth: float = 0.25,
|
|
1267
|
-
dpi: int =
|
|
1269
|
+
dpi: int = config.dpi,
|
|
1268
1270
|
save_path: str = None,
|
|
1269
1271
|
callback: any = None,
|
|
1270
1272
|
ax: Axes = None,
|
|
@@ -1289,7 +1291,7 @@ def heatmap(
|
|
|
1289
1291
|
outparams = False
|
|
1290
1292
|
|
|
1291
1293
|
if width == None or height == None:
|
|
1292
|
-
width = (
|
|
1294
|
+
width = (config.font_size * config.dpi / 72) * 4.5 * len(data.columns)
|
|
1293
1295
|
height = width * 0.8
|
|
1294
1296
|
|
|
1295
1297
|
if ax is None:
|
|
@@ -1323,10 +1325,10 @@ def convex_hull(
|
|
|
1323
1325
|
yname: str,
|
|
1324
1326
|
hue: str,
|
|
1325
1327
|
palette: str = None,
|
|
1326
|
-
width: int =
|
|
1327
|
-
height: int =
|
|
1328
|
-
linewidth: float =
|
|
1329
|
-
dpi: int =
|
|
1328
|
+
width: int = config.width,
|
|
1329
|
+
height: int = config.height,
|
|
1330
|
+
linewidth: float = config.line_width,
|
|
1331
|
+
dpi: int = config.dpi,
|
|
1330
1332
|
save_path: str = None,
|
|
1331
1333
|
callback: any = None,
|
|
1332
1334
|
ax: Axes = None,
|
|
@@ -1393,10 +1395,10 @@ def kde_confidence_interval(
|
|
|
1393
1395
|
data: DataFrame,
|
|
1394
1396
|
xnames=None,
|
|
1395
1397
|
clevel=0.95,
|
|
1396
|
-
width: int =
|
|
1397
|
-
height: int =
|
|
1398
|
-
linewidth: float =
|
|
1399
|
-
dpi: int =
|
|
1398
|
+
width: int = config.width,
|
|
1399
|
+
height: int = config.height,
|
|
1400
|
+
linewidth: float = config.line_width,
|
|
1401
|
+
dpi: int = config.dpi,
|
|
1400
1402
|
save_path: str = None,
|
|
1401
1403
|
callback: any = None,
|
|
1402
1404
|
ax: Axes = None,
|
|
@@ -1476,7 +1478,7 @@ def kde_confidence_interval(
|
|
|
1476
1478
|
# 신뢰구간 그리기
|
|
1477
1479
|
current_ax.plot([cmin, cmin], [ymin_val, ymax_val], linestyle=":", linewidth=linewidth*0.5)
|
|
1478
1480
|
current_ax.plot([cmax, cmax], [ymin_val, ymax_val], linestyle=":", linewidth=linewidth*0.5)
|
|
1479
|
-
current_ax.fill_between([cmin, cmax], y1=ymin_val, y2=ymax_val, alpha=
|
|
1481
|
+
current_ax.fill_between([cmin, cmax], y1=ymin_val, y2=ymax_val, alpha=config.fill_alpha)
|
|
1480
1482
|
|
|
1481
1483
|
# 평균 그리기
|
|
1482
1484
|
current_ax.plot([sample_mean, sample_mean], [0, ymax_val], linestyle="--", linewidth=linewidth)
|
|
@@ -1490,7 +1492,7 @@ def kde_confidence_interval(
|
|
|
1490
1492
|
fontdict={"color": "red"},
|
|
1491
1493
|
)
|
|
1492
1494
|
|
|
1493
|
-
current_ax.grid(True, alpha=
|
|
1495
|
+
current_ax.grid(True, alpha=config.grid_alpha, linewidth=config.grid_width)
|
|
1494
1496
|
|
|
1495
1497
|
finalize_plot(axes[0] if isinstance(axes, list) and len(axes) > 0 else ax, callback, outparams, save_path)
|
|
1496
1498
|
|
|
@@ -1506,10 +1508,10 @@ def pvalue1_anotation(
|
|
|
1506
1508
|
test: str = "t-test_ind",
|
|
1507
1509
|
text_format: str = "star",
|
|
1508
1510
|
loc: str = "outside",
|
|
1509
|
-
width: int =
|
|
1510
|
-
height: int =
|
|
1511
|
-
linewidth: float =
|
|
1512
|
-
dpi: int =
|
|
1511
|
+
width: int = config.width,
|
|
1512
|
+
height: int = config.height,
|
|
1513
|
+
linewidth: float = config.line_width,
|
|
1514
|
+
dpi: int = config.dpi,
|
|
1513
1515
|
save_path: str = None,
|
|
1514
1516
|
callback: any = None,
|
|
1515
1517
|
ax: Axes = None,
|
|
@@ -1583,10 +1585,10 @@ def ols_residplot(
|
|
|
1583
1585
|
fit,
|
|
1584
1586
|
lowess: bool = False,
|
|
1585
1587
|
mse: bool = False,
|
|
1586
|
-
width: int =
|
|
1587
|
-
height: int =
|
|
1588
|
-
linewidth: float =
|
|
1589
|
-
dpi: int =
|
|
1588
|
+
width: int = config.width,
|
|
1589
|
+
height: int = config.height,
|
|
1590
|
+
linewidth: float = config.line_width,
|
|
1591
|
+
dpi: int = config.dpi,
|
|
1590
1592
|
save_path: str = None,
|
|
1591
1593
|
callback: any = None,
|
|
1592
1594
|
ax: Axes = None,
|
|
@@ -1616,11 +1618,11 @@ def ols_residplot(
|
|
|
1616
1618
|
None
|
|
1617
1619
|
|
|
1618
1620
|
Examples:
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1621
|
+
```python
|
|
1622
|
+
from hossam import *
|
|
1623
|
+
fit = hs_stats.ols(data, yname='target', report=False)
|
|
1624
|
+
residplot(fit, lowess=True, mse=True)
|
|
1625
|
+
```
|
|
1624
1626
|
"""
|
|
1625
1627
|
outparams = False
|
|
1626
1628
|
|
|
@@ -1709,10 +1711,10 @@ def ols_residplot(
|
|
|
1709
1711
|
def ols_qqplot(
|
|
1710
1712
|
fit,
|
|
1711
1713
|
line: str = 's',
|
|
1712
|
-
width: int =
|
|
1713
|
-
height: int =
|
|
1714
|
-
linewidth: float =
|
|
1715
|
-
dpi: int =
|
|
1714
|
+
width: int = config.width,
|
|
1715
|
+
height: int = config.height,
|
|
1716
|
+
linewidth: float = config.line_width,
|
|
1717
|
+
dpi: int = config.dpi,
|
|
1716
1718
|
save_path: str = None,
|
|
1717
1719
|
callback: any = None,
|
|
1718
1720
|
ax: Axes = None,
|
|
@@ -1744,16 +1746,17 @@ def ols_qqplot(
|
|
|
1744
1746
|
None
|
|
1745
1747
|
|
|
1746
1748
|
Examples:
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1749
|
+
```python
|
|
1750
|
+
from hossam import *
|
|
1751
|
+
# 선형회귀 모형 적합
|
|
1752
|
+
fit = hs_stats.ols(data, yname='target', report=False)
|
|
1753
|
+
# 표준화된 선 (권장)
|
|
1754
|
+
qqplot(fit)
|
|
1755
|
+
# 회귀선 (데이터 추세 반영)
|
|
1756
|
+
qqplot(fit, line='r')
|
|
1757
|
+
# 45도 대각선 (전통적 방식)
|
|
1758
|
+
qqplot(fit, line='45')
|
|
1759
|
+
```
|
|
1757
1760
|
"""
|
|
1758
1761
|
outparams = False
|
|
1759
1762
|
|
|
@@ -1799,10 +1802,10 @@ def distribution_by_class(
|
|
|
1799
1802
|
bins: any = 5,
|
|
1800
1803
|
palette: str = None,
|
|
1801
1804
|
fill: bool = False,
|
|
1802
|
-
width: int =
|
|
1803
|
-
height: int =
|
|
1804
|
-
linewidth: float =
|
|
1805
|
-
dpi: int =
|
|
1805
|
+
width: int = config.width,
|
|
1806
|
+
height: int = config.height,
|
|
1807
|
+
linewidth: float = config.line_width,
|
|
1808
|
+
dpi: int = config.dpi,
|
|
1806
1809
|
save_path: str = None,
|
|
1807
1810
|
callback: any = None,
|
|
1808
1811
|
) -> None:
|
|
@@ -1896,10 +1899,10 @@ def scatter_by_class(
|
|
|
1896
1899
|
hue: str | None = None,
|
|
1897
1900
|
palette: str | None = None,
|
|
1898
1901
|
outline: bool = False,
|
|
1899
|
-
width: int =
|
|
1900
|
-
height: int =
|
|
1901
|
-
linewidth: float =
|
|
1902
|
-
dpi: int =
|
|
1902
|
+
width: int = config.width,
|
|
1903
|
+
height: int = config.height,
|
|
1904
|
+
linewidth: float = config.line_width,
|
|
1905
|
+
dpi: int = config.dpi,
|
|
1903
1906
|
save_path: str = None,
|
|
1904
1907
|
callback: any = None,
|
|
1905
1908
|
) -> None:
|
|
@@ -1968,10 +1971,10 @@ def categorical_target_distribution(
|
|
|
1968
1971
|
kind: str = "box",
|
|
1969
1972
|
kde_fill: bool = True,
|
|
1970
1973
|
palette: str | None = None,
|
|
1971
|
-
width: int =
|
|
1972
|
-
height: int =
|
|
1973
|
-
linewidth: float =
|
|
1974
|
-
dpi: int =
|
|
1974
|
+
width: int = config.width,
|
|
1975
|
+
height: int = config.height,
|
|
1976
|
+
linewidth: float = config.line_width,
|
|
1977
|
+
dpi: int = config.dpi,
|
|
1975
1978
|
cols: int = 2,
|
|
1976
1979
|
save_path: str = None,
|
|
1977
1980
|
callback: any = None,
|
|
@@ -2050,10 +2053,10 @@ def roc_curve_plot(
|
|
|
2050
2053
|
fit,
|
|
2051
2054
|
y: np.ndarray | pd.Series = None,
|
|
2052
2055
|
X: pd.DataFrame | np.ndarray = None,
|
|
2053
|
-
width: int =
|
|
2054
|
-
height: int =
|
|
2055
|
-
linewidth: float =
|
|
2056
|
-
dpi: int =
|
|
2056
|
+
width: int = config.height,
|
|
2057
|
+
height: int = config.height,
|
|
2058
|
+
linewidth: float = config.line_width,
|
|
2059
|
+
dpi: int = config.dpi,
|
|
2057
2060
|
save_path: str = None,
|
|
2058
2061
|
callback: any = None,
|
|
2059
2062
|
ax: Axes = None,
|
|
@@ -2119,9 +2122,9 @@ def roc_curve_plot(
|
|
|
2119
2122
|
def confusion_matrix_plot(
|
|
2120
2123
|
fit,
|
|
2121
2124
|
threshold: float = 0.5,
|
|
2122
|
-
width: int =
|
|
2123
|
-
height: int =
|
|
2124
|
-
dpi: int =
|
|
2125
|
+
width: int = config.width,
|
|
2126
|
+
height: int = config.height,
|
|
2127
|
+
dpi: int = config.dpi,
|
|
2125
2128
|
save_path: str = None,
|
|
2126
2129
|
callback: any = None,
|
|
2127
2130
|
ax: Axes = None,
|
|
@@ -2174,10 +2177,10 @@ def radarplot(
|
|
|
2174
2177
|
fill: bool = True,
|
|
2175
2178
|
fill_alpha: float = 0.25,
|
|
2176
2179
|
palette: str = None,
|
|
2177
|
-
width: int =
|
|
2178
|
-
height: int =
|
|
2179
|
-
linewidth: float =
|
|
2180
|
-
dpi: int =
|
|
2180
|
+
width: int = config.width,
|
|
2181
|
+
height: int = config.height,
|
|
2182
|
+
linewidth: float = config.line_width,
|
|
2183
|
+
dpi: int = config.dpi,
|
|
2181
2184
|
save_path: str = None,
|
|
2182
2185
|
callback: any = None,
|
|
2183
2186
|
ax: Axes = None,
|
|
@@ -2303,10 +2306,10 @@ def distribution_plot(
|
|
|
2303
2306
|
orient: str = "h",
|
|
2304
2307
|
hue: str | None = None,
|
|
2305
2308
|
kind: str = "boxplot",
|
|
2306
|
-
width: int =
|
|
2307
|
-
height: int =
|
|
2308
|
-
linewidth: float =
|
|
2309
|
-
dpi: int =
|
|
2309
|
+
width: int = config.width,
|
|
2310
|
+
height: int = config.height,
|
|
2311
|
+
linewidth: float = config.line_width,
|
|
2312
|
+
dpi: int = config.dpi,
|
|
2310
2313
|
save_path: str = None,
|
|
2311
2314
|
callback: any = None,
|
|
2312
2315
|
) -> None:
|