How does one go about drawing an hyperplane (given the equation) in 3D in R ? (i.e. 3d equivalent to "abline")
Thanks in advance,
Plot Decision Boundary Hyperplane The hyperplane is the decision-boundary deciding how new observations are classified. Specifically, any observation above the line will by classified as class 0 while any observation below the line will be classified as class 1.
In R3 hyperplanes are “ordinary” planes. Lines and hyperplanes are two kinds of “flat”subsets of Rn.
We all know the equation of a hyperplane is w. x+b=0 where w is a vector normal to hyperplane and b is an offset.
In geometry, a hyperplane is a subspace whose dimension is one less than that of its ambient space. For example, if a space is 3-dimensional then its hyperplanes are the 2-dimensional planes, while if the space is 2-dimensional, its hyperplanes are the 1-dimensional lines.
You probably want the packages scatterplot3d or HH (function regr2.plot
). See, e.g., this example for scatterplot3d
.
Lattice supports 3D charts. See some of the nice examples from Lattice: Multivariate Data Visualization with R on the LearnR blog. For instance, with wireframe()
:
pl <- wireframe(fit.linear + fit.loess.1 + fit.loess.2 +
+ fit.locfit ~ wind * temperature | radiation, grid,
+ outer = TRUE, shade = TRUE, zlab = "")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With