Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in my knn classifier code i have two text file where train and text data store, i pass these two files to knn function in order to read data, but after passing files i find that these files not pass correctly what's wrong with my code
this is the code:

C#
const char *trn_file="Winner.trn";
    const char *tst_file="Winner.tst";


knn.LoadData("Winner.trn","Winner.tst");//the call of function


void KNN::LoadData(const char*TrnFile,const char*TstFile)
{
	ifstream Trn(TrnFile);
	ifstream Tst(TstFile);
.
.
.
}//the function definition


in code Autos the train and test files are look like
+		TrnFile	0x00207b50 "‹خئ„$"	const char *


the train and test files take the value
"‹خئ„$"
not Winner

any guess
thanks
Posted
Comments
Richard MacCutchan 14-Jun-14 4:15am    
Why declare the two pointers if you are not going to use them? It is better to call your function with the pointers thus:
knn.LoadData(trn_file, tst_file);

However, you have not given any details about what you mean by "these files not pass correctly".
MSMHMA 14-Jun-14 10:55am    
in loadData function i read text data from these files but all the data has no values that is because the files not pass
Richard MacCutchan 14-Jun-14 10:57am    
Are you sure the files are in the right place, you have not given their full pathnames?

1 solution

you need to provide a full path. Otherwis you better use unicode.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900