Thank you for the video. In addition to the issue on lines 52/53 that the others pointed out, the scaled train samples were never used to fit the model. Also, the test samples were never scaled. Just bringing it notice so people can make corrections accordingly.
@shivamsrivastava4165 жыл бұрын
line no.52 and 53 test_sample = np.array(test_sample) #It should be there in place of test_sample = np.array(train_sample) please let me know if i am wrong
@sandipansarkar92114 жыл бұрын
superb video krish for practice for beginners.Keep it up.Thanks.
@rahuljaiswal93795 жыл бұрын
u r a good teacher, thanks
@The_midnight_motivator4 жыл бұрын
actually what is the use of ML in predicting this simplething u can simply use an if and else condition in python itself
@oussamaaatiq82934 жыл бұрын
Code: # -*- coding: utf-8 -*- """ import keras from keras.layers import Dense from keras.models import Sequential from keras.optimizers import Adam import numpy as np from random import randint from sklearn.preprocessing import MinMaxScaler #from scikit-learn import MinMaxScaler train_sample = [] train_label = [] for i in range(1000): younger_ages = randint(13,64) train_sample.append(younger_ages) train_label.append(0) older_ages = randint(65,100) train_sample.append(older_ages) train_label.append(1) train_sample = np.array(train_sample) train_label = np.array(train_label) scalar = MinMaxScaler(feature_range=(0,1)) scalar_train_sample = scalar.fit_transform(train_sample.reshape(-1,1)) model = Sequential([Dense(16,input_dim = 1, activation = 'relu'), Dense(32, activation = 'relu'), Dense(2, activation = 'softmax')]) model.compile(Adam(lr=0.001), loss = 'sparse_categorical_crossentropy', metrics= ['accuracy']) model.fit(train_sample, train_label, batch_size = 10, epochs = 10) test_sample = [] test_label = [] for i in range(1000): younger_ages = randint(13,64) test_sample.append(younger_ages) test_label.append(0) older_ages = randint(65,100) test_sample.append(older_ages) test_label.append(1) test_sample = np.array(test_sample) test_label = np.array(test_label) test_sample_output = model.predict(test_sample,batch_size=10) test_sample_output = test_sample_output.round() from sklearn.metrics import confusion_matrix predictedvalues = confusion_matrix(test_label, test_sample_output[:,1])
@ShubhangiKrishnan Жыл бұрын
Bless you
@saichandrareddy91405 жыл бұрын
Accuracy = 1959/2000 above there is mistake at 52, 53 Thanks for good lecture.
@pankajackson3 жыл бұрын
Such a good explanation but theres a small mistake in line 52 n 53. Parameter should be test_sample and test_label instead of using train data that u created to train ur model
@elmlt6 жыл бұрын
Thanks for the video! It really helped me (I am just starting to explore the world of ML, tensorflow & Keras, and have not found many good hands on step by step examples) But I think that there is an issue in the example. In line 52 & 53 your code says: 52: test_sample =np.array(train_sample) 53: test_label = np.array(train_label) I think it should be: 52: test_sample = np.array(test_sample) 53: test_label = np.array(test_label) Due to this issue, I understand that the prediction was made with the same data that was used to train the model. Right? (maybe this is why you got such good predictions) But this still helps to learn how to create the models!!
@krishnaik066 жыл бұрын
Hey Ernesto I think you are right...sorry for the mistake...Actually I made this video at a go...probably u can make the changes and go ahead with the implementation
@aniketanvekar54625 жыл бұрын
Y didn't u use scaled train sample in model.fit()?
@praneethcj65444 жыл бұрын
Please make more coding videos sir where explaining main part intuitively... Thank you sir
@kevalkavle4 жыл бұрын
Which IDE is used here?
@RAZZKIRAN3 жыл бұрын
first dense 16 nuerons, second dense layer 32 , out put layer 2, what about input nuerons, In which state we have supplied input number of nuerons?
@louerleseigneur45323 жыл бұрын
Thanks Krish
@evonkeith5 жыл бұрын
whats the idle that you use?
@rohanshah81292 жыл бұрын
SPYDER
@arunkuduva1234 жыл бұрын
Thanks for the video, How can we use confusion matrix to see the performance of regression kind of problem... the problem you described is classification kind of problem
@manjunathaeshwarappa31224 жыл бұрын
In regression you have to check cost function( actual output - output obtained, square it and then sum it up) . Higher the value of cost function line is not fit. So need to use gradient decent to achieve lowest cost function.
@satyanarayanajammala51295 жыл бұрын
where is the scaled data is used no where it is used
@mdazhar68045 жыл бұрын
scaled data is used for training. but it must have also scaled the test data.
@asifamussawar12253 жыл бұрын
nice
@The_midnight_motivator4 жыл бұрын
actually what is the use of ML in predicting this simplething u can simply use an if and else condition in python itself
@byte_fiend4 жыл бұрын
sir i have a doubt... if our test dataset has only 500 data then how our total data comes 2000 in confusion matrix.
@shindepratibha314 жыл бұрын
By mistake, he took test_sample=np.array(train_sample).That is why the confusion matrix shows 2000 count.
@shivasss1005 жыл бұрын
Your just awesome i can Say !
@ANILKUMAR-qd8lx6 жыл бұрын
Hello output Dense function Dense(1,activation="sogmodi") y u r used softmax please can you explain
@krishnaik066 жыл бұрын
Hey Anil sigmoid help you to transform your output between 0 to 1. Since this is a classifier type of problem
@sandipansarkar92114 жыл бұрын
where s the ipython notebook.thanks
@rajusrkr54445 жыл бұрын
provide the code in link sir, so that easy to practice , no need type again
@amiryavariabdi89623 жыл бұрын
Dear the artificial intelligence community I am pleased to introduce DIDA dataset, which is the largest handwritten digit dataset. I will be grateful, if you could help me to introduce this dataset to the community. Thanks