With the raise in prevalence of heart attacks from 2% in 1960s to over 12% in 2008, Cardiac ailments is the most critical problem to solve.
Cardiac Care is a critical specialty which requires sophisticated equipment and investigative facilities such as Echocardiography with Colour Doppler, Nuclear Scanning, Cardiac CT Scan, Cardiac MRI and Coronary Angiography.
Highly specialized Doctors and Medical professionals are one of the key requirement of a successful Cardiac Hospital.
Considering the needs to run a sophisticated Cardiac Specialty Hospital, Bangalore is an obvious choice. Since Bangalore is home to highly skilled Cardiologists and Medical Professionals, availability of research institutes in Bangalore helps in research needs of a Cardiac Hospital.
To derive the Entity list, our target segment lie under:
Considering the target segment as well as the probability of viewership, below are the entities we have narrowed down to:
#### INSTALL required packages if they are not installed already #######################
require("RCurl")||install.packages("RCurl")
require("jsonlite")||install.packages("jsonlite")
require("plotGoogleMaps")||install.packages("plotGoogleMaps")
require("geosphere")||install.packages("geosphere")
#### LOAD required packages #######################
library("RCurl")
library("jsonlite")
library("plotGoogleMaps")
library("geosphere")
##### Google API KEY #######################
key = "AIzaSyBcIbEaJzu2xrMtLSWo4jIealZ27E6dXNI"
##### Loading the data for the required Places #######################
# Bus Stations search
url = paste0("https://maps.googleapis.com/maps/api/place/radarsearch/json?&query=bus+stations+in+banglore&types=bus_station&location=12.9716,77.5946&radius=50000&key=",key)
doc <- getURL(url)
x <- jsonlite::fromJSON(doc)
busStations = x$results$geometry$location
#head(busStations)
busStations$type = "BusStations"
# Train Stations search
url = paste0("https://maps.googleapis.com/maps/api/place/radarsearch/json?&query=train+stations+in+banglore&types=train_station&location=12.9716,77.5946&radius=50000&key=",key)
doc <- getURL(url)
x <- jsonlite::fromJSON(doc)
trainStations = x$results$geometry$location
#head(trainStations)
trainStations$type = "TrainStations"
# malls search
url = paste0("https://maps.googleapis.com/maps/api/place/radarsearch/json?&query=malls+in+banglore&types=shopping_mall&location=12.9716,77.5946&radius=50000&key=",key)
doc <- getURL(url)
x <- jsonlite::fromJSON(doc)
malls = x$results$geometry$location
#head(malls)
malls$type = "Mall"
##### Processing #######################
data = rbind(busStations,trainStations, malls)
dim(data)
sample = data
coordinates(sample) <-~ lng +lat # Create cordinates
proj4string(sample) = CRS('+proj=longlat +datum=WGS84') # Add Projections
m<-mcGoogleMaps(sample,zcol = "type", mapTypeId='ROADMAP') # Plot on Google maps
# Get the coordinates
p2 = data[,1:2]
# calculate distances
dist_mat = matrix(0,nrow(p2),nrow(p2))
for (i in 1:nrow(p2)){
for (j in 1:nrow(p2)){
dist_mat[i,j] = distCosine(p2[i,],p2[j,], r=6378173)/1000
}
}
# Create clusters based in distances
fit <- hclust(as.dist(dist_mat), method="ward")
plot(fit) # display dendogram
groups <- cutree(fit, k=10) # cut tree into 18 clusters
# draw dendogram with red borders around the 18 clusters
rect.hclust(fit, k=10, border="red")
sample$group = groups # Assign cluster groups
# Plot stores with clustor as label
m <- mcGoogleMaps(sample, mapTypeId='ROADMAP', zcol="group")
We found 466 locations clustered in to 10 segments
After plotting the Google map and visually examining the results, we eliminated the clusters 6, 7, 9 and 10 as the areas corresponding to these clusters were not matching the customer profile
After eliminating these 4 clusters, it still leaves us with 352 locations from which we need to further narrow down to 4 locations.
This task has been achieved by setting up an optimization problem discussed in next slide.
Note: Because of the arbitrarily assignment of viewership numbers, the final selected 4 might not be the optimal locations. This requires more comprehensive method of collecting the accurate viewership data!
We have used Analytic Solver Platform to set up the optimization problem since there were more 200 decision variables.Based on the objective to maximize the viewership while maintaining the cost within the budget, solver provided the below solution:
row1 <- as.numeric(c(12.9370699, 77.6266046))
row2 <- as.numeric(c(12.9258836, 77.675326))
row3 <- as.numeric(c(12.9203227, 77.6444846))
row4 <- as.numeric(c(13.0112861, 77.6630975))
data1 = rbind(row1, row2, row3, row4)
data1 <- data.frame(data1)
colnames(data1) <- c("lat","lng")
sample1 = data1
coordinates(sample1) <-~ lng +lat # Create cordinates
proj4string(sample1) = CRS('+proj=longlat +datum=WGS84') # Add Projections
m<-mcGoogleMaps(sample1,zcol = "type", mapTypeId='ROADMAP') # Plot on Google maps
Below picture depicts the 4 selected areas after plotting them on Google MAP:
* Siva Gangadhar G [71610080] * Shree Sudhha [71610079] * Sravya Chunduri [71610110] * Srikanth Vidapanakal [71610084]