Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Update edsa_recommender.py #95

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 131 additions & 2 deletions edsa_recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,124 @@ def main():

# DO NOT REMOVE the 'Recommender System' option below, however,
# you are welcome to add more options to enrich your app.
page_options = ["Recommender System","Solution Overview"]
page_options = ["Recommender System","Solution Overview","Movie Mate","About Us", "Exploratory Data Analysis"]

# -------------------------------------------------------------------
# ----------- !! THIS CODE MUST NOT BE ALTERED !! -------------------
# -------------------------------------------------------------------
page_selection = st.sidebar.selectbox("Choose Option", page_options)
if page_selection == "About Us":
st.image('resources/imgs/comp.PNG',use_column_width=True)
st.title("About Us")
st.write("We are a team of data scientists passionate about recommendations systems.")
st.write("Our goal is to provide the best Movie recommendatiosn for users across our platforms.")

st.header("Team Members")
# Create three columns
col1, col2, col3 = st.columns(3)
desc1, desc2, desc3 = st.columns(3)
col4, col5, col6 = st.columns(3)
desc4,desc5,desc6 = st.columns(3)

# Place the images in separate columns
col1.image("resources/imgs/aa.jpg", caption="Chief Data Scientist", width=200)
col3.image("resources/imgs/sm.jpg", caption="Senior Developer", width=200)
col2.image("resources/imgs/aag.jpg", caption="Chief Technical Officer", width=200)

desc1.subheader("Abdulmalik Adeyemo")
desc1.write("Abdulmalik is an experienced data scientist. He has a strong background in machine learning and deep learning.")

desc2.subheader("Ayomide Aladetuyi")
desc2.write("Ayomide is an experienced data analyst specializing in drawing insights from data. He has a strong background in Finance.")

desc3.subheader("Setshaba Mashigo")
desc3.write("Setshaba is an experienced data expert specializing in modelling. He has a strong background in Quality Assesment.")

col4.image("resources/os.jpg", caption="Chief Administrative Officer", width=200)

desc4.subheader("Olaniyi Samuel")
desc4.write("Olaniyi is an experienced administrative specialist specialized in presenting amazing insights and presentations.")

desc5.subheader("Seye Tare Garanwei")
desc5.write("Seye is our Market researcher. He has a strong background in Market research.")


if page_selection == "Exploratory Data Analysis":
st.info("Exploratory Data Analysis")
st.write("1. Movie ratings play a crucial role in guiding audiences' choices and determining a film's success or failure. Understanding the distribution of movie ratings is essential for filmmakers, studios, and critics alike. In this analysis, we delve into the distribution of movie ratings and uncover a fascinating trend that sheds light on user preferences and the overall positivity of the ratings landscape.")
st.write("a. The majority of movies (1) receive ratings higher than the average, suggesting a favorable reception among audiences. This might be influenced by selection bias, leading to inflated ratings for well-received films.")
st.write("b. Most frequently assigned ratings include 3.0, 4.0, and 5.0 (2), representing positive thresholds. High ratings near 5.0 indicate outstanding films that leave a lasting impression, influenced by social factors.")
st.write("c. The left-skewed distribution of ratings (3) confirms the positive landscape, with fewer negative ratings. This could be due to users rating films they enjoyed and neglecting poorly received movies.")
st.write("d. Users prefer whole numbers (4) over decimals when rating movies, possibly due to simplicity and the psychological impact of round numbers, making it easier to express their opinions")
st.image('resources/imgs/eda1.png',use_column_width=True)

st.write("2. In the dynamic world of movie ratings, understanding the trends across different time periods can provide valuable insights into audience preferences and cultural influences. In this analysis, we explore the quantity of ratings received by movies from different decades, with a particular focus on the 1990s. It is important to note that this study does not assess the sentiment or quality of the ratings; rather, it aims to highlight the popularity and enduring appeal of 90's movies based on the sheer number of ratings they have accumulated.")
st.write("a. Movies from the 1990s receive the highest quantity of ratings, reflecting their lasting global impact.")
st.write("b. The popularity of 90's movies stems from their cultural significance and nostalgia as cultural touchstones.")
st.write("c. Accessibility through streaming platforms boosts ratings, as viewers easily discover and rate these classics.")
st.write("d. 90's movies continue to captivate newer audiences, cementing their position as enduring rating favorites.")
st.image('resources/imgs/eda2.png',use_column_width=True)

st.write("3. The realm of cinema has continually captivated audiences with its ability to transport them to worlds filled with excitement, wonder, and thrill. Among the vast array of films, certain masterpieces rise above the rest, garnering accolades and admiration from critics and viewers alike. In this write-up, we delve into the highest-rated movies, with special focus on the top two films—parts I and II of Planet Earth—providing insights into their genres and the reasons behind their overwhelming success.")
st.write("a. Common genres like action, adventure, and thriller dominate highly-rated movies, captivating audiences with adrenaline-pumping narratives and compelling storytelling. Understanding this preference is crucial for grasping cinematic appeal and the success of these captivating films.")
st.write("b. Planet Earth parts I and IIs unparalleled success exemplifies the genres allure. With extraordinary efforts and visionary storytelling, the series showcases breathtaking landscapes and natures wonders, immersing audiences in Earths raw beauty and diverse ecosystems.")
st.write("c. Action-Packed Adventure: The Planet Earth series is an action-packed adventure, immersing viewers in gripping encounters between predators and prey. Exploring remote and challenging terrains, the series captures heart-stopping moments, from breathtaking aerial chases to dramatic hunts, showcasing the raw survival instincts of Earth's inhabitants. Audiences are left on the edge of their seats, experiencing the thrill of the chase as if they were witnessing it firsthand.")
st.write("d. Thrills in the Natural World: Planet Earth series delivers unparalleled thrills through intimate portrayals of the animal kingdom. Filmmakers capture rare footage of animals in their natural habitats, evoking empathy and awe as viewers witness the beauty and fragility of wildlife, leading to a deeper understanding of Earth's delicate ecological balance")
st.image('resources/imgs/eda3.png',use_column_width=True)

