KEMBAR78
Olympics Analyzer Final Report File | PDF | Prediction | Time Series
0% found this document useful (0 votes)
51 views37 pages

Olympics Analyzer Final Report File

The 'Olympics Analyzer' is an interactive dashboard application developed using Python and Streamlit that allows users to explore and analyze Olympic medal data, integrating historical datasets with real-time updates. It features country-wise medal breakdowns, interactive visualizations, and machine learning capabilities for predicting future medal tallies. The project aims to provide a user-friendly platform for sports enthusiasts, students, and analysts to gain insights into Olympic performance trends.

Uploaded by

Shweta Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views37 pages

Olympics Analyzer Final Report File

The 'Olympics Analyzer' is an interactive dashboard application developed using Python and Streamlit that allows users to explore and analyze Olympic medal data, integrating historical datasets with real-time updates. It features country-wise medal breakdowns, interactive visualizations, and machine learning capabilities for predicting future medal tallies. The project aims to provide a user-friendly platform for sports enthusiasts, students, and analysts to gain insights into Olympic performance trends.

Uploaded by

Shweta Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 37

“Olympics Analyzer”

A Project Report

MINOR PROJECT

BACHELOR OF TECHNOLOGY
IN

COMPUTER SCIENCE & ENGINEERING


At

Rustamji Institute Of Technology, Gwalior


Candidate’s Declaration

I, ________________, bearing roll number ____________, hereby declare that


the work which is being presented in the Project, entitled
“_______________________________” in partial fulfilment for award of Degree
of “Bachelor of Technology” in Department of Computer Science Engineering
is submitted to the Department Computer Science & Engineering, JECRC
University is a record of Project work carried under the Guidance of Mrs.
Aishwarya Sharma, Department of Computer Science & Engineering.
I have not submitted the matter presented in this work anywhere for the award of
any other Degree.

Student Name:
Enrollment No.:
Certificate

Certified that the Project Report entitled “_______________________________”


submitted by _______________ bearing roll no.______________ in partial fulfilment
of the requirements for the award of the degree of Bachelor of Technology at Rustamji
Institute Of Technology , Gwalior is a record of the student’s own work carried out
under my supervision and guidance. To the best of my knowledge, this Project work
has not been submitted to RJIT or any other university for the award of the degree. It is
further understood that by this certificate the undersigned does not endorse or approve
of any statement made, opinion expressed or conclusion drawn therein but approve
Project for the purpose for which it is submitted.

Guide Name

(Project Guide)

(Project Coordinator) (Dy. HOD, CSE)


Acknowledgment

Many people have supported me, in different ways, during the work with the
thesis. I’d like to thank my guide ___________ & HOD _____________ for
their kind and active support and valuable guidance during the work process.
My family has as always offered me their unconditional support, thank you! I
have taken efforts in the Project. However, it would not have been possible
without the kind support and many individuals and organizations. I would
like to extend my sincere thanks to each and every members related to
RJIT College.

Student Name

Registration No.
Abstract

Olympics Analyzer is an interactive dashboard application developed using


Python and Streamlit that enables users to explore, analyze, and predict Olympic
medal data. The platform integrates historical datasets with real-time updates
fetched via a third-party API, providing users with a comprehensive view of
Olympic performance trends. Key features include country-wise medal
breakdowns, interactive visualizations such as pie charts, bar graphs, and world
maps, as well as comparisons between nations.
The application incorporates machine learning capabilities through Facebook
Prophet to forecast future medal tallies based on past performance data. Users can
view predictions for single or multiple countries, which are displayed using time-
series graphs with confidence intervals.
Designed for sports enthusiasts, students, and analysts, the project combines data
science, web development, and predictive modeling into a single, user-friendly
platform. It showcases the potential of data-driven insights in global sports analysis
and offers valuable experience in building end-to-end software solutions.
Table of Contents

S.No. Chapter Title


1 Introduction

1.1 Background

1.2 Motivation

1.3 Objectives

1.4 Problem Statement

1.5 Scope of the Project

2 Literature Survey

2.1 Existing Platforms and Tools

2.2 Related Projects and Research Work

2.3 Technologies Used in Similar Applications

2.4 Key Learning from the Survey

