time_series()
#> $raw
#> # A tibble: 50,000 x 14
#>    polarity      id date                query user  text  nouns adjectives
#>    <chr>      <int> <dttm>              <chr> <chr> <chr> <int>      <int>
#>  1 Negative  2.01e9 2009-06-03 09:26:56 NO_Q… Nina… n fe…     3          0
#>  2 Positive  1.93e9 2009-05-27 05:45:38 NO_Q… RBCK… @ong…    14          1
#>  3 Negative  2.05e9 2009-06-06 02:27:00 NO_Q… t3ll… an m…     4          2
#>  4 Negative NA      2009-06-19 18:58:49 NO_Q… Joyc… nd n…     7          0
#>  5 Positive  2.07e9 2009-06-07 17:56:22 NO_Q… Shau… @yan…     4          3
#>  6 Positive  1.56e9 2009-04-19 19:00:50 NO_Q… shor… @ust…     4          1
#>  7 Positive  1.84e9 2009-05-18 12:35:39 NO_Q… molt… orni…     5          0
#>  8 Negative  2.07e9 2009-06-07 21:14:40 NO_Q… chel… Pod …     3          0
#>  9 Negative NA      2009-06-17 07:38:41 NO_Q… call… an't…     6          1
#> 10 Negative NA      2009-06-25 08:50:36 NO_Q… Love… " wi…     2          0
#> # … with 49,990 more rows, and 6 more variables: prepositions <int>,
#> #   articles <int>, pronouns <int>, verbs <int>, adverbs <int>,
#> #   interjections <int>
#> 
#> $date_counts
#> # A tibble: 73 x 3
#>    date       polarity count
#>    <date>     <fct>    <int>
#>  1 2009-04-07 Negative   265
#>  2 2009-04-07 Positive   336
#>  3 2009-04-18 Negative   225
#>  4 2009-04-18 Positive   271
#>  5 2009-04-19 Negative   407
#>  6 2009-04-19 Positive   578
#>  7 2009-04-20 Negative   218
#>  8 2009-04-20 Positive   313
#>  9 2009-04-21 Negative   131
#> 10 2009-04-21 Positive   203
#> # … with 63 more rows
#> 
#> $day_counts
#> # A tibble: 53 x 3
#>      day polarity count
#>    <int> <fct>    <int>
#>  1     1 Negative  1278
#>  2     1 Positive  1828
#>  3     2 Negative  1357
#>  4     2 Positive  1996
#>  5     3 Negative  1096
#>  6     3 Positive  1611
#>  7     4 Negative   427
#>  8     4 Positive   604
#>  9     5 Negative   440
#> 10     5 Positive   670
#> # … with 43 more rows
#> 
#> $plot_date

#> 
#> $plot_day

predict_polarity_keras(model_load_path = system.file("extdata",
                                                     "train_no_glove_lstm.rds",
                                                     package = "deepSentimentR",
                                                     mustWork = TRUE))
