Skip to main content

A python package to handle EDA and feature extraction and also return the best hyperparameters for a tabular classification problem.

Project description

EDA FEATURE_EXTRACTOR MODEL

A python package to do EDA, feature selection and display the best hyperparameters for a pre-built classification model.

Useful for datasets with no NaNs or null values present. Can be used for normal classification tasks, next update will work for Regression type problems and incorporate a sorted arrangement of variables.

before utilizing the package, ensure no Null or NaN values remain.

pip install eda-fe-model

pip install eda-fe-model==0.3.2

Using the library

from eda_fe_model import package

package.EDA()
package.feature_extraction()

Use to_categorical from keras.utils, to One Hot Encode the labels

package.build_best_model()
package.model_create()

EDA

package.EDA accepts the following:

        dataset = pandas dataframe
        columns_drop = columns to drop as a list. Accepts None
        one_hot_encode = True/False
        label_encode = True/False
        normalize = True/False
        standardize = True/False
        target_varaible = single target, y, as array
        test_size = percentage of the dataset to be used for testing purposes
        random_state

If the dataset only consists of categorical variables, set normalize or standardize to True.

returns the splitted dataset: x_train, x_test, y_train, y_test (respectively)

FEATURE EXTRACTION

package.feature_extraction accepts the following:

        train_X = train dataset consisting of predictors
        train_Y = train labels
        test_X = test dataset consisting of predictors
        test_Y = test labels
        rfe = True/False; Do you want to use Random Feature Extractor
        dim_out = Used only if rfe=True; output dimension; number of features to be selected 
        distribution = Distibution of the dataset you want to use for GLM

If rfe is False, set dim_out and distribution to be None, to return the input x and y for train and test datasets.
Try changing the distribution if error due to convergence appear.

returns x_train and x_test datasets with the user entered dimension/predictors

BUILD BEST MODEL

package.build_best_model accepts the follwoing:

        x = train dataset consisting of predictors
        y = One HOt Encoded training labels

returns a RandomizedSearchCV object.

Best Score: results.best_score_
Best Parameters: results.best_params_

CREATING THE MODEL

package.model_create accpets the best parameters from the build_best_model() and runs the model for a user specified epochs.

        x = the new train dataset consisting of just the predictors.
        y = One Hot encoded training labels

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eda-fe-model-0.3.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eda_fe_model-0.3.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file eda-fe-model-0.3.2.tar.gz.

File metadata

  • Download URL: eda-fe-model-0.3.2.tar.gz
  • Upload date:
  • Size: 5.5 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.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for eda-fe-model-0.3.2.tar.gz
Algorithm Hash digest
SHA256 9a23c282e626be0111ce495f3a137706d4e32577abc66835dc798e33faf33cd8
MD5 8866987956ddfa441ebf989405e29658
BLAKE2b-256 3df0a92a5a5dcca0387c29afe0541525f510fc6fec0a0cc2f71ecc0d537b2612

See more details on using hashes here.

File details

Details for the file eda_fe_model-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: eda_fe_model-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for eda_fe_model-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 041579277e70ce04002413b9204c67a6fd33514e582fc25080c59dfde75740b1
MD5 7f66ef6e4ab653a4285fe36aa2d58f47
BLAKE2b-256 c5836d5c5caece2dda3accd868e35b877aecea8137d9fa95bc3cc5695288d197

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page