New answers tagged

2

As number of clusters increase the inertia is expected to decrease but is not guaranteed because k-means algorithm needs random initialisation and there are probably local minima. So, the local optimum for 20-25-30 clusters might give you larger inertia. The typical thing to do is doing k-means several times with random seed and pick the best one.


0

There is no unique true clustering in a dataset. Different clusterings can be legitimate for different aims on the same dataset. The choice of method implicitly defines the kinds of clusters you will find. So the first question to ask is, what does a cluster mean in the application of interest. For example if you want clusters to be compact with all ...


0

If you know the number of clusters already, k-means seems more fit than hierarchical clustering, because it tries to give the best possible solution, while HC uses a greedy algorithm, it doesn't matter much if it is deterministic. However, k-means and HC are really comparable only if you use Ward method for HC, which is really just a hierarchical version of ...


0

I was digging about this question, and I found the following: I think KNN cannot be penalized. During testing, knn is supposed to find the closest example in the training set and return the corresponding label; it finds the k-nearest neighbors and returns the majority vote of their labels. There are many approaches to selecting the best model: We can choose ...


0

There are a few simple approaches you might try. They all exploit different kinds of patterns in your data, and they all have at least one parameter you'll need to tweak. Fixed-duration windows around a peak. As you've said, this doesn't work very well. Set a y-axis threshold. A peak starts when the value goes above this threshold, and ends when it goes ...


2

While it is tempting to think, that such pair relations are somehow autocorrelated, and this causes inference problems, the straightforward answer would be, that this is not a problem here. Rationale behind it is close to typical clustering problem. Clustering do not disrupt significance of variables that vary at unit level, it makes too significant ...


1

I'd start with visualisation. Assuming that your dataset is not super large, there are a few options. You can do a pairs plot. With 13 features this can probably just about be done if you have a big screen. Alternatives are principal components or a discriminant coordinate plot (the latter shows the projection of the data according to which the classes are ...


3

My understanding of the Gram matrix, is that it comes from a product $X^{T}X$ where $X$ is a $k\times n$ matrix of coordinates (assuming your points lie in k dimensions). In your case $n$ would be 4 since the distance matrix is $4\times 4$ (pairwise distances between four points). In order to find a/the Gram matrix, you first need to find the location of ...


0

Thanks to @Lewian and @cdalitz. This way is the same as the one proposed by @cdalitz. Let $\vec{w}_i=[w_1\textrm{ }w_2\textrm{ ... }w_k]$ s.t. $$w_l=\begin{cases}1&\textrm{if }a_i\in{A_l}\\0&\textrm{if }a_i\notin{A_l}\end{cases}$$ I can calculate the distance, denoted by $\textrm{dist}(a_i, a_j)$ to be $$\textrm{dist}(a_i, a_j)=||\vec{w}_i-\vec{w}_j|...


0

My first idea was what cdalitz wrote who can now make this an answer again. After the reply of Yanqi Huang, an alternative would be the Jaccard similarity: Divide the number sets in which both $a_i$ and $a_j$ appear by the number of sets in which any one of $a_i$ and $a_j$ appears. This is between 0 and 1, so one minus this is a distance (it actually ...


1

Instead of jumping right into separate linear models for each of your pre-defined groups based on body-weight responses to air temperature, step back and do exploratory data analysis. Look at and play with all the data, see how much the multiple predictors themselves might account for the differences among species, without pre-grouping. You might find that ...


3

Note that in a proper definition of $k$-means the distance $\Delta$ has to be the Euclidean distance, despite the fact that in some literature these days it is defined using any distance. The reason is that only for the Euclidean distance (or equivalent distances) the means are actually the optimum centroids. You can try to solve the optimisation problem ...


0

I think this just means that K is the target number of clusters where the procedure stops.


0

Care to post a generator for those data? "Know your data" is an important part of any modeling process, in which case guessing a simple "sqrt(x)" from visual inspection seems like a starting place for a relatively simple dataset like this. But to the question: It sounds like you'd like to perhaps find a set of parameters alpha, beta, and ...


0

Let's say an object is a singleton at high level in complete linkage, and say that there are otherwise bigger clusters. This means only that the maximum distances between the object and the other clusters are large; the singleton object can still be close to quite a number of objects of the clusters, and is therefore not necessarily an outlier. A high level ...


0

SPSS Statistics TWOSTEP CLUSTER will not directly output a log-likelihood, only AIC or BIC when doing automatic selection of the number of clusters, so you'd have to dig into the formulas in the algorithms in order to manually calculate it.


3

In many real datasets (obviously I don't know about yours), clusters are not well separated, and even if they are, $k$-means clusters will not necessarily correspond to well separated subsets of the data, at least not if the well separated subsets have a covariance structure different from spherical, or varying withing-cluster variation, or if the number of ...


Top 50 recent answers are included