| import streamlit as st
|
|
|
|
|
| import pandas as pd
|
| from pathlib import Path
|
| import os
|
| import sys
|
|
|
|
|
| data_dir = Path(__file__).parent / 'data'
|
|
|
|
|
| @st.cache_data
|
| def load_ratings_data():
|
| chunks = []
|
|
|
| dtype_ratings = {'userId': 'Int32', 'movieId': 'Int32', 'rating': 'float32'}
|
|
|
|
|
| with st.spinner('Loading ratings data (please bear with me)...'):
|
| for chunk in pd.read_csv(
|
| data_dir / 'ratings.csv',
|
| dtype=dtype_ratings,
|
| chunksize=1_000_000
|
| ):
|
|
|
| chunk = chunk.dropna(subset=['userId', 'movieId'])
|
| chunks.append(chunk)
|
|
|
|
|
| ratings = pd.concat(chunks, ignore_index=True)
|
| return ratings
|
|
|
|
|
|
|
| ratings_df = load_ratings_data()
|
| st.session_state['ratings_df'] = ratings_df
|
|
|
|
|
|
|
|
|
|
|
|
|
| st.markdown(
|
| """
|
| <style>
|
| .stApp {
|
| background-color: white;
|
| color: #116A91;
|
| }
|
| .title {
|
| text-align: center;
|
| color: #116A91;
|
| font-size: 36px;
|
| margin-bottom: 10px;
|
| }
|
| .subtitle {
|
| text-align: center;
|
| color: #444444;
|
| font-size: 18px;
|
| margin-bottom: 30px;
|
| }
|
| .section {
|
| background-color: #f9f9f9;
|
| padding: 20px;
|
| margin-bottom: 20px;
|
| border-radius: 6px;
|
| }
|
| .header {
|
| color: #116A91;
|
| font-size: 20px;
|
| margin-bottom: 10px;
|
| }
|
| .content {
|
| color: #333333;
|
| font-size: 16px;
|
| line-height: 1.6;
|
| }
|
| </style>
|
| """, unsafe_allow_html=True
|
| )
|
|
|
|
|
| st.markdown("<div class='title'>Movie Recommender System</div>", unsafe_allow_html=True)
|
| st.markdown("<div class='subtitle'>Discover movies you'll love using different recommendation techniques π¬</div>", unsafe_allow_html=True)
|
|
|
|
|
| st.markdown("""
|
| <div class='section'>
|
| <div class='header'>π€ About the Creator</div>
|
| <div class='content'>
|
| <strong>SJ</strong> is the creator of this Movie Recommender System.
|
| <br><br>
|
| Currently working as a <strong>Product Manager</strong>, SJ specializes in leading cross-functional teams to build and launch user-centric digital products. With a strong foundation in both business strategy and data, SJ is passionate about solving real-world problems through thoughtful product design.
|
| <br><br>
|
| Prior to becoming a Product Manager, SJ held roles as:
|
| <ul>
|
| <li><strong>Data Analyst</strong> β Experienced in SQL, Excel, Tableau, Python, Consumer Bureau data, and Microfinance analytics</li>
|
| <li><strong>Data Engineer</strong> β Worked with IBM DataStage, Informatica, Ataccama, and Collibra</li>
|
| </ul>
|
| This diverse background is what inspired SJ to build tools like this β combining the power of data with simple, intuitive products.
|
| </div>
|
| </div>
|
| """, unsafe_allow_html=True)
|
|
|
|
|
| st.markdown("""
|
| <div class='section'>
|
| <div class='header'>π Purpose of This App</div>
|
| <div class='content'>
|
| This Movie Recommender System helps users discover movies they might enjoy based on different recommendation techniques:
|
| <ul>
|
| <li>π₯ Popularity Based Filtering β Recommend trending movies</li>
|
| <li>π¬ Content-Based Filtering β Recommend movies similar to your favorites</li>
|
| <li>π₯ Collaborative User-Based β Recommend movies liked by users similar to you</li>
|
| <li>ποΈ Collaborative Item-Based β Recommend movies similar to ones you've rated highly</li>
|
| </ul>
|
| The goal is to provide a simple, interactive way to explore movie recommendations tailored to your preferences.
|
| </div>
|
| </div>
|
| """, unsafe_allow_html=True)
|
|
|
|
|
| st.markdown("""
|
| <div class='section'>
|
| <div class='header'>π οΈ Technology Used</div>
|
| <div class='content'>
|
| The application is developed using <strong>Streamlit</strong>, a lightweight and efficient Python framework for building data apps.
|
| <br><br>
|
| Key Python libraries used include <strong>Pandas</strong>, <strong>NumPy</strong>, <strong>Scikit-Learn</strong>, and <strong>Scipy</strong> for data processing and recommendation algorithms.
|
| </div>
|
| </div>
|
| """, unsafe_allow_html=True)
|
|
|
|
|
| st.markdown("""
|
| <div class='section'>
|
| <div class='header'>π What You Can Do with It</div>
|
| <div class='content'>
|
| With this app, users can:
|
| <ul>
|
| <li>Explore movie recommendations based on popularity, content similarity, or collaborative filtering</li>
|
| <li>View detailed recommendations for a specific user</li>
|
| <li>Filter movies based on ratings and user activity</li>
|
| <li>Understand hidden patterns in user preferences using latent features</li>
|
| </ul>
|
| The system helps both casual viewers and movie enthusiasts find movies they are likely to enjoy.
|
| </div>
|
| </div>
|
| """, unsafe_allow_html=True)
|
|
|
|
|
| st.markdown("""
|
| <div class='section'>
|
| <div class='header'>π― Ready to Discover Movies?</div>
|
| <div class='content'>
|
| Choose a recommendation technique from the sidebar and start exploring movies tailored to your tastes.
|
| <br><br>
|
| Enjoy discovering new favorites!
|
| </div>
|
| </div>
|
| """, unsafe_allow_html=True)
|
|
|