mkearney / tweetbotornot2

🔍🐦🤖 Detect Twitter Bots!
https://tweetbotornot2.mikewk.com
Other
89 stars 16 forks source link

XGBoost Upgrade #5

Closed cllghn closed 4 years ago

cllghn commented 4 years ago

Thank you so much for putting together!

I just installed it and have troubles getting it to run as expected. On running predict_bot() I get an error message stating [12:24:08] WARNING: amalgamation/../src/learner.cc:556: Loading model from XGBoost < 1.0.0, consider saving it again for improved compatibility. Then the session is aborted and I am forced to start a new session.

To double check that it was not an issue with my data I ran a subset of your sample code and got the same behavior:

library(tweetbotornot2)
screen_names <- c(
  "American__Voter", ## (these ones should be bots)
  "MagicRealismBot",
  "AOC",             ## (these ones should NOT be bots)
  "realDonaldTrump"
)
twtdat <- rtweet::get_timelines(screen_names, n = 200, check = FALSE)
predict_bot(twtdat)

This is a sessioninfo() from new project:

R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.4

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] tweetbotornot2_0.0.1

loaded via a namespace (and not attached):
 [1] crayon_1.3.4      R6_2.4.1          lifecycle_0.2.0   jsonlite_1.6.1   
 [5] magrittr_1.5      pillar_1.4.4      httr_1.4.1        rlang_0.4.6      
 [9] curl_4.3          rstudioapi_0.11   data.table_1.12.8 rtweet_0.7.0     
[13] vctrs_0.2.4       ellipsis_0.3.0    tools_3.6.3       xfun_0.12        
[17] yaml_2.2.1        compiler_3.6.3    pkgconfig_2.0.3   askpass_1.1      
[21] openssl_1.4.1     knitr_1.28        tibble_3.0.1
github-actions[bot] commented 4 years ago

Thank you for creating an issue on {tweetbotornot}! I appreciate the feedback!

thetoubi commented 4 years ago

I do receive the same warning message for predict_bot() and explain_bot(). However, it doesn't affect my session and both return the expected results.

Maybe it's worth upgrading to R 4.0.0?

R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=German_Switzerland.1252  LC_CTYPE=German_Switzerland.1252   
[3] LC_MONETARY=German_Switzerland.1252 LC_NUMERIC=C                       
[5] LC_TIME=German_Switzerland.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] jsonlite_1.6.1       tweetbotornot2_0.0.1 openssl_1.4.1       
 [4] data.table_1.12.8    forcats_0.5.0        stringr_1.4.0       
 [7] dplyr_0.8.5          purrr_0.3.4          readr_1.3.1         
[10] tidyr_1.1.0          tibble_3.0.1         ggplot2_3.3.0       
[13] tidyverse_1.3.0      rtweet_0.7.0        

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6      lubridate_1.7.8   lattice_0.20-41   prettyunits_1.1.1
 [5] ps_1.3.3          assertthat_0.2.1  rprojroot_1.3-2   utf8_1.1.4       
 [9] R6_2.4.1          cellranger_1.1.0  backports_1.1.7   reprex_0.3.0     
[13] httr_1.4.1        pillar_1.4.4      rlang_0.4.6       progress_1.2.2   
[17] curl_4.3          readxl_1.3.1      rstudioapi_0.11   callr_3.4.3      
[21] Matrix_1.2-18     munsell_0.5.0     broom_0.5.6       compiler_4.0.0   
[25] httpuv_1.5.2      modelr_0.1.8      pkgconfig_2.0.3   askpass_1.1      
[29] pkgbuild_1.0.8    tidyselect_1.1.0  fansi_0.4.1       crayon_1.3.4     
[33] dbplyr_1.4.3      withr_2.2.0       later_1.0.0       grid_4.0.0       
[37] nlme_3.1-147      gtable_0.3.0      lifecycle_0.2.0   DBI_1.1.0        
[41] magrittr_1.5      scales_1.1.1      cli_2.0.2         stringi_1.4.6    
[45] fs_1.4.1          promises_1.1.0    remotes_2.1.1     dapr_0.0.3       
[49] xml2_1.3.2        ellipsis_0.3.1    generics_0.0.2    vctrs_0.3.0      
[53] xgboost_1.0.0.2   tools_4.0.0       glue_1.4.1        hms_0.5.3        
[57] processx_3.4.2    colorspace_1.4-1  sessioninfo_1.1.1 rvest_0.3.5      
[61] haven_2.2.0   
cllghn commented 4 years ago

@thetoubi That absolutely did the trick! Thank you for the guidance.