GithubHelp home page GithubHelp logo

yuryatin / salesplansuccess Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 314 KB

This Python package helps estimate the probability of achieving the annual sales plan in the middle of the year for the current year or at the end of the year for the next year for a specific product based on its historical monthly sales data with the help of ARIMA modeling and Monte Carlo simulation

License: MIT License

Python 29.71% Jupyter Notebook 70.29%

salesplansuccess's Introduction

Python package salesplansuccess

This Python package helps estimate the probability of achieving the annual sales plan in the middle of the year for the current year or at the end of the year for the next year for a specific product based on its historical monthly sales data with the help of ARIMA modeling and Monte Carlo simulation.

Installation

This Python package is uploaded to the PyPI repository and therefore can be installed with pip install salesplansuccess command line instruction and updated (this is critical at this early stage of development) with pip install salesplansuccess --upgrade.

Historical data format to feed

The only class SalesPlanSuccess() of this package accepts for its data parameter only pandas.DataFrame with three columns with the names Year, Month, and Sales. The columns Year and Month must be of the dtype numpy.int64 and the column Sales must be either of the dtype numpy.int64 or numpy.float64. All monthly sales data must be consecutive and positive (must not be zeros or omitted).

Assumptions

The model behind the forecast assumes that the monthly sales changes' residuals are lognormally distributed and the logarithmic monthly sales time series is subject to an ARIMA(2,1,0) process with one external regressor, which is the end of a quarter (March, June, September or December). This lognormal assumption cannot accomodate the historical sales data with 'no sales' months. So, please, do not use this package for historical sales time series with zeros.
This model also apparently assumes that the sales dynamics was subject to the same non-changing process in the past and will continue to follow it in the future (no new promo interventions are assumed).

How to use it

Very easy. The package has only one class SalesPlanSuccess(), which is initiated with the historical sales pandas DataFrame, the current annual plan number, and optionally with the product name (for the plot). This class has only 5 'public' methods: .fit(), .summary(), .simulate(), .percentiles(), .plot(), which are expected to be called in this order.
The illustration of how to use this package can be found in the attached file salesplansuccess_illustration.ipybn .
Briefly this can be expressed like this:

import pandas as pd
from salesplansuccess.api import SalesPlanSuccess
myHistoricalData = pd.read_excel('myfile.xlsx')
myAnnualPlan = 1000
sps = SalesPlanSuccess(data=myHistoricalData, plan=myAnnualPlan)
sps.fit()
sps.simulate()
sps.plot()

salesplansuccess's People

Stargazers

 avatar

Watchers

 avatar

Forkers

pv008

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.