Re: [Scikit-learn-general] Dynamic Time Warping

2015-01-21 Thread Mark Regan
Hi Diego. Not sure if it'll be useful but I coded up a DTW classifier with the same sklearn style fit/predict methods here . Mark On Tue Jan 20 2015 at 4:26:40 AM Andy wrote: > Hi Diego.

Re: [Scikit-learn-general] K Nearest Neighbour with 3d array and custom distance metric

2014-01-10 Thread Mark Regan
/SnippyHolloW/DTW_Cython http://www.mblondel.org/journal/2009/08/31/dynamic-time-warping-theory/ https://github.com/mdeklerk/DTW/blob/master/_dtw.pyx On 10 January 2014 13:05, Mark Regan wrote: Am I correct to assume the only algorithm that will work with a custom distance metric is "brute"

Re: [Scikit-learn-general] K Nearest Neighbour with 3d array and custom distance metric

2014-01-10 Thread Mark Regan
Am I correct to assume the only algorithm that will work with a custom distance metric is "brute"? DWT with 1NN is performing pretty slow with just 10,000 observations. New to Python, perhaps I could write the distance metric function more efficiently? # Define function to compute dynamic time wa

Re: [Scikit-learn-general] K Nearest Neighbour with 3d array and custom distance metric

2014-01-10 Thread Mark Regan
Thanks Joel! Great suggestion. This is now working for my use case. On Fri Jan 10 2014 at 5:46:17 AM, Lars Buitinck wrote: > 2014/1/10 Robert Layton : > > I wonder if that check could be removed -- as long as the input is > > fancy-indexable, the code should otherwise not have an issue (until it

[Scikit-learn-general] K Nearest Neighbour with 3d array and custom distance metric

2014-01-09 Thread Mark Regan
Hi all, tldr: Is there a way for me to pass a 3D array to KNearestNeighbour? I have constructed a custom distance metric to be used with KNN. It takes *two 2D arrays* and returns a float. I believe this fits the requirements for a distance metric in sklearn. However, I am unable to pass a 3D arr

Re: [Scikit-learn-general] Custom Scorer

2014-01-06 Thread Mark Regan
nt to make to the > scoring. > > A theoretical other possibility would be to make your X be tuples of churn > and inputs, have the scorer function take them apart, and use a classifier > that discards the churn. > > I don't have any better idea, sorry. > > Cheers,

[Scikit-learn-general] Custom Scorer

2014-01-06 Thread Mark Regan
Hi all, I'm interested in using several of the standard classification metrics (precision_recal_curve, roc_curve, classification_report) but weighted based on another variable associated with the prediction. In concrete terms, I'm predicting churn and I want each of the above classification metri