-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data read #2
Comments
Hello,
Many thanks for your email and sorry for the late response. Your point is
correct " the sequences should be composed of heartbeats from the same ECG
record". Unfortunately, I had not updated the code on the Github, I will do
it by tomorrow.
Regards,
Sajad
…On Fri, Aug 23, 2019 at 6:01 AM banchuangliangyue ***@***.***> wrote:
@sajadmo <https://github.com/SajadMo>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD4D7SJUNHDQQAS5SVADV73QF7NTVANCNFSM4IO7KWAQ>
.
|
Thanks for your reply. I am looking forward to your updated code! |
@banchuangliangyue is correct, both the training and testing sequences contain one label type only. |
Yes, it is possible. It depends on the sequence length. If you increase the
length, you might get more than one type label in a sequence.
Regards,
Sajad
…On Tue, Dec 31, 2019 at 12:29 PM John Malik ***@***.***> wrote:
@banchuangliangyue <https://github.com/banchuangliangyue> is correct,
both the training and testing sequences contain one label type only.
[image: image]
<https://user-images.githubusercontent.com/40525523/71631948-b69f1d00-2bd9-11ea-8734-fb2af04d3627.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4D7SINVPPR2OPF472KYG3Q3OMQTANCNFSM4IO7KWAQ>
.
|
So I think this means knowing the label of the test heartbeat in advance, which is unrealistic. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First of all, thank you very much for your code! When I read your code, I found the process of generating ECG sequence in the original code is as follows.
Firstly, the heartbeat segmented by ECG records in the training set is stored into a two-dimensional
array, then the heartbeats of each kind (one of N S V) are selected and shuffled to get three smaller
two-dimensional arrays. Next, the three two-dimensional arrays are concatenated by rows to get a
larger two-dimensional array. Finally, the array is split into a sequence every max_time(the default is
10) line.
So I would like to ask why you want to group all the heartbeats according to categories in advance?
If you do this, the labels of each sequence are almost the same, and the heartbeats contained in each
sequence are not split from the same record at all (due to shuffle). This seems very different from the
actual situation, where the sequences should be composed of heartbeats from the same ECG record.
I wonder if this is a hidden trick of data processing? Why do we do that? Thank you very much for your reply! Here are some of the code that puzzles me.
data = np.asarray(data)
shape_v = data.shape
data = np.reshape(data, [shape_v[0], -1])
t_lables = np.array(t_lables)
_data = np.asarray([],dtype=np.float64).reshape(0,shape_v[1])
_labels = np.asarray([],dtype=np.dtype('|S1')).reshape(0,)
for cl in classes:
_label = np.where(t_lables == cl)
permute = np.random.permutation(len(_label[0]))
_label = _label[0][permute[:max_nlabel]]
_data = np.concatenate((_data, data[_label]))
_labels = np.concatenate((_labels, t_lables[_label]))
The text was updated successfully, but these errors were encountered: