AKB Forums

Go Back   AKB Forums > Technical sections > Algorithms
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Algorithms The source of algorithms for your project

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old May 13, 2007, 18:38   #1
Slipstream Traveller
 
Cortana's Avatar
 
Join Date: Jan 2007
Location: Pillar of Autumn
Posts: 132
Rep Power: 2
Reputation: 10
Need help

So here's the question:

I have a dataset of one-dimensional vectors, each of those has a corresponding N-dimensional vector. The task is: given a one-dimensional vector from outside the dataset, predict the corresponding N-dimensional vector.
In other words, I somehow need to learn a function f(x)->(y1, y2,..., yN) or f(x)->([a1,b1], [a2,b2],..., [aN,bN]), where y1 belongs to [a1,b1] and so on (a and b as close together as possible).
Would really appreciate any suggestions, I'm kinda stuck - the methods I've tried didn't perform well.
__________________
"You are making a mistake.
My logic is undeniable."
Cortana is offline   Reply With Quote Quote selected
Old May 14, 2007, 06:57   #2
User
 
ByTheWay's Avatar
 
Join Date: Jul 2006
Location: Yerevan
Posts: 882
Rep Power: 2
Reputation: 26
have you tried to drain a glass of brandy, it can be helpful
__________________
stop your eyes from flowing out
ByTheWay is offline   Reply With Quote Quote selected
Old May 14, 2007, 07:32   #3
Slipstream Traveller
 
Cortana's Avatar
 
Join Date: Jan 2007
Location: Pillar of Autumn
Posts: 132
Rep Power: 2
Reputation: 10
i have, thank u, and how about smth to the point?
__________________
"You are making a mistake.
My logic is undeniable."
Cortana is offline   Reply With Quote Quote selected
Old May 15, 2007, 08:01   #4
Школьник
 
Junior's Avatar
 
Join Date: Aug 2004
Location: Armenia
Posts: 241
Rep Power: 4
Reputation: 10
Cortana, could you please formulate the problem with more detail? And give 2-3 examples?
__________________
One way, or another, I'm gonna get You...
From a song.
Junior is offline   Reply With Quote Quote selected
Old May 16, 2007, 11:00   #5
User
 
ByTheWay's Avatar
 
Join Date: Jul 2006
Location: Yerevan
Posts: 882
Rep Power: 2
Reputation: 26
Quote:
Originally Posted by Junior View Post
Cortana, could you please formulate the problem with more detail? And give 2-3 examples?
You know, after a glass of brandy, it's not so easy task
__________________
stop your eyes from flowing out
ByTheWay is offline   Reply With Quote Quote selected
Old May 25, 2007, 05:52   #6
Slipstream Traveller
 
Cortana's Avatar
 
Join Date: Jan 2007
Location: Pillar of Autumn
Posts: 132
Rep Power: 2
Reputation: 10
Wow, I see a lot of useful suggestions..lol
Junior, what kind of details do u want?
__________________
"You are making a mistake.
My logic is undeniable."
Cortana is offline   Reply With Quote Quote selected
Old May 26, 2007, 07:18   #7
User
 
ByTheWay's Avatar
 
Join Date: Jul 2006
Location: Yerevan
Posts: 882
Rep Power: 2
Reputation: 26
Quote:
Originally Posted by Cortana View Post
Wow, I see a lot of useful suggestions..
Yeh, no thanks required, you know, you're welcome
can you translate your question into Russian
cause my don't understooding English very wall
__________________
stop your eyes from flowing out
ByTheWay is offline   Reply With Quote Quote selected
Old May 26, 2007, 12:25   #8
это надо видеть
 
Satyricon's Avatar
 
Join Date: Mar 2006
Location: где то там...
Posts: 3,009
Blog Entries: 2
Rep Power: 3
Reputation: 332
Send a message via ICQ to Satyricon Send a message via Yahoo to Satyricon Send a message via Skype™ to Satyricon
Please give an example with real numbers
__________________
Лучше поздно, чем никогда. Но лучше поздно, чем сейчас...
Трудно думать о чем то еще, когда вас схватили за яйца...
Satyricon is offline   Reply With Quote Quote selected
Old May 27, 2007, 05:17   #9
Slipstream Traveller
 
Cortana's Avatar
 
Join Date: Jan 2007
Location: Pillar of Autumn
Posts: 132
Rep Power: 2
Reputation: 10
Quote:
Originally Posted by ByTheWay View Post
Yeh, no thanks required, you know, you're welcome
can you translate your question into Russian
cause my don't understooding English very wall
Ha, qo asacn a, cavd tanem
__________________
"You are making a mistake.
My logic is undeniable."
Cortana is offline   Reply With Quote Quote selected
Old May 27, 2007, 05:44   #10
Slipstream Traveller
 
Cortana's Avatar
 
Join Date: Jan 2007
Location: Pillar of Autumn
Posts: 132
Rep Power: 2
Reputation: 10
Quote:
Originally Posted by Satyricon View Post
Please give an example with real numbers
Not sure how this will help, but anyways, here's a sample of my data:

