Skip to main content

This package is used for time series data analysis. Correct internal errors of functions, such as Statistics.normalized_mean_squard_error, Statistics.coefficient_of_determination.

Project description

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

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

Pay attention to the file path,'g20_new_c.csv' should belong to the same file level as the simple example program.

Simple example

import TimeSeriesAnalysis.ProcessData as Data
import TimeSeriesAnalysis.Model as Model
import TimeSeriesAnalysis.Chart as Chart
import Math.Statistics as math
# setting parameters
save_path = 'US'
chart = Chart.chart('US')

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

# contains basic statistics: historocal trend line chartlag plotACF 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.8)

# 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_AR(2)_predict', file_format='csv')

# Combine and compare the prediction results of the two models. figure 2.
chart.forecast_result_group_chart(train, test, model1, model2, 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
model3 = Model.SimpleMovingAverage(windows=5)
model3.fit(data)

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

TimesML (github)

https://github.com/leodflag/TimesML

References

  • Test data set : g20_new_c.csv
    • Dong E, Du H, Gardner L. An interactive web-based dashboard to track COVID-19 in real time. Lancet Inf Dis. 20(5):533-534. doi: 10.1016/S1473-3099(20)30120-1
  • Use requests crawl yahoo finance stock price

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TimesML-0.0.7.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TimesML-0.0.7-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file TimesML-0.0.7.tar.gz.

File metadata

  • Download URL: TimesML-0.0.7.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for TimesML-0.0.7.tar.gz
Algorithm Hash digest
SHA256 12da1d39c7e28d93ae6e400cca1fac8e1494fbb8c696bd6bdf1b07f99e69ab77
MD5 9205635a59af5603b295bdff3d6a5afd
BLAKE2b-256 509106a0db361fabb3e60340375836d5bcf153421fc572bf5d461e078dab2584

See more details on using hashes here.

File details

Details for the file TimesML-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: TimesML-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for TimesML-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fd2f2d6de6977d93e5e9a4bf078aa4c84e50e5a236d6bb252ffede862c6e7abf
MD5 8c63083d58b9490ec52e717fb42e4c6e
BLAKE2b-256 40793c615ca24b3deadde2abb279e8d8d1df46cbc55b911a831381512cbe9205

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page