<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Kay Wilson</title>
    <description>The latest articles on Forem by Kay Wilson (@kayuni3).</description>
    <link>https://forem.com/kayuni3</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1040609%2F8368a6c4-d9e3-40e7-aa73-aae0483863ea.png</url>
      <title>Forem: Kay Wilson</title>
      <link>https://forem.com/kayuni3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kayuni3"/>
    <language>en</language>
    <item>
      <title>Apples to Oranges or Oranges to Nectarines? (Aspiring Solution Architect)</title>
      <dc:creator>Kay Wilson</dc:creator>
      <pubDate>Tue, 11 Apr 2023 19:40:31 +0000</pubDate>
      <link>https://forem.com/kayuni3/apples-to-oranges-or-oranges-to-nectarines-1i1c</link>
      <guid>https://forem.com/kayuni3/apples-to-oranges-or-oranges-to-nectarines-1i1c</guid>
      <description>&lt;h2&gt;
  
  
  Comparing Solution and Naval Architecture
&lt;/h2&gt;

&lt;p&gt;For the past four years of my professional career, I have worked as a Naval Architect. Most people have no idea what naval architecture is and contrary to what the name may imply, I do not do any sketching or drawing at all. Surprisingly, &lt;strong&gt;Solution Architects and Naval Architects have more in common than just their job &lt;em&gt;titles&lt;/em&gt;. We have similar job &lt;em&gt;duties&lt;/em&gt;!&lt;/strong&gt; We just work in different industries. &lt;/p&gt;

&lt;p&gt;Simply put, I design technical solutions for &lt;em&gt;naval ships&lt;/em&gt;. These solutions are based on data that I use to calculate/model the expected behavior of ships and their structure using stress analysis and buoyancy theories, technical requirements and specifications, and data provided to me by the "customer". I review customer provided designs, proposals, and any other submitted documents, create a model, and then either provide or approve a solution to a given problem. &lt;/p&gt;

&lt;p&gt;Note: we call projects "work items" or "availabilities" so you can use this interchangeably when reading from here on. &lt;/p&gt;

&lt;h2&gt;
  
  
  Data Analysis &amp;amp; Designing Technical Solutions
&lt;/h2&gt;

&lt;p&gt;Much of the data used in these models are as old as the Navy itself. Long ago, naval architects conducted and recorded various experiments on the behavior of naval ships due to various stresses such as wind, flooding of tanks, earthquakes and hurricanes, and explosions. Using this ancient data and current conditions reported, I am able to model the expected outcome of stress, corrosion, stability, etc. to then assess and manage the risk of structural failure or casualty. Here are two examples: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Of these experiments, there were "inclining experiments" to model the behavior of buoyancy or stability due to stress loads aboard the ship. Long story short, heavy weights were moved to various locations and the buoyancy was observed, recorded, and eventually turned into charts and respective formulas. Naval architects in my office less than a decade ago had to endure the long grueling process of reading through these many many many charts and making additional tables and charts to then model the expected behavior of buoyancy due to the removal and addition of weights, all by hand. Instead now, all of these charts and data have been uploaded into a lovely interactive database (even though I have had to do these calculations by hand as almost a rite of passage). I now simply input the new data of columns and rows and out comes our new stability model complete with a couple visuals. Then I am able to either approve the requested solution or present an appropriate alternative.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Let's say there is a hole on a deck that needs to be repaired but based on the work items already scheduled, there is no time to complete the repair. Taking such data as the size and location of the hole and material type and thickness, I can estimate the corrosion and failure rate and predict when the deck will fail due to stress. Different locations on the ship and material have been shown to exhibit varying degrees of stress or deterioration. Based on this information, I can appropriately recommend the best method of repair and its required completion date.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are many other components that I manage that all have their own tech manuals and formulas. There is never a dull day in the office, fortunately!&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Estimation and Risk Analysis
&lt;/h2&gt;

&lt;p&gt;While researching Solution Architecture, I came across a project estimation technique/concept that seems similar to a method that I use in my current role: T-shirt sizing. &lt;/p&gt;

