Gaussian Naive Bayes

Gaussian naive bayes is not working when I am trying to fit it to my training dataset. It is showing memory error only when I am trying to convert it into array but not when I am calling the method as you can see in picture.

hey @rishitagoel13 ,
can you once try without calling the toarray() function ?

I did try without toarray() function but then it is showing an error ‘convert the vectorized sparse matrix into dense matrix by calling toarray( ) function’.

hey @rishitagoel13 ,
In that case , you need to reduce the dimensions of the data such that it is able to be stored in memory.

Learn about PCA or TSNE to learn reducing dimensionality

But there are only 6 dimensions in the dataset that I am using and only 891 training examples. This is not much i guess.

Sorry not 6, i confused it with other dataset, yeah there are a lot of dimensions. I will try it again using PCA. Is there not any other way with which i can retain all dimensions?

i was suggesting to use PCA on the above array you are creating , because that is raising memory issues.
other option is to buy a much much better computation power notebook , where you can store that in ram. :sweat_smile: :sweat_smile::sweat_smile::sweat_smile::sweat_smile::sweat_smile:… just kidding ignore that.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.