Displaying 20 results from an estimated 10000 matches similar to: "Why cant my S4 class have a slot named `C`?"
2011 Apr 12
0
Help required
Hi Sadaf,
Out of curiosity, what sorts of things have you tried to fix this?
For example, after playing around with this a bit, if I remove your
"eps" parameter from your `ranges` list, it works.
Perhaps you should try tweaking the values you pick for your
parameters. You don't even have to put it in the `tune` function to
get an idea of the ranges you should use:
R>
2004 Dec 01
1
tuning SVM's
Hi
I am doing this sort of thing:
POLY:
> > obj = best.tune(svm, similarity ~., data = training, kernel =
"polynomial")
> summary(obj)
Call:
best.tune(svm, similarity ~ ., data = training, kernel = "polynomial")
Parameters:
SVM-Type: eps-regression
SVM-Kernel: polynomial
cost: 1
degree: 3
gamma: 0.04545455
coef.0: 0
2009 Sep 06
2
Regarding SVM using R
Hi Abbas,
Before I try to give you answers, I just want to mention that you
should send R related reqests to the R-help list, and not me
personally because (i) there's a greater likelihood that it will get
answered in a timely manner, and (ii) people who might have a similar
problem down the road might benefit from any answer via searching the
list archives ... anyway:
On Sep 5, 2009, at
2015 May 05
1
Problem with adding slots to S4 object
There are too many arguments in the signature of the my_inla generic. The
signature defaults to every argument in the formals, which are probably
already over-specified. Typically, one defines a generic with the formals
(x, ...), or perhaps in this case (x, model, ...), but more on that below
Unrelated to this issue, the my_inla generic is defined incorrectly. It
should call
2011 Mar 04
1
Probabilities outside [0, 1] using Support Vector Machines (SVM) in e1071
Hi All,
I'm attempting to use eps-regression or nu-regression SVM to compute
probabilities but the predict function applied to an svm model object
returns values outside [0, 1]:
Variable Data looks like:
Present X02 X03 X05 X06 X07 X13 X14 X15 X18
1 0 1634 48 2245.469 -1122.0750 3367.544 11105.013 2017.306 40 23227
2 0 1402 40 2611.519 -811.2500 3422.769 10499.425 1800.475 40 13822
3 0 1379
2010 May 14
4
Categorical Predictors for SVM (e1071)
Dear all,
I have a question about using categorical predictors for SVM, using "svm"
from library(e1071). If I have multiple categorical predictors, should they
just be included as factors? Take a simple artificial data example:
x1<-rnorm(500)
x2<-rnorm(500)
#Categorical Predictor 1, with 5 levels
x3<-as.factor(rep(c(1,2,3,4,5),c(50,150,130,70,100)))
#Catgegorical Predictor
2010 Feb 18
3
svm regression
Hi,
I am trying to use svm for regression data.
this is how my data looks like:
>dataTrain
x y z
1 4 6
2 5 4
3 7 5
>classTrain
a
2
3
4
>dataTest
x y z
1 7 2
2 8 3
>classTest
a
3
4
5
building the model
model<-svm(dataTrain,classTrain,type="nu-regression")
pred <- predict(model, dataTest)
> pred
1 2
3.008842 3.120078
I
2005 May 24
1
best.svm
Hi
I am trying to fit an svm to predict speech recognition errors. I am
using best.svm like this:
svm.model = best.svm(data[1:3000,1:23],data[1:3000,24],tunecontrol =
tune.control())
I got this:
> print(svm.model)
Call:
best.svm(x = data[1:3000, 1:23], tunecontrol = tune.control(),
data[1:3000, 24])
Parameters:
SVM-Type: eps-regression
SVM-Kernel: radial
cost: 1
2009 Oct 14
1
Cacheing computationally expensive getter methods for S4 objects
Hi,
I was wondering if there was a way to store the results of a
computationally expensive "getter" call on an S4 object, so that it is
only calculated once for each object.
Trivial example: let's say I want to cache the "expensive" area
calculation of a square object.
setClass("Square",
representation(
length='numeric',
2015 May 05
0
Problem with adding slots to S4 object
Dear all,
I did some more work in this.
- put all the metadata in a dedicated subclass (see metadataclass branch in
github repository). This doesn't solve the problem.
- test the code under R 3.1.2. This gives the same problem. So this is NOT
a bug introduced by R 3.2.0 :-)
- Profiling the code. Below the summary (code is on GitHub). It seems like
most of the time is spent by paste(). Note
2015 May 04
2
Problem with adding slots to S4 object
Dear all,
I'm trying to create a virtual S4 class with some subclasses. I noticed
that adding slots to this class increases the memory use and slows the
functions down. Note that I'm adding very small slots (integer or character
both of length 1).
I've made a reproducible example at
https://github.com/ThierryO/testvirtualclass. The R CMD check --as-cran
fails on the tests.
Some of
2009 Jul 08
1
ksvm question -- help! line search failed...
I got the data working, but now I got another problem with KSVM:
line search fails -2.793708 -0.5831701 1.870406e-05 -5.728611e-06
-5.059796e-08 -3.761822e-08 -7.308871e-13Error in
prob.model(object)[[p]]$A :
$ operator is invalid for atomic vectors
On Tue, Jul 7, 2009 at 6:45 PM, Steve
Lianoglou<mailinglist.honeypot at gmail.com> wrote:
> Hi,
>
> On Jul 7, 2009, at 6:44 PM,
2012 Jul 25
1
Only one class shown in SVM plot?
Hello users!
I'm calculating a simple model using svm(...) from the e1071 package. So far
so good, with a linear kernel I'm getting 5 SVs. When plotting the result I
see very well separated data clouds, but the underlying color is constantly
pink, so as far as I understand no class separation is shown...
I would be happy if anyone could explain me this behaviour because I think I
have a
2010 Feb 23
1
e1071: Cannot predict probabilities
Dear list.
I using the SVM-methods from the e1071, but I can't get the
probabilities when predicting.
Code:
x <- matrix(rbinom(100, 10, 0.3), ncol=2)
y <- apply(x, 1, sum)
fit <- svm(y ~ x, method = "C-classification", kernel = "radial",
probability = TRUE)
predict(fit, x, probability=TRUE)
Here predict doesn't containing any probabilities (not as attributes
2004 May 25
2
e1071, R1.9.0, Solaris 2.9, should I be worried?
In R 1.9.0 running under Solaris 2.9 on a SunBlade 100,
with "Sun WorkShop 6 update 2 C++ 5.3 2001/05/15" as the
C++ compiler, I just did
> install.packages("e1071")
The output includes these lines, which I have wrapped to fit nicely in mail:
** libs
cc -I/users/local/lib/R/include -I/usr/local/include -KPIC -xlibmil \
-dalign -xO4 -c cmeans.c -o cmeans.o
cc
2009 May 11
1
Problems to run SVM regression with e1071
Hi R users,
I'm trying to run a SVM - regression using e1071 package but the function svm() all the time apply a classification method rather than a regression.
svm.m1 <- svm(st ~ ., data = train, cost = 1000, gamma = 1e-03)
Parameters:
SVM-Type: C-classification
SVM-Kernel: radial
cost: 1000
gamma: 0.001
Number of Support Vectors: 209
2009 May 14
1
Least-square support vector machines regression!
Dear R-community,
I was using SVM regression (svm {e1071}) for predictions of single
soil properties of a huge data set (3000 samples). There are for the
eps-regression using the radial basis kernel three optimization
parameters needed.
To make things easier (using only two optimization parameters and not
loosing performance) I wanted to use LS SVM regression
(lssvm{kernlab}). But it
2010 Aug 29
0
SVM comparison
I'm trying to run an epsilon regression model, and am comparing the results
between e1071 and kernlab. I believe that I'm calling the ksvm and svm
functions the same way but I'm getting different results:
library(e1071); library(kernlab)
ksvm(x=1:100, y=(1:100)/5, type="eps-svr", kpar=list(sigma=1))
svm(x=1:100, y=(1:100)/5, type="eps-regression", gamma=0.5)
I
2018 May 21
1
S4 class slot type S4 class
All,
I am considering creating an S4 class whose slots (2) are both S4 classes. ?Since an S4 slot can be an S3 class I figure this can be done. ?However, the correct syntax of which I am unsure. ?Reviewing the docs I have come to the following conclusion:
SetClass('myfoo',
? ? ? ? ? ? ? ? ? slots = (foo1, foo2))
Without a type I believe each slot is .Data. ?A get method on the above
2011 Feb 18
1
segfault during example(svm)
If do:
> library("e1071")
> example(svm)
I get:
svm> data(iris)
svm> attach(iris)
svm> ## classification mode
svm> # default with factor response:
svm> model <- svm(Species ~ ., data = iris)
svm> # alternatively the traditional interface:
svm> x <- subset(iris, select = -Species)
svm> y <- Species
svm> model <- svm(x, y)
svm>