一个好的 Python/Django 协同过滤/匹配/推荐库?

发布于 2024-12-28 07:15:32 字数 349 浏览 6 评论 0原文

我正在寻找一个库,可以用来根据问题的答案将我的用户与其他 Django 模型相匹配——也是我自己的 Django 模型。

所以我想要一些可定制的东西,有良好的文档/支持,并且希望实现起来不会太难!

有人有什么好的建议吗?我查看了 Crab 和 Django-recommender,但似乎都没有很好的文档记录。

基本上我有两个调查应用程序,有相应但不相同的问题和答案。例如,app1 中的问题可能是“您每周有多少个晚上喝酒?” app2 中的问题可能是“您每周预计喝多少个晚上?”,并使用实例中第一个问题的外键。我想获取这些问题的答案,并使用它们将每组中的用户相互配对,根据第 1 组中的用户已经使用的内容向第 2 组中的用户提供建议。

I'm looking for a library I can use to match my users to other Django models based on answers to questions-- also my own django model.

So I'd like something customizable, with good documentation/support, and hopefully not too hard to implement!

Does anyone have any good recommendations? I've looked over Crab and Django-recommender, but neither seem to be very well documented.

basically what I have is two survey applications, with corresponding, but not identical, questions and answers. E.g. a question in app1 could be "how many nights a week do you drink?" and a question in app2 could be "how many nights a week do you expect to drink?", with a foreign key to the first question in the instance. I want to take the responses to these questions and use them to pair users from each set with each other, to give the users in group 2 recommendations based on what the users in group 1 already use.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦回梦里 2025-01-04 07:15:32

他们在免费的斯坦福机器学习课程中讨论了这个主题。请在 http://www.ml-class.org/course/ 查看第十六章的视频video/preview_list

虽然讨论的实现是 Matlab/Octave,但在 Python 中实现应该不难,如果使用 Numpy 则更容易

They covered this subject in the free Stanford ML class. Check the videos for chapter XVI at http://www.ml-class.org/course/video/preview_list

Although the implementation discussed is Matlab/Octave it should be not difficult to implement in Python, even easier if you are using Numpy

白云悠悠 2025-01-04 07:15:32

There are some good books out there on the subject of social media combined with Python.

药祭#氼 2025-01-04 07:15:32

Abracadabra Recommender API 是一个非常灵活的解决方案,适用于任何编码语言(包括 Python)

基本上它是一个推荐算法即服务库。设置非常简单:您只需将 HTTP 调用(可以使用 Django 执行)发送到 API 端点 url 来训练您的模型并接收建议。 查看文档

借助 Abracadabra Recommender API,在使用 Python 时,您首先将数据添加到模型中:

# These code snippets use an open-source library. http://unirest.io/python
response = unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/add/subjects?recommenderId=rec1&subjectId=See+docs",
  headers={
    "X-Mashape-Key": "<required>",
    "Accept": "application/json",
    "Content-Type": "application/json"
  }
)

然后通过对主题(例如电影)进行评级或喜欢来训练模型:

# These code snippets use an open-source library. http://unirest.io/python
response = unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/rate/subject?recommenderId=rec1&subjectId=gameofthrones&subjectWeight=10&userId=user1",
  headers={
    "X-Mashape-Key": "<required>",
    "Accept": "application/json",
    "Content-Type": "application/json"
  }
)

完成后,您会收到基于以下内容的推荐:基于内容、协作或混合过滤如下:

# These code snippets use an open-source library. http://unirest.io/python
response = unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/recommend?method=content&recommenderId=rec1&userId=user1",
  headers={
    "X-Mashape-Key": "<required>",
    "Accept": "application/json",
    "Content-Type": "application/json"
  }
)

您可以查看其他语言的更多示例,包括 AngularReactJavascriptNodeJS, CurlJavaPythonObjective-CRuby.NET...API 主页

A very flexible solution that works in any coding language (including Python) is the Abracadabra Recommender API.

Basically it is a Recommender Algorithms as a Service library. The setup is very straightforward: you only need to send HTTP calls (which you can do with Django) to the API endpoint url to train your model and to receive recommendations. View the docs how.

With the Abracadabra Recommender API, when using Python, you first add data to your model:

# These code snippets use an open-source library. http://unirest.io/python
response = unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/add/subjects?recommenderId=rec1&subjectId=See+docs",
  headers={
    "X-Mashape-Key": "<required>",
    "Accept": "application/json",
    "Content-Type": "application/json"
  }
)

Then you train the model by rating or liking subjects (for instance movies):

# These code snippets use an open-source library. http://unirest.io/python
response = unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/rate/subject?recommenderId=rec1&subjectId=gameofthrones&subjectWeight=10&userId=user1",
  headers={
    "X-Mashape-Key": "<required>",
    "Accept": "application/json",
    "Content-Type": "application/json"
  }
)

Once done, then you receive recommendations based on Content-Based, Collaborative or Hybrid filtering as follows:

# These code snippets use an open-source library. http://unirest.io/python
response = unirest.post("https://noodlio-abracadabra-recommender-systems-v1.p.mashape.com/recommend?method=content&recommenderId=rec1&userId=user1",
  headers={
    "X-Mashape-Key": "<required>",
    "Accept": "application/json",
    "Content-Type": "application/json"
  }
)

You can view more example in other languages, including Angular, React, Javascript, NodeJS, Curl, Java, Python, Objective-C, Ruby, .NET... on the API homepage.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文