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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# Install h2o | |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# The following two commands remove any previously installed H2O packages for R. | |
if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) } | |
if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") } | |
# Next, we download packages that H2O depends on. | |
if (! ("methods" %in% rownames(installed.packages()))) { install.packages("methods") } |
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(xgboost) | |
library(Matrix) | |
library(data.table) | |
library(caret) | |
source('gini.R') | |
df <- read.csv('data/train.csv') | |
df.matrix <- model.matrix(Hazard~.-1,df) | |
set.seed(107) |
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
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
// THE SOFTWARE. | |
namespace Excel4 | |
{ |
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
open System | |
open System.Collections.Generic | |
open System.Collections.ObjectModel | |
open System.ComponentModel | |
open System.Threading | |
open Microsoft.FSharp.Control | |
open Microsoft.FSharp.Reflection | |
type Value = | |
| Dirty |
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
namespace Utility | |
{ | |
using System; | |
using System.Collections.Generic; | |
// based on: | |
//http://stackoverflow.com/questions/2852161/c-sharp-memoization-of-functions-with-arbitrary-number-of-arguments | |
public static class Memoizer | |
{ |
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(dplyr) | |
library(nycflights13) | |
conn <- nycflights13_sqlite() | |
flights_sql <- tbl(conn, 'flights') | |
weather_sql <- tbl(conn, 'weather') | |
`[.tbl_sql` <- function(x, condition) { | |
x %>% select_(condition) | |
} |
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(shiny) | |
shinyServer(function(input, output, session) { | |
# Return the components of the URL in a string: | |
output$urlText <- renderText({ | |
paste(sep = "", | |
"protocol: ", session$clientData$url_protocol, "\n", | |
"hostname: ", session$clientData$url_hostname, "\n", | |
"pathname: ", session$clientData$url_pathname, "\n", |
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
#!/bin/bash | |
set -o nounset -o errexit -o pipefail | |
IP_ADDR=$(/sbin/ifconfig eth0 | grep "inet addr" | cut -d ":" -f2 | cut -d " " -f1) | |
CONF_DIR="$HOME/.ipython/profile_default" | |
CONF_FILE="${CONF_DIR}/ipython_notebook_config.py" | |
mkdir -p "${CONF_DIR}" | |
cat <<EOF >>"${CONF_FILE}" |
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
"***************************************************************************** | |
"" Vim-PLug core | |
"***************************************************************************** | |
if has('vim_starting') | |
set nocompatible " Be iMproved | |
endif | |
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim') | |
let g:vim_bootstrap_langs = "html,javascript,python,scala" |