Skip to content

Commit f344ddd

Browse files
PEP257 D203 D107 D212 #195
1 parent a7c009e commit f344ddd

File tree

8 files changed

+40
-2
lines changed

8 files changed

+40
-2
lines changed

instance_selection/_CNN.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class CNN:
2323
"""
2424

2525
def __init__(self):
26+
"""A constructor for the class."""
2627
self.x_attr = None
2728

2829
def filter(self, samples, y):

instance_selection/_DROP3.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ class DROP3:
3434
"""
3535

3636
def __init__(self, nearest_neighbors=3, power_parameter=2):
37+
"""
38+
The function takes in two parameters, nearest_neighbors and
39+
power_parameter, and assigns them to the attributes nearest_neighbors
40+
and power_parameter
41+
42+
:param nearest_neighbors: The number of nearest neighbors to use when
43+
calculating the weights, defaults to 3 (optional)
44+
:param power_parameter: This is the exponent that is used to calculate
45+
the weights, defaults to 2 (optional)
46+
"""
3747
self.nearest_neighbors = nearest_neighbors
3848
self.power_parameter = power_parameter
3949
self.x_attr = None

instance_selection/_ENN.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ class ENN:
3232
"""
3333

3434
def __init__(self, nearest_neighbors=3, power_parameter=2):
35+
"""
36+
The function takes in two parameters, nearest_neighbors
37+
and power_parameter, and assigns them to the attributes
38+
nearest_neighbors and power_parameter
39+
40+
:param nearest_neighbors: The number of nearest neighbors to use when
41+
calculating the weights, defaults to 3 (optional)
42+
:param power_parameter: This is the exponent that is used to calculate
43+
the weights, defaults to 2 (optional)
44+
"""
3545
self.nearest_neighbors = nearest_neighbors
3646
self.power_parameter = power_parameter
3747
self.x_attr = None

instance_selection/_ICF.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616

1717
class ICF:
18+
1819
"""
1920
Brighton, H., & Mellish, C. (2002). Advances in instance selection for
2021
instance-based learning algorithms. Data mining and knowledge
@@ -33,6 +34,16 @@ class ICF:
3334
"""
3435

3536
def __init__(self, nearest_neighbors=3, power_parameter=2):
37+
"""
38+
The function takes in two parameters, nearest_neighbors and
39+
power_parameter, and assigns them to the attributes nearest_neighbors
40+
and power_parameter.
41+
42+
:param nearest_neighbors: The number of nearest neighbors to use when
43+
calculating the weights, defaults to 3 (optional)
44+
:param power_parameter: This is the exponent that is used to calculate
45+
the weights, defaults to 2 (optional)
46+
"""
3647
self.nearest_neighbors = nearest_neighbors
3748
self.power_parameter = power_parameter
3849
self.x_attr = None

instance_selection/_LocalSets.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
class LocalSets:
15+
1516
"""
1617
Leyva, E., González, A., & Pérez, R. (2015). Three new instance selection
1718
methods based on local sets: A comparative study with several approaches
@@ -23,6 +24,7 @@ class LocalSets:
2324
"""
2425

2526
def __init__(self):
27+
"""A constructor for the class."""
2628
self.local_sets = None
2729
self.n_id = 0
2830

@@ -117,6 +119,7 @@ class LSSm(LocalSets):
117119
"""
118120

119121
def __init__(self):
122+
"""A constructor for the class."""
120123
super().__init__()
121124

122125
def filter(self, instances, labels):
@@ -170,6 +173,7 @@ class LSBo(LocalSets):
170173
"""
171174

172175
def __init__(self):
176+
"""A constructor for the class."""
173177
super(LSBo, self).__init__()
174178

175179
def filter(self, instances, labels):

instance_selection/_MSS.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515

1616
class MSS:
17+
1718
"""
1819
Barandela, R., Ferri, F. J., & Sánchez, J. S. (2005). Decision boundary
1920
preserving prototype selection for nearest neighbor classification.
@@ -26,6 +27,7 @@ class MSS:
2627
"""
2728

2829
def __init__(self):
30+
"""A constructor for the class."""
2931
self.x_attr = None
3032

3133
def filter(self, samples, y):

instance_selection/_RNN.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class RNN:
2626
"""
2727

2828
def __init__(self):
29+
"""A constructor for the class."""
2930
self.x_attr = None
3031

3132
def filter(self, samples, y):

instance_selection/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Instance Selection.
1+
"""Instance Selection.
32
43
The package contains some of the most widely used instance selection algorithms
54
in the literature.

0 commit comments

Comments
 (0)