Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeurCAM

This is the official implementation of the Neural Clustering Additive Model (NeurCAM): https://arxiv.org/abs/2408.13361

Installation

Using uv (Recommended)

First, install uv if you haven't already:

curl -LsSf https://astral.sh/uv/install.sh | sh

Then, install NeurCAM:

# Clone the repository
git clone https://github.com/alexwolson/NeurCAM.git
cd NeurCAM

# Install the package with uv
uv pip install -e .

# For development with optional dependencies
uv pip install -e ".[dev]"

Using pip

pip install -e .

PyTorch with CUDA Support

If you need CUDA support for GPU acceleration, install PyTorch with CUDA separately:

# For CUDA 11.8
uv pip install torch --index-url https://download.pytorch.org/whl/cu118

# For CUDA 12.1
uv pip install torch --index-url https://download.pytorch.org/whl/cu121

Quick Start

from sklearn.datasets import load_iris
from neurcam import NeurCAM

# Load data
iris = load_iris()
X = iris.data

# Create and fit model
nc = NeurCAM(k=3, epochs=5000)
nc = nc.fit(X)

# Make predictions
neurcam_pred = nc.predict(X)

Development

To set up the development environment:

# Install with development dependencies
uv pip install -e ".[dev]"

# Format code with black
black neurcam/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages