Skip to content

After replacing the ml-1m.txt with the original data, the ndcg@10 is close to 0.8 #52

@zuoy3964

Description

@zuoy3964

hi, I download the original ml-1m dataset from https://grouplens.org/datasets/movielens/, and replace the "ml-1m.txt",

fpath = '/ml-1m/ratings.dat'

def read_data(fpath):
    data = []
    with open(fpath, 'r') as f:
        for line in f:
            parts = line.strip().split('::')
            if len(parts) >= 2:
                uid, itemid = parts[0], parts[1]
                data.append((uid, itemid))
    data = pd.DataFrame(data, columns=['uid', 'itemid'])
    return data

def convert_to_txt(data, output_path):
    with open(output_path, 'w') as f:
        for _, row in data.iterrows():
            f.write(f"{row['uid']}\t{row['itemid']}\n")


data = read_data(fpath)
data.head()
output_path = 'ml-1m.txt'
convert_to_txt(data, output_path)

Then run the code you provided in README.md.

python main.py --dataset=ml-1m --train_dir=default --maxlen=200 --dropout_rate=0.2 --device=cuda

I found that after just 20 epochs run, the ndcg@10 is close to 0.78.
Why is so different?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions