Description

StreamOperator to sink data in libsvm format.

Parameters

Name Description Type Required? Default Value
filePath File path String
overwriteSink Whether to overwrite existing data. Boolean false
vectorCol Name of a vector column String
labelCol Name of the label column in the input table String

Script Example

Script

  1. URL = "http://alink-testdata.cn-hangzhou.oss.aliyun-inc.com/csv/iris_vec.csv";
  2. SCHEMA_STR = "features string, label double"
  3. data = CsvSourceStreamOp().setFilePath(URL).setSchemaStr(SCHEMA_STR)
  4. LibSvmSinkStreamOp().setFilePath('/tmp/libsvm.csv') \
  5. .setLabelCol("label").setVectorCol("features").setOverwriteSink(True).linkFrom(data)
  6. StreamOperator.execute()