Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:MurTree/pymurtree into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jurra committed Oct 24, 2023
2 parents fe7e6e6 + dd73304 commit 0aeae63
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,16 @@ jobs:
mingw-w64-x86_64-gcc
mingw-w64-x86_64-python-pip
mingw-w64-x86_64-python-wheel
mingw-w64-x86_64-python-pandas
git
mingw-w64-x86_64-meson
- uses: actions/checkout@v3

- name: Install pybind11
- name: Add requirements
# This is required because --no-build-isolation disable dependences
# installation
run: pip install pybind11
run: python -m pip install gitpython pybind11 meson-python

- name: Build and install
# --no-build-isolation is required because the vanilla setuptool does not
Expand All @@ -80,4 +83,6 @@ jobs:
run: pip install --no-build-isolation .

- name: Test
run: python tests/test.py
run: |
pip install pytest
pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ _no_*
**/__pycache__/
*pymurtree_data/
**/*.cpython*
*.pyd
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
"murtree/code/MurTree/Data Structures/",
"src/pymurtree/"],
# passing in the version to the compiled code
define_macros=[('VERSION_INFO', __version__)]
define_macros=[('VERSION_INFO', __version__)],
language='c++',
cxx_std=11
)
]

Expand Down
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
1 change: 1 addition & 0 deletions src/pymurtree/exporttree.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "solver_result.h"
#include <string>

class ExportTree {

Expand Down

0 comments on commit 0aeae63

Please sign in to comment.