skSymbolRegressor
First introduced in version 3.00.6
Syntax
skSymbolRegressor(skengine, method, config)
Details
Creates a symbolic regressor.
The Community Edition license does not support Shark. To use Shark, go to the official download page and click Request a free trial in the Shark section.
Parameters
skengine is a handle that specifies the Shark engine responsible for symbolic regression training. You can obtain the engine handle by using the getGlobalSharkEngine function.
method is a STRING scalar that specifies the method used to implement symbolic regression. Currently, only "gplearn" is supported, which means symbolic regression is implemented based on genetic programming.
config is a dictionary that specifies the symbolic regressor configuration and includes the following keys:
- "functionSet": A function name vector that specifies the set of functions available for initializing expression trees and for evolution. It can include built-in functions supported by Shark, such as
add,sub,mul,div, andmean, as well as user-defined functions marked with@gpu. If this key is not specified, the default function set is used, includingsin,cos,tan,asin,acos,atan,sinh,cosh,tanh,asinh,acosh,atanh,reciprocal,exp,log,neg,sqrt,cbrt,abs,add,sub,mul,div,pow. -
"selection": A dictionary that specifies the selection strategy and includes the following keys:
- "name": A STRING scalar. Currently, only "tournament" is supported, which indicates the tournament selection algorithm.
- "param": A dictionary that specifies the tournament size. For example, {"size":5} sets the size to 5, so five candidate expressions are sampled and compared each time, and the best expression advances. The default value is 3, and the value must be greater than 0.
-
"mutations": A dictionary tuple that specifies mutation and reproduction strategies and their weights. Each dictionary in the vector contains the following keys:
- "name": A STRING scalar that specifies the strategy name. Valid values include "crossover", "subtree", "hoist", "point", and "reproduction". For details about each strategy, see Introduction to GP.
- "weight": An INT scalar that specifies the sampling weight of the strategy. A larger weight increases the probability that the strategy is selected during training.
- "param": A dictionary that specifies the strategy parameters. Currently, only the point strategy supports setting "rate", for example, {"rate":0.2}. Default value: {"rate":0.1}.
- "verbose": A BOOL scalar that specifies whether to output configuration logs during regressor creation. The default value is false.
Returns
A symbolic regressor handle.
Examples
See Shark Symbolic Regression.
Related functions: getGlobalSharkEngine, skSymbolFit, skSymbolEvalContext, skSymbolEval
