This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distutils.core import setup | |
setup(name='packagename', | |
packages = ['packagename'], | |
version='0.1', | |
description='Brief Description HERE', | |
url='https://github.com/yourusername/packagename', | |
download_url = 'https://github.com/yourusername/packagename/archive/0.1.tar.gz', #FILL IN LATER | |
author='YOU', | |
author_email='YOUR EMAIL', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
''' | |
Here is a basic description of what these functions do! | |
Find more information at this link: Link to your GitHub/webpage here | |
''' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Brief description of what this function does. | |
Args: | |
argument1 (argument type, ie string): description of argument | |
argument2 (argument type, ie string): description of argument | |
Returns: | |
return1 (argument type, ie string): description of return | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cd directory | |
$git clone https://github.com/yourname/nameofpackage.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip install twine ## Only the first time you do this | |
#Repeat this every time you update your directory | |
$ cd local_package_directory | |
$ python setup.py sdist | |
$ twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[metadata] | |
description-file = README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd directory | |
$ git clone https://github.com/username/username.github.io.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
def LOOCV_featureselection(data, ids, outcomevar, dropcols, idcolumn, numestimators=1000): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Separate data for leave-one-person-out-cross-validation (LOOCV) | |
LOOCV_O = ids | |
data[idcolumn] = data[idcolumn].apply(str) | |
data_filtered = data[data[idcolumn] != LOOCV_O] | |
data_cv = data[data[idcolumn] == LOOCV_O] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Train data - all other people in dataframe | |
data_train = data_filtered.drop(columns=dropcols) | |
X_train = data_train.drop(columns=[outcomevar]) | |
feature_list = list(X_train.columns) #Get a feature list to use for importances later on | |
X_train= np.array(X_train) #Re-format as numpy array for input into model | |
y_train = np.array(data_train[outcomevar]) #Outcome variable here | |
OlderNewer