This file contains hidden or 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
| c_profiler -> gives times of functions | |
| line_profiler -> gives times of line by lie | |
| #@profile -> needed for linebyline | |
| def func(): | |
| aklw;ejlkajselksjlkjaslkejawlkjwel;kaj | |
| terminal: python -m cProfile -s cumulative profileme.py | |
| terminal: kernprof -l -v profileme.py #todo cpu profiling line-by-line -> needs @profile for the func you need lbyl for | |
| terminal: python -m memory_profiler profileme.py #todo memory profiling -> need @profile for func you want memory details for |
This file contains hidden or 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
| find /users/username/onedrivepath/ -name ".DS_Store" -depth -exec rm {} \; |
This file contains hidden or 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
| **General File/Directory Commands** | |
| rm _fileName_ -> remove file | |
| rm -rf _dirName_ -> remove folder |
This file contains hidden or 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
| # include standard modules | |
| import argparse | |
| # initiate the parser | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("-V", "--version", help="show program version", action="store_true") #true of false b/c action | |
| parser.add_argument("-W", "--width", help="store width") #no set action = store value | |
| # read arguments from the command line | |
| args = parser.parse_args() |
This file contains hidden or 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
| # WRITE CODE BLOCK IN DEBUG CONSOLE (cmd shift D in anki main window) | |
| # RUN CODE w Cmd Return | |
| #GET ALL TAGS | |
| from aqt import mw | |
| out=mw.col.tags.all() | |
| for t in out: | |
| print(t) | |
This file contains hidden or 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
| git init | |
| git add . | |
| git commit -m "message" | |
| git remote add origin __URL__ | |
| git push -u origin master |
This file contains hidden or 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
| v host file | |
| /usr/local/etc/httpd/extra/httpd-vhosts.conf | |
| start apache | |
| sudo apachectl start | |
| start wsgi | |
| mod_wsgi-express start-server app.wsgi | |
| start wsgi nohup |
This file contains hidden or 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
| def get_data_lists(selected_col=[], indvGroupOnly=False): | |
| # Data input | |
| xls = pd.ExcelFile("final_data_NMR_DILC_comb.xlsx") | |
| day1_org = pd.read_excel(xls,"Day1") | |
| day3_org = pd.read_excel(xls,"Day3") | |
| day10_org = pd.read_excel(xls,"Day10-11") | |
| # print(selected_col) | |
| if len(selected_col)>0: |
This file contains hidden or 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
| TOP_FEATURES = len(feature_list) | |
| forest = RandomForestClassifier(n_estimators=10,max_depth=6)#, random_state=3) | |
| forest.fit(l_mat[1],l_label[1]) | |
| importances = forest.feature_importances_ | |
| std = np.std( | |
| [tree.feature_importances_ for tree in forest.estimators_], | |
| axis=0 | |
| ) |
This file contains hidden or 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
| feat_true, feat_top_rank = boruta_MP(l_mat,l_label,l_title,l_features,nest='auto',top_rank=5) | |
| # TRUE Feat | |
| l_cv = 3,5,6,7 | |
| times = 5 | |
| for i,feat in enumerate(true_feat_T10_R5_tres100): | |
| l_mat_true_T10_R5_tres100, l_label_true_T10_R5_tres100, l_title_true_T10_R5_tres100, _ = get_data_lists(feat) | |
| # print(feat) |