首页 / PYTHON / Python Practical
Python Practical
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Python Practical,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3581字,纯文字阅读大概需要6分钟。
内容图文
![Python Practical](/upload/InfoBanner/zyjiaocheng/1239/822398e735d6419eab7e94b35b73dd6e.jpg)
Python Practical
Examine the accuracy of a TensorFlow recommendation engine.
Tensorflow is a popular framework for machine learning. The popularity is in some for some part that it can utilise the GPU on computers making it very fast.
TF-Recomm is a movie recommendation engine built on tensorflow which uses a Factorization model and a data set from movielens. The original code https://github.com/songgc/TF-recomm does not have a interface to ask for recommendations.
代写TensorFlow留学生作业、代写Python课程设计作业、代做GPU课程作业、Python编程语言作业调试
Andy has created a version that listens on a port for a user number and will return recommendations for that user. The code is by no means perfect and there may be errors ! The code is bundled into a Docker container for ease of use. To use this code :
Standard Small Version
Clone the project from https://github.com/acobley/TF-recomm.git
git clone https://github.com/acobley/TF-recomm.git
Run the docker container:
docker run --name runtfrecomm -p 81:81 -i -t acobley/tfrecomm bash
This will start a docker container an open it with a command line. Change to the TF-recomm directory and run the engine
python svd_train_val.py
This will train the model and once done wait for a socket connection. Open another window and open a telnet session (if you are on windows you will need to get one):
telnet localhost 81
Type and number between 1 and about 5000 and you should get recommendations back.
GPU large version
This version uses a much bigger data set and should use your GPU. This version has not been tested, make sure the small version works first.
Clone the project as before but switch to the GPU branch
git checkout GPU
run the docker container as :
docker run --name runtfrecommgpu -p 81:81 -i -t acobley/tfrecommgpu bash
You should be able to run it in the same way as the small model.
The Problem
This model is trained from the set of data from movielens. The model only uses the ratings.dat file to train the model. However there are two other files, movies.dat and users.dat. The challenge is to write a python program that will interrogate the model and allow you to get an idea of how accurate the model is. To do this you will need to use the movies and users file.
The Movies file:
See http://files.grouplens.org/datasets/movielens/ml-1m-README.txt
The file is in the format:
MovieID::Title::Genres
Genres are a list with | delimitors.
The Users file
See http://files.grouplens.org/datasets/movielens/ml-1m-README.txt
The file is in the format:
UserID::Gender::Age::Occupation::Zip-code
See the readme file for details of the Age and Occupation field.
What to do
If you look carefully, you will see that there are users with similar gender, age and occupation and possibly zip code. You would imagine that users same demographic would receive similar recommendations. Write a Python program that finds users of a similar demographic, attach to the tensorflow container, send the user id’s, store the recommendations and look for similarities. You could look at the genres returned and see if they are similar for similar users. You could extend the the movies file using python to include age ratings and use that as a comparison of the returned movies. You might want to use R to analyse the results you obtain to look for statistical meaning.
Write a report on the code you have produced and any results you have generated. Include your code in the appendix (and a zip file of the code). Your report should be less than 10 pages.
因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
微信:codehelp
原文:https://www.cnblogs.com/pythonhea/p/11182140.html
内容总结
以上是互联网集市为您收集整理的Python Practical全部内容,希望文章能够帮你解决Python Practical所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。