Class: Google::Apis::MlV1::GoogleCloudMlV1ParameterSpec

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

Overview

Represents a single hyperparameter to optimize.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudMlV1ParameterSpec

Returns a new instance of GoogleCloudMlV1ParameterSpec.



1947
1948
1949
# File 'lib/google/apis/ml_v1/classes.rb', line 1947

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

Instance Attribute Details

#categorical_valuesArray<String>

Required if type is CATEGORICAL. The list of possible categories. Corresponds to the JSON property categoricalValues

Returns:

  • (Array<String>)


1907
1908
1909
# File 'lib/google/apis/ml_v1/classes.rb', line 1907

def categorical_values
  @categorical_values
end

#discrete_valuesArray<Float>

Required if type is DISCRETE. A list of feasible points. The list should be in strictly increasing order. For instance, this parameter might have possible settings of 1.5, 2.5, and 4.0. This list should not contain more than 1,000 values. Corresponds to the JSON property discreteValues

Returns:

  • (Array<Float>)


1915
1916
1917
# File 'lib/google/apis/ml_v1/classes.rb', line 1915

def discrete_values
  @discrete_values
end

#max_valueFloat

Required if type is DOUBLE or INTEGER. This field should be unset if type is CATEGORICAL. This value should be integers if type is INTEGER. Corresponds to the JSON property maxValue

Returns:

  • (Float)


1921
1922
1923
# File 'lib/google/apis/ml_v1/classes.rb', line 1921

def max_value
  @max_value
end

#min_valueFloat

Required if type is DOUBLE or INTEGER. This field should be unset if type is CATEGORICAL. This value should be integers if type is INTEGER. Corresponds to the JSON property minValue

Returns:

  • (Float)


1927
1928
1929
# File 'lib/google/apis/ml_v1/classes.rb', line 1927

def min_value
  @min_value
end

#parameter_nameString

Required. The parameter name must be unique amongst all ParameterConfigs in a HyperparameterSpec message. E.g., "learning_rate". Corresponds to the JSON property parameterName

Returns:

  • (String)


1933
1934
1935
# File 'lib/google/apis/ml_v1/classes.rb', line 1933

def parameter_name
  @parameter_name
end

#scale_typeString

Optional. How the parameter should be scaled to the hypercube. Leave unset for categorical parameters. Some kind of scaling is strongly recommended for real or integral parameters (e.g., UNIT_LINEAR_SCALE). Corresponds to the JSON property scaleType

Returns:

  • (String)


1940
1941
1942
# File 'lib/google/apis/ml_v1/classes.rb', line 1940

def scale_type
  @scale_type
end

#typeString

Required. The type of the parameter. Corresponds to the JSON property type

Returns:

  • (String)


1945
1946
1947
# File 'lib/google/apis/ml_v1/classes.rb', line 1945

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1952
1953
1954
1955
1956
1957
1958
1959
1960
# File 'lib/google/apis/ml_v1/classes.rb', line 1952

def update!(**args)
  @categorical_values = args[:categorical_values] if args.key?(:categorical_values)
  @discrete_values = args[:discrete_values] if args.key?(:discrete_values)
  @max_value = args[:max_value] if args.key?(:max_value)
  @min_value = args[:min_value] if args.key?(:min_value)
  @parameter_name = args[:parameter_name] if args.key?(:parameter_name)
  @scale_type = args[:scale_type] if args.key?(:scale_type)
  @type = args[:type] if args.key?(:type)
end