-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArffDataset.h
71 lines (63 loc) · 1.88 KB
/
ArffDataset.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* \class ArffDataset
*
* \brief ARFF file format reader.
* http://www.cs.waikato.ac.nz/ml/weka/arff.html
*
* \sa Dataset
*
* \author Bill White
* \version 1.0
*
* Contact: [email protected]
* Created on: 2/24/11
*/
#ifndef ARFFDATASET_H
#define ARFFDATASET_H
#include <vector>
#include <map>
#include <string>
#include "Dataset.h"
/**
* \enum ArffAttributeType.
* ARFF attribute types.
*/
typedef enum
{
ARFF_NUMERIC_TYPE, /**< continuous levels */
ARFF_NOMINAL_TYPE, /**< discrete levels */
ARFF_STRING_TYPE, /**< string levels */
ARFF_DATE_TYPE, /**< date levels */
ARFF_ERROR_TYPE /**< unknown type */
} ArffAttributeType;
class ArffDataset : public Dataset
{
public:
ArffDataset();
/*************************************************************************\\**
* Get the ARFF data type of the attribute in columnIndex
* NOTE: only NOMINAL_TYPE is currently supported.
*
* \param [in] columnIndex SNP column index
* \return data type of the indexed variable
****************************************************************************/
ArffAttributeType GetTypeOf(unsigned int columnIndex);
/*************************************************************************\\**
* Print the nominals levels to stdout.
****************************************************************************/
void PrintNominalsMapping();
~ArffDataset() { ; }
private:
bool LoadSnps(std::string filename);
/// ARFF relation name
std::string relationName;
/// vector of attribute types
std::vector<ArffAttributeType> attributeTypes;
/// map of attribute names to valid nominal values
std::map<std::string, std::vector<std::string> > nominalValues;
/// missing class values
std::vector<std::string> missingClassValuesToCheck;
/// missing attribute values
std::vector<std::string> missingAttributeValuesToCheck;
};
#endif /* ARFFDATASET_H */