graphing

How to create a decision boundary graph for kNN models in the Caret package?

独自空忆成欢 提交于 2021-02-04 13:55:22
问题 I'd like to plot a decision boundary for the model created by the Caret package. Ideally, I'd like a general case method for any classifier model from Caret. However, I'm currently working with the kNN method. I've included code below that uses the wine quality dataset from UCI which is what I'm working with right now. I found this method that works with the generic kNN method in R, but can't figure out how to map it to Caret -> https://stats.stackexchange.com/questions/21572/how-to-plot

Finding the intersect between a quadratic and line

*爱你&永不变心* 提交于 2021-01-29 10:30:55
问题 I am trying to find the intersect between a straight line and a quadratic curve, however the result I am getting appears to be imaginary although I don't see how this can be the case as I can see them intersect on real axes: Import numpy #quadratic coefficients a,b,c = (-3.09363812e-04, 1.52138019e+03, -1.87044961e+09) # y = ax^2 + bx + c #line coefficients m,d = (1.06446434e-03, -2.61660911e+03) #y = mx + d intersect = (-(b-m)+((b-m)**2 - 4*a*(c-d))**0.5)/(2*a) print(intersect) The output of

Color intensity error in R

自闭症网瘾萝莉.ら 提交于 2021-01-02 08:22:22
问题 I've run into a bit of an issue in my R self-teaching. I'm hoping someone here can help, as I've found no solutions on Google. I'm trying to apply some basic color parameters to the plot command. My basic code looks either as: plot(dose,drugA, type = "b", lty = 2, pch = 18, cex = 1.5, lwd = 1.25, col = rgb(43,228,178), col.axis = rgb(11,114,86), col.lab = rgb(95,195,168), fg = rgb(222,92,53), bg = rgb(222,216,53)) Or: par(lty = 2, pch = 18, cex = 1.5, lwd = 1.25, col = rgb(43,228,178), col

Color intensity error in R

半腔热情 提交于 2021-01-02 08:21:44
问题 I've run into a bit of an issue in my R self-teaching. I'm hoping someone here can help, as I've found no solutions on Google. I'm trying to apply some basic color parameters to the plot command. My basic code looks either as: plot(dose,drugA, type = "b", lty = 2, pch = 18, cex = 1.5, lwd = 1.25, col = rgb(43,228,178), col.axis = rgb(11,114,86), col.lab = rgb(95,195,168), fg = rgb(222,92,53), bg = rgb(222,216,53)) Or: par(lty = 2, pch = 18, cex = 1.5, lwd = 1.25, col = rgb(43,228,178), col

Java plotting library like python's matplotlib [closed]

自古美人都是妖i 提交于 2020-03-14 06:39:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am looking for a java plotting library that might be as good as matplotlib is for python. I have done some research looking over SO questions, but many of them are outdated and a lot has changed in the few years since they were asked. The suggestions that come up lead to websites that at the surface seem to be

R + ggplot : Time series with events

房东的猫 提交于 2020-01-20 10:07:08
问题 I'm an R/ggplot newbie. I would like to create a geom_line plot of a continuous variable time series and then add a layer composed of events. The continuous variable and its timestamps is stored in one data.frame, the events and their timestamps are stored in another data.frame. What I would really like to do is something like the charts on finance.google.com. In those, the time series is stock-price and there are "flags" to indicate news-events. I'm not actually plotting finance stuff, but

Graphing functions

蓝咒 提交于 2020-01-17 04:35:13
问题 I'm new to Java in general, not to mention working with GUIs and I'm working on an assignment to graph the 3 functions: (the four leafed cloves for cosine) with domain restrictions 0,4 -10,10 0 < x < 2pi I've so far made a crude graph of the first 2 functions, and no idea how to plot the third. What I have: import java.awt.*; import javax.swing.JComponent; import javax.swing.JFrame; public class DrawingStuff extends JComponent { public void paintComponent(Graphics g) { //w is x, and h is y