Metadata-Version: 2.1
Name: TimesML
Version: 0.0.3
Summary: This package is used for time series data analysis. Added a variety of drawing functions, evaluation indicators, and simple moving average. Delete the moving average model.
Home-page: https://github.com/leodflag/TimesML
Author: leodflag
Author-email: lovedoglion5@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.6
Description-Content-Type: text/markdown

# TimesML
---
## About
This package was developed for time series data analysis and machine learning tasks. The aim of TimesML is to provide high-level APIs that developers and data scientists can easily model their times series data. We plan to support more machine learning models in the future. Thank you for your support, please star⭐ this project if you like.

## PypI
https://pypi.org/project/TimesML
```js
pip install TimesML
```

## List of module
#### Math
* Statistics

    This module contains statistics calculation function.

    ex. mean_square_error、coefficient_of_determination、
        ACF

#### TimeSeriesAnalysis
* Chart

    Time series data related drawing function.

    ex. statistics_infographic、ACF_chart、forecast_result_group_chart

* Model

    This module contains time series models for forecasting.

    ex. AutoRegressive、SimpleMovingAverage

* ProcessData

    This module contains the access and processing methods of time series data.

    ex. get_data_yahoo、n_order_difference_data、split_data

#### Test Data
Please download the file 'g20_new_c.csv'  first for the following simple example.
https://github.com/leodflag/TimesML/tree/master/test_data

## Simple example
```js
import TimeSeriesAnalysis.ProcessData as Data
import TimeSeriesAnalysis.Model as Model
import TimeSeriesAnalysis.Chart as Chart

# setting parameters
save_path = 'US'
chart = Chart.chart('US')

# read data
data = Data.read_file(path='g20_new_c.csv', col_name='US')

# contains basic statistics: historocal trend line chart、lag plot、ACF chart. figure 1.
chart.statistics_infographic(data, file_path=save_path, lags=20, xlabel='date', ylabel='population')

# split data into training set and test set
train, test = Data.split_data(data, ratio=0.7)

# autoregressive lag periods :2
model1 = Model.AutoRegressive(lags=2)
model1.fit(train)
model1.predict(test, pure_test_set_predict=True)

# autoregressive lag periods :20
model2 = Model.AutoRegressive(lags=20)
model2.fit(train)
model2.predict(test,pure_test_set_predict= True)

# Save the data predicted by model1 using the test set
Data.save_flie(model1.test_predict, path=save_path, stock_id='US', file_format='csv')

# Combine and compare the prediction results of the two models. figure 2.
chart.forecast_result_group_chart(train, test, model, model1, file_path=save_path, 
model_1_name='AR(2)', model_2_name='AR(20)', xlabel='date', ylabel='population')

# simple moving average. five days as a unit to calculate the average
model2 = Model.SimpleMovingAverage(windows=5)
model2.fit(data)

# line chart to observe the average situation every five days. figure 3.
chart.line_chart(data, model2.sma_result, chart_title='SMA(5)', file_path=save_path, xlabel='date', ylabel='price')
```

## TimesML (github)
https://github.com/leodflag/TimesML

## MIT License



