GPTIPS 2, Symbolic Regression. Error

26 ビュー (過去 30 日間)
Luis J Gilarranz
Luis J Gilarranz 2019 年 2 月 14 日
コメント済み: Luis J Gilarranz 2019 年 5 月 22 日
Hi,
I'm using GPTIPS 2 (https://sites.google.com/site/gptips4matlab/) to come up with a model that fits some data. The code runs, and I get the pareto front of models etc. However, I’m getting an error related to the symbolic toolbox.
For instance, when using “gpmodelreport(gp,84)” I get a screen print saying “Simplifying model ...” and then, an error
Error using gpmodel2sym (line 103)
Could not get symbolic object(s) for this model. Error using sym>convertChar (line 1459)
Character vectors and strings in the first argument can only specify a variable or number. To evaluate character vectors and strings representing symbolic expressions, use ‘str2sym’.
That error also shows up when I do “comparemodelsREC”, “gpmodel2sym”, “uniquegenes”...
Any idea?
Cheers!
LJ
  1 件のコメント
Luis J Gilarranz
Luis J Gilarranz 2019 年 2 月 15 日
I've narrowed down the error to the function gppretty.m, but substituting "sym" for "str2sym" doesn't solve the problem

サインインしてコメントする。

採用された回答

xox ir
xox ir 2019 年 3 月 18 日
Hello,
please create this function:
function y=xsym(x)
if isnumeric(x)
x=num2str(x);
end
y=str2sym(x);
Then add the code below:
if~verLessThan('matlab','9.3');sym=@xsym;end
At the begaining of gppretty.m
2019-03-18_102852.jpg
  1 件のコメント
Luis J Gilarranz
Luis J Gilarranz 2019 年 5 月 22 日
Hi xox ir,
After following your instructions "gpmodelreport" works, however, when I want to use the gene browser to simplify the model I get the following error:
genes = uniquegenes(gp)
Scanning 100 models ...
Total encoded genes found: 373
Unique encoded genes found: 49
Decoding & simplifying genes...please wait.
Simplifying gene 1
Error using sym>convertChar (line 1459)
Character vectors and strings in the first
argument can only specify a variable or number. To
evaluate character vectors and strings
representing symbolic expressions, use 'str2sym'.
Error in sym>tomupad (line 1225)
S = convertChar(x);
Error in sym (line 214)
S.s = tomupad(x);
Error in uniquegenes (line 137)
symgenes{i} =
sym(genes.uniqueGenesDecoded{i});
Any idea?
Cheers,
LJ

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by