radnn 0.0.5__py3-none-any.whl → 0.0.6__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.
- radnn/__init__.py +2 -1
- radnn/plots/__init__.py +2 -1
- radnn/plots/plot_multi_scatter.py +117 -0
- {radnn-0.0.5.dist-info → radnn-0.0.6.dist-info}/METADATA +1 -1
- {radnn-0.0.5.dist-info → radnn-0.0.6.dist-info}/RECORD +8 -7
- {radnn-0.0.5.dist-info → radnn-0.0.6.dist-info}/LICENSE.txt +0 -0
- {radnn-0.0.5.dist-info → radnn-0.0.6.dist-info}/WHEEL +0 -0
- {radnn-0.0.5.dist-info → radnn-0.0.6.dist-info}/top_level.txt +0 -0
radnn/__init__.py
CHANGED
radnn/plots/__init__.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from .plot_confusion_matrix import PlotConfusionMatrix
|
|
2
2
|
from .plot_learning_curve import PlotLearningCurve
|
|
3
3
|
from .plot_roc import PlotROC
|
|
4
|
-
from .plot_voronoi_2d import PlotVoronoi2D
|
|
4
|
+
from .plot_voronoi_2d import PlotVoronoi2D
|
|
5
|
+
from .plot_multi_scatter import MultiScatterPlot
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# ......................................................................................
|
|
2
|
+
# MIT License
|
|
3
|
+
|
|
4
|
+
# Copyright (c) 2022-2025 Pantelis I. Kaplanoglou
|
|
5
|
+
|
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
# furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
# copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
# SOFTWARE.
|
|
23
|
+
|
|
24
|
+
# ......................................................................................
|
|
25
|
+
|
|
26
|
+
import numpy as np
|
|
27
|
+
import matplotlib.pyplot as plt
|
|
28
|
+
from matplotlib import cm
|
|
29
|
+
|
|
30
|
+
class MultiScatterPlot(object):
|
|
31
|
+
# --------------------------------------------------------------------------------------
|
|
32
|
+
# Constructor
|
|
33
|
+
def __init__(self, title, data=None, class_count=10, class_names=None):
|
|
34
|
+
# ................................................................
|
|
35
|
+
# // Fields \\
|
|
36
|
+
self.Title = title
|
|
37
|
+
self.Data = data
|
|
38
|
+
|
|
39
|
+
self.ClassCount = class_count
|
|
40
|
+
if class_names is not None:
|
|
41
|
+
self.ClassNames = class_names
|
|
42
|
+
self.ClassCount = len(self.ClassNames)
|
|
43
|
+
|
|
44
|
+
if (self.ClassCount <= 10):
|
|
45
|
+
self.ColorMap = cm.get_cmap("tab10")
|
|
46
|
+
elif (self.ClassCount <= 20):
|
|
47
|
+
self.ColorMap = cm.get_cmap("tab20")
|
|
48
|
+
else:
|
|
49
|
+
self.ColorMap = cm.get_cmap("prism")
|
|
50
|
+
# self.ColorMap = colors.ListedColormap(["darkorange","darkseagreen"])
|
|
51
|
+
|
|
52
|
+
self.PlotDimensions = [14, 8]
|
|
53
|
+
self.PointSize = 48
|
|
54
|
+
|
|
55
|
+
self.PanesPerRow = 2
|
|
56
|
+
if self.Data is not None:
|
|
57
|
+
self.Panes = len(self.Data)
|
|
58
|
+
|
|
59
|
+
self.__fig = None
|
|
60
|
+
self.__ax = None
|
|
61
|
+
# ................................................................
|
|
62
|
+
|
|
63
|
+
# --------------------------------------------------------------------------------------
|
|
64
|
+
def add_data(self, dataset_name, samples, labels=None):
|
|
65
|
+
if self.Data is None:
|
|
66
|
+
self.Data = []
|
|
67
|
+
|
|
68
|
+
if labels is None:
|
|
69
|
+
labels = np.zeros((samples.shape[0]), np.int32)
|
|
70
|
+
self.Data.append([dataset_name, samples, labels])
|
|
71
|
+
self.Panes = len(self.Data)
|
|
72
|
+
|
|
73
|
+
# --------------------------------------------------------------------------------------
|
|
74
|
+
def prepare(self, index, x_axis_caption, y_axis_caption):
|
|
75
|
+
# The 2D data for the scatter plot
|
|
76
|
+
sDataName, nSamples, nLabels = self.Data[index]
|
|
77
|
+
nXValues = nSamples[:, 0]
|
|
78
|
+
nYValues = nSamples[:, 1]
|
|
79
|
+
nLabels = nLabels
|
|
80
|
+
|
|
81
|
+
if self.__fig is None:
|
|
82
|
+
if self.Panes == 1:
|
|
83
|
+
self.__fig, self.__ax = plt.subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=False,
|
|
84
|
+
figsize=self.PlotDimensions)
|
|
85
|
+
else:
|
|
86
|
+
nRows = self.Panes // self.PanesPerRow
|
|
87
|
+
if (self.Panes % self.PanesPerRow != 0):
|
|
88
|
+
nRows += 1
|
|
89
|
+
self.__fig, self.__ax = plt.subplots(nrows=nRows, ncols=self.PanesPerRow, sharex=False, sharey=False,
|
|
90
|
+
squeeze=False, figsize=self.PlotDimensions)
|
|
91
|
+
|
|
92
|
+
nRow = index // self.PanesPerRow
|
|
93
|
+
nCol = index - (nRow * self.PanesPerRow)
|
|
94
|
+
oPlot = self.__ax[nCol, nRow]
|
|
95
|
+
oPlot.set_xlabel(x_axis_caption)
|
|
96
|
+
oPlot.set_ylabel(y_axis_caption)
|
|
97
|
+
oPlot.set_title(sDataName)
|
|
98
|
+
|
|
99
|
+
oScatter = oPlot.scatter(nXValues, nYValues, s=self.PointSize, c=nLabels, cmap=self.ColorMap)
|
|
100
|
+
|
|
101
|
+
oLegend = oPlot.legend(*oScatter.legend_elements(), loc="lower right", title="Classes", framealpha=0.4,
|
|
102
|
+
labelspacing=0.1)
|
|
103
|
+
oPlot.add_artist(oLegend)
|
|
104
|
+
|
|
105
|
+
if index == self.Panes - 1:
|
|
106
|
+
plt.title(self.Title)
|
|
107
|
+
plt.tight_layout(pad=1.01)
|
|
108
|
+
|
|
109
|
+
return self
|
|
110
|
+
# --------------------------------------------------------------------------------------
|
|
111
|
+
def save(self, filename):
|
|
112
|
+
plt.savefig(filename, bbox_inches='tight')
|
|
113
|
+
return self
|
|
114
|
+
# --------------------------------------------------------------------------------------
|
|
115
|
+
def show(self):
|
|
116
|
+
plt.show()
|
|
117
|
+
# --------------------------------------------------------------------------------------
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
radnn/__init__.py,sha256=
|
|
1
|
+
radnn/__init__.py,sha256=9CEr23hNkWNU-R14QMatDBvWQG0oHNjFIBNT23Mfe2M,171
|
|
2
2
|
radnn/core.py,sha256=cWGl_B3bHASEDdZHgDKN9CwGo7-TFjj3y2YD-Ei4bD4,2828
|
|
3
3
|
radnn/evaluation/__init__.py,sha256=7dXDyJfOpSAr7G8jfDofsW4YEHNElCTTyMXuLCtpoOI,59
|
|
4
4
|
radnn/evaluation/evaluate_classification.py,sha256=wacQ_02loI2ApOKrUIDTKqqrwi0_TpUZJQfTpJ6rtag,5497
|
|
5
5
|
radnn/experiment/__init__.py,sha256=8gxrFS4bG7rg2kgrDEhemJgDbO-5KhBYc4owJZ-S--k,247
|
|
6
6
|
radnn/experiment/ml_experiment_config.py,sha256=MuFb4sY4kgCwxtJGmpOace4eTopy7mVLg3IDCpy6evI,8547
|
|
7
7
|
radnn/experiment/ml_experiment_env.py,sha256=I54WILYjCJf9P133dFgOMsXGxkftlU8DcmwXDnBW930,11151
|
|
8
|
-
radnn/plots/__init__.py,sha256=
|
|
8
|
+
radnn/plots/__init__.py,sha256=S3nGBBeCcaJl-RX03AWLpJXF8Ac6hnksrBPL40Nlbso,231
|
|
9
9
|
radnn/plots/plot_confusion_matrix.py,sha256=KWW5k7-gaLPXO4oQBnzwAwgI-rvPOmqw8uiZbFlmU5o,2625
|
|
10
10
|
radnn/plots/plot_learning_curve.py,sha256=tgx3vAm4rg5qScqxLQ2T82BqrRWjiYaIKgLQp5Y19cQ,3480
|
|
11
|
+
radnn/plots/plot_multi_scatter.py,sha256=-VgSwi7knYTNrdW86RGon0MZ_r0JDoiWP9F_gWIvTuo,4797
|
|
11
12
|
radnn/plots/plot_roc.py,sha256=iyOnhux2qFEs7W-szEOCg2VCkcnBEaOJxZkWWYuSnCQ,3493
|
|
12
13
|
radnn/plots/plot_voronoi_2d.py,sha256=Kq3ZaLhLaFHQAurhFKNy7NNuIm3RArCk_WxPT8Ftxek,4409
|
|
13
14
|
radnn/system/__init__.py,sha256=uJLg56njcLtaRO0Kyudat055DGxqWsLMvrn9P8_Rt6A,119
|
|
@@ -25,8 +26,8 @@ radnn/system/hosts/__init__.py,sha256=k2gkMJhe96Nf-V2ex6jZqmCRX9vA_K6gFB8J8Ii9ah
|
|
|
25
26
|
radnn/system/hosts/colab_host.py,sha256=tAuLn9gTkX9cCSEmm7sG1JmCtNIgFlASwBt2olHUSe4,2434
|
|
26
27
|
radnn/system/hosts/linux_host.py,sha256=TZ-5JEZV0WNEB5trTbRWM0REhpuK5oYxoLodKKqhm9s,57
|
|
27
28
|
radnn/system/hosts/windows_host.py,sha256=u4IvgfFoKWdrFy0hYG__AoxfEJYHF4-ISNXTCJ5uN8I,2257
|
|
28
|
-
radnn-0.0.
|
|
29
|
-
radnn-0.0.
|
|
30
|
-
radnn-0.0.
|
|
31
|
-
radnn-0.0.
|
|
32
|
-
radnn-0.0.
|
|
29
|
+
radnn-0.0.6.dist-info/LICENSE.txt,sha256=vYtt_GDvm_yW65X9YMBOOu8Vqc9SAvqH94TbfBc2ckU,1106
|
|
30
|
+
radnn-0.0.6.dist-info/METADATA,sha256=WHrzQA_iryCKZzR7KWbRAmIygXa0cWCTqlWYj5yhc10,2861
|
|
31
|
+
radnn-0.0.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
32
|
+
radnn-0.0.6.dist-info/top_level.txt,sha256=FKlLIm6gRAeZlRzs-HCBJAB1q9ELJ7MgaL-qqFuPo6M,6
|
|
33
|
+
radnn-0.0.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|