Examples

Importing libraries


In [1]:
from ceo import data_cleaning
from ceo import missing_data
from ceo import svr_prediction
from ceo import ridge_prediction

datacleaning

  • The datacleaning module is used to clean and organize the data into 51 CSV files corresponding to the 50 states of the US and the District of Columbia.
  • The wrapping function clean_all_data takes all the data sets as input and sorts the data in to CSV files of the states.
  • The CSVs are stored in the Cleaned Data directory which is under the Data directory.

In [2]:
data_cleaning.clean_all_data()

missing_data

  • The missing_data module is used to estimate the missing data of the GDP (from 1960 - 1962) and determine the values of the predictors (from 2016-2020).
  • The wrapping function predict_all takes the CSV files of the states as input and stores the predicted missing values in the same CSV files.
  • The CSVs generated replace the previous CSV files in the Cleaned Data directory which is under the Data directory.

In [3]:
missing_data.predict_all()

ridge_prediction

  • The ridge_prediction module is used to predict the future values of energies like wind energy, solar energy, hydro energy and nuclear energy from 2016-2020 using ridge regression.
  • The wrapping function ridge_predict_all takes the CSV files of the states as input and stores the future values of the energies in another CSV file under Ridge Regression folder under the Predicted Data directory.

In [4]:
ridge_prediction.ridge_predict_all()

svr_prediction

  • The svr_prediction module is used to predict the future values of energies like wind energy, solar energy, hydro energy and nuclear energy from 2016-2020 using Support Vector Regression
  • The wrapping function SVR_predict_all takes the CSV files of the states as input and stores the future values of the energies in another CSV file under SVR folder under the Predicted Data directory.

In [5]:
svr_prediction.SVR_predict_all()

plots

Visualizations is done using Tableau software. The Tableau workbook for the predicted data is included in the repository. The Tableau dashboard created for this data is illustrated below:


In [5]:
%%HTML

<div class='tableauPlaceholder' id='viz1489609724011' style='position: relative'><noscript><a href='#'><img alt='Clean Energy Production in the contiguous United States(in million kWh) ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;PB&#47;PB87S38NW&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='path' value='shared&#47;PB87S38NW' /> <param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;PB&#47;PB87S38NW&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1489609724011');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='1004px';vizElement.style.height='869px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>