Example #1
0
 def create_new_adaboost_classifiers(po, algs):
     """
     :param algs: The algorithms which will be the classifiers of one of the adaboosts
     :param po: The object which holds the tweets organized and parsed
     :return: Returns a list containing the two adaboost that are created in this function
     """
     adas = [
         ClassifiersWrapper(
             Adaboost.Adaboost(algs), Converters.TweetToTweet(),
             "Adaboost with all the algorithms from before as classifiers")
     ]
     ic_list = []
     for i in range(900):
         ic = ClassifiersWrapper(
             IndexClassifier.IndexClassifier(my_index=i),
             Converters.TweetToTweet())
         ic.train(po.get_tweets_before_for_others(),
                  po.get_tweets_after_for_others())
         ic_list.append(ic)
     adas.append(
         ClassifiersWrapper(
             Adaboost.Adaboost(ic_list),
             Converters.TweetToBowWithPca(new_dim=900),
             "Adaboost with every index as a classfier (after PCA to 900)"))
     return adas