Skip to content

Commit 5acf786

Browse files
committed
Added setup.py for easier installation
1 parent 823569d commit 5acf786

File tree

5 files changed

+61
-17
lines changed

5 files changed

+61
-17
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
*.pyc
2+
build/
3+
dist/
4+
mla.egg-info/

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Machine learning algorithms
1+
# Machine learning algorithms
22
A collection of minimal and clean implementations of machine learning algorithms.
33

44
### Why?
5-
This project is targeting people who wants to learn internals of ml algorithms or implement them from scratch.
6-
The code is much easier to follow than the optimized libraries and easier to play with.
5+
This project is targeting people who wants to learn internals of ml algorithms or implement them from scratch.
6+
The code is much easier to follow than the optimized libraries and easier to play with.
77
All algorithms are implemented in Python, using numpy, scipy and autograd.
88

9-
### Implemented:
9+
### Implemented:
1010
* [Deep learning (MLP, CNN, RNN, LSTM)] (mla/neuralnet)
1111
* [Linear regression, logistic regression] (mla/linear_models.py)
1212
* [Random Forests] (mla/ensemble/random_forest.py)
@@ -21,18 +21,19 @@ All algorithms are implemented in Python, using numpy, scipy and autograd.
2121
* t-SNE
2222
* MCMC
2323
* Word2vec
24-
* Naive bayes
24+
* Naive bayes
2525
* K-nearest neighbors
2626
* Adaboost
2727
* HMM
2828

2929
### Installation
3030
git clone https://github.com/rushter/MLAlgorithms
31-
cd MLAlgorithms; pip install -r requirements.txt
31+
cd MLAlgorithms
32+
pip install scipy numpy
33+
pip install .
3234

3335
### How to run examples without relative imports
34-
cd MLAlgorithms
35-
python -m examples.linear_models
36-
36+
python examples/linear_models.py
37+
3738
### Contributing
3839
Your contributions are always welcome!

requirements.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
tqdm
2-
matplotlib==1.5.1
3-
numpy==1.11.1
4-
pandas==0.19.0
5-
scikit-learn==0.18
6-
scipy==0.18.0
7-
seaborn==0.7.1
8-
six==1.10.0
9-
autograd
2+
matplotlib>=1.5.1
3+
numpy>=1.11.1
4+
pandas>=0.19.0
5+
scikit-learn>=0.18
6+
scipy>=0.18.0
7+
seaborn>=0.7.1
8+
six>=1.10.0
9+
autograd>=1.1.7

setup.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[bdist_wheel]
2+
universal=1
3+
4+
[metadata]
5+
description-file=README.md

setup.py

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from setuptools import setup, find_packages
2+
from codecs import open
3+
from os import path
4+
5+
__version__ = '0.0.1'
6+
7+
here = path.abspath(path.dirname(__file__))
8+
9+
# Get the long description from the README file
10+
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
11+
long_description = f.read()
12+
13+
# get the dependencies and installs
14+
with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
15+
all_reqs = f.read().split('\n')
16+
17+
install_requires = [x.strip() for x in all_reqs if 'git+' not in x]
18+
dependency_links = [x.strip().replace('git+', '') for x in all_reqs if x.startswith('git+')]
19+
20+
setup(
21+
name='mla',
22+
version=__version__,
23+
description='A collection of minimal and clean implementations of machine learning algorithms.',
24+
long_description=long_description,
25+
url='https://github.com/rushter/mla',
26+
download_url='https://github.com/rushter/mla/tarball/' + __version__,
27+
license='MIT',
28+
packages=find_packages(exclude=['docs', 'tests*']),
29+
include_package_data=True,
30+
author='Artem Golubin',
31+
install_requires=install_requires,
32+
setup_requires=['numpy>=1.10', 'scipy>=0.17'],
33+
dependency_links=dependency_links,
34+
author_email='[email protected]'
35+
)

0 commit comments

Comments
 (0)