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
% Copyright Patrick Hall XXXX | |
\documentclass[fleqn]{article} | |
\renewcommand\refname{} | |
\title{XXXX} | |
\author{\copyright Patrick Hall XXXX} | |
\usepackage{graphicx} | |
\usepackage{fullpage} | |
\usepackage{pdfpages} |
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
def glm_grid(X, y, train, valid, family): | |
""" Wrapper function for penalized GLM with alpha and lambda search. | |
:param X: List of inputs. | |
:param y: Name of target variable. | |
:param train: Name of training H2OFrame. | |
:param valid: Name of validation H2OFrame. | |
:param: family: 'gaussian' for linear regression; 'binomial' for logistic. | |
:return: Best H2Omodel from H2OGeneralizedLinearEstimator |
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
iter_ = 0 | |
best_error = 0 | |
best_iter = 0 | |
best_model = None | |
col_sample_rates = [0.1, 0.5, 0.9] | |
subsamples = [0.1, 0.5, 0.9] | |
etas = [0.01, 0.001] | |
max_depths = [3, 6, 12, 15, 18] | |
reg_alphas = [0.01, 0.001] |
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
# load h2o library | |
library(h2o) | |
### set global constants ###################################################### | |
ip = 'localhost' # host to connect connect to h2o server | |
port = 54321 # port to connect connect to h2o server | |
nthreads = - 1 # number of threads to use, -1 indicates max. threads | |
max_mem_size = '12G' # defines amount of available memory, per node | |
dat = NULL # input data location | |
col.types = NULL # vector containing the column types, ['numeric', 'enum', ...] |
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 re | |
replace_char = '_' | |
source = 'he"l*&l# o@@' | |
target = re.sub(r'[-\/\\;,\s\.\/<>&\!:\"\)\(\*\+\?\|=#@]', replace_char, source) | |
target = re.sub(r"\'", replace_char, target) | |
print(target) |
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
git rm -r --cached . |
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
*'; *"; *); */; %mend; run; |
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
*** clear any previous results; | |
ods html close; | |
ods html; | |
*** display resolution of macro variables in log; | |
option symbolgen; | |
*** request detailed performance info; | |
options fullstimer; | |