473,769 Members | 5,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

nearest neighbour classificator

oll3i
679 Contributor
When i have DNA test data like the data below just few first rows pasted here
first number is the number of rows and second number is the number of columns 21st column is a decision
1186 21
1 2 3 1 3 3 1 3 3 1 2 0 3 2 1 3 2 1 0 2 3
0 0 2 1 0 0 0 2 1 3 2 1 2 2 1 0 3 1 1 3 2
0 3 1 1 0 2 2 0 1 3 1 3 0 0 2 1 1 3 3 1 2
1 2 3 3 3 1 3 0 3 3 1 2 1 3 3 1 3 0 3 3 3
3 0 1 3 3 2 0 3 3 3 3 1 3 3 1 3 1 0 3 2 3
0 2 0 3 2 1 2 2 1 2 3 0 3 1 3 0 2 2 1 0 1
3 1 3 2 0 2 0 1 0 3 2 1 3 3 3 1 3 3 0 1 3
0 0 2 0 2 2 3 2 1 3 0 0 3 2 0 3 2 0 3 1 2
3 1 3 3 1 3 1 2 2 0 1 0 3 1 3 3 0 1 3 3 3
1 1 1 0 2 0 2 1 1 3 3 0 1 1 1 1 1 3 3 2 1
0 2 2 0 0 3 3 2 1 3 1 1 3 3 1 1 3 2 2 1 2
2 0 1 1 3 0 3 0 2 2 0 2 0 3 3 3 3 2 0 3 3
1 1 2 2 2 0 2 2 0 2 2 0 3 2 0 3 2 0 2 0 3
1 3 1 3 3 3 1 1 2 2 2 1 3 3 1 2 2 1 3 3 3
3 0 1 0 1 0 2 1 3 3 3 0 3 1 3 3 1 3 3 3 1
0 3 0 2 0 1 2 1 3 2 1 1 2 0 0 3 0 1 2 1 3
1 3 2 0 0 2 1 1 1 3 3 0 1 0 1 3 1 0 1 3 1
2 0 2 1 1 1 0 0 2 2 3 1 3 0 3 2 1 3 1 1 3
0 3 2 0 0 3 2 0 0 0 3 3 1 1 1 2 0 3 3 2 3
0 0 0 0 1 2 1 2 1 3 0 0 3 1 1 0 1 0 2 2 2
when i classify each row to look for the nearest neighbour should i return
the row to which Euclidean distance is the smallest or should i return the decision ? or it's not the question for this forum :) ? but maybe somebody here have written classificators before
thank YOU
Jul 10 '07 #1
3 1592
JosAH
11,448 Recognized Expert MVP
When i have DNA test data like the data below just few first rows pasted here
first number is the number of rows and second number is the number of columns 21st column is a decision
1186 21
1 2 3 1 3 3 1 3 3 1 2 0 3 2 1 3 2 1 0 2 3
0 0 2 1 0 0 0 2 1 3 2 1 2 2 1 0 3 1 1 3 2
0 3 1 1 0 2 2 0 1 3 1 3 0 0 2 1 1 3 3 1 2
1 2 3 3 3 1 3 0 3 3 1 2 1 3 3 1 3 0 3 3 3
3 0 1 3 3 2 0 3 3 3 3 1 3 3 1 3 1 0 3 2 3
0 2 0 3 2 1 2 2 1 2 3 0 3 1 3 0 2 2 1 0 1
3 1 3 2 0 2 0 1 0 3 2 1 3 3 3 1 3 3 0 1 3
0 0 2 0 2 2 3 2 1 3 0 0 3 2 0 3 2 0 3 1 2
3 1 3 3 1 3 1 2 2 0 1 0 3 1 3 3 0 1 3 3 3
1 1 1 0 2 0 2 1 1 3 3 0 1 1 1 1 1 3 3 2 1
0 2 2 0 0 3 3 2 1 3 1 1 3 3 1 1 3 2 2 1 2
2 0 1 1 3 0 3 0 2 2 0 2 0 3 3 3 3 2 0 3 3
1 1 2 2 2 0 2 2 0 2 2 0 3 2 0 3 2 0 2 0 3
1 3 1 3 3 3 1 1 2 2 2 1 3 3 1 2 2 1 3 3 3
3 0 1 0 1 0 2 1 3 3 3 0 3 1 3 3 1 3 3 3 1
0 3 0 2 0 1 2 1 3 2 1 1 2 0 0 3 0 1 2 1 3
1 3 2 0 0 2 1 1 1 3 3 0 1 0 1 3 1 0 1 3 1
2 0 2 1 1 1 0 0 2 2 3 1 3 0 3 2 1 3 1 1 3
0 3 2 0 0 3 2 0 0 0 3 3 1 1 1 2 0 3 3 2 3
0 0 0 0 1 2 1 2 1 3 0 0 3 1 1 0 1 0 2 2 2
when i classify each row to look for the nearest neighbour should i return
the row to which Euclidean distance is the smallest or should i return the decision ? or it's not the question for this forum :) ? but maybe somebody here have written classificators before
thank YOU
You have to define your algebra first for those first 20 digits if you want to be able
to speak about a 'nearest neighbour'. What do 0, 1, 2, 3 mean? C, G, T and A?
what makes one number to be closer to another number than another? What
does the decision digit mean? Is it a coincidence that it is in the range [0,3]
too in your example? Please elaborate.

