semvec/pypi-packages huggingface dataset:
lilvali 0.1.6
Tiny validation library for Python
License: MIT
Requires Python: >=3.12

# lilVali

A small Python 3.12 validation experiment for playing with [PEP 695](https://peps.python.org/pep-0695/). 

> Supports most basic typing constructs including Generics. 
> Also supports dataclasses and classes with annotated `__init__` methods.

## Install
```bash
pip install lilvali
```

## Usage

```python
from lilvali import validate, validator
from lilvali.errors import *
```

## Simple examples
```python
@validate
def add[T: (int, float)](x: int, y: T) -> int | float:
    return x + y


def main():
    print(f"{add(1, 2)=}")
    print(f"{add(1, 2.0)=}")

    try:
        print(f"{add(1.0, 2)=}")
    except ValidationError as e:
        print(f"{e=}")
    else:
        raise RuntimeError("Expected ValidationError")


if __name__ == "__main__":
    main()
```

```python
@validate
@dataclass
class SomeClass:
    x: int
    y: str = field(default="hello")

    @validator
    def _x(value):
        if value is None or value < 0:
            raise ValidationError

    @validator
    def _y(value) -> bool:
        return value == "hello"


@validate
class NotADC:
    def __init__(self, x: int, y: str):
        self.x = x
        self.y = y

    @validator
    def _x(value):
        if value is None or value < 0:
            raise ValidationError

    @validator
    def _y(value) -> bool:
        return value == "hello"
```

See the demo folder as well. 

## Tests
```bash
$ ./test.sh
Running tests with coverage
.........................
----------------------------------------------------------------------
Ran 25 tests in 0.006s

OK
Name                           Stmts   Miss  Cover   Missing
------------------------------------------------------------
lilvali/__init__.py                2      0   100%
lilvali/binding.py               167      0   100%
lilvali/errors.py                  6      0   100%
lilvali/validate.py               80      0   100%
tests/test_tiny_validate.py      195      0   100%
tests/test_validate_types.py     124      0   100%
------------------------------------------------------------
TOTAL                            574      0   100%
```

[TODO](docs/TODO.md)
oagre 0.1.0
Python library for building gradient boosted meta-learner regression.
License: MIT

# OAGRE : Outlier Attenuated Gradient Boosting Regression

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI](https://img.shields.io/pypi/v/oagre.svg)](https://pypi.org/project/oagre)
[![Documentation Status](https://readthedocs.org/projects/oagre/badge/?version=latest)](https://oagre.readthedocs.io/en/latest/?badge=latest)


```
Status: Functional - 
```

A meta-learning model for regression on noisy data with heteroscedasticity.

This work was initially started in 2017 while working with a large scale
noisy regression problem. The initial experiments were done in R and abandoned
when I moved onto other projects. The same line of thinking recurred in 2021
as I looked at more regression problems and led to this repository.

This time round the implementation has been done in Python in a scikit-learn 
compatible structure. It also allows you to define the internal classifier and 
regression algorithms to be used, rather than forcing the use of decision trees.

Massive thanks are required to the contributors at the scikit-lego project for 
the inspiring open-source library that informed much of the development here.


### Installation

The package will be released via PyPi and can installed via pip.

Alternatively you can install from source code

### Experiments

We have conducted experiments using synthetically generated data for highly non-linear 
regression problems and multiple variations of heteroscedastic noise. 
These experiments can be executed using the script [run_experiment.py](scripts/run_experiment.py)
and the analysed with the script [scripts/analyse.py](scripts/analyse.py).

## How to cite

Paper to be published (under revision)

```bibtex
@InProceedings{Hawkins2024,
   author = {John Hawkins},
   year = {2024},
   title = {OAGRE: Outlier Attenuated Gradient Boosted Regression},
   booktitle = {},
   month = {},
}
```