mirror of
https://github.com/helblazer811/ManimML.git
synced 2025-05-23 05:25:56 +08:00

don't appear at the beggining of a forward pass animation. I think this has to do with a bug in Succession in the core ManimCommunity library.
39 lines
1.0 KiB
Python
39 lines
1.0 KiB
Python
"""
|
|
Module for visualizing decision trees in Manim.
|
|
It parses a decision tree classifier from sklearn.
|
|
"""
|
|
from manim import *
|
|
from manim_ml.one_to_one_sync import OneToOneSync
|
|
|
|
class LeafNode(VGroup):
|
|
pass
|
|
|
|
class NonLeafNode(VGroup):
|
|
pass
|
|
|
|
class DecisionTreeDiagram(Graph):
|
|
"""Decision Tree Digram Class for Manim"""
|
|
pass
|
|
|
|
class DecisionTreeEmbedding():
|
|
"""Embedding for the decision tree"""
|
|
pass
|
|
|
|
class DecisionTreeContainer(OneToOneSync):
|
|
"""Connects the DecisionTreeDiagram to the DecisionTreeEmbedding"""
|
|
|
|
def __init__(self, sklearn_tree, points, classes):
|
|
self.sklearn_tree = sklearn_tree
|
|
self.points = points
|
|
self.classes = classes
|
|
|
|
def make_unfold_tree_animation(self):
|
|
"""Unfolds the tree through an in order traversal
|
|
|
|
This animations unfolds the tree diagram as well as showing the splitting
|
|
of a shaded region in the Decision Tree embedding.
|
|
"""
|
|
# Draw points in the embedding
|
|
# Start the tree splitting animation
|
|
pass
|