3 Software Requirement Specification

3.1 Purpose of the System

3.2 Intended Users

3.3 Functional Requirements

3.4 Non-Functional Requirements

3.5 Assumptions and Limitations


S.No. Chapter Title
4 Software Design

4.1 Use Case Diagram

4.2 Class Diagram

4.3 Sequence Diagram

4.4 Database Design (ER Diagram)

5 Software and Hardware Requirements

5.1 Software Requirements

5.2 Hardware Requirements

6 Coding / Code Explanation

6.1 live_data.py

6.2 historical_data.py

6.3 visualization.py

6.4 prediction.py

6.5 colors.py

6.6 olympic_dashboard_app.py

7 Testing

7.1 Black Box Testing

7.2 API Testing

7.3 Prediction Testing

8 Output Screens

8.1 Live Medal Tally


S.No. Chapter Title
8.2 Event Schedule

8.3 Country Medal Trend

8.4 Medal Pie Chart

8.5 Country Comparison (Bar and Radar)

8.6 World Medal Map

8.7 Prediction Graph

9 Conclusion

10 Further Enhancements

11 References

12 Appendices (if any)


CHAPTER 1: INTRODUCTION

1.1 Background

The Olympic Games are a prestigious international sporting event held every four years. They bring
together thousands of athletes from around the world to compete in a wide variety of sports. Since their
modern revival in 1896, the Olympics have grown to become more than just a sports competition —
they represent unity, determination, and excellence across nations. Each edition of the Olympics
produces a vast amount of data — such as medal counts, athlete performances, event schedules, and
historical achievements. This data can reveal interesting patterns and insights when properly analyzed.
For example, we can learn how a country's performance has changed over the years or how closely two
countries compete in particular sports. By analyzing Olympic data, we can understand performance
trends, visualize strengths and weaknesses, and even forecast how a country might perform in future
games. This creates opportunities for deeper appreciation and informed discussions about sports and
international performance.

1.2 Motivation

In recent years, data analysis and visualization have become essential skills in the world of technology.
We wanted to work on a real-world dataset that is large, interesting, and offers many possibilities for
exploration and learning. Olympic data fits this perfectly because: It is structured and spans over a
century. It involves multiple categories like countries, years, sports, and medal types. It has a global
appeal and relevance. We were also motivated by the idea of creating something useful — an
application that not only shows data but also helps users make sense of it. For example, a user could
check how India has performed in the last ten Olympics, compare it with China, or even see predictions
for the next games. This kind of analysis can be very engaging and educational. This project gave us a
chance to apply what we’ve learned about Python, data science, and web development in a creative way.
It also helped us improve our problem-solving and teamwork skills.

1.3 Objectives

The primary objectives of the “Olympics Analyzer” project are: To develop a user-friendly dashboard:
The dashboard should allow users to explore various types of Olympic data in one place. To load and
visualize historical medal data: Users can see how different countries have performed in past Olympics
using graphs and charts. To provide real-time updates: The application fetches live medal tallies and
schedules from external APIs, showing users the latest happenings. To compare country performances:
The app includes tools to compare medal counts between two or more countries using bar charts, radar
charts, etc. To use machine learning for prediction: By analyzing past trends, we can predict how
countries might perform in the next Olympics using models like Prophet. These features combine to
make the application both informative and interactive.
1.4 Problem Statement

Most people rely on news channels, websites, or social media for Olympic updates. However, these
platforms do not offer detailed analysis or personalized visualizations. They are mostly focused on
broadcasting scores or headlines rather than helping users explore the data themselves. Some of the key
problems we identified are: Scattered information: Olympic data is spread across many sources and is
not always easy to access or understand. Lack of interaction: Existing platforms don't allow users to
explore trends or compare countries visually. No predictions: There's rarely any future insight about how
countries might perform in upcoming games based on past data. Our project aims to solve these
problems by creating a single platform where users can interact with Olympic data — both historical and
live — and gain useful insights in a fun and engaging way.

1.5 Scope of the Project The “Olympics Analyzer”

