def test_min_samples_split():
 X = np.asfortranarray(iris.data.astype(tree._tree.DTYPE))
 y = iris.target
 for (max_leaf_nodes, name) in product((None, 1000), ALL_TREES.keys()):
  TreeEstimator = ALL_TREES[name]
  est = TreeEstimator(min_samples_split=10, max_leaf_nodes=max_leaf_nodes, random_state=0)
  est.fit(X, y)
  node_samples = est.tree_.n_node_samples[(est.tree_.children_left != (-1))]
  assert_greater(np.min(node_samples), 9, 'Failed with {0}'.format(name))
  est = TreeEstimator(min_samples_split=0.2, max_leaf_nodes=max_leaf_nodes, random_state=0)
  est.fit(X, y)
  node_samples = est.tree_.n_node_samples[(est.tree_.children_left != (-1))]
  assert_greater(np.min(node_samples), 9, 'Failed with {0}'.format(name))

def test_min_samples_split ( ) : X = np . asfortranarray ( iris . data . astype ( tree . _tree . DTYPE ) ) y = iris . target for ( max_leaf_nodes , name ) in product ( ( None , 1000 ) , ALL_TREES . keys ( ) ) : TreeEstimator = ALL_TREES [ name ] est = TreeEstimator ( min_samples_split = 10 , max_leaf_nodes = max_leaf_nodes , random_state = 0 ) est . fit ( X , y ) node_samples = est . tree_ . n_node_samples [ ( est . tree_ . children_left != ( - 1 ) ) ] assert_greater ( np . min ( node_samples ) , 9 , 'Failed with {0}' . format ( name ) ) est = TreeEstimator ( min_samples_split = 0.2 , max_leaf_nodes = max_leaf_nodes , random_state = 0 ) est . fit ( X , y ) node_samples = est . tree_ . n_node_samples [ ( est . tree_ . children_left != ( - 1 ) ) ] assert_greater ( np . min ( node_samples ) , 9 , 'Failed with {0}' . format ( name ) )
test min_samples_split parameter .