&lt;p&gt;In my current position, we have scheduled future projects called availabilities with pre-assigned tasks outlined in a "work item". There are smaller or larger tasks that are assigned to shorter or longer scheduled availabilities respectively in order to remain on or close to schedule. Shorter availabilities are much more frequent and longer availabilities can be spaced out by years. &lt;/p&gt;

&lt;p&gt;However, once I have assessed the risk of failure or casualty, if a more complex or larger tasks is labeled as "critical", it can be deemed a priority and is thus reassigned to shorter or sooner availabilities regardless and tasks assessed as "low" can be reassigned to longer availabilities. &lt;/p&gt;

&lt;p&gt;Contractors are also prepaid for work before an availability starts and any additional tasks or "growth work" added have higher costs and additional fees. Only tasks deemed critical are added as growth work, and I must use my best engineering judgement to determine what is necessary and urgent using my models as support.&lt;/p&gt;

&lt;p&gt;I am of course not an expert on T-shirt sizing but it seems similar to this method!&lt;/p&gt;

&lt;h2&gt;
  
  
  Effective Communication and Cross-functional Teams
&lt;/h2&gt;

&lt;p&gt;As an SME, I am in constant communication with various people in many different positions and areas of expertise. Once we have created a model, assessed the problem, designed a solution, the last step is to communicate this solution to the rest of the project team.  &lt;/p&gt;

&lt;p&gt;For a docking evolution (which is the start or end of an availability), there are divers, dock masters, enlisted and commissioned sailors, rope handlers, crane operators, etc. that are all working on getting the ship into or out of drydock. A drydock is literally a dry dock. The ship is lifted out of the water onto a platform.&lt;/p&gt;

&lt;p&gt;It may seem simple but it takes days of prep and getting the ship into the drydock and completing an evolution can take almost 28 straight hours (thankfully there is overtime which makes 28 hours feel a wee bit like an 8 hour shift). During this time, we have to be in constant communication with all personnel to track, record, and report every stage of this process as we are the official government oversight and lead POC and are also expected to find a solution to any and every problem that may arise whether it be who to call or what technical manual to read. Naval ships cost hundreds of millions of dollars to build so I try my hardest to not break them! &lt;strong&gt;Below is what a docking evolution looks like.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/G3kdqwsLCBI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;For structural repairs or alterations, we often perform onsite inspections and meet with different personnel and project managers to get the complete picture of the issue before recommending a solution. Having strong communication skills in order to understand the task at hand and effectively communicate all requirements and solutions is definitely a must and is a great strength of mine!  &lt;/p&gt;

&lt;p&gt;Even though I enjoy what I currently do, I would love the opportunity to transition in a role in Solution Architecture and am confident that the skills (or powers) that I've harnessed will come in handy in a Solution Architect or similar role! &lt;/p&gt;

</description>
      <category>solutionarchitect</category>
      <category>cloud</category>
    </item>
    <item>
      <title>The Perfect Duo? (Testing Azure and Terraform Capabilities)</title>
      <dc:creator>Kay Wilson</dc:creator>
      <pubDate>Tue, 11 Apr 2023 15:19:07 +0000</pubDate>
      <link>https://forem.com/kayuni3/the-perfect-duo-testing-azure-and-terraform-capabilities-1880</link>
      <guid>https://forem.com/kayuni3/the-perfect-duo-testing-azure-and-terraform-capabilities-1880</guid>
      <description>&lt;p&gt;What better way to learn a new skill than to practice? Terraform is easily the best IaC application. Using it, I've created and deployed Azure resources like Kubernetes clusters, Active Directory and Security groups, CI/CD solutions using Azure DevOps, and Virtual Machine instances. It has been super easy to learn!&lt;/p&gt;

&lt;p&gt;Terraform is similar to Azure Resource Management (ARM) templates, which I am familiar with and have completed a couple projects using it. However, Terraform is useful as it allows you to configure infrastructure across multiple cloud platforms. Most companies don't just use one cloud providers as one might have a resource that better than the other and vice versa. For example, Azure Active Directory is the arguably the best solution for identity and access management while AWS can be a better solution for IaaS. This is where Terraform comes in handy!&lt;/p&gt;

&lt;h2&gt;
  
  
  General Steps
&lt;/h2&gt;

