Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to...

21
#PIWorld ©2020 OSIsoft, LLC #PIWorld ©2020 OSIsoft, LLC Analyzing PI Data with Python using Jupyter Notebook Presented By: Malvika Singh 1

Transcript of Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to...

Page 1: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC#PIWorld ©2020 OSIsoft, LLC

Analyzing PI Data with Python using Jupyter Notebook

Presented By: Malvika Singh 

1

Page 2: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Disclaimer

What this talk is

• It's for• People interested in data science• People with development skills• People who want to solve problems adhoc

• It's an example of reducing the cost of curiosity

What it isn't

• It is not a "how‐to" for data science.

• It is not an extensive deep dive into PI Web API

• Example shown is not a product, just an example!

2

Page 3: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Agenda

• Problem Statement• Overview of tools (Jupyter Notebook)• PI Web API and PI Web API GitHub samples• How to use the GitHub sample?

3

Page 4: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Problem Statement

4

Time

Unit Startup

Setpoint Reached

Occupancy Start

7 AM

Cooling Duration Wasted Energy

Page 5: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Objective

To predict time taken to reach the setpoint for various cooling units in the building so that energy usage is optimized and costs are reduced.

5

Page 6: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Our Model

6

EventFrame Attributes (Predictors)

Predictive Model

Duration(Target Variable)

Page 7: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

How are we going to use the model?

7

EventFrame Attributes (Predictors)

Predictive Model

Element Attributes(Real time predictors)

Phase 1

Phase 2

Accuracy

Predictions

Page 8: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Jupyter Notebooks – The what

• Stands for Julia, Python and R• Open Source web‐based interactive environment built upon IPythonkernel

• OSIsoft doesn’t own or support Jupyter Notebooks• Project Jupyter

8

Page 9: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Jupyter Notebooks – The why

• Jupyter is free and backed by a large open source community• Coding Environments can be intimidating

• vim, IDE, REPL …. what do all these acronyms mean?

• Runs in your browser• Shows the output right in the same document • Everything lives in memory ( can share results between code blocks)

9

Page 10: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

PI Web API and PI Web API code samples

• The PI Web API is a RESTful and secure interface to the PI System.• Gives client applications Read and Write access to their AF and PI data over HTTPS.

• PI Web API code samples are now live on GitHub in 5 languages!!• PI Web API samples

10

Page 11: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Why PI Web API ?

• The PI Web API is secure.• It is fast and data is just an HTTP call away!• Provides ingress and egress.

Alternative Offerings from OSIsoft which egress data: PI Integrators, OCS DataViews, AFSDK, and PI SQL Data Access Server

11

Page 12: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

The “Science” in Data Science

• As Setpoint Offset at VAV start and % Cooling at VAV start have a linear relationship with the target variable Event Frame Duration , we have chosen a linear regression model for predictive purposes.

• Trying to predict specific values ? ‐> Regression Models• Trying to predict a category ? ‐> Classification Models

12

Page 13: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Evaluating the “Science” in Data Science

• Dataset is split into two parts: Training and Test data.• Model is trained with Training Data first.• Test Data is used to evaluate the accuracy of the model.

13

Page 14: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Using the “Science” in Data Science in Real World

• Predicted Cooling Time can be saved as an attribute of the cooling unit element in the PI system!

• Each cooling unit element’s Predicted Cooling Time attribute will change in real‐time according to the model’s results.

• How to update Predicted Cooling Time in a secure, reliable manner?

14

Page 15: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Data Ingress Using PI Web API

PI Web API can be used to securely ingress data into the PI system.It is a RESTful, performant and secure way to push data into the PI System.

15

Page 16: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

DEMOHow to use the GitHub sample?

16

Page 17: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

CHALLENGES SOLUTION BENEFITS

As per our calculations, we can theoretically save 5000 hours of operation per year using this exercise. This shows that a low accuracy model can also provide tremendous value to an organization if the predictors 

accurately align with the problem.

Saving Energy

Energy efficiency of a building is compromised when cooling units are running to keep the temp at setpoint even when building is unoccupied.

Use data analysis and predictive models to predict how much time will be taken to reach the setpoint so the units are started as close to 7AM as possible.

Building Management uses data to influence decisions.

Energy is saved resulting in reduced costs for building management.

17

Page 18: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

How to get started?

• PI Web API Code Samples• Getting started with Jupyter Notebook• How to prepare data and create models ‐ Microsoft

18

Page 19: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Speaker

• Malvika Singh• Software Developer II• OSIsoft• [email protected]

19

Page 20: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC 10

Page 21: Analyzing PI Data with Python using JupyterNotebook...Use data analysis and predictive models to predict how much time will be taken to reach the setpointso ... Microsoft PowerPoint

#PIWorld ©2020 OSIsoft, LLC

Questions?

Please wait for the microphone

State your name & company

Please remember to…

Complete Survey!Navigate to this session in mobile agenda for survey

DOWNLOAD THE MOBILE APP

21