semvec/pypi-packages huggingface dataset:
ShallowTree 0.0.11
Shallow decision trees for explainable clustering
License: MIT

# ShallowTree

Implementation of the ExShallow algoritm from [Shallow decision trees for explainable k-means clustering](https://arxiv.org/abs/2112.14718), the goal of which is to find a decision tree inducing a partition of the data that is both good (in terms of the k-means cost) and explainable (in terms of being defined by a shallow tree).

## Installation

```
pip install ShallowTree
```

## Example

```python
from ShallowTree.ShallowTree import ShallowTree
from sklearn.datasets import load_iris
from sklearn.cluster import KMeans

# test on the iris dataset
iris = load_iris()
data = iris.data
k = len(iris.target_names)

# create a tree that will partition the data into k clusters
tree = ShallowTree(k)

# define a KMeans instance and feed it to the tree
km = KMeans(k, random_state=1)
km.fit(data)

tree.fit(data, km)

# alternatively, fit the tree immediately;
# kmeans will run internally
tree.fit(data)

# return the score of the tree and compare
# it to the score of the k-means partition
tree_score = tree.score(data)
km_score = -km.score(data)

print(tree_score / km_score)

# Construct the tree, and return cluster labels
prediction = tree.fit_predict(X)

# Tree plot saved to filename
tree.plot('filename')
```

## Citation

```bash
@article{laber2021shallow,
    title={Shallow decision trees for explainable $k$-means clustering},
    author={Laber, Eduardo and Murtinho, Lucas and Oliveira, Felipe},
    journal={arXiv preprint arXiv:2112.14718},
    year={2021}
}
```

## Contact
* [Lucas Murtinho](mailto:lucas.murtinho@gmail.com)
flake8-clean-block 0.1.2
A flake8 plugin that enforces a blank line after if/for/while/with/try blocks
License: MIT
Requires Python: >=3.8

# flake8-clean-block

This is a [flake8](https://flake8.pycqa.org/en/latest/) plugin that enforces a blank line after `if`/`for`/`while`/`with`/`try` blocks in Python code.

## Installation

```bash
pip install flake8-clean-block
```

## Violation codes

There is one violation code that this plugin reports:

| Code      | Description                                            |
| --------- | ------------------------------------------------------ |
| CLB100    | no blank line after the end of an indented block       |


## Style examples

### _Wrong_

This plugin considers the following styles wrong:

```python
for i in range(5):
    print(i)
some_var = 2
```

```python
for i in range(5):
    print(i)
if k == 2:
    print(k)
else:
    print("k")
for j in range(5):
    print(j)
```

```python
for i in range(5): a += i
print(a)
```

```python
with open('filename.txt', 'r') as fp:
    content = fp.readlines()
print(content)
```

### _Correct_

Correspondingly, here are the correct styles, because they are easier to read and less error-prone:

```python
for i in range(5):
    print(i)

some_var = 2
```

```python
for i in range(5):
    print(i)

if k == 2:
    print(k)
else:
    print("k")

for j in range(5):
    print(j)
```

```python
for i in range(5): a += i

print(a)
```

```python
with open('filename.txt', 'r') as fp:
    content = fp.readlines()

print(content)
```

## Rationale

When two lines belonging to different indentation level are right next to each other, it's difficult to read.  Additionally, accidentally hitting the "tab" key on the outer line leads to subtle and hard-to-find bugs (and vice versa).

Therefore, it's better that we add at least one blank line between lines of different indentation levels.
medium-multiply-x 0.1.2
Demo library
License: MIT

# Medium multiply - Test for Fun
A small demo library for a Medium publication about publishing libraries.

### Installation
```
pip install medium-multiply-x
```

### Get started
How to multiply one number by another with this lib:

```Python
from medium_multiply import Multiplication

# Instantiate a Multiplication object
multiplication = Multiplication(2)

# Call the multiply method
result = multiplication.multiply(5)
```
rl-baselines3-zoo 1.6.2
A Training Framework for Stable Baselines3 Reinforcement Learning Agents
License: MIT
Requires Python: >=3.7
Keywords: reinforcement-learning-algorithms reinforcement-learning machine-learning gym openai stable baselines toolbox python data-science


# RL Baselines3 Zoo: A Training Framework for Stable Baselines3 Reinforcement Learning Agents

See https://github.com/DLR-RM/rl-baselines3-zoo