lib/rumale/kernel_machine/kernel_ridge_classifier.rb
# Predict class labels for samples.
#
# @param x [Numo::DFloat] (shape: [n_testing_samples, n_training_samples])
#     The kernel matrix between testing samples and training samples to predict the labels.
# @return [Numo::Int32] (shape: [n_testing_samples]) Predicted class label per sample.
Predict class labels for samples.
Predict class labels for samples .
def predict(x)
        x = check_convert_sample_array(x)
        scores = decision_function(x)
        n_samples, n_classes = scores.shape
        label_ids = scores.max_index(axis: 1) - Numo::Int32.new(n_samples).seq * n_classes
        @classes[label_ids].dup
      end
def predict ( x ) x = check_convert_sample_array ( x ) scores = decision_function ( x ) n_samples , n_classes = scores . shape label_ids = scores . max_index ( axis : 1 ) - Numo :: Int32 . new ( n_samples ) . seq * n_classes @classes [ label_ids ] . dup end
Predict class labels for samples.
Predict class labels for samples .
[n_testing_samples]) Predicted class label per sample.
[ n_testing_samples ] ) Predicted class label per sample .
Numo::Int32
x
[n_testing_samples, n_training_samples]) The kernel matrix between testing samples and training samples to predict the labels.
[ n_testing_samples n_training_samples ] ) The kernel matrix between testing samples and training samples to predict the labels .