def model1_train(params):
    """ Trains model 1, using all terms as features"""
    legit_terms, spam_terms, _ , _ , legit_docs, spam_docs, vocab = params # read parameters needed for model 1
    legit_count = sum(legit_terms.values()) # number of terms in legit files
    spam_count = sum(spam_terms.values()) # number of terms in spam files
    legit_prob = {}
    spam_prob = {}
    
    for term in vocab: # calculate the probabilities with Laplace smoothing, alpha = 1
        if term in legit_terms:
            legit_prob[term] = (legit_terms[term] + 1 ) / (legit_count + len(vocab))
        else:
            legit_prob[term] = (0 + 1) / (legit_count + len(vocab))
    
        if term in spam_terms:
            spam_prob[term] = (spam_terms[term] + 1) / (spam_count + len(vocab))
        else:
            spam_prob[term] = (0 + 1) / (spam_count + len(vocab))

    legit_coefficient = legit_docs / (spam_docs + legit_docs) # P(c_legit)
    spam_coefficient = spam_docs / (spam_docs + legit_docs) # P(c_spam)
    print("Size of vocabulary for model 1 is: " , len(vocab) , "\n")
    return (legit_prob, spam_prob, legit_coefficient, spam_coefficient, vocab)