1: x = -28.240891 y = (310.747, 3.01, -1.4, -40.58, 0, 4, 5, 8, 1, 3)
2: x = -42.423779 y = (349.184, 3.89, -1.74, -60.42, 0, 3, 7, 8, -1, 5)
3: x = -37.312016 y = (296.355, 2.03, -0.54, -22.76, 0, 0, 5, 2, 0, 5)

and so on, about 4M of them.
What I need is a function, which given, say, x = -28.240891 (first data point), will give me back some y very close to y = (310.747, 3.01, -1.4, -40.58, 0, 4, 5, 8, 1, 3).
In other words, the points in the database r not random, so I need to find a rule that describes them.
__________________
"You are making a mistake.
My logic is undeniable."
Cortana is offline   Reply With Quote Quote selected
Old May 27, 2007, 10:04   #11
Академик
 
Join Date: Aug 2002
Location: Yerevan, Armenia
Posts: 4,441
Rep Power: 6
Reputation: 31
Send a message via ICQ to W_z_rd
Did I understand it right that, based on a dataset you have, you need to calculate set of functions Y1(x)...YN(x), which, for any given X, will return you all the Y1-Yn-s closely matching those in dataset ?

There are numbers of interpolation methods (polinomial, b-spline, etc.), every one is good for a specific type of data/task. Which one of those have you tried and why the result was not satisfactory ?

One thing is clear that you can consider the problem as N intependednt x-y relationships, so we have to calculate N functions independently.
__________________
Stuck between heaven and hell; dunno where to go...

Last edited by W_z_rd : Jun 4, 2007 at 08:45.
W_z_rd is offline   Reply With Quote Quote selected
Old May 27, 2007, 10:23   #12
User
 
ByTheWay's Avatar
 
Join Date: Jul 2006
Location: Yerevan
Posts: 882
Rep Power: 2
Reputation: 26
Quote:
Originally Posted by Cortana View Post
What I need is a function, which given, say, x = -28.240891 (first data point), will give me back some y very close to y = (310.747, 3.01, -1.4, -40.58, 0, 4, 5, 8, 1, 3).
public static void main(String[] args) {
double x = -28.240891;
double y[] = {310.747, 3.01, -1.4, -40.58, 0, 4, 5, 8, 1, 3};

System.out.println( getMoreCloseElement(x, y) );
}

static double getMoreCloseElement(double x, double y[]) {
double ret = y[0];
double dif = Math.abs(x - y[0]);

for (int i = 1; i < y.length; i++) {
double temp = Math.abs(x - y[i]);
if( temp < dif ) {
dif = temp;
ret = y[i];
}
}
return ret;
}
__________________
stop your eyes from flowing out
ByTheWay is offline   Reply With Quote Quote selected
Old May 27, 2007, 18:43   #13
Дикообраз-безобраз
 
AvDav's Avatar
 
Join Date: Jul 2004
Location: У самого синего моря
Posts: 2,509
Rep Power: 4
Reputation: 44
Send a message via ICQ to AvDav
Quote:
Originally Posted by Cortana View Post
Not sure how this will help, but anyways, here's a sample of my data:

1: x = -28.240891 y = (310.747, 3.01, -1.4, -40.58, 0, 4, 5, 8, 1, 3)
2: x = -42.423779 y = (349.184, 3.89, -1.74, -60.42, 0, 3, 7, 8, -1, 5)
3: x = -37.312016 y = (296.355, 2.03, -0.54, -22.76, 0, 0, 5, 2, 0, 5)

and so on, about 4M of them.
What I need is a function, which given, say, x = -28.240891 (first data point), will give me back some y very close to y = (310.747, 3.01, -1.4, -40.58, 0, 4, 5, 8, 1, 3).
In other words, the points in the database r not random, so I need to find a rule that describes them.
Hmm.. what you need is just 2 arrays, 1-st one is one dimensional, second one - two, just use linear search by given x value and take the corresponding y[i]-th vector, what's the problem ?
__________________
Forza Alb-Violeţii.
AvDav is offline   Reply With Quote Quote selected
Old May 27, 2007, 18:46   #14
Дикообраз-безобраз
 
AvDav's Avatar
 
Join Date: Jul 2004
Location: У самого синего моря
Posts: 2,509
Rep Power: 4
Reputation: 44
Send a message via ICQ to AvDav
Ooops, didn't mention 4M data stuff ... well pre-sort the array to use binary search so will be somewhat O(log(n)) instead of O(N)
__________________
Forza Alb-Violeţii.
AvDav is offline   Reply With Quote Quote selected
Old May 27, 2007, 19:03   #15
Дошкольник
 
Join Date: Oct 2004
Location: Yerevan
Posts: 114
Rep Power: 4
Reputation: 12
Send a message via ICQ to Intel
Theoretical, we can manage to have just 1 number, instead of Y1, Y2, ..., Yn. And after that all we have to do is to find a function that supplies a single(and also correct) Y value corresponding to a single X, thats much more easier cuz, as it was mentioned before by W_z_rd, there are several methods available for that case, and it doesn't require separate calculations for each Y value.
Intel is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 21:37.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link