Using Linear Regression and Web Scraping techniques, created model that predicts monthly electricity usage in the State of Louisiana
Utilized web scraping (Selenium and BeautifulSoup) to gather data from dynamically generated web pages. Implemented various modeling techniques such as feature engineering, autoregression, and lasso regularization. Final model predicting monthly electricity usage in the State of Louisiana performed with an r-squared of 90 percent and a mean absolute error of 243 MWh.
Target Variable: Electricity Sales
Features:
- Sales - Same Month, Prior Year
- Number of Customer Accounts
- Number of New Construction Permits
- Average Humidity Percentange
- Average Wind Speed
- Average Temperature (absolute deviation from 65 degrees)
- Average Heating/Cooling Degree Day
- Personal Income
- Real GDP
- Consumer Spending
- Population
- Population per account
- Humidity*Wind
- Humidity*Temp
- Wind*Temp
U.S. Energy Information Administration: https://www.eia.gov/
WeatherUnderground: https://www.wunderground.com/
Population: https://www.macrotrends.net/states/louisiana/population
Construction Permits: https://www.census.gov/construction/bps/statemonthly.html
U.S. Department of Commerce - Bureau of Economic Analysis: https://www.bea.gov/
- Python
- Pandas
- NumPy
- matplotlip
- seaborn
- Selenium
- BeautifulSoup
- scikit-learn
- urllib3
Data Gathering
- Scrape historical weather data - weather_scrape.ipynb
- Average weather info - weather.ipynb
- Scrape population data - population.ipynb
- Import economic data - economic_data.ipynb
- Import building permit data - building_permits.ipynb
- Import EIA (electricity) data - EIA.ipynb
Merging Data
- Merge data into one dataframe - merge_eda.ipynb
Feature Engineering
- Perform feature engineering - feature_engineering.ipynb
Linear Regression
- Linear Regression: All Features - linear_regression_all_features.ipynb
- Linear Regression: Selected Features - linear_regression_selected_features.ipynb
- Polynomial Regression: All Features - poly_regression_all_features.ipynb
- Polynomial Regression: Selected Features - poly_regression_selected_features.ipynb