In this workshop you will learn how to create a predictive machine learning model through the Azure Machine Learning designer. You will be able to forecast the production of solar energy in a panel, based on climatic data and with it start on your way to a more sustainable life.
Project Goal | Learn about Machine Learning model and how to train and deploy a predictive model |
---|---|
What will you learn | Identify use cases for predictive models linked to sustainability.The use of technology in promoting environmental sustainability. |
What you'll need | Internet Connection, an Azure account,ability to navigate the Azure portal,basic concepts of Python and Pandas |
Duration | 1-1.5 hours |
Just want to try the app or see the solution? | Reference Notebook |
Slides | Powerpoint |
- Get started with AI on Azure.
- Azure Machine Learning designer.
- Use automated machine learning in Azure Machine Learning.
- The Principles of Sustainable Software Engineering.
Acknowledgements:
- Credits to Hugo Ferreira's article on renewable energy prediction in Germany, which is the basis for this workshop: Blog: https://medium.com/hugo-ferreiras-blog/predicting-wind-and-solar-generation-from-weather-data-using-machine-learning-998d7db8415e; Code: https://nbviewer.org/github/hugorcf/Renewable-energy-weather/blob/master/renewable.ipynb
-
Students will be skilled at: Get an introduction to machine learning Use the automated machine learning capability of Azure Machine Learning to train and deploy a predictive model.
-
Students will be able to independently use their learning to: Identify use cases for predictive models linked to sustainability.
-
Students will undersand the concepts of : The use of technology in promoting environmental sustainability.
🎥 Click this image to watch EcoWatch team walk you through the workshop.
-
Manipulate and Clean Data on Python workshop by Ornella
-
An active Azure subscription
-
Basic knowledge of Python.
Machine learning is the foundation of most AI solutions, using math and statistics to build predictive models for unknown values.
Machines learn from data, every day we create a large amount of information that can be collected and used by data scientists to train a machine learning model and create predictions and inferences based on the relationships found in the information.
🎥 Click this image to watch several examples of how a machine learning model works.
The Regression is a form of machine learning that is used to predict a numeric label based on an item's features, in which you train a model using data that includes both the features and known values for the label, so that the model learns to fit the feature combinations to the label. Then, after training has been completed, you can use the trained model to predict labels for new items for which the label is unknown.
🔎 Click this image, to learn more about regression models in machine learning,
Among the great challenges we have today is the fact of promoting sustainability within our lives to face problems such as climate change and carbon emissions.
In an effort to generate change, we have made this workshop so that you can see how feasible it is to use solar panels in a region based on information from a region and thus have an energy generation without emissions that is more friendly to the environment.
You can also be an agent of change within your projects by taking into account the eight principles of sustainable software engineering.
Next, you will integrate machine learning with sustainability by predicting the renewable energy output with weather and renewables data from Germany -- you can imagine how this is relevant for an energy grid planner managing energy production in a country.
Note: To directly download the cleaned datasets (joined from the weather and time series data), see here
Otherwise, to perform the data cleaning from scratch, download the two datasets that will be used in this dataset
(1) Time series wind and solar production in hourly resolution in 2016 (can be downloaded in our GitHub folder, or directly from the source, click the picture:
(2) Weather data in Germany in 2016, can be downloaded in our OneDrive link, or directly from the source, following from the procedures in this picture (click the picture to be redirected)
Again, to directly download the cleaned and combined datasets (joined from the weather and time series data), see here
------If you've downloaded the weather and time series datasets separately ---------- We will explore the dataframes, create new columns with groupby, visualize relationships between variables, work with missing data and combine two datasets into one dataset to be fed to our machine learning model
production = pd.read_csv("time_series_60min_singleindex_filtered.csv", usecols=(lambda s: s.startswith('utc') | s.startswith('DE')),parse_dates=[0], index_col=0)
Importing the data:
weather = pd.read_csv("weather_data_result_GER_2016.csv",
parse_dates=[0], index_col=0)
# merge production_wind_solar and weather_by_day DataFrames
combined = pd.merge(production_wind_solar, weather_by_day, how='left', left_index=True, right_index=True)
# drop redundant 'T (C)' column
combined = combined.drop('T (C)', axis=1)
With the combined dataset, we can build our model predicting solar and wind energy output with the low-code machine learning platform AZ ML Designer. We will select specific columns for model training for the wind and solar energy prediction respectively. Data wil be normalized with min-max normalization, split to training and test sets, so as to prepare for model training on our linear regression model.
Model evaluation is as simple as dragging the scoring and evaluation nodes to the ML Designer. Wohoo, even without complex deep learning models, our linear regression model scored well with a 0.88 and 0.95 R squared on the wind and solar energy datasets respectively! Not bad for such a simple model!
We will submit our training pipeline for deployment, then test the model with sample inputted data from 2017. With Azure, we are able to process, train and deploy in the cloud easily and integrate our prediction results with external platforms.
Next, we will provide you with some sample data to test the predictions in your model after its deployment.
That's it! With Azure, we can link our real time prediction with a centralized energy production system in an electricity grid dynamically adjust energy production, hence reduce energy and carbon wastage, advancing sustainability from its roots!
You have come a long way in your learning journey, it's time to put your knowledge to test and prove that you have learnt it right. Attempt a quick quiz on Kahoot here.
Now that you have learned a little more about the use of machine learning and how it can help us achieve a more sustainable life, use this workshop to teach your friends or colleagues to raise awareness about the use of renewable energy with this slides.
Be sure to give feedback about this workshop!