nabeel-oz / qlik-py-tools

Data Science algorithms for Qlik implemented as a Python Server Side Extension (SSE).
https://nabeel-oz.github.io/qlik-py-tools/
MIT License
186 stars 87 forks source link

Prophet Not Showing Results #54

Closed aljamo01 closed 4 years ago

aljamo01 commented 5 years ago

Hi there,

After I managed to get C++ compiler and pystan working I am still not seeing results from the Prophet function on Qlik. Note that all other functions work perfectly. Here is what I get when I execute the function. Untitled

nabeel-oz commented 5 years ago

Hi,

Are you passing the future periods to the function as well i.e future dates with null values for the count? This is required to get back a forecast for those future dates.

This is mentioned in the documentation here: https://github.com/nabeel-oz/qlik-py-tools/blob/master/docs/Prophet.md

aljamo01 commented 5 years ago

Yes. the function doesn't seem to work even though it shows that it was executed. Untitled1

nabeel-oz commented 5 years ago

Can you change the function arguments to freq=M, debug=true and show me the log from the SSE terminal?

aljamo01 commented 5 years ago

Here.. Untitled3

aljamo01 commented 5 years ago

Untitled4

nabeel-oz commented 5 years ago

From that we can see that the request does not contain future periods and the input data frame ends up empty. To investigate why, you should change the table in your app to use the same dimension and measure being passed to Prophet. Check that you're passing a date with a numerical representation rather than a string to Prophet.

aljamo01 commented 5 years ago

I wonder why would the future periods not get passed.. I am using the same dimension and it is numerical. I haven't changed any of the script from the hands-on forecasting app but I still get those results. Untitled5

nabeel-oz commented 5 years ago

The Actual measure that you're using in your table is not producing the same result as Sum(Attendances) in your Prophet expression. From the request data frame in the SSE logs I can see that you have actual values until Dec 2018.

I suppose you have reloaded the app from a source file with additional data, but did not extend the future periods. You can either add the future periods in the source file or use the load script snippet in issue #52. You may also want to update the Actual measure as it was fixed to only show values before July 2018.

Also, you can just use Sample_App_Forecasting_Simple.qvf which comes with the latest data and future periods.

Kev-kutkin commented 5 years ago

Hi Nabeel, actually if you do not mind, could you kindly provide us the raw excel and csv files that are required to specifically used in the LOAD script? We can make them accessible, right? I understand that you do provide the links, but they are not pointing to the required file if you check again. I mean some of the filename mentioned in the LOAD script cannot be found in the two links provided by you at all. For example, I cannot find the source file for PERSON.csv or VEHICLE.csv in the two links provided. I really hope you understand because I find it quite hard to learn to reproduce the forecasting chart because I could not reload the data models, add new future values, and then use new data source that is suitable for your script to read it. I am experiencing the issues as shown below.

qlik_run_model_error

and the 'Pause' button could not be used at all as shown below.

qlik_run_algorithm_error

Thank you for your guidance to enable me to run your script.

nabeel-oz commented 5 years ago

@kutkin54 , the Sample_App_Prophet.qvf that you are using only applies the forecasting at the front-end so does not need to be reloaded to understand how the expressions work. This app is meant to be understood using the documentation under Use Prophet with your own app.

However, you can reload the Sample_App_Forecasting_Simple.qvf as it comes with the data source attached to the app and also available here. This app uses the Prophet functions both in the front-end and in the load script.

Finally, on your screenshot above, there is a second button which looks like it is being cut off due to your screen resolution. You can try zooming out (Ctrl + Mouse Scroll for Windows) or just hover over the object to be able to maximize it and use the second button.

aljamo01 commented 5 years ago

@nabeel-oz That worked thank you!!