Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Orange/preprocess/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def __call__(self, data):


class Continuize(Preprocess):
(Indicators, FirstAsBase, FrequentAsBase,Remove, RemoveMultinomial,
(Indicators, FirstAsBase, FrequentAsBase, Remove, RemoveMultinomial,
ReportError, AsOrdinal, AsNormalizedOrdinal, Leave) = Enum(
"Continuize",
"Indicators, FirstAsBase, FrequentAsBase,"
"Remove, RemoveMultinomial, ReportError, AsOrdinal,"
"AsNormalizedOrdinal, Leave")
"Continuize",
"Indicators, FirstAsBase, FrequentAsBase,"
"Remove, RemoveMultinomial, ReportError, AsOrdinal,"
"AsNormalizedOrdinal, Leave")

def __init__(self, zero_based=True,
multinomial_treatment=Indicators):
Expand Down Expand Up @@ -288,9 +288,9 @@ def __call__(self, data):
for a in data.domain.attributes if a.is_continuous):
# Skip normalization for data sets where all features are marked as already normalized.
# Required for SVMs (with normalizer as their default preprocessor) on sparse data to
# retain sparse structure. Normalizing sparse data would otherwise result in a dense matrix,
# which requires too much memory. For example, this is used for Bag of Words models where
# normalization is not really needed.
# retain sparse structure. Normalizing sparse data would otherwise result in a dense
# matrix, which requires too much memory. For example, this is used for Bag of Words
# models where normalization is not really needed.
return data
normalizer = normalize.Normalizer(
zero_based=self.zero_based,
Expand Down Expand Up @@ -403,8 +403,8 @@ class _MethodEnum(Enum):
def __call__(self, *args, **kwargs):
return getattr(Scale, '_' + self.name)(*args, **kwargs)

CenteringType = _MethodEnum('Scale', 'NoCentering, Mean, Median', type=int)
ScalingType = _MethodEnum('Scale', 'NoScaling, Std, Span', type=int)
CenteringType = _MethodEnum('Scale', 'NoCentering, Mean, Median')
ScalingType = _MethodEnum('Scale', 'NoScaling, Std, Span')
NoCentering, Mean, Median = CenteringType
NoScaling, Std, Span = ScalingType

Expand Down