Exemplo n.º 1
0
def t_test_orientation(db, column_name):
    straights = []
    gays = []
    for i in range(1, NUM_OF_PROFILES+1):
        is_gay = isGay(i, db)
        if is_gay:
            datum = db.getColumn_byID(i, column_name)
            if datum:
                gays.append(datum)
        elif is_gay == False:
            datum = db.getColumn_byID(i, column_name)
            if datum:
                straights.append(datum)
    degrees, t = t_test_math(gays, straights)
    print(degrees, t)
Exemplo n.º 2
0
def tfidf_orientation(db):
    gay_text = ""
    straight_text = ""
    for i in range(1, NUM_OF_PROFILES+1):
        # there is an errant frenchman
        if i == 1467:
            continue
        tiptup = db.getText_byID(i)
        if tiptup is not None:
            if isGay(i, db):
                gay_text += '\r'.join(tiptup)
            else:
                straight_text += '\r'.join(tiptup)
    corpus = [gay_text, straight_text]
    tuple_lists = tf_idf(corpus)
    masks = [gay_mask, str_mask]
    for i in range(len(tuple_lists)):
        # print(tuple_list)
        generate_tfidf_cloud(tuple_lists[i], masks[i])