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
name: template-env | |
channels: | |
- conda-forge | |
- defaults | |
dependencies: | |
- bzip2=1.0.6=1 | |
- ca-certificates=2018.10.15=ha4d7672_0 | |
- certifi=2018.10.15=py36_1000 | |
- jupyterlab=0.35.4=py36_0 | |
- jupyterlab_server=0.2.0=py_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
# Name, domain and location are different colors | |
export PS1="\n\[\033[1;32m\]\u\[\033[1;30m\]@\[\033[34m\]\h \[\033[1;30m\]: \[\033[1;33m\]\w\[\e[0;31m\]\$(parse_git_branch)\n \[\033[m\]$ " | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
# Define aliases for frequent commands | |
alias ls='ls -GFh' | |
alias ..='cd ..' | |
alias ....='cd ../..' | |
alias lal='ls -al' |
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
syntax on | |
set tabstop=4 | |
set shiftwidth=4 | |
set autoindent | |
set expandtab | |
set smarttab |
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
# Code for plotting multiple plots | |
n_subplots = 8 | |
assert n_subplots%2 == 0, 'Use even number of subplots' | |
fig, axarr = plt.subplots(n_subplots//2,2) | |
fig.set_figwidth(15) | |
fig.set_figheight(4*axarr.shape[0]) | |
for numb, ax in enumerate(axarr.ravel()): | |
X = np.arange(10) |
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
# INPUT: pandas DataFrame | |
# Compute the correlation matrix | |
corr = df.corr() | |
# Generate a mask for the upper triangle | |
mask = np.zeros_like(corr, dtype=np.bool) | |
mask[np.triu_indices_from(mask)] = True | |
# Set up the matplotlib figure |
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 extract_results_GS(grid_scores): | |
""" | |
After applying gridsearch to a dataset, for all different combinations of parameters, an array of scores is | |
given in the grid_scores object of the estimator. The length of this array is equal to the number of fits of | |
the model. E.g. a model that is fit on three different train/test combinations, as happens in cross-validation. From that, the | |
mean validation score and standard deviation of the scores can be obtained. This function converts a | |
GridSearchCV.grid_scores_ object to a pandas DataFrame object. The frame is unsorted, because the best parameter | |
setting can be verified in the GridSearchCV.best_estimator_ and best_score_ properties. | |
""" | |