Neural Network in Python using Keras|How to implement a basic neural network in python using keras

  Рет қаралды 18,824

Unfold Data Science

Unfold Data Science

Күн бұрын

Пікірлер: 120
@jaypatel731
@jaypatel731 3 жыл бұрын
I think accuracy is good considering very less numbers of examples are available in Training sets. In practical scenario, KNN, XGboost or Decision tree could be more useful.
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Good Observation Jay.
@seekingthat330
@seekingthat330 2 жыл бұрын
Thanks Aman Excellent tutorial! May I know why the neurons for the internal layer was chosen as 12 when the inputs were 8 ? input_dim and neurons for hidden layer were chosen as 8. Does it help to have the neurons higher than the inputs ? Is it recommended to have neurons higher than input_dim by a certain percentage ? Thanks
@franciscoac4717
@franciscoac4717 5 ай бұрын
The author of the video does not explain this part well. I think that this line of code (which the author comments as "First Hidden Layer") is actually two layers: an input one with 8 neurons and a hidden one with 12 neurons. In any case, it remains to be seen why he used 12 and not 5, 14, 17 or some other amount. Did you research anything about it?
@ashwinikumar6461
@ashwinikumar6461 Жыл бұрын
Quite awesome and Wonderful tutorial.. god bless.. Can you pls tell me why you are using ' _ , ' ( underscore and comma ) in the Train Accuracy alone and not in test accuracy...
@ramar5558
@ramar5558 Жыл бұрын
Aman in the comments everybody is asking about why you have taken 12 neuron on what basis any rule ????
@rashidaka4314
@rashidaka4314 Жыл бұрын
Thank you so much. It was a good class. 👌😊
@UnfoldDataScience
@UnfoldDataScience Жыл бұрын
You're welcome 😊
@murapakaganesh1108
@murapakaganesh1108 2 жыл бұрын
Hi aman i followed you recently , your videos also very good compare than where I have been learning data science ..in my opinion it is healthcare business case problem so we need to have a high accuracy here how we will do hyper parameter tuning please
@UnfoldDataScience
@UnfoldDataScience 2 жыл бұрын
All the best Ganesh.
@veerababun9312
@veerababun9312 4 жыл бұрын
Hi Aman, got the 80% accuracy by using k-fold cross validation # Constants num_folds = 10 num_instances = len(x) seed = 42 from sklearn.model_selection import KFold cv = KFold(n_splits=10, random_state=42, shuffle=False) cvscores = [] for train_index, test_index in cv.split(x): X_train, X_test, y_train, y_test = x[train_index], x[test_index], y[train_index], y[test_index] # Fit the model model.fit(X_train, y_train, nb_epoch=150, batch_size=10, verbose=2) # evaluate the model scores = model.evaluate(X_test, y_test, verbose=0) print("%s: %.2f%%" % (model.metrics_names[1], scores[1]*100)) cvscores.append(scores[1] * 100) print("Keras: %.2f%% (+/- %.2f%%)" % (np.mean(cvscores), np.std(cvscores))) accuracy: 68.83% accuracy: 83.12% accuracy: 75.32% accuracy: 76.62% accuracy: 79.22% accuracy: 79.22% accuracy: 85.71% accuracy: 84.42% accuracy: 81.58% accuracy: 89.47% Keras: 80.35% (+/- 5.59%)
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
ok. Goo to see your commitment.
@sandipansarkar9211
@sandipansarkar9211 3 жыл бұрын
great explanation
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Thank you.
@AbhiAnuP-fp5vp
@AbhiAnuP-fp5vp 6 ай бұрын
Hi, can a similar video on Caffe2 be shared? It would be useful
@umeshtiwari800
@umeshtiwari800 2 жыл бұрын
Good
@surafelm.w4058
@surafelm.w4058 4 жыл бұрын
Hi, how to normalize gridded datasets (X1 and X2) for neural network in python and split as training and testing set?
@harshyadav1428
@harshyadav1428 6 ай бұрын
sir i want to make a graphical neural network model on node classification without using ML libraries from scratch by using loops please make video on it
@milanpatel6240
@milanpatel6240 3 жыл бұрын
Thanks Aman. Very good video. Can you explain me why in the 2nd layer you choose 8 neurons(unit size)? Is it because we have 8 inputs?
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Thanks Milan. Yes.
@jawadali4392
@jawadali4392 2 жыл бұрын
In my opinion this model can attain more accuracy. this model is neither good nor bad. Sir kindly tell us how to insert a pictures tensors into this model and classify it. love from pakistan.
@UnfoldDataScience
@UnfoldDataScience 2 жыл бұрын
pictures tensors - do you want to classify pictures?
@jawadali4392
@jawadali4392 2 жыл бұрын
Yes sir
@anirbansarkar6306
@anirbansarkar6306 3 жыл бұрын
Thanks Aman for this great video. I have a doubt although from my side.Why 'relu' as an activation funtion avoids the exploding/vanishing gradient problem? Sorry if I missed your explanation somewhere else (in this case, please refer me that video).
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Relu property is like that, please watch my playlist on neural network u will find a video explaining it.
@ashwinikumar6461
@ashwinikumar6461 Жыл бұрын
Further in continuation to my previous comment, Iam getting A error in the test accuracy code , where it is showing " model is not defined' and hence , would you mind in sharing the exact code link which is used in he video
@ShaidaMuhammad
@ShaidaMuhammad 4 жыл бұрын
Sir I request you to make these videos in PyTorch, because KZbin has a lot of Keras videos. PyTorch are very little.
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Thank you for your suggestion. Noted.
@ioogg2dulce
@ioogg2dulce 4 жыл бұрын
Hi, very well explained! I have a question, can we train a neural network to classify a dataset which doesn't have targets?
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Training can not happen without target. Predictions can happen without target.
@ioogg2dulce
@ioogg2dulce 4 жыл бұрын
Unfold Data Science I watched your tutorial about hotel reviews classifier and I succeeded to predict on new data! Great job! Thank you very much!
@ioogg2dulce
@ioogg2dulce 4 жыл бұрын
very well explained!!! keep on with the good work!
@sarwatfawwad
@sarwatfawwad Жыл бұрын
I am facing problem in uploading keras model. I have also use tensflow to remove error but it is not working
@AlgoTribes
@AlgoTribes 4 жыл бұрын
I think without doing any sort of tuning to the model and not doing any sort of cleaning of the data before feeding to the model which could be done..i believe the model is doing good with regards to the accuracy metric..😀😀..F1-score probably will give the more clear picture..do correct me if am wrong in assuming this..👍👍
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Yes. up to the point
@sivaram.k5767
@sivaram.k5767 7 ай бұрын
How to perform abolone age prediction in neural network model sir
@AmithG-cw1rw
@AmithG-cw1rw 2 жыл бұрын
sir where is the actual model like equation and the plot of ANN how to do it
@Data_In_real_world
@Data_In_real_world 2 жыл бұрын
hello sir its a big kind request please help me .. i need to find weights of all independent VARIABLES of my dataset. how can get the weights which have resulted in my output.
@nazerinnazeer5941
@nazerinnazeer5941 3 жыл бұрын
Hi sir, great class i have an doubt why u choose 12 neurons in the first layer. Is it any reason?
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Same as number of input features.
@naveedtaimoor4007
@naveedtaimoor4007 2 жыл бұрын
@@UnfoldDataScience but input features are just 8 as you discussed in video
@dileepkonkena2319
@dileepkonkena2319 Жыл бұрын
we can't check accuracy in classification based on accuracy, we need to consider precision,recall,f1 also
@aomo5293
@aomo5293 2 жыл бұрын
Hello, Thank you for this tutorial, what kind of function that we should use in case we have multiclass ? Not binary ? Thank you
@engr.simeonstevensonturay61
@engr.simeonstevensonturay61 Жыл бұрын
In that case, you can use categorical cross entropy
@PILAKAREDDY
@PILAKAREDDY Жыл бұрын
Hi Aman ,y_pred=model.predict_classes(x) i have error as no model has been created
@UnfoldDataScience
@UnfoldDataScience Жыл бұрын
check model creation step again
@srirangasuprabhathkoduru1021
@srirangasuprabhathkoduru1021 2 жыл бұрын
Can we manually specify the weight initialisation method?
@UnfoldDataScience
@UnfoldDataScience 2 жыл бұрын
There are techniques we can use
@muhammedthayyib9202
@muhammedthayyib9202 2 жыл бұрын
If use scalar, It would be a good model.
@maryjasmine6767
@maryjasmine6767 4 жыл бұрын
This model is like classification.. How to do this for a regression model..?? Is it possible for using neural network for regression model problems.??
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Hi Mary, yes it is possible, we need to have a "linear" or "relu" activation function in output layer.
@maryjasmine6767
@maryjasmine6767 4 жыл бұрын
@@UnfoldDataScienceThank u so much for your response. if possible Could you please share some sample code..?
@sachinrlu1987
@sachinrlu1987 2 жыл бұрын
How 12 output feed from layer 1 to layer 2 with 8 neuron, what will be the processes.
@gnayaniharshi
@gnayaniharshi 4 жыл бұрын
Sir when we compare in terms epochs this is the best model
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Hi Nayani, did not get your question.
@Sandykrang
@Sandykrang 3 жыл бұрын
Hi, productive explanation, how can we add Local response normalization in CNN in keras? Can you help with this?
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Hi Sandhya, I am not very sure at this moment, let me note this topic and do some research. Thanks for asking.
@Sandykrang
@Sandykrang 3 жыл бұрын
@@UnfoldDataScience ohk , can you please make a video on video data forgery detecting? Can you please help me with the code of how to iterate code for a video to subtract the individual frame from the median frame and repeat the process for the complete video and so on for complete data
@muhammedt1841
@muhammedt1841 9 ай бұрын
I think if you scaled the data accuracy will increase.
@UnfoldDataScience
@UnfoldDataScience 9 ай бұрын
Normally yes.
@pritishbanerjee5517
@pritishbanerjee5517 2 жыл бұрын
Hi Aman, thanks a lot for the tutorial. I have checked the drive shared by you in the description but unable to find this code in the google drive shared by you. Can you please help and upload the code ?
@UnfoldDataScience
@UnfoldDataScience 2 жыл бұрын
Hi Pritish, I will check, it was created long back. Am afraid I dont have back up :(
@ThirdEye097
@ThirdEye097 2 жыл бұрын
Module " tensorflow.python.framework.ops" has no attribute '_tensorlike' What I do ?
@ThirdEye097
@ThirdEye097 2 жыл бұрын
How to resolve this
@sabafarheen4918
@sabafarheen4918 2 жыл бұрын
Hello , I have a question as we have 8 input features so we kept 8 units in second layer .. but why 12 in first layer ? Can we put any number ?
@ranjanibhat4417
@ranjanibhat4417 Жыл бұрын
Basically it's a thumb rule.... number of first layer is equal to 1.5 times the input layer
@mranaljadhav8259
@mranaljadhav8259 3 жыл бұрын
I just used standard scaler to scale those features in same scale and I got accuracy of 84 ℅ .
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Awesome 😊
@mranaljadhav8259
@mranaljadhav8259 3 жыл бұрын
@@UnfoldDataScience thanks alot for your nice explanation 😊
@sagartiwari279
@sagartiwari279 4 жыл бұрын
i have to work on rumour detection using neural networks .... i want to know how can i work with strings instead of integer values... please help me clear my doubt
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Hi Sagar, you should encode strings in numbers. Methods can be onehotendocing etc
@mabubakerashraf1812
@mabubakerashraf1812 3 жыл бұрын
Can you give the Tutorial of Extreme learning machine code in python
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Sure Mabubaker.
@64sush
@64sush 3 жыл бұрын
My quick question is that what is the difference between sequential model and RNN?
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Sequential models - A group of models RNN - A member of the above group
@bhumikshah2597
@bhumikshah2597 2 жыл бұрын
I am getting error while doing kerasmodel.predict_classes(X_test) saying Sequential' object has no attribute 'predict_classes
@UnfoldDataScience
@UnfoldDataScience 2 жыл бұрын
Your trained model is having issues
@preranatiwary7690
@preranatiwary7690 4 жыл бұрын
Thank you. I ll get code from repo.
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Sure you can get.
@akashmanojchoudhary3290
@akashmanojchoudhary3290 3 жыл бұрын
When I'm trying to fit the model, its shows 62/62, whereas it should show 614/614 as there 614 records in training set, Pls help.
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Check your epoch number.
@sandipansarkar9211
@sandipansarkar9211 3 жыл бұрын
75 % accuracy not too good in terms of business accuracy .I believe
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Little higher would be better.
@libinkoshy632
@libinkoshy632 4 жыл бұрын
Model is good in terms of not overfitting However in terms of accuracy, model isn't doing a great job. And also since it is a medical dataset, Recall will be the right method to guage the model. Am I closer Aman?
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Hi Libin, you r thinking in right direction, feel free to take data and code from my repo and mail me ipynb of an improved model :)
@libinkoshy632
@libinkoshy632 4 жыл бұрын
@@UnfoldDataScience Thank you Aman :)
@ajaybhatt6820
@ajaybhatt6820 4 жыл бұрын
sir make vedio on pytorch,tenserflow quickly
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Sure Ajay. Wil cover the suggested topic. :)
@ajaybhatt6820
@ajaybhatt6820 4 жыл бұрын
@@UnfoldDataScience thanku sir 🙏🙏
@shreyjain6447
@shreyjain6447 3 жыл бұрын
Can a Neural Network work with negative inputs?
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
yes it can
@eswarasatyamsetty5367
@eswarasatyamsetty5367 4 жыл бұрын
where model is created i can't find it is giving error
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Please post error message.
@sachinrlu1987
@sachinrlu1987 2 жыл бұрын
and why it is decided 12 neuron in first layer why not 16 or 48
@akashrawat4325
@akashrawat4325 2 жыл бұрын
Hello Sir How can I get this code
@UnfoldDataScience
@UnfoldDataScience 2 жыл бұрын
Hi Akash, link to access code is shared in the description of every video. Please check again.
@akashmanojchoudhary3290
@akashmanojchoudhary3290 3 жыл бұрын
Drive mein ye wala code nahi hai aman. can you share it?
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Hi Akash, It might be in my old laptop, I will hv to search, Kindly mail me just to remind. Also follow up If I do not Respond.
@arsiblack2404
@arsiblack2404 2 жыл бұрын
please. make backpropagation
@wliiliammitiku3996
@wliiliammitiku3996 4 жыл бұрын
model.fit(x_train,y_train,epochs=150,batch_size=10) Etrror here???
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Are you getting any error?
@wliiliammitiku3996
@wliiliammitiku3996 4 жыл бұрын
@@UnfoldDataScience yes it gets me an error..... C:\Users\user\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\input_spec.py:212 assert_input_compatibility raise ValueError( ValueError: Input 0 of layer sequential_7 is incompatible with the layer: expected axis -1 of input shape to have value 12 but received input with shape [None, 8]
@nabeel9867
@nabeel9867 4 жыл бұрын
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type int). Getting this error there why??
@paragpujari3961
@paragpujari3961 3 жыл бұрын
can you please provide the dataset
@UnfoldDataScience
@UnfoldDataScience 2 жыл бұрын
drive.google.com/drive/folders/1XdPbyAc9iWml0fPPNX91Yq3BRwkZAG2M
@nikhielsingh748
@nikhielsingh748 Жыл бұрын
no as the dataset is not balanced , hence accuracy cannot be a reliable metric
@md.estiakahmed5599
@md.estiakahmed5599 3 жыл бұрын
_, means?
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
Which line/part of the video?
@md.estiakahmed5599
@md.estiakahmed5599 3 жыл бұрын
@@UnfoldDataScience _, accuracy = kerasmodel.evaluate (X_train,y_train) My qs this line what _, meaning?
@mranaljadhav8259
@mranaljadhav8259 3 жыл бұрын
@@md.estiakahmed5599 @Md.Estiak Ahmed you can take it (_) has your variable name, instead of using any name he had used underscore.. If you print that (_) underscore you will get loss value of your model.. That evaluate function returns 2 value, 1st is your model loss and 2nd is your model accuracy
@paragpujari3961
@paragpujari3961 3 жыл бұрын
Error getting while computing accuracy_scoreValueError: Classification metrics can't handle a mix of binary and continuous targets
@UnfoldDataScience
@UnfoldDataScience 2 жыл бұрын
datatype issue
@arpangupta5991
@arpangupta5991 3 жыл бұрын
i want to ipython code of this video
@UnfoldDataScience
@UnfoldDataScience 3 жыл бұрын
drive.google.com/drive/folders/1XdPbyAc9iWml0fPPNX91Yq3BRwkZAG2M
@longtruong9935
@longtruong9935 3 жыл бұрын
@@UnfoldDataScience what is exactly folder for the code?
@celina7538
@celina7538 4 жыл бұрын
Based on the accuracy i dont think its a good model..
@UnfoldDataScience
@UnfoldDataScience 4 жыл бұрын
Yes there are scopes for improvement.
@mainuddinali9561
@mainuddinali9561 2 жыл бұрын
no
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
Create a Simple Neural Network in Python from Scratch
14:15
Polycode
Рет қаралды 779 М.
9- How to implement a (simple) neural network with TensorFlow 2
24:37
Valerio Velardo - The Sound of AI
Рет қаралды 23 М.
Stanford's FREE data science book and course are the best yet
4:52
Python Programmer
Рет қаралды 713 М.
Components of Neural Network|Neural network Weight, Bias, layers, activation
10:52
How to implement Perceptron from scratch with Python
13:46
AssemblyAI
Рет қаралды 38 М.
But what is a neural network? | Deep learning chapter 1
18:40
3Blue1Brown
Рет қаралды 18 МЛН
Predicting Stock Prices in Python
29:14
NeuralNine
Рет қаралды 542 М.