Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Simulate a binary classification dataset with a single feature via a mixture of normal distributions using R (Hint: Generate two data frames with the random

Simulate a binary classification dataset with a single feature via a mixture of normal distributions using R (Hint: Generate two data frames with the random number and a class label, and combine them together). The normal distribution parameters (using the function rnorm) should be (5,2) and (-5,2) for the pair of samples - you can determine an appropriate number of samples. Induce a binary decision tree (using rpart), and obtain the threshold value for the feature in the first split. How does this value compare to the empirical distribution of the feature? How many nodes does this tree have? What is the entropy and Gini at each? Repeat with normal distributions of (1,2) and (-1,2). How many nodes does this tree have? Why? Prune this tree (using rpart.prune) with a complexity parameter of 0.1. Describe the resulting tree.

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

Discrete Structures, Logic, And Computability

Authors: James L Hein

3rd Edition

1449615279, 9781449615277

More Books

Students also viewed these Mathematics questions

Question

1. Avoid long-winded statements or nagging.

Answered: 1 week ago

Question

2. Value-oriented information and

Answered: 1 week ago

Question

1. Empirical or factual information,

Answered: 1 week ago

Question

1. To take in the necessary information,

Answered: 1 week ago