Skip to content
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
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from setuptools import setup, find_packages
import os

NAME = 'ml_utils'
NAME = 'ml_tooling'
DESCRIPTION = 'A library for machine learning utilities'
URL = 'https://lspgitlab01.alm.brand.dk/abanbn/ab_models'
URL = 'https://github.com/andersbogsnes/ml_utils'
EMAIL = 'abanbn@almbrand.dk'
AUTHOR = 'Anders Bogsnes'
REQUIRES_PYTHON = '>=3.6.0'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression, LogisticRegression
from ml_utils import BaseClassModel
from ml_tooling import BaseClassModel
from sklearn.datasets import load_iris


Expand Down
10 changes: 5 additions & 5 deletions tests/test_baseclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LinearRegression, LogisticRegression

from ml_utils import BaseClassModel
from ml_utils.baseclass.result import Result
from ml_utils.baseclass.utils import MLUtilsError
from ml_tooling import BaseClassModel
from ml_tooling.baseclass.result import Result
from ml_tooling.baseclass.utils import MLUtilsError


def test_can_change_config():
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_regression_model_can_be_saved(classifier, tmpdir, base, monkeypatch):
def mockreturn():
return '1234'

monkeypatch.setattr('ml_utils.baseclass.baseclass.get_git_hash', mockreturn)
monkeypatch.setattr('ml_tooling.baseclass.baseclass.get_git_hash', mockreturn)
path = tmpdir.mkdir('model')
classifier.score_model()
classifier.save_model(path)
Expand All @@ -124,7 +124,7 @@ def test_save_model_saves_correctly(classifier, tmpdir, monkeypatch):
def mockreturn():
return '1234'

monkeypatch.setattr('ml_utils.baseclass.baseclass.get_git_hash', mockreturn)
monkeypatch.setattr('ml_tooling.baseclass.baseclass.get_git_hash', mockreturn)
save_dir = tmpdir.mkdir('model')
classifier.save_model(save_dir)
expected_name = 'IrisModel_LogisticRegression_1234.pkl'
Expand Down
2 changes: 1 addition & 1 deletion tests/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Test file for helpers.py
"""
import matplotlib.pyplot as plt
from ml_utils.visualizations.helpers import generate_text_labels
from ml_tooling.visualizations.helpers import generate_text_labels


def test_add_text_labels_vertical_returns_correct():
Expand Down
4 changes: 2 additions & 2 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import pytest
from ml_utils.metrics import lift_score, confusion_matrix, sorted_feature_importance
from ml_utils.metrics.metrics import MetricError
from ml_tooling.metrics import lift_score, confusion_matrix, sorted_feature_importance
from ml_tooling.metrics.metrics import MetricError


# noinspection PyTypeChecker
Expand Down
20 changes: 10 additions & 10 deletions tests/test_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import numpy as np
from sklearn.pipeline import make_pipeline

from ml_utils.transformers import (Select,
FillNA,
ToCategorical,
FuncTransformer,
Binner,
Renamer,
DateEncoder,
FreqFeature, DFFeatureUnion)

from ml_utils.transformers.pandas_transformers import TransformerError
from ml_tooling.transformers import (Select,
FillNA,
ToCategorical,
FuncTransformer,
Binner,
Renamer,
DateEncoder,
FreqFeature, DFFeatureUnion)

from ml_tooling.transformers.pandas_transformers import TransformerError

np.random.seed(42)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ml_utils.baseclass.utils import get_git_hash, find_model_file
from ml_tooling.baseclass.utils import get_git_hash, find_model_file


def test_get_git_hash_returns_correctly():
Expand All @@ -11,7 +11,7 @@ def test_find_model_file_with_given_model_returns_correctly(tmpdir, monkeypatch)
def mockreturn():
return '1234'

monkeypatch.setattr('ml_utils.baseclass.utils.get_git_hash', mockreturn)
monkeypatch.setattr('ml_tooling.baseclass.utils.get_git_hash', mockreturn)

model_folder = tmpdir.mkdir('model')
model1 = 'TestModel1_1234.pkl'
Expand All @@ -31,7 +31,7 @@ def test_find_model_file_if_multiple_with_same_hash(tmpdir, monkeypatch):
def mockreturn():
return '1234'

monkeypatch.setattr('ml_utils.baseclass.utils.get_git_hash', mockreturn)
monkeypatch.setattr('ml_tooling.baseclass.utils.get_git_hash', mockreturn)

model_folder = tmpdir.mkdir('model')
model1 = 'TestModel1_1234.pkl'
Expand Down
12 changes: 6 additions & 6 deletions tests/test_visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_curve

from ml_utils.visualizations import plot_lift_curve
from ml_utils.visualizations.visualizations import (RegressionVisualize,
ClassificationVisualize,
plot_confusion_matrix)
from ml_utils.visualizations.helpers import (VizError,
get_feature_importance)
from ml_tooling.visualizations import plot_lift_curve
from ml_tooling.visualizations.visualizations import (RegressionVisualize,
ClassificationVisualize,
plot_confusion_matrix)
from ml_tooling.visualizations.helpers import (VizError,
get_feature_importance)
from sklearn.svm import SVC

np.random.seed(42)
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ omit = */__init__.py
branch = True

[coverage:paths]
source = ml_utils
source = ml_tooling

[pytest]
addopts = -p no:warnings -v --cov ml_utils --cov-report html --cov-report term
addopts = -p no:warnings -v --cov ml_tooling --cov-report html --cov-report term