manis-ai-creator 1.0.0__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.
- manis_ai_creator-1.0.0/CHANGELOG.md +17 -0
- manis_ai_creator-1.0.0/LICENSE +17 -0
- manis_ai_creator-1.0.0/MANIFEST.in +6 -0
- manis_ai_creator-1.0.0/PKG-INFO +498 -0
- manis_ai_creator-1.0.0/README.md +436 -0
- manis_ai_creator-1.0.0/examples/architecture_factories.py +13 -0
- manis_ai_creator-1.0.0/examples/autoencoder.py +9 -0
- manis_ai_creator-1.0.0/examples/classify_points.py +16 -0
- manis_ai_creator-1.0.0/examples/learn_relationship.py +27 -0
- manis_ai_creator-1.0.0/examples/relationship_learning.py +21 -0
- manis_ai_creator-1.0.0/examples/version4_features.py +47 -0
- manis_ai_creator-1.0.0/manis_ai_creator/__init__.py +22 -0
- manis_ai_creator-1.0.0/manis_ai_creator/architectures.py +171 -0
- manis_ai_creator-1.0.0/manis_ai_creator/automl.py +66 -0
- manis_ai_creator-1.0.0/manis_ai_creator/core.py +226 -0
- manis_ai_creator-1.0.0/manis_ai_creator/ensemble.py +83 -0
- manis_ai_creator-1.0.0/manis_ai_creator/metrics.py +46 -0
- manis_ai_creator-1.0.0/manis_ai_creator/model.py +491 -0
- manis_ai_creator-1.0.0/manis_ai_creator/multi_input.py +92 -0
- manis_ai_creator-1.0.0/manis_ai_creator/neural.py +263 -0
- manis_ai_creator-1.0.0/manis_ai_creator/neural_torch.py +388 -0
- manis_ai_creator-1.0.0/manis_ai_creator/preprocessing.py +156 -0
- manis_ai_creator-1.0.0/manis_ai_creator/tf_engine.py +73 -0
- manis_ai_creator-1.0.0/manis_ai_creator/torch_classic.py +140 -0
- manis_ai_creator-1.0.0/manis_ai_creator/torch_detection.py +100 -0
- manis_ai_creator-1.0.0/manis_ai_creator/torch_media.py +168 -0
- manis_ai_creator-1.0.0/manis_ai_creator/unsupervised.py +96 -0
- manis_ai_creator-1.0.0/manis_ai_creator/version.py +1 -0
- manis_ai_creator-1.0.0/manis_ai_creator.egg-info/PKG-INFO +498 -0
- manis_ai_creator-1.0.0/manis_ai_creator.egg-info/SOURCES.txt +37 -0
- manis_ai_creator-1.0.0/manis_ai_creator.egg-info/dependency_links.txt +1 -0
- manis_ai_creator-1.0.0/manis_ai_creator.egg-info/requires.txt +54 -0
- manis_ai_creator-1.0.0/manis_ai_creator.egg-info/top_level.txt +1 -0
- manis_ai_creator-1.0.0/pyproject.toml +35 -0
- manis_ai_creator-1.0.0/setup.cfg +4 -0
- manis_ai_creator-1.0.0/setup.py +4 -0
- manis_ai_creator-1.0.0/tests/test_public_api.py +0 -0
- manis_ai_creator-1.0.0/tests/test_v4_features.py +105 -0
- manis_ai_creator-1.0.0/tests/test_v5_model_api.py +45 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Mani's AI Creator — Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
- Added a unified `model()` / `Model` estimator API.
|
|
6
|
+
- Added `model="auto"` candidate comparison and validation-based model selection.
|
|
7
|
+
- Added scikit-learn classification and regression candidates.
|
|
8
|
+
- Added CSV and array-based tabular training workflows.
|
|
9
|
+
- Added lightweight image-folder classification baselines.
|
|
10
|
+
- Added support for class-folder datasets, explicit train/test folders, and per-class train/test/validation layouts.
|
|
11
|
+
- Added `predict`, `predict_proba`, `evaluate`, `save`, and `load_model` for the unified estimator API.
|
|
12
|
+
- Preserved the v4 public API, including `deep()` and existing neural-network classes.
|
|
13
|
+
- Task selection remains explicit: `classification` or `regression`; there is no `task="auto"` mode.
|
|
14
|
+
|
|
15
|
+
## 4.0.0
|
|
16
|
+
|
|
17
|
+
- Added multi-input learning, neural ensembles, explicit neural search, additional architectures, preprocessing tools, and metrics.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mani Tehrani
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: manis-ai-creator
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A modular AI and machine-learning library with automatic model selection and PyTorch and TensorFlow neural APIs
|
|
5
|
+
Author: Mani Tehrani
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: numpy>=1.24
|
|
17
|
+
Provides-Extra: neural
|
|
18
|
+
Requires-Dist: torch>=2.1; extra == "neural"
|
|
19
|
+
Provides-Extra: pytorch
|
|
20
|
+
Requires-Dist: torch>=2.1; extra == "pytorch"
|
|
21
|
+
Requires-Dist: torchvision>=0.16; extra == "pytorch"
|
|
22
|
+
Requires-Dist: pandas>=2.0; extra == "pytorch"
|
|
23
|
+
Requires-Dist: scikit-learn>=1.3; extra == "pytorch"
|
|
24
|
+
Requires-Dist: Pillow>=10; extra == "pytorch"
|
|
25
|
+
Provides-Extra: tensorflow
|
|
26
|
+
Requires-Dist: tensorflow>=2.15; extra == "tensorflow"
|
|
27
|
+
Requires-Dist: pandas>=2.0; extra == "tensorflow"
|
|
28
|
+
Requires-Dist: scikit-learn>=1.3; extra == "tensorflow"
|
|
29
|
+
Requires-Dist: Pillow>=10; extra == "tensorflow"
|
|
30
|
+
Provides-Extra: tabular
|
|
31
|
+
Requires-Dist: pandas>=2.0; extra == "tabular"
|
|
32
|
+
Requires-Dist: scikit-learn>=1.3; extra == "tabular"
|
|
33
|
+
Requires-Dist: Pillow>=10; extra == "tabular"
|
|
34
|
+
Requires-Dist: joblib>=1.3; extra == "tabular"
|
|
35
|
+
Provides-Extra: text
|
|
36
|
+
Requires-Dist: torch>=2.1; extra == "text"
|
|
37
|
+
Requires-Dist: pandas>=2.0; extra == "text"
|
|
38
|
+
Requires-Dist: scikit-learn>=1.3; extra == "text"
|
|
39
|
+
Provides-Extra: audio
|
|
40
|
+
Requires-Dist: torch>=2.1; extra == "audio"
|
|
41
|
+
Requires-Dist: librosa>=0.10; extra == "audio"
|
|
42
|
+
Requires-Dist: scikit-learn>=1.3; extra == "audio"
|
|
43
|
+
Provides-Extra: video
|
|
44
|
+
Requires-Dist: torch>=2.1; extra == "video"
|
|
45
|
+
Requires-Dist: opencv-python>=4.8; extra == "video"
|
|
46
|
+
Requires-Dist: scikit-learn>=1.3; extra == "video"
|
|
47
|
+
Provides-Extra: detection
|
|
48
|
+
Requires-Dist: torch>=2.1; extra == "detection"
|
|
49
|
+
Requires-Dist: torchvision>=0.16; extra == "detection"
|
|
50
|
+
Requires-Dist: Pillow>=10; extra == "detection"
|
|
51
|
+
Provides-Extra: all
|
|
52
|
+
Requires-Dist: torch>=2.1; extra == "all"
|
|
53
|
+
Requires-Dist: torchvision>=0.16; extra == "all"
|
|
54
|
+
Requires-Dist: tensorflow>=2.15; extra == "all"
|
|
55
|
+
Requires-Dist: pandas>=2.0; extra == "all"
|
|
56
|
+
Requires-Dist: scikit-learn>=1.3; extra == "all"
|
|
57
|
+
Requires-Dist: librosa>=0.10; extra == "all"
|
|
58
|
+
Requires-Dist: opencv-python>=4.8; extra == "all"
|
|
59
|
+
Requires-Dist: Pillow>=10; extra == "all"
|
|
60
|
+
Requires-Dist: joblib>=1.3; extra == "all"
|
|
61
|
+
Dynamic: license-file
|
|
62
|
+
|
|
63
|
+
# Mani's AI Creator 1.0.0
|
|
64
|
+
|
|
65
|
+
**Mani's AI Creator** is a modular machine-learning and deep-learning Python library. Release 1.0.0 introduces a unified `model()` interface with automatic estimator selection through `model="auto"`. It also preserves the earlier `deep()` entry point, the `NeuralNetwork` API, and the v4 capabilities, including multi-input learning, neural ensembles, neural architecture factories, preprocessing utilities, evaluation metrics, residual MLPs and GRU architectures.
|
|
66
|
+
|
|
67
|
+
The installable PyPI distribution is named `manis-ai-creator`. The official Python import namespace is `manis_ai_creator`.
|
|
68
|
+
|
|
69
|
+
The framework supports both PyTorch and TensorFlow for the configurable dense neural network and architecture factories. Optional dependencies are loaded only when their feature is used.
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
Install the core package:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pip install manis-ai-creator
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Install the PyTorch neural engine:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pip install "manis-ai-creator[neural]"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Install TensorFlow neural support:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pip install "manis-ai-creator[tensorflow]"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Install the legacy media/data pipelines:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pip install "manis-ai-creator[pytorch]"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Install all optional dependencies:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pip install "manis-ai-creator[all]"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 1. NeuralNetwork: regression and classification
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
import numpy as np
|
|
107
|
+
from manis_ai_creator import NeuralNetwork
|
|
108
|
+
|
|
109
|
+
rng = np.random.default_rng(7)
|
|
110
|
+
X = rng.uniform(-5, 5, size=(1200, 2)).astype("float32")
|
|
111
|
+
y = (2 * X[:, 0] + 3 * X[:, 1]).astype("float32")
|
|
112
|
+
|
|
113
|
+
model = NeuralNetwork(
|
|
114
|
+
task="regression",
|
|
115
|
+
backend="pytorch", # or "tensorflow"
|
|
116
|
+
hidden_layers=(256, 128, 64),
|
|
117
|
+
activation="gelu",
|
|
118
|
+
optimizer="adamw",
|
|
119
|
+
learning_rate=0.001,
|
|
120
|
+
dropout=0.05,
|
|
121
|
+
)
|
|
122
|
+
model.fit(X, y, epochs=150, batch_size=32, patience=20)
|
|
123
|
+
print(model.predict([[2, 3]]))
|
|
124
|
+
print(model.evaluate(X, y))
|
|
125
|
+
model.save("models/relationship_model.pt")
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The network learns from examples. The equation is not hard-coded into the model. Predictions outside the training distribution may be inaccurate.
|
|
129
|
+
|
|
130
|
+
For classification, use `task="classification"` and integer or string labels. `predict_proba()` returns class probabilities.
|
|
131
|
+
|
|
132
|
+
## 2. Multi-input neural networks
|
|
133
|
+
|
|
134
|
+
Use `MultiInputNetwork` when each example has multiple named feature groups. It concatenates numeric feature groups and trains a shared neural network.
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import numpy as np
|
|
138
|
+
from manis_ai_creator import MultiInputNetwork
|
|
139
|
+
|
|
140
|
+
rng = np.random.default_rng(5)
|
|
141
|
+
inputs = {
|
|
142
|
+
"measurements": rng.normal(size=(500, 3)).astype("float32"),
|
|
143
|
+
"profile": rng.normal(size=(500, 2)).astype("float32"),
|
|
144
|
+
}
|
|
145
|
+
targets = (inputs["measurements"][:, 0] +
|
|
146
|
+
2 * inputs["profile"][:, 1])
|
|
147
|
+
|
|
148
|
+
model = MultiInputNetwork(
|
|
149
|
+
task="regression",
|
|
150
|
+
backend="pytorch",
|
|
151
|
+
hidden_layers=(128, 64),
|
|
152
|
+
)
|
|
153
|
+
model.fit(inputs, targets, epochs=100, batch_size=32)
|
|
154
|
+
print(model.predict({
|
|
155
|
+
"measurements": [[0.2, 0.4, 0.1]],
|
|
156
|
+
"profile": [[0.3, 0.8]],
|
|
157
|
+
}))
|
|
158
|
+
model.save("models/multi_input")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
This is numeric feature fusion. It is not yet a cross-attention image/audio/video multimodal model.
|
|
162
|
+
|
|
163
|
+
## 3. Neural ensembles
|
|
164
|
+
|
|
165
|
+
An ensemble trains multiple independently initialized neural networks and combines their predictions.
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
from manis_ai_creator import EnsembleNetwork
|
|
169
|
+
|
|
170
|
+
ensemble = EnsembleNetwork(
|
|
171
|
+
n_estimators=5,
|
|
172
|
+
task="regression",
|
|
173
|
+
backend="pytorch",
|
|
174
|
+
hidden_layers=(128, 64),
|
|
175
|
+
)
|
|
176
|
+
ensemble.fit(X, y, epochs=100, batch_size=32)
|
|
177
|
+
print(ensemble.predict([[2, 3]]))
|
|
178
|
+
ensemble.save("models/ensemble")
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Regression predictions are averaged. Classification probabilities are averaged before selecting the predicted class.
|
|
182
|
+
|
|
183
|
+
## 4. NeuralSearch: compare MLP configurations
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
from manis_ai_creator import NeuralSearch
|
|
187
|
+
|
|
188
|
+
search = NeuralSearch(
|
|
189
|
+
task="regression",
|
|
190
|
+
backend="pytorch",
|
|
191
|
+
configurations=[
|
|
192
|
+
{"hidden_layers": (64, 32), "activation": "relu"},
|
|
193
|
+
{"hidden_layers": (128, 64), "activation": "gelu"},
|
|
194
|
+
{"hidden_layers": (128, 64, 32), "activation": "silu"},
|
|
195
|
+
],
|
|
196
|
+
)
|
|
197
|
+
search.fit(X, y, epochs=100, batch_size=32, patience=15)
|
|
198
|
+
print(search.results_)
|
|
199
|
+
print(search.predict([[2, 3]]))
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The search compares the supplied configurations using each model's minimum validation loss. It does not automatically discover arbitrary architectures.
|
|
203
|
+
|
|
204
|
+
## 5. Preprocessing and data splitting
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
from manis_ai_creator import train_test_split, StandardScaler, LabelEncoder
|
|
208
|
+
|
|
209
|
+
X_train, X_test, y_train, y_test = train_test_split(
|
|
210
|
+
X, y, test_size=0.2, random_state=42
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
scaler = StandardScaler()
|
|
214
|
+
X_train = scaler.fit_transform(X_train)
|
|
215
|
+
X_test = scaler.transform(X_test)
|
|
216
|
+
|
|
217
|
+
encoder = LabelEncoder()
|
|
218
|
+
encoded_labels = encoder.fit_transform(["cat", "dog", "cat"])
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Also available: `MinMaxScaler`.
|
|
222
|
+
|
|
223
|
+
Fit preprocessing only on training data, then apply the fitted transform to validation/test data to avoid data leakage.
|
|
224
|
+
|
|
225
|
+
## 6. Evaluation metrics
|
|
226
|
+
|
|
227
|
+
```python
|
|
228
|
+
from manis_ai_creator import regression_metrics, classification_metrics
|
|
229
|
+
|
|
230
|
+
print(regression_metrics(y_test, predictions))
|
|
231
|
+
print(classification_metrics(actual_labels, predicted_labels))
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Regression metrics: MSE, RMSE, MAE and R².
|
|
235
|
+
|
|
236
|
+
Classification metrics: accuracy, macro precision, macro recall, macro F1 and confusion matrix.
|
|
237
|
+
|
|
238
|
+
## 7. Architecture factories
|
|
239
|
+
|
|
240
|
+
These functions return native trainable TensorFlow/Keras or PyTorch models. You provide the task-specific training loop and loss function.
|
|
241
|
+
|
|
242
|
+
```python
|
|
243
|
+
from manis_ai_creator import (
|
|
244
|
+
build_cnn, build_lstm, build_gru, build_transformer,
|
|
245
|
+
build_residual_mlp
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
cnn = build_cnn(
|
|
249
|
+
input_shape=(128, 128, 3),
|
|
250
|
+
num_classes=5,
|
|
251
|
+
backend="tensorflow",
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
lstm = build_lstm(
|
|
255
|
+
input_features=12,
|
|
256
|
+
hidden_size=64,
|
|
257
|
+
backend="pytorch",
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
gru = build_gru(
|
|
261
|
+
input_features=12,
|
|
262
|
+
hidden_size=64,
|
|
263
|
+
backend="pytorch",
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
transformer = build_transformer(
|
|
267
|
+
input_features=12,
|
|
268
|
+
d_model=128,
|
|
269
|
+
backend="tensorflow",
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
residual_mlp = build_residual_mlp(
|
|
273
|
+
input_dim=20,
|
|
274
|
+
output_dim=3,
|
|
275
|
+
hidden_dim=128,
|
|
276
|
+
backend="pytorch",
|
|
277
|
+
)
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Sequence inputs for LSTM, GRU and Transformer models have shape `(batch, time_steps, features)`. PyTorch CNN inputs use channel-first `(channels, height, width)`; TensorFlow CNN inputs use `(height, width, channels)`.
|
|
281
|
+
|
|
282
|
+
## 8. Unsupervised learning
|
|
283
|
+
|
|
284
|
+
```python
|
|
285
|
+
from manis_ai_creator import AutoEncoder, Clusterer
|
|
286
|
+
|
|
287
|
+
autoencoder = AutoEncoder(hidden_dim=32, latent_dim=8, backend="pytorch")
|
|
288
|
+
autoencoder.fit(X_train, epochs=100)
|
|
289
|
+
latent = autoencoder.encode(X_test)
|
|
290
|
+
reconstruction_errors = autoencoder.reconstruction_error(X_test)
|
|
291
|
+
|
|
292
|
+
clusters = Clusterer(n_clusters=4)
|
|
293
|
+
cluster_labels = clusters.fit_predict(X_train)
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
`Clusterer` uses scikit-learn K-means; it is a classical machine-learning utility.
|
|
297
|
+
|
|
298
|
+
## 9. Original 1.x/2.x/3.x training API
|
|
299
|
+
|
|
300
|
+
The original `deep()` API remains available:
|
|
301
|
+
|
|
302
|
+
```python
|
|
303
|
+
from manis_ai_creator import deep
|
|
304
|
+
|
|
305
|
+
result = deep(
|
|
306
|
+
dataset="dataset/",
|
|
307
|
+
data_type="image",
|
|
308
|
+
framework="pytorch",
|
|
309
|
+
task="classification",
|
|
310
|
+
epochs=20,
|
|
311
|
+
batch_size=16,
|
|
312
|
+
save_path="models/image_run",
|
|
313
|
+
)
|
|
314
|
+
print(result)
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
The existing routes remain as in 3.0:
|
|
318
|
+
|
|
319
|
+
- Image and tabular classification: TensorFlow or PyTorch.
|
|
320
|
+
- Text, audio and video classification: PyTorch.
|
|
321
|
+
- Image object detection: PyTorch with COCO JSON annotations.
|
|
322
|
+
|
|
323
|
+
Unsupported combinations raise an error rather than silently switching frameworks.
|
|
324
|
+
|
|
325
|
+
Version 4 also adds one-call tabular regression and clustering:
|
|
326
|
+
|
|
327
|
+
```python
|
|
328
|
+
from manis_ai_creator import deep
|
|
329
|
+
|
|
330
|
+
regression_result = deep(
|
|
331
|
+
dataset="housing.csv",
|
|
332
|
+
data_type="tabular",
|
|
333
|
+
task="regression",
|
|
334
|
+
target_col="price",
|
|
335
|
+
framework="pytorch",
|
|
336
|
+
epochs=100,
|
|
337
|
+
save_path="models/housing",
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
cluster_result = deep(
|
|
341
|
+
dataset="customers.csv",
|
|
342
|
+
data_type="tabular",
|
|
343
|
+
task="clustering",
|
|
344
|
+
save_path="models/customer_groups",
|
|
345
|
+
)
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Tabular regression expects a numeric target column. Clustering uses K-means after basic one-hot encoding and standardization.
|
|
349
|
+
|
|
350
|
+
## Compatibility and limitations
|
|
351
|
+
|
|
352
|
+
- The 2.x `deep()` entry point and 3.x `NeuralNetwork`, `AutoEncoder`, `Clusterer`, and architecture factory APIs are retained.
|
|
353
|
+
- The dense `NeuralNetwork` is an MLP, not a pretrained generative language model.
|
|
354
|
+
- Architecture factories create model structures; they do not automatically train those models.
|
|
355
|
+
- `MultiInputNetwork` currently fuses numeric feature arrays by concatenation; it is not a full multimodal attention architecture.
|
|
356
|
+
- `NeuralSearch` compares user-specified MLP configurations; it is not unrestricted AutoML.
|
|
357
|
+
- Object detection retains the existing PyTorch/torchvision implementation and its prior evaluation limitations.
|
|
358
|
+
- TensorFlow and PyTorch features require compatible optional dependencies and, for GPU use, a compatible driver/runtime.
|
|
359
|
+
- Model quality depends on dataset size, data quality, leakage-free evaluation, and task design. No architecture is universally best.
|
|
360
|
+
|
|
361
|
+
## License
|
|
362
|
+
|
|
363
|
+
MIT. See `LICENSE`.
|
|
364
|
+
|
|
365
|
+
## Unified `model()` API
|
|
366
|
+
|
|
367
|
+
Release 1.0.0 adds a unified estimator interface and first-class scikit-learn model selection. **The task is always explicit** (`classification` or `regression`). `model="auto"` is the automatic feature: it trains and compares suitable estimators on a validation partition, selects the best validation score, then refits the selected estimator on the full training partition. The held-out test partition is kept separate for `evaluate()`.
|
|
368
|
+
|
|
369
|
+
Install the tabular/model-selection dependencies:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
pip install "manis-ai-creator[tabular]"
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Automatic model selection for CSV data
|
|
376
|
+
|
|
377
|
+
```python
|
|
378
|
+
from manis_ai_creator import model
|
|
379
|
+
|
|
380
|
+
ai = model(
|
|
381
|
+
data="students.csv",
|
|
382
|
+
task="classification", # always explicit
|
|
383
|
+
data_type="tabular",
|
|
384
|
+
target_col="passed",
|
|
385
|
+
model="auto",
|
|
386
|
+
backend="auto",
|
|
387
|
+
test_size=0.2,
|
|
388
|
+
random_state=42,
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
ai.fit()
|
|
392
|
+
print("Selected:", ai.best_model_)
|
|
393
|
+
print("Candidates:", ai.results_)
|
|
394
|
+
print("Test metrics:", ai.evaluate())
|
|
395
|
+
ai.save("saved_students_model")
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
For regression, set `task="regression"` and provide a numeric target column. The candidate set is appropriate to the chosen task; classification candidates include Random Forest, Extra Trees, Logistic Regression, SVC, KNN and others, while regression candidates include Random Forest, Extra Trees, Gradient Boosting, Ridge, Lasso, SVR and others.
|
|
399
|
+
|
|
400
|
+
### Image folders — automatic split
|
|
401
|
+
|
|
402
|
+
```python
|
|
403
|
+
from manis_ai_creator import model
|
|
404
|
+
|
|
405
|
+
ai = model(
|
|
406
|
+
data={"cat": "dataset/cats", "dog": "dataset/dogs"},
|
|
407
|
+
task="classification",
|
|
408
|
+
data_type="image",
|
|
409
|
+
model="auto",
|
|
410
|
+
test_size=0.2,
|
|
411
|
+
)
|
|
412
|
+
ai.fit()
|
|
413
|
+
print(ai.best_model_)
|
|
414
|
+
print(ai.evaluate())
|
|
415
|
+
print(ai.predict(["new_images/cat1.jpg", "new_images/dog1.jpg"]))
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
The library creates a reproducible in-memory split; it does not move or rewrite your source images. The built-in classical image workflow resizes RGB images to 24×24 by default and compares scikit-learn classifiers. This is a lightweight baseline, not a CNN or a pretrained vision model.
|
|
419
|
+
|
|
420
|
+
### Explicit train/test folders
|
|
421
|
+
|
|
422
|
+
```python
|
|
423
|
+
ai = model(
|
|
424
|
+
data={
|
|
425
|
+
"train": {
|
|
426
|
+
"cat": "dataset/train/cat",
|
|
427
|
+
"dog": "dataset/train/dog",
|
|
428
|
+
},
|
|
429
|
+
"test": {
|
|
430
|
+
"cat": "dataset/test/cat",
|
|
431
|
+
"dog": "dataset/test/dog",
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
task="classification",
|
|
435
|
+
data_type="image",
|
|
436
|
+
model="auto",
|
|
437
|
+
)
|
|
438
|
+
ai.fit()
|
|
439
|
+
print(ai.evaluate())
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Already split inside each class
|
|
443
|
+
|
|
444
|
+
```python
|
|
445
|
+
ai = model(
|
|
446
|
+
data={
|
|
447
|
+
"cat": {"train": "dataset/cat/train", "test": "dataset/cat/test"},
|
|
448
|
+
"dog": {"train": "dataset/dog/train", "test": "dataset/dog/test"},
|
|
449
|
+
},
|
|
450
|
+
task="classification",
|
|
451
|
+
data_type="image",
|
|
452
|
+
model="auto",
|
|
453
|
+
)
|
|
454
|
+
ai.fit()
|
|
455
|
+
print(ai.evaluate())
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
The equivalent on-disk layout `dataset/cat/train`, `dataset/cat/test`, `dataset/dog/train`, `dataset/dog/test` is also recognized. When explicit train/test data is supplied, those assignments are respected; the test set is not used for candidate selection or fitting.
|
|
459
|
+
|
|
460
|
+
### Choose one estimator manually
|
|
461
|
+
|
|
462
|
+
```python
|
|
463
|
+
ai = model(
|
|
464
|
+
data="students.csv",
|
|
465
|
+
task="classification",
|
|
466
|
+
data_type="tabular",
|
|
467
|
+
target_col="passed",
|
|
468
|
+
model="random_forest", # or extra_trees, logistic_regression, svc, knn, ...
|
|
469
|
+
)
|
|
470
|
+
ai.fit()
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### NumPy/Pandas-style arrays
|
|
474
|
+
|
|
475
|
+
```python
|
|
476
|
+
ai = model(
|
|
477
|
+
data={"X": X, "y": y},
|
|
478
|
+
task="regression",
|
|
479
|
+
data_type="tabular",
|
|
480
|
+
model="auto",
|
|
481
|
+
)
|
|
482
|
+
ai.fit()
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
### Prediction and persistence
|
|
486
|
+
|
|
487
|
+
```python
|
|
488
|
+
predictions = ai.predict(X_new)
|
|
489
|
+
# Classification only:
|
|
490
|
+
probabilities = ai.predict_proba(X_new)
|
|
491
|
+
|
|
492
|
+
model_path = ai.save("models/my_model")
|
|
493
|
+
from manis_ai_creator import load_model
|
|
494
|
+
restored = load_model(model_path)
|
|
495
|
+
print(restored.predict(X_new))
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
`model="auto"` currently selects among scikit-learn estimators. It does not silently switch to a TensorFlow/PyTorch neural network. For neural models, continue using `NeuralNetwork`, architecture factories, or the backward-compatible `deep()` API. Release 1.0.0 preserves the v4 exports and `deep()` behavior.
|