Skip to main content

A sklearn-compatible package that implements a symbolic regression model

Project description

symbolic-learn is a sklearn-compatible package that implements a symbolic regression model.

What is symbolic regression?

Symbolic regression is a type of regression model that combines mathematical blocks to find the function that best fits the data. Here each function is represented as a binary tree like this one:

Function tree representation : image not found

The model initially generates a random population of such functions. It then uses genetic programming techniques on it to find out the function that best fits our dataset. As this model is based on scikit-learn’s base estimator, it can be used the same way you would use any sklearn model. Thus, you can use it in pipelines or apply fine-tuning techniques such as GridSearchCV on it.

Symbolic regression is best used when you want to take a naive approach to solving a regression problem. Unlike most existing models, it does not come with an a priori specification of a model. Therefore it is a good idea to use it when you want to find out and understand the mathematical structures in your data.

Example

Here is how to instantiate and train a symbolic regression model:

from sblearn.models import SymbolicRegressor
model = SymbolicRegressor()
model.fit(X_train, y_train)

After training your model, you can use access the fitted function’s formula and function tree through the model’s attributes formulas and trees. Read the doc for more information.

Installation

In order to install the package, use this command:

pip install symbolic-learn

Note for Windows users: Microsoft Visual C++ 2014 or higher is required!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

symbolic-learn-0.1.3.tar.gz (161.9 kB view details)

Uploaded Source

File details

Details for the file symbolic-learn-0.1.3.tar.gz.

File metadata

  • Download URL: symbolic-learn-0.1.3.tar.gz
  • Upload date:
  • Size: 161.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for symbolic-learn-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a1c21ab6631e5bfeb30daec4e14ede0b6579a5ae1d714ed31eb339215ebb3fc4
MD5 603bc2419e360168db297b9e3ae3ebc3
BLAKE2b-256 b9c24b7fa949d7991d07bf2b3b9fce6507191f69e32504ea5c046f2e43293f63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page