prophet icon indicating copy to clipboard operation
prophet copied to clipboard

predict error

Open ashawky84 opened this issue 9 years ago • 7 comments

Hi

Some times the predict function will work fine at the start of a new session but then it will give errors other times. an example is give here.

screen shot 2017-03-02 at 1 15 19 pm

ashawky84 avatar Mar 02 '17 12:03 ashawky84

Hi,

Same error here! I have duplicated the issue @ #79 because I had not seen your post before.

In my case the error shows up regardless of wether it is being executed early in an R session or after the session has had some time running.

Could it be a version-related error? This is what I am running

> version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          3.2                         
year           2016                        
month          10                          
day            31                          
svn rev        71607                       
language       R                           
version.string R version 3.3.2 (2016-10-31)
nickname       Sincere Pumpkin Patch     

Regards,

Ocanamat avatar Mar 03 '17 12:03 Ocanamat

Update:

Try the following, it works for me

single_TS_fcast <- prophet:::predict.prophet(m, future)

Regards,

Ocanamat avatar Mar 03 '17 12:03 Ocanamat

This is an odd issue, probably related to #16. When predict is called on an object with type prophet, it should call prophet:::predict.prophet. So the fact that the latter works while the former does not is surprising.

If you could paste the output of the following commands that'd be super helpful to try and figure out what predict it is using.

class(m)
methods(predict)
getS3method("predict", "list")
getS3method("predict", "prophet")

bletham avatar Mar 05 '17 15:03 bletham

Thanks, Here is the output:

class(m) [1] "list" "prophet" methods(predict) [1] predict.ar* predict.Arima* predict.arima0* predict.avNNet* [5] predict.bag* predict.bagEarth predict.bagFDA* predict.bam* [9] predict.BoxCoxTrans* predict.bs* predict.bSpline* predict.classDist* [13] predict.crq* predict.crqs* predict.default* predict.dummyVars* [17] predict.expoTrans* predict.gafs predict.gam* predict.garch* [21] predict.glm predict.glmmPQL* predict.gls* predict.gnls* [25] predict.HoltWinters* predict.icr* predict.jam* predict.knn3* [29] predict.knnreg* predict.lda* predict.list* predict.lm [33] predict.lme* predict.lmList* predict.lmList4* predict.loess* [37] predict.lqs* predict.mca* predict.merMod* predict.mlm* [41] predict.multinom* predict.nbSpline* predict.nlme* predict.nlrq* [45] predict.nls* predict.nnet* predict.npolySpline* predict.ns* [49] predict.nullModel* predict.pbSpline* predict.pcaNNet* predict.plsda* [53] predict.polr* predict.poly* predict.polySpline* predict.ppolySpline* [57] predict.ppr* predict.prcomp* predict.preProcess* predict.princomp* [61] predict.prophet* predict.qda* predict.qss1* predict.qss2* [65] predict.rfe* predict.rlm* predict.rq* predict.rq.process* [69] predict.rqs* predict.rqss* predict.safs* predict.sbf* [73] predict.smooth.spline* predict.smooth.spline.fit* predict.splsda* predict.StructTS* [77] predict.train see '?methods' for accessing help and source code getS3method("predict", "list") function (object, ...) { out <- lapply(object, predict, ... = ...) if (!is.null(names(object))) names(out) <- names(object) out } <environment: namespace:caret> getS3method("predict", "prophet") function (object, df = NULL, ...) { if (is.null(df)) { df = object$history } else { out <- setup_dataframe(object, df) df <- out$df } df$trend <- predict_trend(object, df) df <- df %>% dplyr::bind_cols(predict_uncertainty(object, df)) %>% dplyr::bind_cols(predict_seasonal_components(object, df)) df$yhat <- df$trend + df$seasonal return(df) } <environment: namespace:prophet>

On Sun, Mar 5, 2017 at 4:31 PM, Ben Letham [email protected] wrote:

This is an odd issue, probably related to #16 https://github.com/facebookincubator/prophet/issues/16. When predict is called on an object with type prophet, it should call prophet:::predict.prophet. So the fact that the latter works while the former does not is surprising.

If you could paste the output of the following commands that'd be super helpful to try and figure out what predict it is using.

class(m) methods(predict) getS3method("predict", "list") getS3method("predict", "prophet")

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/prophet/issues/68#issuecomment-284235590, or mute the thread https://github.com/notifications/unsubscribe-auth/AY7dTdGF7CDpSn0byP8aSryhZHyf6kQUks5ritVVgaJpZM4MQ6iC .

-- Ahmed Shawky PhD Networks & Security

ashawky84 avatar Mar 06 '17 10:03 ashawky84

The issue is that the caret package has a predict.list method which was being used for prophet, since it's class was first list and then prophet. I was able to replicate the issue by first loading the caret package. ecc0682 fixes this, could you install from Github and make sure everything is resolved for you?

devtools::install_github('facebookincubator/prophet', subdir='R')

bletham avatar Mar 06 '17 11:03 bletham

Fix confirmed in #94, but post if you have further issues with this!

bletham avatar Mar 09 '17 07:03 bletham

Thank you it works now.

ashawky84 avatar Mar 09 '17 09:03 ashawky84