project is focused on three major aspects: Historical Analysis: Users can view data from previous
Olympic Games — including medal counts by country and year, sport-wise performance, and trends.
Live Updates: The app connects to a live API that provides real-time updates on medals and events
during the ongoing Olympics. Predictions: Using machine learning models, the application forecasts
future medal counts for countries based on their past performances. The project is limited to data that is
publicly available. While it provides useful visualizations and predictions, it does not include athlete-
level statistics, video highlights, or sport-specific rules. The application is meant for analysis and display
purposes only and is not an official source of Olympic data.
CHAPTER 2: LITERATURE SURVEY

A literature survey helps us understand what work has already been done in the area of Olympic data
analysis and how our project fits into it. It gives us insights into existing tools, platforms, and research
that are related to our idea. By studying this, we can build something better and more useful.

2.1 Existing Platforms and Tools

Several websites and platforms provide Olympic data, but most of them are designed for information
display only. Some of the notable ones include: Olympics.com (Official Website): This is the official
site of the Olympic Games. It provides basic details about athletes, events, and medal counts, but it is
not designed for custom data exploration or comparison. Wikipedia: It offers historical data of Olympic
Games including medal tallies by country and sport. However, this data is not interactive and cannot be
visualized directly. Sports Analytics Tools: Some tools are used by sports analysts and journalists to
explore sports statistics. These tools are powerful but not always accessible to general users or
beginners. Our project adds value by providing an easy-to-use interactive dashboard that combines
historical, live, and predictive features in one place. Most existing solutions lack prediction and
comparison features for casual users.

2.2 Related Projects and Research Work

We also looked at academic papers and projects done by other students and researchers in the field of
sports analytics. Some important references include: "Predicting Olympic Medal Counts with Machine
Learning" (IEEE, 2021): This paper uses models like linear regression and random forest to predict
Olympic medal outcomes. It showed how past performance and socio-economic data could help
improve predictions. Kaggle Dataset Projects: Many students and developers have used the “Athlete
Events” dataset on Kaggle to build dashboards and machine learning models. These projects often focus
on visualizations, but not on live updates or prediction combined in one platform. Use of Facebook
Prophet in Time Series Forecasting: Facebook Prophet is a popular tool for forecasting data over time. It
is especially good for datasets that have seasonal patterns — like the Olympic Games, which occur
every four years. Our project is inspired by these research efforts but aims to improve usability and
combine all the features in one place.

2.3 Technologies Used in Similar Applications

Some common technologies that are often used in data analysis and visualization projects include:
Python: Widely used in data science due to its rich libraries like pandas, matplotlib, seaborn, and scikit-
learn. Plotly & Streamlit: Popular tools for creating interactive dashboards. Plotly allows for rich
visualizations, and Streamlit lets us build web apps quickly in Python. Machine Learning Models: Tools
like Prophet, ARIMA, and regression models are used for time-series forecasting. We have also used
Python, Plotly, and Streamlit in our project, along with Prophet for prediction.
2.4 Key Learning from the Survey

From the literature survey, we learned that: Many existing sources offer either historical data or live
updates, but very few combine both. Prediction of Olympic outcomes is still an emerging area and is
mostly done in research settings. Users enjoy visual dashboards that are simple to use and provide
multiple perspectives (e.g., comparison, trends, rankings). Adding prediction features and real-time
updates makes the application more advanced and useful. These learnings helped shape the final features
of our “Olympics Analyzer” dashboard
CHAPTER 3: SOFTWARE REQUIREMENT SPECIFICATION

Software Requirement Specification (SRS) defines the complete functionality, behavior, and constraints
of the system we are developing. It is a critical step that helps in planning the design, implementation,
and testing stages. This chapter describes both the functional and non-functional requirements of the
Olympics Analyzer project.

3.1 Purpose of the System

The purpose of the “Olympics Analyzer” is to provide a complete dashboard-based application that
allows users to: View historical Olympic data for countries and sports. Get real-time medal tallies and
event schedules. Compare country performances using interactive graphs. Use machine learning to
predict future medals for any country. This application is helpful for students, sports fans, and analysts
who want to explore Olympic data in a visual and meaningful way.

3.2 Intended Users

The system is intended for the following types of users: Students and Teachers for academic learning.
Sports Enthusiasts who want to explore country-wise Olympic performances. Researchers and Analysts
interested in data trends and forecasting. No technical background is needed to use the system, as the
interface is simple and intuitive.

