https://prefect.io logo
Title
j

John Ramey

04/07/2022, 6:51 PM
Is it okay to return a fitted
scikit-learn
object from a task? Any gotchas if I then pass it to a second task which is responsible for calling
.predict()
using that same object. Reason I’m asking: I thought I read somewhere in the prefect docs to be careful with state in such cases, but I can’t seem to find it.
a

Anna Geller

04/07/2022, 7:10 PM
It largely depends on your storage - if you use pickle storage, your objects must be serializable with cloudpickle
👍 1
k

Kevin Kho

04/07/2022, 7:22 PM
I believe all sklearn models are pickle serializable so this should be fine. And it won’t even affect anything except the
result
. If you are passing it downstream, it is perfectly fine
👍 2
j

John Ramey

04/07/2022, 7:29 PM
Awesome, thanks