473,581 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2123
On Sep 12, 10:32 am, Lakesider <i...@rudolfbal l.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...@gm ail.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...@gm ail.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**@rudolfbal l.comwrote in message
news:11******** **************@ 50g2000hsm.goog legroups.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
2142
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 the context of business components.. The components that will run on this machine in some circumstances could be very far reaching and require much...
24
2335
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 message "down" If the numbers are equal, print the message "equal" If there is an error reading the data, print a message containing the word "Error"...
8
21902
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 that time, I get a SocketException with the message "Only one usage of each socket address (protocol/network address/port) is normally permitted". This...
0
8144
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8301
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6551
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5361
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3803
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3820
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1400
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.