Rogerh91 / Springboard-Blog-Tutorials

71 stars 87 forks source link

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

Open MadihaMalik1 opened 7 years ago

MadihaMalik1 commented 7 years ago

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....

NastaseMariana commented 6 years ago

Hello,

Thank you for the tutorial. Unfortunately, I have an error when I try to run the "KSVM" part. I used the same files, like you.

The error is :

df.model<-ksvm(corpus~., data= df.train, kernel="rbfdot") Error in .local(x, ...) : No Support Vectors found. You may want to change your parameters

Do you have any idea where is the problem?

Thank you.

charrychen1024 commented 4 years ago

Hello,

Thank you for the tutorial. Unfortunately, I have an error when I try to run the "KSVM" part. I used the same files, like you.

The error is :

df.model<-ksvm(corpus~., data= df.train, kernel="rbfdot") Error in .local(x, ...) : No Support Vectors found. You may want to change your parameters

Do you have any idea where is the problem?

Thank you.

You need to transform the data type of train$corpus befor modeling, like this: train.df$corpus <- factor(label.df$filenames_1)