Implement 5-fold cross-validation to choose t

Assignment Help Basic Computer Science
Reference no: EM131082524

In Section 3.6.3 we used the test set that we had put aside to both select τ, the threshold for the log odds, and to evaluate the Type I and II errors incurred when we use this threshold. Ideally, we choose τ from another set of messages that is both independent of our training data and our test data. The method of cross-validation is designed to use the training set for training and validating the model. Implement 5-fold cross-validation to choose τ and assess the error rate with our training data. To do this, follow the steps:

(a) Use the sample () function to permute the indices of the training set, and organize these permuted indices into 5 equal-size sets, called folds.

(b) For each fold, take the corresponding subset from the training data to use as a ‘test' set. Use the remaining messages in the training data as the training set. Apply the functions developed in Section 3.6 to estimate the probabilities that a word occurs in a message given it is spam or ham, and use these probabilities to compute the log likelihood ratio for the messages in the training set.

(c) Pool all of the LLR values from the messages in all of the folds, i.e., from all of the training data, and use these values and the type I Error Rate () function to select a threshold that achieves a 1% Type I error.

(d) Apply this threshold to our original/real test set and find its Type I and Type II errors.

Reference no: EM131082524

Questions Cloud

Amount of the annual interest tax shield : What is the amount of the annual interest tax shield given a tax rate of 35 percent?
Write code to handle the attachments in the message : Write code to handle the attachments in the message
Calculate monthly return : A mutual fund that had a NAV Rs. 20 at the beginning of the month made income and capital gain distribution of Rs. 0.0375 and Rs. 0.03 per share respectively; during the month and then ended the month with a net asset value of Rs. 20.06. Calculate..
Can you improve the prediction using them : Can you improve the prediction using them?
Implement 5-fold cross-validation to choose t : Apply this threshold to our original/real test set and find its Type I and Type II errors.
Large downpayment on the purchase of a house : Statement I: When a Bank requires a Borrower to pay a large downpayment on the purchase of a house, the Bank is reducing its risk by increasing the equity cushion to support any losses in value to the collateral.
Calculate the interest rate : Calculate the interest rate on 1,2, 3, 4, 5, 10, and 20 year Treasury securities. Please show all work (steps involved).
Develop a hybrid classifier that uses both the word vectors : Develop a hybrid classifier that uses both the word vectors and these additional features.
Find out effective rate of interest : A finance company offers him a hire purchase deal of repayment in 30 months, the flat rate being 6.497%. Find out Effective rate of Interest.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Higher standard deviation of the second test

The average test grade rose by one point, the scores of the second test were closer together than the first, the higher standard deviation of the second test indicates higher average scores on the second test than the first, or none of the above a..

  What is the purpose of the system unit

1. What is the purpose of the system unit? 2. List and define the primary components of the motherboard. 3. List and define the primary subunits of the CPU.

  Write another implementation for the destructor

Write another implementation for the destructor that deallocates the linked chain directly without calling dequeue.

  Improper disclosure of health information

A cause of action for improper disclosure of health information may result from either a negligent or intentional act. Complete an Internet search and find news stories related to breach of patient confidentiality.

  How verbal and nonverbal communication affect communication

Write 1,750- to 2,100-word paper explaining how verbal and nonverbal communication can affect communication in given areas: Police situations (public announcement to the press).

  Discuss the different types of transaction failures

Discuss the different types of transaction failures. What is meant by catastrophic failure?

  How big is block size used by the file system to read data

How big is the block size used by the file system to read data? Hint: use reads of varying sizes and plot the time it takes to do such reads. Also, be wary of prefetching effects that often kick in during sequential reads.

  Event viewer console for warnings and errors

Make sure that Windows Server 2008 or Windows Server 2008 R2 is running properly on the computer before you begin the upgrade process. Check the Event Viewer console for warnings and errors.

  Difference between a virtual and a pure virtual function

difference between a virtual  and a pure virtual function

  Write a pseudo code program for shifting data

write a pseudo code program for shifting data to make a gap at some specified location of a sorted fi le. Pay particular attention to the details of shifting the last item out of one block and into the first position of the next block.

  Work with dictionary and create relational database

In this lab, you will prepare a Data Dictionary based on the list of elements. Also, your task will be determined the tables, their relationships, primary and foreign keys. Based on this analysis, you will create Database Schema, relational tables..

  Major elements of disaster recovery

Why the business continuity and disaster recovery plan is necessary What should be considered and covered in a business continuity plan and disaster recovery plan Explanation of the major elements of disaster recovery and business continuity Discussi..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd