Skip to content

Computational Data Science Project - Country Fuel and EV Data Analysis

Notifications You must be signed in to change notification settings

kmollard/353-Project

Repository files navigation

CMPT353Project

Analyzing Fossil Fuel Consumption, Gas Prices, and Electric Vehicle Sales for a Sustainable Future

Instructor: Greg Baker
Team Fuel and EVs: Parmveer Dayal, Edoardo Rinaldi, Kyle Mollard

Intro

In this project, we aim to investigate these interrelated aspects to shed light on the potential implications for the energy sector and the environment. More specifically, in our analysis we relied on data related to fossil fuel consumption to find the countries that consume the most and, subsequently, attempted to find whether there was a correlation between fuel consumption and electric vehicles sales. Moreover, as we progressed with our analysis, we wa nted to explore the possibility of a correlation between gas prices and EV sales, to better understand whether the recent increase in gas prices has had an influence on consumers’ behavior toward electric cars.

Datasets and Python Files

Datasets (.csv) include:

1. Fuel_production_vs_consumption.csv for Fuel Consumption
2. gas_prices.csv for gas prices
3. IEA-EV-dataEV-salesCarsHistorical.csv for EV sales

Python files (.py) include:

1. fuel.py for Fuel Consumption Analysis
2. gas.py for Fuel Cost Analysis
3. ev.py for EV Analysis
4. correlation.ipynb for Fuel Consumption vs EV Sales correlation check

Libraries

Required Libraries:
numpy, pandas, matplotlib.pyplot, statsmodels.api, and sklearn

Specific modules from sklearn include:
model_selection.train_test_split
linear_model.LinearRegression
preprocessing.PolynomialFeatures
neighbors.KNeighborsClassifier
neighbors.KNeighborsRegressionn
pipeline.make_pipeline
metrics.r2_score
metrics.mean_squared_error

The following modules were explored, but not used in the final results:
statsmodels.nonparametric.smoothers_lowess.lowess
sklearn.ensemble.RandomForestRegressor
sklearn.neural_network.MLPRegressor

Commands and Order of Execution:

After cloning the repo, simply run the python files from the project directory to go through the data analysis of the report. These files were run with Python 3.9.12 and Python 3.11.1

Example for fuel consumption:
''..\project> python fuel.py''
One exception to this is the correlations.ipynb to be run and explored in a notebook environment

Expected Output Files:

Each separate python file produces the appropriate plots for each country.
Plots are stored in their respective folders within the plots directory

Example for fuel consumption:
Each country (or the World) plot is stored in the plots/consumption folder

Refer to the report for more references

About

Computational Data Science Project - Country Fuel and EV Data Analysis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published