fork download
  1. # your code goes here
  2. import matplotlib.pyplot as plt
  3.  
  4. def plot_line(coefs):
  5. """
  6. рисует разделяющую прямую, соответствующую весам, переданным в coefs = (weights, bias),
  7. где weights - ndarray формы (2, 1), bias - число
  8. """
  9. w, bias = coefs
  10. a, b = - w[0][0] / w[1][0], - bias / w[1][0]
  11. xx = np.linspace(*plt.xlim())
  12. line.set_data(xx, a*xx + b)# your code goes here
Success #stdin #stdout 0.68s 273088KB
stdin
Standard input is empty
stdout
Standard output is empty