Skip to content
Snippets Groups Projects
Commit b88cb70f authored by shawk masboob's avatar shawk masboob
Browse files

Adding the stubbed functions py file

parent 6acbf824
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
# coding: utf-8
# # <center>Stub Functions and Automatic Documentation</center>
#
# <img src="https://pdoc3.github.io/pdoc/logo.png" width=30% alt="Sphinx logo">
# In[1]:
from sklearn import datasets
def dataload():
"""
upload toy datasets from scikit-learn
"""
data = None
return data
def datafetch(file_name):
"""
upload real world datasets from scikit-learn
"""
data = None
print("reading data from:", file_name)
return data
def descriptive_statistic(df):
"""
Provides brief descriptive statistics on dataset.
Takes dataframe as input.
"""
print("Type : ", None, "\n\n")
print("Shape : ", None)
print("Head -- \n", None)
print("\n\n Tail -- \n", None)
print("Describe : ", None)
def model_selection(df):
"""
Takes dateframe as input. Performs foward/backward stepwise
regression. Returns best model for both methods.
"""
null_fit = None
foward_step = None
backward_step = None
return foward_step, backward_step
def MSE_fit(fit):
"""
Takes in a fitted model as the input.
Calculates the MSU of the fitted model.
Outputs the model's MSE.
"""
MSE = None
return MSE
def accuracy_metrics(fit, MSE):
"""
This function is used for model validation. It returns a dictionary
of several regression model accuracy metrics. Its inputs are a fitted model
and the MSE of the fitted model.
"""
d = dict()
sumObj = None
SSE = None
n = None
p = None
pr = None
d['R2'] = None
d['R2ad'] = None
d['AIC'] = None
d['BIC'] = None
d['PRESS'] = None
d['Cp']= None
return d
# In[3]:
# test docstring
help(accuracy_metrics)
# In[ ]:
# test code
file_name = 'data.csv'
a = datafetch(file_name)
print(a)
b = descriptive_statistic(a)
print(b)
c = model_selection(a)
print(c)
d = MSE_fit(c)
print(d)
print(accuracy_metrics(c, d))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment