1
$\begingroup$

I am working with data that requires classifying if a patient will develop cancer or not in the future, based on medical tests done over time. The tests have a sequential relationship. A, then B, then C, etc. For example:

| Patient ID | Test ID | RBC Count | WBC Count | Label
|     1      |    A    |     4.2   |    7000   |   0
|     1      |    B    |     5.3   |    12000  |   0
|     1      |    C    |     2.4   |    15000  |   1
|     2      |    A    |     7.6   |    8000   |   0
|     2      |    B    |     7.4   |    7500   |   0

Each point is not taken at a regular time interval, so this may not be considered a time-series data. How can I apply Keras Sequential model to this? Especially since each patient can have a different number of tests, up to 5, eg. Patient ID 1 has 3 tests, and Patient ID 2 has 2 tests.

$\endgroup$
1
  • $\begingroup$ Have you posted this before, or is this a publicly available dataset? I feel like I've seen this data on the site before and can't seem to find it. $\endgroup$
    – Matthew
    Commented Oct 30, 2018 at 19:27

2 Answers 2

1
$\begingroup$

[Wow.A Great problem]

Possible solution:(Personal opinion)

First Opinion is: Use SVM or KNN instead of a neural net as your data is trivial like 2D vector.

Second Opinion is:

As you aren't trying to predict the next text possibility of a particular patient so in this case RNN(LSTM,GRU) might not help you. So a simple solution is Autoencoder to compress the data and then run a simple logistic regression or svm or may be a neural net.

How?

1.As your Patient numbers are not same in all cases so you should represent his/her all medical test data into a single vector.That is where Autoencoder comes into play.example:

Suppose we have 3 patient: First-3 test , second-2 test ,three-5 test. Our goal is to compress each patient data into 2 dimension vector(as your features are RBC and WBC , 2 features , so it will learn well if we compress it into 2D vector).

(inside asterik sign(*) your data goes)

First Patient=[[*],[*],[*]] # three test
Second Patient=[[*],[*]] # two test
Third Patient=[[*],[*],[*],[*],[*]] # five test

Now you compress the data via Variational autoencoder.

scale your data as wbc>>rbc

then use variational autoencoder to get the latent space vector

use dimesion=2 in latent space via Dense(2)

now when you get the vectors just add the vectors of test for each patient

Like : For First patient you got three vector in latent space like-

[2.33,4.2]+[5.11,9.22]+[0.21,6.32]=result..and You got the representaion for First patient.

after you got all of them a trivial svm/polynomial regression would be just fine.

Let me know how you solved it.

$\endgroup$
2
  • $\begingroup$ I have real reservations with these suggestions - there should be additional clarification or justification at best, starting with: 1) Your first opinion method seems to both completely ignore the sequential nature of the data and completely ignore the association between tests and individuals (because you're treating them as 2D vectors) and $\endgroup$
    – Matthew
    Commented Oct 30, 2018 at 19:36
  • $\begingroup$ (cont) 2) Second opinion removes the sequential nature of the data by summing test representations together - this method at best needs justification; I suspect one of the best predictors of cancer is how many tests were done on a subject, and you remove the number of tests by summing the vectors together. $\endgroup$
    – Matthew
    Commented Oct 30, 2018 at 19:36
1
$\begingroup$

This most certainly sounds like a problem for a Phased LSTM https://arxiv.org/abs/1610.09513

It's designed to process inputs that arrive at irregular time intervals, for example, from two sensors working at different frequencies. As a cool bonus, it's able to process much longer sequences, where a usual LSTM would freak out.

Its derivatives and Backprop is described here: Gradient derivation reference for Phased LSTM

Also, make sure to read "heads up" and notes of the author on his github, before you start implementing it: https://github.com/dannyneil/public_plstm

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.