Contextual Regression: An Accurate and Conveniently Interpretable Nonlinear Model for Mining Discovery from Scientific Data

Chengyu Liu, Wei Wang · DOI

Abstract

Machine learning algorithms such as linear regression, SVM and neural network have played an increasingly important role in the process of scientific discovery. However, none of them is both interpretable and accurate on nonlinear datasets. Here we present contextual regression, a method that joins these two desirable properties together using a hybrid architecture of neural network embedding and dot product layer. We demonstrate its high prediction accuracy and sensitivity through the task of predictive feature selection on a simulated dataset and the application of predicting open chromatin sites in the human genome. On the simulated data, our method achieved high fidelity recovery of feature contributions under random noise levels up to 200%. On the open chromatin dataset, the application of our method not only outperformed the state of the art method in terms of accuracy, but also unveiled two previously unfound open chromatin related histone marks. Our method can fill the blank of accurate and interpretable nonlinear modeling in scientific data mining tasks.

Introduction

In scientific research, the choice of a machine learning model often involves a compromise between interpretability and predictive power. Simple linear models offer clear insights into feature importance but frequently fail to capture the complex, nonlinear relationships inherent in biological or physical data. Conversely, deep learning models achieve high accuracy but operate as "black boxes," making it difficult to extract the underlying logic behind their predictions. While post-hoc interpretation tools like SHAP or LIME exist, they are often computationally expensive and can be decoupled from the model's actual training logic.

This paper introduces Contextual Regression (CR), an inherently interpretable architecture designed to bridge this gap. By mapping inputs to a dynamic set of linear coefficients, CR provides the accuracy of nonlinear models with the direct transparency of standard regression.

The Contextual Regression Architecture

The core innovation of CR is its "pseudo-linear" mapping. Instead of fitting a single global function, the model learns to adapt its linear coefficients based on the specific context of the input data.

The Contextual Regression architecture uses an embedding model to generate context-specific weights, which are then combined with features via a dot product.

As shown in the architecture diagram, the process consists of two primary stages:

  1. Embedding Model: A neural network (e.g., an LSTM or MLP) processes the input features $x$ to produce a "context weight" vector $C$.
  2. Dot Product Layer: The final output $y$ is calculated as the dot product of the input features and these context weights: $y = C \cdot x + b$.

Because the final prediction is a simple dot product, the weights in $C$ function exactly like coefficients in a standard regression, making them immediately readable by researchers. To address the challenge of redundant features, the authors implemented a "Utopia Penalty," a regularization technique that encourages the model to distribute importance fairly across interchangeable features.

Experimental Validation

The researchers evaluated CR using both synthetic and real-world biological datasets:

  • Simulated Data: A sequence of 50 features with known ground-truth relationships was used to test the model's ability to recover underlying rules under extreme noise (up to 1000%).
  • Epigenomic Data: The model was applied to predict DNaseI hypersensitivity (DHS)—a marker for open chromatin—using 27 histone modifications from the Roadmap Epigenomics project. This task is critical for understanding gene regulation across different human cell types.

Results and Discussion

High-Fidelity Rule Extraction

A key strength of Contextual Regression is its ability to accurately recover the true importance of features even in noisy environments. In simulations, the model maintained a Root Mean Square Cosine Distance (RMSCD) below 0.03 for most noise levels, demonstrating that it learns the actual underlying data-generating rules rather than just fitting noise.

Comparison of ground truth weights versus weights extracted by the CR model, showing high fidelity in rule recovery.

Superior Predictive Accuracy

On the DHS prediction task, CR achieved a Pearson correlation of 0.825, outperforming standard Linear Regression (0.586) and the state-of-the-art ChromImpute method. It also slightly exceeded the performance of a standard Bidirectional-LSTM (0.817), proving that its interpretable structure does not come at the cost of performance.

Scientific Discovery

The model's interpretability led to new biological insights. By analyzing the context weights, the researchers identified two histone marks—H3K18ac and H3K23me2—as being strongly associated with open chromatin in embryonic stem cells. These associations were previously unrecognized in existing literature, showcasing CR's potential as a tool for scientific discovery.

Conclusion

Contextual Regression provides a robust framework for scientific data mining by combining nonlinear embedding with a transparent linear output. Its ability to maintain high accuracy while providing human-readable explanations—even under significant noise—makes it a valuable tool for fields where understanding the "why" is as important as the prediction itself. Future work will focus on further stabilizing weight assignments in datasets with extreme feature redundancy.

Summary updated

Abstract

Machine learning algorithms such as linear regression, SVM and neural network have played an increasingly important role in the process of scientific discovery. However, none of them is both interpretable and accurate on nonlinear datasets. Here we present contextual regression, a method that joins these two desirable properties together using a hybrid architecture of neural network embedding and dot product layer. We demonstrate its high prediction accuracy and sensitivity through the task of predictive feature selection on a simulated dataset and the application of predicting open chromatin sites in the human genome. On the simulated data, our method achieved high fidelity recovery of feature contributions under random noise levels up to 200%. On the open chromatin dataset, the application of our method not only outperformed the state of the art method in terms of accuracy, but also unveiled two previously unfound open chromatin related histone marks. Our method can fill the blank of accurate and interpretable nonlinear modeling in scientific data mining tasks.
BibTeX
@misc{liu2017contextual,
  author = {Chengyu Liu and Wei Wang},
  title = {{Contextual Regression: An Accurate and Conveniently Interpretable Nonlinear Model for Mining Discovery from Scientific Data}},
  year = {2017},
  eprint = {1710.10728},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1710.10728},
}
Figure