Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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.750718518519

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

More Books

Students also viewed these Databases questions

Question

Critique why humans fall prey to perceptual illusions.

Answered: 1 week ago

Question

News release is to both print and broadcast as press release is to

Answered: 1 week ago