473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

A simple question about "clustering" ...


Hi NG,

I have a question about data: I have travel-times from A to B like
this

from | to | sec.
A B 17
A B 18
A B 30
A B 32
A B 32
A B 33
A B 34
A B 35
A B 36
A B 37
A B 50
A B 71
A B 1895

I want to answer the question: "How long did most of the cars take?".
In this case, beetween 30 and 37 seconds, or simply 33 as an average
value. A simple average value is bad because of values like the last
one ...

How would you do this?

Thank you very much,

Rudi

Sep 12 '07 #1
5 2106
On Sep 12, 10:32 am, Lakesider <i...@rudolfball.comwrote:
I have a question about data: I have travel-times from A to B like
this

from | to | sec.
A B 17
A B 18
A B 30
A B 32
A B 32
A B 33
A B 34
A B 35
A B 36
A B 37
A B 50
A B 71
A B 1895

I want to answer the question: "How long did most of the cars take?".
In this case, beetween 30 and 37 seconds, or simply 33 as an average
value. A simple average value is bad because of values like the last
one ...

How would you do this?
A common way is to remove the best 10% and the worst 10% - you can
then give the results either as a range or the average of the rest.
The "10%" can vary however you want, of course. No doubt someone with
a better stats background than me could give you good reasons for
taking particular values.

Jon

Sep 12 '07 #2
JS
Or use the median, which is 34 in your example.

Sep 12 '07 #3
On 12 Sep., 11:46, JS <jnospams...@gmail.comwrote:
Or use the median, which is 34 in your example.
Thank you. Unfortunately the median is not a good way for me, because
there can be a lot of values out of the "cluster point".

Sep 12 '07 #4
Clustering usually is not the solution where you wish to get a single value.
Clustering will return the set of values where observations happen
approximately. In your case I would suspect four clusters are appropriate,
and they appear to be centered at 17.5, 33.5, 60.5, and 1895. The sample
size is very small so the analysis would be suspect...

To find the cluster centers for an arbitrary number of clusters you minimize
the sum of the distances for each observation to it's cluster center. There
are algorithms out there that we have used in the past. I think we used
K-Means clustering for the project we did, and you should be able to find
papers on it on the net. This may be overkill as the method was not treating
clustering of observations with one value, but rather observations with many
values. We clustered weather data where the centroid was a temperature,
windspeed, humidity, cloudcover object.

If you are trying to code to a set where you don't know the number of
clusters you wish to get out, which is much more common, then you would set
up a loop over the number of clusters (maximum) and find each solution for
cluster count = 2..n. The optimal solution has the lowest distance for any
observation to it's mean.

If in your example, you are really searching for a single value
representative in the data, then I believe the suggestion of removing the top
and bottom extremes. The ammount of data to remove really depends on whether
the data is normally distributed (famous bell curve) or some other
distribution method. From the data provided it would be hard to state that
it was normally distributed.

"Lakesider" wrote:
On 12 Sep., 11:46, JS <jnospams...@gmail.comwrote:
Or use the median, which is 34 in your example.

Thank you. Unfortunately the median is not a good way for me, because
there can be a lot of values out of the "cluster point".

Sep 12 '07 #5

"Lakesider" <in**@rudolfball.comwrote in message
news:11**********************@50g2000hsm.googlegro ups.com...
>
Hi NG,

I have a question about data: I have travel-times from A to B like
this

from | to | sec.
A B 17
A B 18
A B 30
A B 32
A B 32
A B 33
A B 34
A B 35
A B 36
A B 37
A B 50
A B 71
A B 1895

I want to answer the question: "How long did most of the cars take?".
In this case, beetween 30 and 37 seconds, or simply 33 as an average
value. A simple average value is bad because of values like the last
one ...
Often one finds the mean (mu) and standard deviation (sigma). Discard any
values outside the interval (mu - 3*sigma, mu + 3*sigma), these are known as
outliers. The remaining values should be more meaningful, any of the
various averages should be pretty good when taken over the filtered set.
Sep 12 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: alien2_51 | last post by:
Greetings, I apologize for the cross post I posted previously to .Net Framework with no replies... I have an application server that potentially will service all enterprise applications from...
24
by: Apotheosis | last post by:
The problem professor gave us is: Write a program which reads two integer values. If the first is less than the second, print the message "up". If the second is less than the first, print the...
8
by: Grant Richard | last post by:
Using the TcpListener and TcpClient I created a program that just sends and receives a short string - over and over again. The program is fine until it gets to around 1500 to 1800 messages. At...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.