Closed WojciechKretowicz closed 4 years ago
Thanks. Good ideas. I am not sure about the second one (not data frame = tibble or data.table)?.
You can pass data
as an object that do not have function nrow()
. Then if you provided y
you get the error from this if statement, because nrow(data)
is NULL
.
if (length(y) != nrow(data)) {
verbose_cat(" -> target variable : length of 'y' is different than number of rows in 'data' (",color_codes$red_start,"WARNING",color_codes$red_end,") \n", verbose = verbose)
}
Check that were implemented
data
is null while weights are not. data
is null while y
is provided.predict_function
is function
class objectresidual_function
is function
class objectlabel
is character
class object and conversion if not.I decided not to implement that proposed check:
data
is not a data frame while y
is provided.as it is not necessary for data
to be data.frame. It can be matrix or tbl in some applications.
Thanks
In explain.R are some not described input errors. If you pass them to explain(), you will get the nondescriptive error:
data
is null while weights are not.data
is not a data frame whiley
is provided.data
is null whiley
is provided.