Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python jupyter notebook. CSC 2230 Computer Programming for Engineers. 10) Have the following files loaded in the same folder: www.py4e.com/code3/mbox-short.txt www.py4e.com/code3/mbox.txt and write a function
Python jupyter notebook. CSC 2230 Computer Programming for Engineers.
10) Have the following files loaded in the same folder: www.py4e.com/code3/mbox-short.txt www.py4e.com/code3/mbox.txt and write a function meanSpamconfidence that takes a filename as an input, then read through the file and look for the lines of the form: X-DSPAM-Confidence: 0.8475 When you encounter a line that starts with "X-DSPAM-Confidence:" pull apart the line to extract the floating-point number on the line (e.g., 0.8475). Count these lines and then compute the total of the spam confidence values from these lines. When you reach the end of the file, print out the average spam confidence (calculated by total/count) Example results may look like: meanSpamConfidence( 'mbox.txt') Prints Average spam confidence: 0.894128046745 meanSpamconfidence 'mbox-short.txt') - Prints Average spam confidence: 0.750718518519Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started