Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


complicated calculation on the Arraylist of int[] !!

Posted on 2004-08-02
Medium Priority
Last Modified: 2010-03-31
hi experts,

I got a Arraylist of int[] which contains data like belows:

........................about 1000 rows and 17 columns !

the last column is used as a class identifier, writing a program for this ,
u may read in the dataset first, divide it into 10 subsets and store to ten 2D array. Use a For-loop to repeat the process 10 times, and do the classification experiment inside
this for loop. the classification experiment is using ED----http://www.nist.gov/dads/HTML/euclidndstnc.html

The ED method is used to measure the similarity between
two feature vectors(rows). For each sample in the testing set, compare it with
all the samples in the training set and find the most similar feature
vector(row) (by using ED, the shortest distance..), then
compare their class ID ( user ID), if match, it counts a correct
classified smaple, it counts a non-match classified sample otherwise.
Then, obtain the correct classification RATE for each fold, and
also the total classification rate.
Finally output the classification rate for each fold to a text file !

thanks !
Question by:mmccy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 35

Expert Comment

ID: 11694223

Author Comment

ID: 11694320
Sorry that is the first part !! After having some experts's help I am tackling with it now and fully understand it (the first part)
However, I really have no idea of what I should do in this 2nd part !!
Can u give me some hints ?

thanks !
LVL 24

Expert Comment

ID: 11695666
And ... this is homework!!!!

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 12

Accepted Solution

Giant2 earned 2000 total points
ID: 11700996
>divide it into 10 subsets and store to ten 2D array

      public ArrayList[] divide(ArrayList original, int numOfSubset){
            ArrayList[] ret=new ArrayList[numOfSubset];
            int subset=0;
            int nrlen=original.size()/numOfSubset;
            int pos=0;
            while (subset<numOfSubset && pos<original.size()){
                  if (pos==nrlen)subset++;
            if (pos<original.size()){
                  for (int i=pos;i<original.size();i++)
            return ret;
LVL 24

Expert Comment

ID: 11880153
Agreed; how do the moderators deal with this kind of questioners? Just curious.
LVL 12

Expert Comment

ID: 11880189
>We can answer homework questions in Tutor mode but not to give full solutions.

Sorry Venabili,
but I see many (and many) Experts that giving the full solution have points; and I (giving only a Tutor solution) have NO points.
So I decide that if I have ready a solution, I'll post it (this is I have done in this thread).

Maybe I was not luckly than other because "mmccy" doesn't close the post where I gave the full solution, so now this thread is deleted (even if I gave a solution).

No problem, but I hope this control about the Tutor/FullSolution will be done even on the entire EE DB, not only on the thread not closed.

Bye, Giant.

P.S. I think this is one problem in EE, but, like I raised up in another thread I have this like answer: It's not possible to check the answer accepted/assisted.
LVL 24

Expert Comment

ID: 11883093
I remark that the tone of some questions tells a story: literally from a book, paper or even examination.
You must not complain that you are not always stopped / rewarded or EE will turn into a police environment.
LVL 12

Expert Comment

ID: 11883207
Infact I told:
"It's not possible to check the answer accepted/assisted"

Bye, Giant.
LVL 24

Expert Comment

ID: 11888983
Yes, indeed, now someone has the feeling he/she could get away with the answer without paying.
I agree with "Delete - no points refunded",
but annoying still to those who spent their time.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question