我需要一个热编码为我的分类数据在R。我跟踪了this answer,但似乎one_hot
函数不起作用。甚至,我试图重现的例子提到的答案,但不工作。
install.packages(c("mltools"))
library(mltools)
library(data.table)
给予以下日志:
Installing package into ‘C:/Users/falamiw/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/mltools_0.3.5.zip'
Content type 'application/zip' length 111375 bytes (108 KB)
downloaded 108 KB
package ‘mltools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\falamiw\AppData\Local\Temp\RtmpaSBOFc\downloaded_packages
Warning: package ‘mltools’ was built under R version 4.2.3Registered S3 method overwritten by 'data.table':
method from
print.data.table
data.table 1.14.8 using 2 threads (see ?getDTthreads). Latest news: r-datatable.com
这个虚拟的例子也不起作用:
我不知道问题出在哪里。是从我这边还是包裹那边?
1条答案
按热度按时间qyzbxkaa1#
您可以考虑以下不需要任何包的方法: