Task: Handle NaN and Infinity Values in NumPy Matrix for Scikit-learn Compatibility
Task: Handle NaN and Infinity Values in NumPy Matrix for Scikit-learn Compatibility: a task in Terminal-Lego-15k (Harbor dataset). Write a Python script that cleans a NumPy matrix containing NaN and infinity values so that it can be safely passed to scikit-learn algorithms (such as Affinity…
The task
Write a Python script that cleans a NumPy matrix containing NaN and infinity values so that it can be safely passed to scikit-learn algorithms (such as Affinity Propagation) without raising `ValueError: Input contains NaN, infinity or a value too large for dtype('float64')`.
Part of PrimeIntellect/Terminal-Lego-15k.