<commit_before>require 'spec_helper'

describe "Basic usage" do
	before do
		@problem = Problem.new
		@parameter = SvmParameter.new
		@parameter.cache_size = 1 # mb

		# "eps is the stopping criterion (we usually use 0.00001 in nu-SVC,
		# 0.001 in others)." (from README)
		@parameter.eps = 0.001 

		@parameter.c = 10
	end

	it "has a nice API" do
		example = {11 => 0.11, 21 => 0.21, 101 => 0.99 }.to_example
		example.should == Node.features({11 => 0.11, 21 => 0.21, 101 => 0.99 })
	end

	it "is as in [PCI,217]" do<commit_msg>The additional kernel type parameter reproduces #2<commit_after>require 'spec_helper'

describe "Basic usage" do
	before do
		@problem = Problem.new
		@parameter = SvmParameter.new
		@parameter.cache_size = 1 # mb

		# "eps is the stopping criterion (we usually use 0.00001 in nu-SVC,
		# 0.001 in others)." (from README)
		@parameter.eps = 0.001 

		@parameter.c = 10
		@parameter.kernel_type = KernelType::RBF
	end

	it "has a nice API" do
		example = {11 => 0.11, 21 => 0.21, 101 => 0.99 }.to_example
		example.should == Node.features({11 => 0.11, 21 => 0.21, 101 => 0.99 })
	end

	it "is as in [PCI,217]" do
{'fraction_non_alphanumeric': 0.14185639229422067, 'fraction_numerical': 0.09194395796847636, 'mean_word_length': 3.2490706319702602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7105874', 'n_tokens_mistral': 533, 'n_tokens_neox': 413, 'n_words': 135}