Class: Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1FeatureMap

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/recommendationengine_v1beta1/classes.rb,
lib/google/apis/recommendationengine_v1beta1/representations.rb,
lib/google/apis/recommendationengine_v1beta1/representations.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRecommendationengineV1beta1FeatureMap

Returns a new instance of GoogleCloudRecommendationengineV1beta1FeatureMap.



498
499
500
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 498

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#categorical_featuresHash<String,Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1FeatureMapStringList>

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"] Corresponds to the JSON property categoricalFeatures



489
490
491
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 489

def categorical_features
  @categorical_features
end

#numerical_featuresHash<String,Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1FeatureMapFloatList>

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]` Corresponds to the JSON property numericalFeatures



496
497
498
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 496

def numerical_features
  @numerical_features
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



503
504
505
506
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 503

def update!(**args)
  @categorical_features = args[:categorical_features] if args.key?(:categorical_features)
  @numerical_features = args[:numerical_features] if args.key?(:numerical_features)
end