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
#' @title Assocation Rules Visualization Shiny App | |
#' @description Launches a Shiny App that provides an interactive interface to the visualizations of the \code{arulesViz} package. | |
#' The app allows users to mine rules based on all or just subsets of features, sort by criteria (lift, support, confidence) and visualize | |
#' using network graph, grouped bubble and scatter plots. \cr | |
#' Users filter rules to target only those with a certain variable on the RHS or LHS of the rule. | |
#' Rule mining is computed using the \link{apriori} algorithm from \code{arules}. | |
#' | |
#' @param dataset data.frame, this is the dataset that association rules will be mined from. Each row is treated as a transaction. Seems to work | |
#' OK when a the S4 transactions class from \code{arules} is used, however this is not thoroughly tested. | |
#' @param bin logical, \code{TRUE} will automatically discretize/bin numerical data into categorical features that can be used for association analysis. |
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
setwd('/home/rauf/Programs/DM_Labs/day_4') | |
require(igraph) | |
path <- "vk_data/adj/egonet_755.txt" | |
a<-read.table(path, sep=' ', dec = ' ', header = T) | |
#directed - T or F - в зависимости от значения, | |
#при Т - создает направленный граф, при F - ненаправленный | |
a.network <- graph.data.frame(a, directed = F) | |
a.network <- simplify(a.network) |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import vk_auth | |
import vkontakte | |
import os | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option("-e", "--email", dest="email", | |
help=" user email", metavar="EMAIL") |
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
# coding: utf-8 | |
import pprint | |
import pandas as pd | |
from rescuetime.api.service import Service | |
from rescuetime.api.access import AnalyticApiKey | |
s = Service.Service() | |
k = AnalyticApiKey.AnalyticApiKey(open('rt_key').read(), s) | |
p = {} |
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
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |
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
/* | |
For more detailed instructions on how to use this script, sign up with your email here: | |
http://adamloving.com/internet-programming/how-toexport-facebook-page-fans | |
DISCLOSURE: This javascript runs in your browser pretending to be you | |
looking through your page fans. Facebook should have no problem with this, | |
but who knows if they will think it is strange to see you looking through | |
all your fans so quickly (the script waits 3s before requesting each page). | |
I've had no problem running this so far for 1000s of page fans, but I |