The Data Mining Forum                             open-source data mining software data mining conferences Data Science for Social and Behavioral Analytics DSSBA 2022 data science journal
IMPORTANT: This is the old Data Mining forum.
I keep it online so that you can read the old messages.

Please post your new messages in the new forum: https://forum2.philippe-fournier-viger.com/index.php
 
source code of Charm
Posted by: djanahana
Date: November 17, 2011 11:56AM

Good mroning every body .

first i want to thank you Sir phillipe for this effort to help people by posting source code of data mining algorithms.


my question Sir if there is no problem of course.it is about algorithm Charm source code :
i am very native whith java and i don't understand what means by this declaration of varaiables ex:private List childNodes = new ArrayList<ITNode>(); from the file ITNode.java


my pb is with "<ITNode >" is it kind of declaration ??? because in "eclipse" it consider it as a mistack .and this is the same thing with all what is enter <and >;

thanks for reading my msg

Options: ReplyQuote
Re: source code of Charm
Date: November 23, 2011 01:57PM

Hello djanahana,

I'm sorry for the late reply. Normally, I answer more quickly. But I was busy this week.

To answer your question:

List childNodes = new ArrayList<ITNode>();

It means that we create a list of ITNodes. If you don't write <ITNode> it would also works. But the compiler would not know that this list contains ITNode objects and you would need to always use a "cast" when you want to access objects from the list.

I will give you an example. If you write like what I did:

List childNodes = new ArrayList<ITNode>();

Then, if you want to acess the first item, you will do:

ITNode node = (ITNode) childNodes.get(0);

If you want to do a for loop, you can write like this:

for(ITNode node : childNodes) { ....}

But if you do like this:

List childNodes = new ArrayList<ITNode>();

Then, if you want to acess the first item, you will do:

ITNode node = childNodes.get(0);

and if you want to make a for loop, you will have to do like that:

for(int i=0; i < childNodes.size(); i++) {
ITNOde node = (ITNode) childNode.get(i);
}

This feature of Java is called "generics". It makes your code more pretty. It will also make sure that you never add any other kinds of objects in your list that you created it for.

For example, if you add an object Integer in the childNodes list, it will give you an error. But if you did not use <ITNode> when you created the list, the compiler will not give you an error.

Hope this helps,

Philippe

Options: ReplyQuote
Re: source code of Charm
Posted by: Bui Huu Dong
Date: June 04, 2014 05:20PM

Hi webmasterphilfv,
I am Dong, I'm from Viet Nam.
I am studying for CHARM to Mining Closed Item. can You send to me source of CHARM?
Thank you very so much.

Options: ReplyQuote
Re: source code of Charm
Posted by: Bui Huu Dong
Date: June 04, 2014 05:21PM

Hi webmasterphilfv,
Can you send source code of CHARM to silamy1927@gmail.com.
Thanks a lot.

Options: ReplyQuote
Re: source code of Charm
Date: June 05, 2014 02:13AM

You can get the source code of CHARM in Java in my open source data mining library:

http://www.philippe-fournier-viger.com/spmf/

Just go to the download page and follows the instructions.

Options: ReplyQuote


This forum is powered by Phorum and provided by P. Fournier-Viger (© 2012).
Terms of use.