Skip to content

[BUG]: Cannot load guesses in Template Expression if function contains parameters #510

@gm89uk

Description

@gm89uk

What happened?

For TemplateExpressions, I cannot load guesses that contain a parameter:
guesses = [(f="(((#1 - #2) * -0.16528662) + #4) - #3")],

In this instance #4 is p1[n]:

    expression_spec = @template_spec(expressions = (f,),parameters=(p1=n,)) do x1,x2,x3,x4 #x4 is param, #n is number of categories in x4
        LF = p1[x4]
	return f(x1,x2,x3,LF)
 end

The search runs no problem, but I cannot load the model again. Thank you in advance.

Version

v2.0.0-alpha.8

Operating System

Windows

Interface

Julia REPL

Relevant log output

     
ERROR: syntax: misplaced assignment statement in "[f = "(((#1 - #2) * -0.16528662) + #4) - #3"]" around REPL[42]:1
Stacktrace:
 [1] top-level scope
   @ REPL[42]:1

julia> mach = machine(model, X, y)
ERROR: UndefVarError: `model` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] top-level scope
   @ REPL[43]:1

Extra Info

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions