Skip to content

Commit

Permalink
Add OrdinalEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
toandaominh1997 committed Aug 3, 2021
1 parent c792b80 commit 2946fc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pipelineservice/preprocessing/_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.preprocessing import PolynomialFeatures, QuantileTransformer, PowerTransformer, KBinsDiscretizer, KernelCenterer
from sklearn.preprocessing import StandardScaler, RobustScaler, LabelEncoder, MinMaxScaler
from sklearn.preprocessing import StandardScaler, RobustScaler, LabelEncoder, MinMaxScaler, OrdinalEncoder

class polynomialFeatures(PolynomialFeatures):
def transform(self, X):
Expand Down Expand Up @@ -35,6 +35,10 @@ def transform(self, X):
data = super().transform(X)
return pd.DataFrame(data, columns = X.columns, index = X.index)

class ordinalEncoder(OrdinalEncoder):
def transform(self, X):
data = super().transform(X)
return pd.DataFrame(data, columns = X.columns, index = X.index)
class labelEncoder(LabelEncoder):
def transform(self, X):
data = super().transform(X)
Expand Down

0 comments on commit 2946fc6

Please sign in to comment.