Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New public API making usage more simple #17

Merged
merged 2 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmnemoi_learn/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
cmnemoi-learn is a personal reimplementation of Machine Learning algorithms
with high quality development practices.
"""

__all__ = ["classification", "regression"]
File renamed without changes.
7 changes: 7 additions & 0 deletions cmnemoi_learn/classification/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
Module implementing machine learning models for regression tasks.
"""

from ._logistic_regression import LogisticRegression

__all__ = ["LogisticRegression"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np

from cmnemoi_learn.abstract_model import AbstractModel
from .._abstract_model import AbstractModel


class AbstractClassifier(AbstractModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Optional, Self
import numpy as np

from cmnemoi_learn.classification.abstract_classifier import AbstractClassifier
from ._abstract_classifier import AbstractClassifier


class LogisticRegression(AbstractClassifier):
Expand Down
7 changes: 7 additions & 0 deletions cmnemoi_learn/regression/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
Module implementing machine learning models for regression tasks.
"""

from ._linear_regression import LinearRegression

__all__ = ["LinearRegression"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np

from cmnemoi_learn.abstract_model import AbstractModel
from .._abstract_model import AbstractModel


class AbstractRegressor(AbstractModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
from numpy.linalg import pinv

from cmnemoi_learn.regression.abstract_regressor import AbstractRegressor
from ._abstract_regressor import AbstractRegressor


class LinearRegression(AbstractRegressor):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cmnemoi-learn"
version = "0.3.0"
version = "0.4.0"
description = "Machine Learning from scratch by Charles-Meldhine Madi Mnemoi"
authors = ["Charles-Meldhine Madi Mnemoi <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion tests/classification/test_logistic_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sklearn.linear_model import LogisticRegression as SklearnLogisticRegression
from sklearn.metrics import accuracy_score

from cmnemoi_learn.classification.logistic_regression import LogisticRegression
from cmnemoi_learn.classification import LogisticRegression

RANDOM_STATE = 42

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/test_linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sklearn.linear_model import LinearRegression as SklearnLinearRegression
from sklearn.metrics import mean_squared_error

from cmnemoi_learn.regression.linear_regression import LinearRegression
from cmnemoi_learn.regression import LinearRegression

np.random.seed(42)

Expand Down