Today, give a try to Techtonique web app, a tool designed to help you make informed, data-driven decisions using Mathematics, Statistics, Machine Learning, and Data Visualization. Here is a tutorial with audio, video, code, and slides: https://moudiki2.gumroad.com/l/nrhgb. 100 API requests are now (and forever) offered to every user, no matter the pricing tier.
This blog post demonstrates how to use the machine learning conformal regression (higher-quality prediction intervals, see https://conformalpredictionintro.github.io/) REST API provided by techtonique.net (the latest updates are in the new the API’s blog) using two different methods:
- curl - For command-line users and shell scripts
- Python requests - For Python developers. Note that you can use https://curlconverter.com/ to translate the following request in your favorite programming language.
We’ll walk through examples using the Boston Housing dataset for regression analysis.
The input files can be found in Techtonique/datasets (the ones with names ending with 2 specify a training set index).
Each example will show how to:
- Make API calls with proper authentication
- Handle the response data
Let’s get started!
First, get a token from: https://www.techtonique.net/token.
0 - Download data
!wget https://raw.githubusercontent.com/Techtonique/datasets/refs/heads/main/tabular/regression/boston_dataset2.csv
--2025-05-28 18:31:05-- https://raw.githubusercontent.com/Techtonique/datasets/refs/heads/main/tabular/regression/boston_dataset2.csv
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 40687 (40K) [text/plain]
Saving to: 'boston_dataset2.csv'
boston_dataset2.csv 0%[ ] 0 –.-KB/s
boston_dataset2.csv 100%[===================>] 39.73K –.-KB/s in 0.01s
2025-05-28 18:31:05 (3.10 MB/s) - 'boston_dataset2.csv' saved [40687/40687]
1 - Using curl
Note that you can use https://curlconverter.com/ to translate the following request in your favorite programming language.
!curl -X POST \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NGY3ZDE3Ny05OWQ0LTQzNDktOTc1OC0zZTBkOGVkYWZkYWUiLCJlbWFpbCI6InRoaWVycnkubW91ZGlraS50ZWNodG9uaXF1ZUBnbWFpbC5jb20iLCJleHAiOjE3NDg0NTkwNzh9.xnYgi-WjPH5yS8e6iM-xdQL9mbjEsXRVyUp4ovGJsOw" \
-F "file=@boston_dataset2.csv;type=text/csv" \
"https://www.techtonique.net/mlregression?base_model=ElasticNet&n_hidden_features=5"
{"y_true":[24.0,34.70000076293945,18.899999618530273,18.899999618530273,19.899999618530273,17.5,20.200000762939453,18.200000762939453,15.199999809265137,14.5,15.600000381469727,13.899999618530273,12.699999809265137,14.5,13.100000381469727,30.799999237060547,25.299999237060547,20.0,35.400001525878906,24.700000762939453,31.600000381469727,25.0,19.399999618530273,17.399999618530273,20.899999618530273,24.200000762939453,22.799999237060547,23.399999618530273,21.399999618530273,20.0,20.799999237060547,21.200000762939453,20.299999237060547,24.799999237060547,23.899999618530273,22.5,22.600000381469727,25.0,20.600000381469727,26.5,20.100000381469727,18.700000762939453,19.200000762939453,18.799999237060547,15.699999809265137,19.600000381469727,23.0,17.100000381469727,14.0,17.799999237060547,19.399999618530273,17.0,15.600000381469727,23.100000381469727,23.600000381469727,23.200000762939453,39.79999923706055,36.20000076293945,37.900001525878906,29.100000381469727,50.0,48.5,50.0,24.399999618530273,20.0,21.700000762939453,19.299999237060547,21.5,50.0,31.600000381469727,31.5,29.0,23.700000762939453,17.600000381469727,18.5,24.399999618530273,20.899999618530273,43.5,25.200000762939453,32.400001525878906,29.100000381469727,45.400001525878906,35.400001525878906,28.5,22.5,28.200000762939453,19.399999618530273,17.799999237060547,23.799999237060547,20.399999618530273,18.5,25.0,24.600000381469727,22.600000381469727,19.399999618530273,20.700000762939453,21.100000381469727,19.5,20.600000381469727,17.200000762939453,23.100000381469727,24.100000381469727,20.600000381469727,20.799999237060547,27.5,50.0,15.0,10.899999618530273,10.199999809265137,15.100000381469727,9.699999809265137,13.100000381469727,5.0,8.5,17.200000762939453,27.5,17.200000762939453,17.899999618530273,7.0,10.399999618530273,8.800000190734863,14.199999809265137,13.399999618530273,16.100000381469727,14.300000190734863,11.699999809265137,9.600000381469727,8.699999809265137,17.100000381469727,18.399999618530273,10.800000190734863,12.600000381469727,14.100000381469727,16.100000381469727,14.899999618530273,12.699999809265137,16.399999618530273,19.100000381469727,19.899999618530273,19.600000381469727,29.799999237060547,13.800000190734863,12.0,23.700000762939453,21.200000762939453,7.0,13.600000381469727,21.799999237060547,19.700000762939453,18.299999237060547,16.799999237060547,22.399999618530273],"y_pred":[28.768948924029395,29.831958160004714,22.61321387990469,24.01648375856343,22.044551152278544,20.39698831838647,18.91900267371865,20.687553945513315,19.58111180721161,18.06683499222494,19.669833511144027,17.861543924050082,16.55781150475991,21.14795480985066,17.955816995049933,27.537665074157633,25.65397131171581,21.599105281270447,29.829738267067043,26.871191127670972,30.064409469366574,25.589287524851468,23.91372540949688,20.81363030590693,23.27048042115735,25.49760502741832,24.75757600730877,24.584357124205297,24.521935211193053,23.398983576863206,23.59738888804846,23.201951616701912,23.153395130514117,25.35302241436235,24.913879739385226,22.529618688239136,25.610646260278838,25.51739020275608,24.15729373763772,25.607856651752503,21.908041364340114,21.616866137966138,23.68776562701335,19.32584704853713,14.764312002477082,21.260752158606444,21.80899015057107,20.852458613060573,16.382117204625942,14.809974680181092,20.603803874471883,24.489244193276896,23.45243908968263,21.363948729710767,26.155342813582994,24.427081009361643,30.65883863095734,24.50416077786758,29.50518124595886,28.814884942657642,34.378354464126325,33.833207460460976,34.751530277192124,24.318572458771687,18.91783145086166,23.052846023162083,18.813507057360226,23.884729451232253,34.98662832417418,29.012665023087294,27.874747533052517,29.382272205882742,27.196536899430996,20.73324835772983,18.829611217381427,26.1931454083334,24.387593883853413,33.533558042587174,25.35723484700848,31.2092741506342,26.503671640371714,33.582803763242325,30.43270778970531,28.31300311053933,28.0904418784569,27.25867855257031,22.913364995361196,20.248865870555044,25.25517446995109,23.769060350304727,21.21990909813968,25.581400889677077,25.972008796691533,26.181550150890693,24.877911422922146,24.670265625873995,23.362907481024745,22.18081847585986,23.26229855034116,21.82785858253395,26.745575429590662,26.928533636626003,22.841529418108994,18.552062483782926,14.039908098644514,21.39864581656404,22.83201174766174,17.736644532085585,8.850033471729716,17.048119896465387,11.463317753264993,19.32616376185265,9.425613315175166,10.433950518921984,13.065103024639525,18.38970158611069,16.585369867549673,4.981802814756211,2.2336044505207973,9.956625817547545,11.007709548489785,18.12839653177502,14.290968866031477,20.097868086896735,18.336211824278323,17.532308538556585,16.849544914773787,12.56961385044844,18.02639883433364,18.81725867766704,13.861104495847185,18.694841697410638,17.95561314893297,18.831750390899426,17.6133176865059,15.457743868035381,19.81536111605319,16.368293541547153,19.08789864060966,20.63312406051258,23.30711614009076,15.66836960373547,12.292568743517135,24.131104169752223,21.724276409426814,13.851522873721262,18.06123244266778,21.322682074182076,17.128041399133267,20.904032348665616,21.620139636767856,24.162960320099234],"Score":{"R² Score":0.6252325743531928,"MAE (Mean Absolute Error)":3.699843099565764,"MSE (Mean Squared Error)":27.925081668459494,"RMSE (Root Mean Squared Error)":5.284418763540556,"MAPE (Mean Absolute Percentage Error)":18.840140796923713,"Max Error":28.60135418343596,"support":152.0}}
Use https://curlconverter.com/ to translate the following request in your favorite programming language.
!curl -X POST \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NGY3ZDE3Ny05OWQ0LTQzNDktOTc1OC0zZTBkOGVkYWZkYWUiLCJlbWFpbCI6InRoaWVycnkubW91ZGlraS50ZWNodG9uaXF1ZUBnbWFpbC5jb20iLCJleHAiOjE3NDg0NTkwNzh9.xnYgi-WjPH5yS8e6iM-xdQL9mbjEsXRVyUp4ovGJsOw" \
-F "file=@boston_dataset2.csv;type=text/csv" \
"https://www.techtonique.net/mlregression?base_model=ElasticNet&n_hidden_features=5&return_pi=True"
{"y_true":[24.0,34.70000076293945,18.899999618530273,18.899999618530273,19.899999618530273,17.5,20.200000762939453,18.200000762939453,15.199999809265137,14.5,15.600000381469727,13.899999618530273,12.699999809265137,14.5,13.100000381469727,30.799999237060547,25.299999237060547,20.0,35.400001525878906,24.700000762939453,31.600000381469727,25.0,19.399999618530273,17.399999618530273,20.899999618530273,24.200000762939453,22.799999237060547,23.399999618530273,21.399999618530273,20.0,20.799999237060547,21.200000762939453,20.299999237060547,24.799999237060547,23.899999618530273,22.5,22.600000381469727,25.0,20.600000381469727,26.5,20.100000381469727,18.700000762939453,19.200000762939453,18.799999237060547,15.699999809265137,19.600000381469727,23.0,17.100000381469727,14.0,17.799999237060547,19.399999618530273,17.0,15.600000381469727,23.100000381469727,23.600000381469727,23.200000762939453,39.79999923706055,36.20000076293945,37.900001525878906,29.100000381469727,50.0,48.5,50.0,24.399999618530273,20.0,21.700000762939453,19.299999237060547,21.5,50.0,31.600000381469727,31.5,29.0,23.700000762939453,17.600000381469727,18.5,24.399999618530273,20.899999618530273,43.5,25.200000762939453,32.400001525878906,29.100000381469727,45.400001525878906,35.400001525878906,28.5,22.5,28.200000762939453,19.399999618530273,17.799999237060547,23.799999237060547,20.399999618530273,18.5,25.0,24.600000381469727,22.600000381469727,19.399999618530273,20.700000762939453,21.100000381469727,19.5,20.600000381469727,17.200000762939453,23.100000381469727,24.100000381469727,20.600000381469727,20.799999237060547,27.5,50.0,15.0,10.899999618530273,10.199999809265137,15.100000381469727,9.699999809265137,13.100000381469727,5.0,8.5,17.200000762939453,27.5,17.200000762939453,17.899999618530273,7.0,10.399999618530273,8.800000190734863,14.199999809265137,13.399999618530273,16.100000381469727,14.300000190734863,11.699999809265137,9.600000381469727,8.699999809265137,17.100000381469727,18.399999618530273,10.800000190734863,12.600000381469727,14.100000381469727,16.100000381469727,14.899999618530273,12.699999809265137,16.399999618530273,19.100000381469727,19.899999618530273,19.600000381469727,29.799999237060547,13.800000190734863,12.0,23.700000762939453,21.200000762939453,7.0,13.600000381469727,21.799999237060547,19.700000762939453,18.299999237060547,16.799999237060547,22.399999618530273],"y_pred":[32.16082000732422,30.79961395263672,20.05938148498535,23.67896270751953,23.47905921936035,18.770856857299805,19.340715408325195,21.627836227416992,15.842584609985352,14.643644332885742,17.52556037902832,15.89393424987793,11.627347946166992,20.468059539794922,15.588478088378906,30.029430389404297,26.96938133239746,20.521324157714844,28.974288940429688,26.767742156982422,32.05381393432617,23.07607650756836,25.031036376953125,19.314247131347656,23.190044403076172,25.204025268554688,26.053119659423828,24.26835060119629,24.30323600769043,22.426401138305664,23.377092361450195,21.172176361083984,23.818923950195312,26.601848602294922,24.997562408447266,22.079574584960938,27.454540252685547,28.275344848632812,25.44940757751465,26.14413833618164,22.233226776123047,20.329992294311523,25.73922348022461,18.88027000427246,10.237476348876953,21.168455123901367,22.092113494873047,19.61725425720215,11.15411376953125,11.845582962036133,22.082191467285156,23.582231521606445,20.7059268951416,23.73539924621582,29.166961669921875,26.604455947875977,30.897022247314453,27.681873321533203,32.93724822998047,30.653331756591797,35.620208740234375,35.28023147583008,36.18257141113281,20.363269805908203,13.644023895263672,19.003395080566406,12.84988784790039,20.900146484375,34.15884780883789,31.027061462402344,31.686702728271484,28.539081573486328,28.223297119140625,19.846202850341797,14.783512115478516,25.75575065612793,23.309009552001953,37.53040313720703,27.343379974365234,32.01240539550781,28.572311401367188,35.12142562866211,32.89341735839844,30.886131286621094,29.659130096435547,30.140058517456055,24.581920623779297,17.794912338256836,26.4272403717041,25.498001098632812,22.1319580078125,26.98638153076172,26.93602752685547,26.200008392333984,25.097257614135742,25.11322021484375,24.139034271240234,23.192955017089844,24.575538635253906,18.611425399780273,26.07616424560547,24.416305541992188,21.50562286376953,24.793699264526367,25.797842025756836,26.060726165771484,22.750547409057617,15.789379119873047,6.071758270263672,19.071392059326172,10.811687469482422,19.648544311523438,4.525966644287109,5.9653472900390625,10.412298202514648,14.990995407104492,12.019023895263672,-1.521148681640625,-5.938503265380859,5.799098968505859,5.720115661621094,19.714937210083008,9.509811401367188,20.26764678955078,16.93144416809082,17.029972076416016,14.026863098144531,6.443004608154297,17.09900665283203,20.072021484375,11.191726684570312,19.53536033630371,18.168582916259766,19.09132194519043,13.606542587280273,13.085769653320312,18.57816505432129,14.772441864013672,19.433124542236328,22.522960662841797,23.85995101928711,17.013851165771484,10.616643905639648,26.733097076416016,23.208518981933594,9.111820220947266,15.100822448730469,22.93875503540039,14.853889465332031,21.14824867248535,21.579914093017578,24.191570281982422],"pi_lower":[18.721416473388672,17.360210418701172,6.619977951049805,10.239559173583984,10.039655685424805,5.331453323364258,5.901311874389648,8.188432693481445,2.4031810760498047,1.2042407989501953,4.086156845092773,2.454530715942383,-1.8120555877685547,7.028656005859375,2.1490745544433594,16.59002685546875,13.529977798461914,7.081920623779297,15.53488540649414,13.328338623046875,18.614410400390625,9.636672973632812,11.591632843017578,5.874843597412109,9.750640869140625,11.76462173461914,12.613716125488281,10.828947067260742,10.863832473754883,8.986997604370117,9.937688827514648,7.7327728271484375,10.379520416259766,13.162445068359375,11.558158874511719,8.64017105102539,14.01513671875,14.835941314697266,12.010004043579102,12.704734802246094,8.7938232421875,6.890588760375977,12.299819946289062,5.440866470336914,-3.2019271850585938,7.72905158996582,8.6527099609375,6.177850723266602,-2.285289764404297,-1.593820571899414,8.64278793334961,10.142827987670898,7.266523361206055,10.295995712280273,15.727558135986328,13.16505241394043,17.457618713378906,14.242469787597656,19.497844696044922,17.21392822265625,22.180805206298828,21.84082794189453,22.743167877197266,6.923866271972656,0.204620361328125,5.563991546630859,-0.5895156860351562,7.460742950439453,20.719444274902344,17.587657928466797,18.247299194335938,15.099678039550781,14.783893585205078,6.40679931640625,1.3441085815429688,12.316347122192383,9.869606018066406,24.090999603271484,13.903976440429688,18.573001861572266,15.13290786743164,21.682022094726562,19.45401382446289,17.446727752685547,16.2197265625,16.700654983520508,11.14251708984375,4.355508804321289,12.987836837768555,12.058597564697266,8.692554473876953,13.546977996826172,13.496623992919922,12.760604858398438,11.657854080200195,11.673816680908203,10.699630737304688,9.753551483154297,11.13613510131836,5.172021865844727,12.636760711669922,10.97690200805664,8.066219329833984,11.35429573059082,12.358438491821289,12.621322631835938,9.31114387512207,2.3499755859375,-7.367645263671875,5.631988525390625,-2.627716064453125,6.209140777587891,-8.913436889648438,-7.474056243896484,-3.0271053314208984,1.5515918731689453,-1.420379638671875,-14.960552215576172,-19.377906799316406,-7.6403045654296875,-7.719287872314453,6.275533676147461,-3.9295921325683594,6.828243255615234,3.4920406341552734,3.5905685424804688,0.5874595642089844,-6.99639892578125,3.6596031188964844,6.632617950439453,-2.2476768493652344,6.095956802368164,4.729179382324219,5.651918411254883,0.16713905334472656,-0.3536338806152344,5.138761520385742,1.333038330078125,5.993721008300781,9.08355712890625,10.420547485351562,3.5744476318359375,-2.8227596282958984,13.293693542480469,9.769115447998047,-4.327583312988281,1.6614189147949219,9.499351501464844,1.4144859313964844,7.708845138549805,8.140510559082031,10.752166748046875],"pi_upper":[45.600223541259766,44.239017486572266,33.49878692626953,37.11836624145508,36.91846466064453,32.21025848388672,32.780120849609375,35.067237854003906,29.2819881439209,28.08304786682129,30.964963912963867,29.333337783813477,25.06675148010254,33.90746307373047,29.027881622314453,43.468833923339844,40.408782958984375,33.96072769165039,42.413692474365234,40.20714569091797,45.49321746826172,36.515480041503906,38.47043991088867,32.7536506652832,36.62944793701172,38.643428802490234,39.492523193359375,37.70775604248047,37.742637634277344,35.865806579589844,36.816497802734375,34.61157989501953,37.25832748413086,40.04125213623047,38.43696594238281,35.518978118896484,40.893943786621094,41.71474838256836,38.88880920410156,39.58354187011719,35.672630310058594,33.76939392089844,39.178627014160156,32.319671630859375,23.6768798828125,34.60785675048828,35.531517028808594,33.05665588378906,24.593517303466797,25.28498649597168,35.5215950012207,37.021636962890625,34.14533233642578,37.1748046875,42.60636520385742,40.043861389160156,44.33642578125,41.12127685546875,46.376651763916016,44.092735290527344,49.05961227416992,48.719635009765625,49.62197494506836,33.80267333984375,27.08342742919922,32.44279861450195,26.289291381835938,34.33955001831055,47.59825134277344,44.46646499633789,45.12610626220703,41.978485107421875,41.66270065307617,33.285606384277344,28.222915649414062,39.195152282714844,36.7484130859375,50.96980667114258,40.78278350830078,45.45180892944336,42.011714935302734,48.560829162597656,46.332820892333984,44.32553482055664,43.098533630371094,43.57946014404297,38.021324157714844,31.234315872192383,39.86664581298828,38.93740463256836,35.57136154174805,40.425785064697266,40.375431060791016,39.63941192626953,38.536659240722656,38.5526237487793,37.57843780517578,36.63235855102539,38.01494216918945,32.05082702636719,39.515567779541016,37.855709075927734,34.94502639770508,38.23310089111328,39.23724365234375,39.50012969970703,36.18994903564453,29.228782653808594,19.51116180419922,32.51079559326172,24.25109100341797,33.087947845458984,17.965370178222656,19.40475082397461,23.851701736450195,28.43039894104004,25.45842742919922,11.918254852294922,7.5009002685546875,19.238502502441406,19.15951919555664,33.15434265136719,22.949214935302734,33.70705032348633,30.370847702026367,30.469375610351562,27.466266632080078,19.882408142089844,30.538410186767578,33.51142501831055,24.63113021850586,32.974761962890625,31.607986450195312,32.530723571777344,27.04594612121582,26.52517318725586,32.01757049560547,28.21184539794922,32.872528076171875,35.962364196777344,37.299354553222656,30.45325469970703,24.056047439575195,40.17250061035156,36.64792251586914,22.551223754882812,28.540225982666016,36.37815856933594,28.293292999267578,34.58765411376953,35.019317626953125,37.63097381591797],"pi_coverage":96.71052631578947,"Score":{"R² Score":0.6354086995124817,"MAE (Mean Absolute Error)":3.7427568435668945,"MSE (Mean Squared Error)":27.166824340820312,"RMSE (Root Mean Squared Error)":5.212180382605759,"MAPE (Mean Absolute Percentage Error)":19.09572982788086,"Max Error":23.939273834228516,"support":152.0}}
!curl -X POST \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NGY3ZDE3Ny05OWQ0LTQzNDktOTc1OC0zZTBkOGVkYWZkYWUiLCJlbWFpbCI6InRoaWVycnkubW91ZGlraS50ZWNodG9uaXF1ZUBnbWFpbC5jb20iLCJleHAiOjE3NDg0NTkwNzh9.xnYgi-WjPH5yS8e6iM-xdQL9mbjEsXRVyUp4ovGJsOw" \
-F "file=@boston_dataset2.csv;type=text/csv" \
"https://www.techtonique.net/mlregression?base_model=ElasticNet&n_hidden_features=5&return_pi=True"
{"y_true":[24.0,34.70000076293945,18.899999618530273,18.899999618530273,19.899999618530273,17.5,20.200000762939453,18.200000762939453,15.199999809265137,14.5,15.600000381469727,13.899999618530273,12.699999809265137,14.5,13.100000381469727,30.799999237060547,25.299999237060547,20.0,35.400001525878906,24.700000762939453,31.600000381469727,25.0,19.399999618530273,17.399999618530273,20.899999618530273,24.200000762939453,22.799999237060547,23.399999618530273,21.399999618530273,20.0,20.799999237060547,21.200000762939453,20.299999237060547,24.799999237060547,23.899999618530273,22.5,22.600000381469727,25.0,20.600000381469727,26.5,20.100000381469727,18.700000762939453,19.200000762939453,18.799999237060547,15.699999809265137,19.600000381469727,23.0,17.100000381469727,14.0,17.799999237060547,19.399999618530273,17.0,15.600000381469727,23.100000381469727,23.600000381469727,23.200000762939453,39.79999923706055,36.20000076293945,37.900001525878906,29.100000381469727,50.0,48.5,50.0,24.399999618530273,20.0,21.700000762939453,19.299999237060547,21.5,50.0,31.600000381469727,31.5,29.0,23.700000762939453,17.600000381469727,18.5,24.399999618530273,20.899999618530273,43.5,25.200000762939453,32.400001525878906,29.100000381469727,45.400001525878906,35.400001525878906,28.5,22.5,28.200000762939453,19.399999618530273,17.799999237060547,23.799999237060547,20.399999618530273,18.5,25.0,24.600000381469727,22.600000381469727,19.399999618530273,20.700000762939453,21.100000381469727,19.5,20.600000381469727,17.200000762939453,23.100000381469727,24.100000381469727,20.600000381469727,20.799999237060547,27.5,50.0,15.0,10.899999618530273,10.199999809265137,15.100000381469727,9.699999809265137,13.100000381469727,5.0,8.5,17.200000762939453,27.5,17.200000762939453,17.899999618530273,7.0,10.399999618530273,8.800000190734863,14.199999809265137,13.399999618530273,16.100000381469727,14.300000190734863,11.699999809265137,9.600000381469727,8.699999809265137,17.100000381469727,18.399999618530273,10.800000190734863,12.600000381469727,14.100000381469727,16.100000381469727,14.899999618530273,12.699999809265137,16.399999618530273,19.100000381469727,19.899999618530273,19.600000381469727,29.799999237060547,13.800000190734863,12.0,23.700000762939453,21.200000762939453,7.0,13.600000381469727,21.799999237060547,19.700000762939453,18.299999237060547,16.799999237060547,22.399999618530273],"y_pred":[32.16082000732422,30.79961395263672,20.05938148498535,23.67896270751953,23.47905921936035,18.770856857299805,19.340715408325195,21.627836227416992,15.842584609985352,14.643644332885742,17.52556037902832,15.89393424987793,11.627347946166992,20.468059539794922,15.588478088378906,30.029430389404297,26.96938133239746,20.521324157714844,28.974288940429688,26.767742156982422,32.05381393432617,23.07607650756836,25.031036376953125,19.314247131347656,23.190044403076172,25.204025268554688,26.053119659423828,24.26835060119629,24.30323600769043,22.426401138305664,23.377092361450195,21.172176361083984,23.818923950195312,26.601848602294922,24.997562408447266,22.079574584960938,27.454540252685547,28.275344848632812,25.44940757751465,26.14413833618164,22.233226776123047,20.329992294311523,25.73922348022461,18.88027000427246,10.237476348876953,21.168455123901367,22.092113494873047,19.61725425720215,11.15411376953125,11.845582962036133,22.082191467285156,23.582231521606445,20.7059268951416,23.73539924621582,29.166961669921875,26.604455947875977,30.897022247314453,27.681873321533203,32.93724822998047,30.653331756591797,35.620208740234375,35.28023147583008,36.18257141113281,20.363269805908203,13.644023895263672,19.003395080566406,12.84988784790039,20.900146484375,34.15884780883789,31.027061462402344,31.686702728271484,28.539081573486328,28.223297119140625,19.846202850341797,14.783512115478516,25.75575065612793,23.309009552001953,37.53040313720703,27.343379974365234,32.01240539550781,28.572311401367188,35.12142562866211,32.89341735839844,30.886131286621094,29.659130096435547,30.140058517456055,24.581920623779297,17.794912338256836,26.4272403717041,25.498001098632812,22.1319580078125,26.98638153076172,26.93602752685547,26.200008392333984,25.097257614135742,25.11322021484375,24.139034271240234,23.192955017089844,24.575538635253906,18.611425399780273,26.07616424560547,24.416305541992188,21.50562286376953,24.793699264526367,25.797842025756836,26.060726165771484,22.750547409057617,15.789379119873047,6.071758270263672,19.071392059326172,10.811687469482422,19.648544311523438,4.525966644287109,5.9653472900390625,10.412298202514648,14.990995407104492,12.019023895263672,-1.521148681640625,-5.938503265380859,5.799098968505859,5.720115661621094,19.714937210083008,9.509811401367188,20.26764678955078,16.93144416809082,17.029972076416016,14.026863098144531,6.443004608154297,17.09900665283203,20.072021484375,11.191726684570312,19.53536033630371,18.168582916259766,19.09132194519043,13.606542587280273,13.085769653320312,18.57816505432129,14.772441864013672,19.433124542236328,22.522960662841797,23.85995101928711,17.013851165771484,10.616643905639648,26.733097076416016,23.208518981933594,9.111820220947266,15.100822448730469,22.93875503540039,14.853889465332031,21.14824867248535,21.579914093017578,24.191570281982422],"pi_lower":[18.721416473388672,17.360210418701172,6.619977951049805,10.239559173583984,10.039655685424805,5.331453323364258,5.901311874389648,8.188432693481445,2.4031810760498047,1.2042407989501953,4.086156845092773,2.454530715942383,-1.8120555877685547,7.028656005859375,2.1490745544433594,16.59002685546875,13.529977798461914,7.081920623779297,15.53488540649414,13.328338623046875,18.614410400390625,9.636672973632812,11.591632843017578,5.874843597412109,9.750640869140625,11.76462173461914,12.613716125488281,10.828947067260742,10.863832473754883,8.986997604370117,9.937688827514648,7.7327728271484375,10.379520416259766,13.162445068359375,11.558158874511719,8.64017105102539,14.01513671875,14.835941314697266,12.010004043579102,12.704734802246094,8.7938232421875,6.890588760375977,12.299819946289062,5.440866470336914,-3.2019271850585938,7.72905158996582,8.6527099609375,6.177850723266602,-2.285289764404297,-1.593820571899414,8.64278793334961,10.142827987670898,7.266523361206055,10.295995712280273,15.727558135986328,13.16505241394043,17.457618713378906,14.242469787597656,19.497844696044922,17.21392822265625,22.180805206298828,21.84082794189453,22.743167877197266,6.923866271972656,0.204620361328125,5.563991546630859,-0.5895156860351562,7.460742950439453,20.719444274902344,17.587657928466797,18.247299194335938,15.099678039550781,14.783893585205078,6.40679931640625,1.3441085815429688,12.316347122192383,9.869606018066406,24.090999603271484,13.903976440429688,18.573001861572266,15.13290786743164,21.682022094726562,19.45401382446289,17.446727752685547,16.2197265625,16.700654983520508,11.14251708984375,4.355508804321289,12.987836837768555,12.058597564697266,8.692554473876953,13.546977996826172,13.496623992919922,12.760604858398438,11.657854080200195,11.673816680908203,10.699630737304688,9.753551483154297,11.13613510131836,5.172021865844727,12.636760711669922,10.97690200805664,8.066219329833984,11.35429573059082,12.358438491821289,12.621322631835938,9.31114387512207,2.3499755859375,-7.367645263671875,5.631988525390625,-2.627716064453125,6.209140777587891,-8.913436889648438,-7.474056243896484,-3.0271053314208984,1.5515918731689453,-1.420379638671875,-14.960552215576172,-19.377906799316406,-7.6403045654296875,-7.719287872314453,6.275533676147461,-3.9295921325683594,6.828243255615234,3.4920406341552734,3.5905685424804688,0.5874595642089844,-6.99639892578125,3.6596031188964844,6.632617950439453,-2.2476768493652344,6.095956802368164,4.729179382324219,5.651918411254883,0.16713905334472656,-0.3536338806152344,5.138761520385742,1.333038330078125,5.993721008300781,9.08355712890625,10.420547485351562,3.5744476318359375,-2.8227596282958984,13.293693542480469,9.769115447998047,-4.327583312988281,1.6614189147949219,9.499351501464844,1.4144859313964844,7.708845138549805,8.140510559082031,10.752166748046875],"pi_upper":[45.600223541259766,44.239017486572266,33.49878692626953,37.11836624145508,36.91846466064453,32.21025848388672,32.780120849609375,35.067237854003906,29.2819881439209,28.08304786682129,30.964963912963867,29.333337783813477,25.06675148010254,33.90746307373047,29.027881622314453,43.468833923339844,40.408782958984375,33.96072769165039,42.413692474365234,40.20714569091797,45.49321746826172,36.515480041503906,38.47043991088867,32.7536506652832,36.62944793701172,38.643428802490234,39.492523193359375,37.70775604248047,37.742637634277344,35.865806579589844,36.816497802734375,34.61157989501953,37.25832748413086,40.04125213623047,38.43696594238281,35.518978118896484,40.893943786621094,41.71474838256836,38.88880920410156,39.58354187011719,35.672630310058594,33.76939392089844,39.178627014160156,32.319671630859375,23.6768798828125,34.60785675048828,35.531517028808594,33.05665588378906,24.593517303466797,25.28498649597168,35.5215950012207,37.021636962890625,34.14533233642578,37.1748046875,42.60636520385742,40.043861389160156,44.33642578125,41.12127685546875,46.376651763916016,44.092735290527344,49.05961227416992,48.719635009765625,49.62197494506836,33.80267333984375,27.08342742919922,32.44279861450195,26.289291381835938,34.33955001831055,47.59825134277344,44.46646499633789,45.12610626220703,41.978485107421875,41.66270065307617,33.285606384277344,28.222915649414062,39.195152282714844,36.7484130859375,50.96980667114258,40.78278350830078,45.45180892944336,42.011714935302734,48.560829162597656,46.332820892333984,44.32553482055664,43.098533630371094,43.57946014404297,38.021324157714844,31.234315872192383,39.86664581298828,38.93740463256836,35.57136154174805,40.425785064697266,40.375431060791016,39.63941192626953,38.536659240722656,38.5526237487793,37.57843780517578,36.63235855102539,38.01494216918945,32.05082702636719,39.515567779541016,37.855709075927734,34.94502639770508,38.23310089111328,39.23724365234375,39.50012969970703,36.18994903564453,29.228782653808594,19.51116180419922,32.51079559326172,24.25109100341797,33.087947845458984,17.965370178222656,19.40475082397461,23.851701736450195,28.43039894104004,25.45842742919922,11.918254852294922,7.5009002685546875,19.238502502441406,19.15951919555664,33.15434265136719,22.949214935302734,33.70705032348633,30.370847702026367,30.469375610351562,27.466266632080078,19.882408142089844,30.538410186767578,33.51142501831055,24.63113021850586,32.974761962890625,31.607986450195312,32.530723571777344,27.04594612121582,26.52517318725586,32.01757049560547,28.21184539794922,32.872528076171875,35.962364196777344,37.299354553222656,30.45325469970703,24.056047439575195,40.17250061035156,36.64792251586914,22.551223754882812,28.540225982666016,36.37815856933594,28.293292999267578,34.58765411376953,35.019317626953125,37.63097381591797],"pi_coverage":96.71052631578947,"Score":{"R² Score":0.6354086995124817,"MAE (Mean Absolute Error)":3.7427568435668945,"MSE (Mean Squared Error)":27.166824340820312,"RMSE (Root Mean Squared Error)":5.212180382605759,"MAPE (Mean Absolute Percentage Error)":19.09572982788086,"Max Error":23.939273834228516,"support":152.0}}
Use https://curlconverter.com/ to translate the following request in your favorite programming language.
!curl -X POST \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NGY3ZDE3Ny05OWQ0LTQzNDktOTc1OC0zZTBkOGVkYWZkYWUiLCJlbWFpbCI6InRoaWVycnkubW91ZGlraS50ZWNodG9uaXF1ZUBnbWFpbC5jb20iLCJleHAiOjE3NDg0NTkwNzh9.xnYgi-WjPH5yS8e6iM-xdQL9mbjEsXRVyUp4ovGJsOw" \
-F "file=@boston_dataset2.csv;type=text/csv" \
"https://www.techtonique.net/gbdtregression?model_type=lightgbm"
{"y_true":[24.0,34.70000076293945,18.899999618530273,18.899999618530273,19.899999618530273,17.5,20.200000762939453,18.200000762939453,15.199999809265137,14.5,15.600000381469727,13.899999618530273,12.699999809265137,14.5,13.100000381469727,30.799999237060547,25.299999237060547,20.0,35.400001525878906,24.700000762939453,31.600000381469727,25.0,19.399999618530273,17.399999618530273,20.899999618530273,24.200000762939453,22.799999237060547,23.399999618530273,21.399999618530273,20.0,20.799999237060547,21.200000762939453,20.299999237060547,24.799999237060547,23.899999618530273,22.5,22.600000381469727,25.0,20.600000381469727,26.5,20.100000381469727,18.700000762939453,19.200000762939453,18.799999237060547,15.699999809265137,19.600000381469727,23.0,17.100000381469727,14.0,17.799999237060547,19.399999618530273,17.0,15.600000381469727,23.100000381469727,23.600000381469727,23.200000762939453,39.79999923706055,36.20000076293945,37.900001525878906,29.100000381469727,50.0,48.5,50.0,24.399999618530273,20.0,21.700000762939453,19.299999237060547,21.5,50.0,31.600000381469727,31.5,29.0,23.700000762939453,17.600000381469727,18.5,24.399999618530273,20.899999618530273,43.5,25.200000762939453,32.400001525878906,29.100000381469727,45.400001525878906,35.400001525878906,28.5,22.5,28.200000762939453,19.399999618530273,17.799999237060547,23.799999237060547,20.399999618530273,18.5,25.0,24.600000381469727,22.600000381469727,19.399999618530273,20.700000762939453,21.100000381469727,19.5,20.600000381469727,17.200000762939453,23.100000381469727,24.100000381469727,20.600000381469727,20.799999237060547,27.5,50.0,15.0,10.899999618530273,10.199999809265137,15.100000381469727,9.699999809265137,13.100000381469727,5.0,8.5,17.200000762939453,27.5,17.200000762939453,17.899999618530273,7.0,10.399999618530273,8.800000190734863,14.199999809265137,13.399999618530273,16.100000381469727,14.300000190734863,11.699999809265137,9.600000381469727,8.699999809265137,17.100000381469727,18.399999618530273,10.800000190734863,12.600000381469727,14.100000381469727,16.100000381469727,14.899999618530273,12.699999809265137,16.399999618530273,19.100000381469727,19.899999618530273,19.600000381469727,29.799999237060547,13.800000190734863,12.0,23.700000762939453,21.200000762939453,7.0,13.600000381469727,21.799999237060547,19.700000762939453,18.299999237060547,16.799999237060547,22.399999618530273],"y_pred":[29.225081225502688,33.204107026550275,19.100385576962925,21.537694528581877,20.654316145576225,17.35438550884038,18.797868937397727,19.082751756570577,16.877474455282204,14.816824109482262,16.997973613257525,15.219720737919227,14.601996774955799,18.718013250272364,16.27350330791557,31.901631552341385,24.461071619610657,21.075405297664837,31.89341443548755,23.45845934919339,34.21195277079657,23.506453838216608,20.01375796882777,20.026681111543105,21.49721663446495,24.08030015564916,24.742120666938767,24.032985463295034,23.291127787710302,22.20183264057285,22.46305897384681,22.007375338375358,23.097815287150937,23.23984768392706,21.812990152582348,20.655081138482185,22.379380054879707,24.06359515276423,20.82297940330729,24.78582287391681,20.73784262984714,19.129587526932998,20.37673360559639,19.95498006248719,17.185170734764856,19.62307838569604,19.487822631754973,16.987412766851527,16.14137448924674,12.813847207274309,14.651194797173483,17.10003154096021,18.034967435739286,20.617323761970443,23.21220140693988,22.758732632408023,40.481708683657544,25.85037401691941,37.59411515257517,31.152150740363975,44.63642133751292,44.840012695471955,44.68207655153863,22.108080363655922,18.541110246657343,20.729623248276386,19.226749450727105,20.54290749111923,39.519001158557614,31.99464369210887,37.68654729658841,27.08115110828744,23.269355927166774,19.359069497556604,18.319180043340754,23.23471845293031,21.454533744018203,49.0750165889169,23.83656148437516,37.599080817287565,23.62004707597541,45.35499444510982,34.787361393996626,33.96423064464267,27.66146568352216,29.14551774186401,20.552213972863505,18.67772453554021,23.18848045150176,22.496813993387867,21.051775553535588,23.18848045150176,27.71398981442412,23.79382640068927,20.86423229782233,20.91593414270695,21.725529917232205,19.077607678093724,20.870926924753537,19.94766095285449,22.485949507910732,24.923225688856732,22.04103875125826,21.154924930319766,25.268066368410274,30.566301604446874,23.071986855767094,9.440112464420526,8.03183868945414,14.162699520962335,10.126532667496614,12.577734024981556,7.325507093726402,7.768803238664486,15.37589605682134,13.325915474199439,12.09152753519237,10.256269969623393,7.113448684839998,8.240890634722554,7.727307848851805,13.878533306015619,12.223408803795266,20.062551911618804,15.218495829521885,14.36318351167952,11.866768903818818,7.453701517876654,13.84381364284999,15.509224411235847,9.426238404592974,15.532037295633687,15.598794667780572,16.837564191669173,13.970178714155118,14.67785848321219,16.30584147246973,15.393942657629374,17.635403193549315,21.92126088218697,25.306218088445053,16.102426241219657,13.340410511929926,25.775525950894963,22.160047523546893,12.922075707633107,15.70471369637864,20.949008539018443,17.969797118701038,21.318729920992478,21.289664598210322,22.137091859994644],"Score":{"R² Score":0.8477657120245916,"MAE (Mean Absolute Error)":2.2015616951916726,"MSE (Mean Squared Error)":11.34344831895685,"RMSE (Root Mean Squared Error)":3.3680036102945095,"MAPE (Mean Absolute Percentage Error)":10.96210555459064,"Max Error":19.433698395553126,"support":152.0}}
Use https://curlconverter.com/ to translate the following request in your favorite programming language.
!curl -X POST \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NGY3ZDE3Ny05OWQ0LTQzNDktOTc1OC0zZTBkOGVkYWZkYWUiLCJlbWFpbCI6InRoaWVycnkubW91ZGlraS50ZWNodG9uaXF1ZUBnbWFpbC5jb20iLCJleHAiOjE3NDg0NTkwNzh9.xnYgi-WjPH5yS8e6iM-xdQL9mbjEsXRVyUp4ovGJsOw" \
-F "file=@boston_dataset2.csv;type=text/csv" \
"https://www.techtonique.net/gbdtregression?model_type=xgboost&return_pi=True"
{"y_true":[24.0,34.70000076293945,18.899999618530273,18.899999618530273,19.899999618530273,17.5,20.200000762939453,18.200000762939453,15.199999809265137,14.5,15.600000381469727,13.899999618530273,12.699999809265137,14.5,13.100000381469727,30.799999237060547,25.299999237060547,20.0,35.400001525878906,24.700000762939453,31.600000381469727,25.0,19.399999618530273,17.399999618530273,20.899999618530273,24.200000762939453,22.799999237060547,23.399999618530273,21.399999618530273,20.0,20.799999237060547,21.200000762939453,20.299999237060547,24.799999237060547,23.899999618530273,22.5,22.600000381469727,25.0,20.600000381469727,26.5,20.100000381469727,18.700000762939453,19.200000762939453,18.799999237060547,15.699999809265137,19.600000381469727,23.0,17.100000381469727,14.0,17.799999237060547,19.399999618530273,17.0,15.600000381469727,23.100000381469727,23.600000381469727,23.200000762939453,39.79999923706055,36.20000076293945,37.900001525878906,29.100000381469727,50.0,48.5,50.0,24.399999618530273,20.0,21.700000762939453,19.299999237060547,21.5,50.0,31.600000381469727,31.5,29.0,23.700000762939453,17.600000381469727,18.5,24.399999618530273,20.899999618530273,43.5,25.200000762939453,32.400001525878906,29.100000381469727,45.400001525878906,35.400001525878906,28.5,22.5,28.200000762939453,19.399999618530273,17.799999237060547,23.799999237060547,20.399999618530273,18.5,25.0,24.600000381469727,22.600000381469727,19.399999618530273,20.700000762939453,21.100000381469727,19.5,20.600000381469727,17.200000762939453,23.100000381469727,24.100000381469727,20.600000381469727,20.799999237060547,27.5,50.0,15.0,10.899999618530273,10.199999809265137,15.100000381469727,9.699999809265137,13.100000381469727,5.0,8.5,17.200000762939453,27.5,17.200000762939453,17.899999618530273,7.0,10.399999618530273,8.800000190734863,14.199999809265137,13.399999618530273,16.100000381469727,14.300000190734863,11.699999809265137,9.600000381469727,8.699999809265137,17.100000381469727,18.399999618530273,10.800000190734863,12.600000381469727,14.100000381469727,16.100000381469727,14.899999618530273,12.699999809265137,16.399999618530273,19.100000381469727,19.899999618530273,19.600000381469727,29.799999237060547,13.800000190734863,12.0,23.700000762939453,21.200000762939453,7.0,13.600000381469727,21.799999237060547,19.700000762939453,18.299999237060547,16.799999237060547,22.399999618530273],"y_pred":[26.442415237426758,35.23131561279297,19.804611206054688,21.386371612548828,19.960773468017578,18.005353927612305,18.744047164916992,19.975252151489258,18.39358139038086,16.6386661529541,17.89883041381836,17.22089385986328,16.440576553344727,19.951683044433594,18.086790084838867,28.98358917236328,27.20343780517578,21.869483947753906,33.83155059814453,27.732852935791016,31.86326026916504,23.617542266845703,19.261390686035156,20.24803924560547,21.420976638793945,24.972461700439453,24.796932220458984,22.9288330078125,23.02020835876465,22.803789138793945,22.83431053161621,22.76777458190918,21.554052352905273,24.29648208618164,23.513900756835938,22.151222229003906,24.381080627441406,26.851207733154297,23.721538543701172,23.73475456237793,20.769712448120117,19.475141525268555,21.69524383544922,20.295021057128906,17.146940231323242,20.344783782958984,20.66793441772461,17.302152633666992,14.15251636505127,13.535025596618652,16.79205322265625,17.635236740112305,17.039411544799805,19.501510620117188,23.545635223388672,22.409381866455078,38.170379638671875,25.737802505493164,39.042659759521484,29.805307388305664,41.013797760009766,41.433834075927734,40.85997772216797,19.706069946289062,17.500335693359375,18.770259857177734,17.37241554260254,19.338523864746094,38.918373107910156,34.420570373535156,34.405025482177734,26.628271102905273,26.19058609008789,19.654024124145508,17.766435623168945,28.293018341064453,16.90666961669922,39.26776885986328,25.96318244934082,30.28142738342285,26.571407318115234,43.86202621459961,34.41077423095703,31.38194465637207,26.89581871032715,29.635351181030273,20.954465866088867,18.00459098815918,23.82869529724121,21.42978286743164,21.060474395751953,23.82869529724121,25.67188262939453,26.130399703979492,17.669322967529297,23.83681297302246,19.966480255126953,20.820711135864258,20.409786224365234,19.482126235961914,23.753368377685547,27.81395721435547,25.966333389282227,21.119266510009766,25.55506134033203,27.126747131347656,24.390960693359375,10.30008316040039,10.406465530395508,14.826869010925293,11.080742835998535,14.383598327636719,8.207436561584473,7.805464744567871,12.534814834594727,16.59286880493164,12.648271560668945,12.786554336547852,10.0542573928833,7.759208679199219,8.7243070602417,15.899303436279297,14.302044868469238,20.302051544189453,14.961060523986816,14.528231620788574,11.45074462890625,8.110982894897461,14.595978736877441,16.386404037475586,10.832986831665039,14.647615432739258,15.321465492248535,16.445466995239258,13.637338638305664,14.323694229125977,15.538948059082031,15.411056518554688,17.64772605895996,20.763376235961914,30.36408233642578,16.07801628112793,12.214949607849121,24.393232345581055,21.648456573486328,12.257180213928223,14.621627807617188,21.481687545776367,18.393739700317383,21.256786346435547,20.91344451904297,16.739273071289062],"pi_lower":[17.582509994506836,26.371410369873047,10.944705963134766,12.526466369628906,11.100868225097656,9.145448684692383,9.88414192199707,11.115346908569336,9.533676147460938,7.77876091003418,9.038925170898438,8.36098861694336,7.580671310424805,11.091777801513672,9.226884841918945,20.12368392944336,18.34353256225586,13.009578704833984,24.97164535522461,18.872947692871094,23.003355026245117,14.757637023925781,10.401485443115234,11.388134002685547,12.561071395874023,16.11255645751953,15.937026977539062,14.068927764892578,14.160303115844727,13.943883895874023,13.974405288696289,13.907869338989258,12.694147109985352,15.436576843261719,14.653995513916016,13.291316986083984,15.521175384521484,17.991302490234375,14.86163330078125,14.874849319458008,11.909807205200195,10.615236282348633,12.835338592529297,11.435115814208984,8.28703498840332,11.484878540039062,11.808029174804688,8.44224739074707,5.292611122131348,4.6751203536987305,7.932147979736328,8.775331497192383,8.179506301879883,10.641605377197266,14.68572998046875,13.549476623535156,29.310474395751953,16.877897262573242,30.182754516601562,20.945402145385742,32.153892517089844,32.57392883300781,32.00007247924805,10.84616470336914,8.640430450439453,9.910354614257812,8.512510299682617,10.478618621826172,30.058467864990234,25.560665130615234,25.545120239257812,17.76836585998535,17.33068084716797,10.794118881225586,8.906530380249023,19.43311309814453,8.046764373779297,30.40786361694336,17.1032772064209,21.42152214050293,17.711502075195312,35.00212097167969,25.55086898803711,22.52203941345215,18.035913467407227,20.77544593811035,12.094560623168945,9.144685745239258,14.968790054321289,12.569877624511719,12.200569152832031,14.968790054321289,16.81197738647461,17.27049446105957,8.809417724609375,14.976907730102539,11.106575012207031,11.960805892944336,11.549880981445312,10.622220993041992,14.893463134765625,18.954051971435547,17.106428146362305,12.259361267089844,16.69515609741211,18.266841888427734,15.531055450439453,1.4401779174804688,1.546560287475586,5.966963768005371,2.2208375930786133,5.523693084716797,-0.6524686813354492,-1.0544404983520508,3.6749095916748047,7.732963562011719,3.7883663177490234,3.9266490936279297,1.194352149963379,-1.1006965637207031,-0.13559818267822266,7.039398193359375,5.442139625549316,11.442146301269531,6.1011552810668945,5.668326377868652,2.590839385986328,-0.7489223480224609,5.7360734939575195,7.526498794555664,1.9730815887451172,5.787710189819336,6.461560249328613,7.585561752319336,4.777433395385742,5.463788986206055,6.679042816162109,6.551151275634766,8.787820816040039,11.903470993041992,21.50417709350586,7.218111038208008,3.355044364929199,15.533327102661133,12.788551330566406,3.397274971008301,5.761722564697266,12.621782302856445,9.533834457397461,12.396881103515625,12.053539276123047,7.879367828369141],"pi_upper":[35.30232238769531,44.09122085571289,28.66451644897461,30.24627685546875,28.8206787109375,26.865259170532227,27.603952407836914,28.83515739440918,27.25348663330078,25.498571395874023,26.75873565673828,26.080799102783203,25.30048179626465,28.811588287353516,26.94669532775879,37.8434944152832,36.0633430480957,30.729389190673828,42.69145584106445,36.59275817871094,40.723167419433594,32.477447509765625,28.121295928955078,29.10794448852539,30.280881881713867,33.832366943359375,33.656837463378906,31.788738250732422,31.88011360168457,31.663694381713867,31.694215774536133,31.6276798248291,30.413957595825195,33.15638732910156,32.37380599975586,31.011127471923828,33.24098587036133,35.71111297607422,32.581443786621094,32.59465789794922,29.62961769104004,28.335046768188477,30.55514907836914,29.154926300048828,26.006845474243164,29.204689025878906,29.52783966064453,26.162057876586914,23.012420654296875,22.39493179321289,25.651958465576172,26.495141983032227,25.899316787719727,28.36141586303711,32.405540466308594,31.269287109375,47.0302848815918,34.59770965576172,47.902565002441406,38.66521453857422,49.87370300292969,50.293739318847656,49.71988296508789,28.565975189208984,26.360240936279297,27.630165100097656,26.23232078552246,28.198429107666016,47.77827835083008,43.28047561645508,43.264930725097656,35.48817443847656,35.05049133300781,28.51392936706543,26.626340866088867,37.152923583984375,25.76657485961914,48.1276741027832,34.823089599609375,39.141334533691406,35.431312561035156,52.72193145751953,43.27067947387695,40.241851806640625,35.75572204589844,38.49525451660156,29.81437110900879,26.8644962310791,32.6885986328125,30.289688110351562,29.920379638671875,32.6885986328125,34.53178787231445,34.99030303955078,26.52922821044922,32.69671630859375,28.826385498046875,29.68061637878418,29.269691467285156,28.342031478881836,32.61327362060547,36.67386245727539,34.82624053955078,29.979171752929688,34.41496658325195,35.98665237426758,33.2508659362793,19.159988403320312,19.26637077331543,23.68677520751953,19.94064712524414,23.24350357055664,17.067340850830078,16.66537094116211,21.39472007751465,25.452774047851562,21.508176803588867,21.646459579467773,18.914161682128906,16.61911392211914,17.584213256835938,24.75920867919922,23.161949157714844,29.161956787109375,23.820964813232422,23.388137817382812,20.310649871826172,16.970888137817383,23.455883026123047,25.246309280395508,19.69289207458496,23.50752067565918,24.18136978149414,25.30537223815918,22.497243881225586,23.1835994720459,24.398853302001953,24.27096176147461,26.507631301879883,29.623281478881836,39.2239875793457,24.93792152404785,21.07485580444336,33.253135681152344,30.50836181640625,21.117084503173828,23.48153305053711,30.34159278869629,27.253644943237305,30.11669158935547,29.77334976196289,25.599178314208984],"pi_coverage":95.39473684210526,"Score":{"R² Score":0.8258381485939026,"MAE (Mean Absolute Error)":2.398916006088257,"MSE (Mean Squared Error)":12.977339744567871,"RMSE (Root Mean Squared Error)":3.6024074928536156,"MAPE (Mean Absolute Percentage Error)":11.945282936096191,"Max Error":22.873252868652344,"support":152.0}}
2 - Using Python
import requests
import json
import matplotlib.pyplot as plt
import pandas as pd
# Install necessary libraries if not already installed
try:
import requests
import pandas as pd
import matplotlib.pyplot as plt
except ImportError:
!pip install requests pandas matplotlib
import requests
import pandas as pd
import matplotlib.pyplot as plt
# Replace with your actual bearer token
bearer_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NGY3ZDE3Ny05OWQ0LTQzNDktOTc1OC0zZTBkOGVkYWZkYWUiLCJlbWFpbCI6InRoaWVycnkubW91ZGlraS50ZWNodG9uaXF1ZUBnbWFpbC5jb20iLCJleHAiOjE3NDg0NTkwNzh9.xnYgi-WjPH5yS8e6iM-xdQL9mbjEsXRVyUp4ovGJsOw"
headers = {
"Authorization": f"Bearer {bearer_token}"
}
file_path = 'boston_dataset2.csv'
# Make the request to the xgboost endpoint with return_pi=True
url = "https://www.techtonique.net/gbdtregression?model_type=xgboost&return_pi=True"
try:
with open(file_path, 'rb') as f:
files = {'file': (file_path, f, 'text/csv')}
response = requests.post(url, headers=headers, files=files)
response.raise_for_status() # Raise an exception for bad status codes
data = response.json()
print(data)
# Extract true values, predictions, and prediction intervals
true_values = data['y_true']
predictions = data['y_pred']
lower_bound = data['pi_lower']
upper_bound = data['pi_upper']
# Create a DataFrame for easier plotting
df = pd.DataFrame({
'true_values': true_values,
'predictions': predictions,
'lower_bound': lower_bound,
'upper_bound': upper_bound
})
# Sort by true values for a better plot
df = df.sort_values(by='true_values').reset_index(drop=True)
# Plot the results
plt.figure(figsize=(10, 6))
plt.scatter(df.index, df['true_values'], label='True Values', s=10)
plt.plot(df.index, df['predictions'], label='Predictions', color='red')
plt.fill_between(df.index, df['lower_bound'], df['upper_bound'], color='orange', alpha=0.3, label='Prediction Interval (95%)')
plt.xlabel('Sample Index (Sorted by True Values)')
plt.ylabel('Target Value')
plt.title('XGBoost Regression with Prediction Intervals, coverage in %:' + str(data['pi_coverage']))
plt.legend()
plt.grid(True)
plt.show()
except requests.exceptions.RequestException as e:
print(f"Error during request: {e}")
except KeyError as e:
print(f"Error: Missing key in response data: {e}. Response data: {data}")
except FileNotFoundError:
print(f"Error: File not found at {file_path}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
{'y_true': [24.0, 34.70000076293945, 18.899999618530273, 18.899999618530273, 19.899999618530273, 17.5, 20.200000762939453, 18.200000762939453, 15.199999809265137, 14.5, 15.600000381469727, 13.899999618530273, 12.699999809265137, 14.5, 13.100000381469727, 30.799999237060547, 25.299999237060547, 20.0, 35.400001525878906, 24.700000762939453, 31.600000381469727, 25.0, 19.399999618530273, 17.399999618530273, 20.899999618530273, 24.200000762939453, 22.799999237060547, 23.399999618530273, 21.399999618530273, 20.0, 20.799999237060547, 21.200000762939453, 20.299999237060547, 24.799999237060547, 23.899999618530273, 22.5, 22.600000381469727, 25.0, 20.600000381469727, 26.5, 20.100000381469727, 18.700000762939453, 19.200000762939453, 18.799999237060547, 15.699999809265137, 19.600000381469727, 23.0, 17.100000381469727, 14.0, 17.799999237060547, 19.399999618530273, 17.0, 15.600000381469727, 23.100000381469727, 23.600000381469727, 23.200000762939453, 39.79999923706055, 36.20000076293945, 37.900001525878906, 29.100000381469727, 50.0, 48.5, 50.0, 24.399999618530273, 20.0, 21.700000762939453, 19.299999237060547, 21.5, 50.0, 31.600000381469727, 31.5, 29.0, 23.700000762939453, 17.600000381469727, 18.5, 24.399999618530273, 20.899999618530273, 43.5, 25.200000762939453, 32.400001525878906, 29.100000381469727, 45.400001525878906, 35.400001525878906, 28.5, 22.5, 28.200000762939453, 19.399999618530273, 17.799999237060547, 23.799999237060547, 20.399999618530273, 18.5, 25.0, 24.600000381469727, 22.600000381469727, 19.399999618530273, 20.700000762939453, 21.100000381469727, 19.5, 20.600000381469727, 17.200000762939453, 23.100000381469727, 24.100000381469727, 20.600000381469727, 20.799999237060547, 27.5, 50.0, 15.0, 10.899999618530273, 10.199999809265137, 15.100000381469727, 9.699999809265137, 13.100000381469727, 5.0, 8.5, 17.200000762939453, 27.5, 17.200000762939453, 17.899999618530273, 7.0, 10.399999618530273, 8.800000190734863, 14.199999809265137, 13.399999618530273, 16.100000381469727, 14.300000190734863, 11.699999809265137, 9.600000381469727, 8.699999809265137, 17.100000381469727, 18.399999618530273, 10.800000190734863, 12.600000381469727, 14.100000381469727, 16.100000381469727, 14.899999618530273, 12.699999809265137, 16.399999618530273, 19.100000381469727, 19.899999618530273, 19.600000381469727, 29.799999237060547, 13.800000190734863, 12.0, 23.700000762939453, 21.200000762939453, 7.0, 13.600000381469727, 21.799999237060547, 19.700000762939453, 18.299999237060547, 16.799999237060547, 22.399999618530273], 'y_pred': [26.442415237426758, 35.23131561279297, 19.804611206054688, 21.386371612548828, 19.960773468017578, 18.005353927612305, 18.744047164916992, 19.975252151489258, 18.39358139038086, 16.6386661529541, 17.89883041381836, 17.22089385986328, 16.440576553344727, 19.951683044433594, 18.086790084838867, 28.98358917236328, 27.20343780517578, 21.869483947753906, 33.83155059814453, 27.732852935791016, 31.86326026916504, 23.617542266845703, 19.261390686035156, 20.24803924560547, 21.420976638793945, 24.972461700439453, 24.796932220458984, 22.9288330078125, 23.02020835876465, 22.803789138793945, 22.83431053161621, 22.76777458190918, 21.554052352905273, 24.29648208618164, 23.513900756835938, 22.151222229003906, 24.381080627441406, 26.851207733154297, 23.721538543701172, 23.73475456237793, 20.769712448120117, 19.475141525268555, 21.69524383544922, 20.295021057128906, 17.146940231323242, 20.344783782958984, 20.66793441772461, 17.302152633666992, 14.15251636505127, 13.535025596618652, 16.79205322265625, 17.635236740112305, 17.039411544799805, 19.501510620117188, 23.545635223388672, 22.409381866455078, 38.170379638671875, 25.737802505493164, 39.042659759521484, 29.805307388305664, 41.013797760009766, 41.433834075927734, 40.85997772216797, 19.706069946289062, 17.500335693359375, 18.770259857177734, 17.37241554260254, 19.338523864746094, 38.918373107910156, 34.420570373535156, 34.405025482177734, 26.628271102905273, 26.19058609008789, 19.654024124145508, 17.766435623168945, 28.293018341064453, 16.90666961669922, 39.26776885986328, 25.96318244934082, 30.28142738342285, 26.571407318115234, 43.86202621459961, 34.41077423095703, 31.38194465637207, 26.89581871032715, 29.635351181030273, 20.954465866088867, 18.00459098815918, 23.82869529724121, 21.42978286743164, 21.060474395751953, 23.82869529724121, 25.67188262939453, 26.130399703979492, 17.669322967529297, 23.83681297302246, 19.966480255126953, 20.820711135864258, 20.409786224365234, 19.482126235961914, 23.753368377685547, 27.81395721435547, 25.966333389282227, 21.119266510009766, 25.55506134033203, 27.126747131347656, 24.390960693359375, 10.30008316040039, 10.406465530395508, 14.826869010925293, 11.080742835998535, 14.383598327636719, 8.207436561584473, 7.805464744567871, 12.534814834594727, 16.59286880493164, 12.648271560668945, 12.786554336547852, 10.0542573928833, 7.759208679199219, 8.7243070602417, 15.899303436279297, 14.302044868469238, 20.302051544189453, 14.961060523986816, 14.528231620788574, 11.45074462890625, 8.110982894897461, 14.595978736877441, 16.386404037475586, 10.832986831665039, 14.647615432739258, 15.321465492248535, 16.445466995239258, 13.637338638305664, 14.323694229125977, 15.538948059082031, 15.411056518554688, 17.64772605895996, 20.763376235961914, 30.36408233642578, 16.07801628112793, 12.214949607849121, 24.393232345581055, 21.648456573486328, 12.257180213928223, 14.621627807617188, 21.481687545776367, 18.393739700317383, 21.256786346435547, 20.91344451904297, 16.739273071289062], 'pi_lower': [17.582509994506836, 26.371410369873047, 10.944705963134766, 12.526466369628906, 11.100868225097656, 9.145448684692383, 9.88414192199707, 11.115346908569336, 9.533676147460938, 7.77876091003418, 9.038925170898438, 8.36098861694336, 7.580671310424805, 11.091777801513672, 9.226884841918945, 20.12368392944336, 18.34353256225586, 13.009578704833984, 24.97164535522461, 18.872947692871094, 23.003355026245117, 14.757637023925781, 10.401485443115234, 11.388134002685547, 12.561071395874023, 16.11255645751953, 15.937026977539062, 14.068927764892578, 14.160303115844727, 13.943883895874023, 13.974405288696289, 13.907869338989258, 12.694147109985352, 15.436576843261719, 14.653995513916016, 13.291316986083984, 15.521175384521484, 17.991302490234375, 14.86163330078125, 14.874849319458008, 11.909807205200195, 10.615236282348633, 12.835338592529297, 11.435115814208984, 8.28703498840332, 11.484878540039062, 11.808029174804688, 8.44224739074707, 5.292611122131348, 4.6751203536987305, 7.932147979736328, 8.775331497192383, 8.179506301879883, 10.641605377197266, 14.68572998046875, 13.549476623535156, 29.310474395751953, 16.877897262573242, 30.182754516601562, 20.945402145385742, 32.153892517089844, 32.57392883300781, 32.00007247924805, 10.84616470336914, 8.640430450439453, 9.910354614257812, 8.512510299682617, 10.478618621826172, 30.058467864990234, 25.560665130615234, 25.545120239257812, 17.76836585998535, 17.33068084716797, 10.794118881225586, 8.906530380249023, 19.43311309814453, 8.046764373779297, 30.40786361694336, 17.1032772064209, 21.42152214050293, 17.711502075195312, 35.00212097167969, 25.55086898803711, 22.52203941345215, 18.035913467407227, 20.77544593811035, 12.094560623168945, 9.144685745239258, 14.968790054321289, 12.569877624511719, 12.200569152832031, 14.968790054321289, 16.81197738647461, 17.27049446105957, 8.809417724609375, 14.976907730102539, 11.106575012207031, 11.960805892944336, 11.549880981445312, 10.622220993041992, 14.893463134765625, 18.954051971435547, 17.106428146362305, 12.259361267089844, 16.69515609741211, 18.266841888427734, 15.531055450439453, 1.4401779174804688, 1.546560287475586, 5.966963768005371, 2.2208375930786133, 5.523693084716797, -0.6524686813354492, -1.0544404983520508, 3.6749095916748047, 7.732963562011719, 3.7883663177490234, 3.9266490936279297, 1.194352149963379, -1.1006965637207031, -0.13559818267822266, 7.039398193359375, 5.442139625549316, 11.442146301269531, 6.1011552810668945, 5.668326377868652, 2.590839385986328, -0.7489223480224609, 5.7360734939575195, 7.526498794555664, 1.9730815887451172, 5.787710189819336, 6.461560249328613, 7.585561752319336, 4.777433395385742, 5.463788986206055, 6.679042816162109, 6.551151275634766, 8.787820816040039, 11.903470993041992, 21.50417709350586, 7.218111038208008, 3.355044364929199, 15.533327102661133, 12.788551330566406, 3.397274971008301, 5.761722564697266, 12.621782302856445, 9.533834457397461, 12.396881103515625, 12.053539276123047, 7.879367828369141], 'pi_upper': [35.30232238769531, 44.09122085571289, 28.66451644897461, 30.24627685546875, 28.8206787109375, 26.865259170532227, 27.603952407836914, 28.83515739440918, 27.25348663330078, 25.498571395874023, 26.75873565673828, 26.080799102783203, 25.30048179626465, 28.811588287353516, 26.94669532775879, 37.8434944152832, 36.0633430480957, 30.729389190673828, 42.69145584106445, 36.59275817871094, 40.723167419433594, 32.477447509765625, 28.121295928955078, 29.10794448852539, 30.280881881713867, 33.832366943359375, 33.656837463378906, 31.788738250732422, 31.88011360168457, 31.663694381713867, 31.694215774536133, 31.6276798248291, 30.413957595825195, 33.15638732910156, 32.37380599975586, 31.011127471923828, 33.24098587036133, 35.71111297607422, 32.581443786621094, 32.59465789794922, 29.62961769104004, 28.335046768188477, 30.55514907836914, 29.154926300048828, 26.006845474243164, 29.204689025878906, 29.52783966064453, 26.162057876586914, 23.012420654296875, 22.39493179321289, 25.651958465576172, 26.495141983032227, 25.899316787719727, 28.36141586303711, 32.405540466308594, 31.269287109375, 47.0302848815918, 34.59770965576172, 47.902565002441406, 38.66521453857422, 49.87370300292969, 50.293739318847656, 49.71988296508789, 28.565975189208984, 26.360240936279297, 27.630165100097656, 26.23232078552246, 28.198429107666016, 47.77827835083008, 43.28047561645508, 43.264930725097656, 35.48817443847656, 35.05049133300781, 28.51392936706543, 26.626340866088867, 37.152923583984375, 25.76657485961914, 48.1276741027832, 34.823089599609375, 39.141334533691406, 35.431312561035156, 52.72193145751953, 43.27067947387695, 40.241851806640625, 35.75572204589844, 38.49525451660156, 29.81437110900879, 26.8644962310791, 32.6885986328125, 30.289688110351562, 29.920379638671875, 32.6885986328125, 34.53178787231445, 34.99030303955078, 26.52922821044922, 32.69671630859375, 28.826385498046875, 29.68061637878418, 29.269691467285156, 28.342031478881836, 32.61327362060547, 36.67386245727539, 34.82624053955078, 29.979171752929688, 34.41496658325195, 35.98665237426758, 33.2508659362793, 19.159988403320312, 19.26637077331543, 23.68677520751953, 19.94064712524414, 23.24350357055664, 17.067340850830078, 16.66537094116211, 21.39472007751465, 25.452774047851562, 21.508176803588867, 21.646459579467773, 18.914161682128906, 16.61911392211914, 17.584213256835938, 24.75920867919922, 23.161949157714844, 29.161956787109375, 23.820964813232422, 23.388137817382812, 20.310649871826172, 16.970888137817383, 23.455883026123047, 25.246309280395508, 19.69289207458496, 23.50752067565918, 24.18136978149414, 25.30537223815918, 22.497243881225586, 23.1835994720459, 24.398853302001953, 24.27096176147461, 26.507631301879883, 29.623281478881836, 39.2239875793457, 24.93792152404785, 21.07485580444336, 33.253135681152344, 30.50836181640625, 21.117084503173828, 23.48153305053711, 30.34159278869629, 27.253644943237305, 30.11669158935547, 29.77334976196289, 25.599178314208984], 'pi_coverage': 95.39473684210526, 'Score': {'R² Score': 0.8258381485939026, 'MAE (Mean Absolute Error)': 2.398916006088257, 'MSE (Mean Squared Error)': 12.977339744567871, 'RMSE (Root Mean Squared Error)': 3.6024074928536156, 'MAPE (Mean Absolute Percentage Error)': 11.945282936096191, 'Max Error': 22.873252868652344, 'support': 152.0}}
Comments powered by Talkyard.