Skip to content

Instantly share code, notes, and snippets.

@kayhman
Last active October 6, 2020 08:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
import numpy as np
def linear_predictions(weights, inputs):
# y = weights[0] inputs[0] + weights[1] * inputs[1]
# where inputs[0] = 1.0
return np.dot(inputs, weights) * 60.0 # minutes
v_avg = 30 # km/h
startup_time = 2 /60.0 # hours
inputs = np.array([[1.0, 6.0],
[1.0, 4.0 ]])
weights = np.array([startup_time, 1.0 / v_avg]) # Program params are estimaed by experience, stats analysis, Least Square Error, ...
print("Predictions:", linear_predictions(weights, inputs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment