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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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