0

I am working with C50 package and I can not execute the algorithm, for now the two basic thing: dataset without nulls and factor for variable 'credit$default'. I am wondering what is wrong.

The message after executing this code is:

c50 code called exit with value 1

Code:

library(gmodels)
library(readr)
library(dplyr)
library(class)
library(C50)

# Step 1: Get the data
url_data <- "https://raw.githubusercontent.com/pakinja/Data-R-Value/master/MachineLearning_C5.0_Classification_Algorithm/credit.csv"
 credit <- read_csv(url(url_data))

 # Step 2: Exploring and preparing the data
 credit$default[credit$default == 1] <- "no"
 credit$default[credit$default == 2] <- "yes"
 credit$default <- as.factor(credit$default)


 # Creating Random test
 set.seed(123)
 train_sample <- sample(1000,900)
 str(train_sample)

 credit_train <- credit[train_sample,]
 credit_test <- credit[-train_sample,]

 prop.table(table(credit_test$default))
 prop.table(table(credit_train$default))

# Step 3: Training a model on the data
credit_model <- C5.0(credit_train[,-17], credit_train$default, trials = 1, 
rules = FALSE)
summary(credit_model)
A89
  • 89
  • 9
  • Have you seen [C5.0 decision tree - c50 code called exit with value 1](https://stackoverflow.com/q/22803310/4752675) ? – G5W Oct 09 '18 at 23:39
  • Yes, thank you, I have already checked it. My main concern (in this moment) is that something has changed in the C5.0 algorithm, because my example is from a book (2015) and I saw this example in other blogs... but all the posts that I found are from 2 years ago. – A89 Oct 09 '18 at 23:58
  • Did you try `summary(credit$default)` ? Are there NAs? – G5W Oct 10 '18 at 00:02
  • Thank you for your answer, but no, there is no NAs. – A89 Oct 10 '18 at 01:40

0 Answers0