0

I have a dataset with a variable weight of evidence(woe) that includes Inf/-inf. I used linear regression, however it could not be trained, giving error

Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : NA/NaN/Inf in 'y'

I am searching for a model that can train with Inf and predict woe values for test data. If it is not possible, is there another solution for Inf, like cleaning or mutation?

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
y.eska
  • 67
  • 6

1 Answers1

1

You would have to understand the nature of these Inf cases.

In most cases you can treat them as outliers. There are many techniques to deal with that. You can replace them with the mean/median value, you can predict the value with a simple linear regression model or, if the % of Inf instances in total observations is relatively low, you can exclude them.

Hope this brings some clarity.

AlexB
  • 3,061
  • 2
  • 17
  • 19