У меня есть вызов и мне нужна помощь. Я делаю свой первый проект по науке о данных, и эта проблема возникает при построении модели. Я продолжаю учебник по edureka (https://www.edureka.co/blog/data-science-projects/), где может возникнуть ошибка из
set.seed(30162)
trnctrl <- trainControl(method="cv", number=10)
boostfit <- train(incomelevel ~ age + educationnum + relationship + workclass +
occupation + relationship + maritalstatus +
hoursperweek + capitalgain + capitalloss +
race + nativecountry,
trcontrol = trnctrl,
method="gbm",
data=trainset,
verbose=FALSE)
Я проверил наличие пропущенных значений в переменной levellevel:
table(complete.cases(trainset$incomelevel))
TRUE
31978
ошибка:
Error in na.fail.default(list(incomelevel = c(1L, 1L, 1L, 1L, 1L, 1L, : missing values in object
``
проблеск (поезд)
Observations: 31,978
Variables: 14
$ age <int> 39, 50, 38, 53, 28, 37, 49, 52, 31, 42, 37, 30, 23, 32, 34, 25, 32, 38, 43, 40, 54, 35, 43, 59,...
$ workclass <fct> State-gov, Self-emp-not-inc, Private, Private, Private, Private, Private, Self-emp-not-inc, Pri...
$ education <fct> Bachelors, Bachelors, HS-grad, 11th, Bachelors, Masters, 9th, HS-grad, Masters, Bachelors, Some...
$ educationnum <int> 13, 13, 9, 7, 13, 14, 5, 9, 14, 13, 10, 13, 13, 12, 4, 9, 9, 7, 14, 16, 9, 5, 7, 9, 13, 9, 10, ...
$ maritalstatus <fct> Never-married, Married-civ-spouse, Divorced, Married-civ-spouse, Married-civ-spouse, Married-ci...
$ occupation <fct> Adm-clerical, Exec-managerial, Handlers-cleaners, Handlers-cleaners, Prof-specialty, Exec-manag...
$ relationship <fct> Not-in-family, Husband, Not-in-family, Husband, Wife, Wife, Not-in-family, Husband, Not-in-fami...
$ race <fct> White, White, White, Black, Black, White, Black, White, White, White, Black, Asian-Pac-Islander...
$ sex <fct> Male, Male, Male, Male, Female, Female, Female, Male, Female, Male, Male, Male, Female, Male, M...
$ capitalgain <int> 2174, 0, 0, 0, 0, 0, 0, 0, 14084, 5178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
$ capitalloss <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2042, 0, 0, 0, 0, 0, 0, 0, 0,...
$ hoursperweek <int> 40, 13, 40, 40, 40, 40, 16, 45, 50, 40, 80, 40, 30, 50, 45, 35, 40, 50, 45, 60, 20, 40, 40, 40,...
$ nativecountry <fct> United-States, United-States, United-States, United-States, Cuba, United-States, Jamaica, Unite...
$ incomelevel <fct> <=50K, <=50K, <=50K, <=50K, <=50K, <=50K, <=50K, >50K, >50K, >50K, >50K, >50K, <=50K, <=50K, <=...