This file contains 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
set.seed(100) | |
N <- 10000000 | |
USER_NUM <- 25000 | |
MOVIE_NUM <- 10000 | |
dayOfWeek = rnorm(N, 6, 2) | |
partOfDay = c(1,2,3,3,4,4,4) | |
isRainOrSnow = c(0,0,0,1) | |
isRainOfSnowBefore = c(0,0,0,1) | |
temperature = c(0,1,2,3,4) | |
cameFrom = c(0,1,2,3,4,5,6,7) |
This file contains 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
# read dataset from local file | |
data <- read.csv("/Users/kostya/Downloads/abalone.data.csv", header=F) | |
# set names for dataframe columns | |
colnames(data) <- c('Sex', 'Length', 'Diameter', 'Height', 'WholeWeight', 'ShuckedWeight', | |
'VisceraWeight', 'ShellWeight', 'Rings') | |
# split dataset into train and test seta | |
train.size <- floor(0.9 * nrow(data)) |
This file contains 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(ggplot2) | |
# read dataset from local file | |
abalone <- read.csv("/Users/kostya/Downloads/abalone.data.csv", header=F) | |
# set names for dataframe columns | |
colnames(abalone) <- c('Sex', 'Length', 'Diameter', 'Height', 'WholeWeight', 'ShuckedWeight', | |
'VisceraWeight', 'ShellWeight', 'Rings') | |
# plot histogram |
This file contains 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
@Grab(group="org.seleniumhq.selenium", module="selenium-java", version="2.42.2") | |
import org.openqa.selenium.*; | |
import org.openqa.selenium.chrome.*; | |
System.setProperty("webdriver.chrome.driver", "/Users/kostya/Downloads/chromedriver"); | |
ChromeOptions chromeOptions = new ChromeOptions(); | |
chromeOptions.addArguments("--verbose", "--ignore-certificate-errors"); | |
WebDriver driver = new ChromeDriver(); |
This file contains 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(rmr2) | |
rmr.options(backend = "local") | |
#hdfs.init() | |
lm.map = | |
function(., line) { | |
keyval( line[[1]], paste(line[[2]], line[[3]], sep="|")) | |
} |
This file contains 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
# Spark scala project | |
mvn archetype:generate -B -DarchetypeGroupId=net.alchim31.maven -DarchetypeArtifactId=scala-archetype-simple -DarchetypeVersion=1.5 -DgroupId=org.apache.spark -DartifactId=<Project name> -Dversion=0.1-SNAPSHOT -Dpackage=org.apache.spark | |
# flink project | |
mvn archetype:generate \ | |
-DarchetypeGroupId=org.apache.flink \ | |
-DarchetypeArtifactId=flink-quickstart-scala \ | |
-DarchetypeVersion=0.9.1 \ | |
-DgroupId=org.apache.flink.quickstart \ | |
-DartifactId=flink-scala-project \ |
This file contains 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
import sys | |
import random | |
import datetime | |
TNX_NUM = int(sys.argv[1]) | |
ACCOUNT_NUM = int(sys.argv[2]) | |
RATES_NUM = int(sys.argv[3]) | |
PAR_ID = int(sys.argv[4]) | |
def get_random(top_limit): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
import tensorflow as tf | |
import numpy as np | |
print(tf.__version__) | |
def calc_fx1(fx, x): | |
return tf.gradients(fx, x)[0] | |
def calc_fx2(fx, x): | |
return tf.gradients(tf.gradients(fx, x)[0], x)[0] |
This file contains 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
from aws_xray_sdk.core import xray_recorder | |
@xray_recorder.capture("get_balance") | |
def get_balance(user_acc_id): | |
""" ... """ | |
... |