semvec/pypi-packages huggingface dataset:
stg 0.1.2
feature selection using stochastic gates
License: MIT

# Feature Selection using Stochastic Gates (STG) 

[Project Page](https://runopti.github.io/stg/)|[Paper](https://proceedings.icml.cc/static/paper_files/icml/2020/5085-Paper.pdf)

Feature Selection using Stochastic Gates (STG) is a method for feature selection in neural network estimation problems. 
The new procedure is based on probabilistic relaxation of
the l0 norm of features, or the count of the number of selected features.
The proposed framework simultaneously learns either a nonlinear regression or classification function while selecting a small subset of features.

|![stg_image](docs/assets/stg_figure1_left.png)|
|:--:|
|Top: Each stochastic gate z_d is drawn from the STG approximation of the Bernoulli distribution (shown as the blue histogram on the right). Specifically, z_d is obtained by applying the hard-sigmoid function to a mean-shifted Gaussian random variable. Bottom: The z_d stochastic gate is attached to the x_d input feature, where the trainable parameter µ_d controls the probability of the gate being active|

### Installation

#### Installation with pip

To install with `pip`, run the following command:
```
pip install --user stg
```

#### Installation from GitHub

You can also clone the repository and install manually:
```
git clone 
cd stg/python
python setup.py install --user
```

### Usage

Once you install the library, you can import `STG` to create a model instance:
```
from stg import STG
model = STG(task_type='regression',input_dim=X_train.shape[1], output_dim=1, hidden_dims=[500, 50, 10], activation='tanh', optimizer='SGD', learning_rate=0.1, batch_size=X_train.shape[0], feature_selection=True, sigma=0.5, lam=0.1, random_state=1, device="cpu") 

model.fit(X_train, y_train, nr_epochs=3000, valid_X=X_valid, valid_y=y_valid, print_interval=1000)
# Start training...
```

For more details, please see our Colab notebooks:
- [Regression example](https://colab.research.google.com/github/runopti/stg/blob/master/python/examples/Regression-example.ipynb)
- [Classification example](https://colab.research.google.com/github/runopti/stg/blob/master/python/examples/Classification-example.ipynb)

### Acknowledgements and References

We thank Junchen Yang for his help to develop the R wrapper.
Some of our codebase and its structure is inspired by https://github.com/vacancy/Jacinle. 

If you find our library useful in your research, please consider citing us:
```
@incollection{icml2020_5085,
 author = {Yamada, Yutaro and Lindenbaum, Ofir and Negahban, Sahand and Kluger, Yuval},
 booktitle = {Proceedings of Machine Learning and Systems 2020},
 pages = {8952--8963},
 title = {Feature Selection using Stochastic Gates},
 year = {2020}
}
```
replicators 1.2.1
abstraction for concurrency and multithreading
License: MIT

![Python](https://github.com/bclipp/replicators/workflows/Python/badge.svg)

# replicators

[PyPi Package](https://pypi.org/project/replicators/)

### description
This is a personal package used to hold code patterns used for multithreading and multiprocessing.

### usage
```pip install replicator```

```
pyenv install 3.8.0
pyenv virtualenv 3.8.0 app_3.8
pyenv activate app_3.8

import replicators.multiprocess as mult

data_frame: pd.DataFrame = pd.DataFrame(
        columns=["This",
                 "is",
                 "a",
                 "test",
                 "to",
                 "check",
                 "a_function"],
        data=[[5, 2, "b", 3, 4, 5, 3],
              [7, 2, "b", 3, 4, 5, 3],
              [8, 2, "b", 3, 4, 5, 3],
              [3, 2, "b", 3, 4, 5, 3],
              [2, 2, "b", 3, 4, 5, 3],
              [8, 2, "b", 3, 4, 5, 3],
              [2, 2, "b", 3, 4, 5, 3],
              [8, 2, "b", 3, 4, 5, 3],
              [19, 2, "b", 3, 4, 5, 3],
              [53, 2, "b", 3, 4, 5, 3],
              [11, 2, "b", 3, 4, 5, 3],
              [16, 2, "b", 3, 4, 5, 3]])
    data: list = list(data_frame.T.to_dict().values())
    mult.multiprocess_me(1, print, data, False)

```
easy-database 1.1.8
abstraction for ETL Database interaction
License: MIT

![Python](https://github.com/bclipp/easy_database/workflows/Python/badge.svg)

## easy_database

### description
This is a personal package used to hold code patterns used for relational ETL database access.

### Usage

environment setup
```
pyenv install 3.8.0
pyenv virtualenv 3.8.0 app_3.8
pyenv activate app_3.8

# for integration tests
export PASSWORD=testing1234
export USERNAME=testing1234
export DATABASE=testing1234
export TABLE=customers
export INTEGRATION_TEST=True
export DB_IP_ADDRESS=127.0.0.1
export DATABASE_TYPE=postgresql
sudo --preserve-env docker-compose up
```

python 
```
import easy_database.database as db

database_manager = db.database_factory("postgresql")
database_manager.set_connection_string("...")
database_manager.open_conn()
database_manager.send_sql("SELECT * FROM TEST;")
database_manager.close_conn()
```
thanhle-realpython-reader 1.0.0
Read the latest Real Python tutorials
License: MIT

# Real Python Feed Reader

The Real Python Feed Reader is a basic [web feed](https://en.wikipedia.org/wiki/Web_feed) reader that can download the latest Real Python tutorials from the [Real Python feed](https://realpython.com/contact/#rss-atom-feed).

For more information see the tutorial [How to Publish an Open-Source Python Package to PyPI](https://realpython.com/pypi-publish-python-package/) on Real Python.

## Installation

You can install the Real Python Feed Reader from [PyPI](https://pypi.org/project/realpython-reader/):

    pip install realpython-reader

The reader is supported on Python 2.7, as well as Python 3.4 and above.

## How to use

The Real Python Feed Reader is a command line application, named `realpython`. To see a list of the [latest Real Python tutorials](https://realpython.com/) simply call the program:

    $ realpython
    The latest tutorials from Real Python (https://realpython.com/)
     0 How to Publish an Open-Source Python Package to PyPI
     1 Python "while" Loops (Indefinite Iteration)
     2 Writing Comments in Python (Guide)
     3 Setting Up Python for Machine Learning on Windows
     4 Python Community Interview With Michael Kennedy
     5 Practical Text Classification With Python and Keras
     6 Getting Started With Testing in Python
     7 Python, Boto3, and AWS S3: Demystified
     8 Python's range() Function (Guide)
     9 Python Community Interview With Mike Grouchy
    10 How to Round Numbers in Python
    11 Building and Documenting Python REST APIs With Flask and Connexion – Part 2
    12 Splitting, Concatenating, and Joining Strings in Python
    13 Image Segmentation Using Color Spaces in OpenCV + Python
    14 Python Community Interview With Mahdi Yusuf
    15 Absolute vs Relative Imports in Python
    16 Top 10 Must-Watch PyCon Talks
    17 Logging in Python
    18 The Best Python Books
    19 Conditional Statements in Python

To read one particular tutorial, call the program with the numerical ID of the tutorial as a parameter:

    $ realpython 0
    # How to Publish an Open-Source Python Package to PyPI

    Python is famous for coming with batteries included. Sophisticated
    capabilities are available in the standard library. You can find modules for
    working with sockets, parsing CSV, JSON, and XML files, and working with
    files and file paths.

    However great the packages included with Python are, there are many
    fantastic projects available outside the standard library. These are most
    often hosted at the Python Packaging Index (PyPI), historically known as the
    Cheese Shop. At PyPI, you can find everything from Hello World to advanced
    deep learning libraries.

    [... The full text of the article ...]

You can also call the Real Python Feed Reader in your own Python code, by importing from the `reader` package:

    >>> from reader import feed
    >>> feed.get_titles()
    ['How to Publish an Open-Source Python Package to PyPI', ...]
Flask-Coney 1.1.4
Add Pika support to your Flask application.
License: MIT
Requires Python: >=3.6

Flask-Coney
===========

.. image:: https://badge.fury.io/py/Flask-Coney.svg
    :target: https://pypi.org/project/Flask-Coney/
    :alt: PyPi

.. image:: https://img.shields.io/readthedocs/flask-coney
    :target: https://flask-coney.readthedocs.io/en/latest/
    :alt: Read the Docs

.. image:: https://github.com/mikebarkmin/flask-coney/workflows/Tests/badge.svg?branch=master
    :target: https://github.com/mikebarkmin/flask-coney/actions?query=workflow%3ATests
    :alt: Tests

.. image:: https://codecov.io/gh/mikebarkmin/flask-coney/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/mikebarkmin/flask-coney
    :alt: Coverage


Flask-Coney is an extension for `Flask`_ that adds support for
`Pika`_ to your application. It aims to simplify using Pika
with Flask by providing useful defaults and extra helpers that make it
easier to accomplish common tasks.

.. _Flask: https://palletsprojects.com/p/flask/
.. _Pika: https://pika.readthedocs.io/en/stable/


Installing
----------

Install and update using `pip`_:

.. code-block:: text

  $ pip install -U Flask-Coney

.. _pip: https://pip.pypa.io/en/stable/quickstart/


A Simple Example
----------------

.. code-block:: python

    from flask import Flask
    from flask_coney import Coney

    app = Flask(__name__)
    app.config["CONEY_BROKER_URI"] = "amqp://guest:guest@rabbitmq"
    coney = Coney(app)

    @coney.queue(queue_name="test")
    def test_queue(ch, method, props, body):
        pass


    def publish_to_queue():
        coney.publish({"test": 1}, routing_key="test")

Contributing
------------

For guidance on setting up a development environment and how to make a
contribution to Flask-Coney, see the `contributing guidelines`_.

.. _contributing guidelines: https://github.com/mikebarkmin/flask-coney/blob/master/CONTRIBUTING.rst


Links
-----

-   Documentation: https://flask-coney.readthedocs.io
-   Releases: https://pypi.org/project/Flask-Coney/
-   Code: https://github.com/mikebarkmin/flask-coney
-   Issue tracker: https://github.com/mikebarkmin/flask-coney/issues