3.3 Functional Requirements

These are the features and actions the system should perform: Load Historical Data: The system should
allow loading and filtering of historical Olympic medal data. View Live Medal Tally: Fetch real-time
medal counts using a public API. Event Schedule: Display upcoming Olympic event dates, times, and
venues. Country Performance Analysis: Show medal trends for a specific country across years. Display
medal breakdown (Gold/Silver/Bronze) in pie charts. Compare Two Countries: Visual comparison of
medal counts via bar and radar charts. Predict Future Medals: Use a time-series forecasting model to
estimate future medal counts. Multi-country Prediction: Show predicted trends for multiple countries
together in a single chart.

3.4 Non-Functional Requirements

These are the qualities and constraints of the system: Performance: The system should load and process
data within a few seconds. Charts should be interactive and responsive. Scalability: Easy to expand for
more countries, sports, or features in the future. Usability: Simple interface using dropdowns, input
boxes, and buttons. No programming knowledge required for using the dashboard. Reliability: Should
handle cases like missing or incomplete data gracefully. Proper error handling for failed API requests.
Portability: Can run on any system with Python and a web browser. Security: Since it's a local project,
data security isn’t a major concern, but safe handling of API data is ensured.
3.5 Assumptions and Limitations Assumptions:

User has internet access for fetching live data. Necessary Python packages are already installed.
Limitations: The system depends on third-party APIs for live data, which may change or become
unavailable. Predictions are based only on past medal counts and do not consider external factors like
player injuries or political changes.
CHAPTER 4: SOFTWARE DESIGN

Software design is the blueprint of how the system works internally. It helps us plan how different
components interact, how data flows, and how users interact with the application. This chapter includes
design diagrams such as use case, class, sequence, and ER diagrams.

4.1 Use Case Diagram

The Use Case Diagram shows the interactions between users and the system. It helps us understand the
functionalities from a user’s perspective. Actors: User: The person interacting with the dashboard. Use
Cases: Load Historical Data View Live Medal Tally View Event Schedule Analyze Country Trends
Predict Future Medals Compare Countries Display Medal Pie Chart View World Medal Map sql Copy
Edit User | |---> Load Historical Data |---> View Live Medal Tally |---> View Event Schedule |--->
Analyze Country Trends |---> Predict Future Medals |---> Compare Countries |---> Display Medal Pie
Chart |---> View World Medal Map

4.2 Class Diagram

The Class Diagram represents the structure of the application. It includes main classes, their attributes,
and functions. Classes: OlympicsDashboard Attributes: historical_data, live_data Methods: load_data(),
display_dashboard() DataFetcher Methods: fetch_live_medals(), fetch_event_schedule() Visualizer
Methods: plot_bar_chart(), plot_pie_chart(), plot_radar_chart(), plot_line_chart() Predictor Methods:
predict_single_country(), predict_multiple_countries() User Attributes: selected_country,
selected_chart_type Actions: select_country(), choose_visualization()

4.3 Sequence Diagram


This shows how functions are called in order when a user interacts with the app. Scenario: Predicting
Medals for a Country sql Copy Edit User --> Dashboard: Selects Country Dashboard --> DataFetcher:
Load historical data Dashboard --> Predictor: Call predict_single_country() Predictor --> Prophet
Model: Fit model and forecast Predictor --> Dashboard: Return prediction Dashboard --> Visualizer:
Show prediction chart

4.4 Database Design (ER Diagram)

The ER (Entity-Relationship) Diagram shows how different data tables are related. Entities:
AthleteEvents Fields: ID, Name, Sex, Age, Team, NOC, Games, Year, City, Sport, Event, Medal
NOCRegions Fields: NOC, Region Relationships: Each athlete event is linked to a country via the NOC
code. Medal data is aggregated by country and year. lua Copy Edit AthleteEvents | |--(NOC)-->
NOCRegions This design supports queries like: Total medals per country Medal distribution over years
Country comparison Filtering by sport or year
CHAPTER 5: SOFTWARE AND HARDWARE REQUIREMENTS

Before developing any application, it is important to define the software and hardware environment
required for building, running, and testing the system. This helps ensure compatibility and smooth
performance.

5.1 Software Requirements

Component Details Operating System Windows 10 or later / Linux / macOS Programming Language
Python 3.8 or above Libraries & Tools pandas, numpy, plotly, prophet, streamlit, requests, matplotlib,
seaborn Development Tools VS Code / PyCharm / Jupyter Notebook Browser Chrome, Firefox, Edge
(for running Streamlit app) APIs Codante Olympic API (for live medal tally and event schedule)
Additional Notes: The project relies on the prophet library for time-series forecasting. It may require
installing dependencies like pystan. The dashboard is built using streamlit, a popular Python framework
for building web apps.

5.2 Hardware Requirements

Component Minimum Requirement Recommended Processor Intel Core i3 or equivalent Intel Core i5 or
above RAM 4 GB 8 GB or higher Hard Disk At least 2 GB of free space 10 GB for datasets & caching
Display 13" or larger screen Full HD (1920×1080) or better Internet Connection Required for live
data/API access Broadband recommended The system can run on a standard laptop or PC. Since the
project involves data visualization, a better processor and higher RAM can improve performance during
large dataset processing or rendering charts.
CHAPTER 6: CODING / CODE EXPLANATION

This chapter provides an overview of the key Python files used in the project. Each file contains
modules or functions that contribute to the working of the “Olympics Analyzer” application. The
explanation includes the purpose of each file and the logic behind important functions.

6.1 File: live_data.py

Purpose: This is the entry-point Python script for the command-line version of the Olympics
Dashboard.

Key Features: Shows a menu-driven interface. Allows users to load historical data, view live data, and
generate visualizations. Acts as a controller that connects user input with backend logic.

Important Functions: main_menu(): Displays menu options and takes user input to perform actions
like plotting graphs, fetching live data, or predicting medals.
6.2 File: historical_data.py

Purpose: Loads and processes historical Olympic data from a CSV file.

Functions:

 load_historical_data(filepath): Reads the dataset, filters for entries with medals, and adds
columns for Gold, Silver, and Bronze.

 get_country_medal_counts(df, country_code): Aggregates the number of medals won by a


specific country over the years.

Libraries Used: pandas


6.3 File: visualization.py

Purpose: Contains all data visualization functions using Plotly.

Functions:

 plot_interactive_medals(df): Shows top 10 countries with the most medals using a grouped bar
chart.

 plot_country_medal_trend(medal_counts, country_code): Line chart of total medals over the


years for a selected country. plot_country_pie(df, country_code): Pie chart showing distribution
of Gold, Silver, and Bronze medals.

 compare_two_countries(df, country1, country2): Bar chart comparing medal types between two
countries.

 radar_compare_countries(df, country1, country2): Radar chart comparison of medal counts.

Libraries Used: plotly.express, plotly.graph_objects, pandas


6.4 File: prediction.py
Purpose: Contains functions to predict future medal counts using machine learning. Functions:

 predict_future_medals(medal_counts, country_code): Uses Facebook Prophet to forecast total


medal count for the next Olympics.

 predict_multiple_countries_shared_plot(historical_df, country_codes): Shows predictions for


multiple countries on a single plot.

Libraries Used: Prophet, pandas, plotly


6.5 File: colors.py
Purpose: Defines consistent color schemes for medals and countries.

Constants: MEDAL_COLORS: Hex color codes for Gold, Silver, and Bronze.

COUNTRY_COLORS: Unique colors assigned to specific countries for easy identification in charts.
6.6 File: olaymic_dashboard_app.py

Purpose: Main file for the web-based dashboard built using Streamlit.

Features:

 Displays navigation menu on the sidebar.

 Hosts different pages for live data, event schedules, country trends, comparisons, predictions,
and map visualizations.

 Uses all other backend files for data processing and display.

Libraries Used: streamlit, pandas, plotly, datetime, dateutil


CHAPTER 7: TESTING

Testing is a crucial part of the software development process. It ensures that the system functions
correctly and meets the specified requirements. For this project, both manual testing and output
verification were done for the various functionalities in the dashboard.

7.1 Black Box Testing

In black box testing, the internal code is not considered; only inputs and outputs are verified. Some test
cases used are:

 Test Case 1:Enter a valid country code (e.g.,"USA")for medal trend.→ Expected Result:->
Graph of medal trend appears. → Status:→ Pass

 Test Case 2: Enter an invalid country code (e.g., "XYZ"). → Expected Result:→ Error
message is displayed. →Status:→ Pass

 Test Case 3:Attempt to load historical data with a valid CSV file.→ Expected Result:→ Data
loads successfully. → Status: → Pass

7.2 API Testing

The system uses a third-party API for live Olympic data. These APIs were tested for response and
correctness.

 Medal Tally API: Returns a JSON with country-wise medal counts.→ Status:→ Working

 Event Schedule API: Returns a JSON with upcoming event schedules. → Status:→ Working

 Error Handling: If the API fails or returns empty data, the system displays a friendly message
instead of crashing.

7.3 Prediction Testing

The prediction feature was tested using Prophet model forecasting. *

 Test Case: Load historical data for a country and run prediction. → Expected Result:

 Forecast: graph with upper and lower confidence bounds.→ Status:→ Pass

 Edge Case: Use a country with minimal data.→ Expected Result:→ System alerts that there's
not enough data to predict.→ Status:→ Pass
CHAPTER 8: OUTPUT SCREENS

The dashboard provides several visual and tabular outputs depending on the
selected function. Here are the major output screens:
8.1 Live Medal Tally:
A table sorted by rank, showing gold, silver, bronze, and total medals.

8.2 Event Schedule:


A table listing the date, discipline, event name, venue, and time.
8.3 Country Medal Trend:
A line graph of total medals over the years for a specific country.
8.4 Medal Pie Chart:
Pie chart showing the distribution of gold, silver, and bronze medals for a
country.

8.5 Country Comprasion(Bar and Radar):


Graphs comparing two countries side by side.
8.6 World Medal Map:
A choropleth map showing historical or live medal totals across the globe.
8.7 Prediction Graph:
Time-series chart predicting future medal counts for one or more countries.
CHAPTER 9: CONCLUSION

The "Olympics Analyzer" project successfully integrates data


analysis, visualization, and prediction into one dashboard. It helps
users explore Olympic data interactively, get real-time updates, and
forecast medal counts.
This project not only strengthened our technical skills in Python, data
science, and visualization but also gave us practical experience in
designing a complete software system.
Through this project, we were able to:
 Understand the use of data analysis in real-world sports
applications.
 Build interactive visualizations and dashboards using Streamlit
and Plotly.
 Apply time-series forecasting using Facebook Prophet. * Work
collaboratively to manage different components of the software.
CHAPTER 10: FURTHER ENHANCEMENTS

Although the current system is functional and effective,


several improvements can be made in future versions:
 Athlete-Level Analysis: Add more granularity by
showing stats for individual athletes.
 Filter by Sport: Allow users to view data filtered by
specific sports or disciplines.
 More Detailed Predictions: Combine external data
(GDP, population) with historical trends for more
accurate medal forecasting.
 Mobile-Friendly Version: Optimize the interface for
mobile use.
 Authentication: Add a login system for saving user
preferences or views.
 Admin Panel: Allow event organizers to add manual
updates or custom data.
CHAPTER 11: REFERENCES

 Kaggle Olympic Dataset:

◦ [https://www.kaggle.com/datasets/heesoo37/120-years-of-olympic-history-athletes-and-
results]

◦ (https://www.kaggle.com/datasets/heesoo37/120-years-of-olympic-history-athletes-and-
results)

 Codante Olympic API:

◦ [https://apis.codante.io/olympic-games]

◦ (https://apis.codante.io/olympic-games)

 Streamlit Documentation:

◦ [https://docs.streamlit.io]

◦ (https://docs.streamlit.io)

 Plotly Python Graphing Library:

◦ [https://plotly.com/python/]

◦ (https://plotly.com/python/)

 Facebook Prophet:

◦ [https://facebook.github.io/prophet/]

◦ (https://facebook.github.io/prophet/)

 Python Official Documentation:

◦ [https://docs.python.org/3/]

◦ (https://docs.python.org/3/)

You might also like