Skip to content

Instantly share code, notes, and snippets.

@alchemyst
alchemyst / compare.py
Last active October 4, 2016 18:05 — forked from sschnug/compare.py
Comparison of different approaches for SO-question https://goo.gl/MjADHs
import numpy as np
import time
from scipy.optimize import minimize, nnls
from cvxpy import *
np.random.seed(1)
""" Test-data generator """
def create_test_data(samples, features, noise, loc=10, scale=2.5):
m = np.random.normal(loc=loc, scale=scale, size=(samples, features))