I have a database with the variables: recodedTime_second, OperatorStepLevel, Operator and StepType. There are 11 operators and 16 stepTypes (tasks). The recoded time is the amount of seconds a worker take to do a task each time he is recorded.
I want to do a decision tree that only takes one worker and one step type per time. Also, a confusion to know the accuracy.
I create a database of the worker 10446 doing the steptype AE. I have run:
X10446AE<-transform(X10446AE,Operator=as.character(Operator),StepType=as.character(StepType), OperatorStepLevel=as.integer(OperatorStepLevel),recodedTime_second=as.integer(recodedTime_second),P1P_DateTime=as.POSIXct(P1P_DateTime))
set.seed(100)
tr=sample(1:nrow(X10446AE), round(nrow(X10446AE)*0.7))
train= X10446AE [tr,]
test=X10446AE [-tr,]
arbol_10446AE <- rpart(formula = OperatorStepLevel ~recodedTime_second, data = train)
arbol_10446AE
rpart.plot(arbol_10446AE)
I can not do the prediction and the confusion matrix