-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from openml/smartimputer
Smartimputer
- Loading branch information
Showing
16 changed files
with
20,346 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from .functions import (list_datasets, check_datasets_active, | ||
get_datasets, get_dataset) | ||
from .dataset import OpenMLDataset | ||
from .data_feature import OpenMLDataFeature | ||
|
||
__all__ = ['check_datasets_active', 'get_dataset', 'get_datasets', | ||
'OpenMLDataset', 'list_datasets'] | ||
'OpenMLDataset', 'OpenMLDataFeature', 'list_datasets'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
class OpenMLDataFeature(object): | ||
"""Data Feature (a.k.a. Attribute) object. | ||
Parameters | ||
---------- | ||
index : int | ||
The index of this feature | ||
name : str | ||
Name of the feature | ||
data_type : str | ||
can be nominal, numeric, string, date (corresponds to arff) | ||
nominal_values : list(str) | ||
list of the possible values, in case of nominal attribute | ||
number_missing_values : int | ||
""" | ||
LEGAL_DATA_TYPES = ['nominal', 'numeric', 'string', 'date'] | ||
|
||
def __init__(self, index, name, data_type, nominal_values, number_missing_values): | ||
if type(index) != int: | ||
raise ValueError('Index is of wrong datatype') | ||
if data_type not in self.LEGAL_DATA_TYPES: | ||
raise ValueError('data type should be in %s, found: %s' %(str(self.LEGAL_DATA_TYPES),data_type)) | ||
if nominal_values is not None and type(nominal_values) != list: | ||
raise ValueError('Nominal_values is of wrong datatype') | ||
if type(number_missing_values) != int: | ||
raise ValueError('number_missing_values is of wrong datatype') | ||
|
||
self.index = index | ||
self.name = str(name) | ||
self.data_type = str(data_type) | ||
self.nominal_values = nominal_values | ||
self.number_missing_values = number_missing_values | ||
|
||
def __str__(self): | ||
return "[%d - %s (%s)]" %(self.index, self.name, self.data_type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ liac-arff>=2.1.1dev | |
xmltodict | ||
nose | ||
requests | ||
scikit-learn | ||
scikit-learn>=0.18 | ||
nbformat |
Oops, something went wrong.