(Spark-ml) java.util.NosuchElementException: key not found exception on doing prediction and computing test error.
Thanks. Its working now. My test data had some labels which were not there in training set. On Wednesday, June 28, 2017, Pralabh Kumar > wrote: > Hi Neha > > This generally occurred when , you training data set have some value of > categorical variable ,which in not there in your testing data. For e.g you > have column DAYS ,with value M,T,W in training data . But when your test > data contains F ,then it say no key found exception . Please look into > this , and if that's not the case ,then Could you please share your code > ,and training/testing data for better understanding. > > Regards > Pralabh Kumar > > On Wed, Jun 28, 2017 at 11:45 AM, neha nihal > wrote: > >> >> Hi, >> >> I am using Apache spark 2.0.2 randomforest ml (standalone mode) for text >> classification. TF-IDF feature extractor is also used. The training part >> runs without any issues and returns 100% accuracy. But when I am trying to >> do prediction using trained model and compute test error, it fails with >> java.util.NosuchElementException: key not found exception. >> Any help will be much appreciated. >> >> Thanks >> >> >
Re: (Spark-ml) java.util.NosuchElementException: key not found exception on doing prediction and computing test error.
Hi Neha This generally occurred when , you training data set have some value of categorical variable ,which in not there in your testing data. For e.g you have column DAYS ,with value M,T,W in training data . But when your test data contains F ,then it say no key found exception . Please look into this , and if that's not the case ,then Could you please share your code ,and training/testing data for better understanding. Regards Pralabh Kumar On Wed, Jun 28, 2017 at 11:45 AM, neha nihal wrote: > > Hi, > > I am using Apache spark 2.0.2 randomforest ml (standalone mode) for text > classification. TF-IDF feature extractor is also used. The training part > runs without any issues and returns 100% accuracy. But when I am trying to > do prediction using trained model and compute test error, it fails with > java.util.NosuchElementException: key not found exception. > Any help will be much appreciated. > > Thanks > >
Fwd: (Spark-ml) java.util.NosuchElementException: key not found exception on doing prediction and computing test error.
Hi, I am using Apache spark 2.0.2 randomforest ml (standalone mode) for text classification. TF-IDF feature extractor is also used. The training part runs without any issues and returns 100% accuracy. But when I am trying to do prediction using trained model and compute test error, it fails with java.util.NosuchElementException: key not found exception. Any help will be much appreciated. Thanks
(Spark-ml) java.util.NosuchElementException: key not found exception on doing prediction and computing test error.
Hi, I am using Apache spark 2.0.2 randomforest ml (standalone mode) for text classification. TF-IDF feature extractor is also used. The training part runs without any issues and returns 100% accuracy. But when I am trying to do prediction using trained model and compute test error, it fails with java.util.NosuchElementException: key not found exception. Any help will be much appreciated. Thanks & Regards