Quantcast

libsvm

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

libsvm

dariodematties
Hello People,

Is it possible to integrate libsvm in octave?
Is there a package or something like that in order to do it?
My system:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

The current state of my Octave installation is:
----------------------------------------------------------------------
GNU Octave Version: 4.2.0
GNU Octave License: GNU General Public License
Operating System: Linux 4.4.0-72-generic #93~14.04.1-Ubuntu SMP Fri Mar 31 15:05:15 UTC 2017 x86_64
----------------------------------------------------------------------
Package Name  | Version | Installation directory
--------------+---------+-----------------------
     control  |   3.0.0 | /home/dario/octave/control-3.0.0
          io  |   2.4.5 | /home/dario/octave/io-2.4.5
       ltfat  |   2.1.2 | /home/dario/octave/ltfat-2.1.2
      signal  |   1.3.2 | /home/dario/octave/signal-1.3.2

I have libsvm-3.22 compiled in my Download directory, but I'd like to use it from Octave.

Thanks,
Dario
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsvm

tmacchant
----- Original Message -----

> From: dariodematties 
> To: help-octave
> Cc:
> Date: 2017/4/6, Thu 21:28
> Subject: libsvm
>
> Hello People,
>
> Is it possible to integrate libsvm in octave?
> Is there a package or something like that in order to do it?
> My system:
> No LSB modules are available.
> Distributor ID:    Ubuntu
> Description:    Ubuntu 14.04.5 LTS
> Release:    14.04
> Codename:    trusty
>
> The current state of my Octave installation is:
> ----------------------------------------------------------------------
> GNU Octave Version: 4.2.0
> GNU Octave License: GNU General Public License
> Operating System: Linux 4.4.0-72-generic #93~14.04.1-Ubuntu SMP Fri Mar 31
> 15:05:15 UTC 2017 x86_64
> ----------------------------------------------------------------------
> Package Name  | Version | Installation directory
> --------------+---------+-----------------------
>      control  |   3.0.0 | /home/dario/octave/control-3.0.0
>           io  |   2.4.5 | /home/dario/octave/io-2.4.5
>        ltfat  |   2.1.2 | /home/dario/octave/ltfat-2.1.2
>       signal  |   1.3.2 | /home/dario/octave/signal-1.3.2
>
> I have libsvm-3.22 compiled in my Download directory, but I'd like to use it
> from Octave.
>
> Thanks,
> Dario
>


I have never used libsvm so that the below may not be correct.

In libsvm-3.22, there is matlab directory.

Please read README in matlab directory.
There described 

-----------------------------------------
--- MATLAB/OCTAVE interface of LIBSVM ---
-----------------------------------------

Table of Contents
=================

- Introduction
- Installation
- Usage
- Returned Model Structure
- Other Utilities
- Examples
- Additional Information

<snip>

Tatsuro

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsvm

dariodematties
Thanks Tatsuro

I've already installed libsvm under octave prompt.

I've just to test it in order to see how this works.

I'll report the working of the soft when I tested it.

Thank you very much!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsvm

tmacchant
In reply to this post by tmacchant
Please keep CCing help-octave list.


>> I have libsvm-3.22 compiled in my Download directory, but I'd like to use it
>> from Octave.
>>
>> Thanks,
>> Dario
>>
>
> I have never used libsvm so that the below may not be correct.
>
> In libsvm-3.22, there is matlab directory.
>
> Please read README in matlab directory.
> There described
>
> -----------------------------------------
> --- MATLAB/OCTAVE interface of LIBSVM ---
> -----------------------------------------
>
> Table of Contents
> =================
>
> - Introduction
> - Installation
> - Usage
> - Returned Model Structure
> - Other Utilities
> - Examples
> - Additional Information
>
> <snip>
>
> Tatsuro
>
Thanks Tatsuro

I've already installed libsvm under octave prompt.

I've just to test it to see how this works.

I'll report the working of the soft when I tested it.

Thank you very much!


*********************************
Nice!

Please feed back your work to help-octave list for those who want to use libsvm from octave.

Regards

Tatsuro

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsvm

schloegl
The NaN-package a.k.a. "The NaN-toolbox: A statistics and machine
learning toolbox for Octave and Matlab  for data with and w/o MISSING
VALUES encoded as NaN's."

support also the use of libsvm through the wrappers train_sc and test_sc


  pkg install nan
  pkg load nan

  help train_sc
  help test_sc



Cheers,
  Alois


https://octave.sourceforge.io/nan/function/train_sc.html
https://octave.sourceforge.io/nan/function/test_sc.html




On 2017-04-08 03:38, Tatsuro MATSUOKA wrote:

> Please keep CCing help-octave list.
>
>
>>> I have libsvm-3.22 compiled in my Download directory, but I'd like to use it
>>> from Octave.
>>>
>>> Thanks,
>>> Dario
>>>
>>
>> I have never used libsvm so that the below may not be correct.
>>
>> In libsvm-3.22, there is matlab directory.
>>
>> Please read README in matlab directory.
>> There described
>>
>> -----------------------------------------
>> --- MATLAB/OCTAVE interface of LIBSVM ---
>> -----------------------------------------
>>
>> Table of Contents
>> =================
>>
>> - Introduction
>> - Installation
>> - Usage
>> - Returned Model Structure
>> - Other Utilities
>> - Examples
>> - Additional Information
>>
>> <snip>
>>
>> Tatsuro
>>
> Thanks Tatsuro
>
> I've already installed libsvm under octave prompt.
>
> I've just to test it to see how this works.
>
> I'll report the working of the soft when I tested it.
>
> Thank you very much!
>
>
> *********************************
> Nice!
>
> Please feed back your work to help-octave list for those who want to use libsvm from octave.
>
> Regards
>
> Tatsuro
>
> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/help-octave
>


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsvm

dariodematties
Thanks Alois, that could be a good option.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libsvm

dariodematties
In reply to this post by schloegl
Hello,

I've made a simple test in libsvm on octave, with data provided by the same libsvm soft

octave:2> [heart_scale_label, heart_scale_inst] = libsvmread('../heart_scale');
octave:3> whos
Variables in the current scope:

   Attr Name                   Size                     Bytes  Class
   ==== ====                   ====                     =====  =====
        heart_scale_inst     270x13                     40592  double
        heart_scale_label    270x1                       2160  double

Total is 3780 elements using 42752 bytes

octave:4> model = svmtrain(heart_scale_label, heart_scale_inst, '-c 1 -g 0.07');
*
optimization finished, #iter = 134
nu = 0.433785
obj = -101.855060, rho = 0.426412
nSV = 130, nBSV = 107
Total nSV = 130
octave:5> [predict_label, accuracy, dec_values] = svmpredict(heart_scale_label, heart_scale_inst, model);
Accuracy = 86.6667% (234/270) (classification)
octave:6>

It seems to be working well.

I'll continue reporting.
Loading...