Search -have-problem-with-econometrics

# have problem with econometrics

## Top Questions

View More

ooking at how likely a given email is to be spam based on the words it contains. In particular, in this problem we’re going to count how often words are present in spam emails within some set of training data (which here means a set of emails that have already been marked as spam or not spam manually). We have already started to write a function spam_score(spam_file, not_file, word), which takes in two filenames, along with a target word (a lowercase string). Both filenames refer to text files which must be in the same directory as hw07.py (we’ve provided several such files in hw07files.zip). The text files contain one email per line (really just the subject line to keep things simple) - you can assume that these emails will be a series of words separated by spaces with no punctuation. The first file contains emails that have been identified as spam, the second contains emails that have been identified as not spam. Since you haven’t learned File I/O yet, we’ve provided code that opens the two files and puts the data into two lists of strings (where each element is one line - that is, one email). You then must complete the function, so that it returns the spam score for the target word. The spam score is an integer representing the total number of times the target word occurs across all the spam emails, minus the total number of times the word occurs in not-spam emails. Convert all words to lowercase before counting, to ensure capitalization does not throw off the count.
View More

View More

nd three of them are broken. Two glasses are chosen at random from the box. Calculate the probability that (1) both glasses are broken, (2) none of the glasses are broken (3) both glasses are broken or one of the glasses is broken
View More

t you have in stocks besides unlimited supply of water (0% alcoholic content, 0 in cost): Beer ;Alcohol content; Cost per gallon; In stock (gallons) Low; 0.25%; 0.55; 500 Light; 2.50%; 0.65; 500 Heavy; 4.50%; 0.80; 500 Dark; 6.00%; 0.75; 500 What is the mix of existing beer (and water) to make 1500 gallons of 3 percent beer with the minimum cost? 1. Show the mathematical formulation of the optimization problem (decision variables, objective, and constraints) 2. What is the optimal mix of the existing beer (and water) to meet the order requirement? 3. What is the minimum cost incurred? 4. If the optimal mix maintains its pattern, without re-solving the problem, construct the new optimal mix of existing beer (and water) to make 1600 gallons of the 3 percent beer
View More