Module Expr Str ImportFrom alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad keyword Num Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Expr Call NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad keyword Num Assign NameStore Call NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign NameStore Call NameLoad keyword Num keyword Num keyword Num Assign NameStore Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Assign NameStore Call NameLoad keyword Num keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Expr Call NameLoad Call NameLoad NameLoad AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad keyword Num keyword Num Assign NameStore Call NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad Call NameLoad AttributeLoad NameLoad attr Num Expr Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad keyword Num Assign NameStore Call NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Call NameLoad keyword NameLoad Expr Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad keyword Num Expr Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad keyword Num keyword Num Assign NameStore Call NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Expr Call NameLoad NameLoad Call NameLoad NameLoad For NameStore NameLoad body If AttributeLoad NameLoad attr body Expr Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad Assign NameStore Num Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad keyword Num keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword Num keyword Num Expr Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr While NameLoad body Assign NameStore AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad keyword Num keyword Num Assign NameStore Call NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad Num Assign NameStore Call NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad Num decorator_list
N/A N/A 
Tests for the birch clustering algorithm.
 scipy sparse N/A numpy np sklearn.cluster.tests.common generate_clustered_data sklearn.cluster.birch Birch sklearn.cluster.hierarchical AgglomerativeClustering sklearn.datasets make_blobs sklearn.linear_model ElasticNet sklearn.metrics pairwise_distances_argmin v_measure_score sklearn.utils.testing assert_greater_equal sklearn.utils.testing assert_equal sklearn.utils.testing assert_greater sklearn.utils.testing assert_almost_equal sklearn.utils.testing assert_array_equal sklearn.utils.testing assert_raises sklearn.utils.testing assert_warns test_n_samples_leaves_roots N/A N/A N/A N/A N/A N/A X y N/A make_blobs n_samples 10 N/A brc N/A Birch N/A N/A N/A brc fit X N/A n_samples_root N/A sum N/A N/A sc n_samples_ N/A sc N/A N/A brc root_ subclusters_ N/A n_samples_leaves N/A sum N/A N/A sc n_samples_ N/A leaf N/A N/A brc _get_leaves N/A sc N/A leaf subclusters_ N/A N/A assert_equal n_samples_leaves N/A N/A X shape N/A 0 N/A N/A assert_equal n_samples_root N/A N/A X shape N/A 0 N/A test_partial_fit N/A N/A N/A N/A N/A N/A X y N/A make_blobs n_samples 100 N/A brc N/A Birch n_clusters 3 N/A N/A N/A brc fit X N/A brc_partial N/A Birch n_clusters None N/A N/A N/A brc_partial partial_fit N/A X N/A 50 N/A N/A N/A brc_partial partial_fit N/A X N/A 50 N/A N/A assert_array_equal N/A brc_partial subcluster_centers_ N/A brc subcluster_centers_ N/A N/A N/A brc_partial set_params n_clusters 3 N/A N/A N/A brc_partial partial_fit None N/A N/A assert_array_equal N/A brc_partial subcluster_labels_ N/A brc subcluster_labels_ N/A test_birch_predict N/A N/A N/A N/A N/A rng N/A N/A N/A np random RandomState 0 N/A X N/A generate_clustered_data n_clusters 3 n_features 3 n_samples_per_cluster 10 N/A shuffle_indices N/A N/A np arange 30 N/A N/A N/A rng shuffle shuffle_indices N/A X_shuffle N/A X N/A N/A shuffle_indices N/A N/A brc N/A Birch n_clusters 4 threshold 1.0 N/A N/A N/A brc fit X_shuffle N/A centroids N/A brc subcluster_centers_ N/A N/A assert_array_equal N/A brc labels_ N/A N/A brc predict X_shuffle N/A nearest_centroid N/A pairwise_distances_argmin X_shuffle centroids N/A N/A assert_almost_equal N/A v_measure_score nearest_centroid N/A brc labels_ 1.0 N/A test_n_clusters N/A N/A N/A N/A N/A N/A X y N/A make_blobs n_samples 100 centers 10 N/A brc1 N/A Birch n_clusters 10 N/A N/A N/A brc1 fit X N/A N/A assert_greater N/A len N/A brc1 subcluster_centers_ 10 N/A N/A assert_equal N/A len N/A N/A np unique N/A brc1 labels_ 10 N/A gc N/A AgglomerativeClustering n_clusters 10 N/A brc2 N/A Birch n_clusters gc N/A N/A N/A brc2 fit X N/A N/A assert_array_equal N/A brc1 subcluster_labels_ N/A brc2 subcluster_labels_ N/A N/A assert_array_equal N/A brc1 labels_ N/A brc2 labels_ N/A clf N/A ElasticNet N/A brc3 N/A Birch n_clusters clf N/A N/A assert_raises ValueError N/A brc3 fit X N/A brc4 N/A Birch threshold 10000.0 N/A N/A assert_warns UserWarning N/A brc4 fit X N/A test_sparse_X N/A N/A N/A N/A N/A N/A X y N/A make_blobs n_samples 100 centers 10 N/A brc N/A Birch n_clusters 10 N/A N/A N/A brc fit X N/A csr N/A N/A sparse csr_matrix X N/A brc_sparse N/A Birch n_clusters 10 N/A N/A N/A brc_sparse fit csr N/A N/A assert_array_equal N/A brc labels_ N/A brc_sparse labels_ N/A N/A assert_array_equal N/A brc subcluster_centers_ N/A brc_sparse subcluster_centers_ N/A check_branching_factor N/A N/A node branching_factor N/A N/A N/A subclusters N/A node subclusters_ N/A N/A assert_greater_equal branching_factor N/A len subclusters N/A cluster subclusters N/A N/A N/A cluster child_ N/A N/A N/A check_branching_factor N/A cluster child_ branching_factor N/A test_branching_factor N/A N/A N/A N/A N/A N/A X y N/A make_blobs N/A branching_factor 9 N/A brc N/A Birch n_clusters None branching_factor branching_factor threshold 0.01 N/A N/A N/A brc fit X N/A N/A check_branching_factor N/A brc root_ branching_factor N/A brc N/A Birch n_clusters 3 branching_factor branching_factor threshold 0.01 N/A N/A N/A brc fit X N/A N/A check_branching_factor N/A brc root_ branching_factor N/A brc N/A Birch n_clusters None branching_factor 1 threshold 0.01 N/A N/A assert_raises ValueError N/A brc fit X N/A check_threshold N/A N/A birch_instance threshold N/A N/A N/A Use the leaf linked list for traversal N/A current_leaf N/A N/A birch_instance dummy_leaf_ next_leaf_ N/A current_leaf N/A N/A subclusters N/A current_leaf subclusters_ N/A sc subclusters N/A N/A N/A assert_greater_equal threshold N/A sc radius N/A current_leaf N/A current_leaf next_leaf_ N/A test_threshold N/A N/A N/A N/A N/A N/A X y N/A make_blobs n_samples 80 centers 4 N/A brc N/A Birch threshold 0.5 n_clusters None N/A N/A N/A brc fit X N/A N/A check_threshold brc 0.5 N/A brc N/A Birch threshold 5.0 n_clusters None N/A N/A N/A brc fit X N/A N/A check_threshold brc 5.0 N/A