Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug report] cubist difference between predict and tidypredict_to_column #67

Open
jacekkotowski opened this issue Jan 8, 2020 · 1 comment
Labels
bug an unexpected problem or unintended behavior

Comments

@jacekkotowski
Copy link

data(BostonHousing)
BostonHousing$chas <- as.numeric(BostonHousing$chas) - 1

set.seed(1)
inTrain <- sample(1:nrow(BostonHousing), floor(.8*nrow(BostonHousing)))

train_pred <- BostonHousing[ inTrain, -14]
test_pred <- BostonHousing[-inTrain, -14]

train_resp <- BostonHousing$medv[ inTrain]
test_resp <- BostonHousing$medv[-inTrain]

com_model <- cubist(x = train_pred, y = train_resp, committees = 5)

train_cub <- predict(com_model, newdata = train_pred)

predictingFn <- tidypredict_fit(com_model)

#-------------------------
Results

crim zn indus chas nox rm age dis rad tax ptratio b lstat **real pred_r tidypredict**
0,1415 0 6,91 0 0,448 6,169 6,6 5,7209 3 233 17,9 383,37 5,81 **25,3 24,05105 48,158556**
0,09164 0 10,81 0 0,413 6,065 7,8 5,2873 4 305 19,2 390,91 5,52 **22,8 24,00242 42,4043666**
1,42502 0 19,58 0 0,871 6,51 100 1,7659 5 403 14,7 364,31 7,39 **23,3 22,91912 38,14306904**
11,8123 0 18,1 0 0,718 6,824 76,5 1,794 24 666 20,2 48,45 22,74 **8,4 11,54379 19,119236**
10,8342 0 18,1 0 0,679 6,782 90,8 1,8195 24 666 20,2 21,57 25,79 **7,5 10,2055 16,8894594**
14,2362 0 18,1 0 0,693 6,343 100 1,5741 24 666 20,2 396,9 20,32 **7,2 10,98567 17,4945624**
15,8744 0 18,1 0 0,671 6,545 99,1 1,5192 24 666 20,2 396,9 21,08 **10,9 11,43178 16,3770992**
2,77974 0 19,58 0 0,871 4,903 97,8 1,3459 5 403 14,7 396,9 29,29 **11,8 12,31011 17,63297084**
@topepo
Copy link
Member

topepo commented Apr 3, 2020

Related to #57 and perhaps #58

@topepo topepo added the bug an unexpected problem or unintended behavior label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants