-1

I have a set of data (an Echelle diagram) i would like to sort out. Visually it's clear to see a pattern of two close set of points and a set further away. How do I split the three data sets from each other?

I hope you can help me!

Echelle diagram example

John Coleman
  • 51,337
  • 7
  • 54
  • 119
onitek
  • 17
  • 2
  • You would use some method of clustering... – DJK Sep 07 '17 at 15:40
  • Can you expand on that? – onitek Sep 07 '17 at 15:41
  • 2
    See this: https://en.wikipedia.org/wiki/Cluster_analysis . This question is probably too broad for Stack Overflow. Most of the standard clustering algorithms have already been implemented in Python, so once you decide on which algorithm to use, you shouldn't have to code it from scratch. – John Coleman Sep 07 '17 at 15:44
  • 1
    @onitek, that's more of a statistical question, than a programming question. On this site, if you couldn't get a clustering method to work you would post your code, and someone could help you with your code. This question, formatted more specifically belongs [here](https://math.stackexchange.com/) – DJK Sep 07 '17 at 15:48
  • 1
    Cross Validated might also be a good place to post: https://stats.stackexchange.com/ – John Coleman Sep 07 '17 at 15:49
  • 1
    "Visually it's clear ... How do I split the three data sets from each other?" implement an AI that can recreate the human visual system? But seriously, this isn't an easy problem. Others have pointed you to [CrossValidated](http://www.stats.stackexchange.com) and clustering. Here's a [good overview](http://scikit-learn.org/stable/modules/clustering.html) of the techniques available in `scikit-learn` – juanpa.arrivillaga Sep 07 '17 at 15:59
  • does it have to be split up programmatically? assuming it's a small set of data, what if you wrote a little interface- using, say, bokeh- allowing you to graphically sweep over/select the points that belong in each bucket? would that suffice? – Rick Sep 07 '17 at 16:05
  • Yes, however i have no idea how to. This represents pretty much the amounts of points I would be working with – onitek Sep 07 '17 at 16:06
  • time to learn :) i would suggest looking into making a bokeh widget/dashboard that will allow you to do this. there are lots of tutorials out there that would be a good place to start. [this one](https://www.youtube.com/watch?v=fZ0mwqaQ6EE) is pretty good (but low sound quality- [here is another](https://www.youtube.com/watch?v=h0y90MyGo-c)). – Rick Sep 07 '17 at 16:15
  • [This is what you need.](http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/callbacks.html#userguide-interaction-jscallbacks) Study that page closely and you should be able to get something going fairly quickly. – Rick Sep 07 '17 at 16:29
  • Thanks. It seems quite complex. I am not a brilliant programmer as you can read. I'll look into it :D – onitek Sep 07 '17 at 16:35
  • pay particular attention to the "CustomJS for Selections" subsection. it's very close to what you need. the great thing about bokeh (and that goes for python in general too i suppose) is a lot of the really hard stuff has already been done for you. you just stick the pieces together. good luck! – Rick Sep 07 '17 at 16:45

1 Answers1

0

Use k-means clustering on the date converted to decimal seconds, hours or days

How to convert a Python datetime object to seconds

Joe
  • 6,758
  • 2
  • 26
  • 47