Skip to content

Commit acfe9f0

Browse files
Update adaptive_resonance_theory.py
1 parent cfd23a2 commit acfe9f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

neural_network/adaptive_resonance_theory.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ class ART1:
1616

1717
def __init__(self, num_features: int, vigilance: float = 0.7) -> None:
1818
"""
19-
Initialize the ART1 model with the given number of features and vigilance parameter.
19+
Initialize the ART1 model with number of features and vigilance parameter.
2020
2121
Args:
2222
num_features (int): Number of features in the input data.
2323
vigilance (float): Threshold for similarity (default is 0.7).
2424
2525
Raises:
26-
ValueError: If num_features is not positive or if vigilance is not between 0 and 1.
26+
ValueError: If num_features not positive or vigilance not between 0 and 1.
2727
"""
2828
if num_features <= 0:
2929
raise ValueError("Number of features must be a positive integer.")
@@ -50,7 +50,7 @@ def _similarity(self, weight_vector: np.ndarray, input_vector: np.ndarray) -> fl
5050
or len(input_vector) != self.num_features
5151
):
5252
raise ValueError(
53-
f"Both weight_vector and input_vector must have {self.num_features} features."
53+
"Both weight_vector and input_vector must have certain number."
5454
)
5555

5656
return np.dot(weight_vector, input_vector) / self.num_features
@@ -107,7 +107,7 @@ def art1_example() -> None:
107107
"""
108108
Example function demonstrating the usage of the ART1 model.
109109
110-
This function creates a dataset, trains the ART1 model, and prints the assigned clusters for each data point.
110+
This function creates dataset, trains ART1 model, and prints assigned clusters.
111111
112112
Examples:
113113
>>> art1_example()

0 commit comments

Comments
 (0)