Skip to content
Snippets Groups Projects
Commit 60ce0b50 authored by René Schöne's avatar René Schöne
Browse files

Begin with new learner interface.

parent c221cdeb
No related branches found
No related tags found
2 merge requests!4Dev,!2Learner url load
Pipeline #3559 passed
package de.tudresden.inf.st.eraser.feedbackloop.api;
import java.time.Instant;
/**
* This interface represents the connection from a machine learning model back to the knowledge base.
* It decodes the output of the machine learning model and outputs the result of the classification.
*
* @author rschoene - Initial contribution
*/
@SuppressWarnings("unused")
public interface MachineLearningDecoder {
/**
* Execute the machine learning model and returns the classification result.
* @return the result of the classification
*/
MachineLearningResult classify();
// less important
/**
* Returns the time when the model was last updated, i.e., when the last training was completed.
* @return the time when the model was last updated, or <code>null</code> if the model was not trained yet
*/
Instant lastModelUpdate();
}
package de.tudresden.inf.st.eraser.feedbackloop.api;
import de.tudresden.inf.st.eraser.jastadd.model.Item;
import de.tudresden.inf.st.eraser.jastadd.model.Root;
import java.util.List;
/**
* This interface represents the connection from knowledge base to one machine learning model.
* It takes information from the knowledge base, and encodes them to a representation that is readable both for
* the used technique and the purpose of the machine learning model.
*
* @author rschoene - Initial contribution
*/
@SuppressWarnings("unused")
public interface MachineLearningEncoder {
/**
* Update when new data is available.
* @param model The underlying model
* @param changedItems A list of items whose state has changed
*/
void newData(Root model, List<Item> changedItems);
// to be discussed, in which form this is specified
/**
* Get the items that this model is supposed to change.
* @return the list of targeted items
*/
List<Item> getTargets();
// to be discussed, in which form this is specified
/**
* Get the items which are relevant for the decision making of this model.
* @return the list of items relevant for decision making
*/
List<Item> getRelevantItems();
// to be discussed, if this is necessary
/**
* Explicit hint for this model to start/trigger training. The model might ignore this hint.
*/
void triggerTraining();
}
package de.tudresden.inf.st.eraser.feedbackloop.api;
import de.tudresden.inf.st.eraser.jastadd.model.ItemPreference;
import java.util.List;
/**
* Representation of a classification result using a MachineLearningModel.
*
* @author rschoene - Initial contribution
*/
@SuppressWarnings("unused")
public interface MachineLearningResult {
// Object rawClass();
// double rawConfidence();
// can be used for both activity and preferences
/**
* Get the result as a list of item preferences, i.e., new states to be set for those items.
* @return the classification result as item preferences
*/
List<ItemPreference> getPreferences();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment