Cant understand the code

I am not able to save my data in a CSV format. Kindly help me in saving my predictions in a CSV file

I have used SVM for classification and have divided all the pokemon’s pictures in different folders

hey @adirayer ,
Its really good to see that you have completed the major part of the task.
But please clear me first , that have you trained your model and stuck in submission or you need help in training your model ?

Thank You :slightly_smiling_face:

i am struck in the submission part

the accuracy comes out to be 67%

as you have trained our mode , you just need to predict on test set , the same way you are predicting on train data.
save those predictions in form of a list.

and use pandas to create a dataframe ,

do it as
image_ids = list of image ids in test _set
preds = list of predictions

import pandas as pd
data = pd.DataFrame(list(zip(image_ids,preds)),columns=['ImageId','NameOfPokemon'])
data_to_csv("submission.csv",index=False)

I gues This will do your task a bit.

https://drive.google.com/file/d/1zCbmjpIWFAXUzbu-6pbJmqbv0G8s5XgL/view?usp=sharing please take a look at the code i am still not able to figure out

hey @adirayer ,
have a look at this code link
https://colab.research.google.com/drive/1gMhdnDKmY9pPKC-xleAFagRIY-v4V-j9?usp=sharing

I have just updated your code a bit and also added the submission code.
Hope this helps.

what is wget command? I am not able to use this command it says wget and unzip are not recognised as internal or external command ,also the accuracy come out to be vey low only 25% when i added the submission code to my code. What should I do?

wget and unzip commands are linux commands , hence they wont work on windows.
wget command is used to get files from any link. and unzip is used to extract data from a zip file.

now coming up to accuracy , you have implemented SVM from scratch , so there might be some errors also in implementing it , but if you have a look sklearn SVM implementation then you will find various other different parameters which will be helpful for you to get your task done.

In this way you can achieve good accuracy.
and the submission code is guess correct and working good.

the use of sklearn is prohibited for this challenge so is there any other way to increse accuracy

The SVM is implemented is correct , although you can try playing with learning and number of iterations.
You can also check some articles on internet on how to integrate other sklearn parameters into your code. and also you were currently working with image (32,32) , may be a different size might get your task done.
But the main improvement can be achieved may be by changing the algorithm , as you are working on images , you might get good results using neural networks. They will be really helpful in this. Try that.
and if you haven’t them yet , then don’t worry , keep going in the course , as you get to know about other things and algorithms , the also you can start working on this.

ok thank you will try different algorithms and try to improve the accuracy

Yep That will be good.