-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Starting to draft some code on training phase implementation
- Loading branch information
1 parent
a472600
commit 9e62bad
Showing
16 changed files
with
303 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package weka.finito.training; | ||
|
||
// This class is a Data Provider. | ||
// They can own multiple levels, as the data shouldn't leave their site from my understanding | ||
public class DataProvider implements Runnable { | ||
|
||
public DataProvider() { | ||
|
||
} | ||
|
||
@Override | ||
public void run() { | ||
// Within this run, you should complete the training | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package weka.finito.training; | ||
|
||
import weka.Run; | ||
import weka.classifiers.trees.j48.ClassifierTree; | ||
|
||
// This will work with DataProviders to collect the needed data on how to make PPDT | ||
// Will help Data Providers create level-sites | ||
public class SiteMain implements Runnable { | ||
|
||
// Main Objective | ||
// 1- get info from all providers? | ||
// 2- Somehow tell data providers what level-site(s) they are creating? | ||
|
||
// ppdt could be full PPDT? | ||
ClassifierTree ppdt; | ||
|
||
String [] hosts; | ||
int [] ports; | ||
|
||
public SiteMain(String [] hosts, int [] ports) { | ||
this.hosts = hosts; | ||
this.ports = ports; | ||
} | ||
|
||
@Override | ||
public void run() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package weka.finito.utils; | ||
|
||
import weka.core.Attribute; | ||
import weka.core.Utils; | ||
|
||
import java.rmi.RemoteException; | ||
|
||
public class Computations { | ||
// Create a Compute Locally | ||
|
||
/* | ||
// Probably would be a NodeInfo object instead? | ||
private TreeNode formMajorityClassLeaf() throws RemoteException { | ||
// !!! FIX IMPORTANT | ||
// IF DISTRIBUTION is all zeroes do something else | ||
// For now just setting all classes to be equiprobable.. This is clearly wrong | ||
boolean nonZeroFlag = false; | ||
for (int i = 1; i<m_nhosts; i++) | ||
m_Slaves[i-1].prepareTransVector(); | ||
m_Distribution = new double[m_insts.numClasses()]; | ||
for (int i=0; i<m_insts.numClasses(); i++) { | ||
Attribute classattr = m_insts.classAttribute(); | ||
prepareTransVectorWithClassFilter(classattr.indexOfValue(classattr.value(i))); | ||
m_Distribution[i] = SetIntersect(); | ||
if (m_Distribution[i] > 0) nonZeroFlag = true; | ||
} | ||
if (!nonZeroFlag) { | ||
for (int i=0; i<m_insts.numClasses(); i++) { | ||
m_Distribution[i] = 1; | ||
} | ||
} | ||
Utils.normalize(m_Distribution); | ||
m_ClassValue = Utils.maxIndex(m_Distribution); | ||
return new LeafNode(m_ClassValue, m_Distribution); | ||
} | ||
*/ | ||
} |
Oops, something went wrong.