Machine Learning Project to Predict Presidential Tweets

by Chuck Anderson, May 11, 2020

This document is just a suggestion on how to structure your final project report. You may choose to structure your report differently.

At the end is a code cell that counts words for you.

Do not include any of the text in this document, except possibly for the section headings, in your project report.


What, why, very brief overview of methods and results.

I'm very interested in the grammar, or lack thereof, used in tweets. I will try to automatically recognize presidential tweets by ....


Steps I took. Resources I used, such as code from the class, on-line resources, research articles, books [Goodfellow, et al., 2016], ....

REQUIRED: If this is a team project, clearly describe in detail what each team member did.


Show all results. Intermediate results might be shown in above Methods section. Plots, tables, whatever.


What I learned. What was difficult. Changes I had to make to timeline.


  • [Goodfellow, et al., 2016] Ian Goodfellow and Yoshua Bengio and Aaron Courville, Deep Learning, MIT Press. 2014.

Your report for a single person team should contain approximately 2,000 words times number of team members, in markdown cells. You can count words by running the following python code in your report directory. Projects with two people, for example, should contain 4,000 to 8,000 words.

In [1]:
import io
from nbformat import current
import glob
nbfile = glob.glob('Project Report Example.ipynb')
if len(nbfile) > 1:
    print('More than one ipynb file. Using the first one.  nbfile=', nbfile)
with[0], 'r', encoding='utf-8') as f:
    nb =, 'json')
word_count = 0
for cell in nb.worksheets[0].cells:
    if cell.cell_type == "markdown":
        word_count += len(cell['source'].replace('#', '').lstrip().split(' '))
print('Word count for file', nbfile[0], 'is', word_count)
Word count for file Project Report Example.ipynb is 216
/home/anderson/anaconda3/lib/python3.7/site-packages/nbformat/ UserWarning: nbformat.current is deprecated.

- use nbformat for read/write/validate public API
- use nbformat.vX directly to composing notebooks of a particular version