Module ImportFrom alias ImportFrom alias Import alias identifier Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias Import alias identifier ImportFrom alias ImportFrom alias alias alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr keyword Str keyword TupleLoad Num Num keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword Num keyword Num keyword Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Assign NameStore Dict For NameStore NameLoad body Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameStore Call NameLoad Str Str NameLoad For TupleStore NameStore NameStore ListLoad TupleLoad Str Call NameLoad keyword Num keyword Num TupleLoad Str Call NameLoad keyword Num keyword Num TupleLoad Str Call NameLoad keyword Num keyword Str TupleLoad Str Call NameLoad keyword Num keyword Str TupleLoad Str Call NameLoad keyword Num keyword Str body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad ListLoad Print BinOpMult Str Num Print BinOpAdd Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad Assign NameStore Call NameLoad Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Print Str Call NameLoad BinOpSub Call NameLoad NameLoad Num Str Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Print Call AttributeLoad Str attr NameLoad Print BinOpMult Str Num Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad
N/A sklearn.metrics accuracy_score time time N/A numpy np N/A pickle sklearn.feature_extraction.text TfidfVectorizer sklearn preprocessing sklearn.feature_selection SelectPercentile f_classif chi2 N/A matplotlib.pyplot plt itertools cycle sklearn.cluster KMeans SpectralClustering AgglomerativeClustering sklearn.metrics accuracy_score plot N/A N/A nFeatures data N/A N/A N/A colors N/A cycle rgbcmykw N/A algorithm N/A sorted data N/A fig N/A N/A plt figure N/A ax N/A N/A fig add_subplot 111 N/A N/A j c N/A zip algorithm colors N/A N/A N/A N/A ax plot nFeatures N/A data N/A j label j color c N/A N/A N/A ax scatter nFeatures N/A data N/A j color c N/A N/A N/A plt xlabel #-Features(SelectPercentile) N/A N/A N/A plt ylabel Accuracy N/A N/A N/A plt title Accuracy vs #-Features for different classifiers N/A box N/A N/A ax get_position N/A N/A N/A ax set_position N/A N/A box x0 N/A N/A box y0 N/A N/A box height 0.3 N/A box width N/A N/A box height 0.7 N/A N/A N/A ax legend loc upper center bbox_to_anchor N/A 0.5 -0.15 fancybox True shadow True ncol 3 N/A N/A N/A plt legend loc 2 N/A N/A N/A plt show N/A preprocess N/A N/A article_file lable_file k N/A N/A N/A features N/A N/A pickle load N/A open article_file N/A features N/A N/A np array features N/A lables N/A N/A pickle load N/A open lable_file N/A le N/A N/A preprocessing LabelEncoder N/A N/A N/A le fit lables N/A lables N/A N/A le transform lables N/A vectorizer N/A TfidfVectorizer sublinear_tf True max_df 0.5 min_df 1 stop_words english N/A features_train_transformed N/A N/A vectorizer fit_transform features N/A selector N/A SelectPercentile f_classif percentile k N/A N/A N/A selector fit features_train_transformed lables N/A features_train_transformed N/A N/A N/A N/A selector transform features_train_transformed toarray N/A N/A features_train_transformed lables vectorizer selector le features N/A N/A nFeatures N/A N/A np arange 10 100 10 N/A data N/A N/A k nFeatures N/A N/A N/A features labels vectorizer selector le features_data N/A preprocess pkl/article_2_people.pkl pkl/lable_2_people.pkl k N/A N/A name clf N/A N/A k_means N/A KMeans n_clusters 2 n_init 5 N/A SpectralClustering N/A SpectralClustering n_clusters 2 n_init 5 N/A AgglomerativeClustering_ward N/A AgglomerativeClustering n_clusters 2 linkage ward N/A AgglomerativeClustering_complete N/A AgglomerativeClustering n_clusters 2 linkage complete N/A AgglomerativeClustering_average N/A AgglomerativeClustering n_clusters 2 linkage average N/A N/A N/A N/A N/A data has_key name N/A N/A N/A data N/A name N/A N/A N/A * 100 N/A N/A N/A N/A Method: {} format name N/A N/A  the number of feature is {} format k N/A t0 N/A time N/A y_pred N/A N/A N/A clf fit features labels_ N/A fit time: N/A round N/A N/A time t0 3 s N/A score_accuracy N/A accuracy_score y_pred labels normalize True N/A N/A N/A accuracy score on training: {} format score_accuracy N/A N/A * 100 N/A N/A N/A N/A data N/A name append score_accuracy N/A N/A plot nFeatures data