• 大小: 37.88MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-10
  • 语言: 其他
  • 标签: 推荐系统  

资源简介

电影推荐系统程序,可以直接跑

资源截图

代码片段和文件信息

function rating=demo(agegenderoccupationzipcodemovieK)
    load(‘D.mat‘);
    load(‘train_ratings_final.mat‘);
    load(‘movie_demo.mat‘);
    KDT = KDTreeSearcher(D);
    D=zeros(130);
    for i=1:1
        if(age>=0 && age<10)
            D(11)=1;
        elseif(age>=10 && age<20)
            D(12)=1;
        elseif(age>=20 && age<30)
            D(13)=1;
        elseif(age>=30 && age<40)
            D(14)=1;
        elseif(age>=40 && age<50)
            D(15)=1;
        elseif(age>=50 && age<60)
            D(16)=1;
        elseif(age>=60 && age<70)
            D(17)=1;
        elseif(age>=70 && age<80)
            D(18)=1;
        end
        if(strcmp(gender(i)‘M‘)==1)
            D(19)=1;
        else
            D(110)=1;
        end
        if(strcmp(occupation(i)‘administrator‘)==1)
            D(111)=1;
        elseif(strcmp(occupation(i)‘artist‘)==1)
            D(112)=1;
        elseif(strcmp(occupation(i)‘doctor‘)==1)
            D(113)=1;
        elseif(strcmp(occupation(i)‘educator‘)==1)
            D(114)=1;
        elseif(strcmp(occupation(i)‘engineer‘)==1)
            D(115)=1;
        elseif(strcmp(occupation(i)‘executive‘)==1)
            D(116)=1;
        elseif(strcmp(occupation(i)‘healthcare‘)==1)
            D(117)=1;
        elseif(strcmp(occupation(i)‘homemaker‘)==1)
            D(118)=1;    
        elseif(strcmp(occupation(i)‘lawyer‘)==1)
            D(119)=1;
        elseif(strcmp(occupation(i)‘librarian‘)==1)
            D(120)=1;
        elseif(strcmp(occupation(i)‘marketing‘)==1)
            D(121)=1;
        elseif(strcmp(occupation(i)‘none‘)==1)
            D(122)=1;
        elseif(strcmp(occupation(i)‘other‘)==1)
            D(123)=1;
        elseif(strcmp(occupation(i)‘programmer‘)==1)
            D(124)=1;
        elseif(strcmp(occupation(i)‘retired‘)==1)
            D(125)=1;
        elseif(strcmp(occupation(i)‘salesman‘)==1)
            D(126)=1;
        elseif(strcmp(occupation(i)‘scientist‘)==1)
            D(127)=1;
        elseif(strcmp(occupation(i)‘student‘)==1)
            D(128)=1;
        elseif(strcmp(occupation(i)‘technician‘)==1)
            D(129)=1;
        elseif(strcmp(occupation(i)‘writer‘)==1)
            D(130)=1;
        end
    end
    movie = movieID(find(strcmp(movieNamemovie)));
    IDX = knnsearch(KDTD(1:)‘k‘K);
    rating=0;
    for k=1:K
        rating = rating + train_ratings(IDX(k)movie);
    end
    rating = rating/K;
    if rating>3.2
        fprintf(‘Yes he is likely to watch the movie‘);
    else
        fprintf(‘No he is not likely to watch the movie‘);
    end
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-30 20:36  电影推荐系统\
     目录           0  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\
     文件         246  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\.gitignore
     目录           0  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\
     文件        2437  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\D.mat
     文件        1133  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\LICENSE
     文件        1400  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\README.md
     文件         886  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\age.mat
     文件      396693  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\dataset.mat
     文件        2647  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\demo.m
     文件        1950  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\demog_creator.m
     文件        1431  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\find_rating.m
     文件        1113  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\gender.mat
     文件       29726  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\movie_demo.mat
     文件        3998  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\occupation.mat
     文件        2896  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\pearsonsimilarity.m
     文件         650  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\read_dataset.m
     文件         103  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\read_demography.m
     文件        2862  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\script.m
     文件     4371235  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\similarity.mat
     文件       47482  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\test_ratings.mat
     文件      109875  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\testset.mat
     文件      130404  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\testset_predicted.mat
     文件      116473  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\train_ratings.mat
     文件    11491387  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\train_ratings_all_done.mat
     文件    11095279  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\train_ratings_final.mat
     文件      116477  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\train_ratings_orig.mat
     文件    11490512  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Code 2\train_ratings_wonan.mat
     文件        1133  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\LICENSE
     文件        1400  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\README.md
     目录           0  2013-11-14 20:11  电影推荐系统\Movie-Recommender-and-Score-Prediction-System-master\Reports\
............此处省略13个文件信息

评论

共有 条评论