Skip to content

Instantly share code, notes, and snippets.

View ubless607's full-sized avatar

ubless607 ubless607

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def annot_min(x,y, ax=None):
xmax = x[np.argmin(y)]
ymax = np.array(y).min()
text= "x={:.3f}, y={:.3f}".format(xmax, ymax)
if not ax:
ax=plt.gca()
bbox_props = dict(boxstyle="square,pad=0.3", fc="w", ec="k", lw=0.72)
arrowprops=dict(arrowstyle="->",connectionstyle="angle,angleA=0,angleB=60", color='red')
kw = dict(xycoords='data',textcoords="axes fraction",
arrowprops=arrowprops, bbox=bbox_props, ha="right", va="top")
@ubless607
ubless607 / plot_learning_curve.py
Last active March 14, 2022 10:08
A simple function for plotting a learning curve of the model
def plot_learning_curve(log_df,
metric_name='loss',
rolling=False,
window_size=5,
ylim=(None, None), **kwargs):
'''
A simple function for plotting a learning curve of the model
Args:
log_df: input pandas Dataframe