We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6bd9342 commit 4c549adCopy full SHA for 4c549ad
1 file changed
pyvisim/encoders/_base_encoder.py
@@ -440,7 +440,12 @@ def learn(
440
:param images: An iterable of images.
441
:param dim_reduction_factor: If a value is provided, a new PCA model will be used to reduce the dimensionality of the feature space
442
:raises RuntimeError: If the encoder has no clustering model configured.
443
+ :raises ValueError: If dim_reduction_factor is provided but is not a positive integer.
444
"""
445
+ if dim_reduction_factor is not None and (
446
+ dim_reduction_factor <= 0 or not isinstance(dim_reduction_factor, int)
447
+ ):
448
+ raise ValueError("dim_reduction_factor must be a positive integer.")
449
if self._clustering_model is None:
450
raise RuntimeError(
451
"This encoder has no clustering model to fit. "
0 commit comments