This is now an actual repo:
This file contains hidden or 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 math | |
| import numpy | |
| import random | |
| import decimal | |
| import scipy.linalg | |
| import numpy.random as nrand | |
| import matplotlib.pyplot as plt | |
| """ | |
| Note that this Gist uses the Model Parameters class found here - https://gist.github.com/StuartGordonReid/f01f479c783dd40cc21e |
This file contains hidden or 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
| package com.netease.mail | |
| import org.apache.spark.sql.SparkSession | |
| import org.apache.spark.ml.feature.CountVectorizer | |
| import org.apache.spark.ml.feature.StringIndexer | |
| import org.apache.spark.mllib.classification.LogisticRegressionWithLBFGS | |
| import org.apache.spark.mllib.classification.LogisticRegressionModel | |
| import org.apache.spark.sql.Row | |
| import org.apache.spark.ml.Pipeline | |
| import org.apache.spark.mllib.regression.LabeledPoint |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| import numpy as np | |
| import os | |
| import glob | |
| import cv2 | |
| import math | |
| import pickle | |
| import datetime |
This file contains hidden or 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
| #-*- coding: utf-8 -*- | |
| import logging | |
| from Queue import Queue | |
| import threading | |
| import urllib2 | |
| import time | |
| import random | |
| from bs4 import BeautifulSoup | |
| logging.basicConfig(level=logging.INFO) |
This file contains hidden or 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 python | |
| class BSTNode(object): | |
| """A node in the vanilla BST tree.""" | |
| def __init__(self, parent, k): | |
| """Creates a node. | |
| Args: | |
| parent: The node's parent. |
This file contains hidden or 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
| from math import log, floor, pow | |
| class MinMaxHeap(object): | |
| """an implementation of min-max heap using an array, | |
| which starts at 1 (ignores 0th element) | |
| """ | |
| def __init__(self, array=[]): | |
| super(MinMaxHeap, self).__init__() |
This file contains hidden or 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
| false_table = dict() | |
| true_table = dict() | |
| def possible_next_moves(m, n): | |
| for i in range(m): | |
| yield(i, n) | |
| for i in range(n): | |
| if m < i: | |
| yield(m, i) |
This file contains hidden or 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 fab(max): | |
| n, a, b = 0, 0, 1 | |
| while n < max: | |
| print b | |
| a, b = b, a + b | |
| n += 1 | |
| def fab2(max): | |
| n, a, b = 0, 0, 1 | |
| L = [] |