![Machine Learning for Healthcare Analytics Projects](https://img.perlego.com/books/RM_Books/packt_pub_vpnckweg/9781789532524_300_450.webp)
Machine Learning for Healthcare Analytics Projects
Build smart AI applications using neural network methodologies across the healthcare vertical market
Eduonix Learning Solutions
- 134 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Machine Learning for Healthcare Analytics Projects
Build smart AI applications using neural network methodologies across the healthcare vertical market
Eduonix Learning Solutions
About This Book
Create real-world machine learning solutions using NumPy, pandas, matplotlib, and scikit-learn
Key Features
- Develop a range of healthcare analytics projects using real-world datasets
- Implement key machine learning algorithms using a range of libraries from the Python ecosystem
- Accomplish intermediate-to-complex tasks by building smart AI applications using neural network methodologies
Book Description
Machine Learning (ML) has changed the way organizations and individuals use data to improve the efficiency of a system. ML algorithms allow strategists to deal with a variety of structured, unstructured, and semi-structured data. Machine Learning for Healthcare Analytics Projects is packed with new approaches and methodologies for creating powerful solutions for healthcare analytics.
This book will teach you how to implement key machine learning algorithms and walk you through their use cases by employing a range of libraries from the Python ecosystem. You will build five end-to-end projects to evaluate the efficiency of Artificial Intelligence (AI) applications for carrying out simple-to-complex healthcare analytics tasks. With each project, you will gain new insights, which will then help you handle healthcare data efficiently. As you make your way through the book, you will use ML to detect cancer in a set of patients using support vector machines (SVMs) and k-Nearest neighbors (KNN) models. In the final chapters, you will create a deep neural network in Keras to predict the onset of diabetes in a huge dataset of patients. You will also learn how to predict heart diseases using neural networks.
By the end of this book, you will have learned how to address long-standing challenges, provide specialized solutions for how to deal with them, and carry out a range of cognitive tasks in the healthcare domain.
What you will learn
- Explore super imaging and natural language processing (NLP) to classify DNA sequencing
- Detect cancer based on the cell information provided to the SVM
- Apply supervised learning techniques to diagnose autism spectrum disorder (ASD)
- Implement a deep learning grid and deep neural networks for detecting diabetes
- Analyze data from blood pressure, heart rate, and cholesterol level tests using neural networks
- Use ML algorithms to detect autistic disorders
Who this book is for
Machine Learning for Healthcare Analytics Projects is for data scientists, machine learning engineers, and healthcare professionals who want to implement machine learning algorithms to build smart AI applications. Basic knowledge of Python or any programming language is expected to get the most from this book.
Frequently asked questions
Information
Diabetes Onset Detection
- Detecting diabetes using a deep learning grid search
- Introduction to the dataset
- Building a Keras model
- Performing a grid search using scikit-learn
- Reducing overfitting using dropout regularization
- Finding the optimal hyperparameters
- Generating predictions using optimal hyperparameters
Detecting diabetes using a grid search
- Start by opening up Command Prompt in Windows or Terminal in Linux systems. We will navigate to our project directory using the cd command.
- Our next step is to open the Jupyter Notebook by typing the following command:
jupyter notebook
- Once the Notebook is open, we will rename the unnamed file to Deep Learning Grid Search.
- We will then import our packages using general import statements. We will print the version numbers, as shown in the following screenshot:
![](https://book-extracts.perlego.com/835439/images/520c43ed-e22f-43d2-b418-2d4b83c53cae-plgo-compressed.webp)
- Go to the .keras folder that is present in the Windows Users folder. We can navigate to this folder using C:|Users|<yourusername>|.keras. This folder contains a datasets folder and keras.json file, as shown in the following screenshot:
![](https://book-extracts.perlego.com/835439/images/502deace-3a26-4515-9edc-8868c56e6436-plgo-compressed.webp)
![](https://book-extracts.perlego.com/835439/images/ba51cbac-f7a7-4436-863f-8fe64ba1d619-plgo-compressed.webp)
- Since we will be using Theano, change the backend variable to theano. We are now all set to continue.
import pandas as pd
import numpy as np
Introduction to the dataset
- The dataset that we need can be found at https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv. We can import it by using the following line:
url = "https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv"
- If we navigate to the preceding URL, we can see a lot of raw information. Once we have imported the dataset, we have to define column names. We will do this using the following lines of code:
names = ['n_pregnant', 'glucose_concentration', 'blood_pressure (mm Hg)', 'skin_thickness (mm)', 'serum_insulin (mu U/ml)', 'BMI', 'pedigree_function', 'age', 'class']
- Once we have defined the names of the columns, we have to read all the data into a pandas DataFrame. Since our dataset is in CSV format, we can use the pd.read_csv() function to do this, as shown in the following screenshot:
![](assets/a3a78e9a-4d26-4899-bc9b-6a86e58e9140-plgo-compressed.webp)
- We will now have a look at the dataset by using the describe() function, as shown in the following screenshot:
![](assets/a702dd0c-d0c9-4dc3-96ab-9f467c581916-plgo-compressed.webp)
Preprocessing the dataset
- To do this, we will use the following code snippet to pull up a DataFrame where the glucose concentration of a patient is listed as 0:
df[df['glucose_concentration'] == 0]
![](https://book-extracts.perlego.com/835439/images/b2c6f8a5-1b4f-475b-b956-89b213f39288-plgo-compressed.webp)
- We're going to mark the missing values as NaN, and drop them. To do this, we're going to define the columns we want to look at. We will define all of the columns, excluding those for n_pregnancy, age, and class. This can be done as follows:
columns = ['glucose_concentration', 'blood_pressure (mm Hg)', 'skin_thickness (mm)', 'serum_insulin (mu U/ml)', 'BMI']
- After defining the columns, we have to replace all the zero values with NaN. This can be done as follows:
for col in columns:
df[col].replace(0, np.NaN, inplace=True)
- We will then take another look at the DataFrame to ensure that the preceding commands have worked. We can do this with the describe() f...