Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
先生,我有一个数据集,其中条目的形式为
用户名|项目中|评分
我想使用 matlab 或 python 将此评级更改为矩阵市场输入格式
请帮帮我。
在 matlab 中是这样的(尚未检查代码,您可能还需要几个转置):
fid = fopen('exp.txt'); A = fscanf(fid, '%d|%d|%g', [3 inf]); S = sparse(A(1,:), A(2,:), A(3,:))
阅读文件的参考。 稀疏矩阵的参考。