Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. We are interested in constructing a step function learner as follows: First draw a random number U uniformly on the interval spanned by the

image text in transcribed
3. We are interested in constructing a step function learner as follows: First draw a random number U uniformly on the interval spanned by the minimum and maximum values of the input values (1:1, ..., {12,1} and then use it to construct the following function whose purpose is to give the prediction of 1" given X = .13: at) =os1I{U gm) +o2I(U} .13), where orl and 0:2 are just unknown constants to he learned. It goes without saying that Hermie statement) is the indicator function that equals 1 when the statement is true and 0 otherwise. Construct an R function called vet that implements an estimate 3" (it) = cilU Q I) + 6221' (U > m) of f. This R function must take the following inputs: o A vector x of values at which you would like to compute )3 . a A data frame data containing the input and output variables. o An optional numerical input argument u that overrides the behavior of the learner by forcing the cutpoint of f to be at 11 instead of the randomly gen- erated cutpoint U. The outputs of the function wet should be a list that contains the following: o A vector fitted that contains the predictions at x. a A vector coefficients that contains (i1 and d2. o A number cutpoint that is either equal to the input 11 provided by the function user or equal to the randomly generated U if the input argument u is not pro- vided. 4'. 4. Assess the variability of both the testing and the training mean squared errors of f when evaluated at the data rip by drawing B = lUU bootstrap samples

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

Calculus An Applied Approach

Authors: Ron Larson, Dennis J McKenzie, Larson/Edwards, Bruce H Edwards

7th Edition

ISBN: 1111809720, 9781111809720

More Books

Students also viewed these Mathematics questions