&lt;p&gt;Creating resources and solutions using Terraform is pretty straightforward. Each solution was deployed using these steps.&lt;/p&gt;

&lt;p&gt;1.Create the respective providers, main, variables, outputs files, and service principal credentials.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;providers: specifies cloud provider used &lt;/li&gt;
&lt;li&gt;main: specifies the parameters for my resources
&lt;/li&gt;
&lt;li&gt;variables: specifies the variables for our parameters like the resource group location. These are parameter values that start with &lt;em&gt;var&lt;/em&gt; in my main file. &lt;/li&gt;
&lt;li&gt;outputs: specifies output variables &lt;/li&gt;
&lt;li&gt;service principal credentials: specifies my service principal app id and password as I choose to use a least privilege model to protect my subscriptions and its resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Using Azure CloudShell, I created and applied my Terraform execution plan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform plan -out main.tfplan
terraform apply main.tfplan

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Test the results! &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: code are only samples of what was used and resources have additional parameters that were included in my Terraform files. You can find the complete code in my Github repo.&lt;/em&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  End to End Governance (Azure DevOps and Terraform)
&lt;/h2&gt;

&lt;p&gt;In this project, designed an end to end governance solution for a scenario where a construction company called Kay Inc is working on the construction of a new hospital.  &lt;/p&gt;

&lt;p&gt;Kay Inc has various departments: Structural Design, Project Management, and IT (or superadmins). Each department has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a team that develops solutions to make some aspects of the department more efficient. For example, a function application that automatically uploads published drawings from the design team to a Cosmos DB to be used and tracked by the project management dept. &lt;/li&gt;
&lt;li&gt;an admin team that creates and manages management groups, subscriptions, RBAC, Policies, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Active Directory and IAM:&lt;/strong&gt; I created three Active Directory groups for each department: a group for the entire department and two separate groups for the developer team with DevOps and ARM Contributor roles and admin team with ARM Owner and DevOps Project Administrator roles. The IT department only has one AD group with "superadmin" privileges.&lt;/p&gt;

&lt;p&gt;The construction project is broken down into 5 projects groups: one for each department, one for the entire company, and a collaborative space. &lt;/p&gt;

&lt;h3&gt;
  
  
  To implement my solution, I...
&lt;/h3&gt;

