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

Code reorganization #183

wants to merge 41 commits into from

Conversation

aosojnik
Copy link
Contributor

  • Reorganized learners
    The learners are now grouped together in the learners package. It is further divided into clusterers and predictors. All tasks now have separate interfaces (Classifier, Regressor, MultiLabelClassifier, MultiTargetRegressor, as well as semi-supervised versions) which all extend the InstanceLearner interface - most of the methods have been moved here and have been standardized. In particular, there is only one Instance type (MultiLabelInstance has been merged into Instance) and all predictors return a Prediction object (getVotesForInstance has been replaced with getPredictionForInstance).

  • Predictions rework
    Each predictive task now has its own prediction, all implement the Prediction interface. Predictions also have convenience methods to convert them to doubles or double arrays, whichever is appropriate.

  • Extracted abstract methods
    Where applicable, I've extracted the abstract parts of classes - most notably for ensemble methods. For example, AbstractOzaBag now covers the logic of online bagging regardless of the task, while individual OzaBag classes fill in the missing details, e.g., combination of predictions. There are now more OzaBag classes, one for each task (classification, regression, etc.). They are organized in subpackages such that there is no need for OzaBagClassification or OzaBagRegression, etc. - this is also supposed to lead to a better user experience.

  • Reorganized tasks
    In a similar way, I've also extracted abstract parts of the tasks - resulting in, e.g., AbstractEvaluatePrequential, which codes most of the behaviour of the prequential evaluation. Each learner type then has it's own implementation of the details. This is not very extensive as there are many classification-based tasks which have not yet been used for other predictive modelling tasks.

  • Core multi-label and multi-target classes reorganization
    Many core multi-label and multi-target classes (such as attribute class observers, split criteria, etc.) had been located in the rules.multilabel subpackage. I moved them into the appropriate subpackages in the core package. Notably, a lot of these were tied directly to the implementation of AMRules, making them less reusable by other methods. I would urge the current maintainer of AMRules to make these classes more usable.

  • Merging of Instances and InstancesHeader
    I merged the Instances and InstancesHeader classes as they mostly provided the same functionality, with one just omitting the actual reference to the Instances. An empty header can now be retrieved by using the getEmtpyHeader method.

  • ArffLoader rework
    ArffLoader and ArffFileStream have reworked to allow for easier selection of input and output attributes. Multiple output attributes can now be selected as a list or a range. I also added support for shortcuts such as -1, -2, etc. By default all non-output attributes are selected, but the input attributes can also be fine tuned in the same way as the output attributes. InstanceInformation and AttributeInformation have been adjusted accordingly.

aosojnik and others added 30 commits November 9, 2015 14:23
Conflicts:
	moa/src/main/java/moa/classifiers/core/conditionaltests/NumericAttributeBinaryTest.java
	moa/src/main/java/moa/classifiers/multilabel/LocalMultiTargetClassifier.java
	moa/src/main/java/moa/classifiers/multilabel/meta/MTOzaBag.java
	moa/src/main/java/moa/classifiers/multilabel/trees/ISOUPTree.java
	moa/src/main/java/moa/classifiers/trees/FIMTDD.java
	moa/src/main/java/moa/classifiers/trees/ORTO.java
	moa/src/main/java/moa/tasks/EvaluatePrequentialMultiTarget.java
from the 2015.10 prerelease version, so the pom files were updated back
to the 2014.04 version)
from the 2015.10 prerelease version, so the pom files were updated back
to the 2014.04 version)
aosojnik and others added 11 commits June 14, 2017 11:58
Waikato-master

# Conflicts:
#	moa/src/main/java/com/yahoo/labs/samoa/instances/Attribute.java
#	moa/src/main/java/com/yahoo/labs/samoa/instances/InstanceImpl.java
#	moa/src/main/java/moa/classifiers/multilabel/MultilabelHoeffdingTree.java
#	moa/src/main/java/moa/classifiers/multilabel/trees/ISOUPTree.java
#	moa/src/main/java/moa/classifiers/trees/FIMTDD2.java
#	moa/src/main/java/moa/classifiers/trees/ORTO2.java
#	moa/src/main/java/moa/clusterers/clustree/ClusTree.java
#	moa/src/main/java/moa/tasks/EvaluatePeriodicHeldOutTest.java
#	moa/src/main/java/moa/tasks/EvaluatePrequentialMultiTarget.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants