Skip to content

Conversation

@jameshughes89
Copy link
Contributor

Adding more detail on how the evaluation function works and what one would replace the hard coded function with. The point that is trying to be communicated is that the polynomial is used to calculate y^ on the fly. If someone had arbitrary data for the dependent and independent variables, they would use these values instead.

These details are added based on my observation of where my class is misunderstanding how to use GP for symbolic regression.

Copy link
Member

@fmder fmder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the added note really improves clarity. Maybe we'd need to change a bit the example to highlight that the quartic is the "external" reference system.

@jameshughes89
Copy link
Contributor Author

Hmm... I see what you mean --- it does feel like the additional details makes it just more confusing.

I'm not sure if the added note really improves clarity. Maybe we'd need to change a bit the example to highlight that the quartic is the "external" reference system.

Perhaps the easiest way is to pre-generate the data and store it in a list that is indexed within the evaluation function.

Either way, I'll let the ideas brew a little before I move on this any more.

@jameshughes89
Copy link
Contributor Author

I am struggling on the best way to approach this.

My current thinking is to create an additional function that returns a list of values from the function f(x) = x**4 + x**3 + x**2 + x and passing that to the evalSymbReg function (e.g. below). This would then allow for a note in the documentation that the data being input to the function can obtained from wherever (like a csv). Let me know if this makes sense. If so, I will proceed.

def getSomeFunctionData():
    data = []
    for x in range(-10, 10):
        data.append((x/10)**4 + (x/10)**3 + (x/10)**2 + (x/10))
    return data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants