Skip to content

Jorgemontanez25/Machine-Learning-Final-Project

Repository files navigation

Data Science Final Project

Estimation of Charging Stations for Electric Vehicles

In this project, we aim to address the growing need for electric vehicle (EV) charging infrastructure by leveraging data on the type of charging stations, the area of the region, and the quantity of registered electric vehicles. By analyzing these factors, we seek to predict the optimal number of charging stations needed to support the increasing demand for EVs in a given area. Through data-driven insights and predictive modeling techniques, our goal is to provide valuable guidance for policymakers, urban planners, and stakeholders in the transportation sector to effectively plan and deploy charging infrastructure, thereby promoting the widespread adoption of electric vehicles and contributing to a sustainable future.

Code & Tools

Python SQL GitHub Codespaces Jupyter Notebooks VSCode

Libraries

Pandas Numpy Matplotlib Matplotlib Scikit-Learn

Data Acquisition

Data acquisition serves as a cornerstone in the realm of data science and machine learning projects. It's the crucial first step, laying the groundwork for subsequent analysis and modeling endeavors. In this project, we emphasize the significance of sourcing high-quality data through diverse methods, including APIs and web scraping. By harnessing these techniques, we efficiently gather data from various sources. Additionally, we employ SQL to seamlessly merge and organize collected data into structured datasets. This meticulous approach ensures that our data is primed for in-depth exploration and analysis. Through meticulous data acquisition practices, we pave the way for insightful discoveries and actionable insights in our project.

Perform a full EDA

The exploratory data analysis (EDA) process in this project was conducted in two phases, each serving a distinct purpose. Initially, we embarked on a macro-level EDA, delving into a vast dataset comprising over 70,000 elements and more than 70 variables. This expansive dataset offered a comprehensive overview of the available information, allowing us to glean valuable insights and identify overarching trends. However, to facilitate further analysis and modeling, we recognized the need to refine and structure the data. As a result, we performed a grouping operation, aggregating the elements by state using SQL. This step enabled us to create a new database consisting of merged tables, organized by state. With this streamlined dataset, we proceeded to conduct a secondary EDA, focusing on a reduced set of elements post-grouping. Despite the reduction in data volume, this refined dataset still retained the essential information needed for detailed analysis. By executing two distinct EDAs at different stages of data processing, we ensured a comprehensive understanding of the dataset while optimizing its structure for subsequent analyses.

Build the model and optimize it

Following the exploratory data analysis (EDA) phase, the next step in our project involved data engineering, where we prepared the dataset for machine learning modeling. Utilizing insights gained from the EDA, we split the data into training and testing sets, ensuring that the model would be trained on a representative sample and evaluated on unseen data. With the data prepared, we embarked on the task of building and evaluating machine learning models. We experimented with various models, including linear regression, decision trees, random forests, gradient boosting, support vector regression (SVR), neural networks, and k-nearest neighbors (KNN). After thorough evaluation, we determined that linear regression exhibited the best performance based on metrics such as mean squared error (MSE) and coefficient of determination (R2). However, during model analysis, we detected signs of overfitting, prompting us to explore regularization techniques. We experimented with ridge and lasso regression, and ultimately, lasso regression emerged as the preferred choice due to its superior performance in mitigating overfitting while maintaining predictive accuracy. By leveraging insights from the EDA and employing rigorous model evaluation techniques, we were able to identify and implement the most effective machine learning approach for our project.

Deploy the model

After selecting the lasso regression model as the optimal choice, the next step in our project was deploying the model for practical use. This involved loading both the trained model and the normalization object that was used during data preprocessing. We developed an interface using Streamlit, allowing users to input the relevant features required for prediction. Once the input values were provided, they were normalized using the same normalization technique applied during model training. Subsequently, the model predicted the number of charging stations required based on the input features. Finally, the results of the prediction were presented in the Streamlit interface, providing users with actionable insights based on their input data. This deployment process facilitated the practical application of our predictive model in real-world scenarios, enabling stakeholders to make informed decisions regarding the allocation of charging infrastructure for electric vehicles.

Final Product

Our final product is a user-friendly web application designed to predict the optimal number of charging stations needed for electric vehicles in a given area. By inputting relevant variables such as the type of stations, area of the region, and quantity of electric vehicles registered, users can obtain valuable insights into the infrastructure requirements for electric vehicle charging. The application leverages advanced machine learning techniques, including lasso regression, to provide accurate predictions tailored to specific user inputs. To experience the application firsthand, you can try out our demo website.

EV Predictions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages