kernlab

Why are probabilities and response in ksvm in R not consistent?

喜欢而已 提交于 2019-11-29 09:36:23
I am using ksvm from the kernlab package in R to predict probabilities, using the type="probabilities" option in predict.ksvm . However, I find that sometimes using predict(model,observation,type="r") yields not the class with the highest probability given by predict(model,observation,type="p") . Example: > predict(model,observation,type="r") [1] A Levels: A B > predict(model,observation,type="p") A B [1,] 0.21 0.79 Is this correct behavior, or a bug? If it is correct behavior, how can I estimate the most likely class from the probabilities? Attempt at reproducible example: library(kernlab)

Assign new data point to cluster in kernel k-means (kernlab package in R)?

半城伤御伤魂 提交于 2019-11-28 07:41:01
I have a question about the kkmeans function in the kernlab package of R. I am new to this package and please forgive me if I'm missing something obvious here. I would like to assign a new data point to a cluster in a set of clusters that were created using kernel k-means with the function 'kkmeans'. With regular clustering, one would do this by calculating the Euclidian distance between the new data point and the cluster centroids, and choose the cluster with the closest centroid. In kernel k-means, one must do this in the feature space. Take the example used in the kkmeans description: data

Assign new data point to cluster in kernel k-means (kernlab package in R)?

断了今生、忘了曾经 提交于 2019-11-27 01:56:20
问题 I have a question about the kkmeans function in the kernlab package of R. I am new to this package and please forgive me if I'm missing something obvious here. I would like to assign a new data point to a cluster in a set of clusters that were created using kernel k-means with the function 'kkmeans'. With regular clustering, one would do this by calculating the Euclidian distance between the new data point and the cluster centroids, and choose the cluster with the closest centroid. In kernel