Cancer RNA Classification#

This example demonstrates Tabular Classification using cancer RNA gene expression data.

Problem Description#

Goal: Classify cancer types based on RNA gene expression profiles.

Input Features:

  • RNA gene expression values (multiple genes)

  • High-dimensional input space

Output:

  • Cancer type classification (one-hot encoded)

  • Multiple classes representing different cancer types

Dataset#

The training set ships split across two files each (to keep the high-dimensional files manageable), plus single test files:

  • x_train_0_.csv, x_train_1_.csv — Training gene expression profiles (two parts)

  • y_train_0_.csv, y_train_1_.csv — Training labels (one-hot encoded cancer types)

  • x_test.csv — Test gene expression profiles

  • y_test.csv — Test labels

Note

These files ship in the GeneExpressionCancerRnaSeq example folder of the NeurEco installation (see Examples for the location). Extract that folder and run the commands below from inside it. The two training parts are concatenated in code (and listed together in the CLI configuration).

Important

Classification outputs must be one-hot encoded. Each row has exactly one 1 indicating the cancer type.

Building the Model#

  1. Launch NeurEco and select Tabular Classification

  2. Load the training inputs x_train_0_.csv and x_train_1_.csv

  3. Load the training outputs y_train_0_.csv and y_train_1_.csv (must be one-hot encoded)

  4. Optionally load test files

  5. Click BUILD

  6. Monitor classification accuracy during training

Expected Results#

After training:

  • High classification accuracy — Typically 99%+ on this dataset

  • Compact model — Despite high-dimensional inputs, NeurEco creates a small network

  • Feature selection — NeurEco may identify that only some genes are predictive

Analyzing Results#

Per-class accuracy:

import numpy as np

# Convert one-hot references and probability predictions to class indices
n_classes = y_test.shape[1]
actual_classes = np.argmax(y_test, axis=1)
predicted_classes = np.argmax(predictions, axis=1)

for class_idx in range(n_classes):
    class_mask = actual_classes == class_idx
    class_accuracy = np.mean(predicted_classes[class_mask] == class_idx)
    print(f"Class {class_idx} accuracy: {class_accuracy * 100:.2f}%")

Identifying important genes:

Use sensitivity analysis to find which genes contribute most to classification:

# After training, use sensitivity analysis
# See Advanced Features documentation

Key Takeaways#

This example demonstrates:

  1. High-dimensional inputs — NeurEco handles many input features efficiently

  2. Automatic feature selection — Unimportant inputs may be disconnected

  3. One-hot encoding requirement — Classification outputs must be properly formatted

  4. Interpretability — Sensitivity analysis reveals important features

Variations to Try#

  • Use sensitivity analysis to identify key genes

  • Try limiting model size and observe accuracy impact

  • Compare different normalization strategies

  • Analyze misclassified samples