我已经完成了将字符替换为字符的练习,
library(caret)
library(dslabs)
set.seed(1)
data("mnist_27")
models <- c("glm", "lda", "naive_bayes", "svmLinear",
"gamboost", "gamLoess", "qda",
"knn", "kknn", "loclda", "gam",
"rf", "ranger", "wsrf", "Rborist",
"avNNet", "mlp", "monmlp",
"adaboost", "gbm",
"svmRadial", "svmRadialCost", "svmRadialSigma")
fits <- lapply(models, function(model){
print(model)
train(y ~ ., method = model, data = mnist_27$train)
})
names(fits) <- models
fits_predicts <- sapply(fits, function(fits){ predict(fits,mnist_27$test)
})
然后我像这样进行解密:
Cat xxxxxx | tr [a-z] [d-zabc] | tr [A-Z] [D-ZABC] > xxxxxx_cesar
并且效果很好,然后我尝试用字符替换元音,加密有效,而解密无效。
加密:
Cat xxxxxx | tr [d-zabc] [a-z] | tr [D-ZABC] [A-Z] > xxxxxx_cesar
解密:
Cat xxxxxx | tr [aeiou] [:_,.-] | tr [AEIOU] [:_,.-] > xxxxxx_sustitu