cebes / cebes-server

Cebes servers
https://cebes.github.io
Apache License 2.0
2 stars 0 forks source link

Pipeline: Mechanism for input to change (or clear) stateful output #88

Closed phvu closed 7 years ago

phvu commented 7 years ago
    val lr = CebesSparkTestInjector.instance[LinearRegression]
    assert(lr.getName === "linearregression")
    lr.input(lr.featuresCol, "customer")
    lr.input(lr.labelCol, "band_type")
    lr.input(lr.predictionCol, "band_type_predict")
    lr.input(lr.data, getCylinderBands.limit(200))

    //TODO: changing some inputs (e.g. featureCol, labelCol, etc...)
    // should actually clear the stateful output (i.e. model)
    // while changing `data` shouldn't change the stateful output
    // There should be a way to specify which input will effect stateful outputs

    val lrModel = lr.getModel()
    assert(lrModel.isInstanceOf[LinearRegressionModel])

    val dfPredict = Await.result(lr.output(lr.predict).getFuture, Duration.Inf)
    print(dfPredict.schema)
phvu commented 7 years ago

Gonna be fixed with stateful input slots