org.android.activityminer.logic.classification
Class ModelCreationHelper

Package class diagram package ModelCreationHelper
java.lang.Object
  extended by de.unikassel.android.sdcframework.util.ObservableEventSourceImpl<ObservableProgressData>
      extended by org.android.activityminer.logic.classification.ModelCreationHelper
All Implemented Interfaces:
ObservableEventSource<ObservableProgressData>, ObserverRegistration<ObservableProgressData>

public class ModelCreationHelper
extends ObservableEventSourceImpl<ObservableProgressData>

A class to delegate model creation to.


Field Summary
private  Configuration config
          The current configuration.
private  Context context
          The application context.
private  DBManager dbManager
          A reference to the database manager.
private  String lastError
          The last error
private  android.support.v4.util.LongSparseArray<List<Long>> mapSelectedClassId2SampleIds
          A map to store sample (feature vector) identifiers for the selected lass identifiers
private  String modelName
          The model name
private  PMML pmmlModel
          The created PMML model.
private  int progress
          The current progress.
private  ObservableProgressData progressData
          The observable progress data
private  int sampleCount
          Progress increment for standard operations like partitioning and data loading.
private  boolean succeeded
          The success state flag
private  Set<TrainingActivity> trainingActivites
          The training activities for evaluation.
 
Constructor Summary
ModelCreationHelper(DBManager dbManager, Configuration config, String modelName, Context context)
          Constructor
 
Method Summary
 boolean createModel()
          Does run the model creation
 String getLastError()
          Getter for the last error
 int getMaxProgress()
          Getter for the maximum progress
 Object getModelName()
          Getter for the model name
 String getStartProgressMessage()
          Getter for the start progress message
 boolean hasSucceeded()
          Getter for the success flag
 android.support.v4.util.LongSparseArray<String> loadSamples(Set<FeatureTypes> visibleAttributes)
          Does load available samples as feature vectors from DB and creates the partitioning for k-fold cross validation.
 boolean saveModel()
          Method to store model.
 void updateProgress(String msg)
          Does publish the current progress with the given message.
 
Methods inherited from class de.unikassel.android.sdcframework.util.ObservableEventSourceImpl
getObservers, hasObservers, notify, onObserverRegistration, onObserverUnregistration, registerEventObserver, removeAllObservers, unregisterEventObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbManager

private final DBManager dbManager
A reference to the database manager.


config

private Configuration config
The current configuration.


sampleCount

private int sampleCount
Progress increment for standard operations like partitioning and data loading.


trainingActivites

private Set<TrainingActivity> trainingActivites
The training activities for evaluation.


progressData

private final ObservableProgressData progressData
The observable progress data


progress

private int progress
The current progress.


succeeded

private boolean succeeded
The success state flag


lastError

private String lastError
The last error


modelName

private final String modelName
The model name


mapSelectedClassId2SampleIds

private final android.support.v4.util.LongSparseArray<List<Long>> mapSelectedClassId2SampleIds
A map to store sample (feature vector) identifiers for the selected lass identifiers


context

private final Context context
The application context.


pmmlModel

private PMML pmmlModel
The created PMML model.

Constructor Detail

ModelCreationHelper

public ModelCreationHelper(DBManager dbManager,
                           Configuration config,
                           String modelName,
                           Context context)
Constructor

Parameters:
dbManager - a reference to the database manager
config - the current configuration
modelName - the model name
context - the application context
Method Detail

hasSucceeded

public final boolean hasSucceeded()
Getter for the success flag

Returns:
the success flag

getLastError

public final String getLastError()
Getter for the last error

Returns:
the last error

getMaxProgress

public final int getMaxProgress()
Getter for the maximum progress

Returns:
the maximum progress steps

createModel

public final boolean createModel()
Does run the model creation

Returns:
true if successful, false otherwise

saveModel

public final boolean saveModel()
Method to store model.

Returns:
true if successful, false otherwise

loadSamples

public final android.support.v4.util.LongSparseArray<String> loadSamples(Set<FeatureTypes> visibleAttributes)
                                                                  throws Exception
Does load available samples as feature vectors from DB and creates the partitioning for k-fold cross validation.

Parameters:
visibleAttributes - the visible attributes
Returns:
the class identifier to name mapping
Throws:
Exception

updateProgress

public final void updateProgress(String msg)
Does publish the current progress with the given message.

Parameters:
msg - the progress message

getStartProgressMessage

public String getStartProgressMessage()
Getter for the start progress message

Returns:
the start message for progress observation

getModelName

public Object getModelName()
Getter for the model name

Returns:
the model name