aek-auto-mlbuilder 0.8.1__tar.gz → 0.9.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.
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/PKG-INFO +1 -1
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/__init__.py +2 -1
- aek_auto_mlbuilder-0.9.0/aek_auto_mlbuilder/dbscan.py +31 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/kmeans.py +4 -4
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/knn.py +1 -1
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/naive_bayes.py +1 -1
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/random_forest.py +1 -1
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/svm.py +1 -1
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder.egg-info/PKG-INFO +1 -1
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder.egg-info/SOURCES.txt +1 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/setup.py +1 -1
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/LICENSE +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/README.md +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/base.py +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/decision_tree.py +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/linear_regression.py +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/logistic_regression.py +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/utils.py +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder.egg-info/dependency_links.txt +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder.egg-info/requires.txt +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder.egg-info/top_level.txt +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/pyproject.toml +0 -0
- {aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/setup.cfg +0 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
from sklearn.cluster import DBSCAN
|
2
|
+
from .base import BaseModel
|
3
|
+
|
4
|
+
class DBSCANModel(BaseModel):
|
5
|
+
"""
|
6
|
+
DBSCAN clustering model (unsupervised learning)
|
7
|
+
brute force searching is being used
|
8
|
+
"""
|
9
|
+
def __init__(self, param_grid=None):
|
10
|
+
super().__init__()
|
11
|
+
self.param_grid = param_grid or {
|
12
|
+
"eps": [0.3, 0.5, 0.7, 1.0],
|
13
|
+
"min_samples": [3, 5, 10]
|
14
|
+
}
|
15
|
+
|
16
|
+
def train(self, X):
|
17
|
+
best_score = -float("inf")
|
18
|
+
best_model = None
|
19
|
+
|
20
|
+
for eps in self.param_grid["eps"]:
|
21
|
+
for min_samples in self.param_grid["min_samples"]:
|
22
|
+
model = DBSCAN(eps=eps, min_samples=min_samples)
|
23
|
+
labels = model.fit_predict(X)
|
24
|
+
|
25
|
+
score = len(labels) - (labels == -1).sum()
|
26
|
+
if score > best_score:
|
27
|
+
best_score = score
|
28
|
+
best_model = model
|
29
|
+
self.best_model = best_model
|
30
|
+
self.best_score = best_score
|
31
|
+
return self.best_model
|
@@ -5,7 +5,7 @@ from .base import BaseModel
|
|
5
5
|
class KMeansModel(BaseModel):
|
6
6
|
"""
|
7
7
|
K-Means clustering model (unsupervised learning)
|
8
|
-
Brute force method
|
8
|
+
Brute force method is being used
|
9
9
|
"""
|
10
10
|
def __init__(self, param_grid=None):
|
11
11
|
super().__init__()
|
@@ -17,7 +17,7 @@ class KMeansModel(BaseModel):
|
|
17
17
|
}
|
18
18
|
|
19
19
|
def train(self, X):
|
20
|
-
best_score =
|
20
|
+
best_score = float("inf")
|
21
21
|
best_model = None
|
22
22
|
|
23
23
|
for n_clusters in self.param_grid["n_clusters"]:
|
@@ -32,8 +32,8 @@ class KMeansModel(BaseModel):
|
|
32
32
|
random_state=42
|
33
33
|
)
|
34
34
|
model.fit(X)
|
35
|
-
score =
|
36
|
-
if score
|
35
|
+
score = model.inertia_
|
36
|
+
if score < best_score:
|
37
37
|
best_score = score
|
38
38
|
best_model = model
|
39
39
|
self.best_model = best_model
|
@@ -8,7 +8,7 @@ class KNNModel(BaseModel):
|
|
8
8
|
"""
|
9
9
|
KNN model for classification for classification or regression
|
10
10
|
Use "task" for "classification" or "regression"
|
11
|
-
Brute-force search
|
11
|
+
Brute-force search is being used
|
12
12
|
"""
|
13
13
|
def __init__(self, task="classification", param_grid=None):
|
14
14
|
super().__init__()
|
@@ -6,7 +6,7 @@ class NaiveBayesModel(BaseModel):
|
|
6
6
|
"""
|
7
7
|
Naive bayes model supporting gaussianNB, multinomialNB, bernoulliNB
|
8
8
|
use 'nb_type' param to specify the variant: gaussian, multinomial, bernoulli
|
9
|
-
brute force hyperparameter search
|
9
|
+
brute force hyperparameter search is being used
|
10
10
|
"""
|
11
11
|
def __init__(self, nb_type="gaussian", param_grid=None):
|
12
12
|
super().__init__()
|
@@ -5,7 +5,7 @@ class RandomForestModel(BaseModel):
|
|
5
5
|
"""
|
6
6
|
Random Forest model for classification or regression
|
7
7
|
Use task either "classification" or "regression"
|
8
|
-
brute force method
|
8
|
+
brute force method is being used
|
9
9
|
"""
|
10
10
|
def __init__(self, task="classification", param_grid=None):
|
11
11
|
super().__init__()
|
@@ -8,7 +8,7 @@ class SVMModel(BaseModel):
|
|
8
8
|
"""
|
9
9
|
support vector machine for classification and regression
|
10
10
|
use task parameter for "regression" or "classification"
|
11
|
-
brute force
|
11
|
+
brute force is being used
|
12
12
|
"""
|
13
13
|
def __init__(self, task="classification", param_grid=None):
|
14
14
|
super().__init__()
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="aek-auto-mlbuilder",
|
5
|
-
version="0.
|
5
|
+
version="0.9.0",
|
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",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/linear_regression.py
RENAMED
File without changes
|
{aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder/logistic_regression.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder.egg-info/requires.txt
RENAMED
File without changes
|
{aek_auto_mlbuilder-0.8.1 → aek_auto_mlbuilder-0.9.0}/aek_auto_mlbuilder.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|