aek-auto-mlbuilder 0.0.1__tar.gz → 0.1.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.1.0/LICENSE +6 -0
- {aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/PKG-INFO +1 -1
- aek_auto_mlbuilder-0.1.0/aek_auto_mlbuilder/__init__.py +3 -0
- aek_auto_mlbuilder-0.1.0/aek_auto_mlbuilder/base.py +12 -0
- aek_auto_mlbuilder-0.1.0/aek_auto_mlbuilder/linear_regression.py +39 -0
- aek_auto_mlbuilder-0.1.0/aek_auto_mlbuilder/utils.py +4 -0
- {aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/aek_auto_mlbuilder.egg-info/PKG-INFO +1 -1
- {aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/aek_auto_mlbuilder.egg-info/SOURCES.txt +1 -0
- {aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/setup.py +1 -1
- aek_auto_mlbuilder-0.0.1/LICENSE +0 -0
- aek_auto_mlbuilder-0.0.1/aek_auto_mlbuilder/__init__.py +0 -0
- aek_auto_mlbuilder-0.0.1/aek_auto_mlbuilder/base.py +0 -0
- aek_auto_mlbuilder-0.0.1/aek_auto_mlbuilder/utils.py +0 -0
- {aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/README.md +0 -0
- {aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/aek_auto_mlbuilder.egg-info/dependency_links.txt +0 -0
- {aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/aek_auto_mlbuilder.egg-info/top_level.txt +0 -0
- {aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/pyproject.toml +0 -0
- {aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/setup.cfg +0 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
class BaseModel:
|
2
|
+
def __init__(self):
|
3
|
+
self.best_model = None
|
4
|
+
self.best_score = None
|
5
|
+
|
6
|
+
def train(self, X, y):
|
7
|
+
raise NotImplemented("Train method must be implemented by subclass.")
|
8
|
+
|
9
|
+
def evaluate(self, X, y):
|
10
|
+
if self.best_model is None:
|
11
|
+
raise Exception("Model has not been trained yet!")
|
12
|
+
return self.best_model.score(X, y)
|
@@ -0,0 +1,39 @@
|
|
1
|
+
from sklearn.linear_model import LinearRegression
|
2
|
+
from .base import BaseModel
|
3
|
+
from sklearn.preprocessing import StandardScaler
|
4
|
+
from sklearn.pipeline import make_pipeline
|
5
|
+
|
6
|
+
class LinearRegressor(BaseModel):
|
7
|
+
"""
|
8
|
+
Basic Linear Regression class
|
9
|
+
Try parameters with brute-force.
|
10
|
+
"""
|
11
|
+
|
12
|
+
def __init__(self, param_grid=None):
|
13
|
+
super().__init__()
|
14
|
+
self.param_grid = param_grid or {
|
15
|
+
"fit_intercept": [True, False],
|
16
|
+
"normalize": [True, False]
|
17
|
+
}
|
18
|
+
|
19
|
+
def train(self, X, y):
|
20
|
+
best_score = -float("inf")
|
21
|
+
best_model = None
|
22
|
+
|
23
|
+
for fit_intercept in self.param_grid["fit_intercept"]:
|
24
|
+
for normalize in self.param_grid["normalize"]:
|
25
|
+
|
26
|
+
if normalize:
|
27
|
+
model = make_pipeline(StandardScaler(), LinearRegression(fit_intercept=fit_intercept))
|
28
|
+
else:
|
29
|
+
model = LinearRegression(fit_intercept=fit_intercept)
|
30
|
+
|
31
|
+
model.fit(X, y)
|
32
|
+
score = model.score(X, y)
|
33
|
+
if score > best_score:
|
34
|
+
best_score = score
|
35
|
+
best_model = model
|
36
|
+
|
37
|
+
self.best_model = best_model
|
38
|
+
self.best_score = best_score
|
39
|
+
return self.best_model
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="aek-auto-mlbuilder", # PyPI dağıtım adı
|
5
|
-
version="0.0
|
5
|
+
version="0.1.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",
|
aek_auto_mlbuilder-0.0.1/LICENSE
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{aek_auto_mlbuilder-0.0.1 → aek_auto_mlbuilder-0.1.0}/aek_auto_mlbuilder.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|