1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
|
%global _empty_manifest_terminate_build 0
Name: python-auto-ts
Version: 0.0.71
Release: 1
Summary: Automatically Build Multiple Time Series models fast - now with Facebook Prophet!
License: Apache License 2.0
URL: https://github.com/AutoViML/Auto_TS
Source0: https://mirrors.aliyun.com/pypi/web/packages/a5/79/e4d10cf0975625961f72504de012c0b0eefd20856cd0cddd93a88f2c93a1/auto_ts-0.0.71.tar.gz
BuildArch: noarch
Requires: python3-dask
Requires: python3-distributed
Requires: python3-ipython
Requires: python3-jupyter
Requires: python3-matplotlib
Requires: python3-numpy
Requires: python3-pandas
Requires: python3-pmdarima
Requires: python3-prettytable
Requires: python3-prophet
Requires: python3-pyyaml
Requires: python3-scikit-learn
Requires: python3-seaborn
Requires: python3-statsmodels
Requires: python3-xgboost
Requires: python3-xlrd
%description
<h1 id="auto-ts">Auto_TS: Auto_TimeSeries</h1>
<p style="font-family:verdana">Automatically build multiple Time Series models using a Single Line of Code. Now updated with Dask.

`auto_timeseries` is a complex model building utility for time series data. Since it automates many
Tasks involved in a complex endeavor, it assumes many intelligent defaults. But you can change them.
Auto_Timeseries will rapidly build predictive models based on Statsmodels ARIMA, Seasonal ARIMA, Prophet
and Scikit-Learn ML. It will automatically select the best model which gives best score specified.
# Table of Contents
<ul>
<li><a href="#Latest">Latest updates</a></li>
<li><a href="#introduction">What is auto_ts</a></li>
<li><a href="#install">How to install auto_ts</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#requirements">Requirements</a></li>
<li><a href="#tips">Tips</a></li>
<li><a href="#license">License</a></li>
<li><a href="#copyright">Copyright</a></li>
<li><a href="#disclaimer">Disclaimer</a></li>
</ul>
## Latest
To know about the latest updates and features added to Auto_TS please go to this [page](updates.md).
<h2 id="introduction">Introduction</h2>
<p>Auto_TimeSeries enables you to build and select multiple time series models using techniques such as ARIMA, SARIMAX, VAR, decomposable (trend+seasonality+holidays) models, and ensemble machine learning models.</p>
<p>Auto_TimeSeries is an Automated ML library for time series data. Auto_TimeSeries was initially conceived and developed by <a href="https://www.linkedin.com/in/ram-seshadri-nyc-nj/">Ram Seshadri</a> and was significantly expanded in functionality and scope and upgraded to its present status by <a href="https://github.com/ngupta23">Nikhil Gupta</a>.</p>
<p>auto-ts.Auto_TimeSeries is the main function that you will call with your train data. You can then choose what kind of models you want: stats, ml or Prophet based model. You can also tell it to automatically select the best model based on the scoring parameter you want it to be based on. It will return the best model and a dictionary containing predictions for the number of forecast_periods you mentioned (default=2).
## Install
```
pip install auto-ts
```
Use `pip3 install auto-ts` if the above doesn’t work
```
pip install git+https://github.com/AutoViML/Auto_TS.git
```
### Installing on Colab
If you are using Colab or Kaggle kernel and want to install auto_ts, please use the following steps (otherwise you will get an error!):
```
!pip install auto-ts --no-deps --ignore-installed
!pip install 'fsspec>=0.3.3'
!pip install statsmodels --upgrade
!pip install pmdarima
```

