1
我試圖使用包RGP方程組發現[R採用RGP symbolicRegression的公式發現
library(rgp)
x = c (1:100)
y = 5*x+3*sin(x)+4*x^2+75
data1 = data.frame(x,y)
newFuncSet <- functionSet("+","-","*")
result1 <- symbolicRegression(y ~ x, data = data1, functionSet = newFuncSet, stopCondition = makeStepsStopCondition(2000))
plot(data1$y, col=1, type="l"); points(predict(result1, newdata = data1), col=2, type="l")
model <- result1$population[[which.min(result1$fitnessValues)]]
不過,我不斷收到一個錯誤message.I將是在指出錯誤我你的幫助,感謝已經在上面做了。
有用的參考資料(這將是巨大的,有這樣的R):