class VectorChiSqSelectorBatchOp extends BatchOperator<VectorChiSqSelectorBatchOp> implements VectorChiSqSelectorParams<VectorChiSqSelectorBatchOp>,
    WithModelInfoBatchOp<ChisqSelectorModelInfo, VectorChiSqSelectorBatchOp, ChisqSelectorModelInfoBatchOp> {

    @Override
    public VectorChiSqSelectorBatchOp linkFrom(BatchOperator<?>... inputs) {
        BatchOperator<?> in = checkAndGetFirst(inputs);
        String vectorColName = getSelectedCol();
        String labelColName = getLabelCol();

        SelectorType selectorType = getParams().get(SELECTOR_TYPE);
        int numTopFeatures = getParams().get(NUM_TOP_FEATURES);
        double percentile = getParams().get(PERCENTILE);
        double fpr = getParams().get(FPR);
        double fdr = getParams().get(FDR);
        double fwe = getParams().get(FWE);

        DataSet<Row> chiSquareTest =
            ChiSquareTestUtil.vectorTest(in, vectorColName, labelColName);

        DataSet<Row> model = chiSquareTest.mapPartition(
            new ChisqSelectorUtil.ChiSquareSelector(null, selectorType, numTopFeatures, percentile, fpr, fdr, fwe))
            .name("FilterFeature")
            .setParallelism(1);

        setOutputTable(DataSetConversionUtil.toTable(in.getMLEnvironmentId(), model, new ChiSqSelectorModelDataConverter().getModelSchema()));

        return this;
    }

    public  VectorChiSqSelectorBatchOp();
    public  VectorChiSqSelectorBatchOp(Params params);

}