Create class BaseTree
Closed this issue · 0 comments
nicoboou commented
Create an abstract class BaseTree to be used as a template for :
-
RegressionTree
-
ClassificationTree
-
Define the
methods
-> will be used as@abstractmethod
fit(self, X_features:np.array, y_features: np.array) -> self.root
create_node(self,X_features:np.array, y_features: np.array) -> Node()
get_split(self, X_features:np.array, y_features: np.array, splitting_value_index: int, splitting_value: float) -> Dict(key:str('left'):List, key:str('right'):List)
build_tree(self, node: Node(), current_depth: int) -> None
predict(self, X_test:np.array) -> np.array
-
Define the
args
__init__(self, max_depth:int, min_sample_leaf:int,min_samples_split:int) -> None