PokemonGoers / PredictPokemon-2

In this project we will apply machine learning to establish the TLN (Time, Location and Name - that is where pokemons will appear, at what date and time, and which Pokemon will it be) prediction in Pokemon Go.
Apache License 2.0
9 stars 3 forks source link

No predictions returned #84

Closed jonas-he closed 7 years ago

jonas-he commented 7 years ago

@bensLine So I downloaded the new package and ran the testPrediction.js (with url to local API). It seems like there are 0 predictions returned now (thus the TypeError). Before the change I think there were results since it printed something with confidence and so on.

2016-12-28T12:14:32.845Z downloaded 10000 sightings from API
2016-12-28T12:14:32.845Z filtered data, new length 10000
2016-12-28T12:15:04.979Z train classifier model, arff file creation took 36531
java -classpath C:\Users\joniu\Desktop\poke\node_modules\predict-pokemon\data\we
ka.jar -Xmx1024m weka.classifiers.meta.Vote -S 1 -B "weka.classifiers.lazy.IBk -
K 100 -W 0 -A \"weka.core.neighboursearch.LinearNNSearch -A \\\"weka.core.Euclid
eanDistance -R first-last\\\"\"" -B "weka.classifiers.bayes.BayesNet -D -Q weka.
classifiers.bayes.net.search.local.K2 -- -P 1 -S BAYES -E weka.classifiers.bayes
.net.estimate.SimpleEstimator -- -A 0.5" -R PROD -no-cv -v -classifications "wek
a.classifiers.evaluation.output.prediction.Null" -t C:\Users\joniu\Desktop\poke\
node_modules\predict-pokemon\data\trainingData.arff -d C:\Users\joniu\Desktop\po
ke\node_modules\predict-pokemon\data\classifier2.model
2016-12-28T12:15:04.984Z created classifier model, training took 36536
Error: no cooc data
2016-12-28T12:15:05.653Z prediction took 668
2016-12-28T12:15:06.574Z prediction took 579
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:07.566Z prediction took 554
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:08.544Z prediction took 516
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:09.577Z prediction took 533
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:10.601Z prediction took 540
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:11.605Z prediction took 526
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:12.610Z prediction took 523
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:13.623Z prediction took 523
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:14.665Z prediction took 547
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:15.674Z prediction took 538
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:16.683Z prediction took 531
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:17.699Z prediction took 529
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:18.790Z prediction took 602
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:19.771Z prediction took 567
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:20.750Z prediction took 529
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:21.791Z prediction took 552
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:22.806Z prediction took 549
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:23.813Z prediction took 539
Error: TypeError: Cannot read property 'confidence' of undefined
2016-12-28T12:15:24.852Z prediction took 562
Error: TypeError: Cannot read property 'confidence' of undefined
bensLine commented 7 years ago

First, sorry for the long response time. but I'm currently on holidays and have only occasionally access to internet and a pc...

Yes, the test file doesn't handle the case when no predictions are returned. That happens in this case because there is no data available to cretae the classifier as the URL returns none.

However, there is now some mock data to test predictions without using the sightings from the URL.

if you get the error Error: no cooc data then zou requested predictions before the classifier was created (which will be the case in the testPrediction.js file for the first few predictions due to simplicity). If you get an error that "weka cannot find the classifer.model" the reason is the same.