Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code reorganization #183

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f155b09
Merge pull request #2 from aosojnik/multitarget
aosojnik Nov 9, 2015
5c49882
Added some classifiers for multi-label classification
aosojnik Nov 9, 2015
6715ccf
Updates to multi-label methods
aosojnik Nov 9, 2015
fedd0d2
Cosmetic changes (fixed indentation)
aosojnik Nov 9, 2015
a94c96f
Merge branch 'master' of https://github.com/aosojnik/moa
aosojnik Nov 9, 2015
4e3116a
Removed merging artefacts
aosojnik Nov 9, 2015
5dec8c1
Additional merging artefacts fixed
aosojnik Nov 9, 2015
02d2683
Test commit of everything
aosojnik Nov 9, 2015
8e867c3
Revert "Test commit of everything"
aosojnik Nov 9, 2015
4436a24
Revert "Additional merging artefacts fixed"
aosojnik Nov 9, 2015
296844e
Revert "Removed merging artefacts"
aosojnik Nov 9, 2015
562350e
Updates with the new versions of the algorithms (some code is imported
aosojnik Nov 13, 2015
0f8677b
Merge pull request #8 from Waikato/master
abifet Mar 9, 2016
483366b
Intermediary commit for multi-label changes
aosojnik Mar 23, 2016
a78b6f3
Merge branch 'master' of https://github.com/abifet/moa
aosojnik Mar 23, 2016
df564f7
Merge branch 'master' of https://github.com/Waikato/moa
aosojnik Mar 23, 2016
60b81db
Instance, InstanceHeader, ArffReader, etc. rework
aosojnik Mar 24, 2016
3dfb80b
AttributeInformation streamlining and other fixes
aosojnik Mar 24, 2016
66c988f
Instances rework, new iSOUPTree models and import cleanup
aosojnik Jan 10, 2017
16f1214
Commit before cleanup
Jun 13, 2017
4d7a7a2
Added some classifiers for multi-label classification
aosojnik Nov 9, 2015
1cebdab
Updates to multi-label methods
aosojnik Nov 9, 2015
12f6b0c
Removed merging artefacts
aosojnik Nov 9, 2015
3bcb756
Additional merging artefacts fixed
aosojnik Nov 9, 2015
458ac70
Test commit of everything
aosojnik Nov 9, 2015
a40904d
Revert "Test commit of everything"
aosojnik Nov 9, 2015
5a48cb8
Revert "Additional merging artefacts fixed"
aosojnik Nov 9, 2015
e4f2eb6
Revert "Removed merging artefacts"
aosojnik Nov 9, 2015
b6037c6
Updates with the new versions of the algorithms (some code is imported
aosojnik Nov 13, 2015
1b6cdbf
Intermediary commit for multi-label changes
aosojnik Mar 23, 2016
90e39b2
Instance, InstanceHeader, ArffReader, etc. rework
aosojnik Mar 24, 2016
c4a4691
AttributeInformation streamlining and other fixes
aosojnik Mar 24, 2016
bdffa94
Instances rework, new iSOUPTree models and import cleanup
aosojnik Jan 10, 2017
32d534d
Commit before cleanup
Jun 13, 2017
d16bae0
Merge branch 'master' of https://github.com/aosojnik/moa into
aosojnik Jul 2, 2017
5c0c858
Learner, Prediction rework
aosojnik Jul 2, 2017
374ba36
Removed merging artifacts
Jul 3, 2017
e3549e9
Transitional commit
aosojnik Apr 17, 2018
f916c86
Merge with waikato/moa & bugfixes
aosojnik Sep 13, 2019
7d880aa
Merge with waikato/moa 2019-09
aosojnik Sep 13, 2019
5e8945e
Code reorganization
aosojnik Sep 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public MultiLabelPrediction(int numOutputAttributes) {
for (int i=0; i<numOutputAttributes;i++)
prediction[i]= new DoubleVector();
}

public MultiLabelPrediction(DoubleVector[] prediction) {
this.prediction = prediction;
}

public MultiLabelPrediction(DoubleVector[] prediction) {
this.prediction = prediction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public int branchForInstance(Instance inst) {
if (inst.isMissing(instAttIndex)) {
return -1;
}
<<<<<<< HEAD
double v = inst.valueInputAttribute(instAttIndex);
=======
double v = inst.valueInputAttribute(instAttIndex); // if the attIndex is not calculated above this is the correct method call
>>>>>>> 5c49882b22b3a8314c6dfcc8c026456c887262fa
if (v == this.attValue) {
return this.equalsPassesTest ? 0 : 1;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package moa.classifiers.multilabel;

<<<<<<< HEAD
import java.util.ArrayList;
=======
>>>>>>> 5c49882b22b3a8314c6dfcc8c026456c887262fa
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;
Expand Down Expand Up @@ -35,8 +38,13 @@ public class LocalMultiTargetClassifier extends AbstractMultiLabelLearner
Classifier.class,
"moa.classifiers.trees.FIMTDD");

<<<<<<< HEAD
ArrayList<Classifier> classifiers = null;
ArrayList<InstancesHeader> headers = null;
=======
LinkedList<Classifier> classifiers = null;
LinkedList<InstancesHeader> headers = null;
>>>>>>> 5c49882b22b3a8314c6dfcc8c026456c887262fa

@Override
public boolean isRandomizable() {
Expand All @@ -53,7 +61,11 @@ private InstancesHeader getHeader(int target) {

private void makeHeaders() {
if (headers == null) {
<<<<<<< HEAD
headers = new ArrayList<InstancesHeader>();
=======
headers = new LinkedList<InstancesHeader>();
>>>>>>> 5c49882b22b3a8314c6dfcc8c026456c887262fa
for (int target = 0; target < getModelContext().numOutputAttributes(); target++) {
List<Attribute> attributes = new LinkedList<Attribute>();
List<Integer> indexValues = new LinkedList<Integer>();
Expand Down Expand Up @@ -100,6 +112,10 @@ public Prediction getPredictionForInstance(MultiLabelInstance inst) {
MultiLabelPrediction prediction = new MultiLabelPrediction(getModelContext().numOutputAttributes());
for (int j = 0; j < inst.numberOutputTargets(); j++) {
Instance STInst = getSTInstance(inst, j);
<<<<<<< HEAD
=======

>>>>>>> 5c49882b22b3a8314c6dfcc8c026456c887262fa
prediction.setVote(j, 1, classifiers.get(j).getVotesForInstance(STInst)[0]);
}
return prediction;
Expand All @@ -115,9 +131,15 @@ public void initializeClassifiers() {
this.classifierRandom.setSeed(1234);
if (classifiers == null) {
makeHeaders();
<<<<<<< HEAD
classifiers = new ArrayList<Classifier>();
for (int i = 0; i < getModelContext().numOutputAttributes(); i++) {
Classifier learner = ((Classifier) getPreparedClassOption(this.classifierOption)).copy();
=======
classifiers = new LinkedList<Classifier>();
for (int i = 0; i < getModelContext().numOutputAttributes(); i++) {
Classifier learner = (Classifier) getPreparedClassOption(this.classifierOption);
>>>>>>> 5c49882b22b3a8314c6dfcc8c026456c887262fa
classifiers.add(learner);
learner.resetLearning();
((AbstractClassifier) learner).classifierRandom = this.classifierRandom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public Prediction getPredictionForInstance(MultiLabelInstance inst) {
}
return new MultiLabelPrediction(prediction);
}
<<<<<<< HEAD

public Prediction getPredictionForInstanceUsingN(MultiLabelInstance inst, int n) {
int actual = Math.max(1, Math.min(n, this.ensemble.length));
Expand All @@ -111,6 +112,8 @@ public Prediction getPredictionForInstanceUsingN(MultiLabelInstance inst, int n)
}
return new MultiLabelPrediction(prediction);
}
=======
>>>>>>> 5c49882b22b3a8314c6dfcc8c026456c887262fa

@Override
public void trainOnInstanceImpl(MultiLabelInstance instance) {
Expand Down
Loading