### Installing on Windows
<p>Windows users may experience difficulties with the Prophet and pystan dependency installations. Because of this, we recommend installing Prophet using instructions from the <a hreff="https://facebook.github.io/prophet/docs/installation.html"> Prophet documentation page</a> prior to installing auto-ts. For Anaconda users, this can be accomplished via:
<ol>
<li><p><code> conda install -c conda-forge prophet </code> </p></li>
<li><p><code> pip install auto-ts </code> </p></li>
</ol>
<h2 id="usage">Usage</h2>
### First you need to import auto_timeseries from auto_ts library:<br>
```
from auto_ts import auto_timeseries
```
### Second, Initialize an auto_timeseries model object which will hold all your parameters:</p>
```
model = auto_timeseries(
score_type='rmse',
time_interval='Month',
non_seasonal_pdq=None, seasonality=False,
seasonal_period=12,
model_type=['Prophet'],
verbose=2)
```
#### Here are how the input parameters defined:<br>
<ol>
<li><b>score_type (default='rmse')</b>: The metric used for scoring the models. Type is string.
Currently only the following two types are supported:
(1) "rmse": Root Mean Squared Error (RMSE)
(2) "normalized_rmse": Ratio of RMSE to the standard deviation of actuals</li>
<li><b>time_interval (default is None)</b>: Used to indicate the frequency at which the data is collected.
This is used for two purposes (1) in building the Prophet model and (2) used to impute the seasonal period for SARIMAX in case it is not provided by the user (None). Type is String.
We use the following <a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timeseries-offset-aliases">pandas date range frequency</a> aliases that Prophet uses to make the prediction dataframe. <p>Hence, please note that these are the list of allowed aliases for frequency:
['B','C','D','W','M','SM','BM','CBM',
'MS','SMS','BMS','CBMS','Q','BQ','QS','BQS',
'A,Y','BA,BY','AS,YS','BAS,BYS','BH',
'H','T,min','S','L,ms','U,us','N']
For a start, you can test the following codes for your data and see how the results are:
<ul>
<li>'MS', 'M', 'SM', 'BM', 'CBM', 'SMS', 'BMS' for monthly frequency data</li>
<li> 'D', 'B', 'C' for daily frequency data </li>
<li> 'W' for weekly frequency data </li>
<li> 'Q', 'BQ', 'QS', 'BQS' for quarterly frequency data </li>
<li> 'A,Y', 'BA,BY', 'AS,YS', 'BAS,YAS' for yearly frequency data </li>
<li> 'BH', 'H', 'h' for hourly frequency data </li>
<li> 'T,min' for minute frequency data </li>
<li> 'S', 'L,milliseconds', 'U,microseconds', 'N,nanoseconds' for second frequency data </li>
</ul>
Or you can leave it as None and auto_timeseries will try and impute it.
</li>
<li><b>non_seasonal_pdq (default = (3,1,3))</b>: Indicates the maximum value of (p, d, q) to be used in the search for statistical ARIMA models.
If None, then the following values are assumed max_p = 3, max_d = 1, max_q = 3. Type is Tuple.</li>
<li><b>seasonality (default=False)</b>: Used in the building of the SARIMAX model only at this time. True or False. Type is bool.</li>
<li><b>seasonal_period (default is None)</b>: Indicates the seasonal period in your data. This depends on the peak (or valley) period that occurs regularly in your data.
Used in the building of the SARIMAX model only at this time.
There is no impact of this argument if seasonality is set to False
If None, the program will try to infer this from the time_interval (frequency) of the data
We assume the following as defaults but feel free to change them.
(1) If frequency is Monthly, then seasonal_period is assumed to be 12
(1) If frequency is Daily, then seasonal_period is assumed to be 30 (but it could be 7)
(1) If frequency is Weekly, then seasonal_period is assumed to be 52
(1) If frequency is Quarterly, then seasonal_period is assumed to be 4
(1) If frequency is Yearly, then seasonal_period is assumed to be 1
(1) If frequency is Hourly, then seasonal_period is assumed to be 24
(1) If frequency is Minutes, then seasonal_period is assumed to be 60
(1) If frequency is Seconds, then seasonal_period is assumed to be 60
Type is integer</li>
<li><b>conf_int (default=0.95)</b>: Confidence Interval for building the Prophet model. Default: 0.95. Type is float.</li>
<li><b>model_type (default: 'stats'</b>: The type(s) of model to build. Default to building only statistical models
Can be a string or a list of models. Allowed values are:
'best', 'prophet', 'stats', 'ARIMA', 'SARIMAX', 'VAR', 'ML'.
"prophet" will build a model using Prophet -> this means you must have Prophet installed
"stats" will build statsmodels based ARIMA, SARIMAX and VAR models
"ML" will build a machine learning model using Random Forests provided explanatory vars are given
'best' will try to build all models and pick the best one
If a list is provided, then only those models will be built
WARNING: "best" might take some time for large data sets. We recommend that you
choose a small sample from your data set before attempting to run entire data.
Type can be either: [string, list]
</li>
<li><b>verbose (default=0)</b>: Indicates the verbosity of printing (Default = 0). Type is integer.</li>
</ol>
### The next step after defining the model object is to fit it with some real data:
```
model.fit(
traindata=train_data,
ts_column=ts_column,
target=target,
cv=5,
sep=","
)
```
Here are how the parameters defined:
<ul>
<li><b>traindata (required)</b>: It can be either a dataframe or a file. You must give the name of the file along with its data path in case if a file. It also accepts a pandas dataframe in case you already have a dataframe loaded in your notebook.</li>
<li><b>ts_column (required)</b>: name of the datetime column in your dataset (it could be a name of column or index number in the columns index)</li>
<li><b>target (required)</b>: name of the column you are trying to predict. Target could also be the only column in your dataset</li>
<li><b>cv (default=5)</b>: You can enter any integer for the number of folds you want in your cross validation data set.
</li>
<li><b>sep (default=",")</b>: Sep is the separator in your traindata file. If your separator is ",", "\t", ";", make sure you enter it here. If not, it is ignored.</li>
</ul>
### The next step after training the model object is to make some predictions with test data:<br>
```
predictions = model.predict(
testdata = can be either a dataframe or an integer standing for the forecast_period,
model = 'best' or any other string that stands for the trained model
)
```
Here are how the parameters are defined. You can choose to send either testdata in the form of a dataframe or send in an integer to decide how many periods you want to forecast. You need only
<ul>
<li><b>testdata (required)</b>: It can be either a dataframe containing test data or you can use an integer standing for the forecast_period (you want).</li>
<li><b>model (optional, default = 'best')</b>: The name of the model you want to use among the many different models you have trained. Remember that the default is the best model. But you can choose any model that you want to forecast with. Type is String.</li>
</ul>
<h2 id="requirements">Requirements</h2>
<p>dask, scikit-learn, prophet, statsmodels, pmdarima, XGBoost</p>
<h2 id="license">License:</h2>
<p>Apache License 2.0</p>
<h2 id="Tips">Tips</h2>
<ul>
<li>We recommend that you choose a small sample from your data set before attempting to run entire data. and the evaluation metric so it can select the best model. Currently models within “stats” are compared using AIC and BIC. However, models across different types are compared using RMSE. The results of models are shown using RMSE and Normalized RMSE (ratio of RMSE to the standard deviation of actuals).</li>
<li>You must clean the data and not have any missing values. Make sure the target variable is numeric, otherwise, it won’t run. If there is more than one target variable in your data set, just specify only one for now, and if you know the time interval that is in your data, you can specify it. Otherwise it auto-ts will try to infer the time interval on its own.</li>
<li>If you give Auto_Timeseries a different time interval than what the data has, it will automatically resample the data to the given time interval and use the mean of the target for the resampled period.</li>
<li>Notice that except for filename and ts_column input arguments, which are required, all other arguments are optional.</li>
<li>Note that optionally you can give a separator for the data in your file. Default is comma (",").</li>
<li>“time_interval” options are any codes that you can find in this page below.
<a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timeseries-offset-aliases">Pandas date-range frequency aliases</a>
</li>
<li>Optionally, you can give seasonal_period as any integer that measures the seasonality in the data. If not given, seasonal_period is assumed automatically as follows: Months = 12, Days = 30, Weeks = 52, Qtr = 4, Year = 1, Hours = 24, Minutes = 60 and Seconds = 60.</li>
<li>If you want to give your own non-seasonal order, please input it as non_seasonal_pdq and for seasonal order, use seasonal_PDQ as the input. Use tuples. For example, seasonal_PDQ = (2,1,2) and non_seasonal_pdq = (0,0,3). It will accept only tuples. The default is None and Auto_Timeseries will automatically search for the best p,d,q (for Non Seasonal) and P, D, Q (for Seasonal) orders by searching for all parameters from 0 to 12 for each value of p,d,q and 0-3 for each P, Q and 0-1 for D.</li>
</ul>
<h2 id="disclaimer">DISCLAIMER:</h2>
<p>This is not an Officially supported Google project.</p>
<h2 id="copyright">Copyright</h2>
<p>© Google</p>
%package -n python3-auto-ts
Summary: Automatically Build Multiple Time Series models fast - now with Facebook Prophet!
Provides: python-auto-ts
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-auto-ts
<h1 id="auto-ts">Auto_TS: Auto_TimeSeries</h1>
<p style="font-family:verdana">Automatically build multiple Time Series models using a Single Line of Code. Now updated with Dask.

`auto_timeseries` is a complex model building utility for time series data. Since it automates many
Tasks involved in a complex endeavor, it assumes many intelligent defaults. But you can change them.
Auto_Timeseries will rapidly build predictive models based on Statsmodels ARIMA, Seasonal ARIMA, Prophet
and Scikit-Learn ML. It will automatically select the best model which gives best score specified.
# Table of Contents
<ul>
<li><a href="#Latest">Latest updates</a></li>
<li><a href="#introduction">What is auto_ts</a></li>
<li><a href="#install">How to install auto_ts</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#requirements">Requirements</a></li>
<li><a href="#tips">Tips</a></li>
<li><a href="#license">License</a></li>
<li><a href="#copyright">Copyright</a></li>
<li><a href="#disclaimer">Disclaimer</a></li>
</ul>
## Latest
To know about the latest updates and features added to Auto_TS please go to this [page](updates.md).
<h2 id="introduction">Introduction</h2>
<p>Auto_TimeSeries enables you to build and select multiple time series models using techniques such as ARIMA, SARIMAX, VAR, decomposable (trend+seasonality+holidays) models, and ensemble machine learning models.</p>
<p>Auto_TimeSeries is an Automated ML library for time series data. Auto_TimeSeries was initially conceived and developed by <a href="https://www.linkedin.com/in/ram-seshadri-nyc-nj/">Ram Seshadri</a> and was significantly expanded in functionality and scope and upgraded to its present status by <a href="https://github.com/ngupta23">Nikhil Gupta</a>.</p>
<p>auto-ts.Auto_TimeSeries is the main function that you will call with your train data. You can then choose what kind of models you want: stats, ml or Prophet based model. You can also tell it to automatically select the best model based on the scoring parameter you want it to be based on. It will return the best model and a dictionary containing predictions for the number of forecast_periods you mentioned (default=2).
## Install
```
pip install auto-ts
```
Use `pip3 install auto-ts` if the above doesn’t work
```
pip install git+https://github.com/AutoViML/Auto_TS.git
```
### Installing on Colab
If you are using Colab or Kaggle kernel and want to install auto_ts, please use the following steps (otherwise you will get an error!):
```
!pip install auto-ts --no-deps --ignore-installed
!pip install 'fsspec>=0.3.3'
!pip install statsmodels --upgrade
!pip install pmdarima
```

### Installing on Windows
<p>Windows users may experience difficulties with the Prophet and pystan dependency installations. Because of this, we recommend installing Prophet using instructions from the <a hreff="https://facebook.github.io/prophet/docs/installation.html"> Prophet documentation page</a> prior to installing auto-ts. For Anaconda users, this can be accomplished via:
<ol>
<li><p><code> conda install -c conda-forge prophet </code> </p></li>
<li><p><code> pip install auto-ts </code> </p></li>
</ol>
<h2 id="usage">Usage</h2>
### First you need to import auto_timeseries from auto_ts library:<br>
```
from auto_ts import auto_timeseries
```
### Second, Initialize an auto_timeseries model object which will hold all your parameters:</p>
```
model = auto_timeseries(
score_type='rmse',
time_interval='Month',
non_seasonal_pdq=None, seasonality=False,
seasonal_period=12,
model_type=['Prophet'],
verbose=2)
```
#### Here are how the input parameters defined:<br>
<ol>
<li><b>score_type (default='rmse')</b>: The metric used for scoring the models. Type is string.
Currently only the following two types are supported:
(1) "rmse": Root Mean Squared Error (RMSE)
(2) "normalized_rmse": Ratio of RMSE to the standard deviation of actuals</li>
<li><b>time_interval (default is None)</b>: Used to indicate the frequency at which the data is collected.
This is used for two purposes (1) in building the Prophet model and (2) used to impute the seasonal period for SARIMAX in case it is not provided by the user (None). Type is String.
We use the following <a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timeseries-offset-aliases">pandas date range frequency</a> aliases that Prophet uses to make the prediction dataframe. <p>Hence, please note that these are the list of allowed aliases for frequency:
['B','C','D','W','M','SM','BM','CBM',
'MS','SMS','BMS','CBMS','Q','BQ','QS','BQS',
'A,Y','BA,BY','AS,YS','BAS,BYS','BH',
'H','T,min','S','L,ms','U,us','N']
For a start, you can test the following codes for your data and see how the results are:
<ul>
<li>'MS', 'M', 'SM', 'BM', 'CBM', 'SMS', 'BMS' for monthly frequency data</li>
<li> 'D', 'B', 'C' for daily frequency data </li>
<li> 'W' for weekly frequency data </li>
<li> 'Q', 'BQ', 'QS', 'BQS' for quarterly frequency data </li>
<li> 'A,Y', 'BA,BY', 'AS,YS', 'BAS,YAS' for yearly frequency data </li>
<li> 'BH', 'H', 'h' for hourly frequency data </li>
<li> 'T,min' for minute frequency data </li>
<li> 'S', 'L,milliseconds', 'U,microseconds', 'N,nanoseconds' for second frequency data </li>
</ul>
Or you can leave it as None and auto_timeseries will try and impute it.
</li>
<li><b>non_seasonal_pdq (default = (3,1,3))</b>: Indicates the maximum value of (p, d, q) to be used in the search for statistical ARIMA models.
If None, then the following values are assumed max_p = 3, max_d = 1, max_q = 3. Type is Tuple.</li>
<li><b>seasonality (default=False)</b>: Used in the building of the SARIMAX model only at this time. True or False. Type is bool.</li>
<li><b>seasonal_period (default is None)</b>: Indicates the seasonal period in your data. This depends on the peak (or valley) period that occurs regularly in your data.
Used in the building of the SARIMAX model only at this time.
There is no impact of this argument if seasonality is set to False
If None, the program will try to infer this from the time_interval (frequency) of the data
We assume the following as defaults but feel free to change them.
(1) If frequency is Monthly, then seasonal_period is assumed to be 12
(1) If frequency is Daily, then seasonal_period is assumed to be 30 (but it could be 7)
(1) If frequency is Weekly, then seasonal_period is assumed to be 52
(1) If frequency is Quarterly, then seasonal_period is assumed to be 4
(1) If frequency is Yearly, then seasonal_period is assumed to be 1
(1) If frequency is Hourly, then seasonal_period is assumed to be 24
(1) If frequency is Minutes, then seasonal_period is assumed to be 60
(1) If frequency is Seconds, then seasonal_period is assumed to be 60
Type is integer</li>
<li><b>conf_int (default=0.95)</b>: Confidence Interval for building the Prophet model. Default: 0.95. Type is float.</li>
<li><b>model_type (default: 'stats'</b>: The type(s) of model to build. Default to building only statistical models
Can be a string or a list of models. Allowed values are:
'best', 'prophet', 'stats', 'ARIMA', 'SARIMAX', 'VAR', 'ML'.
"prophet" will build a model using Prophet -> this means you must have Prophet installed
"stats" will build statsmodels based ARIMA, SARIMAX and VAR models
"ML" will build a machine learning model using Random Forests provided explanatory vars are given
'best' will try to build all models and pick the best one
If a list is provided, then only those models will be built
WARNING: "best" might take some time for large data sets. We recommend that you
choose a small sample from your data set before attempting to run entire data.
Type can be either: [string, list]
</li>
<li><b>verbose (default=0)</b>: Indicates the verbosity of printing (Default = 0). Type is integer.</li>
</ol>
### The next step after defining the model object is to fit it with some real data:
```
model.fit(
traindata=train_data,
ts_column=ts_column,
target=target,
cv=5,
sep=","
)
```
Here are how the parameters defined:
<ul>
<li><b>traindata (required)</b>: It can be either a dataframe or a file. You must give the name of the file along with its data path in case if a file. It also accepts a pandas dataframe in case you already have a dataframe loaded in your notebook.</li>
<li><b>ts_column (required)</b>: name of the datetime column in your dataset (it could be a name of column or index number in the columns index)</li>
<li><b>target (required)</b>: name of the column you are trying to predict. Target could also be the only column in your dataset</li>
<li><b>cv (default=5)</b>: You can enter any integer for the number of folds you want in your cross validation data set.
</li>
<li><b>sep (default=",")</b>: Sep is the separator in your traindata file. If your separator is ",", "\t", ";", make sure you enter it here. If not, it is ignored.</li>
</ul>
### The next step after training the model object is to make some predictions with test data:<br>
```
predictions = model.predict(
testdata = can be either a dataframe or an integer standing for the forecast_period,
model = 'best' or any other string that stands for the trained model
)
```
Here are how the parameters are defined. You can choose to send either testdata in the form of a dataframe or send in an integer to decide how many periods you want to forecast. You need only
<ul>
<li><b>testdata (required)</b>: It can be either a dataframe containing test data or you can use an integer standing for the forecast_period (you want).</li>
<li><b>model (optional, default = 'best')</b>: The name of the model you want to use among the many different models you have trained. Remember that the default is the best model. But you can choose any model that you want to forecast with. Type is String.</li>
</ul>
<h2 id="requirements">Requirements</h2>
<p>dask, scikit-learn, prophet, statsmodels, pmdarima, XGBoost</p>
<h2 id="license">License:</h2>
<p>Apache License 2.0</p>
<h2 id="Tips">Tips</h2>
<ul>
<li>We recommend that you choose a small sample from your data set before attempting to run entire data. and the evaluation metric so it can select the best model. Currently models within “stats” are compared using AIC and BIC. However, models across different types are compared using RMSE. The results of models are shown using RMSE and Normalized RMSE (ratio of RMSE to the standard deviation of actuals).</li>
<li>You must clean the data and not have any missing values. Make sure the target variable is numeric, otherwise, it won’t run. If there is more than one target variable in your data set, just specify only one for now, and if you know the time interval that is in your data, you can specify it. Otherwise it auto-ts will try to infer the time interval on its own.</li>
<li>If you give Auto_Timeseries a different time interval than what the data has, it will automatically resample the data to the given time interval and use the mean of the target for the resampled period.</li>
<li>Notice that except for filename and ts_column input arguments, which are required, all other arguments are optional.</li>
<li>Note that optionally you can give a separator for the data in your file. Default is comma (",").</li>
<li>“time_interval” options are any codes that you can find in this page below.
<a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timeseries-offset-aliases">Pandas date-range frequency aliases</a>
</li>
<li>Optionally, you can give seasonal_period as any integer that measures the seasonality in the data. If not given, seasonal_period is assumed automatically as follows: Months = 12, Days = 30, Weeks = 52, Qtr = 4, Year = 1, Hours = 24, Minutes = 60 and Seconds = 60.</li>
<li>If you want to give your own non-seasonal order, please input it as non_seasonal_pdq and for seasonal order, use seasonal_PDQ as the input. Use tuples. For example, seasonal_PDQ = (2,1,2) and non_seasonal_pdq = (0,0,3). It will accept only tuples. The default is None and Auto_Timeseries will automatically search for the best p,d,q (for Non Seasonal) and P, D, Q (for Seasonal) orders by searching for all parameters from 0 to 12 for each value of p,d,q and 0-3 for each P, Q and 0-1 for D.</li>
</ul>
<h2 id="disclaimer">DISCLAIMER:</h2>
<p>This is not an Officially supported Google project.</p>
<h2 id="copyright">Copyright</h2>
<p>© Google</p>
%package help
Summary: Development documents and examples for auto-ts
Provides: python3-auto-ts-doc
%description help
<h1 id="auto-ts">Auto_TS: Auto_TimeSeries</h1>
<p style="font-family:verdana">Automatically build multiple Time Series models using a Single Line of Code. Now updated with Dask.

`auto_timeseries` is a complex model building utility for time series data. Since it automates many
Tasks involved in a complex endeavor, it assumes many intelligent defaults. But you can change them.
Auto_Timeseries will rapidly build predictive models based on Statsmodels ARIMA, Seasonal ARIMA, Prophet
and Scikit-Learn ML. It will automatically select the best model which gives best score specified.
# Table of Contents
<ul>
<li><a href="#Latest">Latest updates</a></li>
<li><a href="#introduction">What is auto_ts</a></li>
<li><a href="#install">How to install auto_ts</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#requirements">Requirements</a></li>
<li><a href="#tips">Tips</a></li>
<li><a href="#license">License</a></li>
<li><a href="#copyright">Copyright</a></li>
<li><a href="#disclaimer">Disclaimer</a></li>
</ul>
## Latest
To know about the latest updates and features added to Auto_TS please go to this [page](updates.md).
<h2 id="introduction">Introduction</h2>
<p>Auto_TimeSeries enables you to build and select multiple time series models using techniques such as ARIMA, SARIMAX, VAR, decomposable (trend+seasonality+holidays) models, and ensemble machine learning models.</p>
<p>Auto_TimeSeries is an Automated ML library for time series data. Auto_TimeSeries was initially conceived and developed by <a href="https://www.linkedin.com/in/ram-seshadri-nyc-nj/">Ram Seshadri</a> and was significantly expanded in functionality and scope and upgraded to its present status by <a href="https://github.com/ngupta23">Nikhil Gupta</a>.</p>
<p>auto-ts.Auto_TimeSeries is the main function that you will call with your train data. You can then choose what kind of models you want: stats, ml or Prophet based model. You can also tell it to automatically select the best model based on the scoring parameter you want it to be based on. It will return the best model and a dictionary containing predictions for the number of forecast_periods you mentioned (default=2).
## Install
```
pip install auto-ts
```
Use `pip3 install auto-ts` if the above doesn’t work
```
pip install git+https://github.com/AutoViML/Auto_TS.git
```
### Installing on Colab
If you are using Colab or Kaggle kernel and want to install auto_ts, please use the following steps (otherwise you will get an error!):
```
!pip install auto-ts --no-deps --ignore-installed
!pip install 'fsspec>=0.3.3'
!pip install statsmodels --upgrade
!pip install pmdarima
```

### Installing on Windows
<p>Windows users may experience difficulties with the Prophet and pystan dependency installations. Because of this, we recommend installing Prophet using instructions from the <a hreff="https://facebook.github.io/prophet/docs/installation.html"> Prophet documentation page</a> prior to installing auto-ts. For Anaconda users, this can be accomplished via:
<ol>
<li><p><code> conda install -c conda-forge prophet </code> </p></li>
<li><p><code> pip install auto-ts </code> </p></li>
</ol>
<h2 id="usage">Usage</h2>
### First you need to import auto_timeseries from auto_ts library:<br>
```
from auto_ts import auto_timeseries
```
### Second, Initialize an auto_timeseries model object which will hold all your parameters:</p>
```
model = auto_timeseries(
score_type='rmse',
time_interval='Month',
non_seasonal_pdq=None, seasonality=False,
seasonal_period=12,
model_type=['Prophet'],
verbose=2)
```
#### Here are how the input parameters defined:<br>
<ol>
<li><b>score_type (default='rmse')</b>: The metric used for scoring the models. Type is string.
Currently only the following two types are supported:
(1) "rmse": Root Mean Squared Error (RMSE)
(2) "normalized_rmse": Ratio of RMSE to the standard deviation of actuals</li>
<li><b>time_interval (default is None)</b>: Used to indicate the frequency at which the data is collected.
This is used for two purposes (1) in building the Prophet model and (2) used to impute the seasonal period for SARIMAX in case it is not provided by the user (None). Type is String.
We use the following <a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timeseries-offset-aliases">pandas date range frequency</a> aliases that Prophet uses to make the prediction dataframe. <p>Hence, please note that these are the list of allowed aliases for frequency:
['B','C','D','W','M','SM','BM','CBM',
'MS','SMS','BMS','CBMS','Q','BQ','QS','BQS',
'A,Y','BA,BY','AS,YS','BAS,BYS','BH',
'H','T,min','S','L,ms','U,us','N']
For a start, you can test the following codes for your data and see how the results are:
<ul>
<li>'MS', 'M', 'SM', 'BM', 'CBM', 'SMS', 'BMS' for monthly frequency data</li>
<li> 'D', 'B', 'C' for daily frequency data </li>
<li> 'W' for weekly frequency data </li>
<li> 'Q', 'BQ', 'QS', 'BQS' for quarterly frequency data </li>
<li> 'A,Y', 'BA,BY', 'AS,YS', 'BAS,YAS' for yearly frequency data </li>
<li> 'BH', 'H', 'h' for hourly frequency data </li>
<li> 'T,min' for minute frequency data </li>
<li> 'S', 'L,milliseconds', 'U,microseconds', 'N,nanoseconds' for second frequency data </li>
</ul>
Or you can leave it as None and auto_timeseries will try and impute it.
</li>
<li><b>non_seasonal_pdq (default = (3,1,3))</b>: Indicates the maximum value of (p, d, q) to be used in the search for statistical ARIMA models.
If None, then the following values are assumed max_p = 3, max_d = 1, max_q = 3. Type is Tuple.</li>
<li><b>seasonality (default=False)</b>: Used in the building of the SARIMAX model only at this time. True or False. Type is bool.</li>
<li><b>seasonal_period (default is None)</b>: Indicates the seasonal period in your data. This depends on the peak (or valley) period that occurs regularly in your data.
Used in the building of the SARIMAX model only at this time.
There is no impact of this argument if seasonality is set to False
If None, the program will try to infer this from the time_interval (frequency) of the data
We assume the following as defaults but feel free to change them.
(1) If frequency is Monthly, then seasonal_period is assumed to be 12
(1) If frequency is Daily, then seasonal_period is assumed to be 30 (but it could be 7)
(1) If frequency is Weekly, then seasonal_period is assumed to be 52
(1) If frequency is Quarterly, then seasonal_period is assumed to be 4
(1) If frequency is Yearly, then seasonal_period is assumed to be 1
(1) If frequency is Hourly, then seasonal_period is assumed to be 24
(1) If frequency is Minutes, then seasonal_period is assumed to be 60
(1) If frequency is Seconds, then seasonal_period is assumed to be 60
Type is integer</li>
<li><b>conf_int (default=0.95)</b>: Confidence Interval for building the Prophet model. Default: 0.95. Type is float.</li>
<li><b>model_type (default: 'stats'</b>: The type(s) of model to build. Default to building only statistical models
Can be a string or a list of models. Allowed values are:
'best', 'prophet', 'stats', 'ARIMA', 'SARIMAX', 'VAR', 'ML'.
"prophet" will build a model using Prophet -> this means you must have Prophet installed
"stats" will build statsmodels based ARIMA, SARIMAX and VAR models
"ML" will build a machine learning model using Random Forests provided explanatory vars are given
'best' will try to build all models and pick the best one
If a list is provided, then only those models will be built
WARNING: "best" might take some time for large data sets. We recommend that you
choose a small sample from your data set before attempting to run entire data.
Type can be either: [string, list]
</li>
<li><b>verbose (default=0)</b>: Indicates the verbosity of printing (Default = 0). Type is integer.</li>
</ol>
### The next step after defining the model object is to fit it with some real data:
```
model.fit(
traindata=train_data,
ts_column=ts_column,
target=target,
cv=5,
sep=","
)
```
Here are how the parameters defined:
<ul>
<li><b>traindata (required)</b>: It can be either a dataframe or a file. You must give the name of the file along with its data path in case if a file. It also accepts a pandas dataframe in case you already have a dataframe loaded in your notebook.</li>
<li><b>ts_column (required)</b>: name of the datetime column in your dataset (it could be a name of column or index number in the columns index)</li>
<li><b>target (required)</b>: name of the column you are trying to predict. Target could also be the only column in your dataset</li>
<li><b>cv (default=5)</b>: You can enter any integer for the number of folds you want in your cross validation data set.
</li>
<li><b>sep (default=",")</b>: Sep is the separator in your traindata file. If your separator is ",", "\t", ";", make sure you enter it here. If not, it is ignored.</li>
</ul>
### The next step after training the model object is to make some predictions with test data:<br>
```
predictions = model.predict(
testdata = can be either a dataframe or an integer standing for the forecast_period,
model = 'best' or any other string that stands for the trained model
)
```
Here are how the parameters are defined. You can choose to send either testdata in the form of a dataframe or send in an integer to decide how many periods you want to forecast. You need only
<ul>
<li><b>testdata (required)</b>: It can be either a dataframe containing test data or you can use an integer standing for the forecast_period (you want).</li>
<li><b>model (optional, default = 'best')</b>: The name of the model you want to use among the many different models you have trained. Remember that the default is the best model. But you can choose any model that you want to forecast with. Type is String.</li>
</ul>
<h2 id="requirements">Requirements</h2>
<p>dask, scikit-learn, prophet, statsmodels, pmdarima, XGBoost</p>
<h2 id="license">License:</h2>
<p>Apache License 2.0</p>
<h2 id="Tips">Tips</h2>
<ul>
<li>We recommend that you choose a small sample from your data set before attempting to run entire data. and the evaluation metric so it can select the best model. Currently models within “stats” are compared using AIC and BIC. However, models across different types are compared using RMSE. The results of models are shown using RMSE and Normalized RMSE (ratio of RMSE to the standard deviation of actuals).</li>
<li>You must clean the data and not have any missing values. Make sure the target variable is numeric, otherwise, it won’t run. If there is more than one target variable in your data set, just specify only one for now, and if you know the time interval that is in your data, you can specify it. Otherwise it auto-ts will try to infer the time interval on its own.</li>
<li>If you give Auto_Timeseries a different time interval than what the data has, it will automatically resample the data to the given time interval and use the mean of the target for the resampled period.</li>
<li>Notice that except for filename and ts_column input arguments, which are required, all other arguments are optional.</li>
<li>Note that optionally you can give a separator for the data in your file. Default is comma (",").</li>
<li>“time_interval” options are any codes that you can find in this page below.
<a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timeseries-offset-aliases">Pandas date-range frequency aliases</a>
</li>
<li>Optionally, you can give seasonal_period as any integer that measures the seasonality in the data. If not given, seasonal_period is assumed automatically as follows: Months = 12, Days = 30, Weeks = 52, Qtr = 4, Year = 1, Hours = 24, Minutes = 60 and Seconds = 60.</li>
<li>If you want to give your own non-seasonal order, please input it as non_seasonal_pdq and for seasonal order, use seasonal_PDQ as the input. Use tuples. For example, seasonal_PDQ = (2,1,2) and non_seasonal_pdq = (0,0,3). It will accept only tuples. The default is None and Auto_Timeseries will automatically search for the best p,d,q (for Non Seasonal) and P, D, Q (for Seasonal) orders by searching for all parameters from 0 to 12 for each value of p,d,q and 0-3 for each P, Q and 0-1 for D.</li>
</ul>
<h2 id="disclaimer">DISCLAIMER:</h2>
<p>This is not an Officially supported Google project.</p>
<h2 id="copyright">Copyright</h2>
<p>© Google</p>
%prep
%autosetup -n auto_ts-0.0.71
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-auto-ts -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.71-1
- Package Spec generated
|