Simplified Machine-Learning Workflow #3
Author
Anton Antonov
Title
Simplified Machine-Learning Workflow #3
Description
Quantile Regression (Part 3)
Category
Educational Materials
Keywords
URL
http://www.notebookarchive.org/2020-09-55rsljc/
DOI
https://notebookarchive.org/2020-09-55rsljc
Date Added
2020-09-11
Date Last Modified
2020-09-11
File Size
10.2 megabytes
Supplements
Rights
Redistribution rights reserved



QRMon live coding 3rd session
QRMon live coding 3rd session
Anton Antonov
MathematicaForPrediction at GitHub
MathematicaForPrediction at WordPress
September 2019
MathematicaForPrediction at GitHub
MathematicaForPrediction at WordPress
September 2019
What are we going to talk about?
What are we going to talk about?
1
.First, we are going to demonstrate and explain how to do QR-based time series simulations and their applications in Operations Research.
2
.Next, we are going to discuss QR in 2D and 3D and a few related applications.
3
.Last, we are going to look into QR workflows code generation from a series of natural language commands.
Definitions
Definitions
1. NREL data
1. NREL data
The time series
The time series
In[]:=
aNRELDataDaily
Out[]=
Outside.Wet-Bulb.Temp.(F)TimeSeries
,Outside.Dry-Bulb.Temp.(F)TimeSeries
,Total.Space.Cooling-KwhTimeSeries
,Heating-kWhTimeSeries
,Lighting.End-Use.Energy-KwhTimeSeries
,Task.Lighting.End-Use.Energy-KwhTimeSeries
,Fans.End-Use.Energy-KwhTimeSeries
,Miscellaneous.Equipment.End-Use.Energy-KwhTimeSeries
,Pumps.End-Use.Energy-KwhTimeSeries
|
|
|
|
|
|
|
|
|
Plots
Plots
Make the plots.
In[]:=
AbsoluteTiming[grs=KeyValueMap[Function[{k,v},DateListPlot[v,PlotLabelk,PlotRangeAll,AspectRatio1/3,PlotTheme"Detailed",ImageSize550]],aNRELDataDaily];]
Out[]=
{0.379112,Null}
In[]:=
Multicolumn[grs,2]
Out[]=
1. QRMon objects
1. QRMon objects
In[]:=
AbsoluteTiming[aQRObjs=Map[QRMonUnit[#]⟹QRMonQuantileRegression[90,Join[Range[0.1,.9,0.1],{0.01,0.99}],Method{LinearProgramming,Method"InteriorPoint",Tolerance10^(-2)}]⟹QRMonDateListPlot[ImageSizeLarge,AspectRatio1/4]&,Take[aNRELDataDaily,4]];]
»
Plot:
|
»
Plot:
|
»
Plot:
|
»
Plot:
|
Out[]=
{7.13112,Null}
In[]:=
aQRObjs〚1〛⟹QRMonEchoDataSummary;
»
Data summary:
,
1 column 1 | ||||||||||||
|
2 column 2 | ||||||||||||
|
In[]:=
aQRObjs〚1〛⟹QRMonConditionalCDF[{3.7711*10^9}]⟹QRMonConditionalCDFPlot[];
»
Conditional CDF:3.7711×
9
10
Note that the CDF is not strictly increasing. This means that: (1) we have over-trained with QR, and/or (2) we should redo QR with less knots and/or lower interpolation order. Also, (3) just do proceed and do the simulations below.
1. Simulations of the time series
1. Simulations of the time series
1. “Paired” simulations
1. “Paired” simulations
1. Alternative filtering of Cartesian product outliers
1. Alternative filtering of Cartesian product outliers
2. Create 2D and 3D data
2. Create 2D and 3D data
2. Quantile regression 2D
2. Quantile regression 2D
2. Quantile Regression in 3D
2. Quantile Regression in 3D
In[]:=
data=aData3D〚1〛;
In[]:=
bregion=BoundaryDiscretizeRegion[QuantileEnvelopeRegion[data,0.97,10]]
Out[]=
In[]:=
Block[{c=5},pntsgr=Graphics3D[Point[data]];Show[{bregion,pntsgr},PlotRange{{-c,c},{0,c},{-c,c}},Boxed->True,Axes->True]]
Out[]=
2. Finding outliers in 3D and 2D data
2. Finding outliers in 3D and 2D data
References
References
[1] Anton Antonov, "A monad for Quantile Regression workflows", (2018), MathematicaForPrediction at WordPress.
[2] Anton Antonov, "Finding outliers in 2D and 3D numerical data", (2019), MathematicaForPrediction at WordPress.


Cite this as: Anton Antonov, "Simplified Machine-Learning Workflow #3" from the Notebook Archive (2020), https://notebookarchive.org/2020-09-55rsljc

Download

