Skip to content

Instantly share code, notes, and snippets.

@naenumtou
Created November 28, 2022 09:27
Show Gist options
  • Save naenumtou/6d8b46414e5b4ede1819a62cc832181d to your computer and use it in GitHub Desktop.
Save naenumtou/6d8b46414e5b4ede1819a62cc832181d to your computer and use it in GitHub Desktop.
# Theil-Sen
TS = TheilSenRegressor()
TS.fit(X, y.ravel())
# Plot
plt.figure(figsize = (10, 6))
plt.scatter(
X,
y,
c = 'teal'
)
plt.plot(
X,
TS.predict(X),
c = 'magenta',
linewidth = 2,
)
plt.title('Theil-Sen Regression')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment