oikan 0.0.3.4__tar.gz → 0.0.3.5__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.3.4 → oikan-0.0.3.5}/PKG-INFO +13 -11
- {oikan-0.0.3.4 → oikan-0.0.3.5}/README.md +12 -10
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan/model.py +5 -5
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan.egg-info/PKG-INFO +13 -11
- {oikan-0.0.3.4 → oikan-0.0.3.5}/pyproject.toml +1 -1
- {oikan-0.0.3.4 → oikan-0.0.3.5}/LICENSE +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan/__init__.py +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan/exceptions.py +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan/neural.py +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan/utils.py +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan.egg-info/SOURCES.txt +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan.egg-info/dependency_links.txt +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan.egg-info/requires.txt +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/oikan.egg-info/top_level.txt +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/setup.cfg +0 -0
- {oikan-0.0.3.4 → oikan-0.0.3.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: oikan
|
3
|
-
Version: 0.0.3.
|
3
|
+
Version: 0.0.3.5
|
4
4
|
Summary: OIKAN: Neuro-Symbolic ML for Scientific Discovery
|
5
5
|
Author: Arman Zhalgasbayev
|
6
6
|
License: MIT
|
@@ -34,6 +34,7 @@ OIKAN is a neuro-symbolic machine learning framework inspired by Kolmogorov-Arno
|
|
34
34
|
[](https://opensource.org/licenses/MIT)
|
35
35
|
[](https://github.com/silvermete0r/oikan/issues)
|
36
36
|
[](https://silvermete0r.github.io/oikan/)
|
37
|
+
[](https://deepwiki.com/silvermete0r/oikan)
|
37
38
|
|
38
39
|
> **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.
|
39
40
|
|
@@ -62,14 +63,15 @@ OIKAN implements a modern interpretation of the Kolmogorov-Arnold Representation
|
|
62
63
|
- Automatic pruning of insignificant terms
|
63
64
|
|
64
65
|
```python
|
65
|
-
|
66
|
-
|
66
|
+
class OIKAN:
|
67
|
+
def __init__(self, hidden_sizes=[64, 64], activation='relu',
|
67
68
|
polynomial_degree=2, alpha=0.1):
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
# Neural network for learning complex patterns
|
70
|
+
self.neural_net = TabularNet(input_size, hidden_sizes, activation)
|
71
|
+
# Data augmentation for better coverage
|
72
|
+
self.augmented_data = self.augment_data(X, y, augmentation_factor=5)
|
73
|
+
# Symbolic regression for interpretable formulas
|
74
|
+
self.symbolic_regression = SymbolicRegression(alpha=alpha)
|
73
75
|
```
|
74
76
|
|
75
77
|
3. **Basis Functions**: Core set of interpretable transformations:
|
@@ -140,7 +142,7 @@ mse = mean_squared_error(y_test, y_pred)
|
|
140
142
|
print("Mean Squared Error:", mse)
|
141
143
|
|
142
144
|
# Get symbolic formula
|
143
|
-
formula = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: '
|
145
|
+
formula = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: 'sympy' -> simplified formula using sympy; 'latex' -> LaTeX format
|
144
146
|
print("Symbolic Formula:", formula)
|
145
147
|
|
146
148
|
# Get feature importances
|
@@ -189,7 +191,7 @@ accuracy = model.score(X_test, y_test)
|
|
189
191
|
print("Accuracy:", accuracy)
|
190
192
|
|
191
193
|
# Get symbolic formulas for each class
|
192
|
-
formulas = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: '
|
194
|
+
formulas = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: 'sympy' -> simplified formula using sympy; 'latex' -> LaTeX format
|
193
195
|
for i, formula in enumerate(formulas):
|
194
196
|
print(f"Class {i} Formula:", formula)
|
195
197
|
|
@@ -209,7 +211,7 @@ loaded_model.load("outputs/model.json")
|
|
209
211
|
|
210
212
|
### Architecture Diagram
|
211
213
|
|
212
|
-
-architecture-oop.png)
|
213
215
|
|
214
216
|
## OIKAN Symbolic Model Compilers
|
215
217
|
|
@@ -15,6 +15,7 @@ OIKAN is a neuro-symbolic machine learning framework inspired by Kolmogorov-Arno
|
|
15
15
|
[](https://opensource.org/licenses/MIT)
|
16
16
|
[](https://github.com/silvermete0r/oikan/issues)
|
17
17
|
[](https://silvermete0r.github.io/oikan/)
|
18
|
+
[](https://deepwiki.com/silvermete0r/oikan)
|
18
19
|
|
19
20
|
> **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.
|
20
21
|
|
@@ -43,14 +44,15 @@ OIKAN implements a modern interpretation of the Kolmogorov-Arnold Representation
|
|
43
44
|
- Automatic pruning of insignificant terms
|
44
45
|
|
45
46
|
```python
|
46
|
-
|
47
|
-
|
47
|
+
class OIKAN:
|
48
|
+
def __init__(self, hidden_sizes=[64, 64], activation='relu',
|
48
49
|
polynomial_degree=2, alpha=0.1):
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
# Neural network for learning complex patterns
|
51
|
+
self.neural_net = TabularNet(input_size, hidden_sizes, activation)
|
52
|
+
# Data augmentation for better coverage
|
53
|
+
self.augmented_data = self.augment_data(X, y, augmentation_factor=5)
|
54
|
+
# Symbolic regression for interpretable formulas
|
55
|
+
self.symbolic_regression = SymbolicRegression(alpha=alpha)
|
54
56
|
```
|
55
57
|
|
56
58
|
3. **Basis Functions**: Core set of interpretable transformations:
|
@@ -121,7 +123,7 @@ mse = mean_squared_error(y_test, y_pred)
|
|
121
123
|
print("Mean Squared Error:", mse)
|
122
124
|
|
123
125
|
# Get symbolic formula
|
124
|
-
formula = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: '
|
126
|
+
formula = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: 'sympy' -> simplified formula using sympy; 'latex' -> LaTeX format
|
125
127
|
print("Symbolic Formula:", formula)
|
126
128
|
|
127
129
|
# Get feature importances
|
@@ -170,7 +172,7 @@ accuracy = model.score(X_test, y_test)
|
|
170
172
|
print("Accuracy:", accuracy)
|
171
173
|
|
172
174
|
# Get symbolic formulas for each class
|
173
|
-
formulas = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: '
|
175
|
+
formulas = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: 'sympy' -> simplified formula using sympy; 'latex' -> LaTeX format
|
174
176
|
for i, formula in enumerate(formulas):
|
175
177
|
print(f"Class {i} Formula:", formula)
|
176
178
|
|
@@ -190,7 +192,7 @@ loaded_model.load("outputs/model.json")
|
|
190
192
|
|
191
193
|
### Architecture Diagram
|
192
194
|
|
193
|
-
-architecture-oop.png)
|
194
196
|
|
195
197
|
## OIKAN Symbolic Model Compilers
|
196
198
|
|
@@ -93,11 +93,11 @@ class OIKAN(ABC):
|
|
93
93
|
|
94
94
|
Parameter:
|
95
95
|
--------
|
96
|
-
type : str, optional (default='original') other options: '
|
97
|
-
'original' returns the original formula with coefficients, '
|
96
|
+
type : str, optional (default='original') other options: 'sympy', 'latex'
|
97
|
+
'original' returns the original formula with coefficients, 'sympy' returns sympy simplified formula.
|
98
98
|
"""
|
99
|
-
if type.lower() not in ['original', '
|
100
|
-
raise InvalidParameterError("Invalid type. Choose 'original', '
|
99
|
+
if type.lower() not in ['original', 'sympy', 'latex']:
|
100
|
+
raise InvalidParameterError("Invalid type. Choose 'original', 'sympy', 'latex'.")
|
101
101
|
if self.symbolic_model is None:
|
102
102
|
raise ValueError("Model not fitted yet.")
|
103
103
|
basis_functions = self.symbolic_model['basis_functions']
|
@@ -114,7 +114,7 @@ class OIKAN(ABC):
|
|
114
114
|
for i in range(len(coef)) if coef[i] != 0])
|
115
115
|
formulas.append(f"Class {self.classes_[c]}: {formula if formula else '0'}")
|
116
116
|
return formulas
|
117
|
-
elif type.lower() == '
|
117
|
+
elif type.lower() == 'sympy':
|
118
118
|
if 'coefficients' in self.symbolic_model:
|
119
119
|
formula = sympify_formula(self.symbolic_model['basis_functions'], self.symbolic_model['coefficients'], self.symbolic_model['n_features'])
|
120
120
|
return formula
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: oikan
|
3
|
-
Version: 0.0.3.
|
3
|
+
Version: 0.0.3.5
|
4
4
|
Summary: OIKAN: Neuro-Symbolic ML for Scientific Discovery
|
5
5
|
Author: Arman Zhalgasbayev
|
6
6
|
License: MIT
|
@@ -34,6 +34,7 @@ OIKAN is a neuro-symbolic machine learning framework inspired by Kolmogorov-Arno
|
|
34
34
|
[](https://opensource.org/licenses/MIT)
|
35
35
|
[](https://github.com/silvermete0r/oikan/issues)
|
36
36
|
[](https://silvermete0r.github.io/oikan/)
|
37
|
+
[](https://deepwiki.com/silvermete0r/oikan)
|
37
38
|
|
38
39
|
> **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.
|
39
40
|
|
@@ -62,14 +63,15 @@ OIKAN implements a modern interpretation of the Kolmogorov-Arnold Representation
|
|
62
63
|
- Automatic pruning of insignificant terms
|
63
64
|
|
64
65
|
```python
|
65
|
-
|
66
|
-
|
66
|
+
class OIKAN:
|
67
|
+
def __init__(self, hidden_sizes=[64, 64], activation='relu',
|
67
68
|
polynomial_degree=2, alpha=0.1):
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
# Neural network for learning complex patterns
|
70
|
+
self.neural_net = TabularNet(input_size, hidden_sizes, activation)
|
71
|
+
# Data augmentation for better coverage
|
72
|
+
self.augmented_data = self.augment_data(X, y, augmentation_factor=5)
|
73
|
+
# Symbolic regression for interpretable formulas
|
74
|
+
self.symbolic_regression = SymbolicRegression(alpha=alpha)
|
73
75
|
```
|
74
76
|
|
75
77
|
3. **Basis Functions**: Core set of interpretable transformations:
|
@@ -140,7 +142,7 @@ mse = mean_squared_error(y_test, y_pred)
|
|
140
142
|
print("Mean Squared Error:", mse)
|
141
143
|
|
142
144
|
# Get symbolic formula
|
143
|
-
formula = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: '
|
145
|
+
formula = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: 'sympy' -> simplified formula using sympy; 'latex' -> LaTeX format
|
144
146
|
print("Symbolic Formula:", formula)
|
145
147
|
|
146
148
|
# Get feature importances
|
@@ -189,7 +191,7 @@ accuracy = model.score(X_test, y_test)
|
|
189
191
|
print("Accuracy:", accuracy)
|
190
192
|
|
191
193
|
# Get symbolic formulas for each class
|
192
|
-
formulas = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: '
|
194
|
+
formulas = model.get_formula() # default: type='original' -> returns all formula without pruning | other options: 'sympy' -> simplified formula using sympy; 'latex' -> LaTeX format
|
193
195
|
for i, formula in enumerate(formulas):
|
194
196
|
print(f"Class {i} Formula:", formula)
|
195
197
|
|
@@ -209,7 +211,7 @@ loaded_model.load("outputs/model.json")
|
|
209
211
|
|
210
212
|
### Architecture Diagram
|
211
213
|
|
212
|
-
-architecture-oop.png)
|
213
215
|
|
214
216
|
## OIKAN Symbolic Model Compilers
|
215
217
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|