Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.
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
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ python:
- "2.7"
- "3.4"
- "3.5"
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
install:
# We do this conditionally because it saves us some downloading if the
# version is the same.
Expand Down
25 changes: 6 additions & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,32 @@ environment:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.8"
PYTHON_ARCH: "32"
MINICONDA: "C:\\Miniconda"

- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.8"
PYTHON_ARCH: "64"
MINICONDA: "C:\\Miniconda-x64"

- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5.0"
- PYTHON: "C:\\Python37"
PYTHON_VERSION: "3.7.0"
PYTHON_ARCH: "32"
MINICONDA: "C:\\Miniconda35"

- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.0"
- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.0"
PYTHON_ARCH: "64"
MINICONDA: "C:\\Miniconda35-x64"



install:
# Miniconda is pre-installed in the worker build
- "SET PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "python -m pip install -U pip"

# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- "pip --version"

# Remove cygwin because it clashes with conda
# see http://help.appveyor.com/discussions/problems/3712-git-remote-https-seems-to-be-broken
- rmdir C:\\cygwin /s /q

# Update previous packages and install the build and runtime dependencies of the project.
- conda update --all --yes
- conda install --quiet --yes numpy scipy cython nose scikit-learn wheel"
# there seems to be a problem with conda-build 1.21.0 on python27 and win64, avoid this
# by using a previous version
- conda install --quiet --yes conda-build=1.21.0
- "%CMD_IN_ENV% pip install --timeout=60 numpy scipy cython nose scikit-learn wheel"
- "%CMD_IN_ENV% python setup.py bdist_wheel bdist_wininst"

- ps: "ls dist"
Expand Down
1 change: 1 addition & 0 deletions lightning/impl/adagrad_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# cython: cdivision=True
# cython: boundscheck=False
# cython: wraparound=False
# cython: language_level=3
#
# Author: Mathieu Blondel
# License: BSD
Expand Down
1 change: 1 addition & 0 deletions lightning/impl/dataset_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# cython: cdivision=True
# cython: boundscheck=False
# cython: wraparound=False
# cython: language_level=3
#
# Author: Mathieu Blondel
# License: BSD
Expand Down
15 changes: 8 additions & 7 deletions lightning/impl/dual_cd_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# cython: cdivision=True
# cython: boundscheck=False
# cython: wraparound=False
# cython: language_level=3
#
# Author: Mathieu Blondel
# License: BSD
Expand Down Expand Up @@ -223,7 +224,7 @@ def _dual_cd(self,

# Verbose output.
if verbose >= 1:
print "iter", t + 1, M - m, "(%d)" % active_size
print("iter", t + 1, M - m, "(%d)" % active_size)

if stop:
break
Expand All @@ -232,7 +233,7 @@ def _dual_cd(self,
if M - m <= tol:
if active_size == n_samples:
if verbose >= 1:
print "\nConverged at iteration", t
print("\nConverged at iteration", t)
break
else:
# When shrinking is enabled, we need to do one more outer
Expand Down Expand Up @@ -320,7 +321,7 @@ def _dual_cd_auc(self,
# Learning
for t in xrange(max_iter):
if verbose >= 1:
print "\nIteration", t
print("\nIteration", t)

for tt in xrange(n_samples):
r = rs.randint(n_pos - 1)
Expand Down Expand Up @@ -455,7 +456,7 @@ def _dual_cd_svr(self,
# Learning...
for t in xrange(max_iter):
if verbose >= 1:
print "\nIteration", t
print("\nIteration", t)

if permute:
rs.shuffle(A)
Expand Down Expand Up @@ -532,17 +533,17 @@ def _dual_cd_svr(self,
violation_init = violation_sum

if verbose >= 1:
print t, violation_sum / violation_init
print(t, violation_sum / violation_init)

if violation_sum / violation_init < tol:
if verbose >= 1:
print "Converged"
print("Converged")
break

# end for t

if verbose >= 1:
print
print()

for i in xrange(n_samples):
ii = i * 2
Expand Down
1 change: 1 addition & 0 deletions lightning/impl/loss_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# cython: cdivision=True
# cython: boundscheck=False
# cython: wraparound=False
# cython: language_level=3
#
# Author: Mathieu Blondel
# License: BSD
Expand Down
1 change: 1 addition & 0 deletions lightning/impl/prank_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# cython: cdivision=True
# cython: boundscheck=False
# cython: wraparound=False
# cython: language_level=3
#
# Author: Mathieu Blondel
# License: BSD
Expand Down
21 changes: 11 additions & 10 deletions lightning/impl/primal_cd_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# cython: cdivision=True
# cython: boundscheck=False
# cython: wraparound=False
# cython: language_level=3
#
# Author: Mathieu Blondel
# License: BSD
Expand Down Expand Up @@ -86,7 +87,7 @@ cdef class LossFunction:
if step >= self.max_steps:
if self.max_steps > 1:
if self.verbose >= 2:
print "Max steps reached during line search..."
print("Max steps reached during line search...")
recompute = 1
break

Expand Down Expand Up @@ -223,7 +224,7 @@ cdef class LossFunction:
Lp_n < -violation_old / n_samples:
# Shrink!
if self.verbose >= 3:
print "Shrink variable", j
print("Shrink variable", j)
return 1
elif w[j] > 0:
violation[0] = fabs(Lp_p)
Expand Down Expand Up @@ -262,7 +263,7 @@ cdef class LossFunction:
if step >= self.max_steps:
if self.max_steps > 1:
if self.verbose >= 2:
print "Max steps reached during line search..."
print("Max steps reached during line search...")
recompute = 1
break

Expand Down Expand Up @@ -379,7 +380,7 @@ cdef class LossFunction:
g_norm + violation_old / nv <= 0:
# Shrink!
if self.verbose >= 2:
print "Shrink variable", j
print("Shrink variable", j)
return 1
else:
violation[0] = fabs(g_norm - alpha)
Expand Down Expand Up @@ -434,7 +435,7 @@ cdef class LossFunction:
if step >= self.max_steps:
if self.max_steps > 1:
if self.verbose >= 2:
print "Max steps reached during line search..."
print("Max steps reached during line search...")
recompute = 1
break

Expand Down Expand Up @@ -1365,11 +1366,11 @@ def _primal_cd(self,
# Verbose output.
if verbose >= 1:
if check_violation_sum:
print "iter", t + 1, violation_sum / violation_init, \
"(%d)" % active_size
print("iter", t + 1, violation_sum / violation_init,
"(%d)" % active_size)
elif check_violation_max:
print "iter", t + 1, violation_max / violation_init, \
"(%d)" % active_size
print("iter", t + 1, violation_max / violation_init,
"(%d)" % active_size)

# Check convergence.
if (check_violation_sum and
Expand All @@ -1378,7 +1379,7 @@ def _primal_cd(self,
violation_max <= tol * violation_init):
if active_size == active_size_start:
if verbose >= 1:
print "\nConverged at iteration", t
print("\nConverged at iteration", t)
break
else:
# When shrinking is enabled, we need to do one more outer
Expand Down
1 change: 1 addition & 0 deletions lightning/impl/prox_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# cython: cdivision=True
# cython: boundscheck=False
# cython: wraparound=False
# cython: language_level=3
#
# Authors: Fabian Pedregosa
#
Expand Down
Loading