This repository has been archived by the owner on May 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8474f5e
Showing
23 changed files
with
5,829 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin/svm* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
All Julia code under MIT license. | ||
|
||
All libSVM code under the license found in deps/COPYRIGHT. This copyright | ||
covers all files in: | ||
|
||
* bin: svm-train, svm-predict | ||
* deps: libsvm-3.14 code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
SVM.jl | ||
====== | ||
|
||
# About | ||
|
||
An interface to libSVM from Julia | ||
|
||
# Installation | ||
|
||
* Go into `deps` | ||
* Run `make` | ||
* Run `cp svm-train ../bin` | ||
* Run `cp svm-predict ../bin` | ||
|
||
# Usage | ||
|
||
using SVM | ||
|
||
labels = [1, -1, -1, 1, 1, -1] | ||
|
||
features = [1.0 0.0; | ||
0.0 -1.0; | ||
0.0 -0.9; | ||
0.9 0.1; | ||
1.0 1.0; | ||
-1.0 -1.0;] | ||
|
||
model = svm(labels, features) | ||
|
||
predictions = predict(model, features) | ||
|
||
# To Do | ||
|
||
* Use binary interface to libSVM instead of libSVM text format | ||
* Convert sparse matrices to libSVM format | ||
* Restore `Makefile.win` and `windows` in `deps` | ||
* Allow users to configure SVM model fitting process |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Copyright (c) 2000-2012 Chih-Chung Chang and Chih-Jen Lin | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
|
||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither name of copyright holders nor the names of its contributors | ||
may be used to endorse or promote products derived from this software | ||
without specific prior written permission. | ||
|
||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR | ||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
CXX ?= g++ | ||
CFLAGS = -Wall -Wconversion -O3 -fPIC | ||
SHVER = 2 | ||
OS = $(shell uname) | ||
|
||
all: svm-train svm-predict svm-scale | ||
|
||
lib: svm.o | ||
if [ "$(OS)" = "Darwin" ]; then \ | ||
SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.$(SHVER)"; \ | ||
else \ | ||
SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.$(SHVER)"; \ | ||
fi; \ | ||
$(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) | ||
|
||
svm-predict: svm-predict.c svm.o | ||
$(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm | ||
svm-train: svm-train.c svm.o | ||
$(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm | ||
svm-scale: svm-scale.c | ||
$(CXX) $(CFLAGS) svm-scale.c -o svm-scale | ||
svm.o: svm.cpp svm.h | ||
$(CXX) $(CFLAGS) -c svm.cpp | ||
clean: | ||
rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) |
Oops, something went wrong.