Code Monkey home page Code Monkey logo

jlibsvm's People

Contributors

davidsoergel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jlibsvm's Issues

Race condition when classifying with MultiClassificationSVM

In MultiClassificationSVM::trainWithoutScaling there are parallel tasks spawned using Parallel.forEach . This restults in non-deterministic classification results. Serializing this fixes the problem.

The reason is that somehow the SVMs size is truncated and data is lost. My feeling is that the issue is within KernelQMatrix.

Unable to load file

Hey there,

I've been trying to implement this library and also to use the provided svm_train and svm_predict methods, but it's not working. The training seems to work out, I'm getting model-files in my directory. However, when I try svm_predict with that model file it doesn't work. I also tried to implement the predicting myself, but it seems to break on SolutionModel.identifyTypeAndLoad.
Exception in thread "main" edu.berkeley.compbio.jlibsvm.SvmException: Unable to load file faceSpoofing.data.model

Can someone help me out with this or fix this in the directory? If someone can tell me what's wrong I wouldn't mind fixing it myself and doing a pull request either.

pom.xml

I think the repositories and dependencies you supplied are no longer working.

Error while reading model file

Hi developers,

I am trying to run jlibsvm using the legacyexec programs svm_train and svm_predict. I have successfully run svm_train and produced a model file. Then, I provided this model file as the second attribute of svm_predict, but I get the following error.

Exception in thread "main" edu.berkeley.compbio.jlibsvm.SvmException: Unable to load file models/a2a.m
at edu.berkeley.compbio.jlibsvm.SolutionModel.identifyTypeAndLoad(SolutionModel.java:69)
at svm_predict.main(svm_predict.java:47)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at edu.berkeley.compbio.jlibsvm.SolutionModel.identifyTypeAndLoad(SolutionModel.java:59)
... 1 more
Caused by: java.lang.NullPointerException
at java.util.StringTokenizer.(StringTokenizer.java:199)
at java.util.StringTokenizer.(StringTokenizer.java:236)
at edu.berkeley.compbio.jlibsvm.binary.BinaryModel.(BinaryModel.java:133)
... 6 more

I think the problem lies in BinaryModel. I have tried versions 0.91 and 0.92, but I get the same error. I have also inspected the model file that is produced by svm_train and it seems perfectly logical.

Thanks in advance for your reply!
Yannis

Unify cross-validation code

There are currently two mostly redundant implementations in svm_train and BinaryClassificationSVM (where it's used for probability estimates)

gradle repo declarations

Heya, thanks for doing the refactor work on libsvm! It'll come in handy for my project. I thought I'd post up the gradle equivalent of your pom repo declarations for others' use -- including your thirdparty repo which was required.

dependencies {
    // http://dev.davidsoergel.com/nexus/content/repositories/releases
    compile group: 'edu.berkeley.compbio', name: 'jlibsvm', version: '0.911'
}
repositories {
    jcenter()
    mavenCentral()
    maven {
          url 'http://davidsoergel.com/nexus/content/repositories/releases'
    }
    maven {
          url 'http://davidsoergel.com/nexus/content/repositories/thirdparty'
    }
}

How are `P` feature vectors evaluated (since they are of type Object)?

Hello,

I am trying to understand how jlibsvm works.

From the source code, I understand that L refers to label (e.g. of type String), while P refers to the feature vector for a particular data point. A collection of data points makes up a problem set.

A problem will be fed into an SVM classifier, to generate a model via train().

However, I am unclear since P can be any object (instead of an array of floats, for e.g.), how are comparisons made? Should there be some sort of comparable interface for each specified in this class?

Great library, by the way!

Getting NotImplementedException in SolutionModel.java while using Trainer.run

The following is the trace of the error:

Exception in thread "main" sun.reflect.generics.reflectiveObjects.NotImplementedException
	at edu.berkeley.compbio.jlibsvm.SolutionModel.writeToStream(SolutionModel.java:109)
	at edu.berkeley.compbio.jlibsvm.binary.AlphaModel.writeToStream(AlphaModel.java:140)
	at edu.berkeley.compbio.jlibsvm.binary.BinaryModel.writeToStream(BinaryModel.java:287)
	at edu.berkeley.compbio.jlibsvm.SolutionModel.save(SolutionModel.java:96)
	at Trainer.run(Trainer.java:66)
	at detectSpoof.main(detectSpoof.java:67)

Any help or a fix would be much appreciated.

Jar version used: 0.9

training error: Solver reached maximum iterations, aborting

Using the legacyexec svm_train command with the next command :

... edu.berkeley.compbio.jlibsvm.legacyexec.svm_train -c 100000 -w0 0.427 -w1 0.012 

and a set of scores (see attached file labels.txt) I have obtained the next log error line as an outcome:

2010-12-10 11:27:21,771 [main] ERROR edu.berkeley.compbio.jlibsvm.Solver - Solver reached maximum iterations, aborting

The equivalent call to the LIBSVM's train command does not give me any error. LIBSVM version I am using is 2.91

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.