#> $raw
#> # A tibble: 354 x 14
#>    polarity    id date                query user  text  nouns adjectives
#>    <chr>    <int> <dttm>              <chr> <chr> <chr> <int>      <int>
#>  1 Positive   217 2009-05-25 17:29:39 mcdo… Mami… mgg …     7          2
#>  2 Positive  2140 2009-05-20 02:38:17 nike  Chet… ew n…     4          2
#>  3 Negative   224 2009-05-25 17:34:51 chen… QCWo… ife?…     9          3
#>  4 Positive   569 2009-06-07 21:38:16 kind… rach… @lon…     8          2
#>  5 Positive  2546 2009-06-08 00:13:48 kind… k8tb… " lo…     7          1
#>  6 Positive  1019 2009-05-11 05:21:25 lebr… unde… atch…     3          1
#>  7 Negative  2110 2009-05-18 01:14:35 Malc… blin… @por…     7          3
#>  8 Positive   256 2009-05-27 23:59:18 goog… maex… " am…     3          1
#>  9 Negative   413 2009-06-02 03:17:04 time… Jaso… " ha…    11          4
#> 10 Positive  1003 2009-05-11 03:18:59 kind… Happ… y Ki…     1          0
#> # … with 344 more rows, and 6 more variables: prepositions <int>,
#> #   articles <int>, pronouns <int>, verbs <int>, adverbs <int>,
#> #   interjections <int>
#> 
#> $predictions
#> # A tibble: 354 x 15
#>    polarity    id date                query user  text  nouns adjectives
#>       <dbl> <int> <dttm>              <chr> <chr> <chr> <int>      <int>
#>  1        1   217 2009-05-25 17:29:39 mcdo… Mami… mgg …     7          2
#>  2        1  2140 2009-05-20 02:38:17 nike  Chet… ew n…     4          2
#>  3        0   224 2009-05-25 17:34:51 chen… QCWo… ife?…     9          3
#>  4        1   569 2009-06-07 21:38:16 kind… rach… @lon…     8          2
#>  5        1  2546 2009-06-08 00:13:48 kind… k8tb… " lo…     7          1
#>  6        1  1019 2009-05-11 05:21:25 lebr… unde… atch…     3          1
#>  7        0  2110 2009-05-18 01:14:35 Malc… blin… @por…     7          3
#>  8        1   256 2009-05-27 23:59:18 goog… maex… " am…     3          1
#>  9        0   413 2009-06-02 03:17:04 time… Jaso… " ha…    11          4
#> 10        1  1003 2009-05-11 03:18:59 kind… Happ… y Ki…     1          0
#> # … with 344 more rows, and 7 more variables: prepositions <int>,
#> #   articles <int>, pronouns <int>, verbs <int>, adverbs <int>,
#> #   interjections <int>, pred_polarity[,1] <int>
#> 
#> $confusion_matrix
#> # A tibble: 4 x 3
#>   polarity pred_polarity count
#>   <fct>    <fct>         <int>
#> 1 0        0               135
#> 2 0        1                40
#> 3 1        0                34
#> 4 1        1               145
#> 
#> $true_negative
#> [1] 135
#> 
#> $true_positive
#> [1] 145
#> 
#> $false_positive
#> [1] 40
#> 
#> $false_negative
#> [1] 34
#> 
#> $precision
#> [1] 0.7837838
#> 
#> $recall
#> [1] 0.8100559
#> 
#> $f1
#> [1] 0.7967033
#> 
#> $accuracy
#> [1] 0.7909605
#> 
#> $plot

predict_polarity_keras(model_load_path = system.file("extdata",
                                                     "train_glove_lstm.rds",
                                                     package = "deepSentimentR",
                                                     mustWork = TRUE))
#> $raw
#> # A tibble: 354 x 14
#>    polarity    id date                query user  text  nouns adjectives
#>    <chr>    <int> <dttm>              <chr> <chr> <chr> <int>      <int>
#>  1 Positive   217 2009-05-25 17:29:39 mcdo… Mami… mgg …     7          2
#>  2 Positive  2140 2009-05-20 02:38:17 nike  Chet… ew n…     4          2
#>  3 Negative   224 2009-05-25 17:34:51 chen… QCWo… ife?…     9          3
#>  4 Positive   569 2009-06-07 21:38:16 kind… rach… @lon…     8          2
#>  5 Positive  2546 2009-06-08 00:13:48 kind… k8tb… " lo…     7          1
#>  6 Positive  1019 2009-05-11 05:21:25 lebr… unde… atch…     3          1
#>  7 Negative  2110 2009-05-18 01:14:35 Malc… blin… @por…     7          3
#>  8 Positive   256 2009-05-27 23:59:18 goog… maex… " am…     3          1
#>  9 Negative   413 2009-06-02 03:17:04 time… Jaso… " ha…    11          4
#> 10 Positive  1003 2009-05-11 03:18:59 kind… Happ… y Ki…     1          0
#> # … with 344 more rows, and 6 more variables: prepositions <int>,
#> #   articles <int>, pronouns <int>, verbs <int>, adverbs <int>,
#> #   interjections <int>
#> 
#> $predictions
#> # A tibble: 354 x 15
#>    polarity    id date                query user  text  nouns adjectives
#>       <dbl> <int> <dttm>              <chr> <chr> <chr> <int>      <int>
#>  1        1   217 2009-05-25 17:29:39 mcdo… Mami… mgg …     7          2
#>  2        1  2140 2009-05-20 02:38:17 nike  Chet… ew n…     4          2
#>  3        0   224 2009-05-25 17:34:51 chen… QCWo… ife?…     9          3
#>  4        1   569 2009-06-07 21:38:16 kind… rach… @lon…     8          2
#>  5        1  2546 2009-06-08 00:13:48 kind… k8tb… " lo…     7          1
#>  6        1  1019 2009-05-11 05:21:25 lebr… unde… atch…     3          1
#>  7        0  2110 2009-05-18 01:14:35 Malc… blin… @por…     7          3
#>  8        1   256 2009-05-27 23:59:18 goog… maex… " am…     3          1
#>  9        0   413 2009-06-02 03:17:04 time… Jaso… " ha…    11          4
#> 10        1  1003 2009-05-11 03:18:59 kind… Happ… y Ki…     1          0
#> # … with 344 more rows, and 7 more variables: prepositions <int>,
#> #   articles <int>, pronouns <int>, verbs <int>, adverbs <int>,
#> #   interjections <int>, pred_polarity[,1] <int>
#> 
#> $confusion_matrix
#> # A tibble: 4 x 3
#>   polarity pred_polarity count
#>   <fct>    <fct>         <int>
#> 1 0        0               122
#> 2 0        1                53
#> 3 1        0                31
#> 4 1        1               148
#> 
#> $true_negative
#> [1] 122
#> 
#> $true_positive
#> [1] 148
#> 
#> $false_positive
#> [1] 53
#> 
#> $false_negative
#> [1] 31
#> 
#> $precision
#> [1] 0.7363184
#> 
#> $recall
#> [1] 0.8268156
#> 
#> $f1
#> [1] 0.7789474
#> 
#> $accuracy
#> [1] 0.7627119
#> 
#> $plot

