From 70b316dbdcc66124ef4fed2188809c147c31a429 Mon Sep 17 00:00:00 2001
From: JISHNU P <cb.en.p2aid19017@cb.students.amrita.edu>
Date: Fri, 3 Jul 2020 11:52:06 +0530
Subject: [PATCH] Upload New File

---
 Jupyter Notebook/Modelling_of_features_in_R.R | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 Jupyter Notebook/Modelling_of_features_in_R.R

diff --git a/Jupyter Notebook/Modelling_of_features_in_R.R b/Jupyter Notebook/Modelling_of_features_in_R.R
new file mode 100644
index 0000000..18ed4d4
--- /dev/null
+++ b/Jupyter Notebook/Modelling_of_features_in_R.R	
@@ -0,0 +1,77 @@
+getwd()
+setwd("C:\\Users\\Ankit\\Desktop")
+getwd()
+
+library(visNetwork)
+library(bnlearn)
+library(ggplot2)
+
+
+df <- read.csv("C:\\Users\\Ankit\\Desktop\\recent_features.csv")
+
+
+df <- as.numeric(df)
+
+df[1:35] <- lapply(df[1:35], as.numeric)
+df[36] <- lapply(df[36], as.factor)
+res <- hc(df)
+str(df)
+
+plot.network <- function(structure, ht = "400px"){
+  
+  nodes.uniq <- unique(c(structure$arcs[,1], structure$arcs[,2]))
+  
+  nodes <- data.frame(id = nodes.uniq,
+                      
+                      label = nodes.uniq,
+                      
+                      color = "darkturquoise",
+                      
+                      shadow = TRUE)
+  
+  
+  
+  edges <- data.frame(from = structure$arcs[,1],
+                      
+                      to = structure$arcs[,2],
+                      
+                      arrows = "to",
+                      
+                      smooth = TRUE,
+                      
+                      shadow = TRUE,
+                      
+                      color = "black")
+  
+  
+  
+  return(visNetwork(nodes, edges, height = ht, width = "100%"))
+  
+}
+
+
+
+
+plot.network(res)
+#df$
+plot(res)
+
+
+
+
+
+
+plot.network <- function(structure, ht = "400px"){
+  nodes.uniq <- unique(c(structure$arcs[,1], structure$arcs[,2]))
+  nodes <- data.frame(id = nodes.uniq,
+                      label = nodes.uniq,
+                      color = "darkturquoise",
+                      shadow = TRUE)
+  edges <- data.frame(from = structure$arcs[,1],
+                      to = structure$arcs[,2],
+                      arrows = "to",
+                      smooth = TRUE,
+                      shadow = TRUE,
+                      color = "black")
+  return(visNetwork(nodes, edges, height = ht, width = "100%"))
+}
\ No newline at end of file
-- 
GitLab