Package adams.data.binning
Class BinnableDataset
- java.lang.Object
-
- adams.data.binning.BinnableDataset
-
public class BinnableDataset extends Object
Helper class for binning Datasets.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBinnableDataset.ClassValueBinValueExtractorUses the specified class value as bin value.static classBinnableDataset.GroupedClassValueBinValueExtractorUses the class value of the first data row in the group as bin value.static classBinnableDataset.StringAttributeGroupExtractorGroup extractor for string columns.
-
Constructor Summary
Constructors Constructor Description BinnableDataset()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Binnable<DataRow>>toBinnableUsingClass(SpreadSheet data, int index)Turns Rows into a list of binnables using the class value.static List<Binnable<DataRow>>toBinnableUsingIndex(SpreadSheet data)Turns Rows into a list of binnables using the data row index.static DatasettoDataset(List<Binnable<DataRow>> list)Turns a binnable list back into Rows.static SpreadSheettoSpreadSheet(List<Binnable<DataRow>> list)Turns a binnable list back into Rows.
-
-
-
Method Detail
-
toBinnableUsingClass
public static List<Binnable<DataRow>> toBinnableUsingClass(SpreadSheet data, int index) throws Exception
Turns Rows into a list of binnables using the class value.- Parameters:
data- the data rows to convertindex- the index of the column to act as class- Returns:
- the generated list
- Throws:
Exception- if extraction of class value fails
-
toBinnableUsingIndex
public static List<Binnable<DataRow>> toBinnableUsingIndex(SpreadSheet data) throws Exception
Turns Rows into a list of binnables using the data row index.- Parameters:
data- the data rows to convert- Returns:
- the generated list
- Throws:
Exception- if extraction of index fails
-
toDataset
public static Dataset toDataset(List<Binnable<DataRow>> list)
Turns a binnable list back into Rows.- Parameters:
list- the list to convert- Returns:
- the generated data rows
-
toSpreadSheet
public static SpreadSheet toSpreadSheet(List<Binnable<DataRow>> list)
Turns a binnable list back into Rows.- Parameters:
list- the list to convert- Returns:
- the generated data rows
-
-