Close Menu
    Trending
    • Credit Risk Scoring for BNPL Customers at Bati Bank | by Sumeya sirmula | Jul, 2025
    • The New Career Crisis: AI Is Breaking the Entry-Level Path for Gen Z
    • Musk’s X appoints ‘king of virality’ in bid to boost growth
    • Why Entrepreneurs Should Stop Obsessing Over Growth
    • Implementing IBCS rules in Power BI
    • What comes next for AI copyright lawsuits?
    • Why PDF Extraction Still Feels LikeHack
    • GenAI Will Fuel People’s Jobs, Not Replace Them. Here’s Why
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Machine Learning»Log Transformation in Time Series Data Normalization | by Mohcen elmakkaoui | Jun, 2025
    Machine Learning

    Log Transformation in Time Series Data Normalization | by Mohcen elmakkaoui | Jun, 2025

    Team_AIBS NewsBy Team_AIBS NewsJune 19, 2025No Comments3 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Definition

    Log transformation entails making use of the logarithm perform to every information level in a time sequence. Mathematically, if x_t ​ represents the unique worth at time t, the remodeled worth y_t is:

    the place:

    • log⁡ is normally the pure logarithm (base e), however base 10 or 2 may also be used relying on the context.
    • c is a small fixed added to keep away from taking the logarithm of zero or damaging values (generally, c=1).

    Why Add a Fixed c?

    Because the logarithm of zero or damaging numbers is undefined, including a relentless ensures that every one enter values are optimistic and legitimate for the transformation. That is particularly vital for time sequence information which will comprise zero or small values.

    Results of Log Transformation

    • Compresses massive values: The logarithm grows slowly because the enter will increase, which compresses the size of huge values greater than small values. This reduces the influence of utmost values or outliers.
    • Stabilizes variance: Many time sequence exhibit rising variance with time (heteroscedasticity). Log transformation helps make the variance extra fixed, satisfying assumptions for a lot of statistical fashions.
    • Transforms multiplicative relationships into additive ones: If a time sequence has multiplicative seasonality or tendencies (e.g., progress by proportion), the log remodel converts these into additive results, that are simpler to mannequin and interpret.

    Instance

    Suppose a time sequence accommodates the values:
    [10,100,1000,10000]

    Making use of the pure log remodel:

    log⁡([10,100,1000,10000])=[2.30,4.61,6.91,9.21]

    Discover how the distinction between massive values shrinks, making the sequence simpler to research.

    import pandas as pd
    import numpy as np
    import matplotlib.pyplot as plt

    # Pattern time sequence information with some zeros
    information = {'worth': [10, 50, 0, 200, 1000, 5000, 0, 10000]}
    ts = pd.Sequence(information['value'])

    # Add a small fixed to keep away from log(0)
    fixed = 1

    # Apply log transformation
    log_transformed = np.log(ts + fixed)

    # Show authentic and remodeled information
    df = pd.DataFrame({'Unique': ts, 'Log Reworked': log_transformed})

    print(df)

    # Plotting for visualization
    plt.determine(figsize=(10, 4))
    plt.plot(ts, label='Unique')
    plt.plot(log_transformed, label='Log Reworked')
    plt.legend()
    plt.title('Log Transformation of Time Sequence Knowledge')
    plt.present()

    • We add fixed = 1 to keep away from points with zeros.
    • We use np.log() to use the pure logarithm.
    • The plot reveals how the transformation compresses massive values and stabilizes the sequence.

    Log transformation is a robust and broadly used approach for normalizing time sequence information, particularly when coping with exponential progress, multiplicative seasonality, or heteroscedasticity. By compressing massive values and stabilizing variance, it makes the info extra appropriate for modeling and improves the accuracy and reliability of forecasting strategies. Whereas easy to implement, care have to be taken to deal with zero or damaging values appropriately, usually by including a small fixed earlier than transformation. General, log transformation is an important preprocessing step that may considerably improve the efficiency of time sequence evaluation and predictive modeling.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow 3D-printed guns are spreading online
    Next Article Beyond Model Stacking: The Architecture Principles That Make Multimodal AI Systems Work
    Team_AIBS News
    • Website

    Related Posts

    Machine Learning

    Credit Risk Scoring for BNPL Customers at Bati Bank | by Sumeya sirmula | Jul, 2025

    July 1, 2025
    Machine Learning

    Why PDF Extraction Still Feels LikeHack

    July 1, 2025
    Machine Learning

    🚗 Predicting Car Purchase Amounts with Neural Networks in Keras (with Code & Dataset) | by Smruti Ranjan Nayak | Jul, 2025

    July 1, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    Credit Risk Scoring for BNPL Customers at Bati Bank | by Sumeya sirmula | Jul, 2025

    July 1, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    How to Measure the Reliability of a Large Language Model’s Response

    February 13, 2025

    Cracking the code of spatio-temporal patterns in time series data | by Katy | Mar, 2025

    March 20, 2025

    Want Your Personal Brand to Stand Out in 2025? Do This.

    March 11, 2025
    Our Picks

    Credit Risk Scoring for BNPL Customers at Bati Bank | by Sumeya sirmula | Jul, 2025

    July 1, 2025

    The New Career Crisis: AI Is Breaking the Entry-Level Path for Gen Z

    July 1, 2025

    Musk’s X appoints ‘king of virality’ in bid to boost growth

    July 1, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.