Package adams.data.io.input
Class ImageClassificationSpreadSheetReportReader
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractReportReader<Report>
-
- adams.data.io.input.ImageClassificationSpreadSheetReportReader
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,FileFormatHandler,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<AbstractReportReader>,SizeOfHandler,Stoppable,StoppableWithFeedback,ReportReader<Report>,Serializable,Comparable
public class ImageClassificationSpreadSheetReportReader extends AbstractReportReader<Report>
Retrieves the label with the highest score from the spreadsheet and stores them in a report.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-input <adams.core.io.PlaceholderFile> (property: input) The file to read and turn into a report. default: ${CWD}-reader <adams.data.io.input.SpreadSheetReader> (property: reader) The spreadsheet reader to use. default: adams.data.io.input.CsvSpreadSheetReader -data-row-type adams.data.spreadsheet.DenseDataRow -spreadsheet-type adams.data.spreadsheet.DefaultSpreadSheet
-column-label <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: columnLabel) The spreadsheet column containing the label. default: first example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-column-score <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: columnScore) The spreadsheet column containing the score. default: second example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-field-label <adams.data.report.Field> (property: fieldLabel) The field to store the label under. default: Classification[S]
-field-score <adams.data.report.Field> (property: fieldScore) The field to store the score under. default: Score[N]
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SpreadSheetColumnIndexm_ColumnLabelthe column with the label.protected SpreadSheetColumnIndexm_ColumnScorethe column with the score.protected Fieldm_FieldLabelthe report field to store the label under.protected Fieldm_FieldScorethe report file to store the score under.protected SpreadSheetReaderm_Readerthe spreadsheet reader to use.-
Fields inherited from class adams.data.io.input.AbstractReportReader
m_Input, m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ImageClassificationSpreadSheetReportReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcolumnLabelTipText()Returns the tip text for this property.StringcolumnScoreTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected intdetermineParentID(Report report)Tries to determine the parent ID for the current report.StringfieldLabelTipText()Returns the tip text for this property.StringfieldScoreTipText()Returns the tip text for this property.SpreadSheetColumnIndexgetColumnLabel()Returns the column containing the label.SpreadSheetColumnIndexgetColumnScore()Returns the column containing the score.FieldgetFieldLabel()Returns the field for the label.FieldgetFieldScore()Returns the field for the score.StringgetFormatDescription()Returns a string describing the format (used in the file chooser).String[]getFormatExtensions()Returns the extension(s) of the format.SpreadSheetReadergetReader()Returns the spreadsheet reader to use.StringglobalInfo()Returns a string describing the object.ReportnewInstance()Returns a new instance of the report class in use.protected List<Report>readData()Performs the actual reading.StringreaderTipText()Returns the tip text for this property.voidsetColumnLabel(SpreadSheetColumnIndex value)Sets the column containing the label.voidsetColumnScore(SpreadSheetColumnIndex value)Sets the column containing the score.voidsetFieldLabel(Field value)Sets the field for the label.voidsetFieldScore(Field value)Sets the field for the score.voidsetReader(SpreadSheetReader value)Sets the spreadsheet reader to use.-
Methods inherited from class adams.data.io.input.AbstractReportReader
checkData, cleanUp, compareTo, destroy, equals, forCommandLine, forName, getDefaultFormatExtension, getInput, getReaders, inputTipText, isStopped, postRead, read, reset, setInput, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Reader
protected SpreadSheetReader m_Reader
the spreadsheet reader to use.
-
m_ColumnLabel
protected SpreadSheetColumnIndex m_ColumnLabel
the column with the label.
-
m_ColumnScore
protected SpreadSheetColumnIndex m_ColumnScore
the column with the score.
-
m_FieldLabel
protected Field m_FieldLabel
the report field to store the label under.
-
m_FieldScore
protected Field m_FieldScore
the report file to store the score under.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractReportReader<Report>
-
setReader
public void setReader(SpreadSheetReader value)
Sets the spreadsheet reader to use.- Parameters:
value- the reader
-
getReader
public SpreadSheetReader getReader()
Returns the spreadsheet reader to use.- Returns:
- the reader
-
readerTipText
public String readerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColumnLabel
public void setColumnLabel(SpreadSheetColumnIndex value)
Sets the column containing the label.- Parameters:
value- the column
-
getColumnLabel
public SpreadSheetColumnIndex getColumnLabel()
Returns the column containing the label.- Returns:
- the column
-
columnLabelTipText
public String columnLabelTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColumnScore
public void setColumnScore(SpreadSheetColumnIndex value)
Sets the column containing the score.- Parameters:
value- the column
-
getColumnScore
public SpreadSheetColumnIndex getColumnScore()
Returns the column containing the score.- Returns:
- the column
-
columnScoreTipText
public String columnScoreTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFieldLabel
public void setFieldLabel(Field value)
Sets the field for the label.- Parameters:
value- the field
-
getFieldLabel
public Field getFieldLabel()
Returns the field for the label.- Returns:
- the field
-
fieldLabelTipText
public String fieldLabelTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFieldScore
public void setFieldScore(Field value)
Sets the field for the score.- Parameters:
value- the field
-
getFieldScore
public Field getFieldScore()
Returns the field for the score.- Returns:
- the field
-
fieldScoreTipText
public String fieldScoreTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescriptionin interfaceFileFormatHandler- Specified by:
getFormatDescriptionin classAbstractReportReader<Report>- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensionsin interfaceFileFormatHandler- Specified by:
getFormatExtensionsin classAbstractReportReader<Report>- Returns:
- the extension(s) (without the dot!)
-
determineParentID
protected int determineParentID(Report report)
Tries to determine the parent ID for the current report.- Specified by:
determineParentIDin classAbstractReportReader<Report>- Parameters:
report- the report to determine the ID for- Returns:
- the parent database ID, -1 if it cannot be determined
-
newInstance
public Report newInstance()
Returns a new instance of the report class in use.- Specified by:
newInstancein classAbstractReportReader<Report>- Returns:
- the new (empty) report
-
readData
protected List<Report> readData()
Performs the actual reading.- Specified by:
readDatain classAbstractReportReader<Report>- Returns:
- the reports that were read
-
-