&lt;p&gt;I created a DevOps Organization and PAT to configure the environment then created the DevOps projects, AD group assignments, and service connections for the company. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Configuring the AD groups&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "azuread_group" "groups" {
  for_each                = var.groups
  display_name            = "kayinc-${each.value}-${local.suffix}"
  prevent_duplicate_names = true
  security_enabled        = true
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Configuring the DevOps projects&lt;/strong&gt; and enabling their necessary features&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "azuredevops_project" "team_projects" {
  for_each        = var.projects
  name            = each.value.name
  description     = each.value.description
  visibility      = "private"
  version_control = "Git"

  features = {
    repositories = "enabled"
    pipelines    = "enabled"
    artifacts    = "disabled"
    boards       = "disabled"
    testplans    = "disabled"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Configuring Security Group Assignments&lt;/strong&gt; for each project with their assigned permissions and dependencies&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module "ado_team_permissions" {
  for_each       = var.projects
  source         = "./modules/azure-devops-permissions"
  ado_project_id = azuredevops_project.team_projects["${each.value.team}"].id
  team_aad_id    = azuread_group.groups["${each.value.team}_devs"].id   # Receives 'Contributor' Permissions
  admin_aad_id   = azuread_group.groups["${each.value.team}_admins"].id # Receives 'Project Administrator' Permissions

  depends_on = [
    azuread_group.groups,
    azuredevops_project.team_projects
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating a Kubernetes cluster using AKS
&lt;/h2&gt;

&lt;p&gt;In this task, I created a AKS cluster and configured Container Insights to manage my Kubernetes environment using Terraform. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Create an AKS cluster&lt;/strong&gt; specifying node pool parameters including the number of nodes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "azurerm_kubernetes_cluster" "k8s" {
  location            = azurerm_resource_group.rg.location
  name                = var.cluster_name
  resource_group_name = azurerm_resource_group.rg.name
  dns_prefix          = var.dns_prefix
  tags                = {
    Environment = "Development"
  }

default_node_pool {
    name       = "agentpool"
    vm_size    = "Standard_D2_v2"
    node_count = var.agent_count
  }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Configure Container Insights&lt;/strong&gt; to monitor the health and performance of my cluster&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "azurerm_log_analytics_solution" "test" {
  location              = azurerm_log_analytics_workspace.test.location
  resource_group_name   = azurerm_resource_group.rg.name
  solution_name         = "ContainerInsights"
  workspace_name        = azurerm_log_analytics_workspace.test.name
  workspace_resource_id = azurerm_log_analytics_workspace.test.id

  plan {
    product   = "OMSGallery/ContainerInsights"
    publisher = "Microsoft"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Virtual Machine Scale Sets from a custom Packer image
&lt;/h2&gt;

&lt;p&gt;Azure Virtual Machine Scale Sets automate the deployment of Virtual Machine instances based on specified parameters to decrease latency and increase availability. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Configuring the VM image&lt;/strong&gt; by creating a resource group, service principal, and the Packer template file to a Packer image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az group create -n kayPackerimages -l eastus

az ad sp create-for-rbac --role Contributor --scopes /subscriptions/kayssub1234 --query "{client_id: appId, client_secret: password, tenant_id: tenant }"

packer build ubuntu.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Packer image file is a json file that include my Azure credentials, os type, image sku and location, etc. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Create a Virtual Network, subnet, and loadbalancer&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "azurerm_virtual_network" "vmss" {
  name                = "vmss-vnet"
  address_space       = ["10.0.0.0/16"]
  location            = var.location
  resource_group_name = azurerm_resource_group.vmss.name
  tags = var.tags
}

resource "azurerm_subnet" "vmss" {
  name                 = "vmss-subnet"
  resource_group_name  = azurerm_resource_group.vmss.name
  virtual_network_name = azurerm_virtual_network.vmss.name
  address_prefixes       = ["10.0.2.0/24"]
}

resource "azurerm_lb" "vmss" {
  name                = "vmss-lb"
  location            = var.location
  resource_group_name = azurerm_resource_group.vmss.name

  frontend_ip_configuration {
    name                 = "PublicIPAddress"
    public_ip_address_id = azurerm_public_ip.vmss.id
  }

  tags = var.tags
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Create my virtual machine&lt;/strong&gt; using the Packer image&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data "azurerm_image" "image" {
  name                = var.packer_image_name
  resource_group_name = data.azurerm_resource_group.image.name
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course I did not start with these more complicated tasks. I first practiced configuring simple solutions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an Azure CosmosDB&lt;/li&gt;
&lt;li&gt;Azure Virtual Machines &lt;/li&gt;
&lt;li&gt;resource groups&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>terraform</category>
      <category>azure</category>
      <category>devops</category>
    </item>
    <item>
      <title>See you soon? (Predictive Modeling using Machine Learning and Data Analysis)</title>
      <dc:creator>Kay Wilson</dc:creator>
      <pubDate>Tue, 04 Apr 2023 16:35:03 +0000</pubDate>
      <link>https://forem.com/kayuni3/see-you-soon-predictive-modeling-using-machine-learning-and-data-analysis-4hmf</link>
      <guid>https://forem.com/kayuni3/see-you-soon-predictive-modeling-using-machine-learning-and-data-analysis-4hmf</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Machine Learning and AI has always perplexed me. I always figured it was based on past data and prediction somehow but never understood exactly how. This project offered the perfect opportunity to learn something new and gain hands-on practice using Power BI that helped me pass Microsoft's Power BI Data Analyst certification exam. &lt;/p&gt;

&lt;p&gt;In this project, I cleansed a dataset and created visuals and machine learning models to predict the readmission of diabetic patients. Microsoft offers many data analysis tools. Of these tools, I used Databricks with Apache Spark and Power BI. The data set was provided by VCU's Center for Clinical and Translational Research. &lt;/p&gt;

&lt;h2&gt;
  
  
  Databricks vs Power BI
&lt;/h2&gt;

&lt;p&gt;Databricks and Power BI differ with their respective user-friendliness. Databricks uses programming language for both data analysis and machine learning. I opted to use Python and PySpark (Apache Spark for Python). Power BI, however, is little-to-no code and allows you perform data analysis via a very user-friendly GUI that looks similar to Excel. Essentially, Databricks is for developers and Power BI is for everyone else.&lt;/p&gt;

&lt;p&gt;Both Databricks and Power BI allow SQL queries. Within Databricks, SQL queries are what allow you to create visuals. Within Power BI, DAX and SQL can both be used for queries but are not required to create visuals. You can simply specify the data you want to use in the field pane. You can even create or import custom visuals using Python and R languages and animated visuals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparing Data
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Importing Data
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Databricks:&lt;/strong&gt; I created a blob storage account in Azure and a container and then uploaded the dataset file in CSV format as blob. I then mounted the storage account to my Databricks notebook and imported my CSV blob and created a dataframe . One mistake I made was that in order to use my blob storage account in Databricks, I needed to enable Data Lake Gen 2 on my storage account. This gave me headache in the beginning because kept receiving an error message when attempting to mount as I could not figure out why it would not upload my blob.&lt;/p&gt;

&lt;p&gt;Mounting my blob storage account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dbutils.fs.mount(
  source = "wasbs:/mycontainer@myblobstorageaccount.blob.core.windows.net",
  mount_point = "/mnt/mymountpoint",
  extra_configs = {"fs.azure.account.key.mydatalake.blob.core.windows.net": "myaccountkey123"})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a dataframe from my blob:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df = (spark.read
  .format("csv")
  .option("header", "true")
  .option("inferSchema", "true")
  .load("wasbs://mycontainer@myblobstorageaccount.blob.core.windows.net/diabetic_data.csv")
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Power BI:&lt;/strong&gt; The CSV or flat file was imported locally to Power BI Desktop. &lt;/p&gt;

&lt;h3&gt;
  
  
  Cleansing Data
&lt;/h3&gt;

&lt;p&gt;Only necessary data were needed from the raw data set. I was able to clean the data using various factors. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Columns deemed as potential indicators of diabetes readmissions were used for analysis. These were race, whether they were on any diabetes medications, previous number of readmissions, and the number of diagnoses, time spent in the hospital. &lt;/li&gt;
&lt;li&gt;I dropped rows with certain discharge disposition IDs to exclude the patients that are no longer with us. &lt;/li&gt;
&lt;li&gt;Patient number was included as a partition key. &lt;/li&gt;
&lt;li&gt;Created an additional column called "Readmission Score" with the data type of integer to be used in certain calculations&lt;/li&gt;
&lt;li&gt;Certain columns that could be used as potential indicators were deleted if there were too many rows with missing values (i.e., medical specialty).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Databricks:&lt;/strong&gt; I created a new or cleansed dataframe with only the needed columns from my raw dataframe using code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cleansed_df = df.select("patient_nbr", "race", "admission_type_id", "discharge_disposition_id", "number_diagnoses", "readmitted", "num_medications", "diabetesMed", "gender", "age")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Power BI:&lt;/strong&gt; During the initial import of my data, the Transform Data option was used to only include the necessary columns and rows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modeling Data
&lt;/h2&gt;

&lt;p&gt;After cleansing, tables were created to determine the correlation, if any, between the data. &lt;/p&gt;

&lt;p&gt;Factors analyzed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;number of diagnoses &lt;/li&gt;
&lt;li&gt;number of medications&lt;/li&gt;
&lt;li&gt;race &lt;/li&gt;
&lt;li&gt;sex &lt;/li&gt;
&lt;li&gt;admission type&lt;/li&gt;
&lt;li&gt;age&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Choosing my aggregate function
&lt;/h3&gt;

&lt;p&gt;There were a couple functions that I used in my queries such as count, avg, kurtosis, skewness&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Average:&lt;/strong&gt; used in finding the "readmission score" of a group&lt;br&gt;
&lt;strong&gt;Count:&lt;/strong&gt; used in showing the distribution of data&lt;br&gt;
&lt;strong&gt;Kurtosis:&lt;/strong&gt; readmission data showed a platykurtic distribution with a kurtosis of about -1.7. This means data was a little too flat. &lt;br&gt;
&lt;strong&gt;Skewness:&lt;/strong&gt; The readmissions data had a skewness score of 0.38. This shows that the distribution of my data is fairly symmetrical. &lt;/p&gt;
&lt;h3&gt;
  
  
  Visualization
&lt;/h3&gt;

&lt;p&gt;Graphs and charts were created to visualize some of the relationships between data. It is much easier to read a chart then just look at a table. The type of visual used was dependent on the parameter used. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bar graphs for average and count functions &lt;/li&gt;
&lt;li&gt;Pie charts for percentages&lt;/li&gt;
&lt;li&gt;Cards for single values&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Power BI has a neat key influencer visual that analyzes your data for you to determine factors influencing a certain metric. In my case, readmission scores. &lt;/p&gt;
&lt;h2&gt;
  
  
  Analysis Results
&lt;/h2&gt;

&lt;p&gt;Once I created my measures and visuals, I looked at my data to see what the results were. Here is a break down of what I saw. Using Power BI, I was able to create a nice report using my visuals which you can view here. &lt;/p&gt;
&lt;h5&gt;
  
  
  Race and Gender
&lt;/h5&gt;

&lt;p&gt;This was an obvious choice of data to look at for trends. I used count and average to examine the readmission history based on the readmission score. I was able to use count to see the number of patients of a specific demographic that had a specific score and find the average readmission score based on a specific demographic. &lt;br&gt;
This is what I saw:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caucasians and Blacks had a higher readmission score than other races. &lt;/li&gt;
&lt;li&gt;Asians had the lowest readmission score of any race&lt;/li&gt;
&lt;li&gt;Women had a higher readmission score than Men&lt;/li&gt;
&lt;li&gt;Asian women had a even higher readmission score than Asian men when comparing women and men of other races &lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
  
  
  Age
&lt;/h5&gt;

&lt;p&gt;Age really did not show a correlation which was surprising to me. I expected to see that older patients would have a higher readmission rate. The average patient age was 71 no matter the readmission score. The age data was skewed making useless. &lt;/p&gt;
&lt;h5&gt;
  
  
  Number of Diagnoses
&lt;/h5&gt;

&lt;p&gt;I was very confident that the number of diagnoses a patient had was going to greatly impact their readmissions. I expected to see that the higher the number of diagnoses, the higher the admission score. The data showed that there was little to no correlation. &lt;/p&gt;
&lt;h5&gt;
  
  
  Number of medications
&lt;/h5&gt;

&lt;p&gt;I expected to see that the higher the number of medications, the lower the admission score as they would be managing their health at home. The data showed there was little to no correlation. A patient with no readmissions had only 1 more medication than those who have been. &lt;/p&gt;
&lt;h5&gt;
  
  
  Admission Type
&lt;/h5&gt;

&lt;p&gt;I was most surprised to see that Admission Type showed the largest influence on readmissions. I was able to see that patients with a  application type ID of 6 or (what type is it) had the highest readmission score, and the most common type of admission type was type 1. &lt;/p&gt;
&lt;h2&gt;
  
  
  Machine Learning (ML)
&lt;/h2&gt;
&lt;h4&gt;
  
  
  Power BI
&lt;/h4&gt;

&lt;p&gt;Power BI has a built in no code ML feature called AI Insights. To use this feature, I created a dataflow in my Power BI workspace and added a machine learning model with the selected data that I wanted to include. My ML model was then applied to my table. &lt;/p&gt;
&lt;h4&gt;
  
  
  Databricks
&lt;/h4&gt;

&lt;p&gt;I used AutoML in Python syntax to create a machine learning model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from databricks import automl

summary = automl.classify(train_df, target_col="readmitted", timeout_minutes=15)

model_uri = summary.best_trial.model_path

import mlflow

# Prepare test dataset
test_pdf = test_df.toPandas()
y_test = test_pdf["Y"]
X_test = test_pdf.drop(["Y"], axis=1)
X_test.head()
# Run inference using the best model
model = mlflow.pyfunc.load_model(model_uri)
predictions = model.predict(X_test)
test_pdf["readmitted"] = predictions

import sklearn.metrics

model = mlflow.sklearn.load_model(model_uri)
sklearn.metrics.plot_confusion_matrix(model, X_test, y_test)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>azure</category>
      <category>machinelearning</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
