TSML is in the Julia Official package registry. The latest release can be installed at the Julia prompt using Julia's package management which is triggered by pressing
] at the julia prompt:
julia> ] (v1.1) pkg> add TSML
Or, equivalently, via the
julia> using Pkg julia> Pkg.add("TSML")
TSML is tested and actively developed on Julia
1.0 and above for Linux and macOS.
There is no support for Julia versions
TSML (Time Series Machine Learning) is package for Time Series data processing, classification, and prediction. It combines ML libraries from Python's ScikitLearn, R's Caret, and Julia using a common API and allows seamless ensembling and integration of heterogenous ML libraries to create complex models for robust time-series prediction.
The package assumes a two-column table composed of Dates and Values. The first part of the workflow aggregates values based on the specified date/time interval which minimizes occurence of missing values and noise. The aggregated data is then left-joined to the complete sequence of dates in a specified date/time interval. Remaining missing values are replaced by k nearest neighbors where k is the symmetric distance from the location of missing value. This approach can be called several times until there are no more missing values.
The next part extracts the date features and convert the values into matrix form parameterized by the size and stride of the sliding window representing the dimension of the input for ML training and prediction.
The final part combines the date features and the matrix of values as input to the ML with the output representing the values of the time periods to be predicted ahead of time.
TSML uses a pipeline which iteratively calls the fit and transform families of functions relying on multiple dispatch to select the correct algorithm from the steps outlined above.
Machine learning functions in TSML are wrappers to the corresponding Scikit-learn, Caret, and native Julia ML libraries. There are more than hundred classifiers and regression functions available using a common API.
Generally, you will need the different transformers and utils in TSML for time-series processing. To use them, it is standard in TSML code to have the following declared at the topmost part of your application:
using TSML using TSML.TSMLTransformers using TSML.TSMLTypes using TSML.Utils
using TSML: DataReader, DateValgator, DateValNNer using TSML: Statifier, Monotonicer, Outliernicer
fname = joinpath(dirname(pathof(TSML)),"../data/testdata.csv")
csvreader = DataReader(Dict(:filename=>fname,:dateformat=>"dd/mm/yyyy HH:MM")) valgator = DateValgator(Dict(:dateinterval=>Dates.Hour(1))) # aggregator valnner = DateValNNer(Dict(:dateinterval=>Dates.Hour(1))) # imputer stfier = Statifier(Dict(:processmissing=>true)) # get statistics mono = Monotonicer(Dict()) # normalize monotonic data outnicer = Outliernicer(Dict(:dateinterval => Dates.Hour(1))) # normalize outliers
- #### Load csv data, aggregate, and get statistics
mpipeline1 = Pipeline(Dict( :transformers => [csvreader,valgator,stfier] ) ) fit!(mpipeline1) respipe1 = transform!(mpipeline1)
- #### Load csv data, aggregate, impute, and get statistics
mpipeline2 = Pipeline(Dict( :transformers => [csvreader,valgator,valnner,stfier] ) ) fit!(mpipeline2) respipe2 = transform!(mpipeline2)
- #### Load csv data, aggregate, impute, and normalize outliers
mpipeline2 = Pipeline(Dict( :transformers => [csvreader,valgator,valnner,outnicer] ) ) fit!(mpipeline2) respipe2 = transform!(mpipeline2)
- #### Load csv data, aggregate, impute, and normalize monotonic data
mpipeline2 = Pipeline(Dict( :transformers => [csvreader,valgator,valnner,mono] ) ) fit!(mpipeline2) respipe2 = transform!(mpipeline2)
## Feature Requests and Contributions We welcome contributions, feature requests, and suggestions. Here is the link to open an [issue][issues-url] for any problems you encounter. If you want to contribute, please follow the guidelines in [contributors page][contrib-url]. ## Help usage Usage questions can be posted in: - [Julia Community](https://julialang.org/community/) - [Gitter TSML Community][gitter-url] - [Julia Discourse forum][discourse-tag-url]
about 2 months ago