catboost icon indicating copy to clipboard operation
catboost copied to clipboard

Unsupported column type: character

Open XianglinZhang-risker opened this issue 6 years ago • 8 comments

Hello, the following error appears in the initial example of R. May I ask what is the reason?

features <- data.frame(feature1 = c(1, 2, 3), feature2 = factor(c('A', 'B', 'C')))
labels <- c(0, 0, 1)
train_pool <- catboost.load_pool(data = features, label = labels)

Error in catboost.from_data_frame(data, label, pairs, weight, group_id, : Unsupported column type: character

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

Matrix products: default

locale: [1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936 LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936

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

other attached packages: [1] catboost_0.23.2

loaded via a namespace (and not attached): [1] compiler_4.0.0 tools_4.0.0 jsonlite_1.6.1

XianglinZhang-risker avatar Jun 10 '20 05:06 XianglinZhang-risker

Hello! Your code snippet works just fine in RStudio both on my Win10 and MacOS machines. Can you help us reproducing this bug in clean environment, like docker image or so?

kizill avatar Jun 19 '20 22:06 kizill

Sorry, I didn't have any problems when I ran it later. I can't figure out why this happened. It may be a conflict with other packages I loaded. I'm sorry to disturb you.

XianglinZhang-risker avatar Jun 26 '20 15:06 XianglinZhang-risker

Ok, so if you'll reproduce it again, feel free to reopen!

kizill avatar Jun 26 '20 16:06 kizill

Hi,

I'm getting this same error, off a fresh install of catboost. Using the initial example for R.

devtools::install_url('https://github.com/catboost/catboost/releases/download/v0.24.4/catboost-R-Windows-0.24.4.tgz', INSTALL_opts = c("--no-multiarch"))

features <- data.frame(feature1 = c(1, 2, 3), feature2 = factor(c('A', 'B', 'C'))) labels <- c(0, 0, 1) train_pool <- catboost.load_pool(data = features, label = labels)

> version _
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 0.3
year 2020
month 10
day 10
svn rev 79318
language R
version.string R version 4.0.3 (2020-10-10) nickname Bunny-Wunnies Freak Out

actuarial-lonewolf avatar Jan 17 '21 21:01 actuarial-lonewolf

I have the same error, when running Quick start example in fresh install of R 4.0.3 on Win10. "Unsupported column type: character"

install.packages('devtools') devtools::install_url('https://github.com/catboost/catboost/releases/download/v0.24.4/catboost-R-Windows-0.24.4.tgz', INSTALL_opts = c("--no-multiarch"))

library(catboost) features <- data.frame(feature1 = c(1, 2, 3), feature2 = c('A', 'B', 'C') ) labels <- c(0, 0, 1) train_pool <- catboost.load_pool(data = features, label = labels)

Error in catboost.from_data_frame(data, label, pairs, weight, group_id, : Unsupported column type: character

version platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 0.3
year 2020
month 10
day 10
svn rev 79318
language R
version.string R version 4.0.3 (2020-10-10) nickname Bunny-Wunnies Freak Out

(.packages()) [1] "catboost" "stats" "graphics" "grDevices" "utils" "datasets" "methods" "base"

ratesquant avatar Jan 18 '21 18:01 ratesquant

Same error here on a fresh install of catboost on Windows:

sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] catboost_0.24.4

loaded via a namespace (and not attached):
 [1] rstudioapi_0.11   magrittr_2.0.1    usethis_2.0.0     devtools_2.3.2    pkgload_1.1.0     R6_2.4.1          rlang_0.4.8       fansi_0.4.1       tools_4.0.2      
[10] pkgbuild_1.1.0    xfun_0.14         sessioninfo_1.1.1 tinytex_0.23      cli_2.0.2         withr_2.3.0       ellipsis_0.3.1    remotes_2.2.0     yaml_2.2.1       
[19] assertthat_0.2.1  digest_0.6.25     rprojroot_1.3-2   lifecycle_0.2.0   crayon_1.3.4      processx_3.4.5    purrr_0.3.4       callr_3.5.1       fs_1.4.1         
[28] ps_1.3.3          testthat_2.3.2    memoise_1.1.0     glue_1.4.1        compiler_4.0.2    desc_1.2.0        backports_1.1.7   prettyunits_1.1.1 jsonlite_1.7.2   
(.packages())
[1] "catboost"  "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"   "base" 

mm0708 avatar Jan 22 '21 19:01 mm0708

Same error on Ubuntu for last binary version of the R linux package on a clean RStudio session.

if(!require(catboost)){
  if(!require(devtools)){
    install.packages("devtools")
  }
  devtools::install_url(
    'https://github.com/catboost/catboost/releases/download/v0.24.4/catboost-R-Linux-0.24.4.tgz',
    INSTALL_opts = c("--no-multiarch")
  )
}
library(catboost)
features <- data.frame(feature1 = c(1, 2, 3), feature2 = c('A', 'B', 'C'))
labels <- c(0, 0, 1)
train_pool <- catboost.load_pool(data = features, label = labels)

Error in catboost.from_data_frame(data, label, pairs, weight, group_id, : Unsupported column type: character

> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=ca_ES.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=ca_ES.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=ca_ES.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=ca_ES.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] catboost_0.24.4

loaded via a namespace (and not attached):
 [1] rstudioapi_0.13   magrittr_2.0.1    usethis_2.0.1     devtools_2.3.2    pkgload_1.1.0     R6_2.4.1          rlang_0.4.10      fastmap_1.0.1     fansi_0.4.1      
[10] tools_4.0.4       pkgbuild_1.2.0    sessioninfo_1.1.1 cli_2.2.0         withr_2.4.1       ellipsis_0.3.1    remotes_2.2.0     assertthat_0.2.1  rprojroot_2.0.2  
[19] lifecycle_0.2.0   crayon_1.3.4      processx_3.4.5    purrr_0.3.4       callr_3.5.1       fs_1.5.0          ps_1.5.0          testthat_2.3.2    memoise_2.0.0    
[28] glue_1.4.2        cachem_1.0.4      compiler_4.0.4    desc_1.2.0        prettyunits_1.1.1 jsonlite_1.7.2   

Maybe it's related with this :D https://github.com/catboost/catboost/issues/1532#issuecomment-761910175

jrosell avatar Mar 01 '21 11:03 jrosell

Solved here: https://www.kaggle.com/code/jordirosell/r-catboost-example/notebook

jrosell avatar Jan 04 '24 21:01 jrosell