Skip to content

ValueError: Input contains NaN, infinity or a value too large for dtype('float64'). #1

Description

@MadihaMalik1

Hi!
The tutorial is very helpful but when I scale, fit and predict it according to my data set it raises
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').

I have tried using:
np.isfinite(X_train).any(), np.isfinite(y_train).any(), np.isfinite(X_test).any()
np.isnan(X_train).any(), np.isnan(y_train).any(), np.isnan(X_test).any()
but still the problem is here.. how can i resolve this problem..
My data set values are actually too large like in exponential form and also it contains negative values. like this:
2.15E-06 -0.000556462 0.000197385 -0.000919 -0.000578077....

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions