Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
5 votes
2 answers
5k views

Grouping sorted coordinates based on proximity to each other

I created an algotrithm that groups a sorted list of coordinates into buckets based on their proximity (30) to one another. Steps: Create a new key with a list ...
Josh Sharkey's user avatar
1 vote
1 answer
4k views

Clustering using k-medoids

This is the program function code for clustering using k-medoids ...
dodo's user avatar
  • 21
3 votes
1 answer
100 views

Simple natural language classifier

This program estimates the likelihood for a string to belong to a certain natural language by computing the cosine similarity between an input string's and several natural languages' letter frequency, ...
Passa's user avatar
  • 33
1 vote
1 answer
1k views

Finding the distance between the two closest points in a 2-D plane

Here is my code: ...
BuluBestTapu's user avatar
3 votes
0 answers
578 views

Compute distance matrix using DTW acceptable for scipy.cluster.hierarchy

I am new to both data science and python. I have a dataset of the time-dependent samples, which I want to run agglomerative hierarchical clustering on them. I have found that Dynamic Time Warping (DTW)...
user3933607's user avatar
7 votes
1 answer
172 views

Speeding up maximum self-similarity test for heavy tail-exponents

I am trying to reproduce results from a research paper using python. I've checked my method and it works on relatively small sample datasets. However, the code does not run for my actual dataset, ...
user avatar
4 votes
1 answer
3k views

KNN algorithm implemented in Python

This is the first time I tried to write some code in Python. I think it gives proper answers but probably some "vectorization" is needed ...
Newbie's user avatar
  • 710
1 vote
1 answer
4k views

Cosine similarity computation

I have a matrix of ~4.5 million vector [4.5mil, 300] and I want to calculate the distance between a vector of length 300 against all the entries in the matrix. I got some great performance time ...
ajaanbaahu's user avatar
5 votes
1 answer
3k views

OpenCV 3: Using k-Nearest Neighbors to analyse RGB image

I'm new to computer vision and numpy. I wrote a simple script to seperate red, green and blue colors from the original image by using the kNN algorithm. After reading through some numpy tutorials, I'...
dev-random's user avatar
5 votes
1 answer
3k views

K-means clustering implemented in Python 3

Here is the classic K-means clustering algorithm implemented in Python 3. My main concern is time/memory efficiency and if there are version specific idioms that I could use to address issues of the ...
Sorrop's user avatar
  • 307
1 vote
1 answer
83 views

Store and output hard-coded relationships among hosts

The following code has begun to smell, but I have not yet decided with what to replace it, other than, obviously, a database. I made a very unsatisfactory workaround for my attempt to make ...
Nathan Basanese's user avatar