This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(xgboost) | |
library(Matrix) | |
library(data.table) | |
library(vcd) | |
data(Arthritis) | |
df <- data.table(Arthritis, keep.rownames = F) | |
head(df[,AgeDiscret := as.factor(round(Age/10,0))]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(Hmisc) # useful for multi histogram | |
hist.data.frame(full) # histogram of each variable | |
pairs(full) # pairwise scatter plots | |
data = mx.symbol.Variable('data') | |
fc1 = mx.symbol.FullyConnected(data=data, num_hidden=7) | |
sigm1 = mx.symbol.Activation(data=fc1, act_type="relu") | |
fc2 = mx.symbol.FullyConnected(data=sigm1, num_hidden=2) | |
net = mx.symbol.SoftmaxOutput(data=fc2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(kohonen) | |
library(Hmisc) # useful for multi histogram | |
#loading client data | |
client <- read.csv(file = "C:/Users/eye1/Desktop/Customer Data.csv") | |
#Feature selection | |
data_train <- client[, c("NO_OF_PRODUCTS_6","Balance","LOGIN_DAYS_L3M", "ONLINE_TRANSACTION_L3M")]#data_train <- iris[c(1,2,3,4)] | |
#Explore the data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on Manuel Bernal's code | |
######## SOM GENERATOR ########### | |
#Loading Packages needed | |
library(png) # For writePNG function | |
library(kohonen) | |
library(shiny) | |
library(ggplot2) | |
library(jsonlite) | |
library(Hmisc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on Manuel Bernal's code | |
######## SOM GENERATOR ########### | |
#Loading Packages needed | |
library(png) # For writePNG function | |
library(kohonen) | |
library(shiny) | |
library(ggplot2) | |
library(jsonlite) | |
library(Hmisc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyUI(fluidPage( | |
titlePanel("Self-Organized-Maps"), | |
fluidRow( | |
sidebarPanel( | |
fileInput("file1", "Select CSV:", accept = c("text/csv", "text/comma-separated-values,text/plain", ".csv")), | |
selectInput("sep", label = "Separator", | |
choices = list("Coma" = ",", "Semicolon" = ";", "Tab" = "\t"), | |
selected = 1), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(mlbench) | |
require(caret) | |
require(MLmetrics) | |
require(plyr) | |
require(ade4) | |
data(Satellite) | |
summary(Satellite) | |
dim(Satellite) | |
my_data <- Satellite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(caret) | |
set.seed(1) | |
data<-read.csv(url('https://datahack-prod.s3.ap-south-1.amazonaws.com/train_file/train_u6lujuX_CVtuZ9i.csv')) | |
preProcValues <- preProcess(data, method = c("medianImpute","center","scale")) | |
library('RANN') | |
data_processed <- predict(preProcValues, data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RODBC) | |
library(tm) | |
library(wordcloud) | |
library(ggplot2) | |
library(ROracle) | |
a <- read.csv(file = 'C:/Users/eye1/Desktop/text.csv') | |
names(a) <- 'feedback' | |
narrative <- a$feedback | |
str(narrative) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(data.table) | |
#download data | |
flights <- fread("https://raw.githubusercontent.com/wiki/arunsrinivasan/flights/NYCflights14/flights14.csv") | |
flights | |
#Subset | |
flights[origin == "JFK" & month == 6L] # by column | |
flights[1:2] #by row |