This Library converts categorical data of any kind {integer, float, strings} into discrete values{1,2,3... # Classes}.
Project description
This package can be used to convert dataset into numerical categorical data. This can be utilized for the pre-processing of various kinds of data for many Machine Learning Models. There are various features available such as normalizing the data to make the data more useful for the model. This function will work on any kind of data in the DataFrame.
IMPORT:
from categorical_encode.categorical import categorical
The Parameters:-
dataframe: The Input DataFrame(X) which you want to categorically encode.
normalize: This parameter determines if it will be between 0-1(1 included) or 1 to no. of classes (1 - no. of classes). default:False
drop_columns: This specifies the dataframe columns that need to be dropped as they are useless. default: No Columns
drop_na: This drops empty values (NaN) if is set to True. default: False
target_columns: This creates the target DataFrame(Y) without applying any Encoding. default: No Columns
Return
This Returns Two DataFrame (X,Y) if target_columns are provided Else only the Input dataframe (X) which is encoded.
Example:
from categorical_encode.categorical import categorical
df = categorical(dataframe = df, normalize= True)
This returns df as categorically encoded column-wise for all the columns having values between 0-1(1 included).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file categorical_encode-0.2.1.tar.gz
.
File metadata
- Download URL: categorical_encode-0.2.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bdcdb4e19575a54973b2888452c020196822d51f12cb6a201e5038b1f703403 |
|
MD5 | 9ce06dc3dc09f4f16d8f84fa47c2c1ff |
|
BLAKE2b-256 | 93c7cce31d4ed1834eb2cfb238c412d23c0c0f0e9e5af108b7c82a9a66b66b5e |