liveBook · Manning

Trend detection

As explained in Data-Driven Cybersecurity

Trend analysis is the examination of changes and patterns in data over time to identify direction, persistence, or emerging developments.

Trend detection, or trend analysis, examines a metric over time to see whether it increases, decreases, or stays steady. In cybersecurity, it helps teams spot changing incident patterns and prioritize defenses. section 2.3.1 section 2.3

Make a trend useful for security decisions:

  • Choose a metric that is relevant to organizational goals and can support actionable decisions. section 3.2.2
  • Track it over time and compare the pattern with past performance or a baseline. section 3.2.2
  • Use the observed direction to inform priorities, then assess whether security measures need adjustment. section 2.3.1 section 11.1.1

Rising phishing attempts

A year of monthly data shows phishing attempts rising from 23 in January to 90 in December. This increase supports prioritizing stronger email controls and additional employee awareness training. section 2.3.1

Listing 2.1 Using trend analysis to create a simple line plot
import pandas as pd    #1
import matplotlib.pyplot as plt    #2

# Example dataset: Phishing attempts recorded over 12 months
data = {'Month': ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 
   'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],    #3
        'Phishing_Attempts': [23, 25, 30, 35, 40, 45, 50, 60, 7
   5, 80, 85, 90]}    #3

df = pd.DataFrame(data)    #4

# Plotting the trend
plt.figure(figsize=(10, 6))    #5
plt.plot(df['Month'], df['Phishing_Attempts'], marker='o', 
 linestyle='-', color='blue')    #6
plt.title('Monthly Trend of Phishing Attempts')    #7
plt.xlabel('Month')    #8
plt.ylabel('Number of Phishing Attempts')    #9
plt.grid(True)    #10
plt.show()    #11

The listing uses pandas to hold monthly phishing counts and Matplotlib to plot their trend as a line chart. section 2.3.1

How Data-Driven Cybersecurity covers it

How deep it goes
Explains direction over time and demonstrates a line plot, without deriving statistical models.
Examples
Plots monthly phishing attempts across a year and uses the increase to motivate stronger email controls and awareness training.
What you can do after
Apply it via pandas and Matplotlib to plot monthly phishing counts and recommend controls from the observed increase.
How it connects
Connects trend analysis with cybersecurity metrics, benchmarking, forecasting, and continuous improvement.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data-Driven Cybersecurity. The section links point to the parts of the book it draws on.