lib/rumale/ensemble/gradient_boosting_classifier.rb
# Predict class labels for samples.
#
# @param x [Numo::DFloat] (shape: [n_samples, n_features]) The samples to predict the labels.
# @return [Numo::Int32] (shape: [n_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)
        n_samples = x.shape[0]
        probs = predict_proba(x)
        Numo::Int32.asarray(Array.new(n_samples) { |n| @classes[probs[n, true].max_index] })
      end
def predict ( x ) x = check_convert_sample_array ( x ) n_samples = x . shape [ 0 ] probs = predict_proba ( x ) Numo :: Int32 . asarray ( Array . new ( n_samples ) { | n | @classes [ probs [ n , true ] . max_index ] } ) end
Predict class labels for samples.
Predict class labels for samples .
[n_samples]) Predicted class label per sample.
[ n_samples ] ) Predicted class label per sample .
Numo::Int32
x
[n_samples, n_features]) The samples to predict the labels.
[ n_samples n_features ] ) The samples to predict the labels .