semvec/pypi-packages huggingface dataset:
metalearners 0.13.0
MetaLearners for CATE estimation
Requires Python: >=3.10

# metalearners

[![CI](https://github.com/Quantco/metalearners/actions/workflows/ci.yml/badge.svg)](https://github.com/Quantco/metalearners/actions/workflows/ci.yml)
[![Documentation Status](https://readthedocs.org/projects/metalearners/badge/?version=latest)](https://metalearners.readthedocs.io/en/latest/?badge=latest)
[![Conda-forge](https://img.shields.io/conda/vn/conda-forge/metalearners?logoColor=white&logo=conda-forge)](https://anaconda.org/conda-forge/metalearners)
[![PypiVersion](https://img.shields.io/pypi/v/metalearners.svg?logo=pypi&logoColor=white)](https://pypi.org/project/metalearners)
[![codecov.io](https://codecov.io/github/QuantCo/metalearners/coverage.svg?branch=main)](https://codecov.io/github/QuantCo/metalearners?branch=main)

MetaLearners for Conditional Average Treatment Effect (CATE) estimation

The library focuses on providing

- Methodologically sound cross-fitting
- Convenient access to and reuse of base models
- Consistent APIs across Metalearners
- Support for more than binary treatment variants
- Integrations with `pandas`, `shap`, `lime`, `optuna` and soon `onnx`

## Example

```python

df = ...

from metalearners import RLearner
from lightgbm import LGBMClassifier, LGBMRegressor

rlearner = RLearner(
    nuisance_model_factory=LGBMRegressor,
    propensity_model_factory=LGBMClassifier,
    treatment_model_factory=LGBMRegressor,
    is_classification=False,
    n_variants=2,
)

features = ["age", "weight", "height"]
rlearner.fit(df[features], df["outcomes"], df["treatment"])
cate_estimates = rlearner.predict(df[features], is_oos=False)
```

Please refer to our
[docs](https://metalearners.readthedocs.io/en/latest/?badge=latest)
for many more in-depth and reproducible examples.

## Installation

`metalearners` can either be installed via PyPI with

```bash
$ pip install metalearners
```

or via conda-forge with

```bash
$ conda install metalearners -c conda-forge
```

## Development

Development instructions can be found [here](https://metalearners.readthedocs.io/en/latest/development.html).
face-feature-parser 1.0.1
A Python library for face parsing and feature extraction
Requires Python: >=3.7

# FaceParser

A Python library for face parsing and feature extraction using BiSeNet. This library provides tools for facial feature detection, segmentation, and analysis.

## Features

- Facial feature parsing and segmentation
- Feature coordinate extraction
- Facial metrics calculation
- CLI tool for easy model management and image processing
- Visualization tools for parsed features

## Installation

```bash
pip install faceparser
```

After installation, you need to download the model weights:

```bash
faceparser install
```

## Usage

### Command Line Interface

1. Install model:
```bash
faceparser install
```

2. Check model installation:
```bash
faceparser check
```

3. Parse an image:
```bash
faceparser parse path/to/image.jpg -o output_directory --save-masks
```

### Python API

```python
from faceparser import get_coordinates

# Parse an image
coordinates = get_coordinates("path/to/image.jpg")

# Get feature embeddings
embeddings = coordinates.get_all_embeddings()

# Get face metrics
metrics = coordinates.get_relative_metrics()
symmetry = coordinates.get_symmetry_score()

# Access individual feature metrics
for feature, area in metrics['feature_areas'].items():
    print(f"{feature} area: {area:.3f}")
```

## Model Details

The face parsing model is based on BiSeNet architecture and trained on the CelebAMask-HQ dataset. It can detect and segment the following facial features:

- Skin
- Nose
- Eyes (left and right)
- Eyebrows (left and right)
- Ears (left and right)
- Mouth
- Upper and lower lips
- Hair
- Hat
- Eyeglasses
- Earrings
- Necklace
- Neck
- Clothes

## Feature Metrics

The library provides various metrics for facial analysis:

- Feature embeddings (normalized position, size, area, aspect ratio)
- Face symmetry score
- Feature areas (normalized)
- Normalized distances between features
- Relative positions
- Feature aspect ratios

## License

This project is licensed under the MIT License - see the LICENSE file for details.#\x00 \x00f\x00a\x00c\x00e\x00p\x00a\x00r\x00s\x00e\x00r\x00
\x00
\x00