بســم الله الـرحمــن الرحيــم :wub:
انا عضوة جديدة معاكوا ومحتاجة مساعدة ضرورى باقرب وقت فى البرنامج المعقد دة
:wacko:
One of the methods of prediction/approximation is the use of least squares fitting using a linear or polynomial function. You are required to write a Java program that does the following:
1. Read in an SGML/XML file that provides a problem definition that includes the type of least squares fitting method, the training data and test data. The file should have the following format:
<problem>
<fit>FitType</fit>
<train>
<point>
<x>xVal</x>
<y>yVal</y>
</point>
…
…
<point>
<x>xVal</x>
<y>yVal</y>
</point>
</train>
<test>
<point>
<x>xVal</x>
<y>yVal</y>
</point>
…
…
<point>
<x>xVal</x>
<y>yVal</y>
</point>
</test>
</problem>
Where FitType Î {LIN, POLY} and xVal and yVal are coordinates of data points. If FitType = POLY, an additional tag after <fit>FitType</fit> will be added to the XML file to specify the degree of polynomial fitting. The tag and its value will have the following format <degree>degree_of_polynomial</degree>
2. Compute the coefficients for the required least squares fitting.
3. Compute the error in floating point notation (a.aaaa Exx) for the training set. Print error in the following format:
Training Set Error:tErrorVal
4. Compute the error in floating point notation (a.aaaa Exx) for the test set. Print error in the following format:
Test Set Error:tErrorVal
