Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm trying to figure out how to create a plot of training and test data in R. Please see the problem description below. Data: age

I'm trying to figure out how to create a plot of training and test data in R. Please see the problem description below.

Data:

agesexcptrestbpscholfbsrestecgthalachexangoldpeakslopecathaltarget
62121302310114601.81331
58001301970113100.61021
60031502400117100.92021
631014018700144142230
6210120267019911.81230
630213525200172002021
43101502470117101.52021
42121202401119400.80031
59121262181113402.21110
48101242740016600.51030
511014026100186102021
641014521200132021210
441011229000153002120
48021302750113900.22021
60021201781196002021
68101441931114103.41230
52131522981117801.21031
62001601640014506.20330
70121602690111212.91130
59131342040116200.82220
6202130263019701.21130
50021202190115801.61021
38131202310118213.81030
580315028310162012021
521311818600190001011
68021202110011501.51021
57121282290015000.41130
561112024001169000021
710211026510130002121
59101352340116100.51031
60001502580015702.61230
660017822811165111230
54101102390112612.81130
54121202580014700.41031
5710152274018811.21130
650015022500114011330
570113023600174001120
580113631910152002220
521012521201168012230
50011202440116201.12021
62001402680016003.60220
421014022601178002021
62111202810010301.41130
64021403130113300.22031
65021552690114800.82021
411113520301132001011
68121802741015011.61030
56131201930016201.91031
56011402940015301.31021
52021361960016900.11021
67101002990012510.91220
411112015701182002021
64121253090113111.81030
55101323530113211.21130
43101322471014310.11430
58101502700011110.82030
57111242610114100.32030
771012530400162102320
411011017200158002030
571011033501143131130
561113022100163002031
51001303050114211.21030
56101302831010311.60030
56101252491014411.21120
52111342010115800.82121
64131702270015500.61031
58001702251014612.81210
501212919601163002021
64131102110014411.81021
460110520401172002021
58121052400015410.61031
411111023501153002021
591114022101164102021
61101381660012513.61120
57121501261117300.22131
681211827701151012131
441112026301173002031
451010420800148131021
420212020901173001021
410211226800172102021
540113228810159102121
34011182100119200.72021
591316027300125002020
59101641761090011210
441212022601169002021
390213822001152001021
49121181490012600.82320
591014017701162102130
66101122120013210.12120
351012628200156102030
53001302640014300.41021
471210824301152002020
461110119711156002031
421213018001150002021
581012530000171002230
56121302561014210.61110
411213021400168021021
51121002220114311.21021
571115423200164002120
42001022650012200.61021
521012825501161102130
54021102140115801.61021
490013026901163002021
53121301971015201.20021
640013030301122021221
471213825700156002021
45131102640113201.21030
65131382821017401.41120
451112830800170002021
65021603600015100.82021
451011526000185002021
551113026201155002021
661116024601120101310
691214025400146021330
51121252451016602.41021
70101451740112512.60030
58121322240017303.22230
65021404171015700.82121
370212021501170002021
57101401920114800.41011
61131342340114502.61220
60101302060013212.41230
39101182190114001.21030
630012419701136101020
46121502310114703.61020
500011025400159002021
52101082331114700.12331
481012222200186002021
53101232820195121230
69131602341013100.11121
45011302340017500.61021
381213817501173002421
56001344090015011.91230
571013220701168102031
69031402390115101.82221
42101363150112511.81010
65101352540012702.81130
441113021900188002021
58101282160013112.21330
481212425511175002221
64101282630110510.21131
50101502430012802.61030
51021202950015700.62021
51121101750112300.62021
6410120246009612.20120
640018032501154102021
63131452331015002.30011
62001403940015701.21021
67101202370171011020
76021401970211601.11021
56111202360117800.82021
35101201980113011.61030
471213025301179002021
641214033501158002020
62001502440115411.41020
51021403080014201.52121
66031502260111402.60021
611215024311137111021
540216020101163002121
51021302560014900.52021
560020028810133140230
341311818200174002021
52111203250117200.22021
59131782700014504.20031
46021421770016011.40021
490113427101162001021
55101402170111115.60030
63001082690116911.81220
54121252730015200.50121
521112820511184002021
430013234110136131030
45001382360015210.21021
43121303150116201.92121
46101403110112011.81230
44021182420114900.31121
55011352500016101.41021
74011202690012110.22121
39029419901179002021
51131252130012511.42121
580010024800122011021
66101602280013802.32011
581014621801105021130
67001062230114200.32221
410112630601163002021
43021222130116500.21021
60101302530114411.42130
421112029501162002021
60101172301116011.42230
50101442000012610.91030
58121122300016502.51130
541110830901156002031
57121501680117401.62021
71001121490112501.61021
58111252200114400.41431
44121302330117910.42021
44021081410117500.61021
57101102010112611.51011
35001381830118201.42021
581214021110165002021
610013033000169002020
43101201770012012.51030
46101202490014400.82030
55001803270211713.41020
601214018500155031020
61101402070013811.92130
50121402330116300.61130
49111302660117100.62021
57001203540116310.62021
660214627800152001121
56101321840010512.11110
610014530700146111030
611014820301161002130
51101402990117311.62030
54121502320016501.62031
65101201770114000.42031
59101102390014211.21130
67101202290012912.61230
67121522120015000.81030
60101452820014212.81230
391214032100182002021
441112022001170002021
51101402980112214.21330
460013824300152101021
40131401990117811.42031
43101153030118101.21021
67021155640016001.61031
541119228300195002130
401015222301181002030
65101102480015800.62210
59121502121115701.62021
701115624500143002021
481111022901168010030
571016528910124011330
530212821600115002001
381213817501173002421
351112219201174002021
54101201880111301.41130
60101402930017001.21230
70101303220010902.41320
62001382941110601.91320
48111302450018000.21021
44101201690114412.80010
531014222600111102031
54101222860011613.21220
540210826700167002021
42131482440017800.82221
530013823400160002021
47101122040114300.12021
58111202840016001.81020
53101402031015513.10030
41011302040017201.42021
481013025610150102230
71011603020116200.42221
63101303301013211.82330
581012825900130131230
52121721991116200.52031
591013827100182002021
431011021101161002031
58101002340115600.12130
61101202600114013.61130
590017424901143101020
411211225001179002021
451014230900147101330
521011223001160002120
441011019700177002120
51129422701154102131
580212034001172002021
541011020600108101120
620012420901163002021
59131702880015900.21030
570012830300159002121
60101252580014112.81130
291113020400202002021
521012820411156111000
37121302500118703.50021
450111216001138001021
491212018801139021330
630015040700154041330
55101602890014510.81130
67101252541116300.21230
531213024610173002321
54101242660010912.21130
63101302540014701.41130
59101703260014013.40030
621112820810140002021
58101143180214004.40310
67101602860010811.51320
600210231801160002121
57101502760011210.61110
54101402390116001.22021
410110519801168002121
540213530411170002021
57001402410112310.21030
401011016700114121030
550012820502130121130
521213822301169002421
66101203020015100.41021
670215227701172002121
57101301310111511.21130
55011323420116601.22021
471011027500118111120
441214023500180002021
630114019501179002221
  • Graph the training and testing error against the number of trees using a classification random forest model for the presence of heart disease (target) using variables age (age), sex (sex), chest pain type (cp), resting blood pressure (trestbps), cholesterol measurement (chol), resting electrocardiographic measurement (restecg), exercise-induced angina (exang), slope of peak exercise (slope), and number of major vessels (ca). Use a maximum of 200 trees. Use set.seed(511038).
  • image text in transcribed
.0 training set testing set 0.8 Classification Error 0.2 0.0 0 50 100 150 200 Number of Trees

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Wavelet Based Approximation Schemes For Singular Integral Equations

Authors: Madan Mohan Panja, Birendra Nath Mandal

1st Edition

0429534280, 9780429534287

More Books

Students also viewed these Mathematics questions