You are on page 1of 1

SELECT id_cliente

FROM pedidos
GROUP BY id_cliente
HAVING COUNT(id) > (...)

SELECT id_cliente
FROM pedidos
GROUP BY id_cliente
HAVING COUNT(id) > (...) skl super avancado
import numpy as np

def gradient_descent(X, y, learning_rate=0.01, epochs=1000):


m, n = X.shape
theta = np.zeros(n)
history = np.zeros(epochs)

for i in range(epochs):
gradient = (1/m) * X.T @ (X @ theta - y)
theta = theta - learning_rate * gradient
history[i] = compute_cost(X, y, theta)

return theta, history

def compute_cost(X, y, theta):


m = len(y)
predictions = X @ theta
cost = (1/2*m) * np.sum(np.square(predictions-y))
return cost

# Exemplo de uso:
X = np.array([[1, 1], [1, 2], [1, 3]])
y = np.array([1, 2, 3])
theta, history = gradient_descent(X, y)

You might also like