Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uppredict.cubist unable to predict properly using sample (cubistControl) #1
Comments
Fixing the following reported issue: predict.cubist unable to predict properly using sample (cubistControl) topepo#1 tl;dr explanation: when using sample parameter in cubistControl, predictions are breaking down immediately. This fix solves this issue without creating other issues. Extra explanation about the fix: There is probably a proper way to do it using a better regex but this version works perfectly, whether there is sample defined or not. Init has no impact overall. It removes everything starting from "sample" and before "entries". I found no impact removing redn (it shows up between sample and entries when using commitees). redn = final error / (sum of errors / (number of commitees - 1)), just a calculated output value (it happens to be read when fed into Cubist into ErrReduction variable, but is not used at all to predict).
I am trying to predict a linear relation in Cubist between three variables using Cubist (from a very large data set). However, it seems to always break down when trying to predict, when "it does not break down" when predicting manually using the output formulas.
Here are the vectors used:
Expected answer: v1 = 3729.1 - 4.526_v3 + 4.54_v2
Output of print/summary:
Everything looks perfect... until:
And when I compare to the following, it does not make sense as it is the right expected answer:
Tested under:
R version 3.2.4 Revised
R version 3.2.3
Rgui and RStudio under Windows 7, Windows 8.1, Windows 10
Virtual machine and non-virtual machine
Different computers
Removing from $model "sample="0.5" init="3965" cleared the issue in my case.
I put this in $Model of the model:
instead of:
And the prediction worked perfectly.