Adaboost Implementation (obtaining weak classifier functional form in R) - r

I am trying to use Adaboost in CRAN-R for a classification problem. I cannot find any R packages that actually output the weak classifier functional form (ex. hi(x) * I (Y > z) that i could then program as a scoring algorithm. Can anyone help point me to a package that could provide these functions / coefficients? Thanks!

Related

R - Non-linear optimization algorithm - linear objective function with binary variables

I have an optimization problem with the following characteristics :
Linear objective function with binary variables (only)
Non-linear constraints.
I am looking for an adapted algorithm in R. Any ideas?
When I have the same optimization problem but with linear constraints, I use the ROI:: suite with the Multiple Solution Binary Linear Problem plugin: ROI.plugin.msbinlp. I am checking out the Rsolnp package but I am yet unable to constraint the solution to integer/binary variables.
Any idea would be very much appreciated. Thank you in advance!

F-score for model selection in e1071 package in R

I am using svm classifier for multiple classes. So far i did not have a problem. The best method is calculated based on accuracy in training data. However I would like to select best method based on F score which is
F1 = 2 * Precision * Recall / Precision + Recall
I am guessing i have to use error.fun in tune.control but i do not know how to do it.
I know in caret package it is easy but i need to use e1071 package.
Any idea would be appreciated well.

Adaboosting in R with any classifier

There is an implementation of AdaBoosting algorithm in R. See this link, the function is called boosting.
The problem is that this package uses classification trees as a base or weak learner.
Is that possible to substitute the original weak learner to any other (e.g., SVM or Neural Networks) using this package?
If not, are there any examples of AdaBoosting implementation in R?
Many thanks!

R. How to boost the SVM model

I have made SVM model using SVM package in R for a classification problem. I got only 87% accuracy. But random forest produces around 92.4%.
fit.svm<-svm(modelformula, data=training, gamma = 0.01, cost = 1,cross=5)
Would like to use boosting for tuning this SVM model. Can someone will help me to tune this SVM model?
What are the best parameters I can provide for SVM method?
Example for booting for SVM model.
To answer your first question.
The e1071 library in R has a built-in tune() function to perform CV. This will help you select the optimal parameters cost, gamma, kernel. You can also manipulate a SVM in R with the package kernlab. You may get different results from the 2 libraries. Let me know if you need any examples.
You may want to look into the caret package. It allows you to both pick various kernels for SVM (model list) and also run parameter sweeps to find the best model.

How to use a glmnet model as a node model for the mob function (of the R package party)?

I am using the mob function of the R package party. My question concerns the model parameter of this function.
How can I define a StatModel object (from the package modeltools) - let's call it glmnetModel - so that the nodes models of the mob estimation are glmnet models (more precisely I would like to use the cv.glmnet function as the main estimation function in the fit slot of glmnetModel) ?
One difficulty is to extend correctly the reweight function (and maybe the estfun and deviance functions ?) like it is suggested here (section 2.1).
Anybody has an idea ?
NB : I have seen some extensions (for SVM : here) but I am not able to use them correctly.
Thank you very much !
Dominique
I'm not sure whether the inferential framework of the parameter instability tests in the MOB algorithm holds for either glmnet or svm.
The assumption is that the model's objective function (e.g., residual sum of squares or log-likelihood) is additive in the observations and that the corresponding first order conditions are consequently additive as well. Then, under certain weak regularity conditions, a central limit theorem holds for the parameter estimates. This can be extended to a functional central limit theorem upon which the parameter instability tests in MOB are based.
If these assumptions do not hold, the p-values may not be valid and hence may lead to too many or too few splits or a biased splitting variable selection. Whether or not this happens in practice for the models you are interested in, I don't know. You would have to check this - either theoretically (which may be hard) or in simulation studies.
Technically, the reimplementation of mob() in the partykit package makes it much easier to plug in new models. A lot less glue code (without S4 classes) is necessary now. See vignette("mob", package = "partykit") for details.

Resources