1 | import sklearn.tree as skl_tree |
||
0 ignored issues
–
show
|
|||
2 | from Orange.classification import SklLearner, SklModel |
||
3 | from Orange.preprocess import Continuize, RemoveNaNColumns, SklImpute |
||
4 | |||
5 | __all__ = ["TreeLearner"] |
||
6 | |||
7 | |||
8 | class TreeClassifier(SklModel): |
||
9 | pass |
||
10 | |||
11 | |||
12 | class TreeLearner(SklLearner): |
||
13 | __wraps__ = skl_tree.DecisionTreeClassifier |
||
14 | __returns__ = TreeClassifier |
||
15 | name = 'tree' |
||
16 | preprocessors = [RemoveNaNColumns(), |
||
17 | SklImpute(), |
||
18 | Continuize()] |
||
19 | |||
20 | def __init__(self, criterion="gini", splitter="best", max_depth=None, |
||
0 ignored issues
–
show
|
|||
21 | min_samples_split=2, min_samples_leaf=1, |
||
0 ignored issues
–
show
|
|||
22 | max_features=None, |
||
0 ignored issues
–
show
|
|||
23 | random_state=None, max_leaf_nodes=None, |
||
0 ignored issues
–
show
|
|||
24 | preprocessors=None): |
||
25 | super().__init__(preprocessors=preprocessors) |
||
26 | self.params = vars() |
||
27 | self.supports_weights = True |
||
28 |
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.py
files in your module folders. Make sure that you place one file in each sub-folder.