Hi there, I am trying to implement a small proof o...
# prefect-community
f
Hi there, I am trying to implement a small proof of concept project using Prefect
n
Hi @Fred Israel! What problem are you having?
f
hi @nicholas I've detailed the problem below! Thanks for your interest
n
Of course! Can you try passing
train
directly to the
train_model
task and looking for the result there by accessing
train.category_id
within the task?
f
yes, thats exactly what i did to get around!
n
Awesome! All good now?
f
however this breaks a bit the abstraction, as this function should receive only the labels, not all the data in train
If I would like to do that then I should probably create a new task such as
labels = extract_labels(train)
. Right?
upvote 1
Copy code
def extract_labels (train):
    return train.category_id
n
Yes that would work nicely, then you can pass that directly to
train_model
f
thanks 🙂