AMBER (Attention-guided Multi-Branching-pipeline with Enhanced Residual fusion) is an experimental deep learning architecture for biomedical engineering. Designed for one-dimensional, multimodal detection tasks, the architecture addresses the challenges of processing heterogeneous data sources by constructing independent pipelines for each feature modality
Ensure you have the following installed on your system:
- Python
pip
(Python package installer)
cd your-repo
git clone https://github.com/jpordoy/AMBER.git
This project uses Yarn as package manager
npm install --global yarn
To run tests, run the following command
yarn test test
Clone the project
git clone https://github.com/Louis3797/awesome-readme-template.git
Go to the project directory
cd my-project
Install dependencies
yarn install
Please put your training data as a csv file in the "Data/" of this project.
import pandas as pd
import numpy as np
from data_loader import DataLoader
from data_formatter import DataFormatter
from model import Amber
from kfold_cv import KFoldCrossValidation
from evaluator import evaluate_model_performance
from config import config
# Define your DataFrame and parameter
mypath = 'Data/Train.csv'
df = pd.read_csv(mypath)
target_column = 'label' # Name of the target column
# Step 1: Load Data
data_loader = DataLoader(dataframe=df, time_steps=config.N_TIME_STEPS, step=config.step, target_column=target_column)
segments, labels = data_loader.load_data()
# Step 2: Format Data
data_formatter = DataFormatter(config=config)
X_train_reshaped, X_test_reshaped, y_train, y_test = data_formatter.format_data(segments, labels)
# Reshape y_test correctly
y_test_reshaped = np.asarray(y_test, dtype=np.float32)
# Initialize model
ts_model = Amber(row_hidden=config.row_hidden, col_hidden=config.row_hidden, num_classes=config.N_CLASSES)
# Create an instance of KFoldCrossValidation
kfold_cv = KFoldCrossValidation(ts_model, [X_train_reshaped['Feature_1'], X_train_reshaped['Feature_2']], y_train)
# Run the cross-validation
kfold_cv.run()
# Evaluate the model performance
evaluation_results = evaluate_model_performance(ts_model, [X_test_reshaped['Feature_1'], X_test_reshaped['Feature_2']], y_test_reshaped)
# Access individual metrics
print("Accuracy:", evaluation_results["accuracy"])
print("F1 Score:", evaluation_results["f1"])
print("Cohen's Kappa:", evaluation_results["cohen_kappa"])
Contributions are always welcome!
See contributing.md
for ways to get started.
Please read the Code of Conduct
-
Question 1
- Answer 1
-
Question 2
- Answer 2
Distributed under the no License. See LICENSE.txt for more information.
Your Name - @twitter_handle - email@email_client.com
Project Link: https://github.com/Louis3797/awesome-readme-template