Skip to main content

PymRMRe

Description

Feature selection is one of the main challenges in analyzing high-throughput genomic data. Minimum redundancy maximum relevance (mRMR) is a particularly fast feature selection method for finding a set of both relevant and complementary features. The Pymrmre package, extend the mRMR technique by using an ensemble approach to better explore the feature space and build more robust predictors. To deal with the computational complexity of the ensemble approach, the main functions of the package are implemented and parallelized in C++ using openMP Application Programming Interface. The package also supports making best selections with some fixed-selected features.

Prerequisite

Python(>=3.6.0)
Cython(>=0.29.12)
numpy(>=1.16.4)
pandas(>=0.25.0)

Installation

pip install Pymrmre

Insturctions

Two primary functions are provided in this package currently:

  • mrmr_ensemble: It provides the ensemble (multiple) solutions of feature selection given the input of feature dataset and target column, it supports the feature selection with preselection as well.

    • :param features: Pandas dataframe, the input dataset
    • :param targets: Pandas dataframe, the target features
    • :param fixed_features: List, the list of fixed features (column names), the default is empty list
    • :param category_features: List, the list of features whose types are categorical (column names), the default is empty list
    • :param solution_length: Integer, the number of features contained in one solution
    • :param solution_count: Integer, the number of solutions to be returned, the default is 1
    • :param estimator: String, the way of computing continuous estimators, the default is Pearson
    • :param return_index: Boolean, to determine whether the solution contains the indices or column names of selected features, the default is False
    • :param return_with_fixed: Boolean, to determine whether the solution contains the fixed selected features, the default is True
    • :return: Pandas series, the solutions of selected features
  • mrmr_ensemble_survival: It provides the ensemble (multiple) solutions of feature selection given the input of feature dataset and target column, it supports the feature selection with preselection as well.

    • :param features: Pandas dataframe, the input dataset
    • :param targets: Pandas dataframe, the target features, it must have two columns (event and time of survival data)
    • :param fixed_features: List, the list of fixed features (column names), the default is empty list
    • :param category_features: List, the list of features whose types are categorical (column names), the default is empty list
    • :param solution_length: Integer, the number of features contained in one solution
    • :param solution_count: Integer, the number of solutions to be returned, the default is 1
    • :param estimator: String, the way of computing continuous estimators, the default is Pearson
    • :param return_index: Boolean, to determine whether the solution contains the indices or column names of selected features, the default is False
    • :param return_with_fixed: Boolean, to determine whether the solution contains the fixed selected features, the default is True
    • :return: Pandas series, the solutions of selected features

Example code:

import pandas as pd
from Pymrmre import mrmr

Load the input data and target variable, suppose for input X we have ten features (f1, f2, ..., f10):

X = pd.read_csv('train_x.csv')
Y = pd.read_csv('train_y.csv')

Suppose we want to generate 3 solutions, where each solution has 5 features. We want to see f1 exists in all solutions (preselection), and we know that f4 and f5 are categorical variables as well, the code should be like this:

solutions = mrmr.mrmr_ensemble(features=X,targets=Y,fixed_features=['f1'],category_features=['f4','f5'],solution_length=5,solution_count=3)

Because the solution we generated is of the type Pandas series, which has the target variable name as column header. To access the contents of all three solutions, the code is like this:

solutions.iloc[0]

To access one of the solutions, the code is like this (i is 0 - 2 here since we generate 3 solutions here):

solutions.iloc[0][i]

Release files for pymrmre 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymrmre 1.0.2
File Size Uploaded
pymrmre-1.0.2.tar.gz 18.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pymrmre 1.0.2
File Interpreter ABI Platform
pymrmre-1.0.2-py3.8-linux-x86_64.egg Legacy Egg format - - Details
pymrmre-1.0.2-py3.7-linux-x86_64.egg Legacy Egg format - - Details

Total release size: 19.3 MB

Release files / pymrmre-1.0.2.tar.gz

Download URL pymrmre-1.0.2.tar.gz
Size 18.5 MB
Tags Source
SHA-256 checksum
How to use checksums
325fd17a99a9d65793257c852a35c896ad11c6b5f22b7a588b76e3fb67e7eb52
BLAKE2b-256 checksum
How to use checksums
9e3fced09b595c62f36608fa56caf98fffe4ab2add9311d822f3a7dfed02eb85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / pymrmre-1.0.2-py3.8-linux-x86_64.egg

Download URL pymrmre-1.0.2-py3.8-linux-x86_64.egg
Size 359.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
905f7af77b4ef0dcaa9c511736baf2fb240f9ad24cbd4c7ac1ef2a96c574556b
BLAKE2b-256 checksum
How to use checksums
7e6b8d4c14f10641862437571d4bd8fc984db2d1f4dbe3ed665fd6ccb3d0f422
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

Release files / pymrmre-1.0.2-py3.7-linux-x86_64.egg

Download URL pymrmre-1.0.2-py3.7-linux-x86_64.egg
Size 428.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
bd318a92e598ed35f01be68d1f037f12d90e8b357376b4fef6a6c7b60d430dee
BLAKE2b-256 checksum
How to use checksums
56433f0809d3f5c1e5cb399c1e64f13701bb8275125dacc3617cf58ce916df08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release history Release notifications | RSS feed

1.0.7

11 release files

1.0.6

11 release files

1.0.5

11 release files

1.0.3

11 release files

This release

1.0.2 This release

3 release files

1.0.0

4 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page