Java Code Examples for org.apache.flink.ml.api.misc.param.Params#clone()

The following examples show how to use org.apache.flink.ml.api.misc.param.Params#clone() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OneVsRestModelMapper.java    From Alink with Apache License 2.0 6 votes vote down vote up
public OneVsRestModelMapper(TableSchema modelSchema, TableSchema dataSchema, Params params) {
    super(modelSchema, dataSchema, params);

    String predResultColName = params.get(OneVsRestPredictParams.PREDICTION_COL);
    String[] keepColNames = params.get(OneVsRestPredictParams.RESERVED_COLS);
    this.predDetail = params.contains(OneVsRestPredictParams.PREDICTION_DETAIL_COL);
    int numModelCols = modelSchema.getFieldNames().length;
    TypeInformation labelType = modelSchema.getFieldTypes()[numModelCols - 1];
    if (predDetail) {
        String predDetailColName = params.get(OneVsRestPredictParams.PREDICTION_DETAIL_COL);
        outputColsHelper = new OutputColsHelper(dataSchema, new String[]{predResultColName, predDetailColName},
            new TypeInformation[]{labelType, Types.STRING}, keepColNames);
    } else {
        outputColsHelper = new OutputColsHelper(dataSchema, predResultColName, labelType, keepColNames);
    }

    this.binClsPredParams = params.clone();
    this.binClsPredParams.set(OneVsRestPredictParams.RESERVED_COLS, new String[0]);
    this.binClsPredParams.set(OneVsRestPredictParams.PREDICTION_COL, "pred_result");
    this.binClsPredParams.set(OneVsRestPredictParams.PREDICTION_DETAIL_COL, "pred_detail");
}
 
Example 2
Source File: TuningEvaluator.java    From Alink with Apache License 2.0 5 votes vote down vote up
public TuningEvaluator(Params params) {
	if (null == params) {
		this.params = new Params();
	} else {
		this.params = params.clone();
	}
}
 
Example 3
Source File: AlgoOperator.java    From Alink with Apache License 2.0 5 votes vote down vote up
/**
 * Construct the operator with the initial Params.
 */
protected AlgoOperator(Params params) {
    if (null == params) {
        this.params = new Params();
    } else {
        this.params = params.clone();
    }
}
 
Example 4
Source File: AlgoOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Construct the operator with the initial Params.
 */
protected AlgoOperator(Params params) {
	if (null == params) {
		this.params = new Params();
	} else {
		this.params = params.clone();
	}
}
 
Example 5
Source File: PipelineStageBase.java    From flink with Apache License 2.0 5 votes vote down vote up
public PipelineStageBase(Params params) {
	if (null == params) {
		this.params = new Params();
	} else {
		this.params = params.clone();
	}
}
 
Example 6
Source File: BaseDB.java    From Alink with Apache License 2.0 5 votes vote down vote up
protected BaseDB(Params params) {
    if (null == params) {
        this.params = new Params();
    } else {
        this.params = params.clone();
    }
    this.params.set(HasIoName.IO_NAME, AnnotationUtils.annotatedName(this.getClass()));
}
 
Example 7
Source File: PipelineStageBase.java    From Alink with Apache License 2.0 5 votes vote down vote up
public PipelineStageBase(Params params) {
    if (null == params) {
        this.params = new Params();
    } else {
        this.params = params.clone();
    }
}
 
Example 8
Source File: LassoRegTrainBatchOp.java    From Alink with Apache License 2.0 4 votes vote down vote up
public LassoRegTrainBatchOp(Params params) {
	super(params.clone(), LinearModelType.LinearReg, "LASSO");
}
 
Example 9
Source File: Mapper.java    From Alink with Apache License 2.0 4 votes vote down vote up
public Mapper(TableSchema dataSchema, Params params) {
	this.dataFieldNames = dataSchema.getFieldNames();
	this.dataFieldTypes = dataSchema.getFieldDataTypes();
	this.params = (null == params) ? new Params() : params.clone();
}
 
Example 10
Source File: FlatMapper.java    From Alink with Apache License 2.0 4 votes vote down vote up
public FlatMapper(TableSchema dataSchema, Params params) {
	this.dataFieldNames = dataSchema.getFieldNames();
	this.dataFieldTypes = dataSchema.getFieldDataTypes();
	this.params = (null == params) ? new Params() : params.clone();
}
 
Example 11
Source File: LinearRegTrainBatchOp.java    From Alink with Apache License 2.0 4 votes vote down vote up
public LinearRegTrainBatchOp(Params params) {
	super(params.clone(), LinearModelType.LinearReg, "Linear Regression");
}
 
Example 12
Source File: RidgeRegTrainBatchOp.java    From Alink with Apache License 2.0 4 votes vote down vote up
public RidgeRegTrainBatchOp(Params params) {
	super(params.clone(), LinearModelType.LinearReg, "Ridge Regression");
}
 
Example 13
Source File: TripleToVectorBatchOp.java    From Alink with Apache License 2.0 4 votes vote down vote up
public TripleToVectorBatchOp(Params params) {
	super(FormatType.VECTOR, params.clone());
}
 
Example 14
Source File: TripleToColumnsBatchOp.java    From Alink with Apache License 2.0 4 votes vote down vote up
public TripleToColumnsBatchOp(Params params) {
    super(FormatType.COLUMNS, params.clone());
}
 
Example 15
Source File: TripleToCsvBatchOp.java    From Alink with Apache License 2.0 4 votes vote down vote up
public TripleToCsvBatchOp(Params params) {
    super(FormatType.CSV, params.clone());
}
 
Example 16
Source File: TripleToJsonBatchOp.java    From Alink with Apache License 2.0 4 votes vote down vote up
public TripleToJsonBatchOp(Params params) {
    super(FormatType.JSON, params.clone());
}
 
Example 17
Source File: Mapper.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Construct a Mapper.
 *
 * @param dataSchema The schema of input rows.
 * @param params The parameters for this mapper.
 */
public Mapper(TableSchema dataSchema, Params params) {
	this.dataFieldNames = dataSchema.getFieldNames();
	this.dataFieldTypes = dataSchema.getFieldDataTypes();
	this.params = (null == params) ? new Params() : params.clone();
}