Displaying 20 results from an estimated 6000 matches similar to: "SVM accuracy question"
2012 Nov 20
3
data after write() is off by 1 ?
I am new to R, so I am sure I am making a simple mistake. I am including complete information in hopes
someone can help me.
Basically my data in R looks good, I write it to a file, and every value is off by 1.
Here is my flow:
> str(prediction)
Factor w/ 10 levels "0","1","2","3",..: 3 1 10 10 4 8 1 4 1 4 ...
- attr(*, "names")= chr
2013 Jan 08
0
bagging SVM Ensemble
Dear Sir,
I got a problem with my program. I would like to classify my data using
bagging support vector machine ensemble. I split my data into training data
and test data. For a given data sets TR(X), K replicated training data sets
are first randomly generated by bootstrapping technique with replacement.
Next, Support Vector Mechine (SVM) is applied for each bootstrap data sets.
Finally, the
2012 Dec 02
2
How to re-combine values based on an index?
I am able to split my df into two like so:
dataset <- trainset
index <- 1:nrow(dataset)
testindex <- sample(index, trunc(length(index)*30/100))
trainset <- dataset[-testindex,]
testset <- dataset[testindex,-1]
So I have the index information, how could I re-combine the data using that back into a single df?
I tried what I thought might work, but failed with:
2009 Mar 27
1
ROCR package finding maximum accuracy and optimal cutoff point
If we use the ROCR package to find the accuracy of a classifier
pred <- prediction(svm.pred, testset[,2])
perf.acc <- performance(pred,"acc")
Do we?find the maximum accuracy?as follows?(is there a simplier way?):
> max(perf.acc at x.values[[1]])
Then to find the cutoff point that maximizes the accuracy?do we do the
following?(is there a simpler way):
> cutoff.list <-
2011 Feb 23
0
svm(e1071) and scaling of weights
I expected, that I will get the same prediction, if I multiply the
weights for all classes with a constant factor, but I got different
results. Please look for the following code.
> library(e1071)
> data(Glass, package = "mlbench")
> index <- 1:nrow(Glass)
> testindex <- sample(index, trunc(length(index)/5))
> testset <- Glass[testindex, ]
> trainset <-
2010 Nov 23
5
cross validation using e1071:SVM
Hi everyone
I am trying to do cross validation (10 fold CV) by using e1071:svm method. I
know that there is an option (?cross?) for cross validation but still I
wanted to make a function to Generate cross-validation indices using pls:
cvsegments method.
#####################################################################
Code (at the end) Is working fine but sometime caret:confusionMatrix
2012 Nov 29
1
Help with this error "kernlab class probability calculations failed; returning NAs"
I have never been able to get class probabilities to work and I am relatively new to using these tools, and I am looking for some insight as to what may be wrong.
I am using caret with kernlab/ksvm. I will simplify my problem to a basic data set which produces the same problem. I have read the caret vignettes as well as documentation for ?train. I appreciate any direction you can give. I
2011 Oct 19
0
R classification
hello, i am so glad to write you.
i am dealing now with writing my M.Sc in Applied Statistics thesis, titled " Data Mining Classifiers and Predictive Models Validation and Evaluation".
I am planning to compare several DM classifiers like "NN, kNN, SVM, Dtree, and Naïve Bayes" according to their Predicting accuracy, interpretability, scalability, and time consuming etc.
I have
2007 Oct 03
0
datasets
Hi, my name is Luis, and I have a problem with a dataset.
Its name is algae and count the collection of data in a lake and respective
proliferation of algae.
The parameters that it has are: "mxPH", "mnO2", "Cl", "NO3" "NH4", "oPO4",
"PO4", "Chla" and "a1" all numerics.
a1 - algae1
If I try to do SVM with
2009 Jul 08
1
SVM cross validation in e1071
Hi list,
Could someone help me to explain why the leave-one-out cross validation results I got from svm using the internal option "cross" are different from those I got manually? It seems using "cross" to do cross validation, the results are always better. Please see the code below. I also include lda as a comparison.
I'm using WinXP, R-2.9.0, and e1071_1.5-19.
Many
2020 Oct 23
5
How to shade area between lines in ggplot2
Hello,
I am running SVM and showing the results with ggplot2. The results
include the decision boundaries, which are two dashed lines parallel
to a solid line. I would like to remove the dashed lines and use a
shaded area instead. How can I do that?
Here is the code I wrote..
```
library(e1071)
library(ggplot2)
set.seed(100)
x1 = rnorm(100, mean = 0.2, sd = 0.1)
y1 = rnorm(100, mean = 0.7, sd =
2020 Oct 23
0
How to shade area between lines in ggplot2
Hi
Did you try google? I got several answers using your question
e.g.
https://stackoverflow.com/questions/54687321/fill-area-between-lines-using-g
gplot-in-r
Cheers
Petr
> -----Original Message-----
> From: R-help <r-help-bounces at r-project.org> On Behalf Of Luigi Marongiu
> Sent: Friday, October 23, 2020 9:59 AM
> To: r-help <r-help at r-project.org>
> Subject:
2020 Oct 27
3
R for-loop to add layer to lattice plot
Hello,
I am using e1071 to run support vector machine. I would like to plot
the data with lattice and specifically show the hyperplanes created by
the system.
I can store the hyperplane as a contour in an object, and I can plot
one object at a time. Since there will be thousands of elements to
plot, I can't manually add them one by one to the plot, so I tried to
loop into them, but only the
2020 Oct 23
2
How to shade area between lines in ggplot2
also from this site: https://plotly.com/ggplot2/geom_ribbon/
I get the answer is geom_ribbon but I am still missing something
```
#! plot
p = ggplot(data = trainset, aes(x=x, y=y, color=z)) +
geom_point() + scale_color_manual(values = c("red", "blue"))
# show support vectors
df_sv = trainset[svm_model$index, ]
p = p + geom_point(data = df_sv, aes(x=x, y=y),
2020 Oct 23
0
How to shade area between lines in ggplot2
Hi
What about something like
p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2],
ymax = slope_1*x + intercept_1 + 1/w[2], fill = "grey70", alpha=0.1))
Cheers
Petr
> -----Original Message-----
> From: Luigi Marongiu <marongiu.luigi at gmail.com>
> Sent: Friday, October 23, 2020 11:11 AM
> To: PIKAL Petr <petr.pikal at precheza.cz>
> Cc: r-help
2020 Oct 23
2
How to shade area between lines in ggplot2
Thank you, but this split the area into two and distorts the shape of
the plot. (compared to
```
p + geom_abline(slope = slope_1, intercept = intercept_1 - 1/w[2],
linetype = "dashed", col = "royalblue") +
geom_abline(slope = slope_1, intercept = intercept_1 + 1/w[2],
linetype = "dashed", col = "royalblue")
```
Why there
2020 Oct 28
0
R for-loop to add layer to lattice plot
On Tue, Oct 27, 2020 at 6:04 PM Luigi Marongiu <marongiu.luigi at gmail.com> wrote:
>
> Hello,
> I am using e1071 to run support vector machine. I would like to plot
> the data with lattice and specifically show the hyperplanes created by
> the system.
> I can store the hyperplane as a contour in an object, and I can plot
> one object at a time. Since there will be
2020 Oct 26
0
How to shade area between lines in ggplot2
Hi
Put fill outside aes
p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2],
ymax = slope_1*x + intercept_1 + 1/w[2]), fill = "blue", alpha=0.1)
The "hole" is because you have two levels of data (red and blue). To get rid
of this you should put new data in ribbon call.
Something like
newdat <- trainset
newdat$z <- factor(0)
p+geom_ribbon(data=newdat, aes(ymin =
2011 Jan 24
5
Train error:: subscript out of bonds
Hi,
I am trying to construct a svmpoly model using the "caret" package (please
see code below). Using the same data, without changing any setting, I am
just changing the seed value. Sometimes it constructs the model
successfully, and sometimes I get an ?Error in indexes[[j]] : subscript out
of bounds?.
For example when I set seed to 357 following code produced result only for 8
2012 Dec 10
3
splitting dataset based on variable and re-combining
I have a dataset and I wish to use two different models to predict. Both models are SVM. The reason for two different models is based
on the sex of the observation. I wish to be able to make predictions and have the results be in the same order as my original dataset. To
illustrate I will use iris:
# Take Iris and create a dataframe of just two Species, setosa and versicolor, shuffle them