0

im predicting some data to my machine learning. Then, im using pathos ThreadPool to predict multiple data at the same time. Example

data 1 
data 2
data 3
data 4

And when i use ThreadPool().map(predict,data) it return wrong sequence of json:

data 2
data 3
data 1
data 4

is theres a way to manage the sequence?

Fregy
  • 111
  • 1
  • 7
  • There is no ``ThreadPool`` in the python standard library. What are referring to in the second example? – Francesco Montesano Feb 09 '18 at 10:17
  • 1
    From what I could see, pathos `ThreadPool.map()` is ordered, so that's not the cause. My guess: you're using an unordered data structure somewhere, probably a `dict`. Try `collections.OrderedDict`. – mata Feb 09 '18 at 10:39
  • EDIT : i just realize that the data is not unordered, but the predicted value somehow get wrong index. Example : its supposed like Document A = Predicted Value from Document A. But the result is Document A = Predicted Value Document A + Document B + and Document C – Fregy Feb 11 '18 at 11:25
  • the other Document predicted well, but sometimes in another document the predicted value its not from it original document. Im using Keras with Tensorflow – Fregy Feb 11 '18 at 11:27

0 Answers0