predict_polarity_keras(model_load_path = system.file("extdata",
                                                     "train_no_glove_conv_1d.rds",
                                                     package = "deepSentimentR",
                                                     mustWork = TRUE))
#> $raw
#> # A tibble: 354 x 14
#>    polarity    id date                query user  text  nouns adjectives
#>    <chr>    <int> <dttm>              <chr> <chr> <chr> <int>      <int>
#>  1 Positive   217 2009-05-25 17:29:39 mcdo… Mami… mgg …     7          2
#>  2 Positive  2140 2009-05-20 02:38:17 nike  Chet… ew n…     4          2
#>  3 Negative   224 2009-05-25 17:34:51 chen… QCWo… ife?…     9          3
#>  4 Positive   569 2009-06-07 21:38:16 kind… rach… @lon…     8          2
#>  5 Positive  2546 2009-06-08 00:13:48 kind… k8tb… " lo…     7          1
#>  6 Positive  1019 2009-05-11 05:21:25 lebr… unde… atch…     3          1
#>  7 Negative  2110 2009-05-18 01:14:35 Malc… blin… @por…     7          3
#>  8 Positive   256 2009-05-27 23:59:18 goog… maex… " am…     3          1
#>  9 Negative   413 2009-06-02 03:17:04 time… Jaso… " ha…    11          4
#> 10 Positive  1003 2009-05-11 03:18:59 kind… Happ… y Ki…     1          0
#> # … with 344 more rows, and 6 more variables: prepositions <int>,
#> #   articles <int>, pronouns <int>, verbs <int>, adverbs <int>,
#> #   interjections <int>
#> 
#> $predictions
#> # A tibble: 354 x 15
#>    polarity    id date                query user  text  nouns adjectives
#>       <dbl> <int> <dttm>              <chr> <chr> <chr> <int>      <int>
#>  1        1   217 2009-05-25 17:29:39 mcdo… Mami… mgg …     7          2
#>  2        1  2140 2009-05-20 02:38:17 nike  Chet… ew n…     4          2
#>  3        0   224 2009-05-25 17:34:51 chen… QCWo… ife?…     9          3
#>  4        1   569 2009-06-07 21:38:16 kind… rach… @lon…     8          2
#>  5        1  2546 2009-06-08 00:13:48 kind… k8tb… " lo…     7          1
#>  6        1  1019 2009-05-11 05:21:25 lebr… unde… atch…     3          1
#>  7        0  2110 2009-05-18 01:14:35 Malc… blin… @por…     7          3
#>  8        1   256 2009-05-27 23:59:18 goog… maex… " am…     3          1
#>  9        0   413 2009-06-02 03:17:04 time… Jaso… " ha…    11          4
#> 10        1  1003 2009-05-11 03:18:59 kind… Happ… y Ki…     1          0
#> # … with 344 more rows, and 7 more variables: prepositions <int>,
#> #   articles <int>, pronouns <int>, verbs <int>, adverbs <int>,
#> #   interjections <int>, pred_polarity[,1] <int>
#> 
#> $confusion_matrix
#> # A tibble: 4 x 3
#>   polarity pred_polarity count
#>   <fct>    <fct>         <int>
#> 1 0        0               110
#> 2 0        1                65
#> 3 1        0                48
#> 4 1        1               131
#> 
#> $true_negative
#> [1] 110
#> 
#> $true_positive
#> [1] 131
#> 
#> $false_positive
#> [1] 65
#> 
#> $false_negative
#> [1] 48
#> 
#> $precision
#> [1] 0.6683673
#> 
#> $recall
#> [1] 0.7318436
#> 
#> $f1
#> [1] 0.6986667
#> 
#> $accuracy
#> [1] 0.680791
#> 
#> $plot

