function probabilityOfSpam(lengthOfBody, lengthOfSubject) {
return lengthOfBody * someParameterFromTraining + lengthOfSubject * someOtherParameterFromTraining;
}
function isSpam(email) {
return probabilityOfSpam(email.bodyLength, email.lengthOfSubject) > .5;
}