aisp 0.1.33__tar.gz → 0.1.34__tar.gz
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.
- {aisp-0.1.33 → aisp-0.1.34}/PKG-INFO +5 -4
- aisp-0.1.34/aisp/NSA/__init__.py +18 -0
- {aisp-0.1.33 → aisp-0.1.34}/aisp/NSA/_base.py +1 -1
- {aisp-0.1.33 → aisp-0.1.34}/aisp/NSA/_negative_selection.py +28 -104
- {aisp-0.1.33 → aisp-0.1.34}/aisp.egg-info/PKG-INFO +5 -4
- {aisp-0.1.33 → aisp-0.1.34}/aisp.egg-info/top_level.txt +1 -0
- {aisp-0.1.33 → aisp-0.1.34}/pyproject.toml +5 -11
- aisp-0.1.33/aisp/NSA/__init__.py +0 -5
- {aisp-0.1.33 → aisp-0.1.34}/LICENSE +0 -0
- {aisp-0.1.33 → aisp-0.1.34}/README.md +0 -0
- {aisp-0.1.33 → aisp-0.1.34}/aisp/utils/__init__.py +0 -0
- {aisp-0.1.33 → aisp-0.1.34}/aisp/utils/_multiclass.py +0 -0
- {aisp-0.1.33 → aisp-0.1.34}/aisp/utils/metrics.py +0 -0
- {aisp-0.1.33 → aisp-0.1.34}/aisp.egg-info/SOURCES.txt +0 -0
- {aisp-0.1.33 → aisp-0.1.34}/aisp.egg-info/dependency_links.txt +0 -0
- {aisp-0.1.33 → aisp-0.1.34}/aisp.egg-info/requires.txt +0 -0
- {aisp-0.1.33 → aisp-0.1.34}/setup.cfg +0 -0
@@ -1,15 +1,15 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: aisp
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.34
|
4
4
|
Summary: Package with techniques of artificial immune systems.
|
5
5
|
Author-email: João Paulo da Silva Barros <jpsilvabarr@gmail.com>
|
6
6
|
Maintainer-email: Alison Zille Lopes <alisonzille@gmail.com>
|
7
|
-
License: LGPL-3.0
|
7
|
+
License-Expression: LGPL-3.0-only
|
8
8
|
Project-URL: Homepage, https://ais-package.github.io/
|
9
9
|
Project-URL: Documentation, https://ais-package.github.io/docs/intro
|
10
10
|
Project-URL: Source Code, https://github.com/AIS-Package/aisp
|
11
11
|
Project-URL: Tracker, https://github.com/AIS-Package/aisp/issues
|
12
|
-
|
12
|
+
Keywords: Artificial Immune Systems,classification,Natural computing,machine learning,artificial intelligence
|
13
13
|
Classifier: Operating System :: OS Independent
|
14
14
|
Classifier: Programming Language :: Python
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
@@ -23,6 +23,7 @@ License-File: LICENSE
|
|
23
23
|
Requires-Dist: numpy>=1.22.4
|
24
24
|
Requires-Dist: scipy>=1.8.1
|
25
25
|
Requires-Dist: tqdm>=4.64.1
|
26
|
+
Dynamic: license-file
|
26
27
|
|
27
28
|
<div align = center>
|
28
29
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"""Module (NSA) Negative Selection Algorithm
|
2
|
+
|
3
|
+
NSAs simulate the maturation process of T-cells in the immune system, where these \
|
4
|
+
cells learn to distinguish between self and non-self. Only T-cells capable \
|
5
|
+
of recognizing non-self elements are preserved.
|
6
|
+
|
7
|
+
----
|
8
|
+
|
9
|
+
Os NSAs simulam o processo de maturação das células-T no sistema imunológico, onde \
|
10
|
+
essas células aprendem a distinguir entre o próprio e não-próprio.
|
11
|
+
Apenas as células-T capazes de reconhecer elementos não-próprios são preservadas.
|
12
|
+
|
13
|
+
"""
|
14
|
+
from ._negative_selection import BNSA, RNSA
|
15
|
+
|
16
|
+
__author__ = "João Paulo da Silva Barros"
|
17
|
+
__all__ = ["RNSA", "BNSA"]
|
18
|
+
__version__ = "0.1.34"
|
@@ -156,7 +156,7 @@ class Base:
|
|
156
156
|
"The array X contains values that are not composed only of 0 and 1."
|
157
157
|
)
|
158
158
|
|
159
|
-
def
|
159
|
+
def score(self, X: npt.NDArray, y: list) -> float:
|
160
160
|
"""
|
161
161
|
Score function calculates forecast accuracy.
|
162
162
|
|
@@ -89,10 +89,18 @@ class RNSA(Base):
|
|
89
89
|
* classes (``npt.NDArray``): lista com as classes de saída.
|
90
90
|
"""
|
91
91
|
|
92
|
-
def __init__(
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
def __init__(
|
93
|
+
self,
|
94
|
+
N: int = 100,
|
95
|
+
r: float = 0.05,
|
96
|
+
r_s: float = 0.0001,
|
97
|
+
k: int = 1,
|
98
|
+
metric: Literal["manhattan", "minkowski", "euclidean"] = "euclidean",
|
99
|
+
max_discards: int = 1000,
|
100
|
+
seed: int = None,
|
101
|
+
algorithm: Literal["default-NSA", "V-detector"] = "default-NSA",
|
102
|
+
**kwargs: Dict[str, Union[bool, str, float]],
|
103
|
+
):
|
96
104
|
"""
|
97
105
|
Negative Selection class constructor (``RNSA``).
|
98
106
|
|
@@ -458,8 +466,12 @@ class RNSA(Base):
|
|
458
466
|
"""
|
459
467
|
return slice_index_list_by_class(self.classes, y)
|
460
468
|
|
461
|
-
def __checks_valid_detector(
|
462
|
-
|
469
|
+
def __checks_valid_detector(
|
470
|
+
self,
|
471
|
+
X: npt.NDArray = None,
|
472
|
+
vector_x: npt.NDArray = None,
|
473
|
+
samples_index_class: npt.NDArray = None,
|
474
|
+
):
|
463
475
|
"""
|
464
476
|
Function to check if the detector has a valid non-proper ``r`` radius for the class.
|
465
477
|
|
@@ -712,52 +724,6 @@ class RNSA(Base):
|
|
712
724
|
return False
|
713
725
|
return True, new_detector_r
|
714
726
|
|
715
|
-
def score(self, X: npt.NDArray, y: list) -> float:
|
716
|
-
"""
|
717
|
-
Score function calculates forecast accuracy.
|
718
|
-
|
719
|
-
Details:
|
720
|
-
---
|
721
|
-
This function performs the prediction of X and checks how many elements are equal between \
|
722
|
-
vector y and y_predicted. This function was added for compatibility with some scikit-learn \
|
723
|
-
functions.
|
724
|
-
|
725
|
-
Parameters:
|
726
|
-
-----------
|
727
|
-
|
728
|
-
* X (np.ndarray): Feature set with shape (n_samples, n_features).
|
729
|
-
* y (np.ndarray): True values with shape (n_samples,).
|
730
|
-
|
731
|
-
Returns:
|
732
|
-
-------
|
733
|
-
|
734
|
-
accuracy: float
|
735
|
-
The accuracy of the model.
|
736
|
-
|
737
|
-
---
|
738
|
-
|
739
|
-
Função score calcular a acurácia da previsão.
|
740
|
-
|
741
|
-
Details:
|
742
|
-
---
|
743
|
-
Esta função realiza a previsão de X e verifica quantos elementos são iguais entre o vetor \
|
744
|
-
y e y_previsto. Essa função foi adicionada para oferecer compatibilidade com algumas \
|
745
|
-
funções do scikit-learn.
|
746
|
-
|
747
|
-
Parameters:
|
748
|
-
---
|
749
|
-
|
750
|
-
* X (np.ndarray): Conjunto de características com shape (n_samples, n_features).
|
751
|
-
* y (np.ndarray): Valores verdadeiros com shape (n_samples,).
|
752
|
-
|
753
|
-
returns:
|
754
|
-
---
|
755
|
-
|
756
|
-
* accuracy (float): A acurácia do modelo.
|
757
|
-
|
758
|
-
"""
|
759
|
-
return super()._score(X, y)
|
760
|
-
|
761
727
|
def get_params(self, deep: bool = True) -> dict:
|
762
728
|
return {
|
763
729
|
"N": self.N,
|
@@ -816,9 +782,16 @@ class BNSA(Base):
|
|
816
782
|
|
817
783
|
"""
|
818
784
|
|
819
|
-
def __init__(
|
820
|
-
|
821
|
-
|
785
|
+
def __init__(
|
786
|
+
self,
|
787
|
+
N: int = 100,
|
788
|
+
aff_thresh: float = 0.1,
|
789
|
+
max_discards: int = 1000,
|
790
|
+
seed: int = None,
|
791
|
+
no_label_sample_selection: Literal[
|
792
|
+
"max_average_difference", "max_nearest_difference"
|
793
|
+
] = "max_average_difference",
|
794
|
+
):
|
822
795
|
"""
|
823
796
|
Constructor of the Negative Selection class (``BNSA``).
|
824
797
|
|
@@ -1133,55 +1106,6 @@ class BNSA(Base):
|
|
1133
1106
|
"""
|
1134
1107
|
return slice_index_list_by_class(self.classes, y)
|
1135
1108
|
|
1136
|
-
def score(self, X: npt.NDArray, y: list) -> float:
|
1137
|
-
"""
|
1138
|
-
Score function calculates forecast accuracy.
|
1139
|
-
|
1140
|
-
Details:
|
1141
|
-
---
|
1142
|
-
This function performs the prediction of X and checks how many elements are equal between vector \
|
1143
|
-
y and y_predicted. This function was added for compatibility with some scikit-learn functions.
|
1144
|
-
|
1145
|
-
Parameters:
|
1146
|
-
-----------
|
1147
|
-
|
1148
|
-
X: np.ndarray
|
1149
|
-
Feature set with shape (n_samples, n_features).
|
1150
|
-
y: np.ndarray
|
1151
|
-
True values with shape (n_samples,).
|
1152
|
-
|
1153
|
-
Returns:
|
1154
|
-
-------
|
1155
|
-
|
1156
|
-
accuracy: float
|
1157
|
-
The accuracy of the model.
|
1158
|
-
|
1159
|
-
---
|
1160
|
-
|
1161
|
-
Função score calcular a acurácia da previsão.
|
1162
|
-
|
1163
|
-
Details:
|
1164
|
-
---
|
1165
|
-
Esta função realiza a previsão de X e verifica quantos elementos são iguais entre o vetor y \
|
1166
|
-
e y_previsto.
|
1167
|
-
Essa função foi adicionada para oferecer compatibilidade com algumas funções do scikit-learn.
|
1168
|
-
|
1169
|
-
Parameters:
|
1170
|
-
---
|
1171
|
-
|
1172
|
-
* X : np.ndarray
|
1173
|
-
Conjunto de características com shape (n_samples, n_features).
|
1174
|
-
* y : np.ndarray
|
1175
|
-
Valores verdadeiros com shape (n_samples,).
|
1176
|
-
|
1177
|
-
returns:
|
1178
|
-
---
|
1179
|
-
|
1180
|
-
accuracy : float
|
1181
|
-
A acurácia do modelo.
|
1182
|
-
"""
|
1183
|
-
return super()._score(X, y)
|
1184
|
-
|
1185
1109
|
def get_params(self, deep: bool = True) -> dict:
|
1186
1110
|
return {
|
1187
1111
|
"N": self.N,
|
@@ -1,15 +1,15 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: aisp
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.34
|
4
4
|
Summary: Package with techniques of artificial immune systems.
|
5
5
|
Author-email: João Paulo da Silva Barros <jpsilvabarr@gmail.com>
|
6
6
|
Maintainer-email: Alison Zille Lopes <alisonzille@gmail.com>
|
7
|
-
License: LGPL-3.0
|
7
|
+
License-Expression: LGPL-3.0-only
|
8
8
|
Project-URL: Homepage, https://ais-package.github.io/
|
9
9
|
Project-URL: Documentation, https://ais-package.github.io/docs/intro
|
10
10
|
Project-URL: Source Code, https://github.com/AIS-Package/aisp
|
11
11
|
Project-URL: Tracker, https://github.com/AIS-Package/aisp/issues
|
12
|
-
|
12
|
+
Keywords: Artificial Immune Systems,classification,Natural computing,machine learning,artificial intelligence
|
13
13
|
Classifier: Operating System :: OS Independent
|
14
14
|
Classifier: Programming Language :: Python
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
@@ -23,6 +23,7 @@ License-File: LICENSE
|
|
23
23
|
Requires-Dist: numpy>=1.22.4
|
24
24
|
Requires-Dist: scipy>=1.8.1
|
25
25
|
Requires-Dist: tqdm>=4.64.1
|
26
|
+
Dynamic: license-file
|
26
27
|
|
27
28
|
<div align = center>
|
28
29
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
[build-system]
|
2
|
-
requires = ["setuptools>=
|
2
|
+
requires = ["setuptools >= 77.0.3"]
|
3
3
|
build-backend = "setuptools.build_meta"
|
4
4
|
|
5
5
|
[tool.setuptools]
|
@@ -7,7 +7,7 @@ packages = {find = {exclude = ["*test*", "*tests", "*tests/*", ".venv", ".idea",
|
|
7
7
|
|
8
8
|
[project]
|
9
9
|
name = "aisp"
|
10
|
-
version = "0.1.
|
10
|
+
version = "0.1.34"
|
11
11
|
authors = [
|
12
12
|
{ name="João Paulo da Silva Barros", email="jpsilvabarr@gmail.com" },
|
13
13
|
]
|
@@ -21,11 +21,10 @@ description = "Package with techniques of artificial immune systems."
|
|
21
21
|
readme = "README.md"
|
22
22
|
|
23
23
|
requires-python = ">= 3.8.10"
|
24
|
-
|
25
|
-
license =
|
24
|
+
license = "LGPL-3.0-only"
|
25
|
+
license-files = ["LICENSE"]
|
26
26
|
|
27
27
|
classifiers = [
|
28
|
-
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
|
29
28
|
"Operating System :: OS Independent",
|
30
29
|
"Programming Language :: Python",
|
31
30
|
"Programming Language :: Python :: 3",
|
@@ -38,14 +37,9 @@ classifiers = [
|
|
38
37
|
dependencies = [
|
39
38
|
"numpy>=1.22.4",
|
40
39
|
"scipy>=1.8.1",
|
41
|
-
"tqdm>=4.64.1"
|
40
|
+
"tqdm>=4.64.1"
|
42
41
|
]
|
43
42
|
|
44
|
-
[tool.poetry]
|
45
|
-
readme = "README.md"
|
46
|
-
|
47
|
-
repository = "https://github.com/AIS-Package/aisp"
|
48
|
-
|
49
43
|
keywords = ["Artificial Immune Systems", "classification", "Natural computing", "machine learning", "artificial intelligence"]
|
50
44
|
|
51
45
|
[project.urls]
|
aisp-0.1.33/aisp/NSA/__init__.py
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|