gpt4 book ai didi

r - 插入符号错误 : "all the Accuracy metric values are missing"

转载 作者:行者123 更新时间:2023-12-04 23:45:07 29 4
gpt4 key购买 nike

我收到以下错误,我不知道可能出了什么问题。
我将 R Studio 与适用于 Windows 8.1 的 3.1.3 版 R 一起使用,并使用 Caret 包进行数据挖掘。

我有以下训练数据:
str(training)

'data.frame':   212300 obs. of  21 variables:

$ FL_DATE_MDD_MMDD : int 101 101 101 101 101 101 101 101 101 101 ...

$ FL_DATE : int 1012013 1012013 1012013 1012013 1012013 1012013 1012013 1012013 1012013 1012013 ...

$ UNIQUE_CARRIER : Factor w/ 13 levels "9E","AA","AS",..: 11 10 2 5 8 9 11 10 10 10 ...

$ DEST : Factor w/ 150 levels "ABE","ABQ","ALB",..: 111 70 82 8 8 31 110 44 53 80 ...

$ DEST_CITY_NAME : Factor w/ 148 levels "Akron, OH","Albany, NY",..: 107 61 96 9 9 29 106 36 97 78 ...

$ ROUNDED_TIME : int 451 451 551 551 551 551 551 551 551 551 ...

$ CRS_DEP_TIME : int 500 520 600 600 600 600 600 600 602 607 ...

$ DEP_DEL15 : Factor w/ 2 levels "0","1": 1 2 1 1 1 1 1 2 1 1 ...

$ CRS_ARR_TIME : int 746 813 905 903 855 815 901 744 901 841 ...

$ Conditions : Factor w/ 28 levels "Blowing Snow",..: 2 2 2 2 2 2 2 2 2 2 ...

$ Dew.PointC : num -14.4 -14.4 -14.4 -14.4 -14.4 -14.4 -14.4 -14.4 -14.4 -14.4 ...

$ Events : Factor w/ 10 levels "","Fog","Fog-Rain",..: 1 1 1 1 1 1 1 1 1 1 ...

$ Gust.SpeedKm.h : num NA NA NA NA NA NA NA NA NA NA ...

$ Humidity : int 68 68 71 71 71 71 71 71 71 71 ...

$ Precipitationmm : num NA NA NA NA NA NA NA NA NA NA ...

$ Sea.Level.PressurehPa: num 1021 1021 1022 1022 1022 ...

$ TemperatureC : num -9.4 -9.4 -10 -10 -10 -10 -10 -10 -10 -10 ...

$ VisibilityKm : num 16.1 16.1 16.1 16.1 16.1 16.1 16.1 16.1 16.1 16.1 ...

$ Wind.Direction : Factor w/ 18 levels "Calm","East",..: 9 9 7 7 7 7 7 7 7 7 ...

$ WindDirDegrees : int 320 320 330 330 330 330 330 330 330 330 ...

$ Wind.SpeedKm.h : num 20.4 20.4 13 13 13 13 13 13 13 13 ...

- attr(*, "na.action")=Class 'omit' Named int [1:22539] 3 32 45 87 94 325 472 548 949 1333 ...

.. ..- attr(*, "names")= chr [1:22539] "3" "32" "45" "87" ...

当我执行以下命令时:
ldaModel <- train(DEP_DEL15~.,data=training,method="lda",preProc=c("center","scale"),na.remove=TRUE)

我得到:

Something is wrong; all the Accuracy metric values are missing: Accuracy Kappa
Min. : NA Min. : NA
1st Qu.: NA 1st Qu.: NA
Median : NA Median : NA
Mean :NaN Mean :NaN
3rd Qu.: NA 3rd Qu.: NA
Max. : NA Max. : NA
NA's :1 NA's :1
Error in train.default(x, y, weights = w, ...) : Stopping

最佳答案

这可能是由于具有“0”和“1”级别的结果因子。

发生这种情况时会发出特定警告:At least one of the class levels are not valid R variables names; This may cause errors if class probabilities are generated because the variables names will be converted to: X0, X1"
似乎人们一致忽略警告,所以我打算在下一个版本中抛出一个错误。

关于r - 插入符号错误 : "all the Accuracy metric values are missing",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30475723/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com