time_domain_features¶
Module: missions.nodes.feature_generation.time_domain_features
¶
Extract features in time domain like simple amplitudes, signal differentiation or polynomial fit
Inheritance diagram for pySPACE.missions.nodes.feature_generation.time_domain_features
:
Class Summary¶
TimeDomainFeaturesNode ([datapoints, absolute]) |
Use the samples of the time series as features |
CustomChannelWiseFeatureNode (...) |
Use the result of a transformation of the time series as features. |
TimeDomainDifferenceFeatureNode ([...]) |
Use differences between channels and/or times as features. |
SimpleDifferentiationFeatureNode ([...]) |
Use differences between successive times on the same channel. |
LocalStraightLineFeatureNode (segment_width, ...) |
Fit straight lines to channel segments and uses coefficients as features. |
Classes¶
TimeDomainFeaturesNode
¶
-
class
pySPACE.missions.nodes.feature_generation.time_domain_features.
TimeDomainFeaturesNode
(datapoints=None, absolute=False, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.base_node.BaseNode
Use the samples of the time series as features
This node uses the values of the channels at certain points of time within the window directly as features.
Parameters
datapoints: The indices of the data points that are used as features. If None, all data points are used.
(optional, default: None)
absolute: If True, the absolute value of each amplitude value is used. Recommended for classification using only the EMG signal.
(optional, default: False)
Exemplary Call
- node : Time_Domain_Features parameters : datapoints : [-4,-3,-2,-1] # means last 4 samples
Author: Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)
Created: 2008/08/26
Revised: 2009/07/16
POSSIBLE NODE NAMES: - TimeDomainFeaturesNode
- TDF
- Time_Domain_Features
- TimeDomainFeatures
POSSIBLE INPUT TYPES: - TimeSeries
Class Components Summary
__hyperparameters
_execute
(x)Extract the TD features from the given data x input_types
-
__hyperparameters
= set([NoOptimizationParameter<kwargs_warning>, NoOptimizationParameter<dtype>, NoOptimizationParameter<output_dim>, NoOptimizationParameter<retrain>, NoOptimizationParameter<input_dim>, NoOptimizationParameter<store>, BooleanParameter<absolute>])¶
-
input_types
= ['TimeSeries']¶
CustomChannelWiseFeatureNode
¶
-
class
pySPACE.missions.nodes.feature_generation.time_domain_features.
CustomChannelWiseFeatureNode
(feature_function, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.feature_generation.time_domain_features.TimeDomainFeaturesNode
Use the result of a transformation of the time series as features.
This node applies a given transformation to the data of each individual data channel. The result is consequently used as features.
Parameters
feature_function: A string that defines the transformation of the univariate time series. This string will be evaluated in a eval('lambda x:' + feature_function)
statement. Therefore,'x'
has to be used as placeholder for the input data. The output has to be array-like, dimensions do not matter. Note that numpy can directly be used. To use other external libraries, use, e.g., the following syntax:"__import__('statsmodels.tsa.api').tsa.api.AR(x).fit(maxlag=3).params[1:]"
Note
The datapoints parameter provided by the TimeDomainFeaturesNode can also be used here. The absolute parameter, however, is not supported. If the absolute value shall be computed, this can be done in the feature_function.Exemplary Call
- node : Custom_Features parameters : feature_function : "numpy.dot(x,x)"
Author: David Feess (david.feess@dfki.de)
Created: 2012/07/29
POSSIBLE NODE NAMES: - CustomChannelWiseFeatureNode
- CustomChannelWiseFeature
- Custom_Features
POSSIBLE INPUT TYPES: - TimeSeries
Class Components Summary
__hyperparameters
_execute
(x)Extract the TD features from the given data x input_types
-
__hyperparameters
= set([NoOptimizationParameter<kwargs_warning>, NoOptimizationParameter<dtype>, NoOptimizationParameter<output_dim>, NoOptimizationParameter<retrain>, NoOptimizationParameter<input_dim>, NoOptimizationParameter<store>, NoOptimizationParameter<absolute>])¶
-
input_types
= ['TimeSeries']¶
TimeDomainDifferenceFeatureNode
¶
-
class
pySPACE.missions.nodes.feature_generation.time_domain_features.
TimeDomainDifferenceFeatureNode
(datapoints=None, moving_window_length=1, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.base_node.BaseNode
Use differences between channels and/or times as features.
This node uses differences between channels (Inter_Channel) at the same time and between different times (Intra_Channel) on the same channel as features.
Parameters
datapoints: The indices of the data points that are used. If None, all data points are used.
(Optional, default: None)
moving_window_length: If this parameter is greater than one, then not the data point x[i] is used but the average of the k=*moving_window_length* elements around x[i], i.e. avg([x[i-k/2],...,x[i+k/2]).
(Optional, default: 1)
- Known issues
- In the current version this produces to much data, even just for one choice.
Exemplary Call
- node : Time_Domain_Difference_Features parameters : datapoints : None moving_window_length : 1
Author: Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)
Created: 2008/08/26
Revised: 2009/07/16
POSSIBLE NODE NAMES: - Time_Domain_Difference_Features
- TimeDomainDifferenceFeatureNode
- TimeDomainDifferenceFeature
POSSIBLE INPUT TYPES: - TimeSeries
Class Components Summary
_execute
(x)Extract the TD features from the given data x input_types
-
input_types
= ['TimeSeries']¶
SimpleDifferentiationFeatureNode
¶
-
class
pySPACE.missions.nodes.feature_generation.time_domain_features.
SimpleDifferentiationFeatureNode
(datapoints=None, moving_window_length=1, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.base_node.BaseNode
Use differences between successive times on the same channel.
This node uses differences between successive times on the same channel of the time series as features to simulate differentiation.
Parameters
datapoints: The indices of the data points that are used. If None, all data points are used.
(Optional, default: None)
moving_window_length: If this parameter is greater than one, then not the data point x[i] is used but the average of the k=*moving_window_length* elements around x[i], i.e. avg([x[i-k/2],...,x[i+k/2]).
(Optional, default: 1)
- Known Issues
Exemplary Call
- node : Derivative_Features parameters : datapoints : None moving_window_length : 1
Author: Mario Krell (Mario.Krell@dfki.de)
POSSIBLE NODE NAMES: - SimpleDifferentiationFeatureNode
- SimpleDifferentiationFeature
- Derivative_Features
POSSIBLE INPUT TYPES: - TimeSeries
Class Components Summary
_execute
(x)Extract the TD features from the given data x input_types
-
input_types
= ['TimeSeries']¶
LocalStraightLineFeatureNode
¶
-
class
pySPACE.missions.nodes.feature_generation.time_domain_features.
LocalStraightLineFeatureNode
(segment_width, stepsize, coefficients_used=[0, 1], *args, **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.base_node.BaseNode
Fit straight lines to channel segments and uses coefficients as features.
Fit first order polynomials (straight lines) to subsegments of the channels and use the learned coefficients as features.
Parameters
segment_width: The width of the segments (in milliseconds) to which straight lines are fitted.
Note
segment_width is rounded such that it becomes a multiple of the sampling interval.
stepsize: The time (in milliseconds) the segments are shifted. Extracted segments are [0, segment_width], [stepsize, segment_width+stepsize], [2*stepsize, segment_width+2*stepsize], ...
Note
stepsize is rounded such that it becomes a multiple of the sampling interval.
coefficients_used: List of the coefficients of the straight line that are actually used as features. The offset of the straight line is the coefficient 0 and the slope is coefficient 1. Per default, both are used as features.
(optional, default: [0, 1])
Exemplary Call
- node : Local_Straightline_Features parameters : segment_width : 1000 stepsize : 1000
Author: Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)
Created: 2011/01/04
Refactored: 2012/01/18
POSSIBLE NODE NAMES: - LocalStraightLineFeature
- LocalStraightLineFeatureNode
- Local_Straightline_Features
POSSIBLE INPUT TYPES: - TimeSeries
Class Components Summary
__hyperparameters
_execute
(data)input_types
-
input_types
= ['TimeSeries']¶
-
__hyperparameters
= set([NoOptimizationParameter<input_dim>, NoOptimizationParameter<dtype>, NoOptimizationParameter<output_dim>, QUniformParameter<segment_width>, NoOptimizationParameter<retrain>, QUniformParameter<stepsize>, NoOptimizationParameter<kwargs_warning>, NoOptimizationParameter<store>, ChoiceParameter<coefficients_used>])¶