oikan 0.0.3.4__py3-none-any.whl → 0.0.3.5__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/model.py CHANGED
@@ -93,11 +93,11 @@ class OIKAN(ABC):
93
93
 
94
94
  Parameter:
95
95
  --------
96
- type : str, optional (default='original') other options: 'sympied', 'latex'
97
- 'original' returns the original formula with coefficients, 'sympied' returns sympy simplified formula.
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', 'sympied', 'latex']:
100
- raise InvalidParameterError("Invalid type. Choose 'original', 'sympied', 'latex'.")
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() == 'sympied':
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.4
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
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
35
35
  [![GitHub issues](https://img.shields.io/github/issues/silvermete0r/OIKAN.svg)](https://github.com/silvermete0r/oikan/issues)
36
36
  [![Docs](https://img.shields.io/badge/docs-passing-brightgreen)](https://silvermete0r.github.io/oikan/)
37
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](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
- class OIKANRegressor:
66
- def __init__(self, hidden_sizes=[64, 64], activation='relu',
66
+ class OIKAN:
67
+ def __init__(self, hidden_sizes=[64, 64], activation='relu',
67
68
  polynomial_degree=2, alpha=0.1):
68
- # Neural network for learning complex patterns
69
- self.neural_net = TabularNet(input_size, hidden_sizes, activation)
70
- # Symbolic regression for interpretable formulas
71
- self.symbolic_model = None
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: 'sympied' -> simplified formula using sympy; 'latex' -> LaTeX format
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: 'sympied' -> simplified formula using sympy; 'latex' -> LaTeX format
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
- ![OIKAN v0.0.3(1) Architecture](https://raw.githubusercontent.com/silvermete0r/oikan/main/docs/media/oikan-v0.0.3(1)-architecture-oop.png)
214
+ ![OIKAN v0.0.3(2) Architecture](https://raw.githubusercontent.com/silvermete0r/oikan/main/docs/media/oikan-v0.0.3(2)-architecture-oop.png)
213
215
 
214
216
  ## OIKAN Symbolic Model Compilers
215
217
 
@@ -0,0 +1,10 @@
1
+ oikan/__init__.py,sha256=zEzhm1GYLT4vNaIQ4CgZcNpUk3uo8SWnoaHYtHW_XSQ,628
2
+ oikan/exceptions.py,sha256=GhHWqy2Q5LVBcteTy4ngnqxr7FOoLNyD8dNt1kfRXyw,901
3
+ oikan/model.py,sha256=Ke5FdHOr1YwnUCJieXN2VjTXhxAGxHWzCfNgw0_WYbA,23157
4
+ oikan/neural.py,sha256=wxmGgzmtpwJ3lvH6u6D4i4BiAzg018czrIdw49phSCY,1558
5
+ oikan/utils.py,sha256=7UCm9obO-8Q2zhetdAkukMDOZvGSBWUL_dSF04XqM7k,8808
6
+ oikan-0.0.3.5.dist-info/licenses/LICENSE,sha256=75ASVmU-XIpN-M4LbVmJ_ibgbzbvRLVti8FhnR0BTf8,1096
7
+ oikan-0.0.3.5.dist-info/METADATA,sha256=sUzI5w2hfUd70B4s1K5vULOvQpQbkvb239NTfS2gAPU,11388
8
+ oikan-0.0.3.5.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
9
+ oikan-0.0.3.5.dist-info/top_level.txt,sha256=XwnwKwTJddZwIvtrUsAz-l-58BJRj6HjAGWrfYi_3QY,6
10
+ oikan-0.0.3.5.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- oikan/__init__.py,sha256=zEzhm1GYLT4vNaIQ4CgZcNpUk3uo8SWnoaHYtHW_XSQ,628
2
- oikan/exceptions.py,sha256=GhHWqy2Q5LVBcteTy4ngnqxr7FOoLNyD8dNt1kfRXyw,901
3
- oikan/model.py,sha256=-EqCxTMeejdOCh2T08ibc87YIDYWUvybFe7jfb1XYbA,23167
4
- oikan/neural.py,sha256=wxmGgzmtpwJ3lvH6u6D4i4BiAzg018czrIdw49phSCY,1558
5
- oikan/utils.py,sha256=7UCm9obO-8Q2zhetdAkukMDOZvGSBWUL_dSF04XqM7k,8808
6
- oikan-0.0.3.4.dist-info/licenses/LICENSE,sha256=75ASVmU-XIpN-M4LbVmJ_ibgbzbvRLVti8FhnR0BTf8,1096
7
- oikan-0.0.3.4.dist-info/METADATA,sha256=P-2T0xtWDyTNhfZYknMK0TPm9EcvCUBD-O2bdfCwpFc,11138
8
- oikan-0.0.3.4.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
9
- oikan-0.0.3.4.dist-info/top_level.txt,sha256=XwnwKwTJddZwIvtrUsAz-l-58BJRj6HjAGWrfYi_3QY,6
10
- oikan-0.0.3.4.dist-info/RECORD,,