Git Product home page Git Product logo

jadianes / winerama-recommender-tutorial Goto Github PK

View Code? Open in Web Editor NEW
348.0 39.0 343.0 545 KB

A wine recommender system tutorial using Python technologies such as Django, Pandas, or Scikit-learn, and others such as Bootstrap.

Home Page: http://jadianes.github.io/winerama-recommender-tutorial

License: Other

Python 75.95% HTML 24.05%
tutorial django scikit-learn python pandas recommender-system wine

winerama-recommender-tutorial's People

Contributors

bitdeli-chef avatar gitter-badger avatar jadianes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

winerama-recommender-tutorial's Issues

Clustering Models:error

(wine) root@hal:~/Projects/Wine-Shop/wine/winerama# python3 manage.py migrate
SystemCheckError: System check identified some issues:

ERRORS:
reviews.Cluster.users: (fields.E300) Field defines a relation with model 'User', which is either not installed
, or is abstract.
reviews.Cluster.users: (fields.E307) The field reviews.Cluster.users was declared with a lazy reference to 're

views.user', but app 'reviews' doesn't provide model 'user'.
reviews.Cluster_users.user: (fields.E307) The field reviews.Cluster_users.user was declared with a lazy refere
nce to 'reviews.user', but app 'reviews' doesn't provide model 'user'.

'NoneType' object has no attribute 'name'

Everything is working at stage, except i get an error on recommendation page.
Line causing the error :
user_cluster_name =
User.objects.get(username=request.user.username).cluster_set.first().name

'NoneType' object has no attribute 'name'

Request Method: GET
Request URL: http://192.168.99.100:8000/reviews/recommendation/
Django Version: 1.11
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'name'
Exception Location: /code/reviews/views.py in user_recommendation_list, line 92
Python Executable: /opt/conda/bin/python
Python Version: 3.6.0

unsupported operand type(s) for /: 'map' and 'int'

Great demo for Django.

I ran the demo and came across with an error: unsupported operand type(s) for /: 'map' and 'int' which is related to these two lines:

all_ratings = map(lambda x: x.rating, self.review_set.all())
return np.mean(all_ratings)

It is for calculating the avarage rating by using numpy. But numpy is not in favor of map. So a possible solution is to turn the map object to a list.

np.mean(list(all_ratings))

Just in case that anyone out there happened to meet with the problem.

Vagueness and skipping of sections

In your section titled "Adding Web Views", you go from defining the views in reviews/views.py to talking about templates and giving sample code for the reviews_list view template. There is no mention of where this code goes and where this file exists. I can follow through what the code means, but have no idea where it lives or will leave. At this point, there is no templates folder nor file. It would be clearer if you gave more info as to where this code goes and where that file lives:

<h2>Latest reviews</h2>

{% if latest_review_list %}
<div>
    {% for review in latest_review_list %}
    <div>
        <h4><a href="{% url 'reviews:review_detail' review.id %}">
        {{ review.wine.name }}
        </a></h4>
        <h6>rated {{ review.rating }} of 5 by {{ review.user_name }}</h6>
        <p>{{ review.comment }}</p>
    </div>
    {% endfor %}
</div>
{% else %}
<p>No reviews are available.</p>
{% endif %} 

Because of this lack of clarity, the tutorial from here onwards just becomes confusing. And when I check out stage-0.3 I look around the files to see where it might exist, and I find it in some templates folder along with some 3 other templates which are never mentioned in the tutorial or how the come about. I know it might simplistic of me to ask this, but that's the part I gave up. Tried it a few times and still could not reproduce your work other than just copying and pasting, which is useless.

self.review_set

Could you please describe where the review_set is defined? In the models.py file, under the wine table, you've used this, self.review_set

Error in views.py - user_recommendation_list

@Vijeta141 please help.

TypeError at /reviews/recommendation/

'<' not supported between instances of 'method' and 'method'

then get a wine list including the previous IDs, order by rating

wine_list = sorted(list(Wine.objects.filter(id__in=other_users_reviews_wine_ids)),
    key=lambda x:x.average_rating,
    reverse=True

)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.