https://prefect.io logo
Title
f

Fred Israel

01/30/2020, 6:50 PM
Hi there, I am trying to implement a small proof of concept project using Prefect
n

nicholas

01/30/2020, 6:52 PM
Hi @Fred Israel! What problem are you having?
f

Fred Israel

01/30/2020, 6:56 PM
hi @nicholas I've detailed the problem below! Thanks for your interest
n

nicholas

01/30/2020, 7:03 PM
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

Fred Israel

01/30/2020, 7:03 PM
yes, thats exactly what i did to get around!
n

nicholas

01/30/2020, 7:04 PM
Awesome! All good now?
f

Fred Israel

01/30/2020, 7:04 PM
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
def extract_labels (train):
    return train.category_id
n

nicholas

01/30/2020, 7:08 PM
Yes that would work nicely, then you can pass that directly to
train_model
f

Fred Israel

01/30/2020, 7:10 PM
thanks 🙂