Esempio n. 1
0
    Train_RSNR = not True
    Test_RSNR = not True
    randomSetup = 3

    # For real-time testing
    through_table = True
    user_based = False

    selectTable = 'clothing_'
    res, itemObj, userObj = pre_work.loadData(
        testing=False, table='clothing_', through_table=True)  # for clothing.

    # Generate voc & User information
    voc, USER = pre_work.Generate_Voc_User(res,
                                           havingCount=havingCount,
                                           limit_user=2500,
                                           user_based=user_based)

    # Generate training labels
    training_batch_labels = list()
    candidate_asins = list()
    candidate_reviewerIDs = list()

    for idx in range(0, num_of_rating, 1):

        training_labels, training_asins, training_reviewerIDs = pre_work.GenerateLabelEncoding(
            USER, num_of_reviews + idx, 1, itemObj, userObj)

        _batch_labels, _asins, _reviewerIDs = pre_work.GenerateBatchLabelCandidate(
            training_labels, training_asins, training_reviewerIDs, batch_size)
Esempio n. 2
0
batch_size = 16
num_of_rating = 1
num_of_validate = 3

# %%
selectTable = 'clothing_'
res, itemObj, userObj = pre_work.loadData(
    havingCount=6,
    sqlfile="HNAE/SQL/[email protected]",
    LIMIT=1000,
    testing=False,
    table='clothing_')  # for clothing.
# res, itemObj, userObj = loadData(havingCount=20, LIMIT=2000, testing=False, table='elec_')  # for elec.
# res, itemObj, userObj = pre_work.loadData(havingCount=15, LIMIT=1000, testing=False, table='toys_')  # for toys

voc, USER = pre_work.Generate_Voc_User(res, havingCount=6)

#%% Generate training labels
training_batch_labels = list()
candidate_asins = list()
candidate_reviewerIDs = list()

for idx in range(0, num_of_rating, 1):

    training_labels, training_asins, training_reviewerIDs = pre_work.GenerateLabelEncoding(
        USER, num_of_reviews + idx, 1, itemObj, userObj)

    _batch_labels, _asins, _reviewerIDs = pre_work.GenerateBatchLabelCandidate(
        training_labels, training_asins, training_reviewerIDs, batch_size)

    training_batch_labels.append(_batch_labels)
Esempio n. 3
0
    else:
        through_table = False
        user_based = True
        pass

    selectTable = 'clothing_'
    res, itemObj, userObj = pre_work.loadData(
        havingCount=15,
        LIMIT=2000,
        testing=False,
        table='clothing_',
        sqlfile='HNAE/SQL/[email protected]')  # for clothing.

    # Generate voc & User information
    voc, USER = pre_work.Generate_Voc_User(res,
                                           havingCount=15,
                                           limit_user=1000)

    # Generate training labels
    training_batch_labels = list()
    candidate_asins = list()
    candidate_reviewerIDs = list()

    for idx in range(0, num_of_rating, 1):

        training_labels, training_asins, training_reviewerIDs = pre_work.GenerateLabelEncoding(
            USER, num_of_reviews + idx, 1, itemObj, userObj)

        _batch_labels, _asins, _reviewerIDs = pre_work.GenerateBatchLabelCandidate(
            training_labels, training_asins, training_reviewerIDs, batch_size)