public static class ExampleBuilder.NamespaceBuilder extends Object
Modifier and Type | Method and Description |
---|---|
ExampleBuilder.NamespaceBuilder |
addCategoricalFeature(Object feature)
Add a categorical feature to this namespace (e.g.
|
ExampleBuilder.NamespaceBuilder |
addCategoricalFeature(String subNamespace,
Object categoricalValue)
Add a categorical feature to this namespace (e.g.
|
ExampleBuilder.NamespaceBuilder |
addNumericalFeature(String featureName,
double numericalValue)
Add numerical feature to this namespace (e.g.
|
ExampleBuilder.NamespaceBuilder |
addTextAsFeatures(String text)
Add text feature to this namespace (e.g.
|
ExampleBuilder.NamespaceBuilder |
namespaceWeight(double weight)
Namespace weight acts as a global scaling of all the values of the features in this namespace.
|
String |
toString() |
public ExampleBuilder.NamespaceBuilder namespaceWeight(double weight)
If value is omitted, the default is 1.
weight
- namespace weightpublic ExampleBuilder.NamespaceBuilder addCategoricalFeature(@Nonnull Object feature)
feature
- categorical featurepublic ExampleBuilder.NamespaceBuilder addCategoricalFeature(@Nonnull String subNamespace, @Nonnull Object categoricalValue)
subNamespace
- sub namespace - e.g. namespace=person, subNamespace=gender, feature=FemalecategoricalValue
- - categorical valuepublic ExampleBuilder.NamespaceBuilder addTextAsFeatures(@Nonnull String text)
text
- raw textpublic ExampleBuilder.NamespaceBuilder addNumericalFeature(@Nonnull String featureName, double numericalValue)
Also you may use this method to add categorical feature with weight
(e.g. bag of words model with tf-idf weights)
featureName
- name of numerical feature (e.g. ctr)numericalValue
- value of numerical feature (e.g. 0.032)Copyright © 2017. All rights reserved.