示例#1
0
def findExcludedIndices(exclusions, users):
    #print(exclusions, users)
    indices = np.array(())
    for u in np.unique(users):
        if u in exclusions:
            uIndices = getIndicesFromUser(users, u)
            #print(uIndices)
            indices = np.append(indices, uIndices)
    #print('indices', indices)
    return indices
示例#2
0
def exclusionList(users, flags, cats=None, minU=8):
    excluded = []
    flags = np.array(flags)
    for u in np.unique(users):
        myUserIndices = getIndicesFromUser(users, u)
        # print(myUserIndices)
        # print(np.array(users)[myUserIndices])
        oneCount = 0
        pot = 0
        score = 0
        #print(myUserIndices)
        for i in myUserIndices:
            #print(i)
            if cats == None or cats[i] != 'Language':
                if flags[i] == 1:
                    oneCount += 1
                pot = pot + 1
        if pot > 0:
            score = oneCount / pot
        if score > .8 and pot > minU:
            excluded.append(u)
    print('excl', excluded, 'users', np.unique(users))
    return excluded