You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a variety of applications in which zero-indexing would be preferred for the OrdinalEncoder. One example is preparing features for a PyTorch model with categorical embeddings, in which case the ordinal label is used to slice dimensions of an embedding matrix. Note also that the sklearn OrdinalEncoder is zero-indexed.
One could possibly add an argument to init() that specifies the indexing (e.g., self.index_start), so that the ordinal_encoding() method can do something like:
data = pd.Series(index=index, data=range(self.index_start, len(index) + self.index_start))
Actual Behavior
The ordinal_encoding() method imposes one-indexing in this line:
data = pd.Series(index=index, data=range(1, len(index) + 1))
Specifications
Version: 2.2.2
The text was updated successfully, but these errors were encountered:
Expected Behavior
There are a variety of applications in which zero-indexing would be preferred for the OrdinalEncoder. One example is preparing features for a PyTorch model with categorical embeddings, in which case the ordinal label is used to slice dimensions of an embedding matrix. Note also that the sklearn OrdinalEncoder is zero-indexed.
One could possibly add an argument to init() that specifies the indexing (e.g., self.index_start), so that the ordinal_encoding() method can do something like:
data = pd.Series(index=index, data=range(self.index_start, len(index) + self.index_start))
Actual Behavior
The ordinal_encoding() method imposes one-indexing in this line:
data = pd.Series(index=index, data=range(1, len(index) + 1))
Specifications
The text was updated successfully, but these errors were encountered: