aek-auto-mlbuilder 0.5.0__tar.gz → 0.6.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.
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/PKG-INFO +1 -1
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/__init__.py +2 -1
- aek_auto_mlbuilder-0.6.1/aek_auto_mlbuilder/svm.py +47 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder.egg-info/PKG-INFO +1 -1
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder.egg-info/SOURCES.txt +1 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/setup.py +3 -3
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/LICENSE +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/README.md +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/base.py +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/decision_tree.py +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/knn.py +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/linear_regression.py +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/logistic_regression.py +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/random_forest.py +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/utils.py +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder.egg-info/dependency_links.txt +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder.egg-info/requires.txt +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder.egg-info/top_level.txt +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/pyproject.toml +0 -0
- {aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/setup.cfg +0 -0
@@ -4,4 +4,5 @@ from .linear_regression import LinearRegressor
|
|
4
4
|
from .logistic_regression import LogisticClassifier
|
5
5
|
from .decision_tree import DecisionTreeModel
|
6
6
|
from .knn import KNNModel
|
7
|
-
from .random_forest import RandomForestModel
|
7
|
+
from .random_forest import RandomForestModel
|
8
|
+
from .svm import SVMModel
|
@@ -0,0 +1,47 @@
|
|
1
|
+
from sklearn.svm import SVC, SVR
|
2
|
+
from sklearn.preprocessing import StandardScaler
|
3
|
+
from sklearn.pipeline import make_pipeline
|
4
|
+
from .base import BaseModel
|
5
|
+
|
6
|
+
|
7
|
+
class SVMModel(BaseModel):
|
8
|
+
"""
|
9
|
+
support vector machine for classification and regression
|
10
|
+
use task parameter for "regression" or "classification"
|
11
|
+
brute force is using
|
12
|
+
"""
|
13
|
+
def __init__(self, task="classification", param_grid=None):
|
14
|
+
super().__init__()
|
15
|
+
self.task = task
|
16
|
+
self.param_grid = param_grid or {
|
17
|
+
"C": [0.1, 1, 10],
|
18
|
+
"kernel": ["linear", "rbf"],
|
19
|
+
"gamma": ["scale", "auto"]
|
20
|
+
}
|
21
|
+
|
22
|
+
def train(self, X, y):
|
23
|
+
best_score = -float("inf")
|
24
|
+
best_model = None
|
25
|
+
|
26
|
+
if self.task.lower() == "classification":
|
27
|
+
ModelClass = SVC
|
28
|
+
elif self.task.lower() == "regression":
|
29
|
+
ModelClass = SVR
|
30
|
+
else:
|
31
|
+
raise ValueError("task must be either classification or regression")
|
32
|
+
|
33
|
+
for C in self.param_grid["C"]:
|
34
|
+
for kernel in self.param_grid["kernel"]:
|
35
|
+
for gamma in self.param_grid["gamma"]:
|
36
|
+
model = make_pipeline(
|
37
|
+
StandardScaler(),
|
38
|
+
ModelClass(C=C, kernel=kernel, gamma=gamma)
|
39
|
+
)
|
40
|
+
model.fit(X, y)
|
41
|
+
score = model.score(X, y)
|
42
|
+
if score > best_score:
|
43
|
+
best_score = score
|
44
|
+
best_model = model
|
45
|
+
self.best_model = best_model
|
46
|
+
self.best_score = best_score
|
47
|
+
return self.best_model
|
{aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder.egg-info/SOURCES.txt
RENAMED
@@ -9,6 +9,7 @@ aek_auto_mlbuilder/knn.py
|
|
9
9
|
aek_auto_mlbuilder/linear_regression.py
|
10
10
|
aek_auto_mlbuilder/logistic_regression.py
|
11
11
|
aek_auto_mlbuilder/random_forest.py
|
12
|
+
aek_auto_mlbuilder/svm.py
|
12
13
|
aek_auto_mlbuilder/utils.py
|
13
14
|
aek_auto_mlbuilder.egg-info/PKG-INFO
|
14
15
|
aek_auto_mlbuilder.egg-info/SOURCES.txt
|
@@ -1,8 +1,8 @@
|
|
1
1
|
from setuptools import setup, find_packages
|
2
2
|
|
3
3
|
setup(
|
4
|
-
name="aek-auto-mlbuilder",
|
5
|
-
version="0.
|
4
|
+
name="aek-auto-mlbuilder",
|
5
|
+
version="0.6.1",
|
6
6
|
description="Automatic ML model builder in Python",
|
7
7
|
long_description=open("README.md", encoding="utf-8").read(),
|
8
8
|
long_description_content_type="text/markdown",
|
@@ -16,5 +16,5 @@ setup(
|
|
16
16
|
"scikit-learn>=1.0",
|
17
17
|
"numpy>=1.23",
|
18
18
|
"pandas>=1.5"
|
19
|
-
],
|
19
|
+
],
|
20
20
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/linear_regression.py
RENAMED
File without changes
|
{aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder/logistic_regression.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder.egg-info/requires.txt
RENAMED
File without changes
|
{aek_auto_mlbuilder-0.5.0 → aek_auto_mlbuilder-0.6.1}/aek_auto_mlbuilder.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|