ColumnDropper Class

Specified columns to drop from the dataset.

Inheritance
nimbusml.internal.core.preprocessing.schema._columndropper.ColumnDropper
ColumnDropper
nimbusml.base_transform.BaseTransform
ColumnDropper
sklearn.base.TransformerMixin
ColumnDropper

Constructor

ColumnDropper(columns=None, **params)

Parameters

Name Description
columns

a list of strings representing the column names to perform the transformation on.

The << operator can be used to set this value (see Column Operator)

For example

  • ColumnDropper(columns=['education', 'age'])

  • ColumnDropper() << ['education', 'age']

For more details see Columns.

params

Additional arguments sent to compute engine.

Examples


   ###############################################################################
   # ColumnDropper
   import numpy
   from nimbusml import FileDataStream
   from nimbusml.datasets import get_dataset
   from nimbusml.preprocessing.schema import ColumnDropper

   # data input (as a FileDataStream)
   path = get_dataset('infert').as_filepath()

   data = FileDataStream.read_csv(path, sep=',', numeric_dtype=numpy.float32)

   # transform usage
   xf = ColumnDropper(columns=['education', 'age'])

   # fit and transform
   features = xf.fit_transform(data)

   # print features
   print(features.head())
   #   case  induced  parity  pooled.stratum  row_num  spontaneous  stratum
   # 0   1.0      1.0     6.0             3.0      1.0          2.0      1.0
   # 1   1.0      1.0     1.0             1.0      2.0          0.0      2.0
   # 2   1.0      2.0     6.0             4.0      3.0          0.0      3.0
   # 3   1.0      2.0     4.0             2.0      4.0          0.0      4.0
   # 4   1.0      1.0     3.0            32.0      5.0          1.0      5.0

Methods

get_params

Get the parameters for this operator.

get_params

Get the parameters for this operator.

get_params(deep=False)

Parameters

Name Description
deep
Default value: False