Class: Google::Apis::PredictionV1_3::Training::ModelInfo

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

Overview

Model metadata.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ ModelInfo

Returns a new instance of ModelInfo



242
243
244
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 242

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

Instance Attribute Details

#class_weighted_accuracyFloat

Estimated accuracy of model taking utility weights into account [Categorical models only]. Corresponds to the JSON property classWeightedAccuracy

Returns:

  • (Float)


195
196
197
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 195

def class_weighted_accuracy
  @class_weighted_accuracy
end

#classification_accuracyFloat

A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an estimate, based on the amount and quality of the training data, of the estimated prediction accuracy. You can use this is a guide to decide whether the results are accurate enough for your needs. This estimate will be more reliable if your real input data is similar to your training data [Categorical models only] . Corresponds to the JSON property classificationAccuracy

Returns:

  • (Float)


205
206
207
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 205

def classification_accuracy
  @classification_accuracy
end

#confusion_matrixHash<String,Hash<String,Float>>

An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair predicted_label, count, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes [Categorical models only]. Corresponds to the JSON property confusionMatrix

Returns:

  • (Hash<String,Hash<String,Float>>)


214
215
216
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 214

def confusion_matrix
  @confusion_matrix
end

#confusion_matrix_row_totalsHash<String,Float>

A list of the confusion matrix row totals Corresponds to the JSON property confusionMatrixRowTotals

Returns:

  • (Hash<String,Float>)


219
220
221
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 219

def confusion_matrix_row_totals
  @confusion_matrix_row_totals
end

#mean_squared_errorFloat

An estimated mean squared error. The can be used to measure the quality of the predicted model [Regression models only]. Corresponds to the JSON property meanSquaredError

Returns:

  • (Float)


225
226
227
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 225

def mean_squared_error
  @mean_squared_error
end

#model_typeString

Type of predictive model (CLASSIFICATION or REGRESSION) Corresponds to the JSON property modelType

Returns:

  • (String)


230
231
232
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 230

def model_type
  @model_type
end

#number_classesFixnum

Number of classes in the trained model [Categorical models only]. Corresponds to the JSON property numberClasses

Returns:

  • (Fixnum)


235
236
237
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 235

def number_classes
  @number_classes
end

#number_instancesFixnum

Number of valid data instances used in the trained model. Corresponds to the JSON property numberInstances

Returns:

  • (Fixnum)


240
241
242
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 240

def number_instances
  @number_instances
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



247
248
249
250
251
252
253
254
255
256
# File 'generated/google/apis/prediction_v1_3/classes.rb', line 247

def update!(**args)
  @class_weighted_accuracy = args[:class_weighted_accuracy] if args.key?(:class_weighted_accuracy)
  @classification_accuracy = args[:classification_accuracy] if args.key?(:classification_accuracy)
  @confusion_matrix = args[:confusion_matrix] if args.key?(:confusion_matrix)
  @confusion_matrix_row_totals = args[:confusion_matrix_row_totals] if args.key?(:confusion_matrix_row_totals)
  @mean_squared_error = args[:mean_squared_error] if args.key?(:mean_squared_error)
  @model_type = args[:model_type] if args.key?(:model_type)
  @number_classes = args[:number_classes] if args.key?(:number_classes)
  @number_instances = args[:number_instances] if args.key?(:number_instances)
end