Giter VIP home page Giter VIP logo

bioinformatics's Introduction

Bioinformatics

Bioinformatics stuff that I am working on

Feature Selection

rf.features.py

This is a simple script to extract important features from a dataset via entropy. This script creates multiple decision trees with entropy gain formula. In a project, using this algorithm, I have extracted most important 20 genes from a dataset containing about 60.000 thousand genes. Using those 20 genes commonly used classfication algorithms could identify each sample up to '95 >' accuracy. Any number of labels and features can be used with this script.

Output of the script is a csv file containing features and their total number of occurrences within all created trees.

To run the script, clone the repo with git, or just download it directly.

git clone https://github.com/kcanakdag/Bioinformatics

Install the required packages with pip:

pip3 install -r requirements.txt

After installing the required packages you can test the script by running the following command;

python rf_features.py -h

Parameters

-i is a str, the input parameter, it is required and should be a path to a .csv dataset.

-min is an int, the amount of minimum samples required to classify a dataset in decision tree. Lower values may lead to overfitting. Default is 10.

-nf is an int, Number of features randomly selected with each decision tree training. So if you have a lot of features, randomly selecting a number of them shortens the time required to create decision trees greatly. Default is 100

-tt is an int, the train-test split size in percentage. Default is 20.

-n is an int, number of trees generated. default is 20

-acc is an int as accuracy cutoff for each tree in percentage. default is 90

-o is a str, the name of the output file-path.

Example usage with iris dataset;

python ./FeatureSelection/RandomForest/rf_feature.py -i ./test_datasets/iris.csv -n 500 -o ./rf_output.csv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.