predict_polarity_keras(model_load_path = system.file("extdata",
                                                     "train_glove_conv_1d.rds",
                                                     package = "deepSentimentR",
                                                     mustWork = TRUE))
#> $raw
#> # A tibble: 354 x 14
#>    polarity    id date                query user  text  nouns adjectives
#>    <chr>    <int> <dttm>              <chr> <chr> <chr> <int>      <int>
#>  1 Positive   217 2009-05-25 17:29:39 mcdo… Mami… mgg …     7          2
#>  2 Positive  2140 2009-05-20 02:38:17 nike  Chet… ew n…     4          2
#>  3 Negative   224 2009-05-25 17:34:51 chen… QCWo… ife?…     9          3
#>  4 Positive   569 2009-06-07 21:38:16 kind… rach… @lon…     8          2
#>  5 Positive  2546 2009-06-08 00:13:48 kind… k8tb… " lo…     7          1
#>  6 Positive  1019 2009-05-11 05:21:25 lebr… unde… atch…     3          1
#>  7 Negative  2110 2009-05-18 01:14:35 Malc… blin… @por…     7          3
#>  8 Positive   256 2009-05-27 23:59:18 goog… maex… " am…     3          1
#>  9 Negative   413 2009-06-02 03:17:04 time… Jaso… " ha…    11          4
#> 10 Positive  1003 2009-05-11 03:18:59 kind… Happ… y Ki…     1          0
#> # … with 344 more rows, and 6 more variables: prepositions <int>,
#> #   articles <int>, pronouns <int>, verbs <int>, adverbs <int>,
#> #   interjections <int>
#> 
#> $predictions
#> # A tibble: 354 x 15
#>    polarity    id date                query user  text  nouns adjectives
#>       <dbl> <int> <dttm>              <chr> <chr> <chr> <int>      <int>
#>  1        1   217 2009-05-25 17:29:39 mcdo… Mami… mgg …     7          2
#>  2        1  2140 2009-05-20 02:38:17 nike  Chet… ew n…     4          2
#>  3        0   224 2009-05-25 17:34:51 chen… QCWo… ife?…     9          3
#>  4        1   569 2009-06-07 21:38:16 kind… rach… @lon…     8          2
#>  5        1  2546 2009-06-08 00:13:48 kind… k8tb… " lo…     7          1
#>  6        1  1019 2009-05-11 05:21:25 lebr… unde… atch…     3          1
#>  7        0  2110 2009-05-18 01:14:35 Malc… blin… @por…     7          3
#>  8        1   256 2009-05-27 23:59:18 goog… maex… " am…     3          1
#>  9        0   413 2009-06-02 03:17:04 time… Jaso… " ha…    11          4
#> 10        1  1003 2009-05-11 03:18:59 kind… Happ… y Ki…     1          0
#> # … with 344 more rows, and 7 more variables: prepositions <int>,
#> #   articles <int>, pronouns <int>, verbs <int>, adverbs <int>,
#> #   interjections <int>, pred_polarity[,1] <int>
#> 
#> $confusion_matrix
#> # A tibble: 4 x 3
#>   polarity pred_polarity count
#>   <fct>    <fct>         <int>
#> 1 0        0               103
#> 2 0        1                72
#> 3 1        0                42
#> 4 1        1               137
#> 
#> $true_negative
#> [1] 103
#> 
#> $true_positive
#> [1] 137
#> 
#> $false_positive
#> [1] 72
#> 
#> $false_negative
#> [1] 42
#> 
#> $precision
#> [1] 0.6555024
#> 
#> $recall
#> [1] 0.7653631
#> 
#> $f1
#> [1] 0.7061856
#> 
#> $accuracy
#> [1] 0.6779661
#> 
#> $plot