类 FeatureHasher
- java.lang.Object
-
- org.apache.flink.ml.feature.featurehasher.FeatureHasher
-
- 所有已实现的接口:
Serializable,org.apache.flink.ml.api.AlgoOperator<FeatureHasher>,org.apache.flink.ml.api.Stage<FeatureHasher>,org.apache.flink.ml.api.Transformer<FeatureHasher>,org.apache.flink.ml.common.param.HasCategoricalCols<FeatureHasher>,org.apache.flink.ml.common.param.HasInputCols<FeatureHasher>,org.apache.flink.ml.common.param.HasNumFeatures<FeatureHasher>,org.apache.flink.ml.common.param.HasOutputCol<FeatureHasher>,FeatureHasherParams<FeatureHasher>,org.apache.flink.ml.param.WithParams<FeatureHasher>
public class FeatureHasher extends Object implements org.apache.flink.ml.api.Transformer<FeatureHasher>, FeatureHasherParams<FeatureHasher>
A Transformer that transforms a set of categorical or numerical features into a sparse vector of a specified dimension. The rules of hashing categorical columns and numerical columns are as follows:- For numerical columns, the index of this feature in the output vector is the hash value of the column name and its correponding value is the same as the input.
- For categorical columns, the index of this feature in the output vector is the hash value of the string "column_name=value" and the corresponding value is 1.0.
If multiple features are projected into the same column, the output values are accumulated. For the hashing trick, see https://en.wikipedia.org/wiki/Feature_hashing for details.
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 FeatureHasher()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 Map<org.apache.flink.ml.param.Param<?>,Object>getParamMap()static FeatureHasherload(org.apache.flink.table.api.bridge.java.StreamTableEnvironment env, String path)voidsave(String path)org.apache.flink.table.api.Table[]transform(org.apache.flink.table.api.Table... inputs)
-
-
-
方法详细资料
-
transform
public org.apache.flink.table.api.Table[] transform(org.apache.flink.table.api.Table... inputs)
- 指定者:
transform在接口中org.apache.flink.ml.api.AlgoOperator<FeatureHasher>
-
save
public void save(String path) throws IOException
- 指定者:
save在接口中org.apache.flink.ml.api.Stage<FeatureHasher>- 抛出:
IOException
-
load
public static FeatureHasher load(org.apache.flink.table.api.bridge.java.StreamTableEnvironment env, String path) throws IOException
- 抛出:
IOException
-
getParamMap
public Map<org.apache.flink.ml.param.Param<?>,Object> getParamMap()
- 指定者:
getParamMap在接口中org.apache.flink.ml.param.WithParams<FeatureHasher>
-
-