pub struct Plot2D {
pub points: Vec<PlotPoint>,
pub decision_boundary: Option<Vec<(f64, f64)>>,
pub margin_boundaries: Option<MarginBoundaries>,
pub config: VisualizationConfig,
pub x_range: (f64, f64),
pub y_range: (f64, f64),
}Expand description
2D visualization data structure
Fields§
§points: Vec<PlotPoint>§decision_boundary: Option<Vec<(f64, f64)>>§margin_boundaries: Option<MarginBoundaries>§config: VisualizationConfig§x_range: (f64, f64)§y_range: (f64, f64)Implementations§
Source§impl Plot2D
impl Plot2D
Sourcepub fn new(config: VisualizationConfig) -> Self
pub fn new(config: VisualizationConfig) -> Self
Create a new 2D plot
Sourcepub fn add_points(
&mut self,
x: &Array2<f64>,
y: &Array1<f64>,
support_vectors: &[usize],
)
pub fn add_points( &mut self, x: &Array2<f64>, y: &Array1<f64>, support_vectors: &[usize], )
Add points to the plot
Sourcepub fn generate_decision_boundary<F>(&mut self, decision_function: F)
pub fn generate_decision_boundary<F>(&mut self, decision_function: F)
Generate decision boundary points
Sourcepub fn generate_margin_boundaries<F>(&mut self, decision_function: F)
pub fn generate_margin_boundaries<F>(&mut self, decision_function: F)
Generate margin boundaries
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Plot2D
impl RefUnwindSafe for Plot2D
impl Send for Plot2D
impl Sync for Plot2D
impl Unpin for Plot2D
impl UnsafeUnpin for Plot2D
impl UnwindSafe for Plot2D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more