Coder Social home page Coder Social logo

edwinnglabs / karpiu Goto Github PK

View Code? Open in Web Editor NEW
17.0 6.0 4.0 27 MB

Karpiu is a package designed for marketing mix modeling by calling Orbit from the backend. Karpiu is still in its beta version. Please use it at your own risk.

Home Page: https://edwinng.com/karpiu/

License: MIT License

Python 71.19% Makefile 0.08% Jupyter Notebook 28.73%
bayesian budget-optimization marketing-analytics time-series marketing-mix-modeling python

karpiu's People

Contributors

edwinnglabs avatar unbrandedtech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

karpiu's Issues

Error in package installation with pandas==1.4.2

Hi Edwin,
Happy Holidays! Incredible work here. Thank you so much for sharing such an impressive modeling work. I have been trying to start testing the model and I keep running into issues with pandas==1.4.2. I followed your instructions, and I hope you don't mind helping me. pystan==2.19.1.1 requires python<3.8 so I install python 3.7. Does Karpiu use python 3.8 because no matter how many times that I tried, I couldn't install Karpiu

image

Did you run into any issues with the python conflicts? Sorry for the question. I appreciate your help very much and I hope to hear back from you. Thank you so much!

Attribution Refinement

Consider using the whole data frame as based and keep a few masks to extract variables on right time-range such as spend_mask, calc_mask instead of current approach which subtract sub df at first i.e.

self.df_bau = df.loc[
    (df[date_col] >= self.calc_start) & (df[date_col] <= self.calc_end),
    [date_col, self.kpi_col] + self.full_regressors
].reset_index(drop=True)

in line 110

Hence, everything will be extracted directly from df itself

Output prediction intervals

enable something like predict(percentile=[0.05, 0.95]) or something similar in the class constructor etc.

[Downstream Installation] PyStan 2.19 issues

From orbit, we are calling pystan==2.19.1.1.
However, the package is archived and is using old way python setup.py install to install the package. It is no longer get called this way under the new pip install ecosystem. See: pypa/pip#8368 for details.

We need to find a way to enforce this call. Right now, it seems python=3.8.* is still ok with the old procedure.

Calibration Process

Using prior solver, calibrate models with a dynamic system by digesting sigma prior, coefficients deviation from previous run etc.

Adstock functionality

Hi Edwin,
Just want thank you so much again for sharing your knowledge and your remarkable work here. I want to ask a quick question about adstock functionality and I wonder whether I am making the right step here. I want to test with an excel file dataset and I am using the function make_adstock_metric to create adstock but I kept running into issues. Do you have any issues create adstock with a different dataset (an actual database in csv)? Which function do you suggest me to create for adstock process if you don't mind me asking.
Apologies for the inconvenience. I appreciate your great insights and valuable guidance as I am learning through this great package.
Greatly appreciate your time and patience,
Sincerely,
Lan Nguyen

Regression Scheme Interface

For reusability, perhaps make a class to facilitate the translation from a structured data frame to list of lists priors;
this should also support control, events and spend regression

Create a new MMM Attributor

  • instead of making Attributor with a scope on just attribution; make it a "shell" which contain all the needed components to forecast with a fixed range where all background info are fixed already e.g. trend, seasonality, static regression effect etc.
  • then the attributor support attribution, marginal cost calculation etc. with quick computation with numpy or other similar tensor type of computation

Optimization Class Hierarchy

There are duplicated code within those optimization classes. We should set up the right base / abstract class.

Faster Attribution Logic

  • build based on a MMMShell class
  • unit test vectorize adstock process
  • build a faster logic with vectorizing adstock process
  • unit test attribution condition such as true up vs. not true up
  • share similar code with net returns objective function

Unit Tests Revisit with Model Update

With all the model updated from previous version, consider including most of the args into the unit tests such as hyper-parameters tuning.

Also need to report a coverage % in the badge somewhere.

Code execution error when running Karpiu from local jupyter notebook

Hi Edwin,
Thank you so much for answering my questions about how to install the Karpiu. Greatly appreciate that you share with the public about your work development. I am able to figure it out and to start testing the file. However, I am running into the issue with the first step of creating data in the data_creation notebook:
image
I understand your busy schedule and I am sorry for reaching out to ask for help and clarification. I am truly fascinated by the work that you have built so far and I would love to be able to run it and to learn from it.
Once again, appreciate your help and your time very much.

Marginal Cost Comparison

  1. derive marginal cost from cost curves df
  2. derive marginal cost from function
  3. use one-off approximation instead of one-on

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.