saraswatmks / superml

Build machine learning models in R like using python's scikit-learn library
https://saraswatmks.github.io/superml/
GNU General Public License v3.0
32 stars 8 forks source link

GrideSearchCV() with lssvm #58

Open Navien2 opened 1 year ago

Navien2 commented 1 year ago

Kindly , I tried use this package with LSSVM , but could not do it, please could you help ? Can I add the lssvm file to this project from :

add lssvm to this part of the code available_trainers = c("XGBTrainer", "RFTrainer", "NBTrainer"),

https://github.com/cran/kernlab/blob/master/R/lssvm.R ??

Navien2 commented 1 year ago

Can I add the lssvm file to this project.

saraswatmks commented 1 year ago

@Navien2 Why not use that package directly? I am trying to understand your usecase to add it to this project?

Navien2 commented 1 year ago

You have the GridesearchCV() code in R in this part in Github: https://github.com/saraswatmks/superml/blob/master/R/GridSearch.R but your code does not work with ( LSSVM( least square support vector machine) no such classifier file in your code files .

I have LSSVM code in R from https://github.com/cran/kernlab/blob/master/R/lssvm.R i add it to your code files but had errors ???? Please could you help me with it

saraswatmks commented 1 year ago

@Navien2 Ok, I'll try to add it this week to this package. Will update you soon. Regards.

saraswatmks commented 1 year ago

@Navien2 could you provide me a working example of lssvm model? I tried the following code but it throws error.

library(kernlab)

iris <- unique(iris)

rbf <- rbfdot(0.5)

k <- kernelMatrix(rbf, as.matrix(iris[,-5]))

klir <- lssvm(k, iris[, 5], type='classification', kernel='matrix')

# Error in type(ret) <- match.arg(type, c("classification", "regression")) : 
#     could not find function "type<-"
Navien2 commented 1 year ago

Dear Manish, I hope you are doing well. could you fix the issue with LSSVM ? best

On Tue, Oct 10, 2023 at 7:58 AM Manish Saraswat @.***> wrote:

@Navien2 https://github.com/Navien2 could you provide me a working example of lssvm model? I tried the following code but it throws error.

library(kernlab)

iris <- unique(iris)

rbf <- rbfdot(0.5)

k <- kernelMatrix(rbf, as.matrix(iris[,-5]))

klir <- lssvm(k, iris[, 5], type='classification', kernel='matrix')

Error in type(ret) <- match.arg(type, c("classification", "regression")) :

could not find function "type<-"

— Reply to this email directly, view it on GitHub https://github.com/saraswatmks/superml/issues/58#issuecomment-1754372505, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGI2VKZA7Z3PIF733VUFAA3X6TIWPAVCNFSM6AAAAAA5MTOM56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJUGM3TENJQGU . You are receiving this because you were mentioned.Message ID: @.***>