Coder Social home page Coder Social logo

Wide Format about autots HOT 7 CLOSED

winedarksea avatar winedarksea commented on August 19, 2024
Wide Format

from autots.

Comments (7)

winedarksea avatar winedarksea commented on August 19, 2024

If you want to learn how to shape your data, take a look at the examples with long=False. I'd rename your columns storeA_product1, storeA_product2, storeB_product1 and so on, and the just pass as many columns as you need. Behind the scenes all data is made into the "wide" format before AutoTS runs the models.
For regressors try following the example here:
https://github.com/winedarksea/AutoTS/blob/dev/extended_tutorial.md#adding-regressors-and-other-information
Some models only take one variable but I handle the dimensionality reduction for you, so pass in as many variables as you want for a regressor.
@catchlui

from autots.

shuaiwang88 avatar shuaiwang88 commented on August 19, 2024

@winedarksea Do I create every autots for each store_product, by using a loop?
like:
for p in store_prodct:
model = autots(subset, x, x, ,x )

from autots.

winedarksea avatar winedarksea commented on August 19, 2024

You can do it that way, however autots accepts multivariate data so either passing wide style data or using long format data with the series_id distinct for each store_product will work.
For large scale it often makes sense to combine the two approaches. Loop AutoTS through high level groupings like product category or store regions, then in each of those subsets run a single AutoTS run on all store_products

from autots.

shuaiwang88 avatar shuaiwang88 commented on August 19, 2024

@winedarksea
I added a column company in the data you mentioned.
image

For the model.fit, I just passed id_col = 'company':
model = model.fit(
df,
id_col='company',
)
Is this correct?

For the forecasting:
prediction = model.predict(forecast_length = 30, verbose=0)
forecasts_df = prediction.forecast
It only returns company B:
image

from autots.

winedarksea avatar winedarksea commented on August 19, 2024

So your data format in that example data is wide style data. In this case, each column is a target series. So instead of CSUSHPISA you would have "companyB_product1" and for EMVOVERALLEMV you might have "companyA_product1" or whatever as appropriate
If using long style data your approach would work if you had three target series, and company was the series_id. It looks like you are using a load_monthly example so you can switch to long example data by load_monthly(long=True)

from autots.

shuaiwang88 avatar shuaiwang88 commented on August 19, 2024

I see. What I am really want to do is using exogenous variables, with series id: forecast sales for different country, with exogenous variables. Any suggestions?
image

from autots.

winedarksea avatar winedarksea commented on August 19, 2024

future_regressor is for those features which you know about the future. For series you don't know in the future, pass them in as additional series to forecast and some multivariate models will use them as features. I haven't personally found much actual value in a single categorical feature that is constant so there isn't direct support for that all though you could pass it in as a future regressor. Study the production_example.py in this repo for one general approach

from autots.

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.