convert to Python int (if possible) rather than raise an error
@@ -1307,8 +1307,10 @@ class UMAP(BaseEstimator):
if self.target_n_neighbors < 2 and self.target_n_neighbors != -1:
raise ValueError("target_n_neighbors must be greater than 2")
if not isinstance(self.n_components, int):
+ try:
self.n_components = int(self.n_components)
- #raise ValueError("n_components must be an int")
+ except ValueError:
+ raise ValueError("n_components must be an int")
if self.n_components < 1:
raise ValueError("n_components must be greater than 0")
if self.n_epochs is not None and (
