Last active
March 11, 2020 18:01
-
-
Save ramonrosa/6cf97b0539873ccb00f9fe37acf27b7e to your computer and use it in GitHub Desktop.
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 numpy as np | |
import matplotlib.pyplot as plt | |
def criar_dados_sinteticos(): | |
m = 10000 # numero de exemplos | |
D = 5 # numero de dimensoes | |
sigma=0.05 # desvio padrao da distribuicao do ruido | |
theta_sintetico = [1.5, 2.2, 1.7, -3.0, 0.3] # lista dos parâmetros theta (inventados) | |
X = np.random.uniform(low=0, high=1, size=(m, D)) | |
ruido = np.random.normal(size=(m,), scale=sigma) | |
y = X.dot(theta_sintetico).flatten() + ruido | |
return X, y | |
X, y = criar_dados_sinteticos() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment