Skip to content

Commit

Permalink
Update MurTree default parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgm committed Oct 17, 2023
1 parent 005b0bd commit e352fe7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pymurtree/OptimalDecisionTreeClassifier.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pandas as pd
import numpy as np

from . import lib
from pymurtree.parameters import Parameters

Expand Down Expand Up @@ -34,10 +33,10 @@ class OptimalDecisionTreeClassifier:
def __init__(self,
time: int = 600,
max_depth: int = 3,
max_num_nodes: int = 7,
max_num_nodes: int = None,
sparse_coefficient: float = 0.0,
verbose: bool = True,
all_trees: bool = True,
verbose: bool = False,
all_trees: bool = False,
incremental_frequency: bool = True,
similarity_lower_bound: bool = True,
node_selection: int = 0,
Expand All @@ -50,6 +49,10 @@ def __init__(self,
self.__solver = None
self.__tree = None

if max_num_nodes is None:
max_num_nodes = 2**max_depth - 1
max_num_nodes = min(2**max_depth - 1, max_num_nodes)

self.__params = Parameters(time, max_depth, max_num_nodes,
sparse_coefficient, verbose,
all_trees, incremental_frequency,
Expand Down

0 comments on commit e352fe7

Please sign in to comment.