Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Project: Malaria Analysis and Prediction in Ouake Health Centre

Introduction:

This Python script analyzes a dataset from the Ouake Health Centre in Northern Benin Republic to investigate the relationship between malaria parasite density and various factors, including age, hematocrit (PCV), and hemoglobin concentration. It also explores the prevalence of anemia.

Dependencies:

  • pandas (pd)
  • seaborn (sns)
  • matplotlib.pyplot (plt)
  • numpy (np)
  • scikit-learn (specifically LinearRegression, RandomForestRegressor, XGBRegressor, train_test_split, r2_score, and mean_squared_error)

Data Acquisition:

The script assumes a CSV file named "ouake retrospective survey.csv" containing the health data. Ensure this file is located in your working directory (usually /content/ in Google Colab) before running the script.

Data Exploration:

  1. Malaria by Age:

    • Reads the CSV data using pandas.read_csv.
    • Plots malaria parasite density across all age categories using appropriate visualization techniques (implementation details not provided in the code).
  2. Data Preprocessing:

    • Extracts the "Specify the Age" and "Malaria parasite density" columns.
    • Handles missing values by filling them with the mean of the respective columns.
    • Converts the filled values to NumPy arrays for compatibility with machine learning models.
  3. Model Building (Ensemble Approach):

    • Intention: Develop an ensemble model by averaging predictions from linear regression, random forest regression, and XGBoost regression. However, the implementation for XGBoost and random forest models is missing in the provided code.
    • Focus on Linear Regression: We'll proceed with linear regression for demonstration purposes.

Model Training and Evaluation:

  1. Data Splitting:

    • Splits the age and malaria density data into training and testing sets using train_test_split with a test size of 33% and a random state of 100 for reproducibility.
  2. Linear Regression Model:

    • Creates a linear regression model using LinearRegression.
    • Trains the model on the training data.
    • Evaluates the model's performance using metrics like R-squared and mean squared error on the testing data.

Visualization and Interpretation:

  1. Age vs. Malaria Prediction:
    • Creates a scatter plot to visualize the relationship between age and malaria parasite density using plt.scatter and plt.plot.
    • Displays the model's variance score (R-squared) to assess its fit.

Further Analysis (Not Implemented in the Provided Code):

  • Ensemble Model Training: Complete the implementation of random forest regression and XGBoost regression to build the full ensemble model.
  • Model Comparison: Evaluate the ensemble model's performance compared to the individual models.
  • Anemia Analysis: Conduct a comprehensive analysis of anemia prevalence using hematocrit and hemoglobin concentration. Analyze the correlation between these factors and age.
  • PSAC Data Handling: Address potential issues with the "Specify the Age" column for PSAC data (children under 5) by implementing appropriate filtering or transformation techniques.

Conclusion:

This script provides a starting point for analyzing malaria data from the Ouake Health Centre. The implemented linear regression model can be enhanced by building and evaluating an ensemble model. Further exploration of anemia and PSAC data is recommended for a more comprehensive understanding.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages