Displaying 20 results from an estimated 1100 matches similar to: "linear classifiers with sparse matrices"
2008 Jun 25
1
stringdot
Hi!!
I am trying to figure out how to use the string kernel "stringdot" in kernlab.
k <- function(x,y) {
(sum(x*y) +1)*exp(-0.001*sum((x-y)^2))
}
class(k) <- "kernel"
data(promotergene)
## train svm using custom kernel
gene.k <- ksvm(Class~.,data=promotergene,kernel=k,C=10,cross=5) # works fine in this case
gene.rbf <-
2009 Jun 03
2
code for double sum
Hi R-users,
I wrote a code to evaluate double sum as follows:
ff2 <- function(bb,eta,z,k)
{ r <- length(z)
for (i in 1:r)
{ sm1 <- sum((z[i]*bb/2)*(psigamma((0:k)+eta+1,deriv=0)/(factorial(0:k)*gamma((0:k)+eta+1))))
sm2 <- sum((besselI(z[i]*bb,eta)*log(z[i]*bb/2) - sm1)/besselI(z[i]*bb,eta))
sm2
}
ff2(bb,eta,z,10)
but it gave me the following message:
>
2010 Sep 15
1
Difficulty creating Julian day in data frame
Hi,
I'm attempting to add a "Julian Day" column to a data frame.
Here is my code and the resulting data frame:
vic.data <- read.table("C:/VIC/data/vic.data.csv", header=F)
names(vic.data) <- c("year", "month", "day", "precip", "evap",
"runoff", "baseflow", "Tsup",
2008 Oct 08
1
Suspicious output from lme4-mcmcsamp
Hello, R community,
I have been using the lmer and mcmcsamp functions in R with some difficulty. I do not believe this is my code or data, however, because my attempts to use the sample code and 'sleepstudy' data provided with the lme4 packaged (and used on several R-Wiki pages) do not return the same results as those indicated in the help pages. For instance:
> sessionInfo()
R
2008 Sep 14
0
ksvm accessing the slots of S4 object
I am using kernlab to build svm models. I am not sure how to access the different slots of the object. For instance if I want to get the nuber of support vectors for each of model I am building and store it in a vector.
>ksvm.model <- ksvm(Class ~ ., data = somedata,kernel = "vanilladot", cross = 10, type ="C-svc")
>names(attributes(ksvm.model))
[1] "param"
2011 May 26
0
R svm prediction kernlab
Hi All,
I am using ksvm method in kernlab R package for support vector
machines. I learned the multiclass one-against-one svm from training data
and using it to classify new datapoints. But I want to update/finetune the
'svm weights' based on some criteria and use the updated svm weights in the
predict method framework. I don't know if its possible or not, how do
classify new
2010 Sep 24
0
kernlab:ksvm:eps-svr: bug?
Hi,
A. In a nutshell:
The training error, obtained as "error (ret)", from the return value
of a ksvm () call for a eps-svr model is (likely) being computed
wrongly. "nu-svr" and "eps-bsvr" suffer from this as well.
I am attaching three files: (1) ksvm.R from the the kernlab package,
un-edited, (2) ksvm_eps-svr.txt: (for easier reading) containing only
eps-svr
2012 Nov 07
1
LiblineaR: accept sparse matrices
Thibault,
It would be nice if LiblineaR() accepted data in the form of a sparse
matrix (it does not accept whatever e1071::read.matrix.csr returns).
It would also be nice if there were functions to read/write files in the
native liblinear file format; I am sure the original liblinear library
provides at least the input code.
Thanks!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04
2012 Jul 13
1
LiblineaR: read/write model files?
How do I read/write liblinear models to files?
E.g., if I train a model using the command line interface, I might want
to load it into R to look the histogram of the weights.
Or I might want to train a model in R and then apply it using a command
line interface.
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/
2016 Apr 20
0
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com>
>>>>> on Tue, 19 Apr 2016 14:04:11 -0700 writes:
> Using the Matrix package, how can I create a row-oriented sparse
> Matrix from scratch populated with some data? By default a
> column-oriented one is created and I'm aware of the note that the
> package is optimized for
2019 May 16
0
ALTREP: Bug reports
Jiefei,
Inline.
On Thu, May 16, 2019 at 2:30 PM ??? <szwjf08 at gmail.com> wrote:
> Hello Luke and Gabriel,
>
> Thank you very much for your quick responses. The explanation of STDVEC is
> very helpful and I appreciate it! For the wrapper, I have a few new
> questions.
>
>
> 1. Like Luke said a mutable object is not possible. However, I noticed
> that there is
2010 Jun 07
2
mgcv
Hello Sir,
I am using mgcv package for my data.
My model is y~x1+f(x2),I want to find out the function f(x2) .
Following is the code.
sm1=gam(y~x1+s(x2),family=binomial, f)
summary(sm1)
plot(sm1,residuals=TRUE, xlab="AGE",pch=20)
In this plot I am getting S(x2,1.93) on y axixs
How should I get the function for x2 from this plot.or Is there anyother procedure in R to get this
2010 Jul 12
1
ed50
I am using semiparametric Model
library(mgcv)
sm1=gam(y~x1+s(x2),family=binomial, f)
How should I find out standard error for ed50 for the above model
ED50 =( -sm1$coef[1]-f(x2)) / sm1$coef [2]
f(x2) is estimated value for non parametric term.
Thanks
[[alternative HTML version deleted]]
2009 Oct 23
1
Data format for KSVM
Hi,
I have a process using svm from the e1071 library. it works.
I want to try using the KSVM library instead. The same data used wiht
e1071 gives me an error with KSVM.
My data is a data.frame.
sample code:
svm_formula <- formula(y ~ a + B + C)
svm_model <- ksvm(formula, data=train_data, type="C-svc",
kernel="rbfdot", C=1)
I get the following error:
2007 Sep 12
0
one-class SVM in kernlab
Hello,
I'm trying to using ksvm() in the kernlab package to fit a one-class
SVC, but I get a strage result on the cross-validation error estimate.
For example, consider this code:
data(spam)
classifier <- ksvm(type~.,data=spam[which(spam[,'type']=='spam'),],
type="one-svc",kernel="rbfdot",kpar=list(sigma=0.1),nu=0.05,cross=10)
what I get is:
>
2009 Apr 28
1
kernlab - custom kernel
hi,
I am using R's "kernlab" package, exactly i am doing classification using
ksvm(.) and predict.ksvm(.).I want use of custom kernel. I am getting some
error.
# Following R code works (with promotergene dataset):
library("kernlab")
s <- function(x, y) {
sum((x*y)^1.25)
}
class(s) <- "kernel"
data("promotergene")
gene <- ksvm(Class ~ .,
2009 Nov 29
2
kernlab's ksvm method freeze
Hello,
I am using kernlab to do some binary classification on aminoacid
strings.
I am using a custom kernel, so i use the kernel="matrix" option of the
ksvm method.
My (normalized) kernel matrix is of size 1309*1309, my results vector
has the same length.
I am using C-svc.
My kernlab call is something similiar to this:
ksvm(kernel="matrix", kernelMatrix, trainingDataYs,
2018 Feb 15
0
wbinfo -U id gives different users on same dc
Hi Louis,
Thanks for information, find it sometimes is a real challenge. Would you
please share your how to link? I wish to read it.
For the .local domain I suppose I have nothing to do. This is a running
windows Active Directory and it is not possible to change domain suffix.
Here is my /etc/hosts
127.0.0.1 localhost.localdomain localhost
10.254.104.8 wdc04.aa.local wdc04
10.254.105.208
2017 Feb 22
0
Crash in the latest release
I found this by accident yesterday. The program that crashes is the first two lines of
the example from the help page for nlmer. That example hasn't changed in a long time, so I
assumed that it is an R-devel issue. It could also be a long latent nlmer bug. The second
run with valgrind is puzzling.
Terry T.
> library(lmer)
> sessionInfo()
R Under development (unstable)
2011 Aug 26
1
kernlab: ksvm() bug?
Hello all,
I'm trying to run a gird parameter search for a svm.
Therefore I'M using the ksvm function from the kernlab package.
----
svp <- ksvm(Ktrain,ytrain,type="nu-svc",nu=C)
----
The problem is that the optimization algorithm does not return
for certain parameters.
I tried to use setTimeLimit() but that doesn't seem to help.
I suspect that ksvm() calls c code that