Quantcast
Channel: R-bloggers
Viewing all 12110 articles
Browse latest View live

How to reorder arrange bars with in each Facet of ggplot

$
0
0

[This article was first published on r-bloggers on Programming with R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

One of the problems that we usually face with ggplot is that rearranging the bars in ascending or descending order. If that problem is solved using reorder() or fct_reorder(), the next problem is when we have facets and ordering bars within each facet.

Recently I came acrosss this function reorder_within() from the package tidytext (Thanks to Julia Silge and Tyler Rinker – who created this solution originally)

Example Code:

library(tidyr)library(ggplot2)iris_gathered <- gather(iris, metric, value, -Species)ggplot(iris_gathered, aes(reorder(Species, value), value)) +  geom_bar(stat = 'identity') +  facet_wrap(~ metric)

As you can see above, the bars in the last facet isn’t ordered properly. This is a problem you wouldn’t forget had you plotted TF_IDF or something similar with facets.

Here’s the solution

library(tidytext)# reorder_within and scale_x_reordered work.# (Note that you need to set scales = "free_x" in the facet)ggplot(iris_gathered, aes(reorder_within(Species, value, metric), value)) +   geom_bar(stat = 'identity') +  #scale_x_reordered() +  facet_wrap(~ metric, scales = "free_x")

Now, that’s beautifully done with a change in function.

If you’re intereted more in Data Visualziation, Here’sDatacamp Paid Course with 75% Annual Offer

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: r-bloggers on Programming with R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.


Gold-Mining Week 14 (2019)

$
0
0

[This article was first published on R – Fantasy Football Analytics, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

</p> <p>Week 14 Gold Mining and Fantasy Football Projection Roundup now available.</p> <p>

The post Gold-Mining Week 14 (2019) appeared first on Fantasy Football Analytics.

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) { var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; s.src = '//cdn.viglink.com/api/vglnk.js'; var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R – Fantasy Football Analytics.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

parcats 0.0.1 released

$
0
0

[This article was first published on R on datistics, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

parcats was released on CRAN. It is an htmlwidget providing bindings to the plotly.js parcats trace, which is not supported by the plotly R package. Also adds marginal histograms for numerical variables.

demogif

demogif

What it can do

I wanted to add interactivity to easyalluvial plots for a while now and found that the parcats trace of plotly.js would be perfect because brushing with the mouse highlights the entire flow and not just everything flowing in and out of a specific node as in most D3 Sankey chart implementations. Unfortunately the parcats trace was not available in the plotly R package so I decided to build a new html widget to create R bindings for specifically this trace.

  • converts any easyalluvial plot to an interactive parallel categories diagram
  • interactive marginal histograms
  • multidimensional partial dependency and model response plots

easyalluvial

parcats requires an alluvial plot created with easyalluvial to create an interactive parrallel categories diagram.

Demo

Examples

suppressPackageStartupMessages( require(tidyverse) )suppressPackageStartupMessages( require(easyalluvial) )suppressPackageStartupMessages( require(parcats) )

Parcats from alluvial from data in wide format

p = alluvial_wide(mtcars2, max_variables = 5)parcats(p, marginal_histograms = TRUE, data_input = mtcars2)

{"x":{"traces":{"parcats":{"type":"parcats","dimensions":[{"label":"mpg","values":["HH","HH","HH","LL","LL","M","M","M","M","M","M","M","MH","MH","MH","MH","MH","ML","ML","ML","ML","ML","ML","ML"],"categoryorder":"array","categoryarray":["HH","MH","M","ML","LL"]},{"label":"cyl","values":["4","4","4","8","8","6","6","6","6","8","8","8","4","4","4","4","6","8","8","8","8","8","8","8"],"categoryorder":"array","categoryarray":["8","6","4"]},{"label":"disp","values":["LL","LL","LL","HH","MH","M","ML","ML","ML","HH","MH","MH","LL","LL","ML","ML","M","HH","MH","MH","MH","MH","MH","MH"],"categoryorder":"array","categoryarray":["HH","MH","M","ML","LL"]},{"label":"hp","values":["LL","LL","ML","MH","HH","ML","M","MH","ML","MH","MH","MH","ML","ML","LL","ML","ML","MH","HH","HH","HH","M","M","MH"],"categoryorder":"array","categoryarray":["HH","MH","M","ML","LL"]},{"label":"drat","values":["HH","MH","M","LL","M","LL","M","M","M","LL","LL","ML","M","MH","M","M","LL","ML","M","MH","ML","LL","ML","LL"],"categoryorder":"array","categoryarray":["HH","MH","M","ML","LL"]}],"counts":[1,3,1,2,1,1,2,1,2,1,1,1,2,2,1,1,1,1,1,1,1,1,1,2],"line":{"shape":"hspline","color":["#710500","#710500","#710500","#FF0065","#FF0065","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#009850","#009850","#009850","#009850","#009850","#009850","#009850"]},"hoveron":"color","hoverinfo":"count+probability","labelfont":{"size":24,"color":"black"},"arrangement":"perpendicular","bundlecolors":true,"sortpaths":"forward","tickfont":null,"domain":{"y":[0,0.7]}},"mpg_LL":{"x":[2.96996268656716,3.04503132575868,3.1200999649502,3.19516860414172,3.27023724333324,3.34530588252475,3.42037452171627,3.49544316090779,3.57051180009931,3.64558043929083,3.72064907848234,3.79571771767386,3.87078635686538,3.9458549960569,4.02092363524842,4.09599227443993,4.17106091363145,4.24612955282297,4.32119819201449,4.396266831206,4.47133547039752,4.54640410958904,4.62147274878056,4.69654138797208,4.77161002716359,4.84667866635511,4.92174730554663,4.99681594473815,5.07188458392967,5.14695322312118,5.2220218623127,5.29709050150422,5.37215914069574,5.44722777988726,5.52229641907877,5.59736505827029,5.67243369746181,5.74750233665333,5.82257097584485,5.89763961503636,5.97270825422788,6.0477768934194,6.12284553261092,6.19791417180244,6.27298281099395,6.34805145018547,6.42312008937699,6.49818872856851,6.57325736776003,6.64832600695154,6.72339464614306,6.79846328533458,6.8735319245261,6.94860056371762,7.02366920290913,7.09873784210065,7.17380648129217,7.24887512048369,7.3239437596752,7.39901239886672,7.47408103805824,7.54914967724976,7.62421831644128,7.69928695563279,7.77435559482431,7.84942423401583,7.92449287320735,7.99956151239887,8.07463015159038,8.1496987907819,8.22476742997342,8.29983606916494,8.37490470835646,8.44997334754797,8.52504198673949,8.60011062593101,8.67517926512253,8.75024790431405,8.82531654350556,8.90038518269708,8.9754538218886,9.05052246108012,9.12559110027163,9.20065973946315,9.27572837865467,9.35079701784619,9.42586565703771,9.50093429622923,9.57600293542074,9.65107157461226,9.72614021380378,9.8012088529953,9.87627749218682,9.95134613137833,10.0264147705699,10.1014834097614,10.1765520489529,10.2516206881444,10.3266893273359,10.4017579665274,10.476826605719,10.5518952449105,10.626963884102,10.7020325232935,10.777101162485,10.8521698016765,10.9272384408681,11.0023070800596,11.0773757192511,11.1524443584426,11.2275129976341,11.3025816368257,11.3776502760172,11.4527189152087,11.5277875544002,11.6028561935917,11.6779248327832,11.7529934719748,11.8280621111663,11.9031307503578,11.9781993895493,12.0532680287408,12.1283366679324,12.2034053071239,12.2784739463154,12.3535425855069,12.4286112246984,12.5036798638899,12.5787485030815,12.653817142273,12.7288857814645,12.803954420656,12.8790230598475,12.9540916990391,13.0291603382306,13.1042289774221,13.1792976166136,13.2543662558051,13.3294348949966,13.4045035341882,13.4795721733797,13.5546408125712,13.6297094517627,13.7047780909542,13.7798467301457],"y":[0.000114229889951921,0.000125273732728626,0.000137050151569662,0.000149514448557863,0.00016354870709374,0.000178420867698831,0.000194189645158508,0.000211800991279836,0.000230417785779495,0.000250186134516728,0.000272091353413307,0.000295190853282919,0.000319748138090847,0.000346753678164109,0.000375163278516301,0.000405392353352029,0.00043839191630835,0.000473025083171863,0.000509897608297058,0.000549865884799235,0.000591714932801751,0.000636282193585793,0.000684264269333185,0.000734388731231368,0.000787767533919764,0.000844863679659828,0.000904374032794608,0.000967727509301851,0.00103507332727552,0.00110511011541999,0.00117962360481525,0.00125836582832946,0.00134007455387214,0.00142692713169268,0.00151819575096023,0.0016126982973312,0.00171303097435456,0.00181790876909982,0.00192627252375892,0.00204115460244825,0.00216064557042484,0.00228385182340514,0.00241424734268498,0.00254924588638339,0.00268815944027951,0.00283489601020689,0.0029861590398113,0.00314150124168559,0.00330524381785147,0.00347336810328754,0.00364580684975305,0.00382692787661865,0.00401233499398705,0.00420243406989608,0.00440104244661222,0.00460397348017972,0.00481193213809768,0.00502813429726787,0.00524865605531255,0.00547449396545618,0.00570823503504366,0.00594625891078352,0.00618984036323931,0.0064409330600869,0.00669624683271584,0.00695731896374736,0.00722548499335452,0.0074977968566662,0.00777604073693687,0.0080609631184595,0.0083499561064188,0.00864504824106555,0.00894643182590742,0.00925182565737347,0.00956350616164292,0.00988114251064116,0.0102027587968439,0.0105309013458707,0.0108647331794483,0.0112025590342439,0.011547236767962,0.0118974165128855,0.0122516609834645,0.0126132019991806,0.012980138623248,0.0133512761133107,0.0137303021027543,0.0141146905339388,0.0145034855963567,0.0149009276537631,0.0153037556724812,0.0157112642465902,0.0161283509199834,0.0165508795035261,0.0169784228663741,0.0174166371255152,0.0178603517797577,0.0183097457170008,0.0187704650058753,0.0192369975629635,0.0197100471319284,0.0201948572574038,0.0206858798277631,0.0211843072095414,0.0216948285594811,0.0222119236444772,0.0227373144896621,0.0232749660742645,0.0238194790893781,0.0243731204029669,0.0249389641095947,0.0255118465438023,0.0260945574178793,0.0266891403556056,0.0272907933140105,0.0279027597420157,0.0285259652044185,0.0291560939853421,0.0297967197565422,0.0304476376619687,0.0311051281846789,0.031772913735407,0.0324497409359108,0.0331325681935215,0.0338250282288393,0.0345250077956126,0.0352301850562352,0.0359438137775108,0.0366632203232897,0.0373867956064092,0.0381170855944091,0.0388512610006622,0.0395883645463794,0.0403298819396755,0.0410733226970109,0.0418182659125721,0.0425647807342156,0.0433112747038546,0.0440576976478669,0.044802364259259,0.0455451712759395,0.0462862140481823,0.0470218113915404,0.0477538790156692,0.0484821446565278],"fillcolor":"#FF0065","fill":"tozeroy","type":"scatter","line":{"color":"#FF0065"},"marker":{"size":0,"color":"#FF0065","opacity":0},"showlegend":false,"name":"LL","xaxis":"x1","yaxis":"y1"},"mpg_ML":{"x":[13.8549153693373,13.9299840085288,14.0050526477203,14.0801212869118,14.1551899261033,14.2302585652949,14.3053272044864,14.3803958436779,14.4554644828694,14.5305331220609,14.6056017612524,14.680670400444,14.7557390396355,14.830807678827,14.9058763180185,14.98094495721,15.0560135964016,15.1310822355931,15.2061508747846,15.2812195139761,15.3562881531676,15.4313567923591,15.5064254315507,15.5814940707422,15.6565627099337,15.7316313491252,15.8066999883167,15.8817686275083,15.9568372666998,16.0319059058913,16.1069745450828,16.1820431842743,16.2571118234658,16.3321804626574,16.4072491018489,16.4823177410404,16.5573863802319,16.6324550194234,16.7075236586149,16.7825922978065],"y":[0.0492015875490189,0.0499157906849128,0.0506239262649292,0.0513201951201251,0.0520095863574055,0.052690498275267,0.0533569422312706,0.0540149987916339,0.0546621137887025,0.0552926856883678,0.0559135388539339,0.0565210415399491,0.0571105049903819,0.0576891388589819,0.0582521716549459,0.0587962683880539,0.0593286766734319,0.059843490489783,0.0603390587366376,0.0608223509644597,0.0612863981530185,0.0617314358410082,0.0621638874833519,0.0625758523747786,0.0629695224225652,0.0633505670227897,0.0637103333927429,0.0640529119557001,0.0643830768624863,0.0646916356526201,0.0649844076024407,0.0652651983007734,0.0655245025638205,0.065769611533718,0.0660033525017636,0.0662161295920915,0.0664163923873938,0.0666060347353955,0.0667755680363576,0.0669342649578231],"fillcolor":"#009850","fill":"tozeroy","type":"scatter","line":{"color":"#009850"},"marker":{"size":0,"color":"#009850","opacity":0},"showlegend":false,"name":"ML","xaxis":"x1","yaxis":"y1"},"mpg_M":{"x":[16.857660936998,16.9327295761895,17.007798215381,17.0828668545725,17.1579354937641,17.2330041329556,17.3080727721471,17.3831414113386,17.4582100505301,17.5332786897216,17.6083473289132,17.6834159681047,17.7584846072962,17.8335532464877,17.9086218856792,17.9836905248708,18.0587591640623,18.1338278032538,18.2088964424453,18.2839650816368,18.3590337208283,18.4341023600199,18.5091709992114,18.5842396384029,18.6593082775944,18.7343769167859,18.8094455559775,18.884514195169,18.9595828343605,19.034651473552,19.1097201127435,19.184788751935,19.2598573911266,19.3349260303181,19.4099946695096,19.4850633087011,19.5601319478926,19.6352005870841,19.7102692262757,19.7853378654672,19.8604065046587,19.9354751438502,20.0105437830417,20.0856124222333,20.1606810614248,20.2357497006163,20.3108183398078,20.3858869789993,20.4609556181908,20.5360242573824,20.6110928965739,20.6861615357654,20.7612301749569,20.8362988141484,20.91136745334,20.9864360925315,21.061504731723,21.1365733709145],"y":[0.0670831726888495,0.0672130665374253,0.0673337201126039,0.0674451809291316,0.0675393895162468,0.0676255442685601,0.0677028563900642,0.0677651513573859,0.0678201666094758,0.0678667236707489,0.0679002024415557,0.067927068845819,0.0679458272511997,0.0679530984411411,0.0679542870907898,0.0679476158335419,0.0679306780801022,0.067908028835629,0.0678776037870206,0.0678377673350176,0.0677924205679144,0.0677391670424319,0.0676770203348596,0.0676093938007805,0.0675334784000283,0.0674488994872161,0.0673587096352501,0.0672595797145926,0.0671517900375297,0.0670381148572513,0.0669145815719605,0.0667822376920479,0.0666436162842428,0.0664939751479885,0.0663352923518843,0.0661698548433573,0.065992036131299,0.0658049365767762,0.0656105568206685,0.0654022970043372,0.0651845742106906,0.0649590369370421,0.0647180616587152,0.0644675526862324,0.0642087263933387,0.0639329352676019,0.0636476918659782,0.0633536987604394,0.0630413425124595,0.062719792830209,0.0623886523029847,0.0620390086008308,0.0616801017122958,0.061310775372805,0.0609233799319284,0.0605267064243477,0.0601189704145019,0.0596939646610578],"fillcolor":"#A56F2B","fill":"tozeroy","type":"scatter","line":{"color":"#A56F2B"},"marker":{"size":0,"color":"#A56F2B","opacity":0},"showlegend":false,"name":"M","xaxis":"x1","yaxis":"y1"},"mpg_MH":{"x":[21.211642010106,21.2867106492975,21.3617792884891,21.4368479276806,21.5119165668721,21.5869852060636,21.6620538452551,21.7371224844467,21.8121911236382,21.8872597628297,21.9623284020212,22.0373970412127,22.1124656804042,22.1875343195958,22.2626029587873,22.3376715979788,22.4127402371703,22.4878088763618,22.5628775155533,22.6379461547449,22.7130147939364,22.7880834331279,22.8631520723194,22.9382207115109,23.0132893507025,23.088357989894,23.1634266290855,23.238495268277,23.3135639074685,23.38863254666,23.4637011858516,23.5387698250431,23.6138384642346,23.6889071034261,23.7639757426176,23.8390443818092,23.9141130210007,23.9891816601922,24.0642502993837,24.1393189385752,24.2143875777667,24.2894562169583,24.3645248561498,24.4395934953413,24.5146621345328,24.5897307737243,24.6647994129159,24.7398680521074,24.8149366912989,24.8900053304904,24.9650739696819,25.0401426088734,25.115211248065,25.1902798872565,25.265348526448,25.3404171656395,25.415485804831,25.4905544440225,25.5656230832141,25.6406917224056,25.7157603615971,25.7908290007886,25.8658976399801,25.9409662791717,26.0160349183632,26.0911035575547,26.1661721967462,26.2412408359377,26.3163094751292,26.3913781143208,26.4664467535123,26.5415153927038,26.6165840318953],"y":[0.059259847792459,0.0588142712837906,0.0583525776493199,0.0578821310903507,0.0574001269997778,0.0569034791960782,0.0563986290457527,0.0558824653752783,0.0553534023360636,0.054816872881358,0.0542696447286468,0.053711469101004,0.0531467335908559,0.0525722979014553,0.0519890017249994,0.0514002011598197,0.0508030781982394,0.0501992400197976,0.0495910745237401,0.0489763217189034,0.0483569807626469,0.047734579415901,0.0471076445821018,0.0464781586448889,0.0458469346254187,0.0452134964837047,0.0445793908845901,0.0439448893387,0.0433106937006642,0.0426775088365751,0.042045255025224,0.0414159549184166,0.0407890997477807,0.0401644546896987,0.039545462105019,0.0389300802121295,0.0383181593967295,0.037714466155406,0.0371153199871162,0.0365210945965443,0.0359369533632597,0.0353583308523981,0.0347860935385033,0.0342253842147137,0.0336710304119423,0.0331244868555602,0.0325905108764094,0.0320635855212454,0.031545816877892,0.0310412744525422,0.0305443347493063,0.030057787047044,0.0295847780056226,0.0291197843524882,0.028666281873045,0.0282263268466158,0.0277946680039127,0.0273754463619757,0.0269695240219589,0.0265720572854393,0.0261878110245049,0.0258164064978562,0.0254535079204524,0.025104447020359,0.0247676064064712,0.0244392260110327,0.0241251357643548,0.0238225219036058,0.0235282391366668,0.0232485383683775,0.0229794836107023,0.0227185589572238,0.0224723524655867],"fillcolor":"#005EAA","fill":"tozeroy","type":"scatter","line":{"color":"#005EAA"},"marker":{"size":0,"color":"#005EAA","opacity":0},"showlegend":false,"name":"MH","xaxis":"x1","yaxis":"y1"},"mpg_HH":{"x":[26.6916526710868,26.7667213102784,26.8417899494699,26.9168585886614,26.9919272278529,27.0669958670444,27.1420645062359,27.2171331454275,27.292201784619,27.3672704238105,27.442339063002,27.5174077021935,27.5924763413851,27.6675449805766,27.7426136197681,27.8176822589596,27.8927508981511,27.9678195373426,28.0428881765342,28.1179568157257,28.1930254549172,28.2680940941087,28.3431627333002,28.4182313724917,28.4933000116833,28.5683686508748,28.6434372900663,28.7185059292578,28.7935745684493,28.8686432076409,28.9437118468324,29.0187804860239,29.0938491252154,29.1689177644069,29.2439864035984,29.31905504279,29.3941236819815,29.469192321173,29.5442609603645,29.619329599556,29.6943982387476,29.7694668779391,29.8445355171306,29.9196041563221,29.9946727955136,30.0697414347051,30.1448100738967,30.2198787130882,30.2949473522797,30.3700159914712,30.4450846306627,30.5201532698543,30.5952219090458,30.6702905482373,30.7453591874288,30.8204278266203,30.8954964658118,30.9705651050034,31.0456337441949,31.1207023833864,31.1957710225779,31.2708396617694,31.345908300961,31.4209769401525,31.496045579344,31.5711142185355,31.646182857727,31.7212514969185,31.7963201361101,31.8713887753016,31.9464574144931,32.0215260536846,32.0965946928761,32.1716633320676,32.2467319712592,32.3218006104507,32.3968692496422,32.4719378888337,32.5470065280252,32.6220751672167,32.6971438064083,32.7722124455998,32.8472810847913,32.9223497239828,32.9974183631743,33.0724870023659,33.1475556415574,33.2226242807489,33.2976929199404,33.3727615591319,33.4478301983235,33.522898837515,33.5979674767065,33.673036115898,33.7481047550895,33.823173394281,33.8982420334726,33.9733106726641,34.0483793118556,34.1234479510471,34.1985165902386,34.2735852294301,34.3486538686217,34.4237225078132,34.4987911470047,34.5738597861962,34.6489284253877,34.7239970645793,34.7990657037708,34.8741343429623,34.9492029821538,35.0242716213453,35.0993402605368,35.1744088997284,35.2494775389199,35.3245461781114,35.3996148173029,35.4746834564944,35.549752095686,35.6248207348775,35.699889374069,35.7749580132605,35.850026652452,35.9250952916435,36.0001639308351,36.0752325700266,36.1503012092181,36.2253698484096,36.3004384876011,36.3755071267926,36.4505757659842,36.5256444051757,36.6007130443672,36.6757816835587,36.7508503227502,36.8259189619418,36.9009876011333,36.9760562403248,37.0511248795163,37.1261935187078,37.2012621578994,37.2763307970909,37.3513994362824,37.4264680754739,37.5015367146654,37.5766053538569,37.6516739930485,37.72674263224,37.8018112714315,37.876879910623,37.9519485498145,38.027017189006,38.1020858281976,38.1771544673891,38.2522231065806,38.3272917457721,38.4023603849636,38.4774290241552,38.5524976633467,38.6275663025382,38.7026349417297,38.7777035809212,38.8527722201127,38.9278408593043,39.0029094984958,39.0779781376873,39.1530467768788,39.2281154160703,39.3031840552619,39.3782526944534,39.4533213336449,39.5283899728364,39.6034586120279,39.6785272512194,39.753595890411,39.8286645296025,39.903733168794,39.9788018079855,40.053870447177,40.1289390863685,40.2040077255601,40.2790763647516,40.3541450039431,40.4292136431346,40.5042822823261,40.5793509215177,40.6544195607092,40.7294881999007,40.8045568390922,40.8796254782837,40.9546941174752,41.0297627566668,41.1048313958583,41.1799000350498,41.2549686742413,41.3300373134328],"y":[0.0222359050903225,0.0220073247261404,0.0217934470120905,0.0215884090640308,0.0213909205690378,0.0212079692739273,0.0210329247967187,0.020865063177382,0.0207114220325011,0.0205647558862172,0.0204251007903076,0.020298712723945,0.0201786212615207,0.0200654784143913,0.0199641794396866,0.0198686751947915,0.0197799377776933,0.0197016011868594,0.0196285143249308,0.0195618838759074,0.0195042013494479,0.0194511809141234,0.0194041691260234,0.0193646538117595,0.01932917175265,0.0192991062342418,0.0192751007142036,0.0192544613318477,0.019238498082011,0.0192271894132118,0.0192185462539002,0.0192136908392892,0.0192121341003209,0.0192125155494985,0.0192156540395949,0.0192208049472464,0.0192271488909842,0.0192350885946818,0.0192438448631322,0.0192530419023504,0.019262560971588,0.0192718112574272,0.0192807551535821,0.0192886592662957,0.0192953378498803,0.0193009812245984,0.0193041649059721,0.0193053097587176,0.0193047226142344,0.0193002323501242,0.0192930439601489,0.0192834723593199,0.019268568517333,0.0192504667992848,0.0192293890452671,0.0192016037364312,0.019170280518466,0.0191352281816972,0.0190926467342532,0.0190461116592218,0.0189950953848759,0.0189360173935566,0.018872635541656,0.0188040718489362,0.0187271525737499,0.0186456726523495,0.0185583885801243,0.0184626819984024,0.0183622544938361,0.0182555037923272,0.0181404729001704,0.018020658095215,0.017894126427459,0.0177596436269259,0.0176204098177031,0.0174742094727197,0.0173205476462964,0.0171622602198725,0.016996915169023,0.0168247302835838,0.0166481325351633,0.0164645548669329,0.0162748610848089,0.0160810477685971,0.0158805066292131,0.0156746449514097,0.015465029591231,0.0152491137657672,0.0150287152174851,0.0148049921788406,0.0145755674031001,0.0143425117236918,0.0141066139974137,0.0138657760289471,0.0136221467751269,0.0133762003712007,0.0131262247974533,0.0128742617322952,0.0126205375516341,0.0123638272945128,0.0121058769293974,0.011846725517612,0.0115857724810267,0.0113242376672141,0.0110620768721777,0.0107993696564901,0.0105366591816821,0.0102739744907838,0.0100118944893552,0.00975037370864591,0.00948959081453261,0.00923043939368806,0.00897238299450101,0.00871581806430377,0.00846177172974433,0.00820931977552797,0.00795913366641453,0.00771220340271279,0.00746732180057261,0.00722547948185629,0.00698747537078351,0.00675192184869771,0.00652015819970899,0.00629266031015632,0.00606795686162937,0.00584774984356118,0.00563208620357928,0.00541949876135071,0.0052120507134402,0.00500928292989102,0.00480980877368389,0.00461603627213574,0.00442695306964015,0.00424131617124104,0.00406184853398545,0.00388696716212249,0.00371562134508756,0.0035508074929813,0.00339038262240756,0.00323352208714428,0.00308344511102575,0.00293748452954117,0.00279506099149529,0.00265955945207812,0.00252784560310971,0.00239959103413078,0.00227828576162718,0.00216040195857675,0.00204599295442203,0.00193818070664026,0.00183354071983298,0.00173241929341168,0.00163731564290115,0.00154519529769942,0.00145657831258937,0.00137337467713549,0.00129294412164485,0.00121594683573901,0.00114375343214423,0.00107410882417359,0.00100777843441016,0.000945654777335618,0.000885848291185368,0.000829195318860362,0.00077617831308329,0.00072524556209966,0.000677272149737365,0.000632401044393554,0.000589385237987148,0.000549109686833407,0.000511447392680605,0.000475419779431034,0.000441896920012362,0.000410547420533137,0.000380623796161367,0.000352961035157659,0.000327082835369569,0.000302436102284797,0.00027980521267239,0.000258620954894211,0.000238489898469975,0.000220134806074134,0.000202937332227206,0.000186631921280276,0.000171872883449019,0.000158028134975829,0.000144931757035496,0.000133166426187586,0.000122113644898602,0.000111682750933326,0.000102384668940649,9.3634397414515e-005,8.53960585846707e-005,7.81111418713833e-005,7.12415249248695e-005,6.48141936795587e-005],"fillcolor":"#710500","fill":"tozeroy","type":"scatter","line":{"color":"#710500"},"marker":{"size":0,"color":"#710500","opacity":0},"showlegend":false,"name":"HH","xaxis":"x1","yaxis":"y1"},"cyl_4":{"x":["4"],"y":[11],"type":"bar","marker":{"color":"#BDBDBD"},"showlegend":false,"name":"cyl_4","xaxis":"x2","yaxis":"y2"},"cyl_6":{"x":["6"],"y":[7],"type":"bar","marker":{"color":"#525252"},"showlegend":false,"name":"cyl_6","xaxis":"x2","yaxis":"y2"},"cyl_8":{"x":["8"],"y":[14],"type":"bar","marker":{"color":"#969696"},"showlegend":false,"name":"cyl_8","xaxis":"x2","yaxis":"y2"},"disp_LL":{"x":[-96.2172366723656,-94.7778345718867,-93.3384324714078,-91.8990303709289,-90.4596282704499,-89.020226169971,-87.5808240694921,-86.1414219690132,-84.7020198685342,-83.2626177680553,-81.8232156675764,-80.3838135670974,-78.9444114666185,-77.5050093661396,-76.0656072656607,-74.6262051651817,-73.1868030647028,-71.7474009642239,-70.307998863745,-68.868596763266,-67.4291946627871,-65.9897925623082,-64.5503904618293,-63.1109883613503,-61.6715862608714,-60.2321841603925,-58.7927820599135,-57.3533799594346,-55.9139778589557,-54.4745757584768,-53.0351736579978,-51.5957715575189,-50.15636945704,-48.7169673565611,-47.2775652560821,-45.8381631556032,-44.3987610551243,-42.9593589546454,-41.5199568541664,-40.0805547536875,-38.6411526532086,-37.2017505527297,-35.7623484522507,-34.3229463517718,-32.8835442512929,-31.444142150814,-30.004740050335,-28.5653379498561,-27.1259358493772,-25.6865337488982,-24.2471316484193,-22.8077295479404,-21.3683274474615,-19.9289253469825,-18.4895232465036,-17.0501211460247,-15.6107190455458,-14.1713169450668,-12.7319148445879,-11.292512744109,-9.85311064363006,-8.41370854315113,-6.97430644267222,-5.53490434219329,-4.09550224171436,-2.65610014123543,-1.2166980407565,0.222704059722417,1.66210616020135,3.10150826068028,4.54091036115921,5.98031246163812,7.41971456211705,8.85911666259598,10.2985187630749,11.7379208635538,13.1773229640328,14.6167250645117,16.0561271649906,17.4955292654695,18.9349313659485,20.3743334664274,21.8137355669063,23.2531376673852,24.6925397678642,26.1319418683431,27.571343968822,29.010746069301,30.4501481697799,31.8895502702588,33.3289523707377,34.7683544712166,36.2077565716956,37.6471586721745,39.0865607726534,40.5259628731324,41.9653649736113,43.4047670740902,44.8441691745691,46.283571275048,47.722973375527,49.1623754760059,50.6017775764848,52.0411796769638,53.4805817774427,54.9199838779216,56.3593859784006,57.7987880788795,59.2381901793584,60.6775922798373,62.1169943803162,63.5563964807952,64.9957985812741,66.435200681753,67.874602782232,69.3140048827109,70.7534069831898,72.1928090836687,73.6322111841476,75.0716132846266,76.5110153851055,77.9504174855844,79.3898195860634,80.8292216865423,82.2686237870212,83.7080258875001,85.1474279879791,86.586830088458,88.0262321889369,89.4656342894158,90.9050363898948,92.3444384903737,93.7838405908526,95.2232426913315,96.6626447918105,98.1020468922894,99.5414489927683,100.980851093247,102.420253193726,103.859655294205,105.299057394684,106.738459495163,108.177861595642,109.617263696121,111.0566657966,112.496067897079,113.935469997558,115.374872098037,116.814274198515,118.253676298994,119.693078399473,121.132480499952,122.571882600431,124.01128470091,125.450686801389,126.890088901868,128.329491002347,129.768893102826],"y":[9.10597711225507e-006,9.8635834067354e-006,1.07004180849651e-005,1.15928175453706e-005,1.25324785628444e-005,1.35782274319107e-005,1.46724881957035e-005,1.58510422507726e-005,1.71289407295952e-005,1.84626214185881e-005,1.99304708925989e-005,2.14825270002367e-005,2.31163508431507e-005,2.49137094930455e-005,2.67873860242218e-005,2.88009628246615e-005,3.09629936214023e-005,3.32114913644765e-005,3.56757454783458e-005,3.8260809453213e-005,4.09797650440827e-005,4.39380126026494e-005,4.70105427303938e-005,5.03032381341823e-005,5.38062082911542e-005,5.74367346422903e-005,6.13963797494855e-005,6.55198072971415e-005,6.98505956996887e-005,7.45132869912323e-005,7.93386725765288e-005,8.44922084662555e-005,8.99275807724509e-005,9.5541790473162e-005,0.000101631545522273,0.000107930619145227,0.000114533078313971,0.000121571109594818,0.000128828968178006,0.000136549280288523,0.000144626252139915,0.000152952667452051,0.000161905464525402,0.000171121235354823,0.000180755566625449,0.000190929390440984,0.000201384471592558,0.000212454293090077,0.000223948956183877,0.000235783679965595,0.000248373267556015,0.000261286052119159,0.000274741807185117,0.00028882595459573,0.000303249713171469,0.000318441513669015,0.000334107549974098,0.000350207167046892,0.000367160383356312,0.000384487171480915,0.000402473265593406,0.000421143975025465,0.000440199709794984,0.00046015225812117,0.000480597537857382,0.000501556967622618,0.000523415748362049,0.000545677730802188,0.000568683490745802,0.000592380809281078,0.000616484564462376,0.000641557811803891,0.000667102249717712,0.000693208048653007,0.000720186107611311,0.000747565517121797,0.000775714166644211,0.000804500531521266,0.000833680465761233,0.000863814011960265,0.000894353788060761,0.000925446989138449,0.000957301124346755,0.000989514948811537,0.00102243901281606,0.00105588324488578,0.00108966923971552,0.0011242727478434,0.00115918072581932,0.00119456037528297,0.00123050627148266,0.00126672658829407,0.00130349584166038,0.00134061147943764,0.00137798793059698,0.0014158878901883,0.00145397719078177,0.00149237182510673,0.00153106905754313,0.00156991399301857,0.00160903932157945,0.00164829829974095,0.00168767230828293,0.00172720148271209,0.00176676874878991,0.00180639137613772,0.00184601018304907,0.0018856169728304,0.00192513956931805,0.0019645684093585,0.00200390513173991,0.00204299185549813,0.00208194177588119,0.00212062797155228,0.00215899492574388,0.00219717106190658,0.0022348301213017,0.00227218036769751,0.00230918430248302,0.00234554065582892,0.00238157848439704,0.00241699202582453,0.00245179777587612,0.00248623254017793,0.00251969103098455,0.0025526632282525,0.00258501235334202,0.00261636853285432,0.00264723676270544,0.00267711693560834,0.00270616024209444,0.00273467041201177,0.00276177068945495,0.00278826436693232,0.00281386806762322,0.0028382244934149,0.00286195506623483,0.00288437555945169,0.00290581456215493,0.00292655875041669,0.00294561398898035,0.00296397443703654,0.00298122482175316,0.00299709286928253,0.00301224586343694,0.00302585512982989,0.00303843704740196,0.00305018679345961,0.00306016170902631,0.00306939512838262,0.00307738226496424,0.00308398549045226,0.00308984622449185,0.00309406022479555,0.00309730164890629,0.00309964334003941,0.00310029353058968,0.00310022293059074],"fillcolor":"#BDBDBD","fill":"tozeroy","type":"scatter","line":{"color":"#BDBDBD"},"marker":{"size":0,"color":"#BDBDBD","opacity":0},"showlegend":false,"name":"LL","xaxis":"x3","yaxis":"y3"},"disp_ML":{"x":[131.208295203305,132.647697303784,134.087099404263,135.526501504741,136.96590360522,138.405305705699,139.844707806178,141.284109906657,142.723512007136,144.162914107615,145.602316208094,147.041718308573,148.481120409052,149.920522509531,151.35992461001,152.799326710489,154.238728810968,155.678130911446,157.117533011925,158.556935112404,159.996337212883,161.435739313362,162.875141413841,164.31454351432,165.753945614799,167.193347715278,168.632749815757,170.072151916236,171.511554016715,172.950956117194,174.390358217672,175.829760318151,177.26916241863,178.708564519109,180.147966619588,181.587368720067,183.026770820546,184.466172921025,185.905575021504,187.344977121983,188.784379222462,190.223781322941,191.66318342342,193.102585523899,194.541987624377,195.981389724856],"y":[0.00309888530206398,0.00309629367933053,0.00309300078711468,0.00308811964369921,0.00308241017313054,0.00307582614199614,0.00306779243419953,0.00305912744080253,0.00304930990529351,0.00303848081289773,0.00302705922651966,0.00301428124373592,0.00300088542713339,0.00298674476766675,0.00297152280807392,0.00295582030767817,0.00293921653327193,0.00292192161886487,0.00290420025260264,0.00288551419447884,0.00286645465502159,0.00284688013713752,0.00282666887569577,0.00280617225936369,0.00278514124278127,0.00276377166579767,0.0027421769012565,0.00272013264390088,0.0026979539124423,0.00267556681279349,0.00265300169797225,0.00263036628806133,0.00260763459486926,0.00258489922986851,0.00256216106681396,0.00253952062762841,0.00251695761062645,0.00249452844160178,0.00247233084794881,0.00245026901363877,0.00242855792149151,0.0024071155118373,0.00238590710236612,0.00236524813390321,0.00234484912868637,0.00232490909390296],"fillcolor":"#525252","fill":"tozeroy","type":"scatter","line":{"color":"#525252"},"marker":{"size":0,"color":"#525252","opacity":0},"showlegend":false,"name":"ML","xaxis":"x3","yaxis":"y3"},"disp_M":{"x":[197.420791825335,198.860193925814,200.299596026293,201.738998126772,203.178400227251,204.61780232773,206.057204428209,207.496606528688,208.936008629167,210.375410729646,211.814812830125,213.254214930603,214.693617031082,216.133019131561,217.57242123204,219.011823332519,220.451225432998,221.890627533477,223.330029633956,224.769431734435,226.208833834914,227.648235935393,229.087638035872,230.527040136351,231.96644223683,233.405844337308,234.845246437787,236.284648538266,237.724050638745,239.163452739224,240.602854839703,242.042256940182,243.481659040661,244.92106114114,246.360463241619,247.799865342098,249.239267442577,250.678669543056,252.118071643535,253.557473744013,254.996875844492,256.436277944971,257.87568004545,259.315082145929,260.754484246408,262.193886346887,263.633288447366,265.072690547845,266.512092648324],"y":[0.00230550829518645,0.00228641210403681,0.00226805314031952,0.00225014148705869,0.00223267452277012,0.00221605814406117,0.00219983049109378,0.00218431589702538,0.00216951416181752,0.00215512656013413,0.00214173989616791,0.00212887360534133,0.00211659780144205,0.00210529748072145,0.00209444582835586,0.00208444707219887,0.00207519480233958,0.00206639520448385,0.00205869639371391,0.00205149393049308,0.00204493506395337,0.00203930754887603,0.00203411698074405,0.0020297825208404,0.002026107452756,0.00202285344499611,0.00202062558564044,0.00201879771055877,0.00201756388221909,0.00201708388598836,0.0020169667845634,0.00201757592388768,0.00201867424365391,0.00202012307762266,0.00202233299152824,0.00202482632395768,0.00202777156124489,0.00203121295416771,0.00203489955703491,0.00203907732341455,0.00204353634876214,0.00204822592158927,0.00205333063989282,0.00205858423185801,0.00206408201581787,0.00206979530094587,0.00207561584310293,0.0020816318173163,0.00208772581445163],"fillcolor":"#969696","fill":"tozeroy","type":"scatter","line":{"color":"#969696"},"marker":{"size":0,"color":"#969696","opacity":0},"showlegend":false,"name":"M","xaxis":"x3","yaxis":"y3"},"disp_MH":{"x":[267.951494748803,269.390896849282,270.830298949761,272.269701050239,273.709103150718,275.148505251197,276.587907351676,278.027309452155,279.466711552634,280.906113653113,282.345515753592,283.784917854071,285.22431995455,286.663722055029,288.103124155508,289.542526255987,290.981928356466,292.421330456944,293.860732557423,295.300134657902,296.739536758381,298.17893885886,299.618340959339,301.057743059818,302.497145160297,303.936547260776,305.375949361255,306.815351461734,308.254753562213,309.694155662692,311.13355776317,312.572959863649,314.012361964128,315.451764064607,316.891166165086,318.330568265565,319.769970366044,321.209372466523,322.648774567002,324.088176667481,325.52757876796,326.966980868439,328.406382968918,329.845785069397,331.285187169875,332.724589270354,334.163991370833,335.603393471312,337.042795571791,338.48219767227,339.921599772749,341.361001873228,342.800403973707,344.239806074186,345.679208174665,347.118610275144,348.558012375623,349.997414476101,351.43681657658,352.876218677059,354.315620777538,355.755022878017,357.194424978496,358.633827078975,360.073229179454,361.512631279933,362.952033380412,364.391435480891,365.83083758137,367.270239681849,368.709641782328,370.149043882806,371.588445983285,373.027848083764,374.467250184243,375.906652284722,377.346054385201,378.78545648568],"y":[0.00209389284543939,0.00210013294474575,0.00210638361932692,0.00211264196749641,0.00211886099830913,0.00212505194874527,0.00213113216681756,0.00213712320176388,0.00214301896132972,0.00214870037700174,0.00215427023961108,0.00215962017128236,0.00216473443980284,0.00216970614877411,0.00217429562709517,0.00217868147584528,0.0021828189044301,0.00218653859844234,0.00219005425251731,0.00219316242953569,0.00219591142705577,0.00219843561282346,0.00220037326648345,0.00220204856454989,0.00220335771703856,0.00220413810649412,0.00220465791510692,0.00220464304200193,0.00220421709860566,0.00220351437286146,0.00220211787189763,0.00220044267524274,0.00219833124543973,0.00219566474476477,0.00219271723151767,0.0021891769426622,0.00218523384074065,0.00218098008575955,0.00217604757025545,0.00217083912515112,0.00216517628267551,0.00215899978718741,0.00215255385649938,0.00214552526935231,0.00213814592540861,0.00213045747315605,0.00212217589673771,0.00211364869962795,0.00210469861757659,0.00209532331333104,0.00208571559180987,0.0020755954747785,0.00206520314371968,0.00205453699390559,0.00204340888740456,0.00203208543243289,0.0020204128700416,0.00200842954750873,0.0019962683804973,0.0019837116706502,0.00197097159012738,0.00195802096066539,0.00194476028880247,0.00193136601816317,0.00191772675937144,0.00190389757678809,0.00188995398911917,0.0018757599395043,0.00186146755902483,0.00184704614166828,0.00183246409379467,0.00181781260522013,0.00180303445299428,0.00178817618230233,0.00177326665117531,0.00175825743472015,0.00174321986623152,0.00172813967160522],"fillcolor":"#252525","fill":"tozeroy","type":"scatter","line":{"color":"#252525"},"marker":{"size":0,"color":"#252525","opacity":0},"showlegend":false,"name":"MH","xaxis":"x3","yaxis":"y3"},"disp_HH":{"x":[380.224858586159,381.664260686638,383.103662787117,384.543064887596,385.982466988075,387.421869088554,388.861271189032,390.300673289511,391.74007538999,393.179477490469,394.618879590948,396.058281691427,397.497683791906,398.937085892385,400.376487992864,401.815890093343,403.255292193822,404.694694294301,406.13409639478,407.573498495258,409.012900595737,410.452302696216,411.891704796695,413.331106897174,414.770508997653,416.209911098132,417.649313198611,419.08871529909,420.528117399569,421.967519500048,423.406921600527,424.846323701006,426.285725801485,427.725127901963,429.164530002442,430.603932102921,432.0433342034,433.482736303879,434.922138404358,436.361540504837,437.800942605316,439.240344705795,440.679746806274,442.119148906753,443.558551007232,444.997953107711,446.43735520819,447.876757308668,449.316159409147,450.755561509626,452.194963610105,453.634365710584,455.073767811063,456.513169911542,457.952572012021,459.3919741125,460.831376212979,462.270778313458,463.710180413937,465.149582514416,466.588984614894,468.028386715373,469.467788815852,470.907190916331,472.34659301681,473.785995117289,475.225397217768,476.664799318247,478.104201418726,479.543603519205,480.983005619684,482.422407720163,483.861809820642,485.301211921121,486.740614021599,488.180016122078,489.619418222557,491.058820323036,492.498222423515,493.937624523994,495.377026624473,496.816428724952,498.255830825431,499.69523292591,501.134635026389,502.574037126868,504.013439227347,505.452841327825,506.892243428304,508.331645528783,509.771047629262,511.210449729741,512.64985183022,514.089253930699,515.528656031178,516.968058131657,518.407460232136,519.846862332615,521.286264433094,522.725666533573,524.165068634052,525.60447073453,527.043872835009,528.483274935488,529.922677035967,531.362079136446,532.801481236925,534.240883337404,535.680285437883,537.119687538362,538.559089638841,539.99849173932,541.437893839799,542.877295940278,544.316698040756,545.756100141235,547.195502241714,548.634904342193,550.074306442672,551.513708543151,552.95311064363,554.392512744109,555.831914844588,557.271316945067,558.710719045546,560.150121146025,561.589523246504,563.028925346983,564.468327447461,565.90772954794,567.347131648419,568.786533748898,570.225935849377,571.665337949856,573.104740050335,574.544142150814,575.983544251293,577.422946351772,578.862348452251,580.30175055273,581.741152653209,583.180554753687,584.619956854166,586.059358954645,587.498761055124,588.938163155603,590.377565256082,591.816967356561,593.25636945704,594.695771557519,596.135173657998,597.574575758477,599.013977858956,600.453379959435,601.892782059914,603.332184160392,604.771586260871,606.21098836135,607.650390461829,609.089792562308,610.529194662787,611.968596763266,613.407998863745,614.847400964224,616.286803064703,617.726205165182,619.165607265661,620.60500936614,622.044411466618,623.483813567097,624.923215667576,626.362617768055,627.802019868534,629.241421969013,630.680824069492,632.120226169971,633.55962827045,634.999030370929,636.438432471408,637.877834571887,639.317236672366],"y":[0.0017130253833055,0.00169789910893133,0.00168275938567878,0.00166762447034943,0.00165249304190316,0.00163739209151535,0.00162231119820322,0.00160726352484454,0.00159227018729436,0.00157730758022422,0.00156241988853816,0.0015475886229124,0.0015328041616933,0.00151812849504469,0.00150350176755884,0.00148895900700221,0.00147451355124719,0.00146012144131713,0.00144585207905298,0.0014316560989099,0.00141752962156152,0.00140353379090528,0.00138959433631011,0.00137575498372947,0.00136201280617626,0.00134832530219225,0.00133476116395686,0.00132125874438284,0.0013078230402702,0.00129449229270088,0.00128120617119291,0.00126800086206752,0.00125486111805665,0.00124175975388948,0.00122874076543203,0.00121575493034425,0.00120281002440948,0.00118991593236368,0.00117704231232895,0.00116420417794027,0.00115138616751374,0.00113858046828712,0.00112579219040262,0.00111300547829796,0.0011002209780041,0.00108742857528215,0.00107462972985676,0.00106181277551816,0.0010489751877674,0.00103612353647331,0.00102322676000437,0.00101030829736393,0.000997355554522161,0.000984353377246176,0.000971324946809989,0.000958237741039757,0.000945107902067139,0.00093194478885829,0.000918705814623569,0.00090543498750673,0.00089211127447287,0.000878727424828452,0.000865311950507665,0.000851828073556412,0.000838304409835874,0.000824745267456258,0.000811121967106031,0.000797473654030953,0.000783782829474506,0.000770054532954089,0.000756306552261031,0.000742520887621129,0.00072872059372057,0.000714905410302424,0.00070107634150401,0.000687245423766063,0.000673414213838668,0.000659593797965855,0.000645780868723229,0.000631998996553495,0.000618240994738088,0.000604510727016144,0.000590840821820369,0.000577203500636335,0.000563633690695862,0.000550134375917605,0.000536678926549688,0.000523348359031137,0.000510081973669644,0.000496900828177695,0.000483858823198671,0.000470887506401249,0.000458063811425165,0.000445366414044529,0.000432750560945216,0.000420359245544662,0.000408064095126645,0.000395915309259591,0.000383971018448062,0.000372131378459283,0.000360515675783783,0.000349066268981994,0.000337738928149714,0.000326703870818644,0.000315791570492304,0.000305078456344264,0.000294609969870671,0.000284269965774519,0.000274212146295781,0.000264338923915944,0.000254620647122549,0.000245226181624066,0.000235969172622667,0.00022694660201187,0.000218179771014197,0.000209552135656599,0.000201237942738589,0.000193105269985909,0.000185146555576052,0.000177508386892739,0.000170009063366395,0.000162757337467185,0.000155746752138146,0.000148873110493828,0.000142315044520796,0.000135918927981214,0.000129699946190386,0.000123770670904286,0.000117970301104339,0.000112409197756298,0.000107056700838339,0.000101828509541261,9.68928360153756e-005,9.20900279913917e-005,8.74532103153778e-005,8.30584774190274e-005,7.87749877884326e-005,7.47055586155652e-005,7.08034104984417e-005,6.70063941271683e-005,6.34614553957003e-005,6.00175697131865e-005,5.67181719003788e-005,5.36073164599534e-005,5.05863536408356e-005,4.77440608712767e-005,4.50269467084453e-005,4.23961985831506e-005,3.99627693238527e-005,3.76039308968209e-005,3.53626683055102e-005,3.32590143259477e-005,3.12237232816495e-005,2.93283096780023e-005,2.75207059808277e-005,2.57824582900521e-005,2.41842240499658e-005,2.26404643880078e-005,2.11865569389955e-005,1.98271301196025e-005,1.85168103783041e-005,1.73096017922823e-005,1.61603159428838e-005,1.50632935433486e-005,1.40599658830656e-005,1.30942954237329e-005,1.21933303001089e-005,1.13535589122088e-005,1.0547196733341e-005,9.81261152865328e-006,9.11403377222603e-006,8.45253746355183e-006,7.85031303038893e-006,7.27278417585575e-006,6.73927848106128e-006,6.24323791485729e-006,5.76876869694017e-006,5.34158786316739e-006,4.93553275271132e-006,4.5543148733414e-006,4.20860785301149e-006],"fillcolor":"#737373","fill":"tozeroy","type":"scatter","line":{"color":"#737373"},"marker":{"size":0,"color":"#737373","opacity":0},"showlegend":false,"name":"HH","xaxis":"x3","yaxis":"y3"},"hp_LL":{"x":[-32.1231343283582,-31.2400692233548,-30.3570041183515,-29.4739390133481,-28.5908739083448,-27.7078088033414,-26.8247436983381,-25.9416785933347,-25.0586134883313,-24.175548383328,-23.2924832783246,-22.4094181733213,-21.5263530683179,-20.6432879633145,-19.7602228583112,-18.8771577533078,-17.9940926483045,-17.1110275433011,-16.2279624382977,-15.3448973332944,-14.461832228291,-13.5787671232877,-12.6957020182843,-11.8126369132809,-10.9295718082776,-10.0465067032742,-9.16344159827087,-8.28037649326751,-7.39731138826415,-6.51424628326079,-5.63118117825744,-4.74811607325407,-3.86505096825072,-2.98198586324736,-2.098920758244,-1.21585565324064,-0.332790548237281,0.550274556766077,1.43333966176944,2.3164047667728,3.19946987177615,4.08253497677951,4.96560008178287,5.84866518678623,6.73173029178959,7.61479539679295,8.49786050179631,9.38092560679967,10.263990711803,11.1470558168064,12.0301209218097,12.9131860268131,13.7962511318165,14.6793162368198,15.5623813418232,16.4454464468265,17.3285115518299,18.2115766568333,19.0946417618366,19.97770686684,20.8607719718433,21.7438370768467,22.6269021818501,23.5099672868534,24.3930323918568,25.2760974968601,26.1591626018635,27.0422277068668,27.9252928118702,28.8083579168736,29.6914230218769,30.5744881268803,31.4575532318836,32.340618336887,33.2236834418904,34.1067485468937,34.9898136518971,35.8728787569004,36.7559438619038,37.6390089669072,38.5220740719105,39.4051391769139,40.2882042819172,41.1712693869206,42.054334491924,42.9373995969273,43.8204647019307,44.703529806934,45.5865949119374,46.4696600169408,47.3527251219441,48.2357902269475,49.1188553319508,50.0019204369542,50.8849855419575,51.7680506469609,52.6511157519643,53.5341808569676,54.417245961971,55.3003110669743,56.1833761719777,57.0664412769811,57.9495063819844,58.8325714869878,59.7156365919911,60.5987016969945,61.4817668019978,62.3648319070012,63.2478970120046,64.1309621170079,65.0140272220113,65.8970923270146,66.780157432018,67.6632225370214,68.5462876420247,69.4293527470281,70.3124178520314,71.1954829570348,72.0785480620382,72.9616131670415,73.8446782720449,74.7277433770482,75.6108084820516,76.4938735870549,77.3769386920583,78.2600037970617],"y":[9.79687808200021e-006,1.0849901610153e-005,1.19779171263786e-005,1.32219932972073e-005,1.46019617858554e-005,1.60769051980816e-005,1.76971699192787e-005,1.94893290064823e-005,2.14005366306974e-005,2.34918412957623e-005,2.57983459615561e-005,2.8252528597658e-005,3.09275990192817e-005,3.38692881353149e-005,3.69922513185917e-005,4.03833015239015e-005,4.41012077795575e-005,4.80392705874274e-005,5.22992666626072e-005,5.69557102168075e-005,6.18766665515482e-005,6.71800814575673e-005,7.29591807032274e-005,7.90526339286085e-005,8.55955242604432e-005,9.27029507060534e-005,0.000100179848819942,0.000108179084702459,0.000116840894128701,0.000125932101211093,0.000135623593658238,0.000146083985034161,0.000157037748013298,0.000168673546334814,0.000181191435411558,0.000194269644924321,0.000208113821433098,0.000222958168294295,0.000238431369048386,0.000254754669372437,0.000272198567827574,0.000290339746278264,0.000309413059328003,0.000329726678393147,0.000350803940730107,0.000372890729241269,0.000396333288579244,0.000420601634984182,0.000445949560029475,0.000472760615676974,0.00050045311065207,0.000529285174284203,0.000559675580144487,0.000590994304942156,0.00062349991551907,0.000657642900663671,0.000692750143021876,0.000729076568398171,0.000767099420568324,0.00080610959952254,0.000846354305009199,0.000888331167877948,0.000931303998790806,0.000975508361719242,0.00102145463033025,0.00106839000098817,0.00111653484642682,0.00116640357761233,0.00121723852708464,0.00126924183781098,0.00132292248016239,0.00137753054912589,0.00143324756976802,0.00149056716547411,0.00154876022574288,0.0016079860133102,0.00166871284148644,0.0017302453244062,0.00179271960726153,0.00185656903958986,0.0019211442831529,0.00198655829405207,0.00205320043677222,0.0021204786786494,0.00218848344396532,0.0022575519659442,0.00232715934479666,0.00239737476182453,0.00246847617729613,0.00254001398809132,0.00261203792480487,0.00268476053006226,0.00275781392835013,0.00283123055122525,0.00290515222121249,0.0029792975990053,0.00305368418504112,0.0031283783259031,0.00320318869337232,0.00327812031524213,0.00335315944156688,0.00342820734101443,0.00350325902370583,0.00357821567435848,0.00365307341338635,0.00372781963207195,0.00380226463704252,0.00387650193527363,0.00395051363452645,0.00402401207015758,0.00409719153969708,0.00417003117403864,0.00424213666290484,0.00431380785365835,0.00438502324548126,0.00445527153523058,0.00452496453745405,0.00459408258682764,0.00466198554596969,0.00472920532157653,0.00479572675282864,0.00486076802243243,0.00492499070730694,0.00498838707597539,0.00505002059489619,0.00511069295991653],"fillcolor":"#BDBDBD","fill":"tozeroy","type":"scatter","line":{"color":"#BDBDBD"},"marker":{"size":0,"color":"#BDBDBD","opacity":0},"showlegend":false,"name":"LL","xaxis":"x4","yaxis":"y4"},"hp_ML":{"x":[79.143068902065,80.0261340070684,80.9091991120717,81.7922642170751,82.6753293220785,83.5583944270818,84.4414595320852,85.3245246370885,86.2075897420919,87.0906548470953,87.9737199520986,88.856785057102,89.7398501621053,90.6229152671087,91.505980372112,92.3890454771154,93.2721105821188,94.1551756871221,95.0382407921255,95.9213058971288,96.8043710021322,97.6874361071356,98.5705012121389,99.4535663171423,100.336631422146,101.219696527149,102.102761632152,102.985826737156,103.868891842159,104.751956947162,105.635022052166,106.518087157169,107.401152262173,108.284217367176,109.167282472179,110.050347577183,110.933412682186,111.816477787189,112.699542892193,113.582607997196,114.465673102199,115.348738207203,116.231803312206,117.114868417209,117.997933522213],"y":[0.00517040334738558,0.00522805952649147,0.00528460260028958,0.00534003541994984,0.00539313125355562,0.00544494880364739,0.00549550497632919,0.00554344283196756,0.00558993499432882,0.00563501591643835,0.00567720769739827,0.0057177895709357,0.00575681690188356,0.00579270569964288,0.00582683022301048,0.00585926971669587,0.00588835489291618,0.00591553884307006,0.00594092694777925,0.00596279119416854,0.0059826427352715,0.00600061429863184,0.00601495089450925,0.00602719680394936,0.00603751195045029,0.0060441502408575,0.0060486607789368,0.00605122890688353,0.00605015598194902,0.0060469653736006,0.00604186426305634,0.00603324094172419,0.00602256160835661,0.00601004984371545,0.00599421934690422,0.00597644835500058,0.00595696963234803,0.00593445775289985,0.00591017440998003,0.00588435279361759,0.00585585890148174,0.00582581299422336,0.00579443877077885,0.00576081759088187,0.00572590838081044],"fillcolor":"#525252","fill":"tozeroy","type":"scatter","line":{"color":"#525252"},"marker":{"size":0,"color":"#525252","opacity":0},"showlegend":false,"name":"ML","xaxis":"x4","yaxis":"y4"},"hp_M":{"x":[118.880998627216,119.76406373222,120.647128837223,121.530193942226,122.41325904723,123.296324152233,124.179389257236,125.06245436224,125.945519467243,126.828584572246,127.71164967725,128.594714782253,129.477779887256,130.36084499226,131.243910097263,132.126975202267,133.01004030727,133.893105412273,134.776170517277,135.65923562228,136.542300727283,137.425365832287,138.30843093729,139.191496042293,140.074561147297,140.9576262523,141.840691357304,142.723756462307,143.60682156731,144.489886672314,145.372951777317,146.25601688232,147.139081987324,148.022147092327,148.90521219733,149.788277302334,150.671342407337,151.55440751234,152.437472617344,153.320537722347,154.203602827351,155.086667932354,155.969733037357,156.852798142361,157.735863247364,158.618928352367,159.501993457371,160.385058562374,161.268123667377,162.151188772381],"y":[0.00568991478780297,0.00565214950862876,0.00561339622959676,0.00557382795940261,0.00553299582477907,0.00549150101510485,0.00544947596719205,0.00540670802730479,0.00536361553358976,0.00532028176487386,0.00527671887670517,0.00523316874919709,0.00518965891998158,0.00514640636310399,0.00510348909742846,0.00506087490492753,0.00501895809792148,0.00497767075025527,0.00493691987149359,0.00489724363120026,0.00485845024098408,0.00482038817251986,0.0047837017585785,0.00474810026388881,0.00471337915939137,0.00468024900632521,0.00464834645164365,0.00461742264186742,0.00458821422544451,0.00456031156774863,0.00453343293066565,0.00450830267600873,0.00448448992681644,0.00446169369372421,0.00444059124544131,0.00442075308108812,0.00440187405533217,0.00438455463222955,0.00436838600062241,0.00435307456743582,0.00433912055296418,0.00432615123936318,0.00431389999458945,0.00430275040314898,0.00429237702378942,0.0042825543783791,0.00427354041653365,0.00426506391555814,0.00425695266859743,0.00424933730267583],"fillcolor":"#969696","fill":"tozeroy","type":"scatter","line":{"color":"#969696"},"marker":{"size":0,"color":"#969696","opacity":0},"showlegend":false,"name":"M","xaxis":"x4","yaxis":"y4"},"hp_MH":{"x":[163.034253877384,163.917318982387,164.800384087391,165.683449192394,166.566514297398,167.449579402401,168.332644507404,169.215709612408,170.098774717411,170.981839822414,171.864904927418,172.747970032421,173.631035137424,174.514100242428,175.397165347431,176.280230452435,177.163295557438,178.046360662441,178.929425767445,179.812490872448,180.695555977451,181.578621082455,182.461686187458,183.344751292461,184.227816397465,185.110881502468,185.993946607471,186.877011712475,187.760076817478,188.643141922482,189.526207027485,190.409272132488,191.292337237492,192.175402342495,193.058467447498,193.941532552502,194.824597657505,195.707662762508,196.590727867512,197.473792972515,198.356858077518,199.239923182522,200.122988287525,201.006053392529,201.889118497532,202.772183602535,203.655248707539,204.538313812542,205.421378917545,206.304444022549,207.187509127552,208.070574232555,208.953639337559,209.836704442562,210.719769547566,211.602834652569,212.485899757572,213.368964862576,214.252029967579,215.135095072582,216.018160177586,216.901225282589,217.784290387592,218.667355492596,219.550420597599,220.433485702602,221.316550807606,222.199615912609,223.082681017613,223.965746122616,224.848811227619,225.731876332623,226.614941437626,227.498006542629,228.381071647633,229.264136752636,230.147201857639,231.030266962643,231.913332067646,232.79639717265,233.679462277653,234.562527382656,235.44559248766,236.328657592663,237.211722697666],"y":[0.00424200375673593,0.00423484239234143,0.00422786165620581,0.00422090405636099,0.00421392842109972,0.00420683215840358,0.00419951084631453,0.00419199390737863,0.00418408374133526,0.00417572332320555,0.00416701088812802,0.00415767344010531,0.00414769427575147,0.00413723485824349,0.00412596857781388,0.004113911324062,0.00410127874612067,0.00408771314588398,0.00407325529683337,0.00405816309674212,0.00404206967607605,0.00402503355616966,0.00400734079293165,0.00398863545292546,0.00396898764779045,0.00394869622007615,0.00392743348302102,0.00390527620273809,0.00388252029991117,0.00385888011772439,0.00383443544465378,0.00380946418688895,0.00378373252418321,0.0037573208743367,0.0037304755513921,0.00370302023679075,0.00367503463824815,0.00364672220233554,0.00361796573981621,0.00358884369028748,0.003559508286406,0.00352989939924512,0.00350009410303498,0.00347018842790519,0.00344017407239337,0.00341012677921175,0.00338008495426087,0.00335008439834303,0.00332019938531918,0.0032904128246132,0.00326079515471126,0.00323141862801866,0.0032022160994284,0.00317328221900555,0.00314468608677897,0.00311631882892708,0.00308828867009858,0.00306065978028147,0.00303329217562533,0.00300629748643484,0.00297973255832207,0.00295343850021728,0.00292752121991004,0.00290202735084002,0.00287679210315529,0.00285190801759298,0.0028274083370815,0.00280313538829475,0.00277916248480108,0.00275550627301554,0.00273202844693663,0.00270877917431494,0.00268575557023437,0.00266284948120425,0.00264008597294099,0.00261744027436354,0.00259484310913937,0.0025722943472445,0.00254974584944774,0.00252717341928582,0.00250455329968352,0.00248181362722983,0.00245897865621778,0.00243600395740772,0.00241279490632013],"fillcolor":"#252525","fill":"tozeroy","type":"scatter","line":{"color":"#252525"},"marker":{"size":0,"color":"#252525","opacity":0},"showlegend":false,"name":"MH","xaxis":"x4","yaxis":"y4"},"hp_HH":{"x":[238.09478780267,238.977852907673,239.860918012676,240.74398311768,241.627048222683,242.510113327686,243.39317843269,244.276243537693,245.159308642696,246.0423737477,246.925438852703,247.808503957707,248.69156906271,249.574634167713,250.457699272717,251.34076437772,252.223829482723,253.106894587727,253.98995969273,254.873024797733,255.756089902737,256.63915500774,257.522220112744,258.405285217747,259.28835032275,260.171415427754,261.054480532757,261.93754563776,262.820610742764,263.703675847767,264.58674095277,265.469806057774,266.352871162777,267.23593626778,268.119001372784,269.002066477787,269.885131582791,270.768196687794,271.651261792797,272.534326897801,273.417392002804,274.300457107807,275.183522212811,276.066587317814,276.949652422817,277.832717527821,278.715782632824,279.598847737827,280.481912842831,281.364977947834,282.248043052838,283.131108157841,284.014173262844,284.897238367848,285.780303472851,286.663368577854,287.546433682858,288.429498787861,289.312563892864,290.195628997868,291.078694102871,291.961759207875,292.844824312878,293.727889417881,294.610954522885,295.494019627888,296.377084732891,297.260149837895,298.143214942898,299.026280047901,299.909345152905,300.792410257908,301.675475362911,302.558540467915,303.441605572918,304.324670677922,305.207735782925,306.090800887928,306.973865992932,307.856931097935,308.739996202938,309.623061307942,310.506126412945,311.389191517948,312.272256622952,313.155321727955,314.038386832959,314.921451937962,315.804517042965,316.687582147969,317.570647252972,318.453712357975,319.336777462979,320.219842567982,321.102907672985,321.985972777989,322.869037882992,323.752102987995,324.635168092999,325.518233198002,326.401298303006,327.284363408009,328.167428513012,329.050493618016,329.933558723019,330.816623828022,331.699688933026,332.582754038029,333.465819143032,334.348884248036,335.231949353039,336.115014458042,336.998079563046,337.881144668049,338.764209773053,339.647274878056,340.530339983059,341.413405088063,342.296470193066,343.179535298069,344.062600403073,344.945665508076,345.828730613079,346.711795718083,347.594860823086,348.47792592809,349.360991033093,350.244056138096,351.1271212431,352.010186348103,352.893251453106,353.77631655811,354.659381663113,355.542446768116,356.42551187312,357.308576978123,358.191642083126,359.07470718813,359.957772293133,360.840837398137,361.72390250314,362.606967608143,363.490032713147,364.37309781815,365.256162923153,366.139228028157,367.02229313316,367.905358238163,368.788423343167,369.67148844817,370.554553553173,371.437618658177,372.32068376318,373.203748868184,374.086813973187,374.96987907819,375.852944183194,376.736009288197,377.6190743932,378.502139498204,379.385204603207,380.26826970821,381.151334813214,382.034399918217,382.917465023221,383.800530128224,384.683595233227,385.566660338231,386.449725443234,387.332790548237,388.215855653241,389.098920758244,389.981985863247,390.865050968251,391.748116073254,392.631181178257,393.514246283261,394.397311388264,395.280376493268,396.163441598271,397.046506703274,397.929571808278,398.812636913281,399.695702018284,400.578767123288,401.461832228291,402.344897333294,403.227962438298,404.111027543301,404.994092648305,405.877157753308,406.760222858311,407.643287963315,408.526353068318,409.409418173321,410.292483278325,411.175548383328,412.058613488331,412.941678593335,413.824743698338,414.707808803341,415.590873908345,416.473939013348,417.357004118351,418.240069223355,419.123134328358],"y":[0.00238942459714921,0.00236583194283586,0.00234190195802631,0.00231775399364488,0.00229331502654834,0.00226845358074284,0.00224332986834957,0.00221786400530133,0.00219191330934521,0.00216567094061096,0.00213905524735795,0.00211191889676121,0.00208447797429014,0.00205665387202551,0.00202830221097642,0.00199965036620224,0.00197062705172858,0.00194109920493989,0.00191129279865307,0.00188114741868688,0.0018505500962244,0.00181971224302823,0.00178858700441915,0.00175709031957122,0.00172540600665284,0.00169350252372266,0.00166133317507306,0.00162904185023137,0.00159661312508453,0.00156404537889241,0.00153143146081773,0.0014987719608732,0.0014661169277746,0.00143349874262698,0.00140093308170255,0.00136852681314759,0.00133624448637682,0.00130411523262258,0.00127230616909656,0.00124070900221688,0.0012093641303341,0.00117850041805106,0.00114793425971598,0.00111771473936465,0.00108813189830555,0.00105892698120457,0.00103015495203936,0.00100216432993698,0.000974623993820047,0.000947591924217993,0.000921470312505527,0.000895860973146585,0.000870822138378165,0.00084680286116761,0.000823345519150435,0.000800506069124938,0.000778771788430058,0.000757635303576639,0.000737148123394931,0.000717825535822805,0.000699121825438341,0.000681082326074135,0.000664238860007342,0.000648020113596993,0.000632464026537626,0.000618106585505223,0.000604364526115152,0.000591267715384892,0.000579343453232738,0.000568010616289763,0.00055729086400316,0.000547689920466297,0.000538642864699629,0.000530163531839688,0.000522723602808788,0.000515787914153286,0.000509363326274108,0.000503875891146903,0.00049883278924453,0.000494235147145259,0.000490453126269509,0.000487047434559259,0.000484017665152496,0.00048166157214175,0.000479610767476372,0.000477862149611602,0.000476635299266464,0.000475639317177638,0.000474868663200252,0.000474465977761868,0.000474217417252387,0.000474116803718427,0.000474233493227598,0.000474427843102093,0.000474694792211258,0.000475036245718232,0.000475381745901222,0.000475728943829093,0.00047601998172377,0.000476246740386286,0.000476410917513629,0.000476404048174469,0.000476272060683338,0.000476021688626576,0.000475504050712428,0.000474809810160231,0.000473951318966294,0.000472750046612482,0.00047133149725295,0.000469713782002425,0.000467699602074393,0.000465439264042791,0.000462956330656678,0.000460045285647853,0.000456871467989388,0.000453463158979802,0.000449616441326831,0.000445502555364321,0.000441153392093874,0.000436375369821376,0.000431337450134642,0.000426073722559581,0.000420408325950373,0.000414500955224666,0.000408386276596238,0.00040191199478706,0.0003952229052873,0.000388352521799463,0.000381176321289984,0.000373820004374724,0.000366314203220831,0.000358564722952029,0.000350675414901841,0.000342672405106484,0.000334492802364367,0.00032621722769765,0.000317865874752033,0.000309406691935343,0.000300896934137027,0.000292349712220037,0.000283762107670874,0.000275168943649171,0.0002665754303265,0.000258005069941345,0.000249472052083462,0.000240973233771143,0.000232555078414792,0.000224213581716396,0.000215937169032352,0.000207791321274187,0.000199756698391055,0.000191813574654313,0.000184042272872697,0.000176411183077317,0.00016889303262632,0.000161578806796962,0.000154427711417928,0.000147405802656372,0.00014061073924322,0.000133995491140457,0.000127520526940213,0.000121286534305694,0.000115242936058129,0.00010934583478723,0.000103695758206613,9.82409253553688e-005,9.29343613804089e-005,8.78737694576562e-005,8.30081123131835e-005,7.82886259432092e-005,7.38080779959931e-005,6.95177077826524e-005,6.53681905547253e-005,6.14457961813183e-005,5.77051671081763e-005,5.40975372593571e-005,5.0701632700744e-005,4.74762485032504e-005,4.43741508486813e-005,4.14659391754648e-005,3.87149778329808e-005,3.60763690551316e-005,3.36123996100004e-005,3.12911401817569e-005,2.90706516035676e-005,2.70050455028727e-005,2.50670133245402e-005,2.3218015642458e-005,2.15043757469162e-005,1.99031539313542e-005,1.83794795831438e-005,1.69724529143195e-005,1.56631370668362e-005,1.4420443918433e-005,1.32769303280641e-005,1.22172280953769e-005,1.12140115902365e-005,1.02940335023496e-005,9.44503013055652e-006,8.64330921532222e-006,7.91057296389597e-006,7.23719813109534e-006,6.60291297634609e-006,6.02510267371094e-006,5.49634266454582e-006,4.99950972405922e-006],"fillcolor":"#737373","fill":"tozeroy","type":"scatter","line":{"color":"#737373"},"marker":{"size":0,"color":"#737373","opacity":0},"showlegend":false,"name":"HH","xaxis":"x4","yaxis":"y4"},"drat_LL":{"x":[2.03818370630419,2.04525539434214,2.05232708238009,2.05939877041803,2.06647045845598,2.07354214649393,2.08061383453188,2.08768552256983,2.09475721060778,2.10182889864572,2.10890058668367,2.11597227472162,2.12304396275957,2.13011565079752,2.13718733883547,2.14425902687341,2.15133071491136,2.15840240294931,2.16547409098726,2.17254577902521,2.17961746706316,2.1866891551011,2.19376084313905,2.200832531177,2.20790421921495,2.2149759072529,2.22204759529085,2.22911928332879,2.23619097136674,2.24326265940469,2.25033434744264,2.25740603548059,2.26447772351854,2.27154941155649,2.27862109959443,2.28569278763238,2.29276447567033,2.29983616370828,2.30690785174623,2.31397953978418,2.32105122782212,2.32812291586007,2.33519460389802,2.34226629193597,2.34933797997392,2.35640966801187,2.36348135604981,2.37055304408776,2.37762473212571,2.38469642016366,2.39176810820161,2.39883979623956,2.4059114842775,2.41298317231545,2.4200548603534,2.42712654839135,2.4341982364293,2.44126992446725,2.44834161250519,2.45541330054314,2.46248498858109,2.46955667661904,2.47662836465699,2.48370005269494,2.49077174073288,2.49784342877083,2.50491511680878,2.51198680484673,2.51905849288468,2.52613018092263,2.53320186896058,2.54027355699852,2.54734524503647,2.55441693307442,2.56148862111237,2.56856030915032,2.57563199718827,2.58270368522621,2.58977537326416,2.59684706130211,2.60391874934006,2.61099043737801,2.61806212541596,2.6251338134539,2.63220550149185,2.6392771895298,2.64634887756775,2.6534205656057,2.66049225364365,2.66756394168159,2.67463562971954,2.68170731775749,2.68877900579544,2.69585069383339,2.70292238187134,2.70999406990928,2.71706575794723,2.72413744598518,2.73120913402313,2.73828082206108,2.74535251009903,2.75242419813697,2.75949588617492,2.76656757421287,2.77363926225082,2.78071095028877,2.78778263832672,2.79485432636467,2.80192601440261,2.80899770244056,2.81606939047851,2.82314107851646,2.83021276655441,2.83728445459236,2.8443561426303,2.85142783066825,2.8584995187062,2.86557120674415,2.8726428947821,2.87971458282005,2.88678627085799,2.89385795889594,2.90092964693389,2.90800133497184,2.91507302300979,2.92214471104774,2.92921639908568,2.93628808712363,2.94335977516158,2.95043146319953,2.95750315123748,2.96457483927543,2.97164652731337,2.97871821535132,2.98578990338927,2.99286159142722,2.99993327946517,3.00700496750312,3.01407665554107,3.02114834357901,3.02822003161696,3.03529171965491,3.04236340769286,3.04943509573081,3.05650678376876,3.0635784718067,3.07065015984465,3.0777218478826,3.08479353592055,3.0918652239585,3.09893691199645,3.10600860003439,3.11308028807234],"y":[0.00126598819738066,0.00138587235833437,0.00151279746231649,0.0016533672507772,0.00180510837015691,0.00196540580386309,0.00214377816119162,0.00233439091147267,0.00253532020954973,0.00275985720806497,0.00299750396930817,0.00324867639191955,0.00352790473654973,0.00382198729929515,0.00413442496479614,0.00447816038321585,0.00483939751204312,0.00522500214356033,0.00564502750040931,0.00608551323147267,0.00655772715513078,0.00706723007950922,0.00760046762156212,0.00817430194175513,0.00878788577841126,0.00942879215005024,0.0101208179512805,0.0108544798816008,0.0116193569608923,0.0124476545151942,0.0133187271752813,0.0142251956502986,0.0152092577959082,0.0162363117271119,0.0173059691499824,0.0184637927941887,0.0196664982416047,0.0209234778691759,0.0222726649061684,0.0236716127404475,0.0251381983059787,0.0266999116664103,0.0283163944297717,0.0300155634224831,0.0318114692032819,0.0336672243461778,0.0356223386619619,0.0376743211341338,0.0397912392906347,0.0420256954627813,0.0443555397358135,0.0467553412777907,0.0492921843600273,0.0519212299236872,0.0546251129665285,0.0574866177959003,0.0604353856927606,0.063467211885666,0.0666708707798461,0.0699586662584662,0.0733461331737696,0.0769026041965217,0.0805470954727276,0.0843085272010241,0.0882339113354219,0.0922506837414249,0.0964019375984928,0.100709883853709,0.105111967444723,0.109665879904687,0.114367089848177,0.119164457777223,0.124130254270337,0.129231955110414,0.134430990109267,0.139813655714066,0.145319040105102,0.150921967541978,0.156721577756232,0.162629210761753,0.168635595181825,0.174844514130807,0.18114771154497,0.187560396464667,0.194155977250259,0.200842164771749,0.207645808842937,0.214610471086261,0.221660540509082,0.228832344836881,0.236141479394455,0.24352916567825,0.25103817169871,0.258659556323889,0.266350867584505,0.274157333633679,0.282050633308106,0.290003373701541,0.298058283398332,0.306174681066345,0.314338113366994,0.322582876876327,0.330864885503626,0.339179593615226,0.347545998872879,0.355927508127765,0.36432623428102,0.37273599273758,0.381142602341497,0.389543374041856,0.397916057911427,0.406265744204614,0.414578423869034,0.422826756271154,0.431030908453682,0.439158526601253,0.447189729470628,0.455154577330502,0.462995138045393,0.470712675920079,0.478341112071451,0.485789864868427,0.493095569586098,0.500289347146154,0.507241489441664,0.514038026828523,0.520700289278531,0.527054031751429,0.533247646648048,0.539265865423929,0.544945617424384,0.550449069578441,0.555729177572733,0.560657844842349,0.565393427126308,0.569855988020064,0.573965279427514,0.577867793274362,0.58144829303755,0.584684655294346,0.587704207746766,0.590356164794076,0.592683338527435,0.594787822079183,0.596485456778507,0.597886605921603,0.599063727141506,0.599804029258948,0.600283319926518,0.600542055892647,0.600346109940177,0.599929634600916,0.599281155573768],"fillcolor":"#BDBDBD","fill":"tozeroy","type":"scatter","line":{"color":"#BDBDBD"},"marker":{"size":0,"color":"#BDBDBD","opacity":0},"showlegend":false,"name":"LL","xaxis":"x5","yaxis":"y5"},"drat_ML":{"x":[3.12015197611029,3.12722366414824,3.13429535218619,3.14136704022414,3.14843872826208,3.15551041630003,3.16258210433798,3.16965379237593,3.17672548041388,3.18379716845183,3.19086885648977,3.19794054452772,3.20501223256567,3.21208392060362,3.21915560864157,3.22622729667952,3.23329898471746,3.24037067275541,3.24744236079336,3.25451404883131,3.26158573686926,3.26865742490721,3.27572911294516,3.2828008009831,3.28987248902105,3.296944177059,3.30401586509695,3.3110875531349,3.31815924117285,3.32523092921079,3.33230261724874,3.33937430528669,3.34644599332464,3.35351768136259,3.36058936940054,3.36766105743848,3.37473274547643,3.38180443351438],"y":[0.598214476951511,0.596950446376127,0.595443311589576,0.593580245466812,0.591538403191161,0.589253991716899,0.586680150241698,0.583950400276721,0.580991787174672,0.577811337412118,0.574501613500055,0.570990831148218,0.567323802458676,0.563557244027627,0.559631753632739,0.55561072948041,0.551522263332985,0.547330774923348,0.543097092377302,0.538829548013045,0.534527361169737,0.530226964677331,0.525928377270284,0.521670934898567,0.517450046435125,0.51327522818671,0.509207175840891,0.50520795051148,0.501306948289293,0.497564460808031,0.493920795213157,0.490433080341685,0.487140975762839,0.483974626321311,0.481024785387179,0.47829299057711,0.475710141420538,0.473404158756678],"fillcolor":"#525252","fill":"tozeroy","type":"scatter","line":{"color":"#525252"},"marker":{"size":0,"color":"#525252","opacity":0},"showlegend":false,"name":"ML","xaxis":"x5","yaxis":"y5"},"drat_M":{"x":[3.38887612155233,3.39594780959028,3.40301949762823,3.41009118566617,3.41716287370412,3.42423456174207,3.43130624978002,3.43837793781797,3.44544962585592,3.45252131389386,3.45959300193181,3.46666468996976,3.47373637800771,3.48080806604566,3.48787975408361,3.49495144212155,3.5020231301595,3.50909481819745,3.5161665062354,3.52323819427335,3.5303098823113,3.53738157034925,3.54445325838719,3.55152494642514,3.55859663446309,3.56566832250104,3.57274001053899,3.57981169857694,3.58688338661488,3.59395507465283,3.60102676269078,3.60809845072873,3.61517013876668,3.62224182680463,3.62931351484257,3.63638520288052,3.64345689091847,3.65052857895642,3.65760026699437,3.66467195503232,3.67174364307026,3.67881533110821,3.68588701914616,3.69295870718411,3.70003039522206,3.70710208326001,3.71417377129795,3.7212454593359,3.72831714737385,3.7353888354118,3.74246052344975,3.7495322114877,3.75660389952565,3.76367558756359,3.77074727560154,3.77781896363949,3.78489065167744,3.79196233971539,3.79903402775334,3.80610571579128,3.81317740382923,3.82024909186718,3.82732077990513,3.83439246794308,3.84146415598103,3.84853584401897,3.85560753205692,3.86267922009487,3.86975090813282,3.87682259617077,3.88389428420872,3.89096597224666,3.89803766028461,3.90510934832256,3.91218103636051,3.91925272439846,3.92632441243641,3.93339610047435,3.9404677885123,3.94753947655025,3.9546111645882,3.96168285262615,3.9687545406641,3.97582622870204,3.98289791673999,3.98996960477794,3.99704129281589],"y":[0.471324720875718,0.469413117209191,0.467835380109481,0.466480116797695,0.465306851388123,0.464517970748999,0.463936821298666,0.463557284954281,0.463582329001194,0.46380243703557,0.464255463094842,0.46508761003291,0.466113137109766,0.467396069329002,0.46902191601056,0.470834556701417,0.472920142239685,0.475304671086762,0.477864814759255,0.48070277212703,0.483790977437159,0.487039441161049,0.490558673872761,0.494277686310964,0.49813792762276,0.502249264286104,0.506510873378503,0.510891581313347,0.515490912339685,0.520194380884358,0.524994924983534,0.529964016114044,0.534999079464372,0.540110921315773,0.545322561704539,0.550572508274626,0.555869322882114,0.561203834623387,0.566548570972591,0.571901307814765,0.577237980708613,0.582556994359498,0.587837229135085,0.593057148385689,0.598232293280591,0.603315339562217,0.60830398450476,0.613222026920691,0.617989736614001,0.622639299308256,0.627194175428375,0.631537374297922,0.635748760140588,0.639842135180965,0.643664031184796,0.647348516496629,0.650874778924519,0.654109166075911,0.657189699573837,0.660070080917306,0.662649630777498,0.665061776720675,0.667231741191423,0.669102244024763,0.670794774495389,0.672204573594007,0.673325260989425,0.674260413171227,0.67487524835766,0.675218798907109,0.675372220338789,0.67517204522771,0.674724301148448,0.674084711761959,0.67306371220945,0.671823139566739,0.670391743886503,0.668557539537049,0.666534468242233,0.664300440634408,0.661696768825938,0.658912450870928,0.655899532133248,0.652557463621282,0.649042989088983,0.645287491847884,0.641244969794162],"fillcolor":"#969696","fill":"tozeroy","type":"scatter","line":{"color":"#969696"},"marker":{"size":0,"color":"#969696","opacity":0},"showlegend":false,"name":"M","xaxis":"x5","yaxis":"y5"},"drat_MH":{"x":[4.00411298085384,4.01118466889179,4.01825635692973,4.02532804496768,4.03239973300563,4.03947142104358,4.04654310908153,4.05361479711948,4.06068648515743,4.06775817319537,4.07482986123332,4.08190154927127,4.08897323730922,4.09604492534717,4.10311661338512,4.11018830142306,4.11725998946101,4.12433167749896,4.13140336553691,4.13847505357486,4.14554674161281,4.15261842965075,4.1596901176887,4.16676180572665,4.1738334937646,4.18090518180255,4.1879768698405,4.19504855787844,4.20212024591639,4.20919193395434,4.21626362199229,4.22333531003024,4.23040699806819,4.23747868610613,4.24455037414408,4.25162206218203,4.25869375021998,4.26576543825793,4.27283712629588,4.27990881433383,4.28698050237177,4.29405219040972,4.30112387844767,4.30819556648562,4.31526725452357,4.32233894256152,4.32941063059946,4.33648231863741,4.34355400667536,4.35062569471331,4.35769738275126,4.36476907078921,4.37184075882715,4.3789124468651,4.38598413490305,4.393055822941,4.40012751097895,4.4071991990169,4.41427088705484,4.42134257509279,4.42841426313074,4.43548595116869,4.44255763920664,4.44962932724459,4.45670101528254,4.46377270332048,4.47084439135843,4.47791607939638,4.48498776743433,4.49205945547228,4.49913114351022,4.50620283154817,4.51327451958612,4.52034620762407,4.52741789566202,4.53448958369997,4.54156127173792,4.54863295977586,4.55570464781381,4.56277633585176,4.56984802388971,4.57691971192766,4.5839913999656,4.59106308800355,4.5981347760415,4.60520646407945,4.6122781521174,4.61934984015535,4.6264215281933,4.63349321623124,4.64056490426919,4.64763659230714,4.65470828034509,4.66177996838304,4.66885165642099,4.67592334445893],"y":[0.637040080093885,0.632587455203179,0.627890092620828,0.62304192919991,0.617945309507439,0.612645112155295,0.60720693672492,0.601525662244247,0.595679750030535,0.58970966924171,0.583507832860647,0.57717718957808,0.570736913253072,0.564081960810003,0.557330237729437,0.550474704229369,0.543445308037235,0.53633770222662,0.529133653864378,0.521798818515274,0.514401041934012,0.506918774213328,0.49934398156336,0.491721332209864,0.484030369140527,0.476280030162502,0.468496572002771,0.460664767271334,0.452801490901571,0.44491934512443,0.437012116339885,0.429096088986267,0.421174835422999,0.413254528332898,0.405343000231942,0.397439184611123,0.389564560392551,0.381711432314889,0.373880452692728,0.366104008146081,0.358359509836531,0.350654787772851,0.343022981753177,0.335433431940326,0.327903236460449,0.320459230447039,0.313066867245765,0.30575489625887,0.298537678613615,0.291380548649927,0.284325821686569,0.277370135434903,0.270482030028777,0.263718832220486,0.257055140766396,0.250465568004076,0.244023431816766,0.237677912193898,0.231412094698412,0.225315807456963,0.219310362089558,0.213394817859374,0.207658879133097,0.20201115889923,0.19646980142671,0.191102380107365,0.185825813714651,0.180671688534505,0.175682953964337,0.170786781183835,0.166028302156696,0.161424263595708,0.156913572633975,0.152554567075941,0.148337116364783,0.144212888428491,0.140252652894191,0.136419618704497,0.132678785435357,0.129112160373201,0.125657381622271,0.122292903339117,0.119110377487442,0.116023805279236,0.113028441095987,0.110212636773004,0.107480475258719,0.104847119770841,0.102372808049453,0.0999777047115129,0.0976867342759074,0.0955339598634749,0.0934552548078404,0.0914834770924906,0.0896292187635928,0.0878432606240513],"fillcolor":"#252525","fill":"tozeroy","type":"scatter","line":{"color":"#252525"},"marker":{"size":0,"color":"#252525","opacity":0},"showlegend":false,"name":"MH","xaxis":"x5","yaxis":"y5"},"drat_HH":{"x":[4.68299503249688,4.69006672053483,4.69713840857278,4.70421009661073,4.71128178464868,4.71835347268662,4.72542516072457,4.73249684876252,4.73956853680047,4.74664022483842,4.75371191287637,4.76078360091431,4.76785528895226,4.77492697699021,4.78199866502816,4.78907035306611,4.79614204110406,4.803213729142,4.81028541717995,4.8173571052179,4.82442879325585,4.8315004812938,4.83857216933175,4.8456438573697,4.85271554540764,4.85978723344559,4.86685892148354,4.87393060952149,4.88100229755944,4.88807398559739,4.89514567363533,4.90221736167328,4.90928904971123,4.91636073774918,4.92343242578713,4.93050411382508,4.93757580186302,4.94464748990097,4.95171917793892,4.95879086597687,4.96586255401482,4.97293424205277,4.98000593009071,4.98707761812866,4.99414930616661,5.00122099420456,5.00829268224251,5.01536437028046,5.02243605831841,5.02950774635635,5.0365794343943,5.04365112243225,5.0507228104702,5.05779449850815,5.0648661865461,5.07193787458404,5.07900956262199,5.08608125065994,5.09315293869789,5.10022462673584,5.10729631477379,5.11436800281173,5.12143969084968,5.12851137888763,5.13558306692558,5.14265475496353,5.14972644300148,5.15679813103942,5.16386981907737,5.17094150711532,5.17801319515327,5.18508488319122,5.19215657122917,5.19922825926711,5.20629994730506,5.21337163534301,5.22044332338096,5.22751501141891,5.23458669945686,5.24165838749481,5.24873007553275,5.2558017635707,5.26287345160865,5.2699451396466,5.27701682768455,5.28408851572249,5.29116020376044,5.29823189179839,5.30530357983634,5.31237526787429,5.31944695591224,5.32651864395019,5.33359033198813,5.34066202002608,5.34773370806403,5.35480539610198,5.36187708413993,5.36894877217788,5.37602046021582,5.38309214825377,5.39016383629172,5.39723552432967,5.40430721236762,5.41137890040557,5.41845058844351,5.42552227648146,5.43259396451941,5.43966565255736,5.44673734059531,5.45380902863326,5.4608807166712,5.46795240470915,5.4750240927471,5.48209578078505,5.489167468823,5.49623915686095,5.50331084489889,5.51038253293684,5.51745422097479,5.52452590901274,5.53159759705069,5.53866928508864,5.54574097312658,5.55281266116453,5.55988434920248,5.56695603724043,5.57402772527838,5.58109941331633,5.58817110135428,5.59524278939222,5.60231447743017,5.60938616546812,5.61645785350607,5.62352954154402,5.63060122958197,5.63767291761991,5.64474460565786,5.65181629369581],"y":[0.0861643045796748,0.0845828477546949,0.0830633808239592,0.0816481727534142,0.0803115543022513,0.0790301776545263,0.0778475022961366,0.0767260246757921,0.075652719566355,0.0746698590773017,0.073732666139111,0.0728371653102059,0.0720198206247599,0.0712355226311803,0.0704894944758485,0.0698009834417549,0.0691383143891391,0.068508454662699,0.0679180520984673,0.0673465387202299,0.0668006457502442,0.0662789398661137,0.0657695590206962,0.0652772800884783,0.0647968033611789,0.0643226031531908,0.0638561272176373,0.063391931010813,0.062928591120251,0.0624632579135396,0.0619934075708797,0.0615197159325115,0.0610345144051687,0.0605404844606319,0.0600387105835733,0.05951664454409,0.0589835979480441,0.0584380443619575,0.0578680528827121,0.0572849934693769,0.0566850411993828,0.0560591400429677,0.0554189335152222,0.0547582308786613,0.0540722221713044,0.0533714872508525,0.0526477750661766,0.0519010432689208,0.0511399209281054,0.0503547201422214,0.0495499133125547,0.0487317277559608,0.0478899054777236,0.0470325229812974,0.046163352912548,0.0452725919798901,0.04437050031536,0.0434586827116505,0.0425288839390092,0.0415917848757343,0.0406467001266352,0.0396900241220091,0.0387289004189799,0.0377623990589761,0.0367906440207738,0.0358172075949681,0.0348419598682331,0.0338670482880445,0.0328932139343706,0.0319219319928015,0.0309556051419319,0.0299930099680122,0.0290379179573916,0.0280913036428586,0.0271508885328773,0.0262232728584512,0.0253065252070213,0.0243981901774909,0.0235080423581446,0.0226300616013428,0.0217624021840741,0.0209181605516849,0.0200863960749941,0.0192677404017776,0.0184749137679932,0.0176952492668386,0.0169319230029619,0.0161946622940757,0.0154713779918237,0.0147674441106509,0.0140887999492923,0.0134246036610789,0.0127824060458,0.0121639219228873,0.0115600384076783,0.0109803248890054,0.010422164630995,0.00987847120743849,0.00936056635332832,0.00886167761478031,0.0083768734040371,0.00791888531253314,0.00747718654298145,0.00704898286850894,0.00664802881534727,0.00626060787877881,0.00588684340144014,0.00553836538276831,0.0052016792749556,0.00487927021393215,0.00457850799519002,0.0042885747506125,0.00401315379025245,0.00375590388456989,0.00350847963134866,0.00327544749497075,0.00305737051892234,0.0028481065782589,0.00265280406058665,0.00246956351546983,0.00229414032236862,0.00213199171524095,0.00197936823537383,0.00183360457655234,0.00170023137601797,0.00157421218237953,0.00145414973069361,0.00134545528964852,0.00124229983676381,0.0011445130544793,0.00105649133476231,0.000972775090306194,0.00089417001608152,0.000823180029660474,0.000755818981874328,0.00069320429896242,0.000636433145346664,0.00058269201407897],"fillcolor":"#737373","fill":"tozeroy","type":"scatter","line":{"color":"#737373"},"marker":{"size":0,"color":"#737373","opacity":0},"showlegend":false,"name":"HH","xaxis":"x5","yaxis":"y5"},"rug_mpg":{"type":"scatter","mode":"markers","x":[21,21,22.8,21.4,18.7,18.1,14.3,24.4,22.8,19.2,17.8,16.4,17.3,15.2,10.4,10.4,14.7,32.4,30.4,33.9,21.5,15.5,15.2,13.3,19.2,27.3,26,30.4,15.8,19.7,15,21.4],"y":["rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug"],"marker":{"symbol":"line-ns-open","color":"black"},"xaxis":"x1","yaxis":"y11","name":"rug_mpg","showlegend":false},"rug_cyl":{"type":"bar","mode":"markers","x":null,"y":null,"marker":{"symbol":"line-ns-open","color":"black"},"xaxis":"x2","yaxis":"y12","name":"rug_cyl","showlegend":false},"rug_disp":{"type":"scatter","mode":"markers","x":[160,160,108,258,360,225,360,146.7,140.8,167.6,167.6,275.8,275.8,275.8,472,460,440,78.7,75.7,71.1,120.1,318,304,350,400,79,120.3,95.1,351,145,301,121],"y":["rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug"],"marker":{"symbol":"line-ns-open","color":"black"},"xaxis":"x3","yaxis":"y13","name":"rug_disp","showlegend":false},"rug_hp":{"type":"scatter","mode":"markers","x":[110,110,93,110,175,105,245,62,95,123,123,180,180,180,205,215,230,66,52,65,97,150,150,245,175,66,91,113,264,175,335,109],"y":["rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug"],"marker":{"symbol":"line-ns-open","color":"black"},"xaxis":"x4","yaxis":"y14","name":"rug_hp","showlegend":false},"rug_drat":{"type":"scatter","mode":"markers","x":[3.9,3.9,3.85,3.08,3.15,2.76,3.21,3.69,3.92,3.92,3.92,3.07,3.07,3.07,2.93,3,3.23,4.08,4.93,4.22,3.7,2.76,3.15,3.73,3.08,4.08,4.43,3.77,4.22,3.62,3.54,4.11],"y":["rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug"],"marker":{"symbol":"line-ns-open","color":"black"},"xaxis":"x5","yaxis":"y15","name":"rug_drat","showlegend":false}},"layout":{"xaxis1":{"domain":[0,0.1875],"anchor":"y11","showgrid":false,"showline":false,"zeroline":false},"xaxis2":{"domain":[0.2125,0.3875],"anchor":"y12","showgrid":false,"showline":false,"zeroline":false},"xaxis3":{"domain":[0.4125,0.5875],"anchor":"y13","showgrid":false,"showline":false,"zeroline":false},"xaxis4":{"domain":[0.6125,0.7875],"anchor":"y14","showgrid":false,"showline":false,"zeroline":false},"xaxis5":{"domain":[0.8125,1],"anchor":"y15","showgrid":false,"showline":false,"zeroline":false},"yaxis1":{"domain":[0.9,1],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false},"yaxis2":{"domain":[0.9,1],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false},"yaxis3":{"domain":[0.9,1],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false},"yaxis4":{"domain":[0.9,1],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false},"yaxis5":{"domain":[0.9,1],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false},"yaxis11":{"domain":[0.89,0.899],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false,"anchor":"x1"},"yaxis12":{"domain":[0.89,0.899],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false,"anchor":"x2"},"yaxis13":{"domain":[0.89,0.899],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false,"anchor":"x3"},"yaxis14":{"domain":[0.89,0.899],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false,"anchor":"x4"},"yaxis15":{"domain":[0.89,0.899],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false,"anchor":"x5"}},"shapes":{},"shapes_original":{},"map_curve":[[5,6,9,14,23],[5,6,9,14,22],[5,6,9,15,21],[1,8,13,17,19],[1,8,12,18,21],[3,7,11,15,19],[3,7,10,16,21],[3,7,10,17,21],[3,7,10,15,21],[3,8,13,17,19],[3,8,12,17,19],[3,8,12,17,20],[4,6,9,15,21],[4,6,9,15,22],[4,6,10,14,21],[4,6,10,15,21],[4,7,11,15,19],[2,8,13,17,20],[2,8,12,18,21],[2,8,12,18,22],[2,8,12,18,20],[2,8,12,16,19],[2,8,12,16,20],[2,8,12,17,19]],"map_trace_2_shape":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"map_type":[["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"],["scatter","bar","scatter","scatter","scatter"]],"map_color":[["#710500","#BDBDBD","#BDBDBD","#BDBDBD","#737373"],["#710500","#BDBDBD","#BDBDBD","#BDBDBD","#252525"],["#710500","#BDBDBD","#BDBDBD","#525252","#969696"],["#FF0065","#969696","#737373","#252525","#BDBDBD"],["#FF0065","#969696","#252525","#737373","#969696"],["#A56F2B","#525252","#969696","#525252","#BDBDBD"],["#A56F2B","#525252","#525252","#969696","#969696"],["#A56F2B","#525252","#525252","#252525","#969696"],["#A56F2B","#525252","#525252","#525252","#969696"],["#A56F2B","#969696","#737373","#252525","#BDBDBD"],["#A56F2B","#969696","#252525","#252525","#BDBDBD"],["#A56F2B","#969696","#252525","#252525","#525252"],["#005EAA","#BDBDBD","#BDBDBD","#525252","#969696"],["#005EAA","#BDBDBD","#BDBDBD","#525252","#252525"],["#005EAA","#BDBDBD","#525252","#BDBDBD","#969696"],["#005EAA","#BDBDBD","#525252","#525252","#969696"],["#005EAA","#525252","#969696","#525252","#BDBDBD"],["#009850","#969696","#737373","#252525","#525252"],["#009850","#969696","#252525","#737373","#969696"],["#009850","#969696","#252525","#737373","#252525"],["#009850","#969696","#252525","#737373","#525252"],["#009850","#969696","#252525","#969696","#BDBDBD"],["#009850","#969696","#252525","#969696","#525252"],["#009850","#969696","#252525","#252525","#BDBDBD"]],"parcats_cols":["#710500","#710500","#710500","#FF0065","#FF0065","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#009850","#009850","#009850","#009850","#009850","#009850","#009850"],"imp":false},"evals":[],"jsHooks":[]}

Parcats from model response alluvial

Machine Learning models operate in a multidimensional space and their response is hard to visualise. Model response and partial dependency plots attempt to visualise ML models in a two dimensional space. Using alluvial plots or parrallel categories diagrams we can increase the number of dimensions.

Here we see the response of a random forest model if we vary the three variables with the highest importance while keeping all other features at their median/mode value.

df = select(mtcars2, -ids )m = randomForest::randomForest( disp ~ ., df)imp = m$importancedspace = get_data_space(df, imp, degree = 3)pred = predict(m, newdata = dspace)p = alluvial_model_response(pred, dspace, imp, degree = 3)parcats(p, marginal_histograms = TRUE, imp = TRUE, data_input = df)

{"x":{"traces":{"parcats":{"type":"parcats","dimensions":[{"label":"pred","values":["HH\n(304,355]","HH\n(304,355]","HH\n(304,355]","HH\n(304,355]","HH\n(304,355]","HH\n(304,355]","HH\n(304,355]","LL\n(139,179]","LL\n(139,179]","LL\n(139,179]","LL\n(139,179]","LL\n(139,179]","LL\n(139,179]","LL\n(139,179]","LL\n(139,179]","LL\n(139,179]","LL\n(139,179]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","M\n(217,260]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","MH\n(260,304]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]","ML\n(179,217]"],"categoryorder":"array","categoryarray":["HH\n(304,355]","MH\n(260,304]","M\n(217,260]","ML\n(179,217]","LL\n(139,179]"]},{"label":"cyl","values":["8","8","8","8","8","8","8","4","4","4","4","4","4","6","6","6","6","4","4","4","4","6","6","6","6","6","6","6","6","6","8","8","8","8","8","8","8","8","4","4","4","4","6","6","6","6","8","8","8","8","8","8","8","8","8","8","4","4","4","4","4","4","4","4","4","4","4","6","6","6","6","6","6","6","6"],"categoryorder":"array","categoryarray":["8","6","4"]},{"label":"mpg","values":["10.4","10.4","10.4","14.7","14.7","19.45","19.45","19.45","19.45","30.4","30.4","33.9","33.9","30.4","30.4","33.9","33.9","10.4","14.7","19.45","19.45","10.4","14.7","19.45","19.45","19.45","30.4","30.4","33.9","33.9","19.45","19.45","30.4","30.4","30.4","33.9","33.9","33.9","10.4","10.4","14.7","14.7","10.4","10.4","14.7","14.7","10.4","10.4","14.7","14.7","14.7","19.45","30.4","30.4","33.9","33.9","10.4","10.4","14.7","14.7","19.45","30.4","30.4","30.4","33.9","33.9","33.9","10.4","10.4","14.7","14.7","19.45","19.45","30.4","33.9"],"categoryorder":"array","categoryarray":["33.9","30.4","19.45","14.7","10.4"]},{"label":"wt","values":["3.44","5.3","5.424","5.3","5.424","5.3","5.424","1.513","2.04","1.513","2.04","1.513","2.04","1.513","2.04","1.513","2.04","3.44","3.44","5.3","5.424","3.44","3.44","3.44","5.3","5.424","5.3","5.424","5.3","5.424","1.513","2.04","1.513","2.04","3.44","1.513","2.04","3.44","5.3","5.424","5.3","5.424","5.3","5.424","5.3","5.424","1.513","2.04","1.513","2.04","3.44","3.44","5.3","5.424","5.3","5.424","1.513","2.04","1.513","2.04","3.44","3.44","5.3","5.424","3.44","5.3","5.424","1.513","2.04","1.513","2.04","1.513","2.04","3.44","3.44"],"categoryorder":"array","categoryarray":["5.424","5.3","3.44","2.04","1.513"]}],"counts":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"line":{"shape":"hspline","color":["#710500","#710500","#710500","#710500","#710500","#710500","#710500","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850"]},"hoveron":"color","hoverinfo":"count+probability","labelfont":{"size":24,"color":"black"},"arrangement":"perpendicular","bundlecolors":true,"sortpaths":"forward","tickfont":null,"domain":{"y":[0,0.7],"x":[0,0.85]}},"pred_LL\n(139,179]":{"x":[82.9782156121377,83.621510977213,84.2648063422884,84.9081017073637,85.551397072439,86.1946924375144,86.8379878025897,87.4812831676651,88.1245785327404,88.7678738978158,89.4111692628911,90.0544646279665,90.6977599930418,91.3410553581172,91.9843507231925,92.6276460882679,93.2709414533432,93.9142368184186,94.5575321834939,95.2008275485693,95.8441229136446,96.4874182787199,97.1307136437953,97.7740090088706,98.417304373946,99.0605997390213,99.7038951040967,100.347190469172,100.990485834247,101.633781199323,102.277076564398,102.920371929473,103.563667294549,104.206962659624,104.850258024699,105.493553389775,106.13684875485,106.780144119925,107.423439485001,108.066734850076,108.710030215152,109.353325580227,109.996620945302,110.639916310378,111.283211675453,111.926507040528,112.569802405604,113.213097770679,113.856393135754,114.49968850083,115.142983865905,115.78627923098,116.429574596056,117.072869961131,117.716165326206,118.359460691282,119.002756056357,119.646051421432,120.289346786508,120.932642151583,121.575937516658,122.219232881734,122.862528246809,123.505823611884,124.14911897696,124.792414342035,125.435709707111,126.079005072186,126.722300437261,127.365595802337,128.008891167412,128.652186532487,129.295481897563,129.938777262638,130.582072627713,131.225367992789,131.868663357864,132.511958722939,133.155254088015,133.79854945309,134.441844818165,135.085140183241,135.728435548316,136.371730913391,137.015026278467,137.658321643542,138.301617008617,138.944912373693,139.588207738768,140.231503103844,140.874798468919,141.518093833994,142.16138919907,142.804684564145,143.44797992922,144.091275294296,144.734570659371,145.377866024446,146.021161389522,146.664456754597,147.307752119672,147.951047484748,148.594342849823,149.237638214898,149.880933579974,150.524228945049,151.167524310124,151.8108196752,152.454115040275,153.09741040535,153.740705770426,154.384001135501,155.027296500576,155.670591865652,156.313887230727,156.957182595803,157.600477960878,158.243773325953,158.887068691029,159.530364056104,160.173659421179,160.816954786255,161.46025015133,162.103545516405,162.746840881481,163.390136246556,164.033431611631,164.676726976707,165.320022341782,165.963317706857,166.606613071933,167.249908437008,167.893203802083,168.536499167159,169.179794532234,169.823089897309,170.466385262385,171.10968062746,171.752975992535,172.396271357611,173.039566722686,173.682862087762,174.326157452837,174.969452817912,175.612748182988,176.256043548063,176.899338913138,177.542634278214,178.185929643289,178.829225008364],"y":[1.18349300672317e-005,1.31362615140238e-005,1.45752955462177e-005,1.61216630673436e-005,1.78249272587213e-005,1.97177557097314e-005,2.17469723394139e-005,2.39537602588016e-005,2.64164877605901e-005,2.90501932021072e-005,3.18803538605508e-005,3.50497625874295e-005,3.84305949716477e-005,4.20254494868392e-005,4.60577521710882e-005,5.03500476001249e-005,5.49032749778138e-005,5.99437174047514e-005,6.53332877030463e-005,7.10364145750686e-005,7.72723234392219e-005,8.3965052730916e-005,9.10290579543201e-005,9.86643557332607e-005,0.000106883369658998,0.000115535405367745,0.000124787168323676,0.000134768367994823,0.000145246795434645,0.000156340327355346,0.000168326146949595,0.000180873771663876,0.000194036125517386,0.000208267469108473,0.00022312296567343,0.000238606286377846,0.000255281376690584,0.000272669026193264,0.00029074091313901,0.000310004221674568,0.000330122239625834,0.000350971809994597,0.000372985048149171,0.000395992947050304,0.000419766981385457,0.000444648734902174,0.000470654331384433,0.000497444307075707,0.000525258760398359,0.000554305586194218,0.000584135360493198,0.000614881846378568,0.000646937838306943,0.000679752881673362,0.000713357022881148,0.000748305432539348,0.000783964560159716,0.00082033051566928,0.000857905254620857,0.000896175781557351,0.000935077312133168,0.000974966632749883,0.00101552377683356,0.00105661137145609,0.00109845399823883,0.00114088517127415,0.00118372360046047,0.00122708389902309,0.00127089826549525,0.00131497767562503,0.00135935716571286,0.00140400052162864,0.00144875279691972,0.00149360607034673,0.00153848072380457,0.00158330068214013,0.00162805525644,0.00167254420365193,0.00171681480585584,0.00176085738495512,0.00180438845444317,0.00184750884624446,0.00189024690631615,0.00193228549575392,0.00197370040196629,0.002014595901766,0.0020546665875559,0.00209389537073432,0.0021324927681112,0.00217020441167884,0.00220686801833417,0.00224282029344384,0.00227788770280306,0.00231173176533954,0.00234482212107027,0.00237708355554794,0.00240799610165813,0.00243815387382184,0.00246755796746923,0.002495605793687,0.00252291545176647,0.00254951702441347,0.00257495962565013,0.00259966219046495,0.00262374443270086,0.00264690723178408,0.00266939394187115,0.00269138722392702,0.00271272401811171,0.00273352259682736,0.00275398874070915,0.00277406561321137,0.00279381997539868,0.00281343029165881,0.00283290459427182,0.00285234923879475,0.00287185767475502,0.00289145328588863,0.00291138390986829,0.00293159690393283,0.00295210572770615,0.00297331914303937,0.0029950638782964,0.00301732441095049,0.00304058001415656,0.00306467270866725,0.00308949325874094,0.00311553130851958,0.00314274698222827,0.00317088658096741,0.00320039262175948,0.00323143747038247,0.00326357914380725,0.0032971616481475,0.00333264877597166,0.00336937632228348,0.0034075474424644,0.00344797631061095,0.00348975482637023,0.00353291435154576,0.00357865393996702,0.00362581400165452,0.00367439712230304,0.00372551177609455,0.00377823694592454,0.00383241071680069,0.0038889430468346,0.0039472602651016,0.00400700753046695,0.00406887880496034],"fillcolor":"#FF0065","fill":"tozeroy","type":"scatter","line":{"color":"#FF0065"},"marker":{"size":0,"color":"#FF0065","opacity":0},"showlegend":false,"name":"LL\n(139,179]","xaxis":"x1","yaxis":"y1"},"pred_ML\n(179,217]":{"x":[179.47252037344,180.115815738515,180.75911110359,181.402406468666,182.045701833741,182.688997198816,183.332292563892,183.975587928967,184.618883294042,185.262178659118,185.905474024193,186.548769389268,187.192064754344,187.835360119419,188.478655484495,189.12195084957,189.765246214645,190.408541579721,191.051836944796,191.695132309871,192.338427674947,192.981723040022,193.625018405097,194.268313770173,194.911609135248,195.554904500323,196.198199865399,196.841495230474,197.484790595549,198.128085960625,198.7713813257,199.414676690775,200.057972055851,200.701267420926,201.344562786001,201.987858151077,202.631153516152,203.274448881227,203.917744246303,204.561039611378,205.204334976454,205.847630341529,206.490925706604,207.13422107168,207.777516436755,208.42081180183,209.064107166906,209.707402531981,210.350697897056,210.993993262132,211.637288627207,212.280583992282,212.923879357358,213.567174722433,214.210470087508,214.853765452584,215.497060817659,216.140356182734,216.78365154781],"y":[0.00413265126884997,0.00419778952245093,0.00426476947119892,0.00433369177315342,0.00440386894123369,0.0044755727919986,0.0045491683689261,0.00462386098079083,0.00469974863380599,0.00477736991254737,0.0048558841454382,0.00493527778144556,0.00501609393549737,0.00509757033356876,0.00517967394939222,0.00526266447503925,0.00534608736310654,0.00542984464514311,0.00551396431941466,0.00559817700290731,0.00568239596854297,0.00576648469263578,0.00585021141482558,0.00593358843989014,0.00601639488257165,0.00609827018195166,0.0061794215280805,0.00625963321984301,0.00633823880657459,0.00641573957900176,0.0064920192027183,0.00656592779494481,0.00663835754873243,0.00670928622464332,0.00677720936900152,0.00684320280817123,0.00690734538329141,0.00696816668186402,0.00702646715225599,0.00708260523806231,0.00713524842265674,0.00718476128165648,0.00723185303717025,0.00727542013881579,0.00731526268216764,0.00735249114209777,0.00738630271124475,0.00741584721841932,0.0074426607563817,0.00746628835772021,0.0074851950224826,0.00750133684105731,0.00751462539296872,0.00752286243817076,0.00752838660394547,0.00753120442136944,0.00752931381649277,0.00752458625752203,0.00751729548345952],"fillcolor":"#009850","fill":"tozeroy","type":"scatter","line":{"color":"#009850"},"marker":{"size":0,"color":"#009850","opacity":0},"showlegend":false,"name":"ML\n(179,217]","xaxis":"x1","yaxis":"y1"},"pred_M\n(217,260]":{"x":[217.426946912885,218.07024227796,218.713537643036,219.356833008111,220.000128373186,220.643423738262,221.286719103337,221.930014468413,222.573309833488,223.216605198563,223.859900563639,224.503195928714,225.146491293789,225.789786658865,226.43308202394,227.076377389015,227.719672754091,228.362968119166,229.006263484241,229.649558849317,230.292854214392,230.936149579467,231.579444944543,232.222740309618,232.866035674693,233.509331039769,234.152626404844,234.795921769919,235.439217134995,236.08251250007,236.725807865146,237.369103230221,238.012398595296,238.655693960372,239.298989325447,239.942284690522,240.585580055598,241.228875420673,241.872170785748,242.515466150824,243.158761515899,243.802056880974,244.44535224605,245.088647611125,245.7319429762,246.375238341276,247.018533706351,247.661829071426,248.305124436502,248.948419801577,249.591715166652,250.235010531728,250.878305896803,251.521601261878,252.164896626954,252.808191992029,253.451487357105,254.09478272218,254.738078087255,255.381373452331,256.024668817406,256.667964182481,257.311259547557,257.954554912632,258.597850277707,259.241145642783,259.884441007858],"y":[0.00750590968205826,0.00749159365552901,0.00747493476935399,0.00745485095244573,0.00743187766447801,0.00740684853857829,0.00737908218139852,0.00734860837847398,0.00731641859657785,0.00728215987758611,0.00724551521114029,0.00720753112848709,0.00716809450550155,0.00712672219479009,0.00708440641904528,0.00704117152347924,0.0069965712503122,0.00695142050292964,0.00690574800919053,0.00685944462424578,0.00681292985166948,0.00676627488391534,0.00671959709850942,0.00667310926099652,0.00662683304093081,0.00658100705564958,0.00653581128847502,0.00649113804938422,0.00644725322472183,0.00640445313422467,0.00636243750107766,0.00632142121529459,0.00628193405312699,0.00624343932874222,0.00620604108877074,0.00617058356027493,0.00613627040210257,0.00610310922956318,0.00607213815675182,0.00604246234436936,0.00601403002016635,0.00598774232482581,0.00596295978257278,0.00593945898661511,0.0059179683042822,0.00589814529930168,0.00587959252323154,0.00586284874788075,0.00584787523475106,0.00583411470872848,0.00582191673911155,0.00581152113368676,0.00580223976612447,0.00579424871445131,0.00578801288482564,0.00578275517813969,0.00577850735978064,0.00577588123271137,0.00577406376107632,0.00577304349893593,0.00577329908898643,0.00577422472375811,0.0057757464791382,0.00577812266375788,0.00578099521824366,0.00578423818630262,0.00578793464456412],"fillcolor":"#A56F2B","fill":"tozeroy","type":"scatter","line":{"color":"#A56F2B"},"marker":{"size":0,"color":"#A56F2B","opacity":0},"showlegend":false,"name":"M\n(217,260]","xaxis":"x1","yaxis":"y1"},"pred_MH\n(260,304]":{"x":[260.527736372933,261.171031738009,261.814327103084,262.457622468159,263.100917833235,263.74421319831,264.387508563385,265.030803928461,265.674099293536,266.317394658611,266.960690023687,267.603985388762,268.247280753838,268.890576118913,269.533871483988,270.177166849064,270.820462214139,271.463757579214,272.10705294429,272.750348309365,273.39364367444,274.036939039516,274.680234404591,275.323529769666,275.966825134742,276.610120499817,277.253415864892,277.896711229968,278.540006595043,279.183301960118,279.826597325194,280.469892690269,281.113188055344,281.75648342042,282.399778785495,283.04307415057,283.686369515646,284.329664880721,284.972960245797,285.616255610872,286.259550975947,286.902846341023,287.546141706098,288.189437071173,288.832732436249,289.476027801324,290.119323166399,290.762618531475,291.40591389655,292.049209261625,292.692504626701,293.335799991776,293.979095356851,294.622390721927,295.265686087002,295.908981452077,296.552276817153,297.195572182228,297.838867547303,298.482162912379,299.125458277454,299.76875364253,300.412049007605,301.05534437268,301.698639737756,302.341935102831,302.985230467906,303.628525832982],"y":[0.00579187491153447,0.00579594013647013,0.00580009229913426,0.00580415652969461,0.00580808625404117,0.00581178338068315,0.00581498509277794,0.00581778563505485,0.00582009207482553,0.00582142770787804,0.00582209624063812,0.00582207603777555,0.00582055443995055,0.00581810947639783,0.00581472630527955,0.00580952912331577,0.00580304389862755,0.00579538582974898,0.0057857072384213,0.00577434457801435,0.00576160459404404,0.00574673639582299,0.00572978317938342,0.00571128763222611,0.00569065375921433,0.00566755278433636,0.00564279210067048,0.00561597407132224,0.00558635103947934,0.0055550049016877,0.00552176192319904,0.00548544543124893,0.00544740041096581,0.00540762811263648,0.00536471536462375,0.00532007344002397,0.00527376307257532,0.00522466717581755,0.00517374419265367,0.00512126870213805,0.00506642009157275,0.00500973396627913,0.00495166340308848,0.00489166326654758,0.00482991250058328,0.00476698995227205,0.00470258616908238,0.00463661996803717,0.00456972959378377,0.00450178653001863,0.00443256842672242,0.0043626976419083,0.00429216163089447,0.00422072894148987,0.0041489271687997,0.00407677370872316,0.00400421140321219,0.00393154795527856,0.00385881615953029,0.00378614427878749,0.00371366786147809,0.00364139475079032,0.00356956111441377,0.00349826315786276,0.00342741907251446,0.00335729966199992,0.00328808323743338,0.00321954259430346],"fillcolor":"#005EAA","fill":"tozeroy","type":"scatter","line":{"color":"#005EAA"},"marker":{"size":0,"color":"#005EAA","opacity":0},"showlegend":false,"name":"MH\n(260,304]","xaxis":"x1","yaxis":"y1"},"pred_HH\n(304,355]":{"x":[304.271821198057,304.915116563132,305.558411928208,306.201707293283,306.845002658358,307.488298023434,308.131593388509,308.774888753584,309.41818411866,310.061479483735,310.70477484881,311.348070213886,311.991365578961,312.634660944036,313.277956309112,313.921251674187,314.564547039262,315.207842404338,315.851137769413,316.494433134489,317.137728499564,317.781023864639,318.424319229715,319.06761459479,319.710909959865,320.354205324941,320.997500690016,321.640796055091,322.284091420167,322.927386785242,323.570682150317,324.213977515393,324.857272880468,325.500568245543,326.143863610619,326.787158975694,327.430454340769,328.073749705845,328.71704507092,329.360340435995,330.003635801071,330.646931166146,331.290226531221,331.933521896297,332.576817261372,333.220112626448,333.863407991523,334.506703356598,335.149998721674,335.793294086749,336.436589451824,337.0798848169,337.723180181975,338.36647554705,339.009770912126,339.653066277201,340.296361642276,340.939657007352,341.582952372427,342.226247737502,342.869543102578,343.512838467653,344.156133832728,344.799429197804,345.442724562879,346.086019927954,346.72931529303,347.372610658105,348.01590602318,348.659201388256,349.302496753331,349.945792118407,350.589087483482,351.232382848557,351.875678213633,352.518973578708,353.162268943783,353.805564308859,354.448859673934,355.092155039009,355.735450404085,356.37874576916,357.022041134235,357.665336499311,358.308631864386,358.951927229461,359.595222594537,360.238517959612,360.881813324687,361.525108689763,362.168404054838,362.811699419913,363.454994784989,364.098290150064,364.741585515139,365.384880880215,366.02817624529,366.671471610366,367.314766975441,367.958062340516,368.601357705592,369.244653070667,369.887948435742,370.531243800818,371.174539165893,371.817834530968,372.461129896044,373.104425261119,373.747720626194,374.39101599127,375.034311356345,375.67760672142,376.320902086496,376.964197451571,377.607492816646,378.250788181722,378.894083546797,379.537378911873,380.180674276948,380.823969642023,381.467265007099,382.110560372174,382.753855737249,383.397151102325,384.0404464674,384.683741832475,385.327037197551,385.970332562626,386.613627927701,387.256923292777,387.900218657852,388.543514022927,389.186809388003,389.830104753078,390.473400118153,391.116695483229,391.759990848304,392.403286213379,393.046581578455,393.68987694353,394.333172308605,394.976467673681,395.619763038756,396.263058403832,396.906353768907,397.549649133982,398.192944499058,398.836239864133,399.479535229208,400.122830594284,400.766125959359,401.409421324434,402.05271668951,402.696012054585,403.33930741966,403.982602784736,404.625898149811,405.269193514886,405.912488879962,406.555784245037,407.199079610112,407.842374975188,408.485670340263,409.128965705338,409.772261070414,410.415556435489,411.058851800564,411.70214716564],"y":[0.00315191812597834,0.00308557364449212,0.00302009271363449,0.00295563139390236,0.00289281967126723,0.0028310217732649,0.00277026839465774,0.00271151106765119,0.00265387901047493,0.00259737740457153,0.00254292684774274,0.0024898019260284,0.00243787731679194,0.0023879378984841,0.00233952440984393,0.00229234487937216,0.00224702419790709,0.00220339821360495,0.00216100663193544,0.00212030298156762,0.00208142404738061,0.00204375038521449,0.00200756415272547,0.00197328867694695,0.00194016367401316,0.00190830956471743,0.00187840484586301,0.00184957406240817,0.00182181208305643,0.00179595154315274,0.00177108910768734,0.00174719962405905,0.00172491296615952,0.00170363463649453,0.00168321939110065,0.00166411536752299,0.00164599080238318,0.00162860876020425,0.00161226171512524,0.00159682607560373,0.00158200487472534,0.00156796464771658,0.00155472978790416,0.00154197686795675,0.00152977852255899,0.00151824407628553,0.00150705778833069,0.00149623140714875,0.00148589603573775,0.00147577697042727,0.00146586631013361,0.00145623063221246,0.00144669326801655,0.00143723833356578,0.00142784450178106,0.00141842909797136,0.00140897909300687,0.00139942024701118,0.00138970471714879,0.00137984977523305,0.00136976032153189,0.00135937165264233,0.00134875403081968,0.00133781914928659,0.00132644380595674,0.0013147678844668,0.00130273182313232,0.0012901245136512,0.00127716497440944,0.00126383761399671,0.00124982780755018,0.00123543539889058,0.00122065938530364,0.00120519228700863,0.0011892966896071,0.0011730106685066,0.00115608637804087,0.00113869585541298,0.00112092914016404,0.00110260427072853,0.00108380199876622,0.00106465723203905,0.00104505244167612,0.00102498964253664,0.00100463506712812,0.00098392731740991,0.000962813549432982,0.000941472576926237,0.000919885251089797,0.000897976405454503,0.000875915084570257,0.000853706014605328,0.000831291216005292,0.000808804338274916,0.000786250934753227,0.00076364058642109,0.000741037240426605,0.000718450265253838,0.000695935203244546,0.000673524595912053,0.000651211091710221,0.000629073793359097,0.000607152100304718,0.000585402655331126,0.000563906627999134,0.000542745523392684,0.000521823380019974,0.00050120428608512,0.000481041649232443,0.000461174101813204,0.000441632935933402,0.00042266605296332,0.000404038397701593,0.000385752298356304,0.00036811827389707,0.000350870386938221,0.000333994455692467,0.000317764430095887,0.000301989876116534,0.000286605135023275,0.00027183685281751,0.000257584277866654,0.000243727560436488,0.000230439932313504,0.000217716380720113,0.000205384126613517,0.000193561081268578,0.000182336802111448,0.000171490206169143,0.000161085548898976,0.000151299823718482,0.000141870868331537,0.000132813756583472,0.000124381283912078,0.000116279198071468,0.000108505742755815,0.000101297272785356,9.44150053074537e-005,8.78310931278344e-005,8.17225216057346e-005,7.59428819755472e-005,7.0429464646624e-005,6.53075776163293e-005,6.05087769817805e-005,5.59436352379888e-005,5.16940831111314e-005,4.77544918536948e-005,4.4016746787254e-005,4.05277123293664e-005,3.73297320104891e-005,3.43034548742255e-005,3.14685419700613e-005,2.89015625188692e-005,2.64784734326705e-005,2.41988264923919e-005,2.21613002546266e-005,2.02426027527795e-005,1.84413355642241e-005,1.68290188134371e-005,1.53264588484724e-005,1.39194892568057e-005,1.26559453123746e-005,1.14922101287676e-005,1.04052166696448e-005,9.42509045900005e-006,8.53367586446659e-006,7.70303438257385e-006,6.9504791184998e-006],"fillcolor":"#710500","fill":"tozeroy","type":"scatter","line":{"color":"#710500"},"marker":{"size":0,"color":"#710500","opacity":0},"showlegend":false,"name":"HH\n(304,355]","xaxis":"x1","yaxis":"y1"},"cyl_4\nHH: 0\nMH: 0.22\nM: 0.19\nML: 0.58\nLL: 0.6":{"x":["4"],"y":[11],"type":"bar","marker":{"color":"#BDBDBD"},"showlegend":false,"name":"cyl_4\nHH: 0\nMH: 0.22\nM: 0.19\nML: 0.58\nLL: 0.6","xaxis":"x2","yaxis":"y2"},"cyl_6\nHH: 0\nMH: 0.22\nM: 0.43\nML: 0.42\nLL: 0.4":{"x":["6"],"y":[7],"type":"bar","marker":{"color":"#525252"},"showlegend":false,"name":"cyl_6\nHH: 0\nMH: 0.22\nM: 0.43\nML: 0.42\nLL: 0.4","xaxis":"x2","yaxis":"y2"},"cyl_8\nHH: 1\nMH: 0.56\nM: 0.38\nML: 0\nLL: 0":{"x":["8"],"y":[14],"type":"bar","marker":{"color":"#969696"},"showlegend":false,"name":"cyl_8\nHH: 1\nMH: 0.56\nM: 0.38\nML: 0\nLL: 0","xaxis":"x2","yaxis":"y2"},"mpg_dens":{"x":[2.96996268656716,3.04503132575868,3.1200999649502,3.19516860414172,3.27023724333324,3.34530588252475,3.42037452171627,3.49544316090779,3.57051180009931,3.64558043929083,3.72064907848234,3.79571771767386,3.87078635686538,3.9458549960569,4.02092363524842,4.09599227443993,4.17106091363145,4.24612955282297,4.32119819201449,4.396266831206,4.47133547039752,4.54640410958904,4.62147274878056,4.69654138797208,4.77161002716359,4.84667866635511,4.92174730554663,4.99681594473815,5.07188458392967,5.14695322312118,5.2220218623127,5.29709050150422,5.37215914069574,5.44722777988726,5.52229641907877,5.59736505827029,5.67243369746181,5.74750233665333,5.82257097584485,5.89763961503636,5.97270825422788,6.0477768934194,6.12284553261092,6.19791417180244,6.27298281099395,6.34805145018547,6.42312008937699,6.49818872856851,6.57325736776003,6.64832600695154,6.72339464614306,6.79846328533458,6.8735319245261,6.94860056371762,7.02366920290913,7.09873784210065,7.17380648129217,7.24887512048369,7.3239437596752,7.39901239886672,7.47408103805824,7.54914967724976,7.62421831644128,7.69928695563279,7.77435559482431,7.84942423401583,7.92449287320735,7.99956151239887,8.07463015159038,8.1496987907819,8.22476742997342,8.29983606916494,8.37490470835646,8.44997334754797,8.52504198673949,8.60011062593101,8.67517926512253,8.75024790431405,8.82531654350556,8.90038518269708,8.9754538218886,9.05052246108012,9.12559110027163,9.20065973946315,9.27572837865467,9.35079701784619,9.42586565703771,9.50093429622923,9.57600293542074,9.65107157461226,9.72614021380378,9.8012088529953,9.87627749218682,9.95134613137833,10.0264147705699,10.1014834097614,10.1765520489529,10.2516206881444,10.3266893273359,10.4017579665274,10.476826605719,10.5518952449105,10.626963884102,10.7020325232935,10.777101162485,10.8521698016765,10.9272384408681,11.0023070800596,11.0773757192511,11.1524443584426,11.2275129976341,11.3025816368257,11.3776502760172,11.4527189152087,11.5277875544002,11.6028561935917,11.6779248327832,11.7529934719748,11.8280621111663,11.9031307503578,11.9781993895493,12.0532680287408,12.1283366679324,12.2034053071239,12.2784739463154,12.3535425855069,12.4286112246984,12.5036798638899,12.5787485030815,12.653817142273,12.7288857814645,12.803954420656,12.8790230598475,12.9540916990391,13.0291603382306,13.1042289774221,13.1792976166136,13.2543662558051,13.3294348949966,13.4045035341882,13.4795721733797,13.5546408125712,13.6297094517627,13.7047780909542,13.7798467301457,13.8549153693373,13.9299840085288,14.0050526477203,14.0801212869118,14.1551899261033,14.2302585652949,14.3053272044864,14.3803958436779,14.4554644828694,14.5305331220609,14.6056017612524,14.680670400444,14.7557390396355,14.830807678827,14.9058763180185,14.98094495721,15.0560135964016,15.1310822355931,15.2061508747846,15.2812195139761,15.3562881531676,15.4313567923591,15.5064254315507,15.5814940707422,15.6565627099337,15.7316313491252,15.8066999883167,15.8817686275083,15.9568372666998,16.0319059058913,16.1069745450828,16.1820431842743,16.2571118234658,16.3321804626574,16.4072491018489,16.4823177410404,16.5573863802319,16.6324550194234,16.7075236586149,16.7825922978065,16.857660936998,16.9327295761895,17.007798215381,17.0828668545725,17.1579354937641,17.2330041329556,17.3080727721471,17.3831414113386,17.4582100505301,17.5332786897216,17.6083473289132,17.6834159681047,17.7584846072962,17.8335532464877,17.9086218856792,17.9836905248708,18.0587591640623,18.1338278032538,18.2088964424453,18.2839650816368,18.3590337208283,18.4341023600199,18.5091709992114,18.5842396384029,18.6593082775944,18.7343769167859,18.8094455559775,18.884514195169,18.9595828343605,19.034651473552,19.1097201127435,19.184788751935,19.2598573911266,19.3349260303181,19.4099946695096,19.4850633087011,19.5601319478926,19.6352005870841,19.7102692262757,19.7853378654672,19.8604065046587,19.9354751438502,20.0105437830417,20.0856124222333,20.1606810614248,20.2357497006163,20.3108183398078,20.3858869789993,20.4609556181908,20.5360242573824,20.6110928965739,20.6861615357654,20.7612301749569,20.8362988141484,20.91136745334,20.9864360925315,21.061504731723,21.1365733709145,21.211642010106,21.2867106492975,21.3617792884891,21.4368479276806,21.5119165668721,21.5869852060636,21.6620538452551,21.7371224844467,21.8121911236382,21.8872597628297,21.9623284020212,22.0373970412127,22.1124656804042,22.1875343195958,22.2626029587873,22.3376715979788,22.4127402371703,22.4878088763618,22.5628775155533,22.6379461547449,22.7130147939364,22.7880834331279,22.8631520723194,22.9382207115109,23.0132893507025,23.088357989894,23.1634266290855,23.238495268277,23.3135639074685,23.38863254666,23.4637011858516,23.5387698250431,23.6138384642346,23.6889071034261,23.7639757426176,23.8390443818092,23.9141130210007,23.9891816601922,24.0642502993837,24.1393189385752,24.2143875777667,24.2894562169583,24.3645248561498,24.4395934953413,24.5146621345328,24.5897307737243,24.6647994129159,24.7398680521074,24.8149366912989,24.8900053304904,24.9650739696819,25.0401426088734,25.115211248065,25.1902798872565,25.265348526448,25.3404171656395,25.415485804831,25.4905544440225,25.5656230832141,25.6406917224056,25.7157603615971,25.7908290007886,25.8658976399801,25.9409662791717,26.0160349183632,26.0911035575547,26.1661721967462,26.2412408359377,26.3163094751292,26.3913781143208,26.4664467535123,26.5415153927038,26.6165840318953,26.6916526710868,26.7667213102784,26.8417899494699,26.9168585886614,26.9919272278529,27.0669958670444,27.1420645062359,27.2171331454275,27.292201784619,27.3672704238105,27.442339063002,27.5174077021935,27.5924763413851,27.6675449805766,27.7426136197681,27.8176822589596,27.8927508981511,27.9678195373426,28.0428881765342,28.1179568157257,28.1930254549172,28.2680940941087,28.3431627333002,28.4182313724917,28.4933000116833,28.5683686508748,28.6434372900663,28.7185059292578,28.7935745684493,28.8686432076409,28.9437118468324,29.0187804860239,29.0938491252154,29.1689177644069,29.2439864035984,29.31905504279,29.3941236819815,29.469192321173,29.5442609603645,29.619329599556,29.6943982387476,29.7694668779391,29.8445355171306,29.9196041563221,29.9946727955136,30.0697414347051,30.1448100738967,30.2198787130882,30.2949473522797,30.3700159914712,30.4450846306627,30.5201532698543,30.5952219090458,30.6702905482373,30.7453591874288,30.8204278266203,30.8954964658118,30.9705651050034,31.0456337441949,31.1207023833864,31.1957710225779,31.2708396617694,31.345908300961,31.4209769401525,31.496045579344,31.5711142185355,31.646182857727,31.7212514969185,31.7963201361101,31.8713887753016,31.9464574144931,32.0215260536846,32.0965946928761,32.1716633320676,32.2467319712592,32.3218006104507,32.3968692496422,32.4719378888337,32.5470065280252,32.6220751672167,32.6971438064083,32.7722124455998,32.8472810847913,32.9223497239828,32.9974183631743,33.0724870023659,33.1475556415574,33.2226242807489,33.2976929199404,33.3727615591319,33.4478301983235,33.522898837515,33.5979674767065,33.673036115898,33.7481047550895,33.823173394281,33.8982420334726,33.9733106726641,34.0483793118556,34.1234479510471,34.1985165902386,34.2735852294301,34.3486538686217,34.4237225078132,34.4987911470047,34.5738597861962,34.6489284253877,34.7239970645793,34.7990657037708,34.8741343429623,34.9492029821538,35.0242716213453,35.0993402605368,35.1744088997284,35.2494775389199,35.3245461781114,35.3996148173029,35.4746834564944,35.549752095686,35.6248207348775,35.699889374069,35.7749580132605,35.850026652452,35.9250952916435,36.0001639308351,36.0752325700266,36.1503012092181,36.2253698484096,36.3004384876011,36.3755071267926,36.4505757659842,36.5256444051757,36.6007130443672,36.6757816835587,36.7508503227502,36.8259189619418,36.9009876011333,36.9760562403248,37.0511248795163,37.1261935187078,37.2012621578994,37.2763307970909,37.3513994362824,37.4264680754739,37.5015367146654,37.5766053538569,37.6516739930485,37.72674263224,37.8018112714315,37.876879910623,37.9519485498145,38.027017189006,38.1020858281976,38.1771544673891,38.2522231065806,38.3272917457721,38.4023603849636,38.4774290241552,38.5524976633467,38.6275663025382,38.7026349417297,38.7777035809212,38.8527722201127,38.9278408593043,39.0029094984958,39.0779781376873,39.1530467768788,39.2281154160703,39.3031840552619,39.3782526944534,39.4533213336449,39.5283899728364,39.6034586120279,39.6785272512194,39.753595890411,39.8286645296025,39.903733168794,39.9788018079855,40.053870447177,40.1289390863685,40.2040077255601,40.2790763647516,40.3541450039431,40.4292136431346,40.5042822823261,40.5793509215177,40.6544195607092,40.7294881999007,40.8045568390922,40.8796254782837,40.9546941174752,41.0297627566668,41.1048313958583,41.1799000350498,41.2549686742413,41.3300373134328],"y":[0.000114229889951921,0.000125273732728626,0.000137050151569662,0.000149514448557863,0.00016354870709374,0.000178420867698831,0.000194189645158508,0.000211800991279836,0.000230417785779495,0.000250186134516728,0.000272091353413307,0.000295190853282919,0.000319748138090847,0.000346753678164109,0.000375163278516301,0.000405392353352029,0.00043839191630835,0.000473025083171863,0.000509897608297058,0.000549865884799235,0.000591714932801751,0.000636282193585793,0.000684264269333185,0.000734388731231368,0.000787767533919764,0.000844863679659828,0.000904374032794608,0.000967727509301851,0.00103507332727552,0.00110511011541999,0.00117962360481525,0.00125836582832946,0.00134007455387214,0.00142692713169268,0.00151819575096023,0.0016126982973312,0.00171303097435456,0.00181790876909982,0.00192627252375892,0.00204115460244825,0.00216064557042484,0.00228385182340514,0.00241424734268498,0.00254924588638339,0.00268815944027951,0.00283489601020689,0.0029861590398113,0.00314150124168559,0.00330524381785147,0.00347336810328754,0.00364580684975305,0.00382692787661865,0.00401233499398705,0.00420243406989608,0.00440104244661222,0.00460397348017972,0.00481193213809768,0.00502813429726787,0.00524865605531255,0.00547449396545618,0.00570823503504366,0.00594625891078352,0.00618984036323931,0.0064409330600869,0.00669624683271584,0.00695731896374736,0.00722548499335452,0.0074977968566662,0.00777604073693687,0.0080609631184595,0.0083499561064188,0.00864504824106555,0.00894643182590742,0.00925182565737347,0.00956350616164292,0.00988114251064116,0.0102027587968439,0.0105309013458707,0.0108647331794483,0.0112025590342439,0.011547236767962,0.0118974165128855,0.0122516609834645,0.0126132019991806,0.012980138623248,0.0133512761133107,0.0137303021027543,0.0141146905339388,0.0145034855963567,0.0149009276537631,0.0153037556724812,0.0157112642465902,0.0161283509199834,0.0165508795035261,0.0169784228663741,0.0174166371255152,0.0178603517797577,0.0183097457170008,0.0187704650058753,0.0192369975629635,0.0197100471319284,0.0201948572574038,0.0206858798277631,0.0211843072095414,0.0216948285594811,0.0222119236444772,0.0227373144896621,0.0232749660742645,0.0238194790893781,0.0243731204029669,0.0249389641095947,0.0255118465438023,0.0260945574178793,0.0266891403556056,0.0272907933140105,0.0279027597420157,0.0285259652044185,0.0291560939853421,0.0297967197565422,0.0304476376619687,0.0311051281846789,0.031772913735407,0.0324497409359108,0.0331325681935215,0.0338250282288393,0.0345250077956126,0.0352301850562352,0.0359438137775108,0.0366632203232897,0.0373867956064092,0.0381170855944091,0.0388512610006622,0.0395883645463794,0.0403298819396755,0.0410733226970109,0.0418182659125721,0.0425647807342156,0.0433112747038546,0.0440576976478669,0.044802364259259,0.0455451712759395,0.0462862140481823,0.0470218113915404,0.0477538790156692,0.0484821446565278,0.0492015875490189,0.0499157906849128,0.0506239262649292,0.0513201951201251,0.0520095863574055,0.052690498275267,0.0533569422312706,0.0540149987916339,0.0546621137887025,0.0552926856883678,0.0559135388539339,0.0565210415399491,0.0571105049903819,0.0576891388589819,0.0582521716549459,0.0587962683880539,0.0593286766734319,0.059843490489783,0.0603390587366376,0.0608223509644597,0.0612863981530185,0.0617314358410082,0.0621638874833519,0.0625758523747786,0.0629695224225652,0.0633505670227897,0.0637103333927429,0.0640529119557001,0.0643830768624863,0.0646916356526201,0.0649844076024407,0.0652651983007734,0.0655245025638205,0.065769611533718,0.0660033525017636,0.0662161295920915,0.0664163923873938,0.0666060347353955,0.0667755680363576,0.0669342649578231,0.0670831726888495,0.0672130665374253,0.0673337201126039,0.0674451809291316,0.0675393895162468,0.0676255442685601,0.0677028563900642,0.0677651513573859,0.0678201666094758,0.0678667236707489,0.0679002024415557,0.067927068845819,0.0679458272511997,0.0679530984411411,0.0679542870907898,0.0679476158335419,0.0679306780801022,0.067908028835629,0.0678776037870206,0.0678377673350176,0.0677924205679144,0.0677391670424319,0.0676770203348596,0.0676093938007805,0.0675334784000283,0.0674488994872161,0.0673587096352501,0.0672595797145926,0.0671517900375297,0.0670381148572513,0.0669145815719605,0.0667822376920479,0.0666436162842428,0.0664939751479885,0.0663352923518843,0.0661698548433573,0.065992036131299,0.0658049365767762,0.0656105568206685,0.0654022970043372,0.0651845742106906,0.0649590369370421,0.0647180616587152,0.0644675526862324,0.0642087263933387,0.0639329352676019,0.0636476918659782,0.0633536987604394,0.0630413425124595,0.062719792830209,0.0623886523029847,0.0620390086008308,0.0616801017122958,0.061310775372805,0.0609233799319284,0.0605267064243477,0.0601189704145019,0.0596939646610578,0.059259847792459,0.0588142712837906,0.0583525776493199,0.0578821310903507,0.0574001269997778,0.0569034791960782,0.0563986290457527,0.0558824653752783,0.0553534023360636,0.054816872881358,0.0542696447286468,0.053711469101004,0.0531467335908559,0.0525722979014553,0.0519890017249994,0.0514002011598197,0.0508030781982394,0.0501992400197976,0.0495910745237401,0.0489763217189034,0.0483569807626469,0.047734579415901,0.0471076445821018,0.0464781586448889,0.0458469346254187,0.0452134964837047,0.0445793908845901,0.0439448893387,0.0433106937006642,0.0426775088365751,0.042045255025224,0.0414159549184166,0.0407890997477807,0.0401644546896987,0.039545462105019,0.0389300802121295,0.0383181593967295,0.037714466155406,0.0371153199871162,0.0365210945965443,0.0359369533632597,0.0353583308523981,0.0347860935385033,0.0342253842147137,0.0336710304119423,0.0331244868555602,0.0325905108764094,0.0320635855212454,0.031545816877892,0.0310412744525422,0.0305443347493063,0.030057787047044,0.0295847780056226,0.0291197843524882,0.028666281873045,0.0282263268466158,0.0277946680039127,0.0273754463619757,0.0269695240219589,0.0265720572854393,0.0261878110245049,0.0258164064978562,0.0254535079204524,0.025104447020359,0.0247676064064712,0.0244392260110327,0.0241251357643548,0.0238225219036058,0.0235282391366668,0.0232485383683775,0.0229794836107023,0.0227185589572238,0.0224723524655867,0.0222359050903225,0.0220073247261404,0.0217934470120905,0.0215884090640308,0.0213909205690378,0.0212079692739273,0.0210329247967187,0.020865063177382,0.0207114220325011,0.0205647558862172,0.0204251007903076,0.020298712723945,0.0201786212615207,0.0200654784143913,0.0199641794396866,0.0198686751947915,0.0197799377776933,0.0197016011868594,0.0196285143249308,0.0195618838759074,0.0195042013494479,0.0194511809141234,0.0194041691260234,0.0193646538117595,0.01932917175265,0.0192991062342418,0.0192751007142036,0.0192544613318477,0.019238498082011,0.0192271894132118,0.0192185462539002,0.0192136908392892,0.0192121341003209,0.0192125155494985,0.0192156540395949,0.0192208049472464,0.0192271488909842,0.0192350885946818,0.0192438448631322,0.0192530419023504,0.019262560971588,0.0192718112574272,0.0192807551535821,0.0192886592662957,0.0192953378498803,0.0193009812245984,0.0193041649059721,0.0193053097587176,0.0193047226142344,0.0193002323501242,0.0192930439601489,0.0192834723593199,0.019268568517333,0.0192504667992848,0.0192293890452671,0.0192016037364312,0.019170280518466,0.0191352281816972,0.0190926467342532,0.0190461116592218,0.0189950953848759,0.0189360173935566,0.018872635541656,0.0188040718489362,0.0187271525737499,0.0186456726523495,0.0185583885801243,0.0184626819984024,0.0183622544938361,0.0182555037923272,0.0181404729001704,0.018020658095215,0.017894126427459,0.0177596436269259,0.0176204098177031,0.0174742094727197,0.0173205476462964,0.0171622602198725,0.016996915169023,0.0168247302835838,0.0166481325351633,0.0164645548669329,0.0162748610848089,0.0160810477685971,0.0158805066292131,0.0156746449514097,0.015465029591231,0.0152491137657672,0.0150287152174851,0.0148049921788406,0.0145755674031001,0.0143425117236918,0.0141066139974137,0.0138657760289471,0.0136221467751269,0.0133762003712007,0.0131262247974533,0.0128742617322952,0.0126205375516341,0.0123638272945128,0.0121058769293974,0.011846725517612,0.0115857724810267,0.0113242376672141,0.0110620768721777,0.0107993696564901,0.0105366591816821,0.0102739744907838,0.0100118944893552,0.00975037370864591,0.00948959081453261,0.00923043939368806,0.00897238299450101,0.00871581806430377,0.00846177172974433,0.00820931977552797,0.00795913366641453,0.00771220340271279,0.00746732180057261,0.00722547948185629,0.00698747537078351,0.00675192184869771,0.00652015819970899,0.00629266031015632,0.00606795686162937,0.00584774984356118,0.00563208620357928,0.00541949876135071,0.0052120507134402,0.00500928292989102,0.00480980877368389,0.00461603627213574,0.00442695306964015,0.00424131617124104,0.00406184853398545,0.00388696716212249,0.00371562134508756,0.0035508074929813,0.00339038262240756,0.00323352208714428,0.00308344511102575,0.00293748452954117,0.00279506099149529,0.00265955945207812,0.00252784560310971,0.00239959103413078,0.00227828576162718,0.00216040195857675,0.00204599295442203,0.00193818070664026,0.00183354071983298,0.00173241929341168,0.00163731564290115,0.00154519529769942,0.00145657831258937,0.00137337467713549,0.00129294412164485,0.00121594683573901,0.00114375343214423,0.00107410882417359,0.00100777843441016,0.000945654777335618,0.000885848291185368,0.000829195318860362,0.00077617831308329,0.00072524556209966,0.000677272149737365,0.000632401044393554,0.000589385237987148,0.000549109686833407,0.000511447392680605,0.000475419779431034,0.000441896920012362,0.000410547420533137,0.000380623796161367,0.000352961035157659,0.000327082835369569,0.000302436102284797,0.00027980521267239,0.000258620954894211,0.000238489898469975,0.000220134806074134,0.000202937332227206,0.000186631921280276,0.000171872883449019,0.000158028134975829,0.000144931757035496,0.000133166426187586,0.000122113644898602,0.000111682750933326,0.000102384668940649,9.3634397414515e-005,8.53960585846707e-005,7.81111418713833e-005,7.12415249248695e-005,6.48141936795587e-005],"type":"scatter","line":{"color":"grey"},"marker":{"size":0,"color":"grey","opacity":0},"showlegend":false,"name":"mpg_dens","xaxis":"x3","yaxis":"y3"},"mpg_10.4\nHH: 0.43\nMH: 0.33\nM: 0.1\nML: 0.21\nLL: 0":{"x0":10.4,"y0":0,"x1":10.4,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_10.4\nHH: 0.43\nMH: 0.33\nM: 0.1\nML: 0.21\nLL: 0","xref":"x3","yref":"y3"},"mpg_14.7\nHH: 0.29\nMH: 0.39\nM: 0.1\nML: 0.21\nLL: 0":{"x0":14.7,"y0":0,"x1":14.7,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_14.7\nHH: 0.29\nMH: 0.39\nM: 0.1\nML: 0.21\nLL: 0","xref":"x3","yref":"y3"},"mpg_19.45\nHH: 0.29\nMH: 0.06\nM: 0.33\nML: 0.16\nLL: 0.2":{"x0":19.45,"y0":0,"x1":19.45,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_19.45\nHH: 0.29\nMH: 0.06\nM: 0.33\nML: 0.16\nLL: 0.2","xref":"x3","yref":"y3"},"mpg_30.4\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4":{"x0":30.4,"y0":0,"x1":30.4,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_30.4\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4","xref":"x3","yref":"y3"},"mpg_33.9\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4":{"x0":33.9,"y0":0,"x1":33.9,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_33.9\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4","xref":"x3","yref":"y3"},"wt_dens":{"x":[0.47657276119403,0.488282848234366,0.499992935274703,0.511703022315039,0.523413109355376,0.535123196395712,0.546833283436048,0.558543370476385,0.570253457516721,0.581963544557058,0.593673631597394,0.605383718637731,0.617093805678067,0.628803892718404,0.64051397975874,0.652224066799077,0.663934153839413,0.67564424087975,0.687354327920086,0.699064414960423,0.710774502000759,0.722484589041096,0.734194676081432,0.745904763121769,0.757614850162105,0.769324937202442,0.781035024242778,0.792745111283115,0.804455198323451,0.816165285363788,0.827875372404124,0.839585459444461,0.851295546484797,0.863005633525133,0.87471572056547,0.886425807605806,0.898135894646143,0.909845981686479,0.921556068726816,0.933266155767152,0.944976242807489,0.956686329847825,0.968396416888162,0.980106503928498,0.991816590968835,1.00352667800917,1.01523676504951,1.02694685208984,1.03865693913018,1.05036702617052,1.06207711321085,1.07378720025119,1.08549728729153,1.09720737433186,1.1089174613722,1.12062754841254,1.13233763545287,1.14404772249321,1.15575780953355,1.16746789657388,1.17917798361422,1.19088807065455,1.20259815769489,1.21430824473523,1.22601833177556,1.2377284188159,1.24943850585624,1.26114859289657,1.27285867993691,1.28456876697725,1.29627885401758,1.30798894105792,1.31969902809826,1.33140911513859,1.34311920217893,1.35482928921927,1.3665393762596,1.37824946329994,1.38995955034027,1.40166963738061,1.41337972442095,1.42508981146128,1.43679989850162,1.44850998554196,1.46022007258229,1.47193015962263,1.48364024666297,1.4953503337033,1.50706042074364,1.51877050778398,1.53048059482431,1.54219068186465,1.55390076890499,1.56561085594532,1.57732094298566,1.589031030026,1.60074111706633,1.61245120410667,1.624161291147,1.63587137818734,1.64758146522768,1.65929155226801,1.67100163930835,1.68271172634869,1.69442181338902,1.70613190042936,1.7178419874697,1.72955207451003,1.74126216155037,1.75297224859071,1.76468233563104,1.77639242267138,1.78810250971172,1.79981259675205,1.81152268379239,1.82323277083272,1.83494285787306,1.8466529449134,1.85836303195373,1.87007311899407,1.88178320603441,1.89349329307474,1.90520338011508,1.91691346715542,1.92862355419575,1.94033364123609,1.95204372827643,1.96375381531676,1.9754639023571,1.98717398939744,1.99888407643777,2.01059416347811,2.02230425051845,2.03401433755878,2.04572442459912,2.05743451163945,2.06914459867979,2.08085468572013,2.09256477276046,2.1042748598008,2.11598494684114,2.12769503388147,2.13940512092181,2.15111520796215,2.16282529500248,2.17453538204282,2.18624546908316,2.19795555612349,2.20966564316383,2.22137573020416,2.2330858172445,2.24479590428484,2.25650599132517,2.26821607836551,2.27992616540585,2.29163625244618,2.30334633948652,2.31505642652686,2.32676651356719,2.33847660060753,2.35018668764787,2.3618967746882,2.37360686172854,2.38531694876888,2.39702703580921,2.40873712284955,2.42044720988989,2.43215729693022,2.44386738397056,2.45557747101089,2.46728755805123,2.47899764509157,2.4907077321319,2.50241781917224,2.51412790621258,2.52583799325291,2.53754808029325,2.54925816733359,2.56096825437392,2.57267834141426,2.5843884284546,2.59609851549493,2.60780860253527,2.61951868957561,2.63122877661594,2.64293886365628,2.65464895069661,2.66635903773695,2.67806912477729,2.68977921181762,2.70148929885796,2.7131993858983,2.72490947293863,2.73661955997897,2.74832964701931,2.76003973405964,2.77174982109998,2.78345990814032,2.79516999518065,2.80688008222099,2.81859016926133,2.83030025630166,2.842010343342,2.85372043038234,2.86543051742267,2.87714060446301,2.88885069150334,2.90056077854368,2.91227086558402,2.92398095262435,2.93569103966469,2.94740112670503,2.95911121374536,2.9708213007857,2.98253138782604,2.99424147486637,3.00595156190671,3.01766164894705,3.02937173598738,3.04108182302772,3.05279191006806,3.06450199710839,3.07621208414873,3.08792217118906,3.0996322582294,3.11134234526974,3.12305243231007,3.13476251935041,3.14647260639075,3.15818269343108,3.16989278047142,3.18160286751176,3.19331295455209,3.20502304159243,3.21673312863277,3.2284432156731,3.24015330271344,3.25186338975378,3.26357347679411,3.27528356383445,3.28699365087478,3.29870373791512,3.31041382495546,3.32212391199579,3.33383399903613,3.34554408607647,3.3572541731168,3.36896426015714,3.38067434719748,3.39238443423781,3.40409452127815,3.41580460831849,3.42751469535882,3.43922478239916,3.4509348694395,3.46264495647983,3.47435504352017,3.48606513056051,3.49777521760084,3.50948530464118,3.52119539168151,3.53290547872185,3.54461556576219,3.55632565280252,3.56803573984286,3.5797458268832,3.59145591392353,3.60316600096387,3.61487608800421,3.62658617504454,3.63829626208488,3.65000634912522,3.66171643616555,3.67342652320589,3.68513661024623,3.69684669728656,3.7085567843269,3.72026687136723,3.73197695840757,3.74368704544791,3.75539713248824,3.76710721952858,3.77881730656892,3.79052739360925,3.80223748064959,3.81394756768993,3.82565765473026,3.8373677417706,3.84907782881094,3.86078791585127,3.87249800289161,3.88420808993195,3.89591817697228,3.90762826401262,3.91933835105295,3.93104843809329,3.94275852513363,3.95446861217396,3.9661786992143,3.97788878625464,3.98959887329497,4.00130896033531,4.01301904737565,4.02472913441598,4.03643922145632,4.04814930849666,4.05985939553699,4.07156948257733,4.08327956961767,4.094989656658,4.10669974369834,4.11840983073867,4.13011991777901,4.14183000481935,4.15354009185968,4.16525017890002,4.17696026594036,4.18867035298069,4.20038044002103,4.21209052706137,4.2238006141017,4.23551070114204,4.24722078818238,4.25893087522271,4.27064096226305,4.28235104930339,4.29406113634372,4.30577122338406,4.31748131042439,4.32919139746473,4.34090148450507,4.3526115715454,4.36432165858574,4.37603174562608,4.38774183266641,4.39945191970675,4.41116200674709,4.42287209378742,4.43458218082776,4.4462922678681,4.45800235490843,4.46971244194877,4.48142252898911,4.49313261602944,4.50484270306978,4.51655279011012,4.52826287715045,4.53997296419079,4.55168305123112,4.56339313827146,4.5751032253118,4.58681331235213,4.59852339939247,4.61023348643281,4.62194357347314,4.63365366051348,4.64536374755382,4.65707383459415,4.66878392163449,4.68049400867483,4.69220409571516,4.7039141827555,4.71562426979584,4.72733435683617,4.73904444387651,4.75075453091684,4.76246461795718,4.77417470499752,4.78588479203785,4.79759487907819,4.80930496611853,4.82101505315886,4.8327251401992,4.84443522723954,4.85614531427987,4.86785540132021,4.87956548836055,4.89127557540088,4.90298566244122,4.91469574948156,4.92640583652189,4.93811592356223,4.94982601060256,4.9615360976429,4.97324618468324,4.98495627172357,4.99666635876391,5.00837644580425,5.02008653284458,5.03179661988492,5.04350670692526,5.05521679396559,5.06692688100593,5.07863696804627,5.0903470550866,5.10205714212694,5.11376722916728,5.12547731620761,5.13718740324795,5.14889749028829,5.16060757732862,5.17231766436896,5.18402775140929,5.19573783844963,5.20744792548997,5.2191580125303,5.23086809957064,5.24257818661098,5.25428827365131,5.26599836069165,5.27770844773199,5.28941853477232,5.30112862181266,5.312838708853,5.32454879589333,5.33625888293367,5.347968969974,5.35967905701434,5.37138914405468,5.38309923109501,5.39480931813535,5.40651940517569,5.41822949221602,5.42993957925636,5.4416496662967,5.45335975333703,5.46506984037737,5.47677992741771,5.48849001445804,5.50020010149838,5.51191018853872,5.52362027557905,5.53533036261939,5.54704044965973,5.55875053670006,5.5704606237404,5.58217071078074,5.59388079782107,5.60559088486141,5.61730097190174,5.62901105894208,5.64072114598242,5.65243123302275,5.66414132006309,5.67585140710343,5.68756149414376,5.6992715811841,5.71098166822444,5.72269175526477,5.73440184230511,5.74611192934545,5.75782201638578,5.76953210342612,5.78124219046645,5.79295227750679,5.80466236454713,5.81637245158746,5.8280825386278,5.83979262566814,5.85150271270847,5.86321279974881,5.87492288678915,5.88663297382948,5.89834306086982,5.91005314791016,5.92176323495049,5.93347332199083,5.94518340903117,5.9568934960715,5.96860358311184,5.98031367015218,5.99202375719251,6.00373384423285,6.01544393127318,6.02715401831352,6.03886410535386,6.05057419239419,6.06228427943453,6.07399436647487,6.0857044535152,6.09741454055554,6.10912462759588,6.12083471463621,6.13254480167655,6.14425488871689,6.15596497575722,6.16767506279756,6.17938514983789,6.19109523687823,6.20280532391857,6.2145154109589,6.22622549799924,6.23793558503958,6.24964567207991,6.26135575912025,6.27306584616059,6.28477593320092,6.29648602024126,6.3081961072816,6.31990619432193,6.33161628136227,6.34332636840261,6.35503645544294,6.36674654248328,6.37845662952362,6.39016671656395,6.40187680360429,6.41358689064463,6.42529697768496,6.4370070647253,6.44871715176563,6.46042723880597],"y":[0.000588305747859961,0.000653662546177273,0.00072396341187711,0.000802929549769672,0.000889479434486809,0.000982370534203968,0.00108518976103096,0.00119855544237035,0.00131994472036086,0.0014524718769899,0.00159934484368988,0.00175623266534799,0.0019253273430717,0.00211354156007869,0.00231408560427172,0.00252765905332986,0.00276623020813334,0.00301977234637766,0.00328847357713965,0.00358591738691038,0.00390296030311582,0.00423814316428616,0.00460440885268852,0.00499653052779915,0.00541004685425104,0.00585650024639029,0.00633619593052139,0.00684075642738381,0.00737945433089138,0.00795989840270584,0.00856881043554107,0.00921224659521633,0.00990697081345154,0.0106337925309994,0.0113945736179875,0.0122170636181251,0.013075178091888,0.0139691415838804,0.0149288526323047,0.0159309722779777,0.0169721838389724,0.01807856341184,0.0192361819738506,0.0204357060491956,0.0216983672563278,0.0230211834918149,0.0243881253482525,0.0258147223814598,0.0273100655794014,0.0288510035218589,0.0304467493337186,0.0321190412211169,0.0338375059584044,0.0356047402731382,0.0374550300138563,0.0393510679905891,0.0412927845618922,0.0433145138958261,0.0453843698154036,0.0474983012194,0.0496827616165884,0.0519187106233118,0.0541960307689625,0.0565335011844187,0.0589238533290903,0.0613518038985453,0.0638290951290422,0.0663583842292055,0.0689205174971155,0.0715212422140802,0.0741705987861254,0.0768472018860914,0.0795521935327253,0.0822998881459878,0.0850685711131232,0.0878578097355035,0.0906785641177854,0.0935149813910552,0.0963652269537346,0.0992340266500031,0.102112691054892,0.104998280069066,0.107891150714918,0.110786291398719,0.113681520357562,0.116574751849369,0.119461164070792,0.122341127438455,0.125211983458818,0.128065819018823,0.130907173518256,0.13373452530288,0.136533977764915,0.13931558956002,0.142079033749399,0.144806289228922,0.147509731046339,0.150190518443112,0.15283159734119,0.155441475785252,0.158025081387198,0.160567718175561,0.163071826127385,0.165546925203725,0.167981725463347,0.17037102903303,0.172729439687436,0.17504978300274,0.177318265544688,0.179554757094315,0.181756596717929,0.18390099262779,0.186012994885452,0.188092598181578,0.190114042061918,0.192101295724165,0.194056388973739,0.195958591236368,0.197822780321955,0.1996555254982,0.201441118790422,0.203185522584342,0.204899585868711,0.206572444876928,0.208201639740741,0.209801911977778,0.211366933510961,0.212886565247555,0.214378957034801,0.215841906076329,0.217258542582392,0.218649860379786,0.220015994195074,0.221338347385617,0.222636246504854,0.223911138655524,0.22514921749551,0.226362219114609,0.227554637986412,0.228716948487392,0.229854501893055,0.230974166590472,0.232070098654074,0.233142667284122,0.234200336738981,0.235240243011945,0.236259393596278,0.237266953219638,0.238262220569756,0.239240698293245,0.24021122863041,0.241174063325155,0.242126109352169,0.243073927209882,0.24401806844024,0.244958754005581,0.245899422915709,0.246840776138009,0.247785361452478,0.248735673786362,0.249691364080893,0.250656189653498,0.251634126018204,0.252622452030991,0.25362489311511,0.254649565002808,0.255689937484511,0.256748346700479,0.257839925383187,0.258952791788404,0.260087323189842,0.261266058142699,0.262472807913362,0.263707076771838,0.264991431631539,0.266314268120489,0.267670675736086,0.269081718567118,0.270543474566533,0.272044986082628,0.273604196845273,0.275228063149989,0.276897904714739,0.278626873439181,0.280436005601543,0.282297229263909,0.284217232541924,0.28623420151517,0.288309084838269,0.290442255233552,0.292686574075527,0.294995829747783,0.297368588070914,0.299851612251397,0.302413397376107,0.305043015556477,0.307779347589871,0.310608082047404,0.313507731471377,0.316507812535489,0.319612839226409,0.322790214423111,0.32605909434202,0.329443238939267,0.332899102401217,0.336435167401056,0.34009327872927,0.343820014387732,0.347615097969852,0.351531320943,0.355511601262243,0.35955403509858,0.363696461121886,0.367902142641089,0.372160663012396,0.376495653373984,0.380887015934679,0.385318639003849,0.389801910426376,0.394327345290166,0.398877201664297,0.403453858795064,0.408050090435334,0.412651813316133,0.417256864237264,0.421849760911855,0.426426472456697,0.430985502995479,0.435491844748906,0.439957746827314,0.444381891230911,0.448717929623582,0.452980463551273,0.457175700975284,0.461252378008086,0.465214876606076,0.469083898103611,0.472810305547681,0.476375023599267,0.47982034767669,0.483106513622703,0.486177892778987,0.489105168486745,0.491864951288793,0.494352955369166,0.496674285024609,0.498827508853677,0.500651583403777,0.502288692429284,0.50373845205029,0.504855872216302,0.505742961360178,0.506427298195742,0.506786419567335,0.506872554200583,0.506744957236864,0.506308677031344,0.505559597500064,0.504590629896242,0.50333757804063,0.501736851592977,0.499915102799359,0.497840253196014,0.495389728635065,0.492722065747208,0.489836758164059,0.486556325721963,0.483067458688263,0.479370953920444,0.475325551151142,0.471056963844871,0.466594264319548,0.461833521021623,0.456841851451872,0.451673447306482,0.446258483642867,0.440613459829106,0.434812285084145,0.428814586237262,0.422596638507221,0.416245612713471,0.409744830207442,0.403042505801392,0.396231915002329,0.389313568260188,0.382220870866176,0.3750457080453,0.367789805280088,0.360412648116943,0.352970021259336,0.345472702151974,0.337902553617375,0.330289252925561,0.322646846200007,0.314972323988092,0.307282620659989,0.299588360868811,0.291894644023726,0.284218373196358,0.276560573003801,0.26892791440864,0.261348875945522,0.25380942288498,0.246311939597434,0.238906633460259,0.231559823289543,0.224272651590395,0.217101269346922,0.210012974658456,0.203000597376581,0.19611744920332,0.189344611228538,0.182661461665087,0.176113704593134,0.169704127869832,0.163395493900408,0.157222094848814,0.151214518087706,0.145316687503506,0.139548627137778,0.133973038650724,0.128513678860714,0.123174342161713,0.118052504075493,0.113051239244301,0.108170748464163,0.103503103564732,0.0989722486908078,0.0945644373323544,0.0903546233194461,0.0863000315013777,0.0823691195201222,0.0786189484250374,0.0750409247730967,0.0715858480294263,0.0682927113521793,0.0651869450311057,0.0622022835713438,0.0593599496263401,0.0567184148587647,0.0541952757212188,0.0517946348331432,0.0496064129050594,0.0475332203175651,0.0455748122691548,0.0438149182675307,0.0421780685312028,0.0406521091370875,0.0393025352306227,0.0380868808816794,0.03697785295599,0.0360237074136805,0.0352128455249011,0.034504022103745,0.0339293615838494,0.0335057141184952,0.0331791784313083,0.0329669599114406,0.032911649354783,0.0329481141959803,0.0330799835756437,0.0333725237896389,0.033750975399349,0.0342149240130743,0.0348247569891112,0.0355219653281096,0.0362980540284246,0.0371978236678173,0.0381877761573159,0.0392491304087517,0.0404126053670661,0.041665933245323,0.0429821686723628,0.0443797881849894,0.0458632621617102,0.0474000146837425,0.0489985253107277,0.0506746989559435,0.0523933252676557,0.054155582572988,0.0559826570274991,0.0578401761691543,0.05972730168576,0.0616571378564448,0.0636064707752118,0.0655722390799825,0.0675567281013371,0.0695472719390482,0.0715402439550405,0.0735305642963638,0.0755091128780825,0.0774755650339555,0.0794212725286344,0.0813332660231287,0.0832185281145797,0.0850688096035054,0.0868598669283703,0.0886099235537995,0.090315051053707,0.0919327109429747,0.0934959848341261,0.0950040361473199,0.0964044706630829,0.0977336848702283,0.0989958680932156,0.100142029176245,0.101196031204604,0.102173161728404,0.10303159354464,0.103777019847113,0.10443813022448,0.104983248745097,0.105395913303758,0.105719542615345,0.105934635905498,0.10600054187191,0.105975622449468,0.105853489007502,0.105569386427853,0.105195659692428,0.104732495479535,0.104112281028683,0.103400206663057,0.102603058124606,0.10166966790964,0.100639826234939,0.0995319095064192,0.098310437660737,0.0969924607441409,0.0956056682531188,0.0941284847116692,0.0925595842276427,0.0909329118212423,0.0892381942792897,0.0874613806634923,0.0856390779195163,0.0837691443928913,0.0818312501902711,0.0798608105282003,0.0778586898734543,0.075809979404024,0.073740092461846,0.0716515274952024,0.0695399188652703,0.0674185037130016,0.0652909035532862,0.0631594916324714,0.0610319166339332,0.0589096794471216,0.0567983141345672,0.0547058893124197,0.0526289858434713,0.0505731501286169,0.0485519529634297,0.0465548564239365,0.0445848462917197,0.0426649145149171,0.0407759020201483,0.0389181996211283,0.0371212188112957,0.0353620427803762,0.0336390170455964,0.0319783425365085,0.0303642466784235,0.0287893862376131,0.0272751295484268,0.0258151648994898,0.0243958992850823,0.0230329287961383,0.0217305117795463,0.0204688280285173,0.0192573636156022,0.0181110106426288,0.0170042264886259,0.0159405454843737,0.0149447169905035,0.0139863440929983,0.0130652625080126,0.0122095355101697,0.0113901710175854,0.0106052370943992,0.00987576463566896,0.00918395788574545,0.00852328855852018,0.00790852861288401,0.00733158064509458,0.00678225522863016,0.00626998860171669,0.00579465411012348,0.00534338414643541,0.00492125787797451,0.00453433111682076,0.00416801080577011,0.00382397867860761,0.00351275571502462,0.00321888830972852,0.00294216929408903,0.00269416625186012,0.00246117041258164,0.00224238158882992,0.00204566626120112,0.00186307285946594,0.00169207179733239,0.00153769718615134,0.00139625138253728,0.0012641248570708,0.00114425717398868,0.00103594290582271,0.000935012077976886,0.000842915037645937,0.000760919634733168,0.000684690514374704],"type":"scatter","line":{"color":"grey"},"marker":{"size":0,"color":"grey","opacity":0},"showlegend":false,"name":"wt_dens","xaxis":"x4","yaxis":"y4"},"wt_1.513\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5":{"x0":1.513,"y0":0,"x1":1.513,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_1.513\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5","xref":"x4","yref":"y4"},"wt_2.04\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5":{"x0":2.04,"y0":0,"x1":2.04,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_2.04\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5","xref":"x4","yref":"y4"},"wt_3.44\nHH: 0.14\nMH: 0.11\nM: 0.33\nML: 0.26\nLL: 0":{"x0":3.44,"y0":0,"x1":3.44,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_3.44\nHH: 0.14\nMH: 0.11\nM: 0.33\nML: 0.26\nLL: 0","xref":"x4","yref":"y4"},"wt_5.3\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0":{"x0":5.3,"y0":0,"x1":5.3,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_5.3\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0","xref":"x4","yref":"y4"},"wt_5.424\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0":{"x0":5.424,"y0":0,"x1":5.424,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_5.424\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0","xref":"x4","yref":"y4"},"rug_pred":{"type":"bar","mode":"markers","x":null,"y":null,"marker":{"symbol":"line-ns-open","color":"black"},"xaxis":"x1","yaxis":"y11","name":"rug_pred","showlegend":false},"rug_cyl":{"type":"bar","mode":"markers","x":null,"y":null,"marker":{"symbol":"line-ns-open","color":"black"},"xaxis":"x2","yaxis":"y12","name":"rug_cyl","showlegend":false},"rug_mpg":{"type":"scatter","mode":"markers","x":[21,21,22.8,21.4,18.7,18.1,14.3,24.4,22.8,19.2,17.8,16.4,17.3,15.2,10.4,10.4,14.7,32.4,30.4,33.9,21.5,15.5,15.2,13.3,19.2,27.3,26,30.4,15.8,19.7,15,21.4],"y":["rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug"],"marker":{"symbol":"line-ns-open","color":"black"},"xaxis":"x3","yaxis":"y13","name":"rug_mpg","showlegend":false},"rug_wt":{"type":"scatter","mode":"markers","x":[2.62,2.875,2.32,3.215,3.44,3.46,3.57,3.19,3.15,3.44,3.44,4.07,3.73,3.78,5.25,5.424,5.345,2.2,1.615,1.835,2.465,3.52,3.435,3.84,3.845,1.935,2.14,1.513,3.17,2.77,3.57,2.78],"y":["rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug","rug"],"marker":{"symbol":"line-ns-open","color":"black"},"xaxis":"x4","yaxis":"y14","name":"rug_wt","showlegend":false},"imp_am":{"y":["am"],"x":[0.00625008206339776],"type":"bar","marker":{"color":"lightgrey"},"showlegend":false,"width":0.5,"name":"fixed: automatic","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_carb":{"y":["carb"],"x":[0.0165005193583327],"type":"bar","marker":{"color":"lightgrey"},"showlegend":false,"width":0.5,"name":"fixed: 4","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_vs":{"y":["vs"],"x":[0.0386171653198195],"type":"bar","marker":{"color":"lightgrey"},"showlegend":false,"width":0.5,"name":"fixed: V","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_gear":{"y":["gear"],"x":[0.0499639778193365],"type":"bar","marker":{"color":"lightgrey"},"showlegend":false,"width":0.5,"name":"fixed: 3","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_qsec":{"y":["qsec"],"x":[0.0502201050558993],"type":"bar","marker":{"color":"lightgrey"},"showlegend":false,"width":0.5,"name":"fixed: 17.71","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_drat":{"y":["drat"],"x":[0.105836729005242],"type":"bar","marker":{"color":"lightgrey"},"showlegend":false,"width":0.5,"name":"fixed: 3.695","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_hp":{"y":["hp"],"x":[0.140562957779641],"type":"bar","marker":{"color":"lightgrey"},"showlegend":false,"width":0.5,"name":"fixed: 123","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_wt":{"y":["wt"],"x":[0.164590998113147],"type":"bar","marker":{"color":"darkgrey"},"showlegend":false,"width":0.5,"name":"alluvial","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_mpg":{"y":["mpg"],"x":[0.179341958443537],"type":"bar","marker":{"color":"darkgrey"},"showlegend":false,"width":0.5,"name":"alluvial","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_cyl":{"y":["cyl"],"x":[0.248115507041646],"type":"bar","marker":{"color":"darkgrey"},"showlegend":false,"width":0.5,"name":"alluvial","xaxis":"x99","yaxis":"y99","orientation":"h"},"imp_total\nalluvial":{"y":["total\nalluvial"],"x":[0.59204846359833],"type":"bar","marker":{"color":"darkgrey"},"showlegend":false,"width":0.5,"name":"alluvial","xaxis":"x99","yaxis":"y99","orientation":"h"}},"layout":{"xaxis1":{"domain":[0,0.2],"anchor":"y11","showgrid":false,"showline":false,"zeroline":false},"xaxis2":{"domain":[0.225,0.4125],"anchor":"y12","showgrid":false,"showline":false,"zeroline":false},"xaxis3":{"domain":[0.4375,0.625],"anchor":"y13","showgrid":false,"showline":false,"zeroline":false},"xaxis4":{"domain":[0.65,0.85],"anchor":"y14","showgrid":false,"showline":false,"zeroline":false},"yaxis1":{"domain":[0.9,1],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false},"yaxis2":{"domain":[0.9,1],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false},"yaxis3":{"domain":[0.9,1],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false},"yaxis4":{"domain":[0.9,1],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false},"yaxis11":{"domain":[0.89,0.899],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false,"anchor":"x1"},"yaxis12":{"domain":[0.89,0.899],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false,"anchor":"x2"},"yaxis13":{"domain":[0.89,0.899],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false,"anchor":"x3"},"yaxis14":{"domain":[0.89,0.899],"showgrid":false,"showline":false,"showticklabels":false,"zeroline":false,"anchor":"x4"},"yaxis99":{"domain":[0,1],"anchor":"y99","showticklabels":false},"xaxis99":{"domain":[0.9,1],"anchor":"x99","showticklabels":false},"annotations":[{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"am","showarrow":false,"text":"am","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"carb","showarrow":false,"text":"carb","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"vs","showarrow":false,"text":"vs","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"gear","showarrow":false,"text":"gear","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"qsec","showarrow":false,"text":"qsec","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"drat","showarrow":false,"text":"drat","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"hp","showarrow":false,"text":"hp","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"wt","showarrow":false,"text":"wt","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"mpg","showarrow":false,"text":"mpg","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"cyl","showarrow":false,"text":"cyl","align":"right"},{"xref":"x99","yref":"y99","x":0.59204846359833,"y":"total\nalluvial","showarrow":false,"text":"total\nalluvial","align":"right"}]},"shapes":{"mpg_10.4\nHH: 0.43\nMH: 0.33\nM: 0.1\nML: 0.21\nLL: 0":{"x0":10.4,"y0":0,"x1":10.4,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_10.4\nHH: 0.43\nMH: 0.33\nM: 0.1\nML: 0.21\nLL: 0","xref":"x3","yref":"y3"},"mpg_14.7\nHH: 0.29\nMH: 0.39\nM: 0.1\nML: 0.21\nLL: 0":{"x0":14.7,"y0":0,"x1":14.7,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_14.7\nHH: 0.29\nMH: 0.39\nM: 0.1\nML: 0.21\nLL: 0","xref":"x3","yref":"y3"},"mpg_19.45\nHH: 0.29\nMH: 0.06\nM: 0.33\nML: 0.16\nLL: 0.2":{"x0":19.45,"y0":0,"x1":19.45,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_19.45\nHH: 0.29\nMH: 0.06\nM: 0.33\nML: 0.16\nLL: 0.2","xref":"x3","yref":"y3"},"mpg_30.4\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4":{"x0":30.4,"y0":0,"x1":30.4,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_30.4\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4","xref":"x3","yref":"y3"},"mpg_33.9\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4":{"x0":33.9,"y0":0,"x1":33.9,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_33.9\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4","xref":"x3","yref":"y3"},"wt_1.513\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5":{"x0":1.513,"y0":0,"x1":1.513,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_1.513\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5","xref":"x4","yref":"y4"},"wt_2.04\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5":{"x0":2.04,"y0":0,"x1":2.04,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_2.04\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5","xref":"x4","yref":"y4"},"wt_3.44\nHH: 0.14\nMH: 0.11\nM: 0.33\nML: 0.26\nLL: 0":{"x0":3.44,"y0":0,"x1":3.44,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_3.44\nHH: 0.14\nMH: 0.11\nM: 0.33\nML: 0.26\nLL: 0","xref":"x4","yref":"y4"},"wt_5.3\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0":{"x0":5.3,"y0":0,"x1":5.3,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_5.3\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0","xref":"x4","yref":"y4"},"wt_5.424\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0":{"x0":5.424,"y0":0,"x1":5.424,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_5.424\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0","xref":"x4","yref":"y4"}},"shapes_original":{"mpg_10.4\nHH: 0.43\nMH: 0.33\nM: 0.1\nML: 0.21\nLL: 0":{"x0":10.4,"y0":0,"x1":10.4,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_10.4\nHH: 0.43\nMH: 0.33\nM: 0.1\nML: 0.21\nLL: 0","xref":"x3","yref":"y3"},"mpg_14.7\nHH: 0.29\nMH: 0.39\nM: 0.1\nML: 0.21\nLL: 0":{"x0":14.7,"y0":0,"x1":14.7,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_14.7\nHH: 0.29\nMH: 0.39\nM: 0.1\nML: 0.21\nLL: 0","xref":"x3","yref":"y3"},"mpg_19.45\nHH: 0.29\nMH: 0.06\nM: 0.33\nML: 0.16\nLL: 0.2":{"x0":19.45,"y0":0,"x1":19.45,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_19.45\nHH: 0.29\nMH: 0.06\nM: 0.33\nML: 0.16\nLL: 0.2","xref":"x3","yref":"y3"},"mpg_30.4\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4":{"x0":30.4,"y0":0,"x1":30.4,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_30.4\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4","xref":"x3","yref":"y3"},"mpg_33.9\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4":{"x0":33.9,"y0":0,"x1":33.9,"y1":0.0679542870907898,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"mpg_33.9\nHH: 0\nMH: 0.11\nM: 0.24\nML: 0.21\nLL: 0.4","xref":"x3","yref":"y3"},"wt_1.513\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5":{"x0":1.513,"y0":0,"x1":1.513,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_1.513\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5","xref":"x4","yref":"y4"},"wt_2.04\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5":{"x0":2.04,"y0":0,"x1":2.04,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_2.04\nHH: 0\nMH: 0.11\nM: 0.14\nML: 0.26\nLL: 0.5","xref":"x4","yref":"y4"},"wt_3.44\nHH: 0.14\nMH: 0.11\nM: 0.33\nML: 0.26\nLL: 0":{"x0":3.44,"y0":0,"x1":3.44,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_3.44\nHH: 0.14\nMH: 0.11\nM: 0.33\nML: 0.26\nLL: 0","xref":"x4","yref":"y4"},"wt_5.3\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0":{"x0":5.3,"y0":0,"x1":5.3,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_5.3\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0","xref":"x4","yref":"y4"},"wt_5.424\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0":{"x0":5.424,"y0":0,"x1":5.424,"y1":0.506872554200583,"type":"line","line":{"color":"lightgrey"},"showlegend":false,"name":"wt_5.424\nHH: 0.43\nMH: 0.33\nM: 0.19\nML: 0.11\nLL: 0","xref":"x4","yref":"y4"}},"map_curve":[[5,8,10,18],[5,8,10,19],[5,8,10,20],[5,8,11,19],[5,8,11,20],[5,8,12,19],[5,8,12,20],[1,6,12,16],[1,6,12,17],[1,6,13,16],[1,6,13,17],[1,6,14,16],[1,6,14,17],[1,7,13,16],[1,7,13,17],[1,7,14,16],[1,7,14,17],[3,6,10,18],[3,6,11,18],[3,6,12,19],[3,6,12,20],[3,7,10,18],[3,7,11,18],[3,7,12,18],[3,7,12,19],[3,7,12,20],[3,7,13,19],[3,7,13,20],[3,7,14,19],[3,7,14,20],[3,8,12,16],[3,8,12,17],[3,8,13,16],[3,8,13,17],[3,8,13,18],[3,8,14,16],[3,8,14,17],[3,8,14,18],[4,6,10,19],[4,6,10,20],[4,6,11,19],[4,6,11,20],[4,7,10,19],[4,7,10,20],[4,7,11,19],[4,7,11,20],[4,8,10,16],[4,8,10,17],[4,8,11,16],[4,8,11,17],[4,8,11,18],[4,8,12,18],[4,8,13,19],[4,8,13,20],[4,8,14,19],[4,8,14,20],[2,6,10,16],[2,6,10,17],[2,6,11,16],[2,6,11,17],[2,6,12,18],[2,6,13,18],[2,6,13,19],[2,6,13,20],[2,6,14,18],[2,6,14,19],[2,6,14,20],[2,7,10,16],[2,7,10,17],[2,7,11,16],[2,7,11,17],[2,7,12,16],[2,7,12,17],[2,7,13,18],[2,7,14,18]],"map_trace_2_shape":[0,0,0,0,0,0,0,0,0,1,2,3,4,5,0,6,7,8,9,10],"map_type":[["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"],["scatter","bar","line","line"]],"map_color":[["#710500","#969696","lightgrey","lightgrey"],["#710500","#969696","lightgrey","lightgrey"],["#710500","#969696","lightgrey","lightgrey"],["#710500","#969696","lightgrey","lightgrey"],["#710500","#969696","lightgrey","lightgrey"],["#710500","#969696","lightgrey","lightgrey"],["#710500","#969696","lightgrey","lightgrey"],["#FF0065","#BDBDBD","lightgrey","lightgrey"],["#FF0065","#BDBDBD","lightgrey","lightgrey"],["#FF0065","#BDBDBD","lightgrey","lightgrey"],["#FF0065","#BDBDBD","lightgrey","lightgrey"],["#FF0065","#BDBDBD","lightgrey","lightgrey"],["#FF0065","#BDBDBD","lightgrey","lightgrey"],["#FF0065","#525252","lightgrey","lightgrey"],["#FF0065","#525252","lightgrey","lightgrey"],["#FF0065","#525252","lightgrey","lightgrey"],["#FF0065","#525252","lightgrey","lightgrey"],["#A56F2B","#BDBDBD","lightgrey","lightgrey"],["#A56F2B","#BDBDBD","lightgrey","lightgrey"],["#A56F2B","#BDBDBD","lightgrey","lightgrey"],["#A56F2B","#BDBDBD","lightgrey","lightgrey"],["#A56F2B","#525252","lightgrey","lightgrey"],["#A56F2B","#525252","lightgrey","lightgrey"],["#A56F2B","#525252","lightgrey","lightgrey"],["#A56F2B","#525252","lightgrey","lightgrey"],["#A56F2B","#525252","lightgrey","lightgrey"],["#A56F2B","#525252","lightgrey","lightgrey"],["#A56F2B","#525252","lightgrey","lightgrey"],["#A56F2B","#525252","lightgrey","lightgrey"],["#A56F2B","#525252","lightgrey","lightgrey"],["#A56F2B","#969696","lightgrey","lightgrey"],["#A56F2B","#969696","lightgrey","lightgrey"],["#A56F2B","#969696","lightgrey","lightgrey"],["#A56F2B","#969696","lightgrey","lightgrey"],["#A56F2B","#969696","lightgrey","lightgrey"],["#A56F2B","#969696","lightgrey","lightgrey"],["#A56F2B","#969696","lightgrey","lightgrey"],["#A56F2B","#969696","lightgrey","lightgrey"],["#005EAA","#BDBDBD","lightgrey","lightgrey"],["#005EAA","#BDBDBD","lightgrey","lightgrey"],["#005EAA","#BDBDBD","lightgrey","lightgrey"],["#005EAA","#BDBDBD","lightgrey","lightgrey"],["#005EAA","#525252","lightgrey","lightgrey"],["#005EAA","#525252","lightgrey","lightgrey"],["#005EAA","#525252","lightgrey","lightgrey"],["#005EAA","#525252","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#005EAA","#969696","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#BDBDBD","lightgrey","lightgrey"],["#009850","#525252","lightgrey","lightgrey"],["#009850","#525252","lightgrey","lightgrey"],["#009850","#525252","lightgrey","lightgrey"],["#009850","#525252","lightgrey","lightgrey"],["#009850","#525252","lightgrey","lightgrey"],["#009850","#525252","lightgrey","lightgrey"],["#009850","#525252","lightgrey","lightgrey"],["#009850","#525252","lightgrey","lightgrey"]],"parcats_cols":["#710500","#710500","#710500","#710500","#710500","#710500","#710500","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#FF0065","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#A56F2B","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#005EAA","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850","#009850"],"imp":true},"evals":[],"jsHooks":[]}

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R on datistics.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

How to make a precision recall curve in R

$
0
0

[This article was first published on R – intobioinformatics, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Precision recall (PR) curves are useful for machine learning model evaluation when there is an extreme imbalance in the data and the analyst is interested particuarly in one class. A good example is credit card fraud, where the instances of fraud are extremely few compared with non fraud. Here are some facts about PR curves.

  • PR curves are sensitive to which class is defined as positive, unlike the ROC curve which is a more balanced method. So we will get a completely different result depending on which class is set as positive.
  • PR curves are sensitive to class distribution, so if the ratio of positives to negatives changes across different analyses, then the PR curve cannot be used to compare performance between them. This is because the chance line varies between datasets with different class distributions.
  • PR curves, because they use precision, instead of specificity (like ROC) can pick up false positives in the predicted positive fraction. This is very helpful when negatives >> positives. In these cases, the ROC is pretty insensitive and can be misleading, whereas PR curves reign supreme.
  • The area under the PR curve does not have a probabilistic interpretation like ROC.

The PR gain curve was made to deal with some of the above problems with PR curves, although it still is intended for extreme class imbalance situations. The main difference is the PR gain curve has a universal baseline as precision is corrected according to chance expectation. We will see this in an example.

Note, we are using non repeated cross validation with Caret to save time, but it requires repeating generally to reduce the variance and bias. Also, for imbalanced data in Caret we need to change to the ‘prSummary’ function that uses area under the PR curve to select the best model.

MLeval (https://cran.r-project.org/web/packages/MLeval/index.html) makes curves and calculates metrics, and will automatically extract the best model parameters and data from the Caret results.

## load libraries required for analysislibrary(MLeval)library(caret)## simulate dataim <- twoClassSim(2000, intercept = -25, linearVars = 20)table(im$Class)## run caretfitControl <- trainControl(method = "cv",summaryFunction=prSummary,classProbs=T,savePredictions = T,verboseIter = F)im_fit <- train(Class ~ ., data = im,method = "ranger",metric = "AUC",trControl = fitControl)im_fit2 <- train(Class ~ ., data = im,method = "xgbTree",metric = "AUC",trControl = fitControl)## run MLevalx <- evalm(list(im_fit,im_fit2))## curves and metrics are in the 'x' list object

We can see in the below analyses, both models are above chance and xgbTree does slightly better than random forest. Pretty cool.

This is the PR curve, see the grey line is baseline chance expectation.

pr.png

This is the PR gain curve, where baseline is zero.

prg.png

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R – intobioinformatics.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Sponsorship: SatRdays and useR Groups

$
0
0

[This article was first published on r – Jumping Rivers, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

SatRdays

SatRdays are great. Low cost R events, held around the world. What’s not to love!

For the last year, we have been offering automatic sponsorship for all SatRday events. All the organisers have to do is complete a quick questionnaire and the money is sent on it’s way. So far we have sponsored seven events!

So if you are organising a SatRday, feel free to tap us for sponsorship! We’re particularly proud of how frictionless we’ve made the process.

useR / R-Ladies Groups

Now that we’ve tested the water with SatRday sponsorship, we thought we would do the same with useR groups. Due the hugh numbers of useR groups, there are over 400, we can’t open this up to the world (sorry). To start with we plan on offering sponsorship to twenty groups from Europe. Hopefully, we can increase this number.

So if you want sponsorship for your group, just complete this quick form


Jumping Rivers are RStudio Certified Full Service Partners. If you need help installing, or running RStudio Pro products, give us a shout. We might even be able to do it for free!

The post Sponsorship: SatRdays and useR Groups appeared first on Jumping Rivers.

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) { var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; s.src = '//cdn.viglink.com/api/vglnk.js'; var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: r – Jumping Rivers.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Advent of Code 2019-04 with R & JavaScript

$
0
0

[This article was first published on Colin Fay, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Solving Advent of Code 2019-04 with R and JavaScript.

[Disclaimer] Obviously, this post contains a big spoiler about Advent of Code, as it gives solutions for solving day 4.

[Disclaimer bis] I’m no JavaScript expert so this might not be the perfect solution. TBH, that’s also the case for the R solution.

About the JavaScript code

The JavaScript code has been written in the same RMarkdown as the R code. It runs thanks to the {bubble} package: https://github.com/ColinFay/bubble

Instructions

Find the instructions at: https://adventofcode.com/2019/day/4

R solution

Part one

test<-156218:652527library(magrittr)cond<-function(vec){splt<-strsplit(as.character(vec),"")[[1]]%>%as.numeric()adj_eq<-(splt==dplyr::lag(splt))[-1]incre<-(splt>=dplyr::lag(splt))[-1]any(adj_eq)&all(incre)}vapply(test,cond,logical(1))%>%sum()
## [1] 1694

Part two

cond2<-function(vec){splt<-strsplit(as.character(vec),"")[[1]]%>%as.numeric()adj_eq<-(splt==dplyr::lag(splt))[-1]if(any(adj_eq)){adj_eq<-any(table(splt)==2)}incre<-(splt>=dplyr::lag(splt))[-1]any(adj_eq)&all(incre)}vapply(test,cond2,logical(1))%>%sum()
## [1] 1148

JS solution

Part one & Two

// Generating the array (from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)

constrange=(start,stop,step=1)=>Array.from({length:(stop-start)/step+1},(_,i)=>start+(i*step));vartest=range(156218,652527)
functionlag(vec){varres=[];res.push(null);for(vari=0;i<vec.length-1;i++){res.push(vec[i])}returnres}functioncond(vec){varvec=vec.toString().split("").map(x=>parseInt(x));varlaged=lag(vec);varadj_eq=vec.map((x,i)=>x==laged[i])adj_eq.shift()varadj_eq=adj_eq.some(z=>z);varincre=vec.map((x,i)=>x>=laged[i])incre.shift()varincre=incre.every(z=>z);varall=[incre,adj_eq].every(z=>z);returnall}
test.map(cond).filter(v=>v).length
## 1694
functiontable(vec){vartbl={}vec.map(function(x){if(tbl[x]){tbl[x]=tbl[x]+1;}else{tbl[x]=1;}})returntbl}functioncond2(vec){varvec=vec.toString().split("").map(x=>parseInt(x));varlaged=lag(vec);varadj_eq=vec.map((x,i)=>x==laged[i])adj_eq.shift()varadj_eq=adj_eq.some(z=>z);if(adj_eq){vartb=table(vec);varres=[];for(iintb){res.push(tb[i]==2);}varadj_eq=res.some(x=>x);}varincre=vec.map((x,i)=>x>=laged[i]);incre.shift();varincre=incre.every(z=>z);varall=[incre,adj_eq].every(z=>z);returnall;}
test.map(cond2).filter(v=>v).length;
## 1148
var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) { var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; s.src = '//cdn.viglink.com/api/vglnk.js'; var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: Colin Fay.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

R Shiny for beginners: annotated starter code

$
0
0

[This article was first published on R on head spin - the Heads or Tails blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

This week I decided to get started with the R shiny package for interactive web applications. As an absolute beginner, I want to document my learning journey in the hope that it will be useful for other first-time shiny users.

This post assumes some basic familiarity with R and the tidyverse, but no prior knowledge of shiny is required. The content is digested from the official shiny tutorial which is great and definitely worth checking out for more details. All credit goes to them; I’m just trying to boil it down to the essentials to get you started within minutes.

Below is the complete code for my first shiny app. Only 56 lines (a good chunk of which are comments and styling) in hopefully readable formatting. I considered it fitting to base it on the classic coin flip experiment which results in either Heads or Tails:

# preparations; required libraries
library(shiny)
library(dplyr)
library(tibble)
library(stringr)
library(ggplot2)

# the post url
post <- "https://heads0rtai1s.github.io/2019/12/05/shiny-starter-code/"

# user interface elements and layout
ui <- fluidPage(
  titlePanel("Heads or Tails"),
  sidebarLayout(
    sidebarPanel(

      sliderInput(inputId = "n", label = "Number of flips:",
                  min = 10, max = 1000, value = 500),
      sliderInput(inputId = "prob", label = "Success rate:",
                  min = 0, max = 1, value = 0.5),

      tags$div(tags$p(HTML("    
                        Find the annotated code")),
               tags$a(href=post, "in this blog post."))

    ),
    mainPanel(plotOutput(outputId = "bars"))
  )
)

# server-side computations
server <- function(input, output) {

  # the bar plot
  output$bars <- renderPlot({

    # most of this is for ggplot2; note the input$x syntax
    flips <- tibble(flips = rbinom(input$n, 1, input$prob)) %>%
      mutate(flips = if_else(flips == 1, "Heads", "Tails"))

    flips %>%
      count(flips) %>%
      ggplot(aes(flips, n, fill = flips)) +
      geom_col() +
      geom_label(aes(flips, n, label = n), size = 5) +
      theme(legend.position = "none",
            axis.text = element_text(size = 15)) +
      labs(x = "", y = "") +
      ggtitle(str_c("Results of ", input$n,
                    " flips with Heads probability ",
                    sprintf("%.2f", input$prob)))
  })
}

# run it all
shinyApp(ui = ui, server = server)

All you need to do at this stage is to (have the required libraries installed and) copy/paste the code above into an active R session. Try it out!

This is the result you will get:

<br />

This app is embedded via shinyapps.io. More about that later.

The app allows you to choose the number of coin flips as well as the probability for Heads using slider bars. It visualises the resulting total numbers of Heads vs Tails as a reactive bar plot. Given the functionality of this app, 56 lines is not too bad, is it? Let’s dissect the code element by element!

Preparations: Before we get to the interesting parts, the first five lines define and load the packages the script needs. This is unrelated to shiny (other than loading it):

library(shiny)

Note, that shiny web apps on shinyapps.io apparently need explicit library calls and that my normal approach of using invisible(lapply()) led to some confusing errors before I figured it out. Besides the libraries, I’m also including the url for this post as part of the preparation.

The shiny code is structured into two main elements: (i) a user interface (UI) definition and layout, and (ii) the server-side computations producing the data for plots (or tables, or other output elements). At the end, there is always a call to the shinyApp function which renders the whole thing.

The UI setup starts with:

ui <- fluidPage(

which defines the internal name of the UI as ui (very surprising; I know). The fluidPage environment creates an output html that automatically adjusts to the size and shape of your viewer window. This seems to be the layout you would choose most often. The 2 alternatives are a fixedPage or a navbarPage which gives you a top-level navigation bar.

Inside our fluidPage we have the UI elements. The first one gives your app a title:

titlePanel("Heads or Tails")

Nothing too complex here. The next element is the sidebarLayout; as in “a layout that contains a sidebar” (as opposed to “a layout for the sidebar only”).

sidebarLayout(
    sidebarPanel(...),
    mainPanel(...)
  )

This layout has always two elements: the sidebarPanel and the mainPanel. You can browse other layout options here, including grids and tabs.

The sidebarPanel typically contains the control widgets. Those widgets are what the users interact with.

Here, we are using a sliderInput to allow the user to select the number of coin flips (in a range from 10 – 1000) and the probability for Heads (in a range from 0 – 1):

sidebarPanel(
  sliderInput(inputId = "n", label = "Number of flips:",
              min = 10, max = 1000, value = 500),
  sliderInput(inputId = "prob", label = "Success rate:",
              min = 0, max = 1, value = 0.5),

)

Both sliders have the same syntax:

  • min, max, and value define the slider range and the default value at which the slider sits upon loading the app. Those parameters are specific to the slider widget.

  • label is the text explaining to the user what the slider is being used for.

  • the inputID is important, since it will be used in the server-side part of the app to assign inputs to outputs. Note, that we call the number of flips n and the probability for Heads prob.

Other available widgets include checkboxes, radio buttons, or text input; each with their own specific parameters besides InputID and label.

Ǹote, that besides widgets and plots, html content or formatting can be added inside a Panel method. In the code I’m inserting a short paragraph and the hyperlink to this blog post:

tags$div(tags$p(HTML("    
                        Find the annotated code")),
               tags$a(href=post, "in this blog post."))

Shiny tags like tag$p or tag$a are named after their HTML equivalents. Raw HTML needs to wrapped via the HTML() function (thanks stackoverflow!). The line breaks are there for aesthetic reasons, to make the height of the sidebar and main boxes roughly the same.

The mainPanel typically contains the rendered reactive output. This object will change immediately when the user selects a different input (here via the sliders). We choose a plot because plots are awesome:

mainPanel(plotOutput(outputId = "bars"))
  • similar to the inputID above, the outputID connects UI elements to server computations.

  • besides the plotOutput function, there are other functions to produce tables, images, text, and more.

Now the 2nd part: the server setup. Here is where all the computations happen that produce the data for our output elements based on the input parameters. This part is close to a typical R workflow, in that you build your plots or tables to communicate insights. The only difference is that parameters are passed from the input UI, and that none of the possible parameters should break your plots.

In the code, the server function builds a list-like object output based on the user input:

server <- function(input, output) {

  output$bars <- renderPlot({})

}
  • We define a single output: a plot via renderPlot. Other render function include renderImage or renderTable. You can add as many output elements as you need.

  • The plot is assigned to output$bars. This means that it becomes an element in the output list (the only element in our case). The name bars needs to match the outputId = "bars" in our UI mainPanel.

Now, the code inside renderPlot is re-run every time the user changes the input parameters. In our example, I used some ggplot2 styling to make the plot look nicer. Here is an alternative one-liner using only base R, to emphasise the shiny elements. Go on and replace the renderPlot call in the starter code with this one to see what happens:

output$bars <- renderPlot({
    barplot(table( rbinom(input$n, 1, input$prob) ))
  })
  • In both versions, the rbinom function does all the work by creating a list of n random numbers following a binomial distribution with a success probability of prob.

  • Note, how the two input parameters are being passed as elements of the input object. Their names, n and prob need to match the respective inputIds in the UI part.

Finally, don’t forget the line that runs the whole thing:

shinyApp(ui = ui, server = server)

And that’s it! This is the main technical concept. The rest is the creative part: figuring out what to display with which user inputs. (Well, there’s also loading datasets and R scripts as well as streamlining bulky apps.)

Except, we’re not quite done yet. Copy/pasting code into the R console is not quite the best way to showcase your app. Here’s how to do it properly:

  • Paste all the starter code above into a single file called app.R.

  • Put that file into a sub-directory of your choice (e.g. ./headsortails/).

  • And call shiny::runApp("headsortails") from an R session running in the parent directory of that subdirectory.

Each app.R should live in its own sub-directory. They are called via the names of their sub-directories. (Note, that the convenience of having both UI and server in the same file was not always possible. Old shiny versions required two separate ui.R and server.R files; a structure that’s still supported).

Finally, shiny apps are ideal to be shared online since they are reactive HTML. You can run your own shiny server to do this, especially if you have many different apps to showcase. For your first steps, I recommend using shinyapps.io, run by the omipresent Rstudio folks. They have a free tier allowing you to host 5 apps running for a maximum 25 hours per month. That’s plenty of resources to get your feet wet.

As indicated at the beginning, I’m using shinyapps.io to host the version of the app that is included above. However, you cannot embed shiny elements directly into a blogdown post like this one, since those posts are static. Above, I used the little trick of embedding the link to my shiny app via the HTML iframe tag. Like this:

More info:

  • The official shiny tutorial, from which this post was digested, contains a list of 11 example apps that demonstrate various use cases.

  • Check out the pretty comprehensive shiny gallery for plenty of inspiration. As for many Rstudio/tidyverse tools there’s also a handy cheat sheet.

  • If you’re primarily interested in reactive dashboards have a look at shiny dashboard. I played with it a bit and I like it so far.

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) { var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; s.src = '//cdn.viglink.com/api/vglnk.js'; var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R on head spin - the Heads or Tails blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

lintools 0.1.3 is on CRAN

$
0
0

[This article was first published on R – Mark van der Loo, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Version 0.1.3 of the lintools package was accepted on CRAN today.

This version brings a few internal improvements and switches the testing suite to the tinytest test infrastructure.

lintools is provides basic manipulations of linear systems of equalities and inequalities including: variable elimination (Gaussian elimination, Fourier-Motzkin elimination), Moore-Penrose pseudoinverse, reduction to reduced row echelon form, value substitution, projecting a vector on the convex polytope described by a system of (in)equations, simplifing systems by removing spurious columns and rows and collapsing implied equalities, testing whether a matrix is totally unimodular and computing variable ranges implied by linear (in)equalities.

Markdown with by ❤wp-gfm
var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) { var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; s.src = '//cdn.viglink.com/api/vglnk.js'; var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R – Mark van der Loo.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.


Emails from R: Blastula 0.3

$
0
0

[This article was first published on RStudio Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

We’re pleased to announce blastula, a package for creating beautiful custom emails in R. At RStudio, we love interactive dashboards, but some situations call for a different communication mechanism. Use blastula to:

  • Compose custom email bodies based on code, code output, and markdown
  • Send emails using SMTP servers – even GMail – or integrate with production services like RStudio Connect

Blastula makes it easy to send notifications for everything from anomaly detection to fantasy basketball results, all without leaving R.

To get started, install blastula from CRAN:

install.packages('blastula')

Creating Email

Blastula’s unique strength is creating custom HTML email bodies that render in a variety of email clients, including mobile. The recommended way to create email is using blastula’s R Markdown output format. blastula::blastula_email. The body of the email will respect the R Markdown output, including markdown syntax and code chunk outputs.

---output: blastula::blastula_email --- Hi Team,This *important* forecast needs to go out today.```{r echo=FALSE}model <- arima(presidents, c(1, 0, 0))predict(model, 3)```

To create the email from the R Markdown document, use render_email:

email <- render_email('email.Rmd')

The resulting email object can be previewed in RStudio.

Email from R Markdown

Alternatively, it is possible to create an email without R Markdown, by using the compose_email function to combine text, images, and even plots:

library(blastula)library(ggplot2)library(glue)plot <- qplot(disp, hp, data = mtcars, colour = mpg)plot_email <- add_ggplot(plot)email <- compose_email(  body = md(c(     "Team, How would you plot the relationship between these 3 variables?",      plot_email  )))

Preview blastula emails in RStudio

Visit the documentation to learn how to embed images, set email headers and footers, and even add call-to-action buttons.

Sending Custom Emails with SMTP

To send email, blastula includes functions to access SMTP servers such as GMail, Outlook, and Office365.

First, securely tell blastula about your SMTP server:

create_smtp_creds_key(  id = "gmail",  user = "user_name@gmail.com",  provider = "gmail")

Next, use the SMTP service to send your custom email:

email %>%  smtp_send(    from = "personal@email.net",    to = "personal@email.net",    subject = "Testing the `smtp_send()` function",    credentials = creds_key(id = "gmail")  )

Sending Custom Emails with RStudio Connect

Organizations can use blastula in production on RStudio Connect. For instance, we use blastula to track critical services like our support ticket volume and our staff training schedules.

An easy way to get started is to access the RStudio Connect examples:

blastula::prepare_rsc_example_files()

Publish the resulting R Markdown document to RStudio Connect, where it can be scheduled for regular execution and distributed to stakeholders.

Schedule and Email in RStudio Connect

Blastula offers three additional functions to make it easier to create emails for RStudio Connect.

  • render_connect_email automatically adds a footer to the email with useful links back to the content on RStudio Connect.
  • attach_connect_email ensures RStudio Connect sends the custom email, and also makes it easy to customize the subject line, include additional email attachments, and optionally attach the report output.
  • suppress_scheduled_email() allows you to skip sending the email. This pattern is very powerful. For example, reports can be run once a day, but only distributed if certain conditions are met.

Together, these three functions can be used to send proactive notifcations:

if (demand_forecast > 1000) {  render_connect_email(input = "alert-supply-team-email.Rmd") %>%  attach_connect_email(    subject = sprintf("We need to prepare %d units!", demand_forecast),    attach_output = TRUE,    attachments = c("demand_forecast_data.csv")  )} else {  suppress_scheduled_email() }

Please be sure to visit the blastula website to find additional resources. Afterall, who doesn’t want a ggplot in their inbox?

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: RStudio Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Counting Arguments in the Tidyverse

$
0
0

[This article was first published on r – Jumping Rivers, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Before we start anything, I’d like to mention that most of the hard work came from nsaunders and his great blog post Idle thoughts lead to R internals: how to count function arguments.

Let’s get started.

The aim of this blog is to capture the number of arguments present in each function with packages of the tidyverse. First we need to load the necessary packages

library("tidyverse")library("tidytext")

Now we need to grab the relevant tidyverse packages

tpkg = tidyverse_packages()tpkg[17] = "readxl"head(tpkg)## [1] "broom"   "cli"     "crayon"  "dplyr"   "dbplyr"  "forcats"

We’ve had to reset the 17th element to readxl as it gets loaded as readxl\n(>=, which breaks the next block of code. Now we also need to load in the tidyverse packages. Doing this one by one would be a pain, so I’ve used map()

map(tpkg, library, character.only = TRUE)

Now for the actual analysis I’m just going to whack the full code in now, then go through it line by line.

pkg = tpkg %>%   as_tibble() %>%   rename(package = value) %>%    rowwise() %>%   mutate(funcs = paste0(ls(paste0("package:", package)), collapse = ",")) %>%   unnest_tokens(func, funcs, token = stringr::str_split,                 pattern = ",", to_lower = FALSE) %>%   filter(is.function(get(func, pos = paste0("package:", package)))) %>%   mutate(num_args = length(formalArgs(args(get(func, pos = paste0("package:", package)))))) %>%   ungroup()

This is what the head of pkg looks like

head(pkg)## # A tibble: 6 x 3##   package func            num_args##                    ## 1 broom   augment                2## 2 broom   augment_columns        8## 3 broom   bootstrap              3## 4 broom   confint_tidy           4## 5 broom   finish_glance          2## 6 broom   fix_data_frame         3

Lines 1-4

Lines 1-4 look like this

tpkg %>%   as_tibble() %>%   rename(package = value) %>%    rowwise() %>% 

Here we are grabbing, the tidyverse packages character vector, converting it to a tibble and renaming the column. We then use rowwise() so that we can work in a row-wise fashion.

Line 5

mutate(funcs = paste0(ls(paste0("package:", package)), collapse = ",")) %>% 

To get a character vector back of the objects within a package, we do ls("package:package_name"). However, we want to store this as a single string, so we need to use our old friend paste0() to do so. We then use mutate to attach this to the data frame. Our data from now looks like this

## Source: local data frame [6 x 2]## Groups: ## ## # A tibble: 6 x 2##   package funcs                                                            ##                                                                  ## 1 broom   argument_glossary,augment,augment_columns,bootstrap,column_gloss…## 2 cli     ansi_hide_cursor,ansi_show_cursor,ansi_with_hidden_cursor,bg_bla…## 3 crayon  %+%,bgBlack,bgBlue,bgCyan,bgGreen,bgMagenta,bgRed,bgWhite,bgYell…## 4 dplyr   %>%,add_count,add_count_,add_row,add_rownames,add_tally,add_tall…## 5 dbplyr  add_op_single,as.sql,base_agg,base_no_win,base_odbc_agg,base_odb…## 6 forcats %>%,as_factor,fct_anon,fct_c,fct_collapse,fct_count,fct_cross,fc…

Lines 6 – 7

unnest_tokens(func, funcs, token = stringr::str_split,                 pattern = ",", to_lower = FALSE) %>% 

As we’ve stored the function names as a single string, we can now apply some tidytext to turn our data into long data! We do this using the unnest_tokens() function. Here we are taking the funcs variable, turning it into func by splitting it up using str_split() from stringr. The data now looks like this

## Source: local data frame [6 x 2]## Groups: ## ## # A tibble: 6 x 2##   package func             ##                  ## 1 broom   argument_glossary## 2 broom   augment          ## 3 broom   augment_columns  ## 4 broom   bootstrap        ## 5 broom   column_glossary  ## 6 broom   confint_tidy

Line 8

filter(is.function(get(func, pos = paste0("package:", package)))) %>%

Now, not every object inside a package is a function. We can use is.function() to test this. However, as our function names are stored as strings, we must wrap them in the get() function. For instance,

is.function("augment")## [1] FALSEis.function(get("augment"))## [1] TRUE

What if we have conflicts in function names? We can also specify the package our function is from, using the argument pos

is.function(get("augment", pos = "package:broom"))## [1] TRUE

We can then use this condition within a filter command to remove any objects that aren’t functions

Lines 9 – end

mutate(num_args = length(formalArgs(args(get(func, pos = paste0("package:", package)))))) %>%   ungroup()

It is possible to withdraw the arguments of a function using the formalArgs() function. However, this does not work on primitive functions

formalArgs(get("add", pos = "package:magrittr"))## NULLformalArgs(get("augment", pos = "package:broom"))## [1] "x"   "..."

We can counter act this by wrapping the function in args() first. This method now works for both primitives and non-primitives

formalArgs(args(get("add", pos = "package:magrittr")))## [1] "e1" "e2"formalArgs(args(get("augment", pos = "package:broom")))## [1] "x"   "..."

To work out the number of these argument we simply wrap this expression in length().

The big reveal

pkg %>%   arrange(desc(num_args))## # A tibble: 2,292 x 3##    package    func               num_args##                           ##  1 ggplot2    theme                    93##  2 ggplot2    guide_colorbar           28##  3 ggplot2    guide_colourbar          28##  4 ggplot2    guide_legend             21##  5 rstudioapi launcherSubmitJob        21##  6 ggplot2    geom_dotplot             19##  7 ggplot2    geom_boxplot             18##  8 readr      read_delim_chunked       18##  9 readr      read_delim               17## 10 readr      spec_delim               17## # … with 2,282 more rows

So it turns out that theme() from ggplot2 is king of the arguments, by a mile! The largest per package looks like this


We’re not done there! The 9 packages with the largest sum of arguments are

largest = pkg %>%  group_by(package) %>%  count() %>%  arrange(desc(n)) %>%  head(9) %>%  pull(package)largest## [1] "rlang"      "ggplot2"    "dplyr"      "purrr"      "lubridate" ## [6] "dbplyr"     "readr"      "rstudioapi" "httr"

We can plot a histogram, for each package, of the no. of arguments in each function like so..

pkg %>%   filter(package %in% largest) %>%  ggplot(aes(x = num_args)) +   geom_histogram(binwidth = 1, fill = "steelblue", col = "black") +   facet_wrap(~package) +   xlim(c(0, 25)) +   theme_minimal()


We can go a step further and retrieve the argument names as well. To do this we use the same technique as before with the functions

pkg %>%   rowwise() %>%   mutate(args = paste0(formalArgs(args(get(func, pos = paste0("package:", package)))),                        collapse = ",")) %>%   unnest_tokens(arg, args, token = stringr::str_split,                 pattern = ",", to_lower = FALSE) %>%   ungroup() %>%   count(arg) %>%   arrange(desc(n))## # A tibble: 1,029 x 2##    arg          n##        ##  1 ...        785##  2 x          698##  3 data       169##  4 .x         120##  5 ""         102##  6 n           91##  7 .f          90##  8 position    90##  9 mapping     79## 10 na.rm       79## # … with 1,019 more rows

The most commonly used arguments in the tidyverse are ... and x by some distance.

pkg %>%   rowwise() %>%   mutate(args = paste0(formalArgs(args(get(func, pos = paste0("package:", package)))),                        collapse = ",")) %>%   unnest_tokens(arg, args, token = stringr::str_split,                 pattern = ",", to_lower = FALSE) %>%   ungroup() %>%   group_by(package) %>%   count(arg) %>%   arrange(package, desc(n)) %>%   slice(2) %>%   arrange(desc(n)) ## # A tibble: 26 x 3## # Groups:   package [26]##    package   arg         n##            ##  1 ggplot2   data      103##  2 purrr     .x         91##  3 dplyr     x          83##  4 rlang     ...        64##  5 readr     locale     44##  6 lubridate ...        35##  7 stringr   pattern    23##  8 dbplyr    x          21##  9 httr      ...        21## 10 tidyr     ...        18## # … with 16 more rows

So you can see that data is the most common argument within ggplot2, .x is the most common argument within purrr and so on…

That’s it for this blog post. Hope you’ve enjoyed!


The post Counting Arguments in the Tidyverse appeared first on Jumping Rivers.

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: r – Jumping Rivers.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Practical Data Science with R 2nd Edition now in-stock at Amazon.com!

$
0
0

[This article was first published on R – Win-Vector Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Practical Data Science with R 2nd Edition is now in-stock at Amazon.com!

NewImage

Buy it for your favorite data scientist in time for the holidays!

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R – Win-Vector Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Advent of Code 2019-06 with R

$
0
0

[This article was first published on Colin Fay, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Solving Advent of Code 2019-06 with R (and no JavaScript this time).

[Disclaimer] Obviously, this post contains a big spoiler about Advent of Code, as it gives solutions for solving day 6.

Instructions

Find the instructions at: https://adventofcode.com/2019/day/6

R solution

Part one

library(magrittr)library(igraph)
## ## Attaching package: 'igraph'## The following objects are masked from 'package:stats':## ##     decompose, spectrum## The following object is masked from 'package:base':## ##     union
ipt<-read.delim("input6.txt",header=FALSE,sep=")",stringsAsFactor=FALSE)grph<-ipt%>%graph_from_data_frame()grph%>%distance_table()%>%extract2("res")%>%sum()
## [1] 147807

Part two

distances(grph,v=V(grph)[["YOU"]],to=V(grph)[["SAN"]])-2
##     SAN## YOU 229

JS solution

Nop, no JS solution today… I didn’t feel like reimplementing igraph in JavaScript, neither digging into the graph modules today 😉

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: Colin Fay.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

celebRation 2020

$
0
0

[This article was first published on R blog posts on sandsynligvis.dk, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The year 2020 marks the 20th anniversary of the release of R version 1.0.0! To celebrate this, we are inviting the community of R users and developers for a two-day celebRation workshop/mini-conference on February 28-29th 2020 in Copenhagen.

We kick off on 28th February with hands-on workshops on two hot topics, namely data visualization using contemporary ggplot2 and extending R with C++ using the Rcpp package.

The day of the anniversary – February 29 – presents a line-up of speakers who cover the past, the present, and the future of the R programming language.

Current announced speakers are:

  • Peter Dalgaard, Copenhagen Business School
  • Julia Silge, StackOverflow
  • Roger Bivand, Norwegian School of Economics
  • Heather Turner, Freelance, UK
  • Therese Graversen, IT University of Copenhagen
  • Dirk Eddelbuettel, University of Illinois
  • Thomas Lin Pedersen, RStudio

Go to the website celebRation2020.org for registration and more information, and follow us on twitter ( @celebRtion2020) to get updates as we get nearer.

R v1.0.0 turns 20 in 2020! 🥳Come celebRate your favorite programming language on Feb 28-29 in Copenhagen, Denmark. Talks and workshops by @pdalgd, @juliasilge, @RogerBivand, @HeathrTurnr, @eddelbuettel, @thomasp85& more: https://t.co/oxIcabvUGl#rstats

— CelebRation2020 (@celebRtion2020) November 25, 2019

Important dates

  • January 6th, 2020. Early bird registration deadline.
  • February 3rd, 2020. Regular registration deadline.
  • February 28th, 2020. Workshop day
  • February 29th, 2020. Conference day
var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R blog posts on sandsynligvis.dk.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

R Package for @racently

$
0
0

[This article was first published on R | datawookie, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I recently wrote about an API for @racently. The next logical step was to build a package which wraps the API so that the data can easily be pulled into R.

The package is available here. It is still very much a work in progress: the API only exposes two endpoints, but both of them are wrapped in the package.

Installation

Install using {devtools}.

devtools::install_github("datawookie/racently")library(racently)

Searching for Athletes

The search_athlete() function makes it possible to search for an athlete by name using regular expressions for pattern matching.

Suppose I wanted to find athletes with the surname “Mann”.

search_athlete("Mann$")##                                      id        slug         name gender nationality        twitter parkrun strava## 1  016d0a83-1fc4-4613-81cb-ad3f09abac5e           Garry Mann      M                         NA     NA## 2  311aeaa2-155f-4566-a9fd-cf30afd67b16            Alec Mann      M          ZA                 NA     NA## 3  3207bed9-3dd4-42e7-aee5-c0a0347295c8         Michael Mann      M                         NA     NA## 4  3c22a177-d03e-41c7-be31-a2bc77b2c61c           Kevin Mann      M          ZA                 NA     NA## 5  52d681ea-8229-47ce-99ab-a4425b4dbcf0          Thomas Mann      M                         NA     NA## 6  7ebe5ce2-6067-48d5-9c68-5f8167d6ab6e           Julie Mann      F                         NA     NA## 7  8437fcc7-3a38-4ecb-8708-82d148ea3368           Angie Mann      F                         NA     NA## 8  94d8f1e6-4850-4708-8f70-3210b45d3bde           Helen Mann      F                         NA     NA## 9  bdd0716a-cbda-4c2e-8ef1-d5baab63ecfd         Patrick Mann      M                         NA     NA## 10 bebc042f-ad26-40f3-99d2-61a65e0296a2           Zeldi Mann      F                         NA     NA## 11 d4cf93a6-69b4-40c4-949e-8444da403e17           Peter Mann      M          ZA                 NA     NA## 12 d676cb99-f272-4e9a-be04-fb6ec0aa7245           Steve Mann      M          ZA                 NA     NA## 13 d9897020-6e62-47c4-8481-ecbd19ddad12          Nicola Mann      F                         NA     NA## 14 d9cc374d-521a-48bb-86dd-3ec6f05ef59f stuart-mann  Stuart Mann      M         runningmann100      NA     NA## 15 df571960-0451-4cba-8483-17ccb4704680             Kim Mann      F                         NA     NA## 16 e3c1dcc1-c783-4629-891b-f2e5a21daa87          Joanne Mann      F                         NA     NA## 17 e4417318-66ef-42e3-b9f7-6a241b550e74            Jack Mann      M                         NA     NA## 18 f2e9074c-ca75-4a99-b89d-07d377836c21             Roy Mann      M          ZA                 NA     NA## 19 f753bf50-4637-4cfb-89f6-efde8563ceff            Luke Mann      M          ZA                 NA     NA

We see that the somewhat legendary @runningmann100, Stuart Mann, is among the list of results.

Athlete Details

The athlete() function allows you to find the results for a specific athlete, specified by id (from the results above).

athlete("d9cc374d-521a-48bb-86dd-3ec6f05ef59f")## $name## [1] "Stuart Mann"## ## $gender## [1] "M"## ## $results##    date       race                      distance time     club                  license##  1 2019-06-09 Comrades                  86.8 km  09:53:23 Fourways Road Runners      NA##  2 2019-02-09 Klerksdorp                42.2 km  03:54:09 NA                         NA##  3 2018-11-24 Josiah Gumede             42.2 km  04:20:21 Fourways Road Runners    3388##  4 2018-10-28 Sapphire Coast            42.2 km  04:27:23 Fourways Road Runners    3388##  5 2018-09-02 Vaal River City           42.2 km  04:21:54 Fourways Road Runners    3388##  6 2018-06-10 Comrades                  90.2 km  10:15:52 Fourways Road Runners    3388##  7 2018-05-20 RAC                       10.0 km  01:14:21 Fourways Road Runners    3388##  8 2018-03-25 Umgeni Marathon           42.2 km  04:20:04 Fourways Road Runners    3388##  9 2018-03-10 Kosmos 3-in-1             42.2 km  04:18:51 NA                         NA## 10 2018-02-25 Maritzburg                42.2 km  04:31:38 Fourways Road Runners    3388## 11 2017-12-03 Heroes Marathon           42.2 km  04:28:06 Fourways Road Runners    3388## 12 2017-11-05 Soweto Marathon           42.2 km  04:41:24 Fourways Road Runners    3388## 13 2017-09-17 Cape Town Marathon        42.2 km  04:25:06 Fourways Road Runners    3388## 14 2017-06-04 Comrades                  86.7 km  10:40:59 Fourways Road Runners    3388## 15 2017-04-01 Arthur Cresswell Memorial 52.0 km  05:27:19 Fourways Road Runners    3388## 16 2017-03-26 Gaterite Challenge        42.2 km  04:14:54 Fourways Road Runners    3388## 17 2016-05-29 Comrades                  89.2 km  10:19:06 Fourways Road Runners    9120## 18 2016-05-01 Deloitte Challenge        42.2 km  04:15:53 Team Vitality              NA## 19 2016-04-24 Chatsworth Freedom        52.0 km  05:36:06 Fourways Road Runners    9120## 20 2015-08-30 Mandela Day               42.2 km  04:48:16 Fourways Road Runners      NA## 21 2015-01-25 Johnson Crane Hire        42.2 km  04:28:35 Fourways Road Runners      NA## 22 2009-08-09 Mtunzini Bush             16.0 km  01:31:07 Fourways Road Runners    9120## 23 2009-05-24 Comrades                  89.2 km  08:45:43 Fourways Road Runners    9120## 24 2008-11-28 Sani Stagger              42.2 km  05:25:19 Fourways Road Runners      NA

The results include name, gender and the details of all of the relevant results in the system. As Stuart has pointed out, there are many results missing from his profile (he ticks off a marathon pretty much every weekend), but hey, like I said, this is a work in progress.

Future

We’ll be working hard to add more race results over the coming months (and cleaning up some of the existing data). There are also plans to expose more functionality on the API, which in turn will filter through to the R package.

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R | datawookie.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

HackRcity 2019 recap: hacking the “coolest city” contest

$
0
0

[This article was first published on r – Appsilon Data Science | End­ to­ End Data Science Solutions, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Fellowship of the Ring

Intro + hackathon description  

Have you ever participated in a hackathon? A month ago my answer was still no (despite the fact that I’ve been working in the R Shiny/Data Science space for 5 years). Now I have checked it off my list. And my team won, so I’m 1 for 1, with a 100% success rate, so I can retire now. More seriously, the team and I made tons of mistakes and just a few good decisions and we think that it would be beneficial to share the lessons learned, both from the coding and work organisation perspective.

HackRcity participants

the HackRcity participants

What was the hackathon about? It was organised by the Analyx company from Poznań city, and held in their office. A great job done on their side! The problem to be solved was as follows: in 2018 one of the tourist organisations published “popularity index” of the Polish cities, and Poznań got a low score, especially in comparison to similar Polish cities e.g. Wrocław. That confirmed what city authorities had seen for a long time: that Poznań is not as attractive to tourists as it should be. So, Poznań’s office of promotion gathered all of the available data from the Central Statistical Office of Poland and gave it to the hackathon participants with an expected result: tell us what to do to make Poznań great again, especially in how it’s perceived by tourists.

The general task was divided into several parts that were assessed by the jury:

  1. Some values of “popularity index” were missing – teams should build a model to predict them, the MAE was compared
  2. Reproducibility and code organisation
  3. Interpretability of the model
  4. Value of conclusions for the city of Poznań 
  5. The quality of the presentation at the end of the hackathon
  6. An approach to solving side-quest: plan the trip through 5 polish cities for a fictional family based on their preferences

There were also two nice concepts introduced by the organisers. They made the work more fun and emphasized the crucial concept in data science – you need to look for helpful data around you:

  • each team was allotted 7 “points” that could be spent on additional datasets, and each had his own “price”. But you needed to choose wisely, for you could only afford some of them! So eventually each team had different data to use according to their brilliant (or ill-advised) ideas.
  • the names of the Polish cities in dataset were disguised as fruit names! So part of the game was to decode the names – it turned out that the ‘lemon’ was a nickname for ‘Warsaw’ 🙂 

How we organised our work 

So, we rolled up our sleeves and got to work! We had nine hours to complete the tasks. There was no time to lose! We decided to call our team lotR, after our favorite band of in-over-their-heads adventurers. 

the lotR fellowship gets to work

the lotR fellowship gets to work

the lotR fellowship gets to work

the lotR fellowship gets to work

But we really had no idea where to start. Someone said, “I don’t know, maybe we should look at the data.” Then the question became “Wait, how do we get the data?” But we figured it out and were very proud for the first success of the day! 😉

We realized that we didn’t have much experience with hackathons together as a team, so we needed to organise the way we work. What developed quite naturally was the model of hierarchical work splitting: we started by just looking at the data and getting familiar with it all together. Then we formed two groups: one focused on decoding the fruit names plus building the trip planner app and the second group focused on building the predictive model plus its interpretability. Each group then divided into sub-groups (well, consisting of only 1 person) that wrote code for a specific area. We kept everyone informed of our progress and helped each other with issues.

I’m sure that sounds great, but 2 hours into the hackathon I was honestly afraid that we would have nothing to show for our efforts, and we would have to get up on stage after 9 hours and admit our failure. But we eventually achieved some results, so lesson learned: do not give up!

 

View this post on Instagram

 

A post shared by Appsilon Data Science (@appsilonds) on Dec 6, 2019 at 5:08am PST

There was one obstacle with communication: we shared a room with a competing team! It caused some mistrust at the beginning. After a whole day together though we get along and it was actually a great idea for networking and building relations. We honestly kept our fingers crossed for the success of the other team during the presentations. 

Our delivered solution

We started slowly, very unorganised, and lost a lot of time to find the optimal way to operate technically. So here is the lesson learned: set up a repo earlier than later, a Slack channel, and a common environment. Integrate the tools that might be useful: we struggled with H2O on Mac and H2O<=> DALEX integration (and it was totally expected that it will be used, as prof. Przemysław Biecek was on the jury). 

I previously mentioned H2O. As the prediction error was just a part of the final score we decided to not overthink the solution and use autoML for R. It turned out to be the best strategy: our model was good enough (we had the 3rd best result in this section) and it took us just one click to generate the model and predictions. We used the saved time to improve the interpretability of the model and craft the interesting recommendations.

But please don’t think that no work is needed when using such automated solutions. What we discovered is that the solution is quite vulnerable for feature selection. And in our case that was a major issue: in the dataset there were 59 observations with ‘popularity index’ values and 7 to be predicted, but over 570 variables! Those were mostly financial budgets of each city per category and counts of tourist facilities, like hotels and restaurants. We took the following steps, and reducing the number of variables in each step improved our autoML model:

  1. Removed all of the variables that had 0 variance (had the same values for all observations; usually all equal to 0). After this step were left with 470 variables.
  2. Removed all highly correlated variables using the caret::findCorrelation function. We got down to 426 variables.
  3. Removed all unimportant variables using caret::rfeControl – the process of feature selection based on recursive feature elimination with random forests. We end up with 16 variables.
  4. Added important variables from datasets that we “bought” with our “points”: social media comments about Poznań and reviews from travelling portal. Our final dataset had 30 variables and gave the best results.

We were quite surprised that such an advanced solution as autoML that produces comparable results of super advanced deep learning models in just a few minutes does not have a step like removing the correlated variables.

The biggest value of the model was to find out why a city was popular or not. We spent more time on interpretability. We discovered that public spending on culture and education by a city correlated with its popularity with tourists. Other correlations include the number and quality of reviews on Tripadvisor and Twitter. 

So one of our recommendations to Poznań was to encourage small businesses there to get active on social media platforms.  

The lotR team also recommended that Poznań enhance the cultural side of the city. Poznań doesn’t have natural attractions like mountains or a seaside. There are some historical points of interest, such as a cathedral with the graves of Poland’s first kings. But there are a number of massive events like concerts and picnics. (We later discovered that Poznan is still pretty happening even at 2:30 AM. As people from the “Lemon” city, we were surprised to see that). 

What was our big plus was the “Trip Planner” in the form of a basic Shiny app. It allows the solution to be easily and user-friendly reproducible for different sets of family preferences. The purpose of the app is to recommend road trips for families. It calculates the average preferences of the family members and finds the 5 best destinations within 1500 km. It captures the family members’ interests with a questionnaire and compares their interests with the offerings of the various cities. In short — it’s an app for family road trip ideas! 

Screenshot of the Trip Planner app

Screenshot of the Trip Planner app

Results – lessons learned

The presentation part was done by me because the other guys on the team were busy drinking beers in the audience. Ok, to be honest, we made this decision to prevent the chaos of having four presenters on stage at the same time with little prep time, and it turned out to be a good choice. So we recommend assigning one person to give the final presentation. 

Next, don’t worry about the details, just focus on what is useful. Nine hours goes by quickly in this type of event. Focus on what is actually assessed! We noticed that the model was only worth 20% of the total score, so we found a pre-made model and used that, leaving us time to focus on other tasks. We were surprised by the technical issues that we encountered. So it’s wise to prepare your work environment and tools before the hackathon starts. 

R Shiny allowed us to develop a decent looking solution in a short amount of time. We were the only team to use it, so maybe it gave us a little edge. 🙂

Closing thoughts 

It was a great experience and got us out of our typical coding environment. After the competition, the city center was still pretty happening, with crowds everywhere. Poznań really looked like a “best kept secret” type of city.  

winners of the hackathon with the poster

lotR completed the journey

Do you have your own hackathon hacks? Please add them in the comments below.

Thanks for reading! Follow us on Twitter @dubelmarcin , @frappsilon, @frappsilon, @krystian8207, @q_nowicki

Follow Appsilon Data Science on Social Media

 

Article HackRcity 2019 recap: hacking the “coolest city” contest comes from Appsilon Data Science | End­ to­ End Data Science Solutions.

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: r – Appsilon Data Science | End­ to­ End Data Science Solutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.


Choropleth Map in ggplot2

$
0
0

[This article was first published on R – data technik, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Creating a map in ggplot2 can be surprisingly easy! This tutorial will show the US by state. The dataset is from 1970 and will show some US statistics including population, income, life expectancy, and illiteracy.

I love making maps, while predictive statistics provide such great insight, map making was one thing that really made my interested in data science. I’m also glad R provides a great way to make them.

I’d also recommend plotly package where you can make it interactive as you scroll over. All within R!

Here is the first map we will make:

This is population by state in 1970 US.

library(ggplot2)library(dplyr)states<-as.data.frame(state.x77)states$region <- tolower(rownames(states))states_map <- map_data("state")fact_join <- left_join(states_map, states, by = "region")ggplot(fact_join, aes(long, lat, group = group))+  geom_polygon(aes(fill = Population), color = "white")+  scale_fill_viridis_c(option = "C")+  theme_classic()

For the next graph the code will be mostly similar but I will change the fill = option.

Let’s try income:

This is great. The income has much more normal distribution. Seems varying among the states.

ggplot(fact_join, aes(long, lat, group = group))+  geom_polygon(aes(fill = Income), color = "white")+  scale_fill_viridis_c(option = "C")+  theme_classic()

Last one we’ll make is life expectancy:

Great info here! Life expectancy, in the 1970s by state! That particular variable needed a little extra coding, see below:

fact_join$`Life Exp` <- as.numeric(fact_join$`Life Exp`)ggplot(fact_join, aes(long, lat, group = group))+geom_polygon(aes(fill = `Life Exp`), color = "white")+scale_fill_viridis_c(option = "C")+theme_classic()

Enjoy your maps! Also this dataset is publicly available so feel free to recreate.

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R – data technik.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

From one Regression to Hundreds Within Seconds: A Shiny Specification Curve

$
0
0

[This article was first published on An Accounting and Data Science Nerd's Corner, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Online appendices detailing the robustness of empirical analyses are paramount but they never let readers explore all reasonable researcher degrees of freedom. Simonsohn, Simmons and Nelson suggest a ‘specification curve’ that allows readers to eyeball how a main coefficient of interest varies across a wide arrange of specifications. I build on this idea by making it interactive: A shiny-based web app enables readers to explore the robustness of findings in detail along the whole curve.

Following up on two blog articles that introduced the in-development ‘rdfanalysis’ package, the app is new extension of this package. In essence, it let’s you change the research design choices that you want to display and then redraws the curve on the fly.

In its simple version, it just needs a data frame with each row containing an estimate and its choices. In most cases, you also want to include lower and upper bounds of the estimate as well so that the specification curve can display a nice confidence interval ribbon. As an example, the first few rows of data used in the example below look as follows:

# devtools::install_github("joachim-gassen/rdfanalysis")library(rdfanalysis)load(url("https://joachim-gassen.github.io/data/rdf_ests.RData"))kable(head(ests), format.args = list(digits = 3))
na.omitidvsoutlier_tment_styleoutlier_cutoffmodel_typefeffectclusterestlbub
yesgdp_onlywin0level-levelnonenone0.3620.34660.3783
nogdp_onlywin0level-levelnonenone0.3860.37370.3983
yesgdp_schoolwin0level-levelnonenone0.1310.11590.1452
nogdp_schoolwin0level-levelnonenone0.0750.06440.0855
yesgdp_uewin0level-levelnonenone0.3700.35430.3860
nogdp_uewin0level-levelnonenone0.3250.31160.3378

This is the type of data that exhaust_design() from the rdfanalysis package will generate. If you create your own data, you need to inform plot_rdf_spec_curve() which columns in your data frame contain choices. You do this by setting attribute in the data frame. In the case above, choices are included in columns 1 to 7. So that you would set the attribute as follows:

attr(ests, "choices") <- 1:7

Once you have such a data frame, you can plot your specification curve:

attr(ests, "choices") <- 1:7plot_rdf_spec_curve(ests, "est", "lb", "ub") 

Nice. But how does one create the interactive display? Easy. Just call shiny_rdf_spec_curve(), giving your data and the additional parameters that you would hand over to plot_rdf_spec_curve() as a list:

shiny_rdf_spec_curve(ests, list("est", "lb", "ub")) 

You will see that the app will take a while to display the initial specification curve. This is because it is based on 11,264 specifications. Once you start to drill down, the app will become more responsive.

When you focus on only a few specifications you might think “Hey this is nice but I would rather like to see the actual regression results for these cases”. This can be done! You can use the workflow of the rdfanalysis package so that the app will present the actual model results as soon as you zoomed in on a handful of specifications. While you at it you can also specify your preferred specification (e.g., the one that you presented in your paper).

design <- define_design(steps = c("read_data",                                  "select_idvs",                                  "treat_extreme_obs",                                  "specify_model",                                  "est_model"),                        rel_dir = "vignettes/case_study_code")shiny_rdf_spec_curve(  ests, list("est", "lb", "ub"),  design, "vignettes/case_study_code",  "https://joachim-gassen.github.io/data/wb_new.csv",  default_choices = list(na.omit = "no",                         idvs = "full",                         outlier_tment_style ="win",                         model_type = "level-log",                         outlier_cutoff = 0,                         feffect = "ctryyear",                         cluster = "ctryyear"))

Please note that the code above will only run when you have forked the rdfanalysis repo and set the working directory to its root.

Finally, you can add a title and a short info text by setting the title and abstract parameters and, voilà: Your interactive and exhaustive robustness section.

A Shiny Specification Curve

Kudos to Nate Breznau for bringing up the idea to use shiny to visualize the specification curve. See my former post for more detail on the case and on how to drill deeper into the findings. Feel free to use the in-development ‘rdfanalysis’ package to exhaust the researcher degrees of freedoms in your own projects. If you have remarks about this project, I would love to hear from you. Use the comment section below or reach out via email or twitter.

Enjoy!

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: An Accounting and Data Science Nerd's Corner.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

RcppArmadillo 0.9.800.3.0

$
0
0

[This article was first published on Thinking inside the box , and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

armadillo image

A small Armadillo bugfix upstream update 9.800.3 came out a few days ago. The changes, summarised by Conrad in email to me (and for once not yet on the arma site are fixes for matrix row iterators, better detection of non-hermitian matrices by eig_sym(), inv_sympd(), chol(), expmat_sym() and miscellaneous minor fixes. It also contains a bug fix by Christian Gunning to his sample() implementation.

Armadillo is a powerful and expressive C++ template library for linear algebra aiming towards a good balance between speed and ease of use with a syntax deliberately close to a Matlab. RcppArmadillo integrates this library with the R environment and language–and is widely used by (currently) 679 other packages on CRAN.

Changes in RcppArmadillo version 0.9.800.3.0 (2019-12-04)

  • Upgraded to Armadillo release 9.800.3 (Horizon Scraper)

  • The sample function passes the prob vector as const allowing subsequent calls (Christian Gunning in #276 fixing #275)

Courtesy of CRANberries, there is a diffstat report relative to previous release. More detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

If you like this or other open-source work I do, you can now sponsor me at GitHub. For the first year, GitHub will match your contributions.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: Thinking inside the box .

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

What is new for rquery December 2019

$
0
0

[This article was first published on R – Win-Vector Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Our goal has been to make rquery the best query generation system for R (and to make data_algebra the best query generator for Python).

Lets see what rquery is good at, and what new features are making rquery better.

The idea is: the query is a first class citizen that we can use to design and optimize queries prior to translating them into a data transform action via data.table, SQL, Pandas, or other realizations.

For quite a while rquery has had query-narrowing. Columns that are not used in the calculation are eliminated early. Here is an example.

library(rquery)

ops <-mk_td(
  "d", 
  c("col1", "col2", "col3")) %.>%extend(., sum23 :=col2 +col3) %.>%select_columns(., 'sum23')

cat(format(ops))
## mk_td("d", c(
##   "col1",
##   "col2",
##   "col3")) %.>%
##  extend(.,
##   sum23 := col2 + col3) %.>%
##  select_columns(., 
##     c('sum23'))

The above query (or operator DAG) represents working with a table that has columns col1, col2, col3. The example is specifying adding a new derived column named sum23 and then limiting down to only this new column. We’ve tried to use operator names that evoke operator names used by Codd.

An important point is: the query is bound to a description of a data frame (or a schema), not bound to any one data frame. Thus we can re-use the query on new data.

The record-keeping in the query knows that only columns col2 and col2 are used.

columns_used(ops)
## $d
## [1] "col2" "col3"

This allows “query narrowing” where the unused columns are not specified in intermediate queries. This is easiest to see if we convert the query to SQL.

ops %.>%to_sql(
    ., 
    rquery::rquery_default_db_info()) %.>%cat(.)
## SELECT
##  "sum23"
## FROM (
##  SELECT
##   "col2" + "col3"  AS "sum23"
##  FROM (
##   SELECT
##    "col2",
##    "col3"
##   FROM
##    "d"
##   ) tsql_76973382323412881950_0000000000
## ) tsql_76973382323412881950_0000000001

Notice col1 is never referred to. This can be handy when working with tables with hundreds of columns.

And, using rqdatatable we can use data.table as another data action implementation.

library(rqdatatable)

data.frame(col1 =1, col2 =2, col3 =3) %.>%ops %.>%knitr::kable(.)
sum23
5

rquery now also has query-shortening. Some dead-values can be eliminated during query construction, before any calculations are attempted.

ops <-mk_td(
  "example_table", 
  c("col1", "col2", "col3")) %.>%extend(., sum23 :=col2 +col3) %.>%extend(., x :=1) %.>%extend(., x :=2) %.>%extend(., x :=3) %.>%extend(., x :=4) %.>%extend(., x :=5) %.>%select_columns(., c('x', 'sum23'))

cat(format(ops))
## mk_td("example_table", c(
##   "col1",
##   "col2",
##   "col3")) %.>%
##  extend(.,
##   sum23 := col2 + col3,
##   x := 5) %.>%
##  select_columns(., 
##     c('x', 'sum23'))

Obviously nobody would construct such a bad query, but it is nice that some of the “ick” is optimized automatically.

Both of the above optimizations are deliberately conservative. They are implemented to be correct (not give incorrect results), but are not necessarily super aggressive in eliminating all redundancy.

It is a bit long and technical. But both of these optimizations are easy due to the use of category theoretic ideas in the design of the rquery and data_algebra packages (I am working on some notes on this here).

The short form is: the rquery/data_algebra operators have an interpretation in a nice category over table schemas. The schema objects give us pre-condition and post-condition record keeping which enforces correct query composition and query narrowing. The generality of arrow composition gives us the freedom to place optimizations in the composition step. This gives us more options then systems that are restricted to list-concatenation or function composition/abstraction as their notion of composition. It also lets us enforce and check conditions early.

rquery performs most of its checking during query construction. This can catch errors early and save a lot of development time.

ops_bad <-mk_td(
  "example_table", 
  c("col1", "col2", "col3")) %.>%extend(., sum23 :=col2_MISSPELLED +col3)
## Error in check_have_cols(src_columns, required_cols, "rquery::extend"): rquery::extend unknown columns col2_MISSPELLED

Notice an error was raised during query construction. We didn’t have to wait to supply data or translate to SQL.

Let’s take a look at the SQL translation of our final example query.

ops %.>%to_sql(
    ., 
    rquery::rquery_default_db_info()) %.>%cat(.)
## SELECT
##  "x",
##  "sum23"
## FROM (
##  SELECT
##   "col2" + "col3"  AS "sum23",
##   5  AS "x"
##  FROM (
##   SELECT
##    "col2",
##    "col3"
##   FROM
##    "example_table"
##   ) tsql_28722584463189084716_0000000000
## ) tsql_28722584463189084716_0000000001

There are some more things we would wish optimized away, such as both the inner and outer select. But the SQL is reasonably short, due to the intermediate stages that were optimized out of the original query. Later versions of the system will pick these up, and likely these are also easy for downstream SQL optimizers to eliminate.

An important point: optimizations performed during query construction are shared among all back-ends: data.table, SQL, and Pandas.

Please consider giving rquery a try.


Appendix

We often get asked “why bother with rquery, given dplyr was first.” I’d say: if you are happy with dplyr don’t worry about rquery. Though I would add: you really owe it to yourself to check out data.table, it is by far the best data manipulation system in R.

However, let’s take a look how dbplyr generates a similar SQL query.

library(dplyr)
## 
## Attaching package: 'dplyr'

## The following objects are masked from 'package:stats':
## 
##     filter, lag

## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
packageVersion("dplyr")
## [1] '0.8.3'
library(dbplyr)
## 
## Attaching package: 'dbplyr'

## The following objects are masked from 'package:dplyr':
## 
##     ident, sql
packageVersion("dbplyr")
## [1] '1.4.2'
con <-DBI::dbConnect(RSQLite::SQLite(), 
                      ":memory:")
copy_to(
  con, 
  data.frame(col1 =1, col2 =2, col3 =3), 
  name ='d')

tbl(con, 'd') %>%mutate(sum23 :=col2 +col3) %>%mutate(x :=1) %>%mutate(x :=2) %>%mutate(x :=3) %>%mutate(x :=4) %>%mutate(x :=5) %>%select(x, sum23) %>%show_query()
## 
## SELECT 5.0 AS `x`, `sum23`
## FROM (SELECT `col1`, `col2`, `col3`, `sum23`, 4.0 AS `x`
## FROM (SELECT `col1`, `col2`, `col3`, `sum23`, 3.0 AS `x`
## FROM (SELECT `col1`, `col2`, `col3`, `sum23`, 2.0 AS `x`
## FROM (SELECT `col1`, `col2`, `col3`, `sum23`, 1.0 AS `x`
## FROM (SELECT `col1`, `col2`, `col3`, `col2` + `col3` AS `sum23`
## FROM `d`)))))

The dplyrSQL query appears to have neither query narrowing nor query shortening. Again, a downstream SQL optimizer may be able to eliminate these steps (or it may not). However, it also would be desirable to have these sort of eliminations available when using data.table through dtplyr.

Also, dbplyr does not seem to catch errors until compute() or print() are called.

tbl(con, 'd') %>%mutate(sum23 :=col2_MISSPELLED +col3) %>%show_query()
## 
## SELECT `col1`, `col2`, `col3`, `col2_MISSPELLED` + `col3` AS `sum23`
## FROM `d`

The above SQL refers to a non-existent column col2_MISSPELLED. The query construction and SQL generation steps did not signal any error. Depending on how many queries and steps are before this, this could delay finding this mistake by quite a while (especially when using a high latency SQL engine such as Apache Spark).

DBI::dbDisconnect(con)
var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) { var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; s.src = '//cdn.viglink.com/api/vglnk.js'; var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R – Win-Vector Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Le Monde puzzle [#1119]

$
0
0

[This article was first published on R – Xi'an's Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

A digit puzzle as Le weekly Monde current mathematical puzzle that sounds close to some earlier versions:

Perfect squares are pairs (a²,b²) with the same number of digits such that a²b² is itself a square. What is the pair providing a²b² less than 10⁶? Is there a solution with both integers enjoying ten digits?

The run of a brute force R code like

cek<-function(a,b){  u<-trunc  if ((n<-u(log(a^2,ba=10)))==u(log(b^2,ba=10))&      (u(sqrt(a^2*10^(n+1)+b^2))^2==(a^2*10^(n+1)+b^2))) print(c(a,b))}

provides solutions to the first question.

[1] 2 3[1] 4 9[1] 12 20[1] 15 25[1] 18 30[1] 49 99[1] 126 155[1] 154 300[1] 159 281[1] 177 277[1] 228 100[1] 252 310[1] 285 125

with the (demonstrable) conclusion that the only pairs with an even number of digits are of the form (49…9²,9…9²), as for instance (49999²,99999²) with ten digits each.

var vglnk = { key: '949efb41171ac6ec1bf7f206d57e90b8' }; (function(d, t) {var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;s.src = '//cdn.viglink.com/api/vglnk.js';var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script'));

To leave a comment for the author, please follow the link and comment on their blog: R – Xi'an's Og.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Viewing all 12110 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>