class ChiSqSelectorBatchOp extends BatchOperator<ChiSqSelectorBatchOp> implements ChiSqSelectorParams<ChiSqSelectorBatchOp>,
    WithModelInfoBatchOp<ChisqSelectorModelInfo, ChiSqSelectorBatchOp, ChisqSelectorModelInfoBatchOp> {

    @Override
    public ChiSqSelectorBatchOp linkFrom(BatchOperator<?>... inputs) {
        BatchOperator<?> in = checkAndGetFirst(inputs);
        String[] selectedColNames = getSelectedCols();
        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.test(in, selectedColNames, labelColName);

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

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

        return this;
    }

    public  ChiSqSelectorBatchOp();
    public  ChiSqSelectorBatchOp(Params params);

}