> ## Documentation Index
> Fetch the complete documentation index at: https://aegean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Detecting a Grid Anomaly from Regression Residuals

> Set up your development environment, then use a frozen ridge regression to find the February 2021 Texas grid failure in its residuals.

## Grading

| Component               | Points |
| ----------------------- | ------ |
| Nickname                | 5      |
| Development environment | 25     |
| Grid anomaly detection  | 70     |

## Nickname

Change your nickname in the Discord server to your full name, first and last. This is how we identify you.

## Development Environment Setup

Please refer to the [Development Environment Guide](/aiml-common/resources/environment/index) for setup instructions. After you clone or import the [class github repo](https://github.com/pantelis/eng-ai-agents) you need to provide proof that your development environment is correctly setup:

1. [Complete this notebook to verify that Torch is running properly inside the docker container.](https://colab.research.google.com/github/pantelis/eng-ai-agents/blob/main/notebooks/assignments/devenv/index.ipynb). Note that you need to consult the repos Pull Requests if you are on a Apple M silicon platform.

2. Create an account on Hugging Face and provide a screenshot of your profile.

Screenshots must be stored as `.png` files, named `dev-environment-docker-xyz.png`, and located under the assignment submission folder in your cloned class repo.

## Grid Anomaly Detection

In February 2021 Winter Storm Uri broke the Texas grid. Temperatures collapsed, generation failed, and ERCOT began shedding load in the early hours of 15 February. Around 4.5 million homes and businesses lost power and hundreds of people died. Background is in the [2021 Texas power crisis](https://en.wikipedia.org/wiki/2021_Texas_power_crisis) article.

You will build a model of ordinary grid behaviour, freeze it, and decide whether its residuals separate that week from a normal week.

The model is the ridge regression from the [linear regression](/aiml-common/lectures/regression/linear-regression) and [SGD](/aiml-common/lectures/regression/linear-regression/sgd/sgd_sinusoidal_dataset) pages. Only the design matrix changes. You will add temperature, calendar indicators, and interactions between them, and fit it by stochastic gradient descent.

### What you will need

The notebook reads real ERCOT data from the gridstatus.io API. You need a `GRIDSTATUS_API_KEY` in your environment. Ask on Discord if you do not have one.

### Assignment Notebook

<Card title="Open Notebook in Colab" icon="google" href="https://colab.research.google.com/github/pantelis/eng-ai-agents/blob/main/notebooks/assignments/topics/linear-regression/grid-anomaly-detection/grid-anomaly-detection.ipynb">
  Grid Anomaly Detection Notebook
</Card>

## Submitting

Commit the notebook to your own private clone of the [class repo](https://github.com/pantelis/eng-ai-agents), under `assignments/assignment-1`. Save all cell outputs before you commit. A notebook without outputs is graded as if the cells never ran.

Then submit the complete GitHub URL of that directory, not of the repository root, to Canvas or Brightspace.

The [assignment submission guide](/aiml-common/resources/environment/assignment-submission) covers the rest: setting up your clone, adding the TAs as collaborators, and the README each assignment folder needs.

***

<Callout icon="pen-to-square" iconType="regular">
  [Edit this page on GitHub](https://github.com/aegean-ai/eaia/edit/main/src/aiml-common/assignments/main/ai-fall-2026/assignment-1.mdx) or [file an issue](https://github.com/aegean-ai/eaia/issues/new/choose).
</Callout>
