Feature Engineering
Simple Machine Learning Tool Kit package
This package contains the modules to simplify your code for your feature engineering processes.
It is part of the educational repositories (https://github.com/pandle/materials) to learn how to write stardard code and common uses of the TDD.
Package contents two classes to manage feature engineering.
>>> import smltk
>>> help(smltk)
>>> from smltk.feature_engineering import Indicator
>>> help(Indicator)
# license MIT # support https://github.com/bilardi/smltk/issues
The class Indicator contains the tool kit to calculate the principal indicators. |
Indicators Tool Kit
Compute all relevant Directional Change parameters |
|
Get only Directional Changes starts |
|
Plot image with directional changes |
Detailed list
- class smltk.feature_engineering.Indicator(params={})
The class Indicator contains the tool kit to calculate the principal indicators.
- Arguments: params (dict) with the keys below
- events (list[str]):
list of directional change events
- timeseries (list[int|float]):
list of values, default None
Here’s an example:
>>> from smltk.feature_engineering import Indicator >>> timeseries = numpy.array() >>> indicator = Indicator() >>> dc_events = indicator.get_dc_events(timeseries) >>> print(dc_events) array['upward dc', 'downward dc', ..]
- get_dc_events(timeseries: array = None, threshold: float = 0.0001) list
Compute all relevant Directional Change parameters
- Arguments:
- timeseries (list[int|float]):
list of values
- threshold (float):
default is 0.0001
- Returns:
list of directional change events
- get_dc_events_ends(events: list = None, timeseries: list = None) dict
Get only Directional Changes ends
- Arguments:
- events (list[str]):
list of directional change events
- timeseries (list[int|float]):
list of values
- Returns:
dictionary of boolean lists when each directional change events ends
- get_dc_events_starts(events: list = None, timeseries: list = None) dict
Get only Directional Changes starts
- Arguments:
- events (list[str]):
list of directional change events
- timeseries (list[int|float]):
list of values
- Returns:
dictionary of boolean lists when each directional change events starts
- plot_dc(params: dict = {}, return_ax=False)
Plot image with directional changes
- Arguments: params (dict) with the keys below
- dc_colors (dict):
key-value about each event-color of directional change
- events (list[str]):
list of events names for time point
- timeseries (list[float]):
list of values
- timestamp (list[int|datetime]):
time point list
- figsize (tuple):
default (10, 5)
- title (str):
title of plot
- x_axis_label (str):
label of x axis
- y_axis_label (str):
label of y axis
- Returns:
plot or its object