diff --git a/plot_toy_example.py b/plot_toy_example.py index 3e66719..5cd0f09 100644 --- a/plot_toy_example.py +++ b/plot_toy_example.py @@ -13,7 +13,7 @@ import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import Lasso -from pyowl import OwlRegressor +from pyowl.pyowl import OwlRegressor n_samples = 10 n_features = 100 diff --git a/pyowl/__init__.py b/pyowl/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fista.py b/pyowl/fista.py similarity index 100% rename from fista.py rename to pyowl/fista.py diff --git a/loss.py b/pyowl/loss.py similarity index 100% rename from loss.py rename to pyowl/loss.py diff --git a/pyowl.py b/pyowl/pyowl.py similarity index 99% rename from pyowl.py rename to pyowl/pyowl.py index c7d423f..50492ce 100644 --- a/pyowl.py +++ b/pyowl/pyowl.py @@ -11,8 +11,8 @@ from sklearn.isotonic import isotonic_regression from sklearn.preprocessing import LabelBinarizer -from fista import fista -from loss import get_loss +from pyowl.fista import fista +from pyowl.loss import get_loss def prox_owl(v, w): diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..887b771 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +matplotlib==2.2.3 +numpy==1.15.1 +scikit-learn==0.19.2 +scipy==1.1.0 \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..64c1120 --- /dev/null +++ b/setup.py @@ -0,0 +1,14 @@ +from setuptools import find_packages +from setuptools import setup + +setup(name='pyowl', + version='0.1', + description='pyowl: Ordered Weighted L1 Regularization in Python', + long_description=open('README.md').read(), + url='https://github.com/vene/pyowl', + packages=find_packages(), + install_requires=[ + "numpy==1.15.1", + "scikit-learn==0.19.2", + "scipy==1.1.0" + ]) diff --git a/test_pyowl.py b/tests/test_pyowl.py similarity index 97% rename from test_pyowl.py rename to tests/test_pyowl.py index 3dec713..6b75456 100644 --- a/test_pyowl.py +++ b/tests/test_pyowl.py @@ -3,7 +3,7 @@ import numpy as np from numpy.testing import assert_array_almost_equal -from pyowl import prox_owl +from pyowl.pyowl import prox_owl rng = np.random.RandomState(0)