Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:miw:miw08_rbs_ml:attrchangecollection [2017/07/17 08:08] (aktualna)
Linia 1: Linia 1:
 +<code ="​Java">​
 +package MachineLearning;​
  
 +import java.util.*;​
 +
 +public class AttrChangeCollection
 +{
 +
 + private HashMap<​Integer,​ AttributChange>​ m_attrChangeCollection;​
 +
 +
 + public AttrChangeCollection()
 + {
 + m_attrChangeCollection = new HashMap<​Integer,​ AttributChange>​();​
 + }
 +
 +
 + public void Add(ArrayList<​Integer>​ tresholds, Integer attrIndex)
 + {
 + if (!m_attrChangeCollection.containsKey(attrIndex))
 + {
 + AttributChange attrChange = new AttributChange(tresholds,​attrIndex);​
 + m_attrChangeCollection.put(attrIndex,​ attrChange);​
 + }
 + }
 +
 + public void Change(Object[][] examples, Integer attrIndex)
 + {
 + if(m_attrChangeCollection.containsKey(attrIndex))
 + {
 + m_attrChangeCollection.get(attrIndex).Change(examples);​
 + }
 + }
 +
 + public void Change(Object[][] examples)
 + {
 + for (AttributChange attrChange : m_attrChangeCollection.values())
 + {
 + attrChange.Change(examples);​
 + }
 + }
 +
 + public void Change(Object[] example)
 + {
 + for (AttributChange attrChange : m_attrChangeCollection.values())
 + {
 + attrChange.Change(example);​
 + }
 + }
 +
 + public void WriteAggregateValues()
 + {
 + if (m_attrChangeCollection.size() > 0)
 + {
 + WriteFile sw = new WriteFile();​
 + sw.open("​Aggregate.txt"​);​
 +
 + sw.writeLine("​Nowy atrybut"​);​
 + sw.writeLine("​\tStary atrybut"​);​
 +
 + m_attrChangeCollection.get(0).WriteOldNewValues("​DaysOfWeek",​ sw, Days.values());​
 +
 + m_attrChangeCollection.get(1).WriteOldNewValues("​Hour",​ sw);
 +
 + m_attrChangeCollection.get(2).WriteOldNewValues("​Month",​ sw, Month.values());​
 +
 + sw.close();​
 + }
 + }
 +}
 +</​code>​
pl/miw/miw08_rbs_ml/attrchangecollection.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0