Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T3 Task #3

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added __pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file added __pycache__/preprocessing.cpython-311.pyc
Binary file not shown.
Binary file modified __pycache__/run.cpython-310.pyc
Binary file not shown.
Binary file added __pycache__/run.cpython-311.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def prepare(config_path):
parser = argparse.ArgumentParser()
parser.add_argument('--process_data_mid', default=0)
parser.add_argument('--process_data_ready', default=0)
parser.add_argument('--task', default='1')
parser.add_argument('--task', default='3')
parser.add_argument('--base_model', default='MF')
parser.add_argument('--seed', type=int, default=2020)
parser.add_argument('--ratio', default=[0.2, 0.8])
parser.add_argument('--ratio', default=[0.5, 0.5])
parser.add_argument('--gpu', default='0')
parser.add_argument('--epoch', type=int, default=10)
parser.add_argument('--lr', type=float, default=0.01)
Expand Down
7 changes: 4 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def __init__(self,
'aug_mae': 10, 'aug_rmse': 10,
'emcdr_mae': 10, 'emcdr_rmse': 10,
'ptupcdr_mae': 10, 'ptupcdr_rmse': 10}



def seq_extractor(self, x):
x = x.rstrip(']').lstrip('[').split(', ')
Expand Down Expand Up @@ -210,9 +212,7 @@ def eval_mae_last_epochs(self, model, data_loader, stage):
print("Length of unique user_ids", len(set(user_ids)))

# Calculate RMSE for each user
# user_ids = X[:, 0].unique().tolist() # Assuming UID is in the first column
for i,user_id in enumerate(user_ids):
# user_indices = torch.where(X[:, 0] == user_id)[0]
user_targets = targets[i]
user_predicts = predicts[i]
if user_id not in user_targets_dict:
Expand All @@ -229,7 +229,7 @@ def eval_mae_last_epochs(self, model, data_loader, stage):


# Store UID and RMSE values in a CSV file
filename = 'user_rmse_8_2_trial_2.csv'
filename = 'user_rmse_8_2_T3_MF.csv'
with open(filename, 'w', newline='') as file:
writer = csv.writer(file)
writer.writerow(['UID', 'MAE', 'RMSE']) # Write header
Expand Down Expand Up @@ -296,6 +296,7 @@ def CDR(self, model, data_src, data_map, data_meta, data_test,
self.update_results(mae, rmse, 'ptupcdr')
print('MAE: {} RMSE: {}'.format(mae, rmse))


def main(self):
model = self.get_model()
data_src, data_tgt, data_meta, data_map, data_aug, data_test = self.get_data()
Expand Down
14,426 changes: 14,426 additions & 0 deletions user_rmse_2_8_T1_MF.csv

Large diffs are not rendered by default.

29,911 changes: 29,911 additions & 0 deletions user_rmse_2_8_T2_MF.csv

Large diffs are not rendered by default.

9,017 changes: 9,017 additions & 0 deletions user_rmse_5_5_T1_MF.csv

Large diffs are not rendered by default.

18,695 changes: 18,695 additions & 0 deletions user_rmse_5_5_T2_MF.csv

Large diffs are not rendered by default.

3,607 changes: 3,607 additions & 0 deletions user_rmse_8_2_T1_MF.csv

Large diffs are not rendered by default.

7,479 changes: 7,479 additions & 0 deletions user_rmse_8_2_T2_MF.csv

Large diffs are not rendered by default.

3,349 changes: 3,349 additions & 0 deletions user_rmse_8_2_T3_MF.csv

Large diffs are not rendered by default.