Simulate data from the Friedman 1 benchmark problem. These data were originally described in Friedman (1991) and Breiman (1996). For details, see sklearn.datasets.make_friedman1.
Arguments
- n_samples
Integer specifying the number of samples (i.e., rows) to generate. Default is 100.
- n_features
Integer specifying the number of features to generate. Default is 10.
- n_bins
Integer specifying the number of (roughly) equal sized bins to split the response into. Default is
NULL
for no binning. Setting to a positive integer > 1 effectively turns this into a classification problem wheren_bins
gives the number of classes.- sigma
Numeric specifying the standard deviation of the noise.
- seed
Integer specifying the random seed. If
NULL
(the default) the results will be different each time the function is run.
References
Breiman, Leo (1996) Bagging predictors. Machine Learning 24, pages 123-140.
Friedman, Jerome H. (1991) Multivariate adaptive regression splines. The Annals of Statistics 19 (1), pages 1-67.
Examples
gen_friedman()
#> y x1 x2 x3 x4 x5
#> 1 12.508680 0.858668992 0.559547173 0.44641937 0.114472353 0.26883421
#> 2 22.479448 0.365129990 0.977672412 0.31493669 0.919276896 0.72702007
#> 3 10.925940 0.103726123 0.524608764 0.85950756 0.193799939 0.94570438
#> 4 5.782480 0.085171812 0.468667488 0.43013119 0.196065944 0.49261993
#> 5 13.572376 0.331509704 0.187139478 0.04316896 0.503607209 0.47479839
#> 6 13.622897 0.404571955 0.567182346 0.37642299 0.496971598 0.34158931
#> 7 22.652722 0.755830705 0.397415219 0.95996771 0.868919721 0.34366171
#> 8 11.823684 0.448214682 0.034019897 0.20195121 0.837611572 0.25373095
#> 9 12.364221 0.898853394 0.545338688 0.56594351 0.071882137 0.32792993
#> 10 18.509250 0.910393552 0.570173427 0.58114354 0.579575365 0.56101824
#> 11 19.581185 0.931327082 0.157349970 0.15233267 0.941101965 0.67870302
#> 12 20.996277 0.344829321 0.450736267 0.13165567 0.862870003 0.99259509
#> 13 7.010502 0.050779365 0.637689278 0.74416456 0.098535705 0.80865547
#> 14 13.928416 0.430085238 0.646409326 0.43200033 0.286782792 0.66004064
#> 15 12.078871 0.957321461 0.117038271 0.21170225 0.688989923 0.02158931
#> 16 14.022408 0.365097411 0.254932032 0.02619193 0.533626783 0.27863491
#> 17 12.768443 0.001666045 0.788766653 0.94987475 0.548818200 0.64188536
#> 18 9.704721 0.320671841 0.053895883 0.20696044 0.431188655 0.60441020
#> 19 18.051693 0.682753002 0.679645638 0.80375524 0.152114708 0.96365634
#> 20 15.039985 0.930875384 0.735856461 0.91716723 0.315546534 0.03721440
#> 21 20.523721 0.657430458 0.771374385 0.20824197 0.477443808 0.81775137
#> 22 7.176765 0.500102438 0.067876093 0.29412806 0.480594089 0.10963732
#> 23 6.456943 0.009032334 0.554375954 0.11393196 0.032965228 0.58478511
#> 24 10.791089 0.642982834 0.146903975 0.12090960 0.159241601 0.64205520
#> 25 22.449037 0.319247328 0.571024061 0.95704243 0.860235933 0.86186874
#> 26 14.180009 0.480398061 0.996407035 0.23076795 0.190828813 0.18418794
#> 27 14.555904 0.397417146 0.404322280 0.51928329 0.574724406 0.82476032
#> 28 22.320379 0.517558023 0.619875930 0.13135713 0.767586907 0.70577106
#> 29 16.150871 0.491005711 0.269674344 0.71591575 0.999464656 0.26963866
#> 30 19.595665 0.744847329 0.573693378 0.81967248 0.451328604 0.66334374
#> 31 15.499408 0.502751975 0.964870630 0.71062452 0.161639933 0.60051660
#> 32 13.217463 0.082020628 0.829110332 0.62156900 0.809243394 0.56232010
#> 33 10.977762 0.384788962 0.425176601 0.45384693 0.211751275 0.81148620
#> 34 12.995386 0.299486726 0.187966311 0.63738146 0.843769899 0.52058233
#> 35 20.545178 0.707541597 0.687992336 0.05860084 0.324966174 0.68195301
#> 36 18.388314 0.382288978 0.812758865 0.81914328 0.419223524 0.75348009
#> 37 22.440360 0.778512126 0.498806096 0.29352908 0.764182168 0.88751963
#> 38 7.794418 0.545759286 0.101318620 0.07878174 0.081933820 0.32056389
#> 39 21.978532 0.522748704 0.955017384 0.23655131 0.580539844 0.94629945
#> 40 7.873652 0.093352068 0.281990444 0.50936817 0.259618728 0.87237707
#> 41 16.759925 0.496863673 0.692443485 0.66762668 0.526440626 0.44234496
#> 42 15.847998 0.956699395 0.209484261 0.23376951 0.584071226 0.55777959
#> 43 12.026150 0.182177860 0.507534054 0.19657654 0.367237477 0.68927400
#> 44 15.129697 0.454814634 0.399530661 0.90207904 0.557116035 0.18349048
#> 45 5.372712 0.001679344 0.037090355 0.77952886 0.018385845 0.73252447
#> 46 9.076911 0.283297111 0.026584951 0.76425219 0.461246487 0.57020258
#> 47 21.484522 0.489691680 0.849759179 0.11541874 0.433595991 0.90693172
#> 48 11.312284 0.696521314 0.282902607 0.42882830 0.159674526 0.78049270
#> 49 17.273258 0.539397985 0.325768267 0.86478927 0.759668957 0.33276620
#> 50 13.027660 0.225982199 0.724213712 0.71015591 0.609967528 0.23674135
#> 51 11.351598 0.841800509 0.851606604 0.71209621 0.003243543 0.56744912
#> 52 9.174246 0.031045103 0.089644126 0.25331318 0.584412522 0.36480918
#> 53 16.887046 0.373930389 0.948610179 0.20503417 0.128293821 0.99499923
#> 54 9.857595 0.056807871 0.756669916 0.11691360 0.464448310 0.18755098
#> 55 15.448272 0.575660014 0.493528102 0.14991364 0.221891686 0.58988297
#> 56 15.547899 0.241541837 0.749761216 0.87254249 0.404951417 0.67663918
#> 57 18.201301 0.770400164 0.741892368 0.54591269 0.787077444 0.08854305
#> 58 9.955444 0.355248712 0.320497472 0.30846898 0.230879235 0.67643045
#> 59 14.923140 0.568178736 0.413964914 0.30057844 0.520828138 0.44168643
#> 60 10.828814 0.157875733 0.149543938 0.58239023 0.819659144 0.37673887
#> 61 19.229000 0.493801547 0.851782544 0.69674931 0.551280160 0.64222239
#> 62 12.626886 0.249440704 0.374908131 0.16730034 0.630344710 0.27382997
#> 63 6.413295 0.247185199 0.629831575 0.64994109 0.103227024 0.04987249
#> 64 13.269684 0.296022402 0.832694096 0.34762904 0.414592361 0.32098295
#> 65 15.817564 0.391862531 0.483622195 0.17233375 0.490723182 0.59577008
#> 66 14.653174 0.077176317 0.907962732 0.34487209 0.725947730 0.98023589
#> 67 12.982949 0.032286308 0.806289435 0.09093113 0.467668503 0.78371463
#> 68 15.019160 0.124697410 0.449162645 0.35590847 0.973223491 0.65047955
#> 69 15.743908 0.902870931 0.374740696 0.62736707 0.437304459 0.46466238
#> 70 23.624663 0.571252657 0.863349679 0.05723549 0.563774737 0.80691024
#> 71 19.782515 0.679020305 0.555323428 0.81265638 0.719851143 0.26165719
#> 72 10.169155 0.284378762 0.430759853 0.45372034 0.399309313 0.45706399
#> 73 21.417601 0.212584526 0.592008602 0.97325969 0.909621902 0.82811839
#> 74 10.571819 0.192024343 0.729179574 0.54533896 0.353317087 0.53638365
#> 75 22.526564 0.861673013 0.696993835 0.53080424 0.832413354 0.92924008
#> 76 2.465921 0.175815796 0.275465441 0.43311288 0.011521178 0.15389867
#> 77 14.327491 0.229394846 0.853227049 0.63783762 0.781052889 0.05476633
#> 78 10.136255 0.012182954 0.812571332 0.63352460 0.479548279 0.90632909
#> 79 9.949873 0.712006683 0.006141337 0.27782663 0.576211812 0.62040683
#> 80 16.461274 0.158334760 0.079724933 0.91076996 0.811576466 0.88508876
#> 81 9.717952 0.798977884 0.213373322 0.31338754 0.373981104 0.07923746
#> 82 11.468756 0.038454709 0.709827786 0.39716112 0.652164470 0.75734289
#> 83 15.646886 0.941182600 0.299699161 0.05470572 0.259163060 0.28550083
#> 84 21.449431 0.930206709 0.451143171 0.34604120 0.948179735 0.37879719
#> 85 14.446843 0.297610674 0.238596041 0.58709939 0.981950989 0.46466859
#> 86 12.606177 0.405535535 0.153773182 0.98421118 0.179118798 0.81590255
#> 87 6.826026 0.449557665 0.116008421 0.16548664 0.092207920 0.41431371
#> 88 8.508168 0.064139278 0.391936723 0.65188096 0.645617366 0.16729453
#> 89 16.410573 0.705599427 0.866964339 0.38207451 0.208205299 0.90355840
#> 90 9.299456 0.339410211 0.993090863 0.53831244 0.037761439 0.03827034
#> 91 19.538828 0.395263129 0.551627719 0.13800700 0.874792115 0.37004399
#> 92 13.922263 0.802358415 0.533529358 0.24660275 0.230674258 0.11654341
#> 93 23.741087 0.376943605 0.698485296 0.84286106 0.946045800 0.95764046
#> 94 18.145098 0.915326283 0.299003245 0.39455179 0.743961505 0.57569809
#> 95 4.309378 0.076202628 0.350360219 0.41606671 0.308272643 0.02480323
#> 96 14.798185 0.634925068 0.392326640 0.46337813 0.475403720 0.57806394
#> 97 14.316231 0.396530972 0.911453800 0.47688166 0.457358819 0.12437911
#> 98 25.771467 0.998634673 0.252213487 0.03661304 0.987825487 0.86902576
#> 99 23.826581 0.761909639 0.688889077 0.08890256 0.716177621 0.63659226
#> 100 17.268911 0.630840339 0.938761205 0.30205448 0.372012045 0.68325526
#> x6 x7 x8 x9 x10
#> 1 0.07165747 0.39551818 0.95975666 0.25663405 0.24485833
#> 2 0.00506768 0.98025986 0.38012006 0.81135264 0.60811992
#> 3 0.73313299 0.98556535 0.29921583 0.43748583 0.96198649
#> 4 0.22492684 0.82539051 0.25514989 0.37421362 0.25738971
#> 5 0.18960039 0.68630278 0.65532167 0.16382068 0.50554709
#> 6 0.40606224 0.44025807 0.42315458 0.01120894 0.04240819
#> 7 0.78580072 0.29486931 0.79519206 0.54319015 0.49264079
#> 8 0.34755368 0.80917519 0.05257739 0.92182283 0.81824702
#> 9 0.31815393 0.57611395 0.97066507 0.66791307 0.45828255
#> 10 0.57476823 0.66977827 0.88047194 0.90211481 0.35325858
#> 11 0.30807186 0.38874647 0.18924702 0.98041681 0.23652354
#> 12 0.77976778 0.69652217 0.30929188 0.13530614 0.66959548
#> 13 0.28295991 0.83467609 0.18744677 0.37985216 0.83954121
#> 14 0.28858567 0.18059869 0.95820326 0.30903893 0.13615496
#> 15 0.40712082 0.18472799 0.35230657 0.10692049 0.90858457
#> 16 0.79316410 0.32213954 0.43409567 0.24259980 0.89235823
#> 17 0.41750890 0.13291428 0.99649488 0.32603652 0.68136199
#> 18 0.84669258 0.67660278 0.19518177 0.27183690 0.73360897
#> 19 0.47378925 0.43753377 0.66973329 0.66194722 0.25521597
#> 20 0.94889092 0.92196911 0.07530727 0.24643390 0.07813625
#> 21 0.66919885 0.37611235 0.81548251 0.21385616 0.59287512
#> 22 0.84765306 0.79002407 0.61909664 0.68289349 0.24328921
#> 23 0.09697748 0.36047047 0.91921143 0.98937228 0.41543900
#> 24 0.60490684 0.78595350 0.79985754 0.36894349 0.47838790
#> 25 0.87615991 0.54277126 0.23636800 0.32375046 0.91971897
#> 26 0.90773901 0.44800020 0.21575081 0.46000705 0.71999931
#> 27 0.83663322 0.76108976 0.80057669 0.43853908 0.97012592
#> 28 0.15971878 0.78220086 0.66522152 0.10288856 0.08664368
#> 29 0.85286586 0.40875337 0.19086674 0.53272029 0.63726236
#> 30 0.46549883 0.86738173 0.23058056 0.14976423 0.54332376
#> 31 0.54343594 0.69176764 0.89991088 0.43913373 0.98715108
#> 32 0.63039015 0.15828128 0.58239408 0.88878360 0.72324079
#> 33 0.73280523 0.45646685 0.19728039 0.01408781 0.72263306
#> 34 0.73458861 0.36662890 0.76954915 0.82604523 0.28638125
#> 35 0.84726952 0.96279897 0.72394400 0.91646300 0.82434517
#> 36 0.73189228 0.20754493 0.19744470 0.49806293 0.18227235
#> 37 0.44682491 0.07538959 0.92760940 0.28126380 0.77857724
#> 38 0.79942195 0.81743462 0.52397709 0.25875392 0.61138061
#> 39 0.42703535 0.68146272 0.21239877 0.30456213 0.66772947
#> 40 0.14469106 0.85887412 0.93555341 0.85352276 0.33530881
#> 41 0.36429581 0.77352280 0.82291152 0.18313840 0.12500351
#> 42 0.10655865 0.19764348 0.66773231 0.21786342 0.84487347
#> 43 0.10769924 0.38756346 0.93887399 0.32069146 0.33839679
#> 44 0.69793217 0.88319434 0.53045958 0.60608329 0.73493665
#> 45 0.67109315 0.95695499 0.13813218 0.13577084 0.98406365
#> 46 0.25479387 0.02857349 0.15740556 0.21957998 0.70400391
#> 47 0.32965172 0.69772892 0.61373539 0.43857195 0.72588599
#> 48 0.33571618 0.33698020 0.95530372 0.26382044 0.54524503
#> 49 0.45082380 0.71694316 0.67082462 0.27960620 0.11634905
#> 50 0.33950042 0.67664724 0.86754180 0.42280470 0.45810613
#> 51 0.55862081 0.46947430 0.06800344 0.44297234 0.43319813
#> 52 0.48893637 0.58574610 0.34843799 0.23591573 0.94301806
#> 53 0.27313027 0.54180234 0.11520502 0.76790000 0.58923175
#> 54 0.89396925 0.99099038 0.16132747 0.43032146 0.94466836
#> 55 0.75300594 0.85417555 0.37684322 0.32466043 0.36858399
#> 56 0.35496567 0.42082709 0.48872788 0.39758757 0.65726675
#> 57 0.32279429 0.53250537 0.76083148 0.71067803 0.55429472
#> 58 0.99667268 0.51529433 0.04403185 0.30772233 0.76978260
#> 59 0.86889496 0.54629661 0.23559907 0.62182639 0.83372063
#> 60 0.34983144 0.94049579 0.60705215 0.31833481 0.54649001
#> 61 0.65027636 0.62416372 0.61485522 0.50731407 0.56768617
#> 62 0.77134985 0.55635054 0.47047771 0.04501199 0.74624627
#> 63 0.31504905 0.02895887 0.29017977 0.62187347 0.16131237
#> 64 0.85960622 0.35654250 0.59887128 0.09110199 0.92422739
#> 65 0.87483393 0.18930051 0.77635277 0.64430303 0.52655862
#> 66 0.29707242 0.45189174 0.65548439 0.97762440 0.53292717
#> 67 0.37242949 0.29719023 0.49479629 0.90938963 0.61519795
#> 68 0.50678112 0.93996683 0.44431773 0.37913860 0.77580450
#> 69 0.95742220 0.46972229 0.27944051 0.01553222 0.07706682
#> 70 0.84861959 0.45748225 0.20668650 0.86026934 0.48846376
#> 71 0.39614118 0.64567136 0.41121381 0.52480811 0.39158442
#> 72 0.25367087 0.15977975 0.11358950 0.29841301 0.99482200
#> 73 0.56057679 0.19041209 0.44689108 0.63792671 0.48162075
#> 74 0.53585050 0.62202679 0.22300473 0.85884735 0.48588316
#> 75 0.44178868 0.39310232 0.97342649 0.34107576 0.27968173
#> 76 0.19706366 0.02584121 0.51903712 0.46497696 0.61811320
#> 77 0.46223204 0.41564055 0.13673048 0.47923708 0.04855309
#> 78 0.23599433 0.80101465 0.30976491 0.56934895 0.58626519
#> 79 0.70572187 0.74256944 0.31762786 0.27915926 0.34722234
#> 80 0.69161426 0.85717971 0.94143387 0.44141478 0.99901984
#> 81 0.74722217 0.17841130 0.69882645 0.47337626 0.93131478
#> 82 0.15013919 0.68249250 0.78471219 0.33156671 0.55427198
#> 83 0.97291946 0.76831187 0.28953431 0.59260418 0.14586199
#> 84 0.72325986 0.49824897 0.44012611 0.61771962 0.62978833
#> 85 0.17051974 0.84494426 0.78194708 0.85940546 0.30844450
#> 86 0.92658357 0.41191996 0.45711269 0.05744917 0.56177192
#> 87 0.59394242 0.71329566 0.86301159 0.28823774 0.51896421
#> 88 0.35856969 0.41445042 0.86820954 0.23218449 0.08037205
#> 89 0.39301791 0.11852654 0.22361964 0.26285183 0.52075961
#> 90 0.94613848 0.21326341 0.01485025 0.17452605 0.12289985
#> 91 0.21406932 0.68158200 0.11298782 0.33435814 0.25181524
#> 92 0.94343302 0.68937101 0.58247811 0.50110813 0.77907235
#> 93 0.96743037 0.81129464 0.85762794 0.86502249 0.14616594
#> 94 0.90698271 0.20449472 0.95157956 0.17254832 0.79418969
#> 95 0.19260592 0.92891082 0.12066013 0.56511970 0.82597229
#> 96 0.10226850 0.24194720 0.42585720 0.02449699 0.58804851
#> 97 0.89951044 0.59705196 0.97261963 0.89811145 0.87325399
#> 98 0.65789404 0.54022088 0.52420427 0.26925744 0.70684232
#> 99 0.97300168 0.67646808 0.68224856 0.08773706 0.54304839
#> 100 0.78656857 0.52933295 0.51728385 0.75885089 0.81413188