Commit Graph

26 Commits

Author SHA1 Message Date
Mathieu Blondel 79ba998b20 Fix parsing issues. 2011-06-21 18:31:46 +09:00
Mathieu Blondel e304597fab Raise error if file doesn't exist. 2011-06-21 17:57:21 +09:00
Lars Buitinck 668094e7c2 document placement new in SVMlight reader 2011-06-15 09:27:33 +02:00
Mathieu Blondel f70c442f37 load_svmlight_format -> load_svmlight_file. 2011-06-13 22:31:23 +09:00
Lars Buitinck 772b24a1ab (Hopefully) full exception safety in SVMlight reader
Also some minor refactoring
2011-06-13 13:16:18 +02:00
Lars Buitinck 2cede177f5 SVMlight reader: memory leak, type test 2011-06-13 12:56:29 +02:00
Mathieu Blondel d59a06bc43 More comments. 2011-06-13 01:28:21 +09:00
Mathieu Blondel 446687a8bb Fix ref counting bug. 2011-06-13 01:03:48 +09:00
Mathieu Blondel 650c464495 Fix compile issues on Mac OS X. 2011-06-13 00:54:29 +09:00
Lars Buitinck fb3ecab261 finish exception handling in SVMlight reader
Changes behavior: trying to open a non-existent file will result in
an IOError rather than a ValueError.

Slapped my name onto scikits/learn/datasets/svmlight_format.py out
of sheer vanity.

svmlight_format.py is now pep8 and pyflakes-clean.
2011-06-11 19:15:48 +02:00
Lars Buitinck 6566057aa5 Use C++ exception handling in SVMlight reader.
Info from exceptions should be propagated up to the Python level,
but currently isn't.
2011-06-11 17:51:57 +02:00
Lars Buitinck 24619a631d Simplify and document SVMlight/libSVM data reader 2011-06-11 16:55:46 +02:00
Lars Buitinck 20c15eef6c SVMlight reader: skip one level of indirection
Uses placement new and vector::swap to eliminate some memory
allocations. Main benefits: exception safety will be easier to
guarantee and there are fewer opportunities for memory leaks.
Still, this is a hairy beast.

Also some other safety improvements.
2011-06-11 14:21:49 +02:00
Lars Buitinck d7debebe0c SVMlight reader: cosmetic 2011-06-11 13:27:57 +02:00
Lars Buitinck a1156dafd4 SVMlight reader: one more clear() instead of delete 2011-06-11 12:46:40 +02:00
Lars Buitinck 8526ab686c Plumb memory leak in SVMlight reader
Quick fix, maybe only partial: the deallocator seems not to be called
in unit testing.
2011-06-11 12:35:17 +02:00
Mathieu Blondel 7eab00f46f Fix comment. 2011-06-11 13:54:12 +09:00
Mathieu Blondel 6582a7265a Return false when couldn't read the file. 2011-06-11 13:05:17 +09:00
Mathieu Blondel 3dc5d241e0 Update credits. 2011-06-11 13:03:35 +09:00
Lars Buitinck 9b3f0f4c45 SVMlight reader: ensure C calling conventions + docstring 2011-06-11 01:43:45 +02:00
Lars Buitinck aa3e4f9846 SVMlight reader: minor fixes 2011-06-10 23:10:22 +02:00
Lars Buitinck a770a59b51 Merge branch 'svmlight_format' of git://github.com/mblondel/scikit-learn into mblondel-svmlight
Conflicts:
	scikits/learn/datasets/_svmlight_format.cpp

Added a comment.
2011-06-10 21:49:18 +02:00
Lars Buitinck f98bb35e56 svmlight reader: don't use leading _ in identifiers
There's no need for them, and _[A-Z] is reserved for the C++ implementation,
so the behavior is undefined per C++03.
2011-06-10 19:20:48 +02:00
Mathieu Blondel 059a129e4e Propagate errors up to the Python level. 2011-06-11 02:18:05 +09:00
Mathieu Blondel 1b47641d25 Important note. 2011-06-11 02:04:10 +09:00
Mathieu Blondel f5c0cb5e0d Fast and memory-efficient loader for the svmlight format. 2011-06-11 00:20:34 +09:00