oikan 0.0.1.11__tar.gz → 0.0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oikan-0.0.2.1/PKG-INFO +160 -0
- oikan-0.0.2.1/README.md +143 -0
- oikan-0.0.2.1/oikan/exceptions.py +15 -0
- oikan-0.0.2.1/oikan/model.py +438 -0
- oikan-0.0.2.1/oikan/symbolic.py +28 -0
- oikan-0.0.2.1/oikan/utils.py +47 -0
- oikan-0.0.2.1/oikan.egg-info/PKG-INFO +160 -0
- {oikan-0.0.1.11 → oikan-0.0.2.1}/oikan.egg-info/SOURCES.txt +1 -4
- oikan-0.0.2.1/oikan.egg-info/requires.txt +3 -0
- {oikan-0.0.1.11 → oikan-0.0.2.1}/pyproject.toml +2 -4
- {oikan-0.0.1.11 → oikan-0.0.2.1}/setup.py +1 -3
- oikan-0.0.1.11/PKG-INFO +0 -105
- oikan-0.0.1.11/README.md +0 -87
- oikan-0.0.1.11/oikan/metrics.py +0 -48
- oikan-0.0.1.11/oikan/model.py +0 -99
- oikan-0.0.1.11/oikan/regularization.py +0 -30
- oikan-0.0.1.11/oikan/symbolic.py +0 -129
- oikan-0.0.1.11/oikan/trainer.py +0 -49
- oikan-0.0.1.11/oikan/utils.py +0 -44
- oikan-0.0.1.11/oikan/visualize.py +0 -69
- oikan-0.0.1.11/oikan.egg-info/PKG-INFO +0 -105
- oikan-0.0.1.11/oikan.egg-info/requires.txt +0 -5
- {oikan-0.0.1.11 → oikan-0.0.2.1}/LICENSE +0 -0
- {oikan-0.0.1.11 → oikan-0.0.2.1}/oikan/__init__.py +0 -0
- {oikan-0.0.1.11 → oikan-0.0.2.1}/oikan.egg-info/dependency_links.txt +0 -0
- {oikan-0.0.1.11 → oikan-0.0.2.1}/oikan.egg-info/top_level.txt +0 -0
- {oikan-0.0.1.11 → oikan-0.0.2.1}/setup.cfg +0 -0
oikan-0.0.2.1/PKG-INFO
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: oikan
|
3
|
+
Version: 0.0.2.1
|
4
|
+
Summary: OIKAN: Optimized Interpretable Kolmogorov-Arnold Networks
|
5
|
+
Author: Arman Zhalgasbayev
|
6
|
+
License: MIT
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
9
|
+
Classifier: Operating System :: OS Independent
|
10
|
+
Requires-Python: >=3.7
|
11
|
+
Description-Content-Type: text/markdown
|
12
|
+
License-File: LICENSE
|
13
|
+
Requires-Dist: torch
|
14
|
+
Requires-Dist: numpy
|
15
|
+
Requires-Dist: scikit-learn
|
16
|
+
Dynamic: license-file
|
17
|
+
|
18
|
+
<!-- logo in the center -->
|
19
|
+
<div align="center">
|
20
|
+
<img src="https://raw.githubusercontent.com/silvermete0r/oikan/main/docs/media/oikan_logo.png" alt="OIKAN Logo" width="200"/>
|
21
|
+
|
22
|
+
<h1>OIKAN: Optimized Interpretable Kolmogorov-Arnold Networks</h1>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
## Overview
|
26
|
+
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.
|
27
|
+
|
28
|
+
[](https://badge.fury.io/py/oikan)
|
29
|
+
[](https://pypistats.org/packages/oikan)
|
30
|
+
[](https://pepy.tech/projects/oikan)
|
31
|
+
[](https://opensource.org/licenses/MIT)
|
32
|
+
[](https://github.com/silvermete0r/oikan/issues)
|
33
|
+
[](https://silvermete0r.github.io/oikan/)
|
34
|
+
|
35
|
+
## Key Features
|
36
|
+
- 🧠 **Neuro-Symbolic ML**: Combines neural network learning with symbolic mathematics
|
37
|
+
- 📊 **Automatic Formula Extraction**: Generates human-readable mathematical expressions
|
38
|
+
- 🎯 **Scikit-learn Compatible**: Familiar `.fit()` and `.predict()` interface
|
39
|
+
- 🚀 **Production-Ready**: Export symbolic formulas for lightweight deployment
|
40
|
+
- 📈 **Multi-Task**: Supports both regression and classification problems
|
41
|
+
|
42
|
+
## Scientific Foundation
|
43
|
+
|
44
|
+
OIKAN is based on Kolmogorov's superposition theorem, which states that any multivariate continuous function can be represented as a composition of single-variable functions. We leverage this theory by:
|
45
|
+
|
46
|
+
1. Using neural networks to learn optimal basis functions
|
47
|
+
2. Employing SVD projection for dimensionality reduction
|
48
|
+
3. Applying symbolic regression to extract interpretable formulas
|
49
|
+
|
50
|
+
## Quick Start
|
51
|
+
|
52
|
+
### Installation
|
53
|
+
|
54
|
+
#### Method 1: Via PyPI (Recommended)
|
55
|
+
```bash
|
56
|
+
pip install -qU oikan
|
57
|
+
```
|
58
|
+
|
59
|
+
#### Method 2: Local Development
|
60
|
+
```bash
|
61
|
+
git clone https://github.com/silvermete0r/OIKAN.git
|
62
|
+
cd OIKAN
|
63
|
+
pip install -e . # Install in development mode
|
64
|
+
```
|
65
|
+
|
66
|
+
### Regression Example
|
67
|
+
```python
|
68
|
+
from oikan.model import OIKANRegressor
|
69
|
+
from sklearn.model_selection import train_test_split
|
70
|
+
|
71
|
+
# Initialize model with optimal architecture
|
72
|
+
model = OIKANRegressor(
|
73
|
+
hidden_dims=[16, 8], # Network architecture
|
74
|
+
num_basis=10, # Number of basis functions
|
75
|
+
degree=3, # Polynomial degree
|
76
|
+
dropout=0.1 # Regularization
|
77
|
+
)
|
78
|
+
|
79
|
+
# Fit model (sklearn-style)
|
80
|
+
model.fit(X_train, y_train, epochs=200, lr=0.01)
|
81
|
+
|
82
|
+
# Get predictions
|
83
|
+
y_pred = model.predict(X_test)
|
84
|
+
|
85
|
+
# Save interpretable formula to file with auto-generated guidelines
|
86
|
+
# The output file will contain:
|
87
|
+
# - Detailed symbolic formulas for each feature
|
88
|
+
# - Instructions for practical implementation
|
89
|
+
# - Recommendations for production deployment
|
90
|
+
model.save_symbolic_formula("regression_formula.txt")
|
91
|
+
```
|
92
|
+
|
93
|
+
*Example of the saved symbolic formula instructions: [outputs/regression_symbolic_formula.txt](outputs/regression_symbolic_formula.txt)*
|
94
|
+
|
95
|
+
|
96
|
+
### Classification Example
|
97
|
+
```python
|
98
|
+
from oikan.model import OIKANClassifier
|
99
|
+
|
100
|
+
# Similar sklearn-style interface for classification
|
101
|
+
model = OIKANClassifier(hidden_dims=[16, 8])
|
102
|
+
model.fit(X_train, y_train)
|
103
|
+
probas = model.predict_proba(X_test)
|
104
|
+
|
105
|
+
# Save classification formulas with implementation guidelines
|
106
|
+
# The output file will contain:
|
107
|
+
# - Decision boundary formulas for each class
|
108
|
+
# - Softmax application instructions
|
109
|
+
# - Production deployment recommendations
|
110
|
+
model.save_symbolic_formula("classification_formula.txt")
|
111
|
+
```
|
112
|
+
|
113
|
+
*Example of the saved symbolic formula instructions: [outputs/classification_symbolic_formula.txt](outputs/classification_symbolic_formula.txt)*
|
114
|
+
|
115
|
+
## Architecture Details
|
116
|
+
|
117
|
+
OIKAN's architecture consists of three main components:
|
118
|
+
|
119
|
+
1. **Basis Function Layer**: Learns optimal single-variable transformations
|
120
|
+
- B-spline bases for smooth function approximation
|
121
|
+
- Trigonometric bases for periodic patterns
|
122
|
+
- Polynomial bases for algebraic relationships
|
123
|
+
|
124
|
+
2. **Neural Composition Layer**: Combines transformed features
|
125
|
+
- SVD projection for dimensionality reduction
|
126
|
+
- Dropout for regularization
|
127
|
+
- Skip connections for gradient flow
|
128
|
+
|
129
|
+
3. **Symbolic Extraction Layer**: Generates interpretable formulas
|
130
|
+
- L1 regularization for sparse representations
|
131
|
+
- Symbolic regression for formula extraction
|
132
|
+
- LaTeX export for documentation
|
133
|
+
|
134
|
+
## Contributing
|
135
|
+
|
136
|
+
We welcome contributions! Key areas of interest:
|
137
|
+
|
138
|
+
- Model architecture improvements
|
139
|
+
- Novel basis function implementations
|
140
|
+
- Improved symbolic extraction algorithms
|
141
|
+
- Real-world case studies and applications
|
142
|
+
- Performance optimizations
|
143
|
+
|
144
|
+
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
145
|
+
|
146
|
+
## Citation
|
147
|
+
|
148
|
+
If you use OIKAN in your research, please cite:
|
149
|
+
|
150
|
+
```bibtex
|
151
|
+
@software{oikan2025,
|
152
|
+
title = {OIKAN: Optimized Interpretable Kolmogorov-Arnold Networks},
|
153
|
+
author = {Zhalgasbayev, Arman},
|
154
|
+
year = {2025},
|
155
|
+
url = {https://github.com/silvermete0r/OIKAN}
|
156
|
+
}
|
157
|
+
```
|
158
|
+
|
159
|
+
## License
|
160
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
oikan-0.0.2.1/README.md
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
<!-- logo in the center -->
|
2
|
+
<div align="center">
|
3
|
+
<img src="https://raw.githubusercontent.com/silvermete0r/oikan/main/docs/media/oikan_logo.png" alt="OIKAN Logo" width="200"/>
|
4
|
+
|
5
|
+
<h1>OIKAN: Optimized Interpretable Kolmogorov-Arnold Networks</h1>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
## Overview
|
9
|
+
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.
|
10
|
+
|
11
|
+
[](https://badge.fury.io/py/oikan)
|
12
|
+
[](https://pypistats.org/packages/oikan)
|
13
|
+
[](https://pepy.tech/projects/oikan)
|
14
|
+
[](https://opensource.org/licenses/MIT)
|
15
|
+
[](https://github.com/silvermete0r/oikan/issues)
|
16
|
+
[](https://silvermete0r.github.io/oikan/)
|
17
|
+
|
18
|
+
## Key Features
|
19
|
+
- 🧠 **Neuro-Symbolic ML**: Combines neural network learning with symbolic mathematics
|
20
|
+
- 📊 **Automatic Formula Extraction**: Generates human-readable mathematical expressions
|
21
|
+
- 🎯 **Scikit-learn Compatible**: Familiar `.fit()` and `.predict()` interface
|
22
|
+
- 🚀 **Production-Ready**: Export symbolic formulas for lightweight deployment
|
23
|
+
- 📈 **Multi-Task**: Supports both regression and classification problems
|
24
|
+
|
25
|
+
## Scientific Foundation
|
26
|
+
|
27
|
+
OIKAN is based on Kolmogorov's superposition theorem, which states that any multivariate continuous function can be represented as a composition of single-variable functions. We leverage this theory by:
|
28
|
+
|
29
|
+
1. Using neural networks to learn optimal basis functions
|
30
|
+
2. Employing SVD projection for dimensionality reduction
|
31
|
+
3. Applying symbolic regression to extract interpretable formulas
|
32
|
+
|
33
|
+
## Quick Start
|
34
|
+
|
35
|
+
### Installation
|
36
|
+
|
37
|
+
#### Method 1: Via PyPI (Recommended)
|
38
|
+
```bash
|
39
|
+
pip install -qU oikan
|
40
|
+
```
|
41
|
+
|
42
|
+
#### Method 2: Local Development
|
43
|
+
```bash
|
44
|
+
git clone https://github.com/silvermete0r/OIKAN.git
|
45
|
+
cd OIKAN
|
46
|
+
pip install -e . # Install in development mode
|
47
|
+
```
|
48
|
+
|
49
|
+
### Regression Example
|
50
|
+
```python
|
51
|
+
from oikan.model import OIKANRegressor
|
52
|
+
from sklearn.model_selection import train_test_split
|
53
|
+
|
54
|
+
# Initialize model with optimal architecture
|
55
|
+
model = OIKANRegressor(
|
56
|
+
hidden_dims=[16, 8], # Network architecture
|
57
|
+
num_basis=10, # Number of basis functions
|
58
|
+
degree=3, # Polynomial degree
|
59
|
+
dropout=0.1 # Regularization
|
60
|
+
)
|
61
|
+
|
62
|
+
# Fit model (sklearn-style)
|
63
|
+
model.fit(X_train, y_train, epochs=200, lr=0.01)
|
64
|
+
|
65
|
+
# Get predictions
|
66
|
+
y_pred = model.predict(X_test)
|
67
|
+
|
68
|
+
# Save interpretable formula to file with auto-generated guidelines
|
69
|
+
# The output file will contain:
|
70
|
+
# - Detailed symbolic formulas for each feature
|
71
|
+
# - Instructions for practical implementation
|
72
|
+
# - Recommendations for production deployment
|
73
|
+
model.save_symbolic_formula("regression_formula.txt")
|
74
|
+
```
|
75
|
+
|
76
|
+
*Example of the saved symbolic formula instructions: [outputs/regression_symbolic_formula.txt](outputs/regression_symbolic_formula.txt)*
|
77
|
+
|
78
|
+
|
79
|
+
### Classification Example
|
80
|
+
```python
|
81
|
+
from oikan.model import OIKANClassifier
|
82
|
+
|
83
|
+
# Similar sklearn-style interface for classification
|
84
|
+
model = OIKANClassifier(hidden_dims=[16, 8])
|
85
|
+
model.fit(X_train, y_train)
|
86
|
+
probas = model.predict_proba(X_test)
|
87
|
+
|
88
|
+
# Save classification formulas with implementation guidelines
|
89
|
+
# The output file will contain:
|
90
|
+
# - Decision boundary formulas for each class
|
91
|
+
# - Softmax application instructions
|
92
|
+
# - Production deployment recommendations
|
93
|
+
model.save_symbolic_formula("classification_formula.txt")
|
94
|
+
```
|
95
|
+
|
96
|
+
*Example of the saved symbolic formula instructions: [outputs/classification_symbolic_formula.txt](outputs/classification_symbolic_formula.txt)*
|
97
|
+
|
98
|
+
## Architecture Details
|
99
|
+
|
100
|
+
OIKAN's architecture consists of three main components:
|
101
|
+
|
102
|
+
1. **Basis Function Layer**: Learns optimal single-variable transformations
|
103
|
+
- B-spline bases for smooth function approximation
|
104
|
+
- Trigonometric bases for periodic patterns
|
105
|
+
- Polynomial bases for algebraic relationships
|
106
|
+
|
107
|
+
2. **Neural Composition Layer**: Combines transformed features
|
108
|
+
- SVD projection for dimensionality reduction
|
109
|
+
- Dropout for regularization
|
110
|
+
- Skip connections for gradient flow
|
111
|
+
|
112
|
+
3. **Symbolic Extraction Layer**: Generates interpretable formulas
|
113
|
+
- L1 regularization for sparse representations
|
114
|
+
- Symbolic regression for formula extraction
|
115
|
+
- LaTeX export for documentation
|
116
|
+
|
117
|
+
## Contributing
|
118
|
+
|
119
|
+
We welcome contributions! Key areas of interest:
|
120
|
+
|
121
|
+
- Model architecture improvements
|
122
|
+
- Novel basis function implementations
|
123
|
+
- Improved symbolic extraction algorithms
|
124
|
+
- Real-world case studies and applications
|
125
|
+
- Performance optimizations
|
126
|
+
|
127
|
+
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
128
|
+
|
129
|
+
## Citation
|
130
|
+
|
131
|
+
If you use OIKAN in your research, please cite:
|
132
|
+
|
133
|
+
```bibtex
|
134
|
+
@software{oikan2025,
|
135
|
+
title = {OIKAN: Optimized Interpretable Kolmogorov-Arnold Networks},
|
136
|
+
author = {Zhalgasbayev, Arman},
|
137
|
+
year = {2025},
|
138
|
+
url = {https://github.com/silvermete0r/OIKAN}
|
139
|
+
}
|
140
|
+
```
|
141
|
+
|
142
|
+
## License
|
143
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class OikanError(Exception):
|
2
|
+
"""Base exception class for OIKAN"""
|
3
|
+
pass
|
4
|
+
|
5
|
+
class NotFittedError(OikanError):
|
6
|
+
"""Raised when prediction is attempted on unfitted model"""
|
7
|
+
pass
|
8
|
+
|
9
|
+
class DataError(OikanError):
|
10
|
+
"""Raised when there are issues with input data"""
|
11
|
+
pass
|
12
|
+
|
13
|
+
class InitializationError(OikanError):
|
14
|
+
"""Raised when model initialization fails"""
|
15
|
+
pass
|