oikan 0.0.2.4__py3-none-any.whl → 0.0.3.1__py3-none-any.whl
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/__init__.py +14 -0
- oikan/exceptions.py +5 -13
- oikan/model.py +307 -426
- oikan/neural.py +43 -0
- oikan/symbolic.py +52 -25
- oikan/utils.py +59 -37
- oikan-0.0.3.1.dist-info/METADATA +233 -0
- oikan-0.0.3.1.dist-info/RECORD +11 -0
- {oikan-0.0.2.4.dist-info → oikan-0.0.3.1.dist-info}/WHEEL +1 -1
- oikan-0.0.2.4.dist-info/METADATA +0 -214
- oikan-0.0.2.4.dist-info/RECORD +0 -10
- {oikan-0.0.2.4.dist-info → oikan-0.0.3.1.dist-info}/licenses/LICENSE +0 -0
- {oikan-0.0.2.4.dist-info → oikan-0.0.3.1.dist-info}/top_level.txt +0 -0
oikan-0.0.2.4.dist-info/METADATA
DELETED
@@ -1,214 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: oikan
|
3
|
-
Version: 0.0.2.4
|
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
|
-
> **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.
|
36
|
-
|
37
|
-
## Key Features
|
38
|
-
- 🧠 **Neuro-Symbolic ML**: Combines neural network learning with symbolic mathematics
|
39
|
-
- 📊 **Automatic Formula Extraction**: Generates human-readable mathematical expressions
|
40
|
-
- 🎯 **Scikit-learn Compatible**: Familiar `.fit()` and `.predict()` interface
|
41
|
-
- 🔬 **Research-Focused**: Designed for academic exploration and experimentation
|
42
|
-
- 📈 **Multi-Task**: Supports both regression and classification problems
|
43
|
-
|
44
|
-
## Scientific Foundation
|
45
|
-
|
46
|
-
OIKAN implements the Kolmogorov-Arnold Representation Theorem through a novel neural architecture:
|
47
|
-
|
48
|
-
1. **Theorem Background**: Any continuous multivariate function f(x1,...,xn) can be represented as:
|
49
|
-
```
|
50
|
-
f(x1,...,xn) = ∑(j=0 to 2n){ φj( ∑(i=1 to n) ψij(xi) ) }
|
51
|
-
```
|
52
|
-
where φj and ψij are continuous single-variable functions.
|
53
|
-
|
54
|
-
2. **Neural Implementation**:
|
55
|
-
```python
|
56
|
-
# Pseudo-implementation of KAN architecture
|
57
|
-
class KANLayer:
|
58
|
-
def __init__(self, input_dim, output_dim):
|
59
|
-
self.edges = [SymbolicEdge() for _ in range(input_dim * output_dim)]
|
60
|
-
self.weights = initialize_weights(input_dim, output_dim)
|
61
|
-
|
62
|
-
def forward(self, x):
|
63
|
-
# Transform each input through basis functions
|
64
|
-
edge_outputs = [edge(x_i) for x_i, edge in zip(x, self.edges)]
|
65
|
-
# Combine using learned weights
|
66
|
-
return combine_weighted_outputs(edge_outputs, self.weights)
|
67
|
-
```
|
68
|
-
|
69
|
-
## Quick Start
|
70
|
-
|
71
|
-
### Installation
|
72
|
-
|
73
|
-
#### Method 1: Via PyPI (Recommended)
|
74
|
-
```bash
|
75
|
-
pip install -qU oikan
|
76
|
-
```
|
77
|
-
|
78
|
-
#### Method 2: Local Development
|
79
|
-
```bash
|
80
|
-
git clone https://github.com/silvermete0r/OIKAN.git
|
81
|
-
cd OIKAN
|
82
|
-
pip install -e . # Install in development mode
|
83
|
-
```
|
84
|
-
|
85
|
-
### Regression Example
|
86
|
-
```python
|
87
|
-
from oikan.model import OIKANRegressor
|
88
|
-
from sklearn.model_selection import train_test_split
|
89
|
-
|
90
|
-
# Initialize model
|
91
|
-
model = OIKANRegressor()
|
92
|
-
|
93
|
-
# Fit model (sklearn-style)
|
94
|
-
model.fit(X_train, y_train, epochs=100, lr=0.01)
|
95
|
-
|
96
|
-
# Get predictions
|
97
|
-
y_pred = model.predict(X_test)
|
98
|
-
|
99
|
-
# Save interpretable formula to file with auto-generated guidelines
|
100
|
-
# The output file will contain:
|
101
|
-
# - Detailed symbolic formulas for each feature
|
102
|
-
# - Instructions for practical implementation
|
103
|
-
# - Recommendations for testing and validation
|
104
|
-
model.save_symbolic_formula("regression_formula.txt")
|
105
|
-
```
|
106
|
-
|
107
|
-
*Example of the saved symbolic formula instructions: [outputs/regression_symbolic_formula.txt](outputs/regression_symbolic_formula.txt)*
|
108
|
-
|
109
|
-
|
110
|
-
### Classification Example
|
111
|
-
```python
|
112
|
-
from oikan.model import OIKANClassifier
|
113
|
-
|
114
|
-
# Similar sklearn-style interface for classification
|
115
|
-
model = OIKANClassifier()
|
116
|
-
model.fit(X_train, y_train, epochs=100, lr=0.01)
|
117
|
-
probas = model.predict_proba(X_test)
|
118
|
-
|
119
|
-
# Save classification formulas with implementation guidelines
|
120
|
-
# The output file will contain:
|
121
|
-
# - Decision boundary formulas for each class
|
122
|
-
# - Softmax application instructions
|
123
|
-
# - Recommendations for testing and validation
|
124
|
-
model.save_symbolic_formula("classification_formula.txt")
|
125
|
-
```
|
126
|
-
|
127
|
-
*Example of the saved symbolic formula instructions: [outputs/classification_symbolic_formula.txt](outputs/classification_symbolic_formula.txt)*
|
128
|
-
|
129
|
-
|
130
|
-
### Key Design Principles
|
131
|
-
|
132
|
-
1. **Interpretability by Design**
|
133
|
-
```python
|
134
|
-
# Edge activation contains interpretable basis functions
|
135
|
-
ADVANCED_LIB = {
|
136
|
-
'x': (lambda x: x), # Linear
|
137
|
-
'x^2': (lambda x: x**2), # Quadratic
|
138
|
-
'sin(x)': np.sin, # Periodic
|
139
|
-
'tanh(x)': np.tanh # Bounded
|
140
|
-
}
|
141
|
-
```
|
142
|
-
|
143
|
-
2. **Automatic Simplification**
|
144
|
-
```python
|
145
|
-
def simplify_formula(terms, threshold=1e-4):
|
146
|
-
return [term for term in terms if abs(term.coefficient) > threshold]
|
147
|
-
```
|
148
|
-
|
149
|
-
3. **Research-Oriented Architecture**
|
150
|
-
```python
|
151
|
-
class SymbolicEdge:
|
152
|
-
def forward(self, x):
|
153
|
-
return sum(w * f(x) for w, f in zip(self.weights, self.basis_functions))
|
154
|
-
|
155
|
-
def get_formula(self):
|
156
|
-
return format_symbolic_terms(self.weights, self.basis_functions)
|
157
|
-
```
|
158
|
-
|
159
|
-
### Architecture Diagram
|
160
|
-
|
161
|
-

