lib/svmkit/kernel_approximation/rbf.rb in svmkit-0.1.2 vs lib/svmkit/kernel_approximation/rbf.rb in svmkit-0.1.3
- old
+ new
@@ -38,12 +38,13 @@
# Create a new transformer for mapping to RBF kernel feature space.
#
# @overload new(gamma: 1.0, n_components: 128, random_seed: 1) -> RBF
#
- # @param gamma [Float] (defaults to: 1.0) The parameter of RBF kernel: exp(-gamma * x^2).
- # @param n_components [Integer] (defaults to: 128) The number of dimensions of the RBF kernel feature space.
- # @param random_seed [Integer] (defaults to: nil) The seed value using to initialize the random generator.
+ # @param params [Hash] The parameters for RBF kernel approximation.
+ # @option params [Float] :gamma (1.0) The parameter of RBF kernel: exp(-gamma * x^2).
+ # @option params [Integer] :n_components (128) The number of dimensions of the RBF kernel feature space.
+ # @option params [Integer] :random_seed (nil) The seed value using to initialize the random generator.
def initialize(params = {})
self.params = DEFAULT_PARAMS.merge(Hash[params.map { |k, v| [k.to_sym, v] }])
self.params[:random_seed] ||= srand
@rng = Random.new(self.params[:random_seed])
@random_mat = nil