Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aliviahossain/Disease-prediction
/ types & classes
Types & classes
52 in github.com/aliviahossain/Disease-prediction
⨍
Functions
597
◇
Types & classes
52
↳
Endpoints
60
↓ 12 callers
Class
UncertaintyHandler
Evaluates whether a prediction is confident enough to show the user. Parameters ---------- confidence_threshold : float Absolute m
backend/utils/uncertainty_handler.py:45
↓ 10 callers
Class
PreprocessingError
Raised when a prediction payload cannot be cleaned safely.
backend/preprocessing/cleaning.py:24
↓ 9 callers
Class
PredictionHistory
backend/models/prediction.py:76
↓ 8 callers
Class
SyntheticPatientGenerator
Generate synthetic patient profiles for model testing.
backend/services/synthetic_patient_service.py:10
↓ 7 callers
Class
User
backend/models/user.py:6
↓ 7 callers
Class
ValidationError
Exception for validation errors.
backend/middleware/error_handler.py:42
↓ 5 callers
Class
InMemoryBackend
Thread-safe in-memory rate limit backend. Uses a background thread to prune stale entries periodically.
backend/middleware/security.py:19
↓ 4 callers
Class
BayesCalculator
Bayesian probability calculator for disease prediction. Compatible with ML model integration.
backend/src/calculator.py:51
↓ 4 callers
Class
RateLimiter
Token bucket rate limiter for API endpoints. Implements per-IP and per-endpoint rate limiting using pluggable backends.
backend/middleware/security.py:272
↓ 3 callers
Class
DiseaseMLModel
Machine Learning model for disease prediction based on symptoms. Uses logistic regression-style weighted scoring.
backend/models/ml_model.py:9
↓ 3 callers
Class
PatientHistory
A single saved prediction / calculation entry for a user. One row is created per call to the Bayesian calculator or the image-based disease-t
backend/models/patient_history.py:18
↓ 3 callers
Class
SQLiteBackend
SQLite-based rate limit backend. Uses WAL mode for high concurrency support among Gunicorn workers.
backend/middleware/security.py:161
↓ 2 callers
Class
RedisBackend
Distributed Redis rate limit backend using TTL-based keys and an atomic Lua script.
backend/middleware/security.py:94
↓ 1 callers
Class
BiasAnalyzer
Analyzes bias and coverage in the disease prediction model's dataset. Generates metrics including: - Class distribution across diseases
backend/analysis/bias_analysis.py:16
↓ 1 callers
Class
CleanedPredictionInput
backend/preprocessing/cleaning.py:31
↓ 1 callers
Class
Disease
backend/models/disease.py:4
↓ 1 callers
Class
EncryptionService
backend/services/encryption_service.py:7
↓ 1 callers
Class
ErrorHandler
Centralized error handler for Flask application.
backend/middleware/error_handler.py:130
↓ 1 callers
Class
JsonFormatter
JSON formatter for structured logging.
backend/middleware/logger.py:216
↓ 1 callers
Class
ModelVersion
Manages model versions and metadata.
backend/services/model_version_manager.py:12
↓ 1 callers
Class
ModelVersionManager
Manages model versions and training cycles.
backend/services/model_version_manager.py:31
↓ 1 callers
Class
NotFoundError
Exception for resource not found errors.
backend/middleware/error_handler.py:60
↓ 1 callers
Class
SecurityValidator
Security validation for API requests. Prevents common attacks like XSS, SQL injection, etc.
backend/middleware/security.py:375
↓ 1 callers
Class
StructuredLogger
Structured logger with JSON formatting and multiple log levels.
backend/middleware/logger.py:16
↓ 1 callers
Class
UnauthorizedError
Exception for unauthorized access errors.
backend/middleware/error_handler.py:82
↓ 1 callers
Class
Weird
backend/tests/test_patient_history.py:204
Class
AppError
Base exception class for application errors.
backend/middleware/error_handler.py:13
Class
BayesCalculator
Bayesian probability calculator for disease prediction. Enhanced with data types, risk stratification, and backwards compatibility.
backend/utils/calculator.py:70
Class
ForbiddenError
Exception for forbidden access errors.
backend/middleware/error_handler.py:91
Class
PredictionError
Exception for prediction/ML model errors.
backend/middleware/error_handler.py:113
Class
RateLimitError
Exception for rate limit exceeded errors.
backend/middleware/error_handler.py:99
Class
RequestLogger
Request logger middleware for Flask.
backend/middleware/logger.py:420
Class
RiskLevel
backend/services/risk_stratification_service.py:4
Class
TemporalAnalysisEngine
Advanced engine to process sequential patient history, analyze vital trends, and compute dynamic survival probabilities.
backend/utils/temporal_analysis.py:13
Class
TestBayesianCalculator
backend/tests/test_calculator.py:39
Class
TestConfiguration
backend/tests/test_uncertainty_handler.py:26
Class
TestDoctorDashboardAPI
Tests for the Doctor Dashboard API endpoint.
backend/tests/test_doctor_dashboard.py:126
Class
TestDoctorDashboardPage
Tests for the Doctor Dashboard page rendering.
backend/tests/test_doctor_dashboard.py:318
Class
TestErrorHandling
Test proper error handling across endpoints
backend/tests/test_fetch_endpoints.py:180
Class
TestHighConfidencePredictions
backend/tests/test_uncertainty_handler.py:125
Class
TestHistoryAPI
backend/tests/test_patient_history.py:244
Class
TestHistoryAPIStandalone
backend/tests/test_patient_history.py:233
Class
TestHistoryEndpoint
Test /api/history endpoint fetch error handling
backend/tests/test_fetch_endpoints.py:45
Class
TestHomePageFetch
Test home page fetch error handling
backend/tests/test_fetch_endpoints.py:127
Class
TestLowConfidenceDetection
backend/tests/test_uncertainty_handler.py:54
Class
TestMLSymptomsEndpoint
Test /api/ml/symptoms endpoint for home page
backend/tests/test_fetch_endpoints.py:85
Class
TestPatientHistoryModelStandalone
These tests insert PatientHistory rows with a synthetic user_id that isn't tied to a real User row. They exercise the model's serialization an
backend/tests/test_patient_history.py:126
Class
TestPredictionHistoryModel
Tests for the PredictionHistory model.
backend/tests/test_doctor_dashboard.py:268
Class
TestPredictionPersistence
Tests for prediction persistence in the ML predict endpoint.
backend/tests/test_doctor_dashboard.py:203
Class
TestResponseOkCheck
Test that frontend can properly check response.ok
backend/tests/test_fetch_endpoints.py:223
Class
TestSaveHistoryServiceStandalone
backend/tests/test_patient_history.py:174
Class
TestUserFacingMessages
backend/tests/test_uncertainty_handler.py:94