One 、 The data contains missing values 、 Infinite problem
1.1 ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
1.2 solve
One 、 The data contains missing values 、 Infinite problem
1.1 ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’).
1.2 solve
The data contains missing values 、 Infinite equal . Use the following code to determine and locate which data has the problem
print(np.isinf(X_train).any()) # Judge X_train Is there an infinite number in
print(np.isfinite(X_train).any()) # Judge X_train Whether or not is a finite number
print(np.isnan(X_train).any()) # Judge X_train Contains missing values in