data(castles.dated)
data(castles.nondated)
stones <- rbind(castles.dated$stones, castles.nondated$stones)
periods <- rbind(castles.dated$periods, castles.nondated$periods)
stones$height <- cut(stones$height, breaks = c(19, 27, 40, 71), include.lowest = TRUE)
stones$width <- cut(stones$width, breaks = c(24, 45, 62, 144), include.lowest = TRUE)
stones$edging <- cut(stones$edging, breaks = c(0, 3, 4, 8), include.lowest = TRUE)
stones$boss <- cut(stones$boss, breaks = c(0, 6, 9, 20), include.lowest = TRUE )
castlesfh <- folderh(periods, "castle", stones)
# Default: dist="l1", crit=1
discdd.predict(castlesfh, "period")
# With the calculation of the confusion matrix and misclassification ratio
discdd.predict(castlesfh, "period", misclass.ratio = TRUE)
# Hellinger distance
discdd.predict(castlesfh, "period", distance = "hellinger")
# crit=2
discdd.predict(castlesfh, "period", crit = 2)
Run the code above in your browser using DataLab