st.write("4. The genres of movies, when considered as an isolated feature, have minimal determining influence on the ratings they receive. This is evident from the comparable distributions observed in both the top 100 and bottom 100 rated movies. These movies exhibit similar genre compositions with similar frequencie.")
st.write("a. Genres have minimal isolated influence on movie ratings. Analyzing top 100 and bottom 100 rated films shows similar genre distributions, suggesting specific genres don't guarantee high or low ratings. Other factors play a more significant role in determining a movie's success. The presence of genres alone doesn't define audience reception. Filmmakers should focus on storytelling, performances, direction, and production quality to impact ratings positively")
st.write("b.The top 100 and bottom 100 rated movies have comparable genre compositions and frequencies. This indicates that genres alone don't heavily influence a film's reception. Other factors like storytelling, performances, direction, and production quality play a more significant role in determining audience response.")
st.image('resources/imgs/eda4.png',use_column_width=True)



# st.subheader("Data Cleaning")

if page_selection == "Movie Mate":
# Header contents
st.write('# Movie Mate')
st.write('### Team RR Movie Recommender Model ')
st.image('resources/imgs/moviemate.PNG',use_column_width=True)
# Recommender System algorithm selection
sys = st.radio("Select an algorithm",
('Content Based Filtering',
'Collaborative Based Filtering'))

# User-based preferences
st.write('### Enter Your Three Favorite Movies')
movie_1 = st.selectbox('Fisrt Option',title_list[14930:15200])
movie_2 = st.selectbox('Second Option',title_list[25055:25255])
movie_3 = st.selectbox('Third Option',title_list[21100:21200])
fav_movies = [movie_1,movie_2,movie_3]

# Perform top-10 movie recommendation generation
if sys == 'Content Based Filtering':
if st.button("Recommend"):
try:
with st.spinner('Crunching the numbers...'):
top_recommendations = content_model(movie_list=fav_movies,
top_n=10)
st.title("We think you'll like:")
for i,j in enumerate(top_recommendations):
st.subheader(str(i+1)+'. '+j)
except:
st.error("Oops! Looks like this algorithm does't work.\
We'll need to fix it!")


if sys == 'Collaborative Based Filtering':
if st.button("Recommend"):
try:
with st.spinner('Crunching the numbers...'):
top_recommendations = collab_model(movie_list=fav_movies,
top_n=10)
st.title("We think you'll like:")
for i,j in enumerate(top_recommendations):
st.subheader(str(i+1)+'. '+j)
except:
st.error("Oops! Looks like this algorithm does't work.\
We'll need to fix it!")
if page_selection == "Recommender System":
# Header contents
st.write('# Movie Recommender Engine')
Expand Down Expand Up @@ -102,7 +214,24 @@ def main():
# ------------- SAFE FOR ALTERING/EXTENSION -------------------
if page_selection == "Solution Overview":
st.title("Solution Overview")
st.write("Describe your winning approach on this page")

st.info("Section 1: Utilizing AI for Recommender Systems")

st.write("Solution: Implement advanced AI-powered algorithms for movie recommendation systems to enhance user experience.")
st.write("In today's technology-driven world, recommender systems play a crucial role in helping users make appropriate content choices daily. To provide seamless movie recommendations, we propose utilizing AI to power these systems. Major streaming platforms like Netflix, Amazon Prime, and Disney already leverage AI to analyze user behavior and preferences, ensuring the delivery of tailored content suggestions.")

st.info("Section 2: Section 2: Learning User Ratings and Watch History")

st.write("Solution: Analyze user ratings and watch history to understand individual preferences accurately.")
st.write("A well-designed movie recommendation system deeply analyzes user ratings and watch history. By employing intelligent algorithms, we can process this data to curate personalized movie lists. Understanding users' historical interactions allows the system to learn their preferences and refine future recommendations, ensuring a more satisfying movie-watching experience.")


st.info("Section 3: Providing Accurate Recommendations")

st.write("Solution: AI-powered algorithms offer accurate recommendations, boosting user satisfaction and platform revenue.")
st.write("Accurate recommendations are key to increasing user satisfaction and platform affinity. By harnessing the power of AI, our system will curate content that aligns precisely with users' tastes. The personalized movie lists will not only enhance content consumption but also drive revenue for streaming platforms through increased user engagement.")

st.image('resources/imgs/S1.PNG',use_column_width=True)

# You may want to add more sections here for aspects such as an EDA,
# or to provide your business pitch.
Expand Down
Binary file added resources/imgs/S1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/aa.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/aag.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/comp.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/eda1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/eda2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/eda3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/eda4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/moviemate.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/os.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/imgs/sm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.