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 14.322286 0.709550018 0.92053284 0.808273319 0.280996723 0.145520131
#> 2 6.647938 0.167222360 0.34630357 0.681456939 0.093635883 0.669465744
#> 3 15.136086 0.402050663 0.57776857 0.360349244 0.752478214 0.095799302
#> 4 18.392303 0.214850500 0.45248935 0.891727997 0.895198460 0.633014216
#> 5 14.111069 0.006581149 0.40887523 0.470829079 0.972551142 0.863275858
#> 6 12.984450 0.778076902 0.53639522 0.424892367 0.148269611 0.322017639
#> 7 14.717051 0.389818714 0.81197881 0.254769232 0.357111299 0.329988069
#> 8 7.321098 0.235966779 0.62785634 0.652501051 0.033039734 0.424122352
#> 9 15.557723 0.529323117 0.42428441 0.500569301 0.493775769 0.837959650
#> 10 24.778621 0.839875563 0.41700949 0.071116831 0.772252189 0.912703764
#> 11 11.136542 0.391292722 0.27126556 0.348034609 0.438719198 0.611146524
#> 12 18.638684 0.378654235 0.71750171 0.701992311 0.721468958 0.593117202
#> 13 12.816329 0.375125494 0.46112214 0.638863831 0.726859680 0.005820304
#> 14 6.559596 0.324040594 0.32219936 0.175795210 0.063760074 0.125718636
#> 15 18.988415 0.652288545 0.90876756 0.569754115 0.451764853 0.909726465
#> 16 15.473359 0.947493204 0.74869911 0.926004101 0.138422389 0.516776758
#> 17 10.923314 0.933270667 0.94146279 0.586944471 0.272009256 0.860142202
#> 18 16.488478 0.772523671 0.11350027 0.014302280 0.639166902 0.521876858
#> 19 21.100320 0.747421634 0.51878647 0.842535859 0.905202658 0.082621508
#> 20 8.323588 0.272640726 0.28273343 0.780231654 0.310283510 0.282267304
#> 21 4.947835 0.059095853 0.06750307 0.676714366 0.264834913 0.289295947
#> 22 19.720214 0.723394913 0.50719624 0.626614844 0.998900956 0.018055252
#> 23 8.564684 0.418724455 0.01061187 0.282838064 0.300754632 0.908254162
#> 24 21.159682 0.773164152 0.98742917 0.543723427 0.936827125 0.990222176
#> 25 10.575059 0.278985259 0.21836158 0.923028857 0.195075814 0.638290274
#> 26 17.759393 0.617247312 0.55347611 0.338462576 0.830643220 0.079389208
#> 27 13.061903 0.996399089 0.36644144 0.521853017 0.043737628 0.719305639
#> 28 24.132830 0.780433619 0.89509103 0.116065342 0.875225798 0.891219785
#> 29 19.367219 0.313206737 0.82467915 0.167863107 0.503215537 0.947091030
#> 30 14.375478 0.046164788 0.74467357 0.404367259 0.827667983 0.949044566
#> 31 5.787966 0.259657566 0.29070906 0.445988121 0.005447247 0.671856560
#> 32 12.415797 0.757655540 0.20340815 0.818647352 0.332574713 0.485953012
#> 33 14.211088 0.828985988 0.04825360 0.998599380 0.488784749 0.607603529
#> 34 23.850280 0.677365336 0.55017747 0.006496106 0.893703492 0.161951110
#> 35 13.548159 0.533103568 0.43119161 0.372679001 0.499085168 0.347618752
#> 36 16.064261 0.715737734 0.14693484 0.231971042 0.828493125 0.613362536
#> 37 14.525841 0.812242311 0.62578979 0.827412164 0.198217713 0.095030673
#> 38 16.241838 0.386039089 0.85814906 0.456625558 0.606946493 0.305514888
#> 39 9.185014 0.608656858 0.11607179 0.636306778 0.617502012 0.112426598
#> 40 21.710132 0.861906315 0.51506531 0.580126241 0.690243989 0.930089671
#> 41 19.622887 0.247913085 0.90356739 0.268632193 0.945709018 0.538457277
#> 42 13.219297 0.454553073 0.27424049 0.700779450 0.454146986 0.852281173
#> 43 14.234392 0.843057652 0.10454405 0.965904551 0.705867330 0.042341935
#> 44 13.307297 0.192995519 0.64812736 0.015989834 0.416473269 0.134341900
#> 45 18.647484 0.816717202 0.84249709 0.719107884 0.649532374 0.588715406
#> 46 8.542659 0.912099798 0.98739787 0.570765413 0.178090174 0.724162902
#> 47 15.126288 0.118067756 0.09000935 0.037696888 0.753594742 0.607293839
#> 48 11.741391 0.916303606 0.31744256 0.489974377 0.250849325 0.285546794
#> 49 11.171713 0.753653461 0.09007050 0.794812656 0.284693584 0.878733248
#> 50 9.346738 0.843370387 0.04858851 0.560726533 0.658145222 0.241840580
#> 51 12.821650 0.302271924 0.63708172 0.637756359 0.402365164 0.540093415
#> 52 20.741479 0.404090346 0.56796038 0.771076529 0.841813137 0.852957095
#> 53 10.002400 0.007272989 0.31983153 0.966321530 0.497030391 0.084198003
#> 54 14.775293 0.902794651 0.64916496 0.732322373 0.030945887 0.735409023
#> 55 19.482487 0.572698182 0.55757933 0.530213956 0.899247067 0.437211688
#> 56 8.752302 0.550423775 0.23597105 0.405922972 0.029030432 0.868871097
#> 57 16.299224 0.147619333 0.82187251 0.813217099 0.761428390 0.579595784
#> 58 17.632456 0.250859858 0.57442692 0.109390186 0.564668731 0.876166561
#> 59 17.246829 0.146285730 0.54627318 0.799988585 0.869108316 0.846785915
#> 60 8.623893 0.651462127 0.01291989 0.354464890 0.563181650 0.489801612
#> 61 8.858560 0.156756841 0.54922308 0.551524954 0.207487894 0.804804148
#> 62 14.555959 0.898701257 0.85285516 0.256398843 0.562441069 0.197441097
#> 63 9.392716 0.110889939 0.34300391 0.617411787 0.520408381 0.553364698
#> 64 11.961888 0.161802326 0.84017419 0.936758947 0.122851405 0.542296371
#> 65 12.167353 0.189157703 0.55304070 0.690917216 0.365455261 0.875835738
#> 66 16.857394 0.767544881 0.38041304 0.503485390 0.758624237 0.248081441
#> 67 8.199994 0.895412234 0.13459536 0.253039944 0.002460030 0.672589950
#> 68 17.877739 0.686654990 0.40469080 0.946921874 0.189874353 0.835715991
#> 69 20.883609 0.487377827 0.50589827 0.920018985 0.952032994 0.137638118
#> 70 6.713320 0.096609993 0.69051719 0.393165327 0.305007589 0.256155907
#> 71 15.301370 0.050148380 0.28117226 0.983429892 0.595484403 0.850980569
#> 72 18.658295 0.852317930 0.93406590 0.050484302 0.810415651 0.120452016
#> 73 16.416354 0.880728715 0.21341431 0.082828070 0.670127201 0.107761633
#> 74 12.029978 0.595102248 0.35480332 0.773510746 0.192085025 0.522172586
#> 75 13.995934 0.682071190 0.28374506 0.662558638 0.673226304 0.220445569
#> 76 10.962728 0.765302889 0.98529816 0.425616808 0.289760412 0.178974014
#> 77 20.436624 0.976678672 0.80939393 0.806153856 0.815466868 0.865947972
#> 78 10.294570 0.283642630 0.48996329 0.211839552 0.156607873 0.560878852
#> 79 12.936352 0.155681090 0.29918174 0.255860376 0.750901246 0.526399791
#> 80 14.573988 0.845910324 0.29786569 0.438948194 0.398406375 0.667381763
#> 81 4.103397 0.510231060 0.06745135 0.573182038 0.264716158 0.094482590
#> 82 9.862333 0.325411739 0.12812526 0.832863445 0.361394178 0.543612911
#> 83 13.630453 0.259547271 0.73862614 0.634604492 0.475388818 0.580684567
#> 84 10.288684 0.090206055 0.80417970 0.723665096 0.539015773 0.341985950
#> 85 20.537754 0.993191049 0.24369272 0.013291366 0.627089569 0.546672167
#> 86 10.679789 0.202808891 0.18924563 0.139559822 0.423759654 0.578435601
#> 87 23.582227 0.233068248 0.83643180 0.007137964 0.816555317 0.967787132
#> 88 15.271147 0.706818763 0.17939641 0.829580076 0.611519435 0.618815018
#> 89 18.663597 0.844609432 0.17642765 0.189378791 0.862897126 0.735692609
#> 90 25.203834 0.941853279 0.45897717 0.304854743 0.992283171 0.960620929
#> 91 23.731179 0.716493150 0.87011041 0.052962180 0.632331653 0.825931386
#> 92 9.131755 0.129428241 0.55655380 0.216418463 0.227961986 0.596763759
#> 93 8.295682 0.045161958 0.64319898 0.830968497 0.420083936 0.178923765
#> 94 11.886913 0.423033975 0.35546322 0.617356396 0.383074795 0.672239752
#> 95 11.375905 0.541658666 0.53491905 0.795869295 0.110703063 0.112794292
#> 96 18.585085 0.841555593 0.45539806 0.792866278 0.350163946 0.801001800
#> 97 21.337304 0.263872138 0.98795662 0.939402644 0.985292070 0.026537519
#> 98 13.419200 0.025992646 0.71951264 0.870567952 0.847536365 0.311720289
#> 99 18.209650 0.883311720 0.27841041 0.841596912 0.724085059 0.354745290
#> 100 17.275438 0.450701970 0.66743408 0.162974716 0.264631730 0.856417805
#> x6 x7 x8 x9 x10
#> 1 0.645602145 0.8861717707 0.503419271 0.457416577 0.453792620
#> 2 0.581549660 0.5842684391 0.633856534 0.468581578 0.646247630
#> 3 0.807131788 0.8414551399 0.965761843 0.785223631 0.973303011
#> 4 0.848486071 0.8023497208 0.435581753 0.820111734 0.934627561
#> 5 0.908663641 0.3665524579 0.506172868 0.200292916 0.860027250
#> 6 0.252525178 0.5171021207 0.745358565 0.959721317 0.874328690
#> 7 0.793537227 0.1402287707 0.129087529 0.837824774 0.547416809
#> 8 0.476789465 0.6103242941 0.237813459 0.210731194 0.250355226
#> 9 0.144379115 0.8799971030 0.121574924 0.259779316 0.119479071
#> 10 0.438092752 0.3406709784 0.283442375 0.420597251 0.376164246
#> 11 0.571106388 0.3605840083 0.187402317 0.244338630 0.122324354
#> 12 0.928166669 0.0744416905 0.359624762 0.775613114 0.752476464
#> 13 0.979892497 0.4179268864 0.777034621 0.807960380 0.810812406
#> 14 0.952116238 0.8355183813 0.015863565 0.924136046 0.299055605
#> 15 0.415252799 0.9533156329 0.514758391 0.293757560 0.565136325
#> 16 0.063955896 0.9450018802 0.432314195 0.745304845 0.372602645
#> 17 0.457186324 0.5634870189 0.396450181 0.311615880 0.345968890
#> 18 0.443205634 0.2880946666 0.296036527 0.409234574 0.948534526
#> 19 0.256735690 0.6353486709 0.600470706 0.252242171 0.506237645
#> 20 0.713704980 0.1104651222 0.835370241 0.541350628 0.457607690
#> 21 0.681852090 0.3747225024 0.526261458 0.693367578 0.057499358
#> 22 0.926464356 0.6899273056 0.803756996 0.257224190 0.423144262
#> 23 0.828952944 0.6098741505 0.004244041 0.577247268 0.300934783
#> 24 0.058789211 0.2590711229 0.092663346 0.613271000 0.548871215
#> 25 0.070507557 0.2278112799 0.032061134 0.051641251 0.001550716
#> 26 0.687277301 0.3917773587 0.622937432 0.910920883 0.902305513
#> 27 0.555062570 0.3930373220 0.694422098 0.781036662 0.009886677
#> 28 0.857228401 0.6625796729 0.920406527 0.812951165 0.959666360
#> 29 0.651602655 0.4472857921 0.005156784 0.728598226 0.999315873
#> 30 0.497060264 0.6941958666 0.629622545 0.440549141 0.946741047
#> 31 0.563480984 0.8232566479 0.618140860 0.142839628 0.690670928
#> 32 0.875182529 0.0649990004 0.731339753 0.074359900 0.045454358
#> 33 0.602186775 0.4694019151 0.945065801 0.873041093 0.572996358
#> 34 0.153667548 0.2603235799 0.276656334 0.172561696 0.812411505
#> 35 0.641358865 0.3389810468 0.780780248 0.164187185 0.457189734
#> 36 0.870917242 0.4775860340 0.387617885 0.567656500 0.748205142
#> 37 0.719666708 0.4608401058 0.822649360 0.694383744 0.255672589
#> 38 0.405490452 0.0198368647 0.016388280 0.645672612 0.549130010
#> 39 0.515815409 0.0851931807 0.137246026 0.134802919 0.759364029
#> 40 0.664334457 0.7664456482 0.625094134 0.160339671 0.315002116
#> 41 0.776179779 0.2492413986 0.843211218 0.324402209 0.229323430
#> 42 0.388370602 0.3188966538 0.553982753 0.459870300 0.007003668
#> 43 0.573421364 0.9945557348 0.409490832 0.577739010 0.756245643
#> 44 0.286641585 0.9925041844 0.214589068 0.707151524 0.576507082
#> 45 0.585679685 0.0634404763 0.724075868 0.257559746 0.974714244
#> 46 0.521129625 0.1787163133 0.986186974 0.495231126 0.438649515
#> 47 0.474237439 0.6074576522 0.337584822 0.259421416 0.721378005
#> 48 0.959615913 0.0109293140 0.031744821 0.748346985 0.497076850
#> 49 0.788354994 0.5286978967 0.779540561 0.534417275 0.605085983
#> 50 0.200636199 0.7036007417 0.125288498 0.182982873 0.465321900
#> 51 0.996505316 0.6911005201 0.363547677 0.086370304 0.211054487
#> 52 0.200780649 0.7710489505 0.585787815 0.344452500 0.155688514
#> 53 0.948077115 0.3153426449 0.490129693 0.468346576 0.126083235
#> 54 0.947902638 0.8947030213 0.878410012 0.740881175 0.008326250
#> 55 0.823016548 0.4581125907 0.313913195 0.979382919 0.315857474
#> 56 0.014187379 0.2950595480 0.108193677 0.106146394 0.394494600
#> 57 0.526736987 0.8156770202 0.117311964 0.395462505 0.180990408
#> 58 0.349291279 0.8670684521 0.115577248 0.558523921 0.491233657
#> 59 0.057368450 0.4834398429 0.824538553 0.584684314 0.212790988
#> 60 0.289856778 0.4578999961 0.638135864 0.584368082 0.058894115
#> 61 0.968794936 0.8862667177 0.316744230 0.147447287 0.314277984
#> 62 0.003517859 0.4938773189 0.704580971 0.510189717 0.642823834
#> 63 0.857095583 0.9488681294 0.536488954 0.745158947 0.916214375
#> 64 0.545552211 0.7180561770 0.701139724 0.674855337 0.893567453
#> 65 0.702442940 0.1493362351 0.796500063 0.790271669 0.324020581
#> 66 0.864791069 0.5936125400 0.822295898 0.652889986 0.795810646
#> 67 0.073997886 0.9073324129 0.663003216 0.394476679 0.895334076
#> 68 0.651916978 0.6198351560 0.050270999 0.968870453 0.649612453
#> 69 0.438700164 0.0002744263 0.291372386 0.615537899 0.554158246
#> 70 0.511677097 0.2404547343 0.194343874 0.667075003 0.919752819
#> 71 0.265252809 0.3401323461 0.589681757 0.864146577 0.953351259
#> 72 0.497267797 0.5936471811 0.786634997 0.093408646 0.481013901
#> 73 0.045554797 0.0838331443 0.853255253 0.787563414 0.414773092
#> 74 0.247973815 0.8817055584 0.617569149 0.048010915 0.681645721
#> 75 0.656253541 0.3382765041 0.529943575 0.911116323 0.812217940
#> 76 0.144416940 0.3663346907 0.038349488 0.917677154 0.095551306
#> 77 0.112814033 0.3750578654 0.057166606 0.393166471 0.444303367
#> 78 0.269993818 0.4147169665 0.606940168 0.004024461 0.613808589
#> 79 0.252235241 0.0389493029 0.561233314 0.695681280 0.006505021
#> 80 0.150764150 0.2118955518 0.702374120 0.454805280 0.598594113
#> 81 0.068539526 0.5403717028 0.438710173 0.785175696 0.020890761
#> 82 0.035260646 0.1950884536 0.216095727 0.775130426 0.958181756
#> 83 0.744751160 0.0550980540 0.039933928 0.493012443 0.064865002
#> 84 0.720950314 0.6206886144 0.809181142 0.079016414 0.574156203
#> 85 0.794510411 0.3689098444 0.563800434 0.982585400 0.848944015
#> 86 0.178887855 0.2202787802 0.599704981 0.617883557 0.093373095
#> 87 0.696740709 0.7558993085 0.351947656 0.606434719 0.094499502
#> 88 0.392508177 0.7801557770 0.532440776 0.079878310 0.454943917
#> 89 0.946968497 0.7063118273 0.354670205 0.613462814 0.070400902
#> 90 0.536705079 0.3607476617 0.707133598 0.966397154 0.051038708
#> 91 0.906183299 0.6480933684 0.295430645 0.506562765 0.300069415
#> 92 0.051090467 0.3982287906 0.609418476 0.208198798 0.368212808
#> 93 0.796668496 0.2282841124 0.680928483 0.906629454 0.115445196
#> 94 0.897482813 0.8592208570 0.721328455 0.138530034 0.483894231
#> 95 0.387080584 0.0993408919 0.169472744 0.683555648 0.862327439
#> 96 0.579479027 0.1089704672 0.548331648 0.151619136 0.547284484
#> 97 0.912846120 0.3075738552 0.549301883 0.686086558 0.270201567
#> 98 0.150862525 0.0343134028 0.640982171 0.717149598 0.358904076
#> 99 0.577205724 0.3869340310 0.190920526 0.232892851 0.341514112
#> 100 0.266994565 0.8928546598 0.394179433 0.450882636 0.049708111