Skip to content

Commit

Permalink
Version 0.2.0
Browse files Browse the repository at this point in the history
Critical fix to adapt to new sklearn arguments in `_boost` method.
Updated requirements.
Updated Travis testing.
Improved setup.py
  • Loading branch information
hbldh committed Jan 18, 2018
1 parent 344c7b0 commit 37df93e
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 93 deletions.
9 changes: 1 addition & 8 deletions .travis.yml
@@ -1,21 +1,15 @@
language: python
sudo: false
python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- "3.5-dev"
- 3.6
- "nightly"
- pypy
matrix:
allow_failures:
- python: 2.6
- python: 3.3
- python: 3.4
- python: 3.5
- python: "3.5-dev"
- python: "nightly"
- python: pypy
branches:
Expand All @@ -34,7 +28,6 @@ install:
- "pip install -U pip setuptools wheel"
- "pip install pytest pytest-cov python-coveralls"
- "travis_wait pip install numpy scipy"
- "pip install -r requirements.txt"
- "pip install -e ."
script: py.test tests --cov skboost --cov-report term-missing
after_success:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
Copyright (c) 2018 Henrik Blidh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 5 additions & 6 deletions requirements.txt
@@ -1,6 +1,5 @@
numpy>=1.10.2
scipy>=0.16.1
scikit-learn>=0.17
six>=1.10.0
futures>=3.0.3
psutil>=3.4.2
numpy>=1.14
scipy>=1.0.0
scikit-learn>=0.19.1
six>=1.11.0
psutil>=5.4.3
53 changes: 34 additions & 19 deletions setup.py
Expand Up @@ -17,12 +17,12 @@
from __future__ import print_function
from __future__ import absolute_import

import re
import os
from codecs import open
from setuptools import setup, find_packages, Extension

import numpy
import skboost

basedir = os.path.dirname(os.path.abspath(__file__))

Expand All @@ -31,33 +31,48 @@ def read(f):
return open(f, encoding='utf-8').read()


with open('skboost/version.py', 'r') as fd:
version = re.search(
'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)

setup(
name='skboost',
version=skboost.__version__,
author=skboost.author,
author_email=skboost.author_email,
maintainer=skboost.maintainer,
maintainer_email=skboost.maintainer_email,
url=skboost.url,
download_url=skboost.download_url,
description=skboost.description,
version=version,
author='Henrik Blidh',
author_email='henrik.blidh@nedomkull.com',
url='https://github.com/hbldh/skboost',
description="Boosting Algorithms compatible with scikit-learn",
long_description=read('README.md'),
license=skboost.license,
platforms=skboost.platforms,
keywords=skboost.keywords,
classifiers=skboost.classifiers,
license='MIT',
keywords=['Machine Learning', 'Boosting'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: MIT',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
packages=find_packages(exclude=['tests', 'scripts']),
package_data={
'skboost.stumps.ext': ['src/*', ],
'skboost.datasets.musk': ['clean*.*', ],
},
install_requires=[
'numpy>=1.6.1',
'scipy>=0.9',
'scikit-learn>=0.16.0',
'six>=1.10.0',
'futures>=3.0.3',
'psutil>=3.4.2'
'numpy',
'scipy',
'scikit-learn',
'six',
'psutil',
'futures;python_version<"3.4"',
],
dependency_links=[],
ext_package='skboost.stumps.ext',
Expand Down
56 changes: 0 additions & 56 deletions skboost/__init__.py
@@ -1,57 +1 @@
# -*- coding: utf-8 -*-
"""Release data for the skboost project."""

# -----------------------------------------------------------------------------
# Copyright (c) 2015, Nedomkull Mathematical Modeling AB.
# -----------------------------------------------------------------------------

author = 'Henrik Blidh'
author_email = 'henrik.blidh@nedomkull.com'
maintainer = 'Henrik Blidh'
maintainer_email = 'henrik.blidh@nedomkull.com'
license = 'MIT'
description = "Boosting Algorithms compatible with scikit-learn"
url = 'https://bitbucket.org/nedomkull/milboost'
download_url = 'https://bitbucket.org/nedomkull/milboost'
platforms = ['Linux', 'Mac OSX', 'Windows XP/Vista/7/8']
keywords = ['Machine Learning', 'Boosting']
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: MIT',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],


# Version information. An empty _version_extra corresponds to a full
# release. 'dev' as a _version_extra string means this is a development
# version.
_version_major = 0
_version_minor = 1
_version_patch = 3
# _version_extra = '.dev1'
_version_extra = 'a2'
# _version_extra = '' # Uncomment this for full releases

# Construct full version string from these.
_ver = [_version_major, _version_minor, _version_patch]

__version__ = '.'.join(map(str, _ver))
if _version_extra:
__version__ += _version_extra

version = __version__ # backwards compatibility name
version_info = (_version_major, _version_minor, _version_patch, _version_extra)
5 changes: 4 additions & 1 deletion skboost/gentleboost.py
Expand Up @@ -78,7 +78,7 @@ def fit(self, X, y, sample_weight=None):

return super(GentleBoostClassifier, self).fit(X, y, sample_weight)

def _boost(self, iboost, X, y, sample_weight):
def _boost(self, iboost, X, y, sample_weight, random_state):
"""Implement a single boost.
Perform a single boost according to the real multi-class SAMME.R
Expand All @@ -99,6 +99,9 @@ def _boost(self, iboost, X, y, sample_weight):
sample_weight : array-like of shape = [n_samples]
The current sample weights.
random_state : numpy.RandomState
The current random number generator
Returns
-------
sample_weight : array-like of shape = [n_samples] or None
Expand Down
5 changes: 4 additions & 1 deletion skboost/logitboost.py
Expand Up @@ -87,7 +87,7 @@ def fit(self, X, y, sample_weight=None):

return out

def _boost(self, iboost, X, y, sample_weight):
def _boost(self, iboost, X, y, sample_weight, random_state):
"""Implement a single boost iteration.
Parameters
Expand All @@ -104,6 +104,9 @@ def _boost(self, iboost, X, y, sample_weight):
sample_weight : array-like of shape = [n_samples]
The current sample weights.
random_state : numpy.RandomState
The current random number generator
Returns
-------
sample_weight : array-like of shape = [n_samples] or None
Expand Down
2 changes: 1 addition & 1 deletion skboost/milboost/classifier.py
Expand Up @@ -101,7 +101,7 @@ def fit(self, X, y, sample_weight=None):

return out

def _boost(self, iboost, X, y, sample_weight):
def _boost(self, iboost, X, y, sample_weight, random_state):

if iboost > 0:
dv_pre = self.decision_function(X)
Expand Down
10 changes: 10 additions & 0 deletions skboost/version.py
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
"""
version
Created on 2018-01-18 by hbldh <henrik.blidh@nedomkull.com>
"""

__version__ = '0.2.0'
version = __version__

0 comments on commit 37df93e

Please sign in to comment.