[SciPy-Dev] cKDTree

Ralf Gommers ralf.gommers at gmail.com
Thu Sep 8 04:18:56 EDT 2016


On Wed, Sep 7, 2016 at 6:23 AM, Sylvain Corlay <sylvain.corlay at gmail.com>
wrote:

> I understand (especially about the scikits), although I was surprised by
> some recently added features in scipy, such as differential evolution
>
> DE is more of a  "recipe" which has been studied empirically for which
> there is no theoretical convergence rate. Even though it may "work well"
> for certain problems, it causes some issues such as defining on which basis
> it should even be "improved", and what should be the foundation for a
> change. (Recently a result on convergence in probability (with no error
> rate) on a bounded domain has been published, but no result exists on the
> speed of convergence afaik...)
>

> Evolutionary optimization is definitely cool and may work strikingly well
> for certain problems, but I was surprised that it got elected to inclusion
> in scipy. DE would have been a nice seed for a scikit-evolution.
>
> For those interested in stochastic algorithms for global multivariate
> optimization for which we have proven convergence results and an abundant
> literature, we have at least the two following categories of methods
>
>  - *MCMC* (Markov Chain Monte Carlo) which comprises simulated annealing,
> for which there are nice results of convergence in distribution.
>  - *Robbins-Monro* methods, which comprise stochastic gradient methods,
> for which we have almost-sure convergence and central-limit - type theorems.
>

I think it's fair to summarize the reason for the current status and
inclusion of DE as: theoretical convergence rates and papers are nice, but
code that actually works on a good set of benchmarks is way more important.

Some years ago we had only bad global optimizers. We did have simulated
annealing, but it just didn't work for most problems. No one stepped up to
improve it, so we deprecated and removed it.

DE was benchmarked quite thoroughly (on the benchmark functions from
benchmarks/benchmarks/test_go_benchmark_functions.py) and came out looking
good. It solved problems that the only other good optimizer we had
(basinhopping) did not do well on. So that means there was value in adding
it.

Cheers,
Ralf


> This sort of raises the question of the scope of scipy. Should scipy go
> through the same sort of "big split" as Jupyter or more à la d3js? Is
> amount of specialized knowledge required to understand a methods part of
> what defines the line of division in what should be or not be in scipy?
>
> Sylvain
>
> On Tue, Sep 6, 2016 at 8:08 PM, Jacob Vanderplas <
> jakevdp at cs.washington.edu> wrote:
>
>> As for adding more functionality along those lines, I would advocate
>> creation of a new package or perhaps a scikit. As we've seen with
>> scikit-learn, useful features can filter-up into scipy (e.g.
>> sparse.csgraph) and the development of new features within an independent
>> package is *much* easier than development from within a scipy PR.
>>    Jake
>>
>>  Jake VanderPlas
>>  Senior Data Science Fellow
>>  Director of Research in Physical Sciences
>>  University of Washington eScience Institute
>>
>> On Tue, Sep 6, 2016 at 11:03 AM, Sylvain Corlay <sylvain.corlay at gmail.com
>> > wrote:
>>
>>> Would you guys consider in scope for scipy to have implementation of
>>> faster nearest neighbor search methods than KdTree?
>>>
>>> Some methods are fairly simple... e.g principal axis tree which use the
>>> principal direction of the dataset to split the dataset into smaller
>>> subsets.  As soon as intrinsic dimensionality is significantly smaller than
>>> the dimension of the space, it is significantly faster.
>>>
>>> Besides, only having to compute the (an approximate) principal axis is
>>> much faster than doing an actual PCA.
>>>
>>> On Tue, Sep 6, 2016 at 4:14 AM, Jacob Vanderplas <
>>> jakevdp at cs.washington.edu> wrote:
>>>
>>>> From my own casual benchmarks, the new scipy cKDTree is much faster
>>>> than any of the scikit-learn options, though it still only supports
>>>> axis-aligned euclidean-like metrics (where sklearn's BallTree supports
>>>> dozens of additional metrics). The cKDTree also has a limited range of
>>>> query types compared to scikit-learn's trees,
>>>>    Jake
>>>>
>>>>  Jake VanderPlas
>>>>  Senior Data Science Fellow
>>>>  Director of Research in Physical Sciences
>>>>  University of Washington eScience Institute
>>>>
>>>> On Mon, Sep 5, 2016 at 12:46 AM, Daπid <davidmenhur at gmail.com> wrote:
>>>>
>>>>> On 4 September 2016 at 23:00, Robert Lucente <rlucente at pipeline.com>
>>>>> wrote:
>>>>> > Please note that I am a newbie and just a lurker.
>>>>> >
>>>>> > I noticed in a recent email that cKDTree was mentioned.
>>>>> >
>>>>> > Q: What is the relationship if any between SciPy an scikit-learn
>>>>> when it comes to cKDTree?
>>>>> >
>>>>> > The reason that I ask are the following 2 links
>>>>> >
>>>>> > https://jakevdp.github.io/blog/2013/04/29/benchmarking-neare
>>>>> st-neighbor-searches-in-python/
>>>>> >
>>>>> > https://github.com/scikit-learn/scikit-learn/issues/3682
>>>>>
>>>>> Note that these benchmarks are from 2013 and 2014. Scipy's KDTree has
>>>>> seen its performance recently improved, twice. Scikit's last update to
>>>>> its KDTree was in 2015. So, we need to run the benchmarks again.
>>>>>
>>>>> /David.
>>>>> _______________________________________________
>>>>> SciPy-Dev mailing list
>>>>> SciPy-Dev at scipy.org
>>>>> https://mail.scipy.org/mailman/listinfo/scipy-dev
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> SciPy-Dev mailing list
>>>> SciPy-Dev at scipy.org
>>>> https://mail.scipy.org/mailman/listinfo/scipy-dev
>>>>
>>>>
>>>
>>> _______________________________________________
>>> SciPy-Dev mailing list
>>> SciPy-Dev at scipy.org
>>> https://mail.scipy.org/mailman/listinfo/scipy-dev
>>>
>>>
>>
>> _______________________________________________
>> SciPy-Dev mailing list
>> SciPy-Dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/scipy-dev
>>
>>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20160908/597b9be4/attachment.html>


More information about the SciPy-Dev mailing list