Class FeatureMap (0.38.0)

public final class FeatureMap extends GeneratedMessageV3 implements FeatureMapOrBuilder

FeatureMap represents extra features that customers want to include in the recommendation model for catalogs/user events as categorical/numerical features.

Protobuf type google.cloud.recommendationengine.v1beta1.FeatureMap

Implements

FeatureMapOrBuilder

Static Fields

CATEGORICAL_FEATURES_FIELD_NUMBER

public static final int CATEGORICAL_FEATURES_FIELD_NUMBER
Field Value
TypeDescription
int

NUMERICAL_FEATURES_FIELD_NUMBER

public static final int NUMERICAL_FEATURES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static FeatureMap getDefaultInstance()
Returns
TypeDescription
FeatureMap

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static FeatureMap.Builder newBuilder()
Returns
TypeDescription
FeatureMap.Builder

newBuilder(FeatureMap prototype)

public static FeatureMap.Builder newBuilder(FeatureMap prototype)
Parameter
NameDescription
prototypeFeatureMap
Returns
TypeDescription
FeatureMap.Builder

parseDelimitedFrom(InputStream input)

public static FeatureMap parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static FeatureMap parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static FeatureMap parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static FeatureMap parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static FeatureMap parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static FeatureMap parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
FeatureMap
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<FeatureMap> parser()
Returns
TypeDescription
Parser<FeatureMap>

Methods

containsCategoricalFeatures(String key)

public boolean containsCategoricalFeatures(String key)

Categorical features that can take on one of a limited number of possible values. Some examples would be the brand/maker of a product, or country of a customer.

Feature names and values must be UTF-8 encoded strings.

For example: { "colors": {"value": ["yellow", "green"]}, "sizes": {"value":["S", "M"]}

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

containsNumericalFeatures(String key)

public boolean containsNumericalFeatures(String key)

Numerical features. Some examples would be the height/weight of a product, or age of a customer.

Feature names must be UTF-8 encoded strings.

For example: { "lengths_cm": {"value":[2.3, 15.4]}, "heights_cm": {"value":[8.1, 6.4]} }

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCategoricalFeatures() (deprecated)

public Map<String,FeatureMap.StringList> getCategoricalFeatures()
Returns
TypeDescription
Map<String,StringList>

getCategoricalFeaturesCount()

public int getCategoricalFeaturesCount()

Categorical features that can take on one of a limited number of possible values. Some examples would be the brand/maker of a product, or country of a customer.

Feature names and values must be UTF-8 encoded strings.

For example: { "colors": {"value": ["yellow", "green"]}, "sizes": {"value":["S", "M"]}

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;

Returns
TypeDescription
int

getCategoricalFeaturesMap()

public Map<String,FeatureMap.StringList> getCategoricalFeaturesMap()

Categorical features that can take on one of a limited number of possible values. Some examples would be the brand/maker of a product, or country of a customer.

Feature names and values must be UTF-8 encoded strings.

For example: { "colors": {"value": ["yellow", "green"]}, "sizes": {"value":["S", "M"]}

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;

Returns
TypeDescription
Map<String,StringList>

getCategoricalFeaturesOrDefault(String key, FeatureMap.StringList defaultValue)

public FeatureMap.StringList getCategoricalFeaturesOrDefault(String key, FeatureMap.StringList defaultValue)

Categorical features that can take on one of a limited number of possible values. Some examples would be the brand/maker of a product, or country of a customer.

Feature names and values must be UTF-8 encoded strings.

For example: { "colors": {"value": ["yellow", "green"]}, "sizes": {"value":["S", "M"]}

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;

Parameters
NameDescription
keyString
defaultValueFeatureMap.StringList
Returns
TypeDescription
FeatureMap.StringList

getCategoricalFeaturesOrThrow(String key)

public FeatureMap.StringList getCategoricalFeaturesOrThrow(String key)

Categorical features that can take on one of a limited number of possible values. Some examples would be the brand/maker of a product, or country of a customer.

Feature names and values must be UTF-8 encoded strings.

For example: { "colors": {"value": ["yellow", "green"]}, "sizes": {"value":["S", "M"]}

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;

Parameter
NameDescription
keyString
Returns
TypeDescription
FeatureMap.StringList

getDefaultInstanceForType()

public FeatureMap getDefaultInstanceForType()
Returns
TypeDescription
FeatureMap

getNumericalFeatures() (deprecated)

public Map<String,FeatureMap.FloatList> getNumericalFeatures()
Returns
TypeDescription
Map<String,FloatList>

getNumericalFeaturesCount()

public int getNumericalFeaturesCount()

Numerical features. Some examples would be the height/weight of a product, or age of a customer.

Feature names must be UTF-8 encoded strings.

For example: { "lengths_cm": {"value":[2.3, 15.4]}, "heights_cm": {"value":[8.1, 6.4]} }

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;

Returns
TypeDescription
int

getNumericalFeaturesMap()

public Map<String,FeatureMap.FloatList> getNumericalFeaturesMap()

Numerical features. Some examples would be the height/weight of a product, or age of a customer.

Feature names must be UTF-8 encoded strings.

For example: { "lengths_cm": {"value":[2.3, 15.4]}, "heights_cm": {"value":[8.1, 6.4]} }

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;

Returns
TypeDescription
Map<String,FloatList>

getNumericalFeaturesOrDefault(String key, FeatureMap.FloatList defaultValue)

public FeatureMap.FloatList getNumericalFeaturesOrDefault(String key, FeatureMap.FloatList defaultValue)

Numerical features. Some examples would be the height/weight of a product, or age of a customer.

Feature names must be UTF-8 encoded strings.

For example: { "lengths_cm": {"value":[2.3, 15.4]}, "heights_cm": {"value":[8.1, 6.4]} }

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;

Parameters
NameDescription
keyString
defaultValueFeatureMap.FloatList
Returns
TypeDescription
FeatureMap.FloatList

getNumericalFeaturesOrThrow(String key)

public FeatureMap.FloatList getNumericalFeaturesOrThrow(String key)

Numerical features. Some examples would be the height/weight of a product, or age of a customer.

Feature names must be UTF-8 encoded strings.

For example: { "lengths_cm": {"value":[2.3, 15.4]}, "heights_cm": {"value":[8.1, 6.4]} }

map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
FeatureMap.FloatList

getParserForType()

public Parser<FeatureMap> getParserForType()
Returns
TypeDescription
Parser<FeatureMap>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public FeatureMap.Builder newBuilderForType()
Returns
TypeDescription
FeatureMap.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected FeatureMap.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
FeatureMap.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public FeatureMap.Builder toBuilder()
Returns
TypeDescription
FeatureMap.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException