
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
A codebook solution for time series data compression and feature extraction considering rebound effect
FD_codepy is an open-source python package that can be used to extract time series in an interpretable manner, and use it for compression.
The key idea is proposed specifically for metered data in energy sector, but can also be used with smart sensors and edge computing.
Inspired by Codebook method, it breaks down the time series data into its constituent parts, i.e., the unique sub-patterns called Codewords, and the index of the Codewords, i.e., representations, allowing for efficient compression and analysis.
Compared to resampling data into lower resolution, this lossy compression method takes similar data storage and transmission bandwidth, while preserving high frequency information and accumulative/average metered values.
Get a high level idea of the problem from our article published by The Conversation:
The FD_codepy source code is on GitHub: https://github.com/abc123yuanrui/FD_codepy/
Codebook
: key class for reconstructing long energy time series into unique partitions (codewords) and representations. Check examples for details.
'euclidean'
)'DTW'
)'Wasserstein'
)'flexibilityD'
)preprocessing
method will normalise the data into normalised series as attribute normalized_arr
, with the scaler attribute scaler_average
get_distance_matrix
method is a statistical analysis that computes the distance matrix for long time series (assuming we know historical data). It returns the matrix and quantile result for setting a similarity threshold (otherwise, the threshold can be set by an empirical value).desolve_time_series_thre
process the time seires into codewords
and representations
, return them.post_processing
reconstructe time series based on codewords and representations, the result stores as attribute recovered_series
Codebook.flex_distance
is a static function for getting FD between the two given time series.
fd = Codebook.flex_distance(series_a, series_b)
which provides fd by default settingsfd, row_index, col_index = Codebook.flex_distance(series_a, series_b, route = True)
. It probvides the reshaping strage from series a to series bfd = Codebook.flex_distance(series_a, series_b, weighted_matix_a, weighted_matix_b, route = False)
from fdcodepy.utils.helpers import distance_method_routing_analysis
distance_method_routing_analysis(series_a, series_b, methods.Code_book, report = True)
export_dir
variable of the function distance_method_routing_analysis
pip install fdcodepy
import fdcodepy
from fdcodepy import methods
sample_series = np.random.uniform(0, 30, 365*24)
series_codebook = methods.Code_book(time_series, 24, 'flexibilityD')
series_codebook.pre_processing()
distance_matrix, quantiles = series_codebook.get_distance_matrix()
codewords, representations = series_codebook.desolve_time_series_thre(quantiles[0])
series_codebook.post_processing()
series_codebook.recovered_series
is the reconstruted data, computed from the representations with only lenght of len(representations)
, compared to original series with length len(sample_series)
from fdcodepy.utils.helpers import code_book_processing_analysis
code_book_processing_analysis(series_codebook, time_index, report = True, export_dir = '.')
FlexibilityDistance
to compute the flexibility distance between two time series datasets (with default settings).
from fdcodepy import methods
Code_book.flex_distance(time_series_1, time_series_2)
The figures can be zoomed to for checking details
FAQs
A codebook solution for time series data compression and feature extraction considering rebound effect
We found that fdcodepy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.