<commit_before>require 'svm'

if #arg == 0 then arg = nil end

dtr=svm.dataset('rcv1.train.bin')
dte=svm.dataset('rcv1.test.bin')

if arg and (arg[1] == 'dense' or arg[2] == 'dense') then
	dtr:dense()
	dte:dense()
end

-- These tests are comparing with Leon Bottou's experiments.
if not arg or (arg and arg[1] == 'sgd-hinge') then
	print('======================================')
	print('SVM SGD HingeLoss')
	-- sgd (hinge)
	mysvm = svm.SvmSgd(dtr:nfeature(),1e-4)<commit_msg>info on where to get train/test samples<commit_after>require 'svm'

if #arg == 0 then arg = nil end

-- you can get these files use Leon Bottou's sgd project.
dtr=svm.dataset('rcv1.train.bin')
dte=svm.dataset('rcv1.test.bin')

if arg and (arg[1] == 'dense' or arg[2] == 'dense') then
	dtr:dense()
	dte:dense()
end

-- These tests are comparing with Leon Bottou's experiments.
if not arg or (arg and arg[1] == 'sgd-hinge') then
	print('======================================')
	print('SVM SGD HingeLoss')
	-- sgd (hinge)
	mysvm = svm.SvmSgd(dtr:nfeature(),1e-4)
{'fraction_non_alphanumeric': 0.2306949806949807, 'fraction_numerical': 0.015444015444015444, 'mean_word_length': 4.761111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4955857', 'n_tokens_mistral': 421, 'n_tokens_neox': 397, 'n_words': 111}