示例#1
0
def build_X_y(acount_name):

    fourNumControler = FourNumControler(acount_name)
    X = []
    y = []

    labels = range(0, 500, 100)
    print(len(labels))

    def make_class(num, labels):
        for index, label in enumerate(labels):
            if num < label:
                return index
        return len(labels)

    for four_num in fourNumControler.load_four_num():
        tweets = four_num[1]
        following = four_num[2]
        followers = four_num[3]
        favorites = four_num[4]
        X.append([tweets, following, favorites])

        followers_labeled = make_class(followers, labels)
        print(followers_labeled)
        y.append(followers_labeled)
    return X, y, ["tweets", "following", "favorites"]
示例#2
0
def checkFourNumDataBank(acount_name):
    acountPickleControler = FourNumControler(acount_name)
    count = 0
    for i in acountPickleControler.load_four_num():
        print(i)
        count += 1
    print(count)
示例#3
0
    def build_X(self):
        """
        return two data
        X and ["tweets", "following", "follower", "favorites"]
        """
        fourNumControler = FourNumControler(self.acount_name)
        X = []

        def make_class(num, labels):
            for index, label in enumerate( labels ):
                if num < label:
                    return index
            return len(labels)

        for four_num in fourNumControler.load_four_num():
            tweets = four_num[1]
            following = four_num[2]
            followers = four_num[3] 
            favorites = four_num[4]
            X.append( [tweets, following, followers, favorites] )

        return X, ["tweets", "following", "follower", "favorites"]