alexandre kempf
01/04/2020, 1:33 PMfrom prefect import task, Parameter, Flow
import numpy as np
@task
def augment_data(a, b=10):
    return np.sqrt(a)+np.sqrt(b)
with Flow("augment") as flowAug:
    a = Parameter("a")
    aug = augment_data(a, 10)
@task
def load_data(c):
    return c
@task
def train_model(model, d):
    print("Training, {} with {}!".format(model, d))
    return model
with Flow("training") as flowModel:
    init = Parameter("c")
    model = Parameter("model")
    data = load_data(init)
    state = flowAug.run(a=data)
    aug_data = state.result[aug].result
    result = train_model(model, aug_data)
state_model = flowModel.run(c=5, model="SVM")alexandre kempf
01/04/2020, 3:06 PMjosh
01/06/2020, 3:11 PMaugment@task
def run_flowAug(data):
    return flowAug.run(a=data)trainingDylan
Dylan
alexandre kempf
01/07/2020, 10:52 AMalexandre kempf
01/07/2020, 11:09 AM@task
def sumsqrt(a, b):
    return np.sqrt(a)+np.sqrt(b)@task
def run_flowAug(data):
    state = flowAug.run(a=data)
    return state.result["aug"].resultalexandre kempf
01/07/2020, 1:10 PMalexandre kempf
01/07/2020, 1:33 PM