This project applies symbolic regression techniques to model coarse-grained potentials from molecular dynamics data. The goal is to automate the extraction of interpretable, physically-based force and energy functions for molecular systems.
Before running the code, make sure you have the following dependencies installed:
pandasgplearnscikit-learnjoblibnumpy
You can install all dependencies with the following command:
- Clone or download the project
- Install the dependencies:
pip install -r requirements.txt
This code requires a data file named force_pairs.csv, containing force and distance data. Make sure this data file is available at the specified path, or modify the path in the code accordingly.
The data file should contain the following columns:
-r: Distance data -F: Force data
- Data Preparation
Ensure the data file
force_pairs.csvis available and the path is correct. - Running the Code Run the following command to start training the model:
python symbolic_regression_model.py- Using the
cgpmClass You can also directly use the cgpm class in a Python script. Here's an example:
from symbolic_regression import cgpm
model = cgpm(data_path="path_to_your_data.csv")
model() Once the training is complete, the results will be saved to a file named gp_comparison_summary.csv. This file contains performance metrics for each model, including training and validation errors.
- Make sure the data file path is correct. The
data_pathshould point to theforce_pairs.csvfile. - You can adjust hyperparameters such as
population_sizeandgenerationsin the cgpm class to optimize the symbolic regression process. - The code will generate multiple
.pklmodel files during execution. These models can be saved or loaded as needed.
If you have any suggestions or issues, feel free to submit an Issue or submit a Pull Request.