lib/svmkit/linear_model/logistic_regression.rb in svmkit-0.2.2 vs lib/svmkit/linear_model/logistic_regression.rb in svmkit-0.2.3

- old
+ new

@@ -72,10 +72,10 @@ [samples, Numo::DFloat.ones([x.shape[0], 1]) * @params[:bias_scale]] ) end # Initialize some variables. n_samples, n_features = samples.shape - rand_ids = [*0..n_samples - 1].shuffle(random: @rng) + rand_ids = [*0...n_samples].shuffle(random: @rng) weight_vec = Numo::DFloat.zeros(n_features) # Start optimization. @params[:max_iter].times do |t| # random sampling subset_ids = rand_ids.shift(@params[:batch_size])