Path: blob/master/trees/__pycache__/tree.cpython-35.pyc
2585 views
X�YC � @ sw d d l Z Gd d � d � Z d d � Z d d � Z d d � Z d
d � Z d d
� Z d d d � Z e g Z d S)� Nc @ s^ e Z d Z d Z d d d d d d � Z d d � Z d
d � Z d d
� Z d d � Z d S)�Treea
Classification tree using information gain with entropy as impurity
Parameters
----------
max_features : int or None, default None
The number of features to consider when looking for the best split,
None uses all features
min_samples_split : int, default 10
The minimum number of samples required to split an internal node
max_depth : int, default 3
Maximum depth of the tree
minimum_gain : float, default 1e-7
Minimum information gain required for splitting
� NgH�����z>�
c C s( | | _ | | _ | | _ | | _ d S)N)� max_depth�max_features�minimum_gain�min_samples_split)�selfr r r r � r
�+/Users/ethen/machine-learning/trees/tree.py�__init__ s z
Tree.__init__c C s� t j | � j d | _ | j d k s>