|
162
|
-
|
163
|
-
### Key Design Principles
|
164
|
-
|
165
|
-
1. **Interpretability First**: All transformations maintain clear mathematical meaning
|
166
|
-
2. **Scikit-learn Compatibility**: Familiar `.fit()` and `.predict()` interface
|
167
|
-
3. **Symbolic Formula Exporting**: Export formulas as lightweight mathematical expressions
|
168
|
-
4. **Automatic Simplification**: Remove insignificant terms (|w| < 1e-4)
|
169
|
-
|
170
|
-
|
171
|
-
### Key Model Components
|
172
|
-
|
173
|
-
1. **EdgeActivation Layer**:
|
174
|
-
- Implements interpretable basis function transformations
|
175
|
-
- Automatically prunes insignificant terms
|
176
|
-
- Maintains mathematical transparency
|
177
|
-
|
178
|
-
2. **Formula Extraction**:
|
179
|
-
- Combines edge transformations with learned weights
|
180
|
-
- Applies symbolic simplification
|
181
|
-
- Generates human-readable expressions
|
182
|
-
|
183
|
-
3. **Training Process**:
|
184
|
-
- Gradient-based optimization of edge weights
|
185
|
-
- Automatic feature importance detection
|
186
|
-
- Complexity control through regularization
|
187
|
-
|
188
|
-
## Contributing
|
189
|
-
|
190
|
-
We welcome contributions! Key areas of interest:
|
191
|
-
|
192
|
-
- Model architecture improvements
|
193
|
-
- Novel basis function implementations
|
194
|
-
- Improved symbolic extraction algorithms
|
195
|
-
- Real-world case studies and applications
|
196
|
-
- Performance optimizations
|
197
|
-
|
198
|
-
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
199
|
-
|
200
|
-
## Citation
|
201
|
-
|
202
|
-
If you use OIKAN in your research, please cite:
|
203
|
-
|
204
|
-
```bibtex
|
205
|
-
@software{oikan2025,
|
206
|
-
title = {OIKAN: Optimized Interpretable Kolmogorov-Arnold Networks},
|
207
|
-
author = {Zhalgasbayev, Arman},
|
208
|
-
year = {2025},
|
209
|
-
url = {https://github.com/silvermete0r/OIKAN}
|
210
|
-
}
|
211
|
-
```
|
212
|
-
|
213
|
-
## License
|
214
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
oikan-0.0.2.4.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
oikan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
oikan/exceptions.py,sha256=UqT3uTtfiB8QA_3AMvKdHOme9WL9HZD_d7GHIk00LJw,394
|
3
|
-
oikan/model.py,sha256=nPQcP5TYeuL29pjc9nIKd1tak-Bmh0d0LdRZz6LwcTo,20779
|
4
|
-
oikan/symbolic.py,sha256=TtalmSpBecf33_g7yE3q-RPuCVRWQNaXWE4LsCNZmfg,1040
|
5
|
-
oikan/utils.py,sha256=GpwAHjPpq3lHvUIS0sKSxJzaLBIkyDxe0aiYRrOqL90,1581
|
6
|
-
oikan-0.0.2.4.dist-info/licenses/LICENSE,sha256=75ASVmU-XIpN-M4LbVmJ_ibgbzbvRLVti8FhnR0BTf8,1096
|
7
|
-
oikan-0.0.2.4.dist-info/METADATA,sha256=DXQFc4HCNY7hVk_UGXLN43qwmEf0OZFIredbEE6Uq5I,7850
|
8
|
-
oikan-0.0.2.4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
9
|
-
oikan-0.0.2.4.dist-info/top_level.txt,sha256=XwnwKwTJddZwIvtrUsAz-l-58BJRj6HjAGWrfYi_3QY,6
|
10
|
-
oikan-0.0.2.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|