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
''' | |
Python 3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09) | |
In [1]: import sklearn | |
In [2]: print(sklearn.__version__) | |
0.18.1 | |
''' | |
import pandas as pd | |
from sklearn.model_selection import KFold |
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 pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from sklearn.linear_model import Ridge, RidgeCV | |
# import seaborn as sns # failed to show marker with this line uncommented | |
# Load data (Hitters dataset) | |
hitters_df = pd.read_csv('https://raw.githubusercontent.com/selva86/datasets/master/Hitters.csv') | |
hitters_clean_df = hitters_df.dropna() | |
hitters_clean_df = pd.get_dummies(hitters_clean_df, drop_first=True) |
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
# Single-line version: | |
(?i)\b((?:https?:(?:\/{1,3}|[a-z0-9%])|[a-z0-9.\-]+\.(?:[a-z0-9]{2,13})\/)(?:[^\s()<>{}\[\]]+|\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\))+(?:\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’])|(?:(?<!@)[a-z0-9]+(?:[.\-][a-z0-9]+)*[.](?:[a-z0-9]{2,13})\b\/?(?!@)(?:[^\s()<>{}\[\]]+|\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\))+(?:\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))) | |
# Commented multi-line version: | |
(?xi) | |
\b | |
( # Capture 1: entire matched URL | |
(?: | |
https?: # URL protocol and colon |
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
hass:account | |
hass:alert | |
hass:alert-circle | |
hass:altimeter | |
hass:apple-safari | |
hass:apps | |
hass:arrow-bottom-left | |
hass:arrow-down | |
hass:arrow-left | |
hass:arrow-right |
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
#!/usr/bin/env bash | |
set -x -e | |
JUPYTER_PASSWORD=${1:-"myJupyterPassword"} | |
NOTEBOOK_DIR=${2:-"s3://myS3Bucket/notebooks/"} | |
# home backup | |
if [ ! -d /mnt/home_backup ]; then | |
sudo mkdir /mnt/home_backup | |
sudo cp -a /home/* /mnt/home_backup |