GithubHelp home page GithubHelp logo

Comments (6)

KaixuYang avatar KaixuYang commented on June 18, 2024

Hi @julioasotodv thanks for the detailed example. Somehow the code ran without error on my machine (after I change cv_horizon to 5). I see you are using the Anaconda environment. What is the python version and pandas/sklearn version?

from greykite.

julioasotodv avatar julioasotodv commented on June 18, 2024

Hi @KaixuYang, after some more testing (also on Mac, as I was using Windows before) it seems that my pandas version was the issue.

I was using pandas=1.3.3. After downgrading to pandas 1.2 (for instance, pandas=1.2.5) the issue goes away and CV results are not NaN anymore, so it looks like some pandas op in greykite\algo\changepoint\adalasso\changepoint_detector.py does not seem to play well with pandas>=1.3.

So downgrading to pandas 1.2 solves the issue, which is great to know.

Shall I keep this issue open or perhaps a PR in the meantime for modifying setup.py accordingly?

Thanks a lot

from greykite.

KaixuYang avatar KaixuYang commented on June 18, 2024

Hi @julioasotodv thanks for the investigation. Actually the root cause of this issue is that this is a monthly data set, and since the number of potential changepoints are too many, it brings duplicates into the columns. Instead of forcing the pandas version to be 1.2, we would like to fix this issue so it will get along with pandas 1.3 as well. Could you help us submitting a PR to fix this? I think a reasonable fix would be that: in line 230 of greykite.algo.changepoint.adalasso, the changepoints contains duplicates. We want to eliminate the duplicates with the util function greykite.common.python_utils.unique_elements_in_list. Could you test if this resolves the problem? Thanks!

from greykite.

julioasotodv avatar julioasotodv commented on June 18, 2024

Hi @KaixuYang, thank you for reaching out.

I understand the issue. However, there is not change in pandas 1.3 that should yield these two different behaviors as far as I know.

Will try to debug and search in pandas' changelogs before "hardcoding" a greykite.common.python_utils.unique_elements_in_list patch, just to make sure there would not be any side effects.

Thanks!

from greykite.

KaixuYang avatar KaixuYang commented on June 18, 2024

Thanks @julioasotodv ! Yeah actually unique_elements_in_list should be a safe guard for the function even for the earlier versions of pandas, but we failed to put it there. It would be great to add it there so no duplicated columns are generated.

from greykite.

KaixuYang avatar KaixuYang commented on June 18, 2024

Fixed in the next release.

from greykite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.