Skip to main content

Lightweight RL utilities: epsilon-greedy and Q-learning update

Project description

epsilonq

epsilonq is a lightweight Python package providing basic Reinforcement Learning utilities.
It includes an Epsilon-Greedy action selection function and a Q-learning update function, making it easy to implement simple RL agents.


Features

  • Epsilon-Greedy Action Selection for balancing exploration and exploitation.
  • Q-learning Update for updating Q-values based on experience.
  • Beginner-friendly and lightweight — no heavy dependencies.

Installation

Install from PyPI:

pip install epsilonq

# USAGE
from epsilonq import epsilon_greedy, q_learning_update

# Initialize Q-table (dictionary)
Q = {}

# Define current state and Q-values for actions
state = "A"
q_values = [0.5, 0.2, 0.9]

# Select an action using epsilon-greedy policy
action = epsilon_greedy(q_values, epsilon=0.1)

# Simulate reward and next state
reward = 1.0
next_state = "B"

# Perform Q-learning update
q_learning_update(Q, state, action, reward, next_state, alpha=0.5, gamma=0.9)

print("Updated Q-table:", Q)


---

## **Step 4 — Create `setup.py`**
This file tells PyPI how to build your package:

```python
from setuptools import setup, find_packages

setup(
    name="epsilonq",
    version="0.1.0",
    author="Your Name",
    author_email="your.email@example.com",
    description="Lightweight RL utilities: epsilon-greedy and Q-learning update",
    long_description=open("README.md").read(),
    long_description_content_type="text/markdown",
    url="https://pypi.org/project/epsilonq/",
    packages=find_packages(),
    install_requires=[],
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
    python_requires=">=3.6",
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

epsilonq-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

epsilonq-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file epsilonq-0.1.0.tar.gz.

File metadata

  • Download URL: epsilonq-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for epsilonq-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5684fa506f2dd2c154035c8d19508353cdd264e1c807ce9a80016f07a86a931a
MD5 f322da1137e7def83e7c6ebb17ff656b
BLAKE2b-256 16614ad50b93501969521dbf819f7b8134927c2a4cbee6fc5e2d1614f685ad91

See more details on using hashes here.

File details

Details for the file epsilonq-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: epsilonq-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for epsilonq-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f9a7433ca3c61cf6fae3c6b33edc19e341f713074f8dfa35f54cc350bcdb567
MD5 3f0bce0f115a9d6004dfc42831e8b355
BLAKE2b-256 f74e2f57c6b16e5a040e5eaca605d379c872c062d98dec94cfba3aedb969a6bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page