lib/rumale/model_selection/grid_search_cv.rb
# Fit the model with given training data and all sets of parameters.
#
# @param x [Numo::DFloat] (shape: [n_samples, n_features]) The training data to be used for fitting the model.
# @param y [Numo::NArray] (shape: [n_samples, n_outputs]) The target values or labels to be used for fitting the model.
# @return [GridSearchCV] The learned estimator with grid search.
Fit the model with given training data and all sets of parameters.
Fit the model with given training data and all sets of parameters .
def fit(x, y)
        x = check_convert_sample_array(x)
        init_attrs
        param_combinations.each do |prm_set|
          prm_set.each do |prms|
            report = perform_cross_validation(x, y, prms)
            store_cv_result(prms, report)
          end
        end
        find_best_params
        @best_estimator = configurated_estimator(@best_params)
        @best_estimator.fit(x, y)
        self
      end
def fit ( x , y ) x = check_convert_sample_array ( x ) init_attrs param_combinations . each do | prm_set | prm_set . each do | prms | report = perform_cross_validation ( x , y , prms ) store_cv_result ( prms , report ) end end find_best_params @best_estimator = configurated_estimator ( @best_params ) @best_estimator . fit ( x , y ) self end
Fit the model with given training data and all sets of parameters.
Fit the model with given training data and all sets of parameters .
The learned estimator with grid search.
The learned estimator with grid search .
GridSearchCV
x
[n_samples, n_features]) The training data to be used for fitting the model.
[ n_samples n_features ] ) The training data to be used for fitting the model .
y
[n_samples, n_outputs]) The target values or labels to be used for fitting the model.
[ n_samples n_outputs ] ) The target values or labels to be used for fitting the model .