Welcome to gplearn’s documentation!¶
gplearn implements Genetic Programming in Python, with a
scikit-learn inspired and compatible API.
While Genetic Programming (GP) can be used to perform a
very wide variety of tasks,
gplearn is purposefully constrained to solving symbolic regression
problems. This is motivated by the scikit-learn ethos, of having powerful
estimators that are straight-forward to implement.
Symbolic regression is a machine learning technique that aims to identify an underlying mathematical expression that best describes a relationship. It begins by building a population of naive random formulas to represent a relationship between known independent variables and their dependent variable targets in order to predict new data. Each successive generation of programs is then evolved from the one that came before it by selecting the fittest individuals from the population to undergo genetic operations.
est = SymbolicRegressor() est.fit(X_train, y_train) y_pred = est.predict(X_test)
However, don’t let that stop you from exploring all the ways that the evolution can be tailored to your problem. The package attempts to squeeze a lot of functionality into a scikit-learn-style API. While there are a lot of parameters to tweak, reading the documentation here should make the more relevant ones clear for your problem.
gplearn supports regression through the
classification with the
SymbolicClassifier, as well as transformation
for automated feature engineering with the
is designed to support regression problems, but should also work for binary
gplearn is built on scikit-learn and a fairly recent copy (0.22.1+) is required
for installation. If you come across any issues in running or installing the
package, please submit a bug report.
Next up, read some more details about what Genetic Programming is, and how it works…
- Introduction to GP
- API reference
- Advanced Use
- Release History