potash / drain

pipeline library
MIT License
12 stars 5 forks source link

FitPredict requires a Construct with target=False #22

Closed kenben closed 7 years ago

kenben commented 7 years ago

In this example, fitpredict() fails, because it believes that estimator=[]. This can be fixed by setting c.target = False. FitPredict shouldn't care about this.

def construct():
    c = Construct(_class_name='sklearn.ensemble.RandomForestClassifier',
                criterion='entropy', max_features='log2', n_estimators=10)
    c.name = 'estimator'
    c.target = True
    return c

def fitpredict():
    tf = Transform(inputs=[join()])
    c = construct()
    ft = FitPredict(inputs=[c, tf])
    ft.target = True
    return ft
potash commented 7 years ago

Fixed