AlexRodis / bayesian-models

A small library build on top of `pymc` that implements many common models
Apache License 2.0
0 stars 0 forks source link

#56 `numpy` inputs to `BEST` raises #63

Closed AlexRodis closed 1 year ago

AlexRodis commented 1 year ago

The reason this is happening is because BEST like all models call CommonDataProcessor to check for missing values. In this case however the dtype of the input is object and the underlying implementation relies on numpy.isnan, which wont't work with strings and objects. We can extend this by allowing isnan to work with objects:

cmp = np.vectoryize(lambda elem : elem!=elem)
cmp(arr)

This works because in IEEE specs NaN != NaN which numpy.nan implements