Re: [R] help! kennard-stone algorithm in soil.spec packages does not work for my dataset!!!
Hi all Certainly there are some problems with the ken.sto function. In addition there are some considerations that need to be taken into account before using this code. For instance, it projects the data onto a principal component space prior sampling. In this case is necessary to check if a PCA is really necessary. Second, this function uses the Euclidean distance (ED) as metric for selecting the samples. By using the ED directly on the PCs, the PCs with high explained variance will “dominate” the measurements. In this case is better to standardize the PCs prior ED computation or use the Mahalanobis distance. Whatever, I have modified the “ken.sto” code and now seems to be that it works correctly. If some of you still need it just drop me an e-mail. Regards, Leonardo Ramirez-Lopez, Researcher Georges Lemaître Centre for Earth and Climate Research Earth and Life Institute Université Catholique de Louvain, 3 Place Louis Pasteur 1348, Louvain la Neuve Belgium e-mail: leonardo.rami...@uclouvain.be http://www.uclouvain.be/en-teclim.html Ph.D Researcher Physical Geography and Soil Science Institute of Geography University of Tübingen Rümelinstr. 19-23 72070 Tübingen Germany http://www.geographie.uni-tuebingen.de/ -- View this message in context: http://r.789695.n4.nabble.com/help-kennard-stone-algorithm-in-soil-spec-packages-does-not-work-for-my-dataset-tp3031344p4306703.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help! kennard-stone algorithm in soil.spec packages does not work for my dataset!!!
I'm also trying to use the kennard-stone algorithm in the soil.spec package for my dataset, (to generate a training and test set from the data, based on this algorithm, because it's the most commonly used and well-performing algorithm in QSAR studies) but it's generating an error: ken.sto(mydataIN) Error in ken.sto(mydataIN) : subscript out of bounds My data is a 42 row by 6 column all numerical (except header) matrix of the format: id x1 x2 x3 x4y1 2 66.77.710.079 4.58 3.0792 13 79.79.570.100 4.82 2.8451 5 77.73.100.071 1.42 0.4771 6 82.17.580.071 2.08 0.7160 32 98.85.600.143 3.27 1.7160 36 93.34.740.097 4.16 1.7160 ... I cannot find any documentation for the exact format of the data matrix for this function (http://www.inside-r.org/packages/cran/soil.spec/docs/ken.sto does not have this information). Any help would be appreciated!!! -- View this message in context: http://r.789695.n4.nabble.com/help-kennard-stone-algorithm-in-soil-spec-packages-does-not-work-for-my-dataset-tp3031344p3670857.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help! kennard-stone algorithm in soil.spec packages does not work for my dataset!!!
http://r.789695.n4.nabble.com/file/n3032045/rsv1.txt rsv1.txt I am very grateful to David's suggestion, here , I upload my dataset rsv1.txt, also the question, ks-ken.sto(rsv1,per=TRUE,per.n=0.3,va=FALSE,sav=FALSE) it does not work, all results are NULL, i do not known why it is ? hope, friends can give me a hand! thanks kevin -- View this message in context: http://r.789695.n4.nabble.com/help-kennard-stone-algorithm-in-soil-spec-packages-does-not-work-for-my-dataset-tp3031344p3032045.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] help! kennard-stone algorithm in soil.spec packages does not work for my dataset!!!
http://r.789695.n4.nabble.com/file/n3031344/RSV.Rdata RSV.Rdata I want to split my dataset to training set and test set using kennard-stone(KS) algorithm, it is lucky there is R packages soil.spec to implement it. but when I used it to my dataset, it does not work, who can help me, how reasons is it, below, it is my code, and my data in the attachment. ks-ken.sto(x,per=TRUE,per.n=0.3,va=FALSE,sav=FALSE) ks % results $`Chosen sample names` NULL $`Chosen row number` integer(0) $`Chosen calibration sample names` [1] NULL $`Chosen calibration row number` [1] NULL $`Chosen validation sample names` [1] NULL $`Chosen validation row number` [1] NULL attr(,class) why it is all NULL ? and ks-ken.sto(x,per=TRUE,per.n=0.3,va=TRUE,sav=FALSE) Error in val.min[i] - blub[sample(length(blub), 1)] : replacement has length zero In addition: Warning message: In min(prco[-cal.start.n, i]) : no non-missing arguments to min; returning Inf if I set va=TRUE, appearing the errors. I hope some friends can help me ! -- View this message in context: http://r.789695.n4.nabble.com/help-kennard-stone-algorithm-in-soil-spec-packages-does-not-work-for-my-dataset-tp3031344p3031344.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help! kennard-stone algorithm in soil.spec packages does not work for my dataset!!!
On Nov 7, 2010, at 6:53 PM, bbslover wrote: http://r.789695.n4.nabble.com/file/n3031344/RSV.Rdata RSV.Rdata I want to split my dataset to training set and test set using kennard-stone(KS) algorithm, it is lucky there is R packages soil.spec to implement it. but when I used it to my dataset, it does not work, who can help me, how reasons is it, below, it is my code, and my data in the attachment. No attachment, athough partial credit for making the effort. Most probable cause... failing to read Posting Guide. -- David. ks-ken.sto(x,per=TRUE,per.n=0.3,va=FALSE,sav=FALSE) ks % results $`Chosen sample names` NULL $`Chosen row number` integer(0) $`Chosen calibration sample names` [1] NULL $`Chosen calibration row number` [1] NULL $`Chosen validation sample names` [1] NULL $`Chosen validation row number` [1] NULL attr(,class) why it is all NULL ? and ks-ken.sto(x,per=TRUE,per.n=0.3,va=TRUE,sav=FALSE) Error in val.min[i] - blub[sample(length(blub), 1)] : replacement has length zero In addition: Warning message: In min(prco[-cal.start.n, i]) : no non-missing arguments to min; returning Inf if I set va=TRUE, appearing the errors. David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.