<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Least Squares Anomaly Detection on Static Data
In this example, we generate some points from a 2-D Gaussian mixture,
and then plot the response of the anomaly detection model across the data
space given some different parameter settings.
The plots show training data as black crosses, contours in blue indicate 
the response of the model across the space after training, and the contour 
line in red indicates the decision boundary given by thresholding the model
output at 0.5.
This example was created by modifying the scikit-learn 
demo.
In general the LSAnomaly class can be used as a plug-in replacement in 
any of the outlier detection demos on the sklearn site (e.g., as a 
replacement for svm.OneClassSVM).
Step1:  Generate Data
Step2:  Anomaly Models
<ASSISTANT_TASK:>
Python Code:
import os
import numpy as np
from pathlib import Path
cwd = os.getcwd()
os.chdir(Path(cwd).parents[1])
from lsanomaly import LSAnomaly
import lsanomaly.notebooks.static_mix as demo
Explanation: Least Squares Anomaly Detection on Static Data
In this example, we generate some points from a 2-D Gaussian mixture,
and then plot the response of the anomaly detection model across the data
space given some different parameter settings.
The plots show training data as black crosses, contours in blue indicate 
the response of the model across the space after training, and the contour 
line in red indicates the decision boundary given by thresholding the model
output at 0.5.
This example was created by modifying the scikit-learn 
demo.
In general the LSAnomaly class can be used as a plug-in replacement in 
any of the outlier detection demos on the sklearn site (e.g., as a 
replacement for svm.OneClassSVM).
End of explanation
n_samples = 20
offset = 2.5
X, xx, yy = demo.data_prep(n_samples=n_samples, offset=offset)
Explanation: Generate Data
End of explanation
sigma_candidates = [1, 2, 3]
rho_candidates = [0.1, 1, 10]
demo.plot_results(
    X, 
    xx, 
    yy, 
    threshold=0.5,
    sigma_candidates=sigma_candidates, 
    rho_candidates=rho_candidates
)
Explanation: Anomaly Models
End of explanation
<END_TASK>