e1071: using svm with sparse matrices (PR#8527)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

e1071: using svm with sparse matrices (PR#8527)

julien.gagneur
Full_Name: Julien Gagneur
Version: 2.2.1
OS: Linux (Suse 9.3)
Submission from: (NULL) (194.94.44.4)


Using the SparseM library (SparseM_0.66)
and the e1071 library (e1071_1.5-12)


I fail using svm method with a sparse matrix. Here is a sample example.

I experienced the same problem under Windows.



> library(SparseM)
[1] "SparseM library loaded"
> library("e1071")
Loading required package: class
> data(iris)
> attach(iris)
> M=as.matrix(iris[,1:4])
> Msparse=as.matrix.csr(M)
> Species=iris[,5]
> mod=svm(Msparse,Species)
Error in svm.default(Msparse, Species) : object "nac" not found

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: e1071: using svm with sparse matrices (PR#8527)

Kasper Daniel Hansen
First: this is not a bug, more a feature request.

Secondly, even if it was a bug, it is _not_ a bug in R, please read  
the posting rules for bugs. Now a member of R-core has to use  
valuable time to clean up after your bug report.

Correspondence such as this such really be sent to the package  
maintainers (and - perhaps - a cc to R-devel).

Having said all of this, of course it would be nice if svn supported  
sparse matrices.

/Kasper


On Jan 27, 2006, at 2:02 AM, [hidden email] wrote:

> Full_Name: Julien Gagneur
> Version: 2.2.1
> OS: Linux (Suse 9.3)
> Submission from: (NULL) (194.94.44.4)
>
>
> Using the SparseM library (SparseM_0.66)
> and the e1071 library (e1071_1.5-12)
>
>
> I fail using svm method with a sparse matrix. Here is a sample  
> example.
>
> I experienced the same problem under Windows.
>
>
>
>> library(SparseM)
> [1] "SparseM library loaded"
>> library("e1071")
> Loading required package: class
>> data(iris)
>> attach(iris)
>> M=as.matrix(iris[,1:4])
>> Msparse=as.matrix.csr(M)
>> Species=iris[,5]
>> mod=svm(Msparse,Species)
> Error in svm.default(Msparse, Species) : object "nac" not found
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: e1071: using svm with sparse matrices (PR#8527)

Liaw, Andy
In reply to this post by julien.gagneur
From: Kasper Daniel Hansen

>
> First: this is not a bug, more a feature request.
>
> Secondly, even if it was a bug, it is _not_ a bug in R, please read  
> the posting rules for bugs. Now a member of R-core has to use  
> valuable time to clean up after your bug report.
>
> Correspondence such as this such really be sent to the package  
> maintainers (and - perhaps - a cc to R-devel).
>
> Having said all of this, of course it would be nice if svn supported  
> sparse matrices.

Libsvm, the `engine' underneath svm() in `e1071', uses a sparse
representation of the data.  I vaguely recall seeing Chih-Jen Lin's code
that uses the SparseM package to pass sparse data to svm()...  David would
know best, of course.

Andy

 

> /Kasper
>
>
> On Jan 27, 2006, at 2:02 AM, [hidden email] wrote:
>
> > Full_Name: Julien Gagneur
> > Version: 2.2.1
> > OS: Linux (Suse 9.3)
> > Submission from: (NULL) (194.94.44.4)
> >
> >
> > Using the SparseM library (SparseM_0.66)
> > and the e1071 library (e1071_1.5-12)
> >
> >
> > I fail using svm method with a sparse matrix. Here is a sample  
> > example.
> >
> > I experienced the same problem under Windows.
> >
> >
> >
> >> library(SparseM)
> > [1] "SparseM library loaded"
> >> library("e1071")
> > Loading required package: class
> >> data(iris)
> >> attach(iris)
> >> M=as.matrix(iris[,1:4])
> >> Msparse=as.matrix.csr(M)
> >> Species=iris[,5]
> >> mod=svm(Msparse,Species)
> > Error in svm.default(Msparse, Species) : object "nac" not found
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel