C5.0 decision tree - c50 code called exit with value 1

前端 未结 6 1195
再見小時候
再見小時候 2020-12-06 17:38

I am getting the following error

c50 code called exit with value 1

I am doing this on the titanic data available from Kaggle

<
6条回答
  •  情书的邮戳
    2020-12-06 18:11

    For anyone interested, the data can be found here: http://www.kaggle.com/c/titanic-gettingStarted/data. I think you need to be registered in order to download it.

    Regarding your problem, first of I think you meant to write

    new_model <- C5.0(train[,-2],train$Survived)
    

    Next, notice the structure of the Cabin and Embarked Columns. These two factors have an empty character as a level name (check with levels(train$Embarked)). This is the point where C50 falls over. If you modify your data such that

    levels(train$Cabin)[1] = "missing"
    levels(train$Embarked)[1] = "missing"
    

    your algorithm will now run without an error.

提交回复
热议问题