Leukemia microarray diagnosis

End-to-end machine learning examples

The purpose of this example is to diagnose the leukemia of a patient depending on their DNA coding. Furthermore, because of the large DNA code a gene selection will be performed to simplify the model and get better knowledge of the disease.

The DNA is coded in 7129 genes, each one takes a value between 0 and 1. The output of the model is a binary value, it takes the value 0 for the acute lymphoblastic leukemia (ALL) and the value 1 for the acute myeloid leukemia (AML).


  1. Application type
  2. Data set
  3. Neural network
  4. Training strategy
  5. Model selection
  6. Testing analysis
  7. Model deployment

1. Application type

This is a classification project, since the variable to be predicted is binary (ALL or AML).

The goal here is to model the probability of ALL, conditioned on the microarray signals. Note that the probability of AML is 1 - ALL.

2. Data set

The data file contains a total of 7129 genes and 72 patients. The first row in the data file contains the names of the variables and the rest of them represent the instances.

The inputs-targets correlations indicate us which genes are more related with the ALL or AML diseases .

As we can see in the previous figure, there are some genes with a high correlation with the diagnosis by themself. In fact, the gene 4847 and the gene 2288 have a perfect correlation with the target variable.

3. Neural network

3. Training strategy

2. Model selection

Due to the large number of variables in the microarray problems, a feature selection should be performed. The inputs selection is used to find the optimal subset of inputs for the best performance of the model.

In this example, the inputs selection algorithm selected is the growing inputs. This method is the optimum for this kind of problems.

The output of the results shows the next table with the final values of the algorithm and its losses.

Growing inputs results

In the previous table, we can see that the algorithm did no iterations. This is because it found a variable with perfect correlation, and it stopped with this variable as the only input.

Finally, Neural Designer shows the final architecture of the neural network, see the next figure.

Final architecture

6. Testing analysis

A standard method for testing the prediction capabilities is to compare the outputs from the neural network against an independent set of data. The correlation matrix shows which instances are misclassified.

Predicted positive Predicted negative
Real positive 4 0
Real negative 0 10

As we can see in this confusion matrix, the model performs a perfect prediction of the leukemia class with independent data to those used for the training and the inputs selection.

7. Model deployment

Once the model is obtained, Neural Designer provides the user the mathematical expression of it in several programming languages. The next listing shows that formula in R language.


Related examples:

Related solutions: