Skip to main content

Fuzzy Deep Neural Network (FDNN)

Project description

FDNN

A lightweight implementation of a Fuzzy Deep Neural Network (FDNN) in TensorFlow.

Installation

pip install FDNN

Usage

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler

import FDNN as fd

# Load dataset
df = pd.read_csv("MAINDiagnostics.csv")
df["Gender"] = df["Gender"].map({"MALE": 1, "FEMALE": 0})
df = df.drop(columns=["IDFILENAME", "FileName", "Beat"], errors='ignore')

# Create binary target
normal_group = ["SR", "SB", "ST", "SI", "SAAWR"]
arrhythmia_group = ["AFIB", "AF", "SVT", "AT", "AVNRT", "AVRT"]
df["Rhythm_Binary"] = df["Rhythm"].apply(lambda x: 0 if x in normal_group else (1 if x in arrhythmia_group else None))
df = df.dropna(subset=["Rhythm_Binary"])
y = df["Rhythm_Binary"].astype(int)
X = df.drop(columns=["Rhythm", "Rhythm_Binary"], errors='ignore')

# Save feature names
feature_names = X.columns.tolist()

# Scale features
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)

# Train/test split
X_train, X_val, y_train, y_val = train_test_split(X_scaled, y, test_size=0.2, random_state=42, stratify=y)
input_dim = X_train.shape[1]

# Train the model
model = fd.build_fdnn(input_dim)
model.fit(X_train, y_train, validation_data=(X_val, y_val), epochs=20, batch_size=32, verbose=1)

You can find "MAINDiagnostics.csv" here.

License

MIT

Authors

  • Arman Daliri
  • Nora Mahdavi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fdnn-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file fdnn-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fdnn-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fdnn-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6a1649c4f23582da630da426b730f5e6f8409bcc47e287745a32b731548f04f
MD5 e26bc1bf2c17fd9b02ab13173f561e57
BLAKE2b-256 91b6a04ba1d5dd63fea81acd69c2a0ddb86f079e03c3a58a8e6af2463659c2ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page