I am trying to convert threshold array(pickle file of isolation forest from scikit learn) of type from Float64 to Float32
for i in range(len(tree.tree_.threshold)):
tree.tree_.threshold[i] = tree.tree_.threshold[i].astype(np.float32)
Then Printing it
for value in tree.tree_.threshold[:5]:
print(type(value))
print(value)
the output i am getting is :
<class 'numpy.float64'>
526226.0
<class 'numpy.float64'>
91.9514312744
<class 'numpy.float64'>
3.60330319405
<class 'numpy.float64'>
-2.0
<class 'numpy.float64'>
-2.0
I am not getting a proper conversion to Float32. I want to convert values and their type to Float32, Did anybody have any workaround this ?