semvec/pypi-packages huggingface dataset:
feature-ordering-tabseq 0.1.6
Feature Ordering Module from TabSeq (ICPR 2024)
Requires Python: >=3.8

# TabSeq Feature Ordering

[![PyPI version](https://img.shields.io/pypi/v/tabseq-feature-ordering.svg)](https://pypi.org/project/tabseq-feature-ordering/)
[![Python Versions](https://img.shields.io/pypi/pyversions/tabseq-feature-ordering.svg)](https://pypi.org/project/tabseq-feature-ordering/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![ICPR 2024 Paper](https://img.shields.io/badge/Paper-ICPR%202024-blue)](https://link.springer.com/chapter/10.1007/978-3-031-78128-5_27)
[![GitHub Stars](https://img.shields.io/github/stars/zadid6pretam/TabSeq?style=social)](https://github.com/zadid6pretam/TabSeq)

---

This module extracts and packages the feature ordering algorithm used in **TabSeq (ICPR 2024)** as a standalone utility, enabling integration into any tabular deep learning pipeline.



## Key Features

-  Variance-based intra-cluster ordering  
-  KMeans clustering for feature grouping  
-  Weighted global ordering from local cluster orders  
-  Minimal dependencies, flexible integration  

## Installation

```bash
pip install tabseq-feature-ordering
```

## Usage

```python
from tabseq_feature_ordering import reorder_features

# Inputs
X_train = ...  # pandas DataFrame of shape (n_samples, n_features)
cluster_size = 5
sort_order = 'descending'  # or 'ascending'

# Output
global_ordering, X_train_reordered = reorder_features(X_train, cluster_size, sort_order)
```

## Parameters

- `X_train`: Tabular training data as `pd.DataFrame`
- `cluster_size`: Number of clusters (e.g., 5)
- `sort_order`: Intra-cluster sorting order by variance (`'ascending'` or `'descending'`)

## Output

- `global_ordering`: List of column names in reordered order
- `X_train_reordered`: DataFrame with reordered columns

## Example

```python
import pandas as pd
import numpy as np
from tabseq_feature_ordering import reorder_features

# Example input
X = pd.DataFrame(np.random.rand(40, 80), columns=[f"F{i}" for i in range(80)])

# Run feature ordering
order, X_reordered = reorder_features(X, cluster_size=5, sort_order='descending')

print(order[:10])  # First 10 features in the new order
```

## License

MIT License © 2024 Zadid Habib

## Citation

If you use this module, please cite our paper:

Habib, Al Zadid Sultan Bin, Kesheng Wang, Mary-Anne Hartley, Gianfranco Doretto, and Donald A. Adjeroh. "TabSeq: A Framework for Deep Learning on Tabular Data via Sequential Ordering." In International Conference on Pattern Recognition, pp. 418-434. Cham: Springer Nature Switzerland, 2024.

---

### Bibtex

```bash
@inproceedings{habib2024tabseq,
  title={TabSeq: A Framework for Deep Learning on Tabular Data via Sequential Ordering},
  author={Habib, Al Zadid Sultan Bin and Wang, Kesheng and Hartley, Mary-Anne and Doretto, Gianfranco and A. Adjeroh, Donald},
  booktitle={International Conference on Pattern Recognition},
  pages={418--434},
  year={2024},
  organization={Springer}
}
```
seatools-starter-web-flask 1.0.2
Seatools Flask Web Starter
Requires Python: >=3.9
Keywords: seatools>=1.0.41, starter

# Seatools Flask Starter

This framework must be used in conjunction with the `seatools-starter-server-*` packages, using `seatools-starter-server-uvicorn` as an example here.

[中文文档](./README_zh.md)

## Usage Guide
1. Install with `poetry add flask seatools-starter-server-uvicorn seatools-starter-web-flask`
2. Configure `config/application.yml` as follows:
```yaml
seatools:
  server:
    # Here are the uvicorn parameter configurations
    uvicorn:
      host: 0.0.0.0
      port: 8000
      workers: 1
      reload: true
  # Here are the Flask configurations
  flask:
    # Consistent with Flask parameters
    import_name: seatools.ioc.server.app
    static_folder: static
    template_folder: templates
    ...
```
3. Usage, load by defining ioc container functions

```python
import abc
from seatools.ioc import Autowired, Bean
from flask import Flask

# Add route
from flask import Flask

@Bean
def api_controller(app: Flask):
    @app.get('/')
    def hello():
        return 'hello flask'

class Service(abc.ABC):
    
    def hello(self):
        raise NotImplementedError

# Flask integration with seatools ioc injection
@Bean
class ServiceA(Service):

    def hello(self):
        return "serviceA"

@Bean
def a2_router(app: Flask, service: Service):  # Specific injection method see seatools

    @app.get('/service')
    def service():
        return service.hello() # return hello flask
```
3. Run, see `seatools-starter-server-*`, example: [`seatools-starter-server-uvicorn`](https://gitee.com/seatools-py/seatools-starter-server-uvicorn)
singpass-client 0.1.2
Add your description here
Requires Python: >=3.10

# Singpass OAuth Client

## Description

A lightweight Python client for integrating with Singpass' OAuth2 endpoints. This client helps:

- Generate Singpass authorization URLs
- Exchange authorization codes for tokens
- Decrypt and verify ID and access tokens
- Retrieve and verify user info from Singpass

**Note**: This library does not handle session management out of the box.

It is built around the official Singpass standards and uses JOSE for handling JWTs and JWKs.

## Usage

```python
import asyncio
from singpass_client.client import SingpassOauthClient

# Load Singpass discovery data (usually from the Singpass metadata URL)
discovery = {
    "issuer": "https://stg-id.singpass.gov.sg",
    "authorization_endpoint": "https://stg-id.singpass.gov.sg/auth",
    "jwks_uri": "https://stg-id.singpass.gov.sg/.well-known/keys",
    "userinfo_endpoint": "https://stg-id.singpass.gov.sg/userinfo",
}

# Initialize the client
client = SingpassOauthClient(discovery=discovery, client_id="YOUR_CLIENT_ID", scope="openid")

# Step 1: Generate the authorization URL
auth_url, code_verifier, nonce, state = client.create_authorization_url(
    redirect_uri="https://yourapp.com/callback"
)

print("Visit this URL to authenticate:", auth_url)

# After redirection, handle the callback with the returned `code`
# Step 2: Exchange code for tokens
async def exchange_code():
    token_set = await client.handle_callback(
        nonce=nonce,
        code_verifier=code_verifier,
        authorization_code="AUTHORIZATION_CODE_FROM_CALLBACK",
        key_file_path="path/to/your_private_jwks.json",
        sig_key_id="your-signing-key-id",
        en_key_id="your-encryption-key-id"
    )

    access_token = token_set["access_token"]

    # Step 3: Retrieve and verify user info
    user_info = await client.get_info(
        access_token=access_token,
        en_key_id="your-encryption-key-id",
        key_file_path="path/to/your_private_jwks.json",
        nonce=nonce
    )

    print("User info:", user_info)

# Run the async flow
asyncio.run(exchange_code())
```
seatools-starter-web-fastapi 1.0.3
Seatools Starter Web Fastapi
Requires Python: >=3.9
Keywords: seatools>=1.0.41, starter

# Seatools FastAPI Starter

This framework must be used in conjunction with the `seatools-starter-server-*` packages, using `seatools-starter-server-uvicorn` as an example here.

[中文文档](./README_zh.md)

## Usage Guide
1. Install with `poetry add fastapi seatools-starter-server-uvicorn seatools-starter-web-fastapi`
2. Configure `config/application.yml` as follows:
```yaml
seatools:
  server:
    # Here are the uvicorn parameter configurations
    uvicorn:
      host: 0.0.0.0
      port: 8000
      workers: 1
      reload: true
  # Here are the FastAPI configurations
  fastapi:
    title: xxxxx
    description: xxx
    docs_url: none
```
3. Usage, load by defining ioc container functions
```python
from seatools.ioc import Autowired, Bean
from fastapi import FastAPI


app = Autowired(cls=FastAPI)

# Add middleware

from fastapi.middleware.cors import CORSMiddleware
    
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# Add global exception handler
# Custom exception handling
@app.exception_handler(AssertionError)
async def assert_exception_handler(request, exc):
    ...

# Add route method
@app.get('/')
async def hello():
    return "hello"

# Add route
from fastapi import APIRouter
custom_router = APIRouter(prefix='/custom')

@custom_router.get('/')
async def custom_hello():
    return "custom hello"

@Bean
def register_custom_router(app: FastAPI):
    app.include_router(custom_router)

# FastAPI integration with seatools ioc injection
@Bean
class ServiceA:
    
    async def hello(self):
        return "serviceA"


@app.get('/serviceA')
async def serviceA(serviceA = Autowired(cls=ServiceA)): # Inject seatools.ioc in the controller parameter using Autowired, note that the type should not be explicitly declared here, FastAPI will fail on parameter type checking for unsupported types
    return await serviceA.hello()
    
# Or inject at the router level, this method is more recommended
@app.get('/serviceA')
async def serviceA():
    serviceA = Autowired(cls=ServiceA)
    return await serviceA.hello()
```
3. Run, see `seatools-starter-server-*`, example [`seatools-starter-server-uvicorn`](https://gitee.com/seatools-py/seatools-starter-server-uvicorn)
FeatureOrdering 0.1.4
Feature Ordering Module from TabSeq (ICPR 2024)
Requires Python: >=3.8

# TabSeq Feature Ordering

[![PyPI version](https://img.shields.io/pypi/v/tabseq-feature-ordering.svg)](https://pypi.org/project/tabseq-feature-ordering/)
[![Python Versions](https://img.shields.io/pypi/pyversions/tabseq-feature-ordering.svg)](https://pypi.org/project/tabseq-feature-ordering/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![ICPR 2024 Paper](https://img.shields.io/badge/Paper-ICPR%202024-blue)](https://link.springer.com/chapter/10.1007/978-3-031-78128-5_27)
[![GitHub Stars](https://img.shields.io/github/stars/zadid6pretam/TabSeq?style=social)](https://github.com/zadid6pretam/TabSeq)

---

This module extracts and packages the feature ordering algorithm used in **TabSeq (ICPR 2024)** as a standalone utility, enabling integration into any tabular deep learning pipeline.



## Key Features

-  Variance-based intra-cluster ordering  
-  KMeans clustering for feature grouping  
-  Weighted global ordering from local cluster orders  
-  Minimal dependencies, flexible integration  

## Installation

```bash
pip install tabseq-feature-ordering
```

## Usage

```python
from tabseq_feature_ordering import reorder_features

# Inputs
X_train = ...  # pandas DataFrame of shape (n_samples, n_features)
cluster_size = 5
sort_order = 'descending'  # or 'ascending'

# Output
global_ordering, X_train_reordered = reorder_features(X_train, cluster_size, sort_order)
```

## Parameters

- `X_train`: Tabular training data as `pd.DataFrame`
- `cluster_size`: Number of clusters (e.g., 5)
- `sort_order`: Intra-cluster sorting order by variance (`'ascending'` or `'descending'`)

## Output

- `global_ordering`: List of column names in reordered order
- `X_train_reordered`: DataFrame with reordered columns

## Example

```python
import pandas as pd
import numpy as np
from tabseq_feature_ordering import reorder_features

# Example input
X = pd.DataFrame(np.random.rand(40, 80), columns=[f"F{i}" for i in range(80)])

# Run feature ordering
order, X_reordered = reorder_features(X, cluster_size=5, sort_order='descending')

print(order[:10])  # First 10 features in the new order
```

## License

MIT License © 2024 Zadid Habib

## Citation

If you use this module, please cite our paper:

Habib, Al Zadid Sultan Bin, Kesheng Wang, Mary-Anne Hartley, Gianfranco Doretto, and Donald A. Adjeroh. "TabSeq: A Framework for Deep Learning on Tabular Data via Sequential Ordering." In International Conference on Pattern Recognition, pp. 418-434. Cham: Springer Nature Switzerland, 2024.

---

### Bibtex

```bash
@inproceedings{habib2024tabseq,
  title={TabSeq: A Framework for Deep Learning on Tabular Data via Sequential Ordering},
  author={Habib, Al Zadid Sultan Bin and Wang, Kesheng and Hartley, Mary-Anne and Doretto, Gianfranco and A. Adjeroh, Donald},
  booktitle={International Conference on Pattern Recognition},
  pages={418--434},
  year={2024},
  organization={Springer}
}
```