How to save caret trained models so that it can be used later for building ensemble models in RStudio?
Related
I would like to generate random data using R or RStudio for a distribution with function as below from scratch. How do I develop the codes. I am new to this type of models.
I tried to build a pre-trained core-ml model with the help of create ML framework, but the model created is not updatable, Is there a way to create a pre-trained core-ml model which can be updated on the device itself (newly introduced feature in Core-ML 3) ?
Not directly with Create ML, you'll have to use coremltools to make the model updatable. See here for examples: https://github.com/apple/coremltools/tree/main/examples
However... this will only work for neural networks and k-nearest neighbors models. Create ML does not actually produce these kinds of models (at the moment).
For example, an image classifier trained with Create ML is a GLM on top of a fixed neural network. You cannot make GLM models updatable at this point.
So in short, no, you can't make models trained with Create ML updatable.
I usually use R to make my own statistical models based on data that I have.
However, I have recently read about a logistic regression model in a scientific publication and I want to replicate this model to make predictions on some of my own data, which includes the same variables.
Is there a way to "declare" a model in R, based on the coefficients published in the paper?
The R package tfestimators (https://tensorflow.rstudio.com/tfestimators/) lists several canned estimators currently available:
linear_regressor() Linear regressor model.
linear_classifier() Linear classifier model.
dnn_regressor() DNN Regression.
dnn_classifier() DNN Classification.
dnn_linear_combined_regressor() DNN Linear Combined Regression.
dnn_linear_combined_classifier() DNN Linear Combined Classification.
There is mention of SVMs and random forests "coming soon". Does anyone know of a way to implement SVMs and random forests in tensorflow through R at this time?
Thanks very much!
I've been using the caret package in R to run some boosted regression tree and random forest models and am hoping to generate prediction intervals for a set of new cases using the inbuilt cross-validation routine.
The trainControl function allows you to save the hold-out predictions at each of the n-folds, but I'm wondering whether unknown cases can also be predicted at each fold using the built-in functions, or whether I need to use a separate loop to build the models n-times.
Any advice much appreciated
Check the R package quantregForest, available at CRAN. It can easily calculate prediction intervals for random forest models. There's a nice paper by the author of the package, explaining the backgrounds of the method. (Sorry, I can't say anything about prediction intervals for BRT models; I'm looking for them by myself...)