Skip to content

Commit

Permalink
added 3 more recommendations in a new row
Browse files Browse the repository at this point in the history
  • Loading branch information
bushraqurban committed Jan 25, 2025
1 parent 5cbfc46 commit 16b5f4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def normalize_rating(rating_str):
except ValueError:
return 0 # Return 0 if the rating is invalid

def get_recommendations(course_name, data, similarity_matrix, top_n=3, threshold=90, rating_weight=0.05):
def get_recommendations(course_name, data, similarity_matrix, top_n=6, threshold=90, rating_weight=0.05):
"""
Get top N course recommendations based on similarity to the given course name.
Expand Down
2 changes: 1 addition & 1 deletion static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ form button:hover {
/* Recommendations list */
.recommendations-list {
display: flex;
flex-wrap: nowrap;
flex-wrap: wrap;
gap: 20px;
padding: 20px;
overflow-x: auto;
Expand Down
8 changes: 4 additions & 4 deletions templates/recommendations.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ <h2>Recommended Courses</h2>
{% for recommendation in recommendations %}
<div class="course-item">
<div class="course-info">
<h3><a href= "{{ recommendation.course_url }}" > {{ recommendation.course_name }} </a></h3>
<p><strong>Rating:</strong> {{ recommendation.rating }} </p>
<p><strong>Offered by:</strong> {{ recommendation.institution }} </p>
<p><strong>Difficluty level:</strong> {{recommendation.difficulty_level}} </p>
<h3><a href="{{ recommendation.course_url }}"> {{ recommendation.course_name }} </a></h3>
<p><strong>Rating:</strong> {{ recommendation.rating }}</p>
<p><strong>Offered by:</strong> {{ recommendation.institution }}</p>
<p><strong>Difficulty level:</strong> {{ recommendation.difficulty_level }}</p>
</div>
</div>
{% endfor %}
Expand Down

0 comments on commit 16b5f4c

Please sign in to comment.