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(stockPortfolio) | |
library(quadprog) | |
library(ggplot2) | |
stocks <- c("SPY", "EFA", "IWM", "VWO", "LQD", "HYG") | |
returns <- getReturns(stocks, freq = "week") | |
eff.frontier <- function (returns, | |
short = "no", | |
max.allocation = NULL, |
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
probabilityInsideCluster = 0.5 | |
probabilityOutsideCluster = 0.2 | |
probabilityNoise = 0.3 | |
clusterBoundaries = c(10, 25, 56, 81, 151, 293) | |
clientTypeCount = c(0, 0, 0, 0) | |
library(dplyr) | |
library(rpart) | |
# this create a frame of clients | |
makeClientsFrame = function(attribCount = 1000, | |
clientCount = 1000, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# if needed, install plotly via shell like so | |
%sh pip install plotly | |
#--- | |
%pyspark | |
import plotly | |
import numpy as np | |
from plotly.graph_objs import Scatter, Layout | |
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
%angular | |
<base href="http://demos.telerik.com/kendo-ui/gantt/index"> | |
<style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style> | |
<title></title> | |
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.3.1028/styles/kendo.common-material.min.css" /> | |
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.3.1028/styles/kendo.material.min.css" /> | |
<link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.3.1028/styles/kendo.material.mobile.min.css" /> | |
<script src="http://kendo.cdn.telerik.com/2016.3.1028/js/jquery.min.js"></script> |
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
from gensim.utils import simple_preprocess | |
tokenize = lambda x: simple_preprocess(x) | |
# tokenize("We can load the vocabulary from the JSON file, and generate a reverse mapping (from index to word, so that we can decode an encoded string if we want)?!") | |
import os | |
import json | |
import numpy as np | |
from gensim.models import Word2Vec |
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
require(mxnet) | |
batch.size = 32 | |
seq.len = 32 | |
num.hidden = 16 | |
num.embed = 16 | |
num.lstm.layer = 1 | |
num.round = 1 | |
learning.rate= 0.1 | |
wd=0.00001 | |
clip_gradient=1 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.