Displaying 6 results from an estimated 6 matches for "df_sv".
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),
color="purple", size=4, alpha=0.5)
# show hyperplane (decision boundaries are off set by 1/w[2])
w = t(svm_model$coefs) %*% svm_model$SV # %*% = matrix multiplication
slope_1 = -w[1]/w[2]
int...
2020 Oct 23
2
How to shade area between lines in 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),
> > color="purple", size=4, alpha=0.5) # show hyperplane
> > (decision
> > boundaries are off set by 1/w[2]) w = t(svm_model$coefs) %*%
> > svm_model$SV # %*...
2020 Oct 23
0
How to shade area between lines in ggplot2
...ps://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),
> color="purple", size=4, alpha=0.5) # show hyperplane
> (decision
> boundaries are off set by 1/w[2]) w = t(svm_model$coefs) %*%
> svm_model$SV # %*% = matrix multiplicatio...
2020 Oct 26
0
How to shade area between lines in ggplot2
...n/
> > > 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),
> > > color="purple", size=4, alpha=0.5) # show
> > > hyperplane (decision boundaries are off set by 1/w[2]) w =
> > > t(svm_model$coefs) %*% svm_mode...
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 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 =