Skip to content

Instantly share code, notes, and snippets.

View jacksonpradolima's full-sized avatar
🙃
Solving Problems like a charm

Jackson Antonio do Prado Lima jacksonpradolima

🙃
Solving Problems like a charm
View GitHub Profile
@jacksonpradolima
jacksonpradolima / friedman.test.with.post.hoc.R
Last active August 31, 2024 14:56
Friedman test with post-hoc using Bergmann-Hommel procedure
friedman.test.with.post.hoc <- function(data, alpha = 0.05)
{
print("Check if you missing the packages 'graph' and 'Rgraphviz'. Try to install them using bioconductor")
#source("http://bioconductor.org/biocLite.R")
#biocLite(c("graph","Rgraphviz"))
# Loading needed packages
if(!require(ggplot2))
{
prepare.data.statistical.test <- function(csvName = "teste.csv"){
#read the data
my_data <- read.csv(csvName, sep=";")
#replace the rownames with the instance (problem) names
row.names(my_data) <- my_data$Instance
#remove the Instance column
my_data <- my_data[,!(names(my_data) %in% c("Instance"))]
@jacksonpradolima
jacksonpradolima / evaluate.data.distribution.R
Last active November 29, 2016 17:07
Evaluate the data distribution
#' @title Evaluate the data distribution
#'
#' \code{evaluate.data.distribution} returns the data evaluation of a matrix,
#' This function contains the Shapiro-Wilk W test, and graphs and plots from DescTools and scmamp packages
#'
#' @description This function is a wrapper to evaluate when there is multiple comparison tests.
#' @param data
#' @param isEnglish
#' @return A list with the evaluation results
#'
@jacksonpradolima
jacksonpradolima / kruskal.test.with.post.hoc.R
Last active April 24, 2017 22:32
Kruskal-Wallist test with post-hoc using Nemenyi test with Critical Difference. Chi-squared is applied automatically when ties are present, otherwise Tukey is used as default.
#' @title Tests for multiple comparisons - Kruskal-Wallis with Post-hoc (when necessary)
#'
#' @description This function is a wrapper to multiple comparison tests.
#' @param value
#' @param group
#' @param data
#' @param alpha
kruskal.test.with.post.hoc <- function(value, group, data, alpha = 0.05, notch = FALSE, omm = FALSE)
{
print("If you would like export the data frames to LaTeX, we recommend to install and to use 'xtable'.")
# execute the function kruskal.test.with.post.hoc
#read the data
csv_file <- "kruskal_final_bisect.csv"
my_data <- read.csv(csv_file, sep=";")
result <- kruskal.test.with.post.hoc(my_data$Value, my_data$Group, my_data)
result
format(result$Nemenyi$p.value, scientific = TRUE)
format(result$Kruskal$p.value, scientific = TRUE)
@jacksonpradolima
jacksonpradolima / install.sh
Created April 4, 2017 19:03 — forked from domderen/install.sh
Installation of apache spark on ubuntu machine.
#!/bin/sh
# installation of Oracle Java JDK.
sudo apt-get -y update
sudo apt-get -y install python-software-properties
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get -y update
sudo apt-get -y install oracle-java7-installer
# Installation of commonly used python scipy tools
@jacksonpradolima
jacksonpradolima / spark_scala_zeppelin.txt
Created April 4, 2017 19:15
install_spark_scala_zeppelin
#check java instalation
java -version
#get path
echo $JAVA_HOME
#install java
sudo apt-get update
sudo apt-get install oracle-java8-installer
@jacksonpradolima
jacksonpradolima / install_all.sh
Last active April 4, 2017 20:09
Install scala, apache spark and apache zeppelin
#!/bin/sh
# Install JAVA
wget https://gist.githubusercontent.com/jacksonpradolima/1253019d0a63b07501b767fefc3531a8/raw/d10b827ecd752106ce99649c5137c04c6e09aff0/install_java.sh
source install_java.sh
# Install some python packages and tools
wget https://gist.githubusercontent.com/jacksonpradolima/a7de2799142c442021a55a71bf5fcacb/raw/f509db81b114ded277014af9e2e9d1c7cc902867/install_python_components.sh
source install_python_components.sh
@jacksonpradolima
jacksonpradolima / install_java.sh
Last active April 4, 2017 19:56
Install java
# installation of Oracle Java JDK
sudo apt-get -y update
sudo apt-get -y install python-software-properties
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get -y update
sudo apt-get -y install oracle-java8-installer
@jacksonpradolima
jacksonpradolima / install_python_components.sh
Created April 4, 2017 20:04
# Installation of commonly used python scipy tools
# Installation of commonly used python scipy tools
sudo apt-get -y install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose python-geopy python-seaborn
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo python -m pip install folium
sudo python -m pip install scikit-learn