kind regards,

Jos
Jul 10 '07 #2
oll3i
679 Contributor
he you see, lecturer only told us that the last column is a decision
i counted it with naive bayes and the decision is correct a least for the rows i tested
in the tutorials on knn i found the test data eg
x1 x2 y(classificatio n)
1 2 bad
2 7 good
we just have the decision [0,3]
maybe i should gather the decisions of the nearest neighbours and then return the decision that occurs most frequently ?
Jul 10 '07 #3
JosAH
11,448 Recognized Expert MVP
I have a question for you: what, by Jove, is a 'decision'. Don't tell me it's a number.

kind regards,

Jos
Jul 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

14
11507
by: John Hunter | last post by:
I have a list of two tuples containing x and y coord (x0, y0) (x1, y1) ... (xn, yn) Given a new point x,y, I would like to find the point in the list closest to x,y. I have to do this a lot, in an inner loop, and then I add each new point x,y to the list. I know the range of x and y in
4
6796
by: tertius | last post by:
Hi, I'm trying to round my float total to the nearest .05 cents. 12.01 should produce 12.00 0.14 should produce 0.10 2.28 " 2.25 703.81 " 703.80 "%.02f"%100.0099 produces 100.01 (which I know is right)
2
2629
by: nkunapa | last post by:
Hi: Is there a way in XPATH to find the nearest node of the node in context with a certain attribute value. Here is my problem. I have the following XML and I am trying to add all the nodes with attribute value LNum=1 as child nodes of the nearest node above it with attribute LNum=0....and add all the nodes with attribute value LNum=2 as child nodes of the nearest node above it with attribute LNum=1 and so on. The LNum value can go...
4
3869
by: Travis Stewart | last post by:
Hi, I am not very familiar with C++ so the problems I am having might be simple and I just cannot see them or I am totally unaware of why something would be incorrect. Anyway, I'm using the ANN approximate nearest neighbour libraries written by David Mount and Sunil Arya. In the ANN.h file there is a comment describing how the data types used to represent the coordinates and distances between points can be modified by the user. For my...
8
2848
by: Gompie | last post by:
Why does the function DMin("Abs(!- #" & & "#)";"SomeTable") not work properly with datefields. It always finds the closest difference with a later date only, if an earlier date in the table is closer or even equal, it still comes up with the later date. It works fine with numeric fields. (of course without the number signs) Anybody knows why?
1
3215
by: maryjones11289 | last post by:
Hi All, I'm trying to write/find code that creates a Ternary Search Tree in Visual Basic (VB6 or .NET). Here's my situation: What I have is an array consisting of 60,000 string elements. All elements are exactly 225 characters in length. All elements are made up of 1's and 0's
4
3073
by: naren2345 | last post by:
Would this expression round an integer n to the nearest power of 4 ? ((n-1)|3) + 1
3
1482
by: Valvalis | last post by:
Hello, I am trying to set a class attribute of a text.item element to the value of its nearest ancestor. I want to do this in the case that the class of the text.item is currently a blank string. <text class="read-only"> ... <text.item class=""/> //this element should inherit the class attribute "read-only" from text <foo class="read-write"> <text.item class="" /> //this element should inherit the class attribute...
1
5380
by: lindabaldwin | last post by:
Hi everyone, I have a code that I can use in Excel to round to the nearest 0.5, but I cannot get it to work in Access. When I try to execute it I get the following error message: "Compile error: user defined type not defined." Any idea what I need to do to change my code to work in Access? Here's the code: 'Round to nearest 0.5 Public Function vbaRoundTO(dblValue As Double, dblRoundTo As Double, _ Optional RoundingOption As rOpt...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8872
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6673
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5299
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3562
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.