Beispiel #1
0
            samples = collections.defaultdict(list)
            for d, dec in enumerate(dec_paths):
                for i in range(estimator.tree_.node_count):
                    if dec.toarray()[0][i] == 1:
                        samples[i].append(d)

'''

estimator.fit(X_train, y_train)

names = dir(estimator)

for name in names:
    print(name)
    try:
        print(estimator.__getattribute__(name))
    except TypeError:
        pass


exit()


# The decision estimator has an attribute called tree_  which stores the entire
# tree structure and allows access to low level attributes. The binary tree
# tree_ is represented as a number of parallel arrays. The i-th element of each
# array holds information about the node `i`. Node 0 is the tree's root. NOTE:
# Some of the arrays only apply to either leaves or split nodes, resp. In this
# case the values of nodes of the other type are arbitrary!
#
# Among those arrays, we have: