Metadata-Version: 2.4
Name: triggered-ope
Version: 0.0.1
Summary: Triggered Off-Policy Evaluation for Safe Reinforcement Learning
Author-email: Tyler Schmidt <tyler-schmidt-1@uiowa.edu>
License: MIT
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: numpy>=1.26
Requires-Dist: pandas
Requires-Dist: scipy
Description-Content-Type: text/markdown

# dstools

A small Python package to fit least-squares linear models using the closed-form normal equation:


$\hat{\beta} = (X^\top X)^{-1} X^\top y$

---

## Installation

First, make sure you are in the project root (where `pyproject.toml` lives), then install locally:

```bash
pip install .
```

## Example 
```python
import numpy as np
from dstools.linear_model import mylm, coef

# generate random data
rng = np.random.default_rng(1)
X = rng.normal(size=(5, 2))
y = X @ np.array([1, 2]) + 1 + rng.normal(size=5)

# fit linear model (intercept included by default)
fit = mylm(X, y)

# extract coefficients (intercept + slopes)
print("Coefficients:", coef(fit))

# optionally access fitted values and residuals
print("Fitted values:", fit.fitted_values)
print("Residuals:", fit.residuals)
```


# tests
In the root directory, on command line:

```bash
pip install . 
```
Then 

```bash
pytest tests
```

# virtual environments
If in a virtual envionment command line has parenthese (venv). To see which python executable is running,
```bash
which python3
```

To make a new hidden environment
```bash
python3 -m venv .venv
```

To move into a virtual environment 
```bash
source .venv/bin/activate
```

To deactivate
```bash
deactivate
```

To use inside of jupyter notbook, first inside the virtual environment
```pip
pip install ipykernel
```
Then 
```pip
python -m ipykernel install --user --name=school-venv --display-name "Python (School HW)"
```

# pip
to list pip packages: 
```bash
pip list
```

# bash loop
```bash
for J in {1..20}
do
  Rscript super_hard_sim.R $J
done
```

