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)
    
  3. Basis functions

# 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
}

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

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.5.tar.gz (13.0 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.5-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oikan-0.0.2.5.tar.gz
  • Upload date:
  • Size: 13.0 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.5.tar.gz
Algorithm Hash digest
SHA256 d40f7636db33e3cc97fd00e0f6704fc06264e727b0ab699ad5373d1ec013e64e
MD5 374c2a70549963f02755487f961dc33e
BLAKE2b-256 d657f8412455cd15ca6da586ad93d6ba9631fff63b764719d3ee457f5b5b0be8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oikan-0.0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 11.5 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4d6fce0fce599f1b65e91dcc086bd110590bf27f54f87418cdde9840b75db186
MD5 9491fb453e5dd5d9490edb73c0bb45cd
BLAKE2b-256 26c5bc5f15c5d72735b445e5a833c389b390fad190143743ce6c70347fa3d34a

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