符号回归-Symbolic Regressor

符号回归
Gplearn扩展了scikit学习机器学习库,通过符号回归执行遗传编程(GP)。

符号回归是一种机器学习技术,旨在识别一个潜在的数学表达式。它首先建立一个朴素随机公式的总体来表示已知自变量和它们的因变量目标之间的关系,以预测新数据。每一个连续的生成程序从之前的程序进化而来,从种群中选择最适合的个体进行遗传操作。

基因编程能够采取一系列完全随机的程序,(未经训练,你可能也想不到的任何给定的目标功能),并使它们繁殖,变异和进化它们的方式走向真相。我们可以把遗传规划看作是一个随机优化的过程。每一个初始种群被构思出来,在这个过程中的每一个选择和进化步骤中,从当前一代的随机个体被选择来经历随机变化以进入下一代。您可以通过使用估计器(estimator)的random_state参数来控制这种随机性。

在每一种表示中,我们都有变量、常数和函数的混合。在这种情况下,我们有加、减、乘的函数。我们也有变量𝑋0和𝑋1,常数是3.0和0.5。总的来说,这些变量和常数被称为终端。与函数相结合,可用变量、常量和函数的集合被称为原语集。我们也可以将这个公式表示为一个语法树,其中函数是内部节点,用深蓝色表示,变量和常量组成了叶子(或终端节点),用浅蓝色表示:

 

 

 函数有一个称为它的属性。在python函数的意义上,Arity指的是函数所接受的参数的数量。在上面的情况下,所有的函数都需要两个参数,因此只有两个参数。

在gplearn中,可用的函数集由一个在初始化估计器时设置的参数控制。默认集是算术运算符:加法、减法、除法和乘法。但是,您也可以添加一些所有内置的转换器、比较函数或三角函数。这些字符串被放到function_set参数中,以便将它们包含在程序中。

• ‘add’ : addition, arity=2.
• ‘sub’ : subtraction, arity=2.
• ‘mul’ : multiplication, arity=2
• ‘div’ : division, arity=2.
• ‘sqrt’ : square root, arity=1.
• ‘log’ : log, arity=1.
• ‘abs’ : absolute value, arity=1.
• ‘neg’ : negative, arity=1.
• ‘inv’ : inverse, arity=1.
• ‘max’ : maximum, arity=2.
• ‘min’ : minimum, arity=2.
• ‘sin’ : sine (radians), arity=1.
• ‘cos’ : cosine (radians), arity=1.
• ‘tan’ : tangent (radians), arity=1.
A symbolic transformer is a supervised transformer that begins by building
    a population of naive random formulas to represent a relationship. The
    formulas are represented as tree-like structures with mathematical
    functions being recursively applied to variables and constants. 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 such as crossover, mutation or reproduction.
    The final population is searched for the fittest individuals with the least
    correlation to one another.
 

译文:符号转换器是一种有监督的转换器,它首先构建一组简单的随机公式来表示一种关系。这些公式用树状结构表示,数学函数递归地应用于变量和常数。每一代程序都是从前一代进化而来,通过从群体中选择最适合的个体进行遗传操作,如交叉、突变或繁殖。最终的种群是寻找最适合的个体,彼此之间的相关性最小。

 

 

 A symbolic regressor is an estimator that begins by building a population of naive random formulas to represent a relationship. The formulas are represented as tree-like structures with mathematical functions being recursively applied to variables and constants. 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 such as crossover, mutation or reproduction.

 

译文:符号回归是一种估计器,它首先建立一组简单的随机公式来表示一种关系。这些公式用树状结构表示,数学函数递归地应用于变量和常数。每一代程序都是从前一代进化而来,通过从群体中选择最适合的个体进行遗传操作,如交叉、突变或繁殖。

 

 

误差函数:

1、For the SymbolicRegressor several common error metrics are available and the evolution process seeks to minimize
them. The default is the magnitude of the error, ‘mean absolute error’. Other metrics available are:
• ‘mse’ for mean squared error, and
• ‘rmse’ for root mean squared error.
 
2、For the SymbolicTransformer, where indirect optimization is sought, the metrics are based on correlation between
the program’s output and the target, these are maximized by the evolution process:
• ‘pearson’, for Pearson’s product-moment correlation coefficient (the default), and
• ‘spearman’ for Spearman’s rank-order correlation coefficient. 
 
3、The SymbolicClassifier currently uses the ‘log loss’ aka binary cross-entropy loss as its default metric to optimise
posted @ 2022-05-15 22:42  小白白中白  阅读(3147)  评论(0编辑  收藏  举报