MICP_3 - ntihindukkipati/CS5590_Python_DL GitHub Wiki

MICP_3


1. In the code provided, there are three mistakes that stop the code from running successfully. find those mistakes and explain why they need to be corrected to be able to get the code run.
Errors that I have faced are
1.Tensorflow version error
2.Input_dimension in our case it is 2000
3. Neuron in the last layer is 3 because we have 3 for prediction (pos, neg, unsup)
4.activation function I have used softmax as it is giving better accuracy
As far I have learned softmax gives good accuracy than other activation functions
![Screenshot (546)](https://user-images.githubusercontent.com/54405951/79029246-2ddd3900-7b59-11ea-8cc0-d063981a5cc3.png)

2. Add embedding layer to the model, did you experience any improvement?
ANS:
The accuracy got decreased but in the previous model it got overfit but when I have added embedded layer the accuracy and validation accuracy are at the same point which means it got underfit.
Screenshot (547) Screenshot (548)

3. Apply the code on 20_newsgroup data set we worked in the previous classes
From sklearn. datasets import fetch_20newsgroups
newsgroups_train =fetch_20newsgroups (subset='train', shuffle=True, categories = categories,)
Screenshot (549) Screenshot (550)

4.Plot the loss and accuracy using history object
Screenshot (551)

*Bonus


Question
1. Predict over one sample of data and check what will be the prediction for that.

Screenshot (552)

2.Plot loss and accuracy in Tensorboard.
Screenshot (552) Screenshot (544) Screenshot (545)

⚠️ **GitHub.com Fallback** ⚠️