project 1 updated
This commit is contained in:
Binary file not shown.
@@ -30,8 +30,8 @@ print(diabetes.head())
|
||||
|
||||
# Summary on diabetes df
|
||||
print(diabetes.describe())
|
||||
# sns.pairplot(diabetes, hue='Outcome', diag_kind='hist')
|
||||
# plt.show()
|
||||
sns.pairplot(diabetes, hue='Outcome', diag_kind='hist')
|
||||
plt.show()
|
||||
sns.heatmap(diabetes.corr(), annot=True, square=True,
|
||||
annot_kws={"size": 12})
|
||||
# plt.tight_layout()
|
||||
|
||||
25
python/Supervised Learning/Training and Tuning/test.py
Normal file
25
python/Supervised Learning/Training and Tuning/test.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import functools
|
||||
from time import perf_counter
|
||||
|
||||
|
||||
class slowDown(object):
|
||||
"""docstring for slowDown"""
|
||||
def __init__(self, rate):
|
||||
if callable(rate):
|
||||
self.func = rate
|
||||
self.rate = 1
|
||||
else:
|
||||
self.rate = rate
|
||||
|
||||
def __get__(self, instance, owner=None):
|
||||
return functools.partial(self, instance)
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
if not hasattr(self, 'func'):
|
||||
self.func = args[0]
|
||||
return self
|
||||
start_time = perf_counter()
|
||||
self.func(*args, **kwargs)
|
||||
end_time = perf_counter()
|
||||
run_time = end_time - start_time
|
||||
print(f'Finished {self.func.__name__!r} in {run_time:.4f} secs')
|
||||
Reference in New Issue
Block a user