Hi, thank you so much for doing this. it helped me a lot. But could you share the another classification tutorial that can distinguish each of five abnormal ECG? Really appreciate it if you can help.
3rd Notebook Implemented form your channel. Everything was so clear. Thank you. I had patience value of 4 but the model stopped at 0.10 val_loss, so a bit worse.
No problem! :) Honestly, I think EarlyStopping is a bit of a shortcut, because there is the possibility of stopping before you get to the minimum validation loss. It's great if you just want to test out a model, but if you're looking to truly optimize performance, I would recommend the ModelCheckpoint() callback with save_best_only set to True. This will allow your model to run for the full number of epochs, but it will save the weights or the model from the best run. Afterwards, you can load in the weights/model using model.load_weights() or model.load(). This approach will take more time, but it is more thorough in my opinion :)
Have you done the predict model? Can you show the confusion matrix and classification report? I've do same training ways like you but I got bad result both Please guide me, I'm newbie in this
# Prediction # Assuming your trained model is stored in the 'model' variable # Get the second sample from the test features second_sample = X_test.iloc[0, :] # Indexing by position (row 1, all columns) # Reshape the sample to match the expected input format (single sample, sequence length, features) second_sample = np.expand_dims(second_sample, axis=0) # Add a new dimension for batch size # Make prediction on the reshaped sample prediction = model.predict(second_sample) # Threshold the sigmoid output to get a class (normal: 0, abnormal: 1) predicted_class = (prediction > 0.5).astype(int) # Print the predicted class (0 or 1) print("Predicted class for the second test sample:", predicted_class[0][0])
# Prediction # Assuming your trained model is stored in the 'model' variable # Get the second sample from the test features second_sample = X_test.iloc[0, :] # Indexing by position (row 1, all columns) # Reshape the sample to match the expected input format (single sample, sequence length, features) second_sample = np.expand_dims(second_sample, axis=0) # Add a new dimension for batch size # Make prediction on the reshaped sample prediction = model.predict(second_sample) # Threshold the sigmoid output to get a class (normal: 0, abnormal: 1) predicted_class = (prediction > 0.5).astype(int) # Print the predicted class (0 or 1) print("Predicted class for the second test sample:", predicted_class[0][0])
This is a really great tutorial, thank you so much :) you are a gifted educator!
Hi, thank you so much for doing this. it helped me a lot. But could you share the another classification tutorial that can distinguish each of five abnormal ECG? Really appreciate it if you can help.
Great work. Thank you very much!!!
3rd Notebook Implemented form your channel. Everything was so clear. Thank you.
I had patience value of 4 but the model stopped at 0.10 val_loss, so a bit worse.
No problem! :)
Honestly, I think EarlyStopping is a bit of a shortcut, because there is the possibility of stopping before you get to the minimum validation loss. It's great if you just want to test out a model, but if you're looking to truly optimize performance, I would recommend the ModelCheckpoint() callback with save_best_only set to True.
This will allow your model to run for the full number of epochs, but it will save the weights or the model from the best run.
Afterwards, you can load in the weights/model using model.load_weights() or model.load().
This approach will take more time, but it is more thorough in my opinion :)
Excellent video
helped a lot
How do you use this to train an ECG device to predict arrhythmia?
Have you done the predict model? Can you show the confusion matrix and classification report?
I've do same training ways like you but I got bad result both
Please guide me, I'm newbie in this
# Prediction
# Assuming your trained model is stored in the 'model' variable
# Get the second sample from the test features
second_sample = X_test.iloc[0, :] # Indexing by position (row 1, all columns)
# Reshape the sample to match the expected input format (single sample, sequence length, features)
second_sample = np.expand_dims(second_sample, axis=0) # Add a new dimension for batch size
# Make prediction on the reshaped sample
prediction = model.predict(second_sample)
# Threshold the sigmoid output to get a class (normal: 0, abnormal: 1)
predicted_class = (prediction > 0.5).astype(int)
# Print the predicted class (0 or 1)
print("Predicted class for the second test sample:", predicted_class[0][0])
So helpful thanks very much
No problem :)
Happy New Year!
@@gcdatkin Happy new year... wishing you all the best.
For prediction:
# Prediction
# Assuming your trained model is stored in the 'model' variable
# Get the second sample from the test features
second_sample = X_test.iloc[0, :] # Indexing by position (row 1, all columns)
# Reshape the sample to match the expected input format (single sample, sequence length, features)
second_sample = np.expand_dims(second_sample, axis=0) # Add a new dimension for batch size
# Make prediction on the reshaped sample
prediction = model.predict(second_sample)
# Threshold the sigmoid output to get a class (normal: 0, abnormal: 1)
predicted_class = (prediction > 0.5).astype(int)
# Print the predicted class (0 or 1)
print("Predicted class for the second test sample:", predicted_class[0][0])