lib/rumale/pairwise_metric.rb in rumale-0.22.1 vs lib/rumale/pairwise_metric.rb in rumale-0.22.2

- old
+ new

@@ -121,10 +121,10 @@ # @param y [Numo::DFloat] (shape: [n_samples_y, n_features]) # @param degree [Integer] The parameter of polynomial kernel. # @param gamma [Float] The parameter of polynomial kernel, if nil it is 1 / n_features. # @param coef [Integer] The parameter of polynomial kernel. # @return [Numo::DFloat] (shape: [n_samples_x, n_samples_x] or [n_samples_x, n_samples_y] if y is given) - def polynomial_kernel(x, y = nil, degree = 3, gamma = nil, coef = 1) + def polynomial_kernel(x, y = nil, degree = 3, gamma = nil, coef = 1) # rubocop:disable Metrics/ParameterLists y = x if y.nil? gamma ||= 1.0 / x.shape[1] x = Rumale::Validation.check_convert_sample_array(x) y = Rumale::Validation.check_convert_sample_array(y) Rumale::Validation.check_params_numeric(gamma: gamma, degree: degree, coef: coef)