# NOT RUN {
# Predicting the 2 last characters of a dataset using a model with a maximum depth of 5
# The training size is the total number of characters within the dataset minus 2: nchar(pewee) - 2
q <- prediction(pewee, 5, nchar(pewee) - 2)
q
# [[1]]
# [1] 0.56300039 0.05899728 0.37800233
# [[2]]
# [1] 0.08150306 0.76293065 0.15556628
# $Prediction
# [1] "0" "1"
# To access the "Prediction" from result list q:
q[["Prediction"]]
# For custom beta (e.g. 0.8):
prediction(pewee, 5, nchar(pewee) - 10, 0.8)
# }
Run the code above in your browser using DataLab