Struct linfa_trees::Tikz [−][src]
Struct to print a fitted decision tree in Tex using tikz and forest.
There are two settable parameters:
legend: if true, a box with the names of the split features will appear in the top right of the treecomplete: if true, a complete and standalone Tex document will be generated; otherwise the result will an embeddable Tex tree.
Usage
use linfa::prelude::*; use linfa_datasets; use linfa_trees::DecisionTree; // Load dataset let dataset = linfa_datasets::iris(); // Fit the tree let tree = DecisionTree::params().fit(&dataset).unwrap(); // Export to tikz let tikz = tree.export_to_tikz().with_legend(); let latex_tree = tikz.to_string(); // Now you can write latex_tree to the preferred destination
Implementations
impl<'a, F: Float, L: Debug + Label> Tikz<'a, F, L>[src]
pub fn new(tree: &'a DecisionTree<F, L>) -> Self[src]
Creates a new Tikz structure for the decision tree with the following default parameters:
legend=falsecomplete=true
pub fn complete(self, complete: bool) -> Self[src]
Whether a complete Tex document should be generated
pub fn with_legend(self) -> Self[src]
Add a legend to the generated tree
Trait Implementations
Auto Trait Implementations
impl<'a, F, L> RefUnwindSafe for Tikz<'a, F, L> where
F: RefUnwindSafe,
L: RefUnwindSafe,
F: RefUnwindSafe,
L: RefUnwindSafe,
impl<'a, F, L> Send for Tikz<'a, F, L> where
L: Sync,
L: Sync,
impl<'a, F, L> Sync for Tikz<'a, F, L> where
L: Sync,
L: Sync,
impl<'a, F, L> Unpin for Tikz<'a, F, L>
impl<'a, F, L> UnwindSafe for Tikz<'a, F, L> where
F: RefUnwindSafe,
L: RefUnwindSafe,
F: RefUnwindSafe,
L: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,