semvec/pypi-packages huggingface dataset:
midlearn 0.1.3
Python Wrapper of the 'midr' R package to interpret black-box models.
Requires Python: >=3.8

# midlearn

[![PyPI version](https://badge.fury.io/py/midlearn.svg)](https://badge.fury.io/py/midlearn)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**midlearn** is a **rpy2**-based Python wrapper for the **midr** R package. It provides a model-agnostic framework for interpreting black-box models using a **scikit-learn** compatible API.

The core objective of midlearn is to create a globally interpretable surrogate model through **Maximum Interpretation Decomposition (MID)**. This technique finds an optimal additive approximation of any black-box model (e.g., GBMs, Neural Networks) by minimizing the squared error between the original predictions and the surrogate's components.

## Main Features

-   **Scikit-learn Compatible API**: Fits seamlessly into existing workflows with familiar `.fit()` and `.predict()` methods.
-   **Functional Decomposition**: Deconstructs model predictions into an intercept, main effects $g_j(X_j)$, and interaction effects $g_{jk}(X_j, X_k)$.
-   **Model Fidelity**: Quantifies the quality of the explanation using the Uninterpreted Variation Ratio.
-   **Seamless Visualization**: Built-in support for plotnine-based interfaces to generate feature importance, dependence plots, and additive breakdowns.

## Installation

**midlearn** requires an R installation on your system with the **midr** package.

### 1. Install R Package

From CRAN:
``` r
install.packages('midr')
```

Or from GitHub:
``` r
pak::pak("ryo-asashi/midr")
```

### 2. Install Python package

From PyPI:
``` bash
pip install midlearn
```

Or from GitHub:
``` bash
pip install git+https://github.com/ryo-asashi/midlearn.git
```

## Theoretical Foundation

MID approximates a complex prediction function $f(\mathbf{x})$ as a sum of interpretable functions:
$$
f(\mathbf{x}) \approx g_\emptyset + \sum_{j} g_j(X_{j}) + \sum_{j < k} g_{jk}(X_{j}, X_{k}) + \dots + g_D(\mathbf{x})
$$

The theoretical foundations of MID are described in Iwasawa & Matsumori (2026) [Forthcoming], and the software implementation is detailed in [Asashiba et al. (2025)](https://arxiv.org/abs/2506.08338).

## License

**midlearn** is licensed under the MIT License.
pstree-tui 1.4.0
Interactive collapsible process tree viewer
Requires Python: >=3.10
Keywords: curses, pgtree, process, tree, tui

# pstree-tui
pgtree is a very useful tool to search for processes and show them in a tree along with their ancestors and descendants. It is great. I had too much processes and wanted to be able to collapse the levels. So I coded this.

This is not directly related to pgtree (other being a similar idea) and contains AI-generated code. 


## Features

* Can use mouse to expand and close
* No stupid F keys like htop and btop
* Can kill process
* Can kill process trees
* Copy pids by clicking on them
* Interactively search through processes


## Usage

`pstree-tui name` 

k to kill
K to kill entire tree
R to refresh

## Alternatives

pgtree and some search
htop and use f keys
use some sort of activity monitor