Skip to main content

For selecting the optimal features using the stepwise algorithm

Project description

Stepwise Selection

Select the optimal features in a dataset using the stepwise method.

Instructions

  1. Install:

pip install Selection_Method

  1. Plug in your train and test dataset, and your preferred algorithm.

Forward_Stepwise

from Selection_Method.Forward_Stepwise import forward_stepwise

initialize forward_stepwise object, inputting your already split train and test dataframes, and your already created regression model object.

selection = forward_stepwise(x_train, x_test, y_train, y_test, linear_model)

select the best features using the stepwise algorithm through the .select() method.

final_list, final_score = selection.select()

Backward_Stepwise

from Selection_Method.Backward_Stepwise import backward_stepwise

initialize backward_stepwise object, inputting your already split train and test dataframes, and your already created regression model object.

selection = backard_stepwise(x_train, x_test, y_train, y_test, linear_model)

select the best features using the stepwise algorithm through the .select() method.

final_list, final_score = selection.select()

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

Selection_Method-0.0.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

Selection_Method-0.0.2-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

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