Kernel: R (R-Project)
Predicting the Genre of a Movie
Natalie Agudo nsa348, Elizabeth Pipes elp343
References (if any)
Professor Sondjaja's help during office hours
Class Demonstrations and Lectures
Codes
In [0]:
In [1]:
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
In [41]:
In [42]:
In [43]:
Title | Genre | Year | Rating | X..Votes | X..Words | i | the | to | a | ⋯ | foster | pub | vegetarian | garrison | grammoo | chimney | bikini | richter | psychopath | fling |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
the terminator | action | 1984 | 8.1 | 183538 | 1849 | 0.04002163 | 0.04380746 | 0.02541915 | 0.02487831 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000000000 | 0 |
batman | action | 1989 | 7.6 | 112731 | 2836 | 0.05148096 | 0.03385049 | 0.02397743 | 0.02820875 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000000000 | 0 |
tomorrow never dies | action | 1997 | 6.4 | 47198 | 4215 | 0.02870700 | 0.05432977 | 0.03036773 | 0.02182681 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000237248 | 0 |
batman forever | action | 1995 | 5.4 | 77223 | 3032 | 0.03660950 | 0.04221636 | 0.02044855 | 0.03100264 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000000000 | 0 |
supergirl | action | 1984 | 4.1 | 6576 | 3842 | 0.04190526 | 0.03227486 | 0.02889120 | 0.02628839 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000000000 | 0 |
the avengers | action | 1998 | 3.4 | 21519 | 3586 | 0.03680982 | 0.03346347 | 0.02481874 | 0.02900167 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000278862 | 0 |
In [44]:
In [45]:
WARNING: Some output was deleted.
In [46]:
In [47]:
In [48]:
In [49]:
In [50]:
In [51]:
In [52]:
In [53]:
0.001789709
0
0
In [54]:
In [55]:
In [56]:
Title | Genre | Year | Rating | X..Votes | X..Words | i | the | to | a | ⋯ | foster | pub | vegetarian | garrison | grammoo | chimney | bikini | richter | psychopath | fling | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
109 | birthday girl | romance | 2001 | 6.0 | 13497 | 2235 | 0.04340045 | 0.02460850 | 0.03176734 | 0.01968680 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
169 | the french connection | action | 1971 | 7.9 | 34062 | 1115 | 0.02062780 | 0.06278027 | 0.01524664 | 0.04484305 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
In [57]:
0.015246637
In [58]:
- 81
- 5006
In [59]:
In [60]:
predicted_genre |
---|
romance |
action |
romance |
action |
romance |
action |
In [61]:
In [62]:
0.728395061728395
In [63]:
Title | Genre | Year | Rating | X..Votes | X..Words | i | the | to | a | ⋯ | foster | pub | vegetarian | garrison | grammoo | chimney | bikini | richter | psychopath | fling | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
109 | birthday girl | romance | 2001 | 6.0 | 13497 | 2235 | 0.04340045 | 0.02460850 | 0.03176734 | 0.01968680 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
169 | the french connection | action | 1971 | 7.9 | 34062 | 1115 | 0.02062780 | 0.06278027 | 0.01524664 | 0.04484305 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
82 | mrs brown | romance | 1997 | 7.2 | 5701 | 4077 | 0.03728232 | 0.04145205 | 0.03335786 | 0.01888644 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
207 | x-men | action | 2000 | 7.4 | 122149 | 1736 | 0.03168203 | 0.04493088 | 0.04089862 | 0.02016129 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
33 | braveheart | action | 1995 | 8.4 | 245652 | 2895 | 0.03799655 | 0.03557858 | 0.03281520 | 0.02521589 | ⋯ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
predicted_genre |
---|
romance |
action |
romance |
action |
romance |
In [64]:
In [65]:
0.828571428571429
In [66]:
- action
- action
- action
- action
- action
Levels:
- 'action'
- 'romance'
In [67]:
113
In [68]:
394
In [69]:
529
In [88]:
0.62962962962963
In [89]:
0.691358024691358
In [90]:
0.679012345679012
In [91]:
0.654320987654321
In [92]:
0.703703703703704
In [93]:
0.716049382716049
In [94]:
0.679012345679012
In [95]:
0.679012345679012