Results 1 to 1 of 1
- 05-07-2012, 04:58 PM #1
Member
- Join Date
- May 2012
- Location
- Malaysia
- Posts
- 3
- Rep Power
- 0
Compare input with the data from text file and etc??
Hi,
I'm new to java and currently trying to implement generalized regression neural network (grnn) in java. I need an opinion on how to comparing input with training data from text file.
this is the basic code/algorithm that i use right now:
This is the example of training data that i put in text file.public class Grnn {
public static void main(String[] args)
{
// Check LSA, CM and CUT and compare to LSA, CM and CUT in training data,
// Capture Target Output values = TargetOutput
double LSA_Training_Data = 0.8;
int CM_Training_Data = 77;
int CUT_Training_Data = 65;
double LSA = 0.6;
int CM = 76;
int CUT = 64;
double dif1 = LSA_Training_Data - LSA;
int dif2 = CM_Training_Data - CM;
int dif3 = CUT_Training_Data - CUT;
int NoOfNeuron = 3;
int TargetOutput = 75;
double numenator = (((TargetOutput * Math.pow(NoOfNeuron,dif1)) + (TargetOutput * Math.pow(NoOfNeuron,dif2)) + (TargetOutput * Math.pow(NoOfNeuron,dif3))));
double denumenator = (Math.pow(NoOfNeuron,dif1)+ Math.pow(NoOfNeuron,dif2)+ Math.pow(NoOfNeuron,dif3));
double holdtime = (numenator / denumenator);
System.out.println ("hold time is " + holdtime);
System.out.println ("exponent a " + (TargetOutput * Math.pow(NoOfNeuron,dif1)));
System.out.println ("exponent b " + (TargetOutput * Math.pow(NoOfNeuron,dif2)));
System.out.println ("exponent c " + (TargetOutput * Math.pow(NoOfNeuron,dif3)));
}
}
LSA CM CUT Target Output
60 1 1 0.1
55 1 1 0.1
60 33 17 0.2
55 33 17 0.3
60 77 65 47
55 77 65 49
0.8 77 65 75
0.8 81 65 76
0.7 81 65 78
How am i going to compare my input (LSA, CM, CUT) with training data (LSA_Training_Data,CM_Training_Data,CUT_Training_D ata) that i put in text file and also capture the Target Output? The other problem is how am i going to capture the nearest Training Data in file? The input does not always the same with the data in text file. For example the input is can be 0.6(LSA), 76(CM) and 64(CUT) and if you refer to the training data above the nearest value is 0.8,77,65 where the target output is 75 . The use of GRNN is to predict the value of output (hold time) based on this three input (0.6,76,64). The way GRNN works can be seen in the code. As you can see, i manually input the value of LSA, CM, CUT, LSA_Training_Data,CM_Training_Data,CUT_Training_Da ta and Target Output but i need to get this data (LSA_Training_Data,CM_Training_Data,CUT_Training_D ata and Target Output) from text file based from the input (LSA, CM, CUT) that i provide.
Your opinion is very, very much appreciated.Last edited by mhaider2; 05-08-2012 at 07:39 AM. Reason: code updated
Similar Threads
-
Read text file and compare strings
By africanhacker in forum New To JavaReplies: 9Last Post: 04-01-2011, 12:53 AM -
Read a data from a text file and create an object from these data in this text file
By jjavaa in forum Advanced JavaReplies: 2Last Post: 03-25-2011, 02:36 PM -
Input from Command Line rather than from a text file
By thomas6 in forum New To JavaReplies: 3Last Post: 04-26-2010, 09:00 PM -
count character in text file as input file
By aNNuur in forum New To JavaReplies: 7Last Post: 03-25-2010, 04:01 PM -
PROOF READ: Sort text file 3 different ways and compare
By VinceGuad in forum New To JavaReplies: 2Last Post: 01-26-2009, 04:28 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks