Downloads · 30 days
0
gabrieltxs/AMR_prediction
AMR_prediction is a machine learning model from gabrieltxs. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains a Python script for predicting antimicrobial resistance (AMR) using the LGBMClassifier model. The script reads input datasets from a directory, applies feature extraction techniques to obtain…
Downloads · 30 days
0
Access
Public
Updated Mar 15, 2023
Repo size
2.7 GB
Likes
1
Public
Click a slice to open those files.
.rar1.6 GB · 57%
From the Hugging Face model README
This repository contains a Python script for predicting antimicrobial resistance (AMR) using the LGBMClassifier model. The script reads input datasets from a directory, applies feature extraction techniques to obtain k-mer features, trains and tests the models using cross-validation, and outputs the results in text files.

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
This script requires the following Python libraries:
pandas
scikit-learn
numpy
tqdm
lightgbm
hyperopt
joblib
bayesian-optimization
skopt
Clone the repository to your local machine and install the required libraries:
$ git clone https://github.com/username/repo.git
$ cd repo
$ pip install -r requirements.txt
To use the script, execute the following command:
css Copy code
$ python main.py
The main script consists of several sections:
1 Import necessary libraries
2 Set seed for reproducibility
3 Define function to get list of models to evaluate
4 Load list of selected samples
5 Call function to get list of models
6 Initialize KFold cross-validation
7 Iterate over values of k to read the corresponding k-mer feature dataset
8 Iterate over the models list
9 Write results to text file
The input datasets are CSV files containing bacterial genomic sequences and their corresponding resistance profiles for selected antibiotics. The script reads these files from a directory and applies k-mer feature extraction techniques to obtain numerical feature vectors.
The script uses two models for AMR prediction: Random Forest and LGBMClassifier.
The script outputs the results of each model to a text file in the specified output directory. The results include accuracy, precision, recall, F1 score, and area under the ROC curve.
Gabriel Sousa - gabrieltxs
This project is licensed under the MIT License - see the LICENSE.md file for details.