Skip to main content

OIKAN: Optimized Interpretable Kolmogorov-Arnold Networks

Project description

OIKAN Logo

OIKAN: Optimized Interpretable Kolmogorov-Arnold Networks

Overview

OIKAN (Optimized Interpretable Kolmogorov-Arnold Networks) is a neuro-symbolic ML framework that combines modern neural networks with classical Kolmogorov-Arnold representation theory. It provides interpretable machine learning solutions through automatic extraction of symbolic mathematical formulas from trained models.

PyPI version PyPI Downloads per month PyPI Total Downloads License GitHub issues Docs

Important Disclaimer: OIKAN is an experimental research project. It is not intended for production use or real-world applications. This framework is designed for research purposes, experimentation, and academic exploration of neuro-symbolic machine learning concepts.

Key Features

  • 🧠 Neuro-Symbolic ML: Combines neural network learning with symbolic mathematics
  • 📊 Automatic Formula Extraction: Generates human-readable mathematical expressions
  • 🎯 Scikit-learn Compatible: Familiar .fit() and .predict() interface
  • 🔬 Research-Focused: Designed for academic exploration and experimentation
  • 📈 Multi-Task: Supports both regression and classification problems

Scientific Foundation

OIKAN implements the Kolmogorov-Arnold Representation Theorem through a novel neural architecture:

  1. Theorem Background: Any continuous multivariate function f(x1,...,xn) can be represented as:

    f(x1,...,xn) = ∑(j=0 to 2n){ φj( ∑(i=1 to n) ψij(xi) ) }
    

    where φj and ψij are continuous single-variable functions.

  2. Neural Implementation:

    # Pseudo-implementation of KAN architecture
    class KANLayer:
        def __init__(self, input_dim, output_dim):
            self.edges = [SymbolicEdge() for _ in range(input_dim * output_dim)]
            self.weights = initialize_weights(input_dim, output_dim)
    
        def forward(self, x):
            # Transform each input through basis functions
            edge_outputs = [edge(x_i) for x_i, edge in zip(x, self.edges)]
            # Combine using learned weights
            return combine_weighted_outputs(edge_outputs, self.weights)
    

Quick Start

Installation

Method 1: Via PyPI (Recommended)

pip install -qU oikan

Method 2: Local Development

git clone https://github.com/silvermete0r/OIKAN.git
cd OIKAN
pip install -e .  # Install in development mode

Regression Example

from oikan.model import OIKANRegressor
from sklearn.model_selection import train_test_split

# Initialize model 
model = OIKANRegressor()

# Fit model (sklearn-style)
model.fit(X_train, y_train, epochs=100, lr=0.01)

# Get predictions
y_pred = model.predict(X_test)

# Save interpretable formula to file with auto-generated guidelines
# The output file will contain:
# - Detailed symbolic formulas for each feature
# - Instructions for practical implementation
# - Recommendations for testing and validation
model.save_symbolic_formula("regression_formula.txt")

Example of the saved symbolic formula instructions: outputs/regression_symbolic_formula.txt

Classification Example

from oikan.model import OIKANClassifier

# Similar sklearn-style interface for classification
model = OIKANClassifier()
model.fit(X_train, y_train, epochs=100, lr=0.01)
probas = model.predict_proba(X_test)

# Save classification formulas with implementation guidelines
# The output file will contain:
# - Decision boundary formulas for each class
# - Softmax application instructions
# - Recommendations for testing and validation
model.save_symbolic_formula("classification_formula.txt")

Example of the saved symbolic formula instructions: outputs/classification_symbolic_formula.txt

Key Design Principles

  1. Interpretability by Design

    # Edge activation contains interpretable basis functions
    ADVANCED_LIB = {
        'x': (lambda x: x),          # Linear
        'x^2': (lambda x: x**2),     # Quadratic
        'sin(x)': np.sin,            # Periodic
        'tanh(x)': np.tanh          # Bounded
    }
    
  2. Automatic Simplification

    def simplify_formula(terms, threshold=1e-4):
        return [term for term in terms if abs(term.coefficient) > threshold]
    
  3. Research-Oriented Architecture

    class SymbolicEdge:
        def forward(self, x):
            return sum(w * f(x) for w, f in zip(self.weights, self.basis_functions))
            
        def get_formula(self):
            return format_symbolic_terms(self.weights, self.basis_functions)
    

Architecture Diagram

Architecture Diagram

Key Design Principles

  1. Interpretability First: All transformations maintain clear mathematical meaning
  2. Scikit-learn Compatibility: Familiar .fit() and .predict() interface
  3. Symbolic Formula Exporting: Export formulas as lightweight mathematical expressions
  4. Automatic Simplification: Remove insignificant terms (|w| < 1e-4)

Key Model Components

  1. EdgeActivation Layer:

    • Implements interpretable basis function transformations
    • Automatically prunes insignificant terms
    • Maintains mathematical transparency
  2. Formula Extraction:

    • Combines edge transformations with learned weights
    • Applies symbolic simplification
    • Generates human-readable expressions
  3. Training Process:

    • Gradient-based optimization of edge weights
    • Automatic feature importance detection
    • Complexity control through regularization

Contributing

We welcome contributions! Key areas of interest:

  • Model architecture improvements
  • Novel basis function implementations
  • Improved symbolic extraction algorithms
  • Real-world case studies and applications
  • Performance optimizations

Please see CONTRIBUTING.md for guidelines.

Citation

If you use OIKAN in your research, please cite:

@software{oikan2025,
  title = {OIKAN: Optimized Interpretable Kolmogorov-Arnold Networks},
  author = {Zhalgasbayev, Arman},
  year = {2025},
  url = {https://github.com/silvermete0r/OIKAN}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

oikan-0.0.2.4.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

oikan-0.0.2.4-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file oikan-0.0.2.4.tar.gz.

File metadata

  • Download URL: oikan-0.0.2.4.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for oikan-0.0.2.4.tar.gz
Algorithm Hash digest
SHA256 fc9b95ba268b301426a6ac68cb4e05009788f8916cc1a699cc65a909a948065a
MD5 66a26c4ec41bcb2e1e6e440b59fdb817
BLAKE2b-256 08ccaa80ae734eb60e9560c3df55bf89f6e7b215dba60f2554c616fe29103207

See more details on using hashes here.

File details

Details for the file oikan-0.0.2.4-py3-none-any.whl.

File metadata

  • Download URL: oikan-0.0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for oikan-0.0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 60b739cd0c788f201c3be779d1776fc295e46ac8d8dc3fbd3fc97c07c5ae9b6d
MD5 22b733f74ab757db66be7c265695a4a1
BLAKE2b-256 e060ea2f52a598c4f11c0de5991d05aca69107852b6c5c63422f89b38a4a2328

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