Skip to content

Instantly share code, notes, and snippets.

import numpy as np
# logistic regression.
# yi = sigmoid(dot(a * xi))
def sigmoid(x):
return 1 / (1 + np.exp(-x))
N = 1000
M = 2
@ferryzhou
ferryzhou / show_youtube_dl.sh
Last active July 5, 2018 17:21
youtube download
# Download youtube to mp3
youtube-dl -f bestaudio -x --audio-format mp3 -o '%(playlist)s/%(playlist_index)s – %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLByf7LdMdgugN_3Jms9fjJpNV6rS_eB2N
# Download playlist
youtube-dl -o '%(playlist)s/%(playlist_index)s – %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLByf7LdMdgugN_3Jms9fjJpNV6rS_eB2N
# Cut videos
ffmpeg -i movie.mp4 -ss 00:00:03 -t 00:00:08 -async 1 cut.mp4
# Download from ustream to mp4 so even partially downloaded data can be used
# $ jupyter notebook
# Right top, click New
# https://www.dataquest.io/blog/jupyter-notebook-tutorial/
# https://www.kaggle.com/janiobachmann/lending-club-risk-analysis-and-metrics