Skip to main content

A python package for automated feature selection

Project description

Statistical Processing of attributes via Recursive Cross Elimination

SPARCE

The sparce software is a statistical machine learning software that automates feature seleciton in genomics data files. The software was originally outiftted for general use in genetics, transcirptomics, methylomics and ATAC-seq data.

Installation

conda create -n sparce pip
conda activate sparce
pip install sparce

HOW TO RUN

'''
Run inside script
'''


import sparce
import pandas as pd
from sklearn.preprocessing import OrdinalEncoder

def preprocess(file): 
  X = pd.read_csv('file')
  enc = OrdinalEncoder()
  enc.fit(X['a column in X'])
  X['a column in X'] = enc.transform(X['a column in X'])
  y = X['a column in X']
  X = X.drop('a column in X', axis = 1)
  
  return X,y

X, y = preprocess(file)

nFeatures = 5
nJobs = 10

CV = sparce.feature_selection.grade_features(X = X, y = y, nFeatures = nFeatures , nJobs = nJobs)

CLI

Clone the repository and re-invoke the main function. import args_parse into the sparce.py Ready to run in the cli

python sparce.py -x <file> -y <target> -nFeatures <int> -nJobs <int>

conda deactivate sparce

sparce assumptions

The data is in tidy format where (Features x samples) with a column labeled "target" The features are continuous attributes in a classificaiton problem The classes are mutually exclusive nFeatures > nSamples, you are attempting to reduce the dimensionality of the problem to produce nSamples > nFeatures

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

sparce-0.1.14.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

sparce-0.1.14-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file sparce-0.1.14.tar.gz.

File metadata

  • Download URL: sparce-0.1.14.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7

File hashes

Hashes for sparce-0.1.14.tar.gz
Algorithm Hash digest
SHA256 9967298e1f75b15aee455e94452e54ac6708137e947e9b2615a0e38a6a1a907a
MD5 7ef07d6043c7a374c0d026d7b1c91c0c
BLAKE2b-256 5d7f1e587a4a1a08b9aa17fcf9465510e9e28e55cfc56eee9ce60b454eff1628

See more details on using hashes here.

File details

Details for the file sparce-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: sparce-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7

File hashes

Hashes for sparce-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 9fe8dea7c3a5ebc29242840f19b4c72141b47413de1d63ffbd2c974a283623d2
MD5 b27c9bf3a9fcebe83c51a53a6d84364e
BLAKE2b-256 340e96f2abd5687710ee44553250f9b0e35830864811080347c29ea390d42221

See more details on using hashes here.

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