├── .gitignore ├── LICENSE ├── Project.md ├── README.md ├── files ├── MLF2017_Midterm.pdf ├── MLF2018_Midterm.pdf ├── MLF2019_Midterm.pdf ├── MLF2021_Midterm.pdf ├── MLF2022_Midterm.pdf ├── MLF2023_Midterm.pdf ├── MLF_Bias_Variance_Metric.pdf ├── MLF_Col_Filtering.pdf ├── MLF_Finance_Research.pdf ├── MLF_Graphical_Model.pdf ├── MLF_Intro.pdf ├── MLF_Kernel_Method.pdf ├── MLF_Neural_Network.pdf ├── MLF_Notes.pdf ├── MLF_Regression.pdf ├── MLF_SVD_PCA_LDA.pdf ├── MLF_SVM_KNN_Tree.pdf ├── MLF_Sentiment.pdf ├── MLF_Topic_RecessionPrediction.pdf └── MLF_WordEmbedding.pdf ├── past-years ├── 2016.M3 │ └── Project_List.md ├── 2017.M3 │ ├── Project_List.md │ └── README.md ├── 2018.M1 │ ├── Project.md │ ├── README.md │ └── syllabus.pdf ├── 2019.M3 │ ├── Project.md │ └── README.md ├── 2021.M1 │ ├── Project.md │ └── README.md └── 2022.M3 │ ├── Project.md │ └── README.md ├── py ├── FRB_H15m.csv ├── Keras_Iris.ipynb ├── MLF 10 - PHBS test_prep.ipynb ├── Pandas-CrashCourse.ipynb ├── PythonCrashCourse_Derek_Banas.ipynb ├── PythonCrashCourse_Numpy.ipynb ├── ReturnMonthly2020.csv.gz └── TF_Keras_XOR.ipynb └── wiki ├── Alpha Go.md ├── Benfords law.md ├── Extra Reading.md ├── ML Books.md ├── Project Ideas.md ├── Python Resources.md └── Useful Links.md /.gitignore: -------------------------------------------------------------------------------- 1 | ######################################## 2 | ## USER-SPECIFIC 3 | ######################################## 4 | grading/ 5 | 6 | ######################################## 7 | ## PYTHON 8 | ######################################## 9 | # Byte-compiled / optimized / DLL files 10 | __pycache__/ 11 | *.py[cod] 12 | *$py.class 13 | 14 | # C extensions 15 | *.so 16 | 17 | # Distribution / packaging 18 | .Python 19 | build/ 20 | develop-eggs/ 21 | dist/ 22 | downloads/ 23 | eggs/ 24 | .eggs/ 25 | lib/ 26 | lib64/ 27 | parts/ 28 | sdist/ 29 | var/ 30 | wheels/ 31 | *.egg-info/ 32 | .installed.cfg 33 | *.egg 34 | MANIFEST 35 | 36 | # PyInstaller 37 | # Usually these files are written by a python script from a template 38 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 39 | *.manifest 40 | *.spec 41 | 42 | # Installer logs 43 | pip-log.txt 44 | pip-delete-this-directory.txt 45 | 46 | # Unit test / coverage reports 47 | htmlcov/ 48 | .tox/ 49 | .coverage 50 | .coverage.* 51 | .cache 52 | nosetests.xml 53 | coverage.xml 54 | *.cover 55 | .hypothesis/ 56 | .pytest_cache/ 57 | 58 | # Translations 59 | *.mo 60 | *.pot 61 | 62 | # Django stuff: 63 | *.log 64 | local_settings.py 65 | db.sqlite3 66 | 67 | # Flask stuff: 68 | instance/ 69 | .webassets-cache 70 | 71 | # Scrapy stuff: 72 | .scrapy 73 | 74 | # Sphinx documentation 75 | docs/_build/ 76 | 77 | # PyBuilder 78 | target/ 79 | 80 | # Jupyter Notebook 81 | .ipynb_checkpoints 82 | 83 | # pyenv 84 | .python-version 85 | 86 | # celery beat schedule file 87 | celerybeat-schedule 88 | 89 | # SageMath parsed files 90 | *.sage.py 91 | 92 | # Environments 93 | .env 94 | .venv 95 | env/ 96 | venv/ 97 | ENV/ 98 | env.bak/ 99 | venv.bak/ 100 | 101 | # Spyder project settings 102 | .spyderproject 103 | .spyproject 104 | 105 | # Rope project settings 106 | .ropeproject 107 | 108 | # mkdocs documentation 109 | /site 110 | 111 | # mypy 112 | .mypy_cache/ 113 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Peking University HSBC Business School 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Project.md: -------------------------------------------------------------------------------- 1 | # Course Project 2 | 3 | ## Team List (Presentation Order) 4 | 5 | Group | Members | Repo 6 | --- | --- | --- 7 | 0 | Feng Xi | [Detecting Financial Fraud with First Digit Law](https://github.com/pkujackfeng/MLF_final_project/blob/main/README.md) 8 | 1 | Yang Hengyi | [Credit Default Prediction (HSBC)](https://github.com/YHY-10/CreditDefault-Prediction) 9 | 2 | Ma Fangyuan, Zhu Zerun | [Credit Default Prediction (HSBC)](https://github.com/WatchMtLiu/PHBS_MLF_2024/blob/main/README.md) 10 | 3 | Zhang Yuyang, Ge Ruiyang | [Usage of transaction data to predict credit event (HSBC)](https://github.com/Allwings1/MLF_Project) 11 | 4 | Xiong Zichao, Yuan Yutao | [Recession Identification and Prediction](https://github.com/ZichaoXiong/Recession/blob/main/README.md) 12 | 5 | Li Yuhui | [Prediction of BTC price with Tweets(X) data](https://github.com/Dracarys397803/PHBS_MLF_2023/blob/main/README.md) 13 | 6 | Gong Jiaxin, Wang Xin | [Stock Prediction Based on Report Similarity](https://github.com/ShawnWangXin/PHBS_MLF_2023/blob/main/Project/README.md) 14 | 7 | Cheng Lei, Li Chang | [How to Capture the Patterns of Price and Volume data in Long Time Series](https://github.com/lca-123/PHBS_MLF_2023/blob/master/final_project/README.md) 15 | 8 | Zhang Qiuyan, Pan Kangyu | [Home Credit - Credit Risk Model Stability](https://github.com/zsevenn/Credit-risk-prediction/) with [Kaggle data](https://www.kaggle.com/competitions/home-credit-credit-risk-model-stability/overview) 16 | 9 | Chen Yichao, Yang Honggui | [Credit Default Prediction (HSBC)](https://github.com/yanghonggui12581/MLF_final_project) 17 | 10 | Niu Yitong Niu, Deng Tingqin | [Home Credit - Credit Risk Model Stability](https://github.com/LilyYitong23/LilyYitong23-PHBS_MLF_2023/blob/main/project%20final%20version.md) with [Kaggle data](https://www.kaggle.com/competitions/home-credit-credit-risk-model-stability/overview) 18 | 19 | ## Project Guidline 20 | * Report should be consist of the summary in `README.md` and the execution in python notebooks `.ipynb`. ( `.pdf`, `.ppt`, `.doc` __NOT__ accepted.) 21 | * In the `README.md` summary, 22 | * You may update your proposal file. 23 | * briefly describe your motivation, goal, data source, result and conclusion. 24 | * A few figure or table for summary is recommended. 25 | * Use links to data or `.ipynb` files (see past year examples below) 26 | * In the `.ipynb` execution, 27 | * Put command cell and edit cell (comments) in a balanced way. (Do not only put code!) 28 | * Put a brief table of contents with links (example: __PML__) 29 | * You may breakdown code into several `.ipynb` files by function (e.g., data cleaning, learning, result analysis). In that case, make sure to __save__ intermediate result into file so that I can run the later steps (result analysis) without running previous steps (data cleaning, learning). 30 | * The use of `.py` file should be strictly restricted to function or class only. (Do not put any learning procedure in `.py`) 31 | * I should be able to reproduce the result from your code. Your code should run with no error. Code with error will be severely deduct your score. Make sure to run your code in a new session. 32 | * Other considerations: 33 | * Make sure the workload within team is balanced. (Add your team members to collaborators, each team members commit codes, etc) 34 | * There should be no secret component (e.g., stock trading strategy) 35 | * Creative (out-of-textbook) ideas are recommended for better result or result analysis 36 | * Deadline for updating report is __11.21 Sunday Midnight (11:59 PM)__ 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Machine Learning for Finance (FN 570) 2023-24 Module 3 (Spring 2024) 2 | 3 | ## Announcements 4 | * The WeChat group will be created by TA. (No 1-to-1 chat please.) 5 | * Email is the preferred method of communication. The class mailing list will be created as PHBS.MLF@allmail.net. 6 | 11 | 12 | ## Course Resources 13 | * Course slides: [Intro](files/MLF_Intro.pdf) | [Regression](files/MLF_Regression.pdf) | [SVM/KNN/Tree](files/MLF_SVM_KNN_Tree.pdf) | [SVD/PCA/LDA](files/MLF_SVD_PCA_LDA.pdf) | [Hyperparameter](files/MLF_Bias_Variance_Metric.pdf) | [Sentiment / Word Embedding](files/MLF_WordEmbedding.pdf) | [Neural Network](files/MLF_Neural_Network.pdf) | [Graphical Model](files/MLF_Graphical_Model.pdf) | [Finance Research](files/MLF_Finance_Research.pdf) 14 | * Project: [Current](Project.md) | [2022](past-years/2022.M3/Project.md) | [2021](past-years/2021.M1/Project.md) | [2019](past-years/2019.M3/Project.md) | [2018](past-years/2018.M1/Project.md) | [2017](past-years/2017.M3/Project_List.md) | [2016](past-years/2016.M3/Project_List.md) 15 | * Past years' exam: [2023](files/MLF2023_Midterm.pdf) | [2022](files/MLF2022_Midterm.pdf) | [2021](files/MLF2021_Midterm.pdf) | [2019](files/MLF2019_Midterm.pdf) (online take-home) | [2018](files/MLF2018_Midterm.pdf) | [2017](files/MLF2017_Midterm.pdf) | [Exams from Tom Michell's ML course](http://www.cs.cmu.edu/~tom/10701_sp11/prev.shtml) (Carnegie Mellon University) 16 | 17 | 21 | 22 | ## Lectures: 23 | No | Date | Contents 24 | --- | :---: | --- 25 | __01__ | 2.20 Tue | Course overview ([Syllabus](#syllabus)) \| Required software (Python, Github, PyCharm) \| Python crash course ([Basic](py/PythonCrashCourse_Derek_Banas.ipynb), [Numpy](py/PythonCrashCourse_Numpy.ipynb) (Notebook Shorcut Keys), [Pandas](py/Pandas-CrashCourse.ipynb). Also see [Datacamp](https://www.datacamp.com/community/blog/python-pandas-cheat-sheet), [CheatSheet](https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf)) 26 | __02__ | 2.23 Fri | __PML__ Ch. 1: Intro ([Slides](files/MLF_Intro.pdf)) \| Notations, Regression, Weight update ([Slides](files/MLF_Regression.pdf)) 27 | __03__ | 2.27 Tue | __PML__ Ch. 2: Perceptron, Adaline, Gradient descent, Stochastic Gradient Descent 28 | __04__ | 3.01 Fri | __PML__ Ch. 3: Logistic Regression (LR) ([Slides](files/MLF_Regression.pdf)) and Support Vector Machine (SVM) ([Slides](files/MLF_SVM_KNN_Tree.pdf)) 29 | __05__ | 3.05 Tue | __PML__ Ch. 3: KNN ([Slides](files/MLF_SVM_KNN_Tree.pdf), [Code](https://github.com/PHBS/python-machine-learning-book-3rd-edition/blob/master/ch03/ch03.ipynb)), Decision Tree ([Slides](files/MLF_SVM_KNN_Tree.pdf)). 30 | __06__ | 3.08 Fri | __PML__ Ch. 4: Data Preprocessing, __PML__ Ch. 5: SVD/PCA ([Slides](MLF_SVD_PCA_LDA.pdf)) 31 | __07__ | 3.12 Tue | __PML__ Ch. 5: LDA ([Slides](MLF_SVD_PCA_LDA.pdf)), __PML__ Ch. 6: Bias-Variance, Cross-validation ([Slides](files/MLF_Bias_Variance_Metric.pdf)) 32 | __08__ | 3.15 Fri | __PML__ Ch. 6: Hyperparameter tuning, Evaluation Metric, Class imbalance ([Slides](files/MLF_Bias_Variance_Metric.pdf)) 33 | __09__ | 3.19 Tue | __PML__ Ch. 7: Ensenble Learning ([Slides](files/MLF_SVM_KNN_Tree.pdf)), Kernel Method ([Slides](files/MLF_Kernel_Method.pdf), __PML__ Ch 3, 5) 34 | __14__ | 3.22 Fri | __HSBC Guest Lecture [1/4]__: Overview and data introduction. 35 | __10__ | 3.26 Tue | __PML__ Ch. 8: Sentiment Analysis ([Slides](files/MLF_Sentiment.pdf)) 36 | __11__ | 3.29 Fri | Topics in Finance ML: Recession prediction ([Slides](files/MLF_Topic_RecessionPrediction.pdf)), ML in Finance Research ([Slides](files/MLF_Finance_Research.pdf)), Collaborative Filtering ([Slides](files/MLF_Col_Filtering.pdf)) 37 | __12__ | 4.02 Tue | Neural Network, Deep Learning, CNN ([Slides](files/MLF_Neural_Network.pdf), __PML__ Ch. 12-15) 38 | __13__ | 4.07 Sun | __Midterm Exam__ (In Class) 39 | __15__ | 4.09 Tue | __HSBC Guest Lecture [2/4]__ 40 | __16__ | 4.12 Fri | __HSBC Guest Lecture [3/4]__ 41 | __17__ | 4.16 Tue | __HSBC Guest Lecture [4/4]__ 42 | __18__ | 4.19 Fri | Course Project Presentation (may be scheduled later) 43 | 44 | 65 | 66 | ## Homeworks: 67 | * ### __Set 0: [Required Software]__ [Due by Friday] 68 | * Register on [Github.com](https://github.com/) and let TA know your ID. Make sure to use your __full real name__ in your profile. Accept TA's invitation to the [PHBS organization](https://github.com/orgs/PHBS/people). 69 | * Create a designated repository `GITHUB_ID/PHBS_MLF_2023` for your HW and project. Tick `Initialize this repository with a README` and select `python` under `.gitignore` 70 | * Fork [PML repository](https://github.com/PHBS/python-machine-learning-book-3rd-edition) to your repository. 71 | * Install [Github Desktop](https://desktop.github.com/). Then __clone__ the PML repository to your local storage. 72 | * Install [Anaconda](https://www.anaconda.com/download/) Python distribution (__3.X version__, not 2.X version). Anaconda distribution is core Python + useful scientific computation libraries (e.g., numpy, scipy, pandas) + package management system (pip or conda) 73 | * Install [PyCharm](https://www.jetbrains.com/pycharm/) Community version. (Or Professional version after applying for [free student license](https://www.jetbrains.com/student/)) 74 | * Send to TA the screenshots of (1) Github Desktop (showing the PML repository) (2) Jupyter Notebook (Anaconda) (3) PyCharm (See my examples: [Github Desktop](https://github.com/PHBS/ASP/blob/master/files/Choi_Jaehyuk_Github.png), [Anaconda Spyder](https://github.com/PHBS/ASP/blob/master/files/Choi_Jaehyuk_Python.png)). 75 | * ### __Set 1: [Classifiers]__ [Due by 3.19 Tues] 76 | * The goal of this HW is to be familiar with the basic classifiers __PML__ Ch 3. 77 | * For this HW, we will use [Give Me Some Credit](https://www.kaggle.com/c/GiveMeSomeCredit) on Kaggle. You may download it from the Kaggle link or CMS. 78 | * Load `cs-training.csv` into a Pandas dataframe. 79 | * Fill-in the missing values (`nan`) with the column means. (Use `pd.fillna()` or See Ch 4 of `PML`) 80 | * Select the 2 most important features using LogisticRegression with L1 penalty. (Adjust C until you see 2 features) 81 | * Using the 2 selected features, apply LR / SVM / decision tree. Try your own hyperparameters (C, gamma, tree depth, etc) to maximize the prediction accuracy. (Just try several values. You don't need to show your answer is the maximum.) 82 | * Visualize your classifiers using the `plot_decision_regions` function from __PML__ Ch. 3 83 | * Put your result in `YOUR_GITHUB_ID/Give-Me-Some-Credit/code/Classifiers.ipynb` 84 | * ### __Set 2: [PCA/Hyperparameter/CV]__ [Due by 3.29 Fri] 85 | * The goal of this HW is to be familiar with PCA (feature extraction), grid search, pipeline, k-fold CV. 86 | * For this HW, we continue to use [Give Me Some Credit]([http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data](https://www.kaggle.com/datasets/brycecf/give-me-some-credit-dataset)) on Kaggle. 87 | * Extract a few (>2) features using PCA method. 88 | * Using the selected features from above, we are going to apply LR / SVM / decision tree (or any other algorithm). 89 | * Implement the methods using pipeline. (__PML__ p185) 90 | * Use grid search for finding optimal hyperparameters. (__PML__ p199). In the search, apply 5-fold cross-validation. 91 | 92 | *** 93 | # Syllabus 94 | 95 | ## Classes: 96 | * Lectures: Tuesday & Friday 1:30 – 3:20 PM 97 | * Venue: PHBS Building, Room 313 98 | 99 | ## Instructor: [Jaehyuk Choi](http://www.jaehyukchoi.net/phbs_en) 100 | * Office: PHBS Building, Room 755 101 | * Phone: 86-755-2603-0568 102 | * Email: jaehyuk@phbs.pku.edu.cn 103 | * Office Hour: Monday 7-9 PM 104 | 105 | ## Teaching Assistance: 苏南 (Nan SU) 106 | * Email: sunan@stu.pku.edu.cn 107 | * TA Office Hour (Room 213/214): TBA 108 | 109 | ## Course overview 110 | With the advent of computation power and big data, machine learning (ML) recently became one of the most spotlighted research fields in industry and academia. This course provides a broad introduction to ML in theoretical and practical perspectives. Through this course, students will learn the intuition and implementation behind the popular ML methods and gain hands-on experience in using ML software packages such as SK-learn and Tensorflow. This course will also explore the possibility of applying ML to finance and business. Each student is required to complete a final course project. 111 | __This year, the compliance analytics team in HSBC bank (Gunagzhou) will give 4 guest lectures to demonstrate how ML is developed and shared in banking industry.__ 112 | 113 | ## Prerequisites 114 | This course assumes prior knowkedge in probability/statistics and experience in Python. This course is ideally recommended for those who have taken introductory ML/AI courses from an undergraduate program. 115 | 116 | ## Textbooks and Reading Materials 117 | ### Primary textbook 118 | * __PML__ (primary textbook): Python Machine Learning 3rd Ed. by Sebastian Raschka. 119 | * [Github](https://github.com/PHBS/python-machine-learning-book-3rd-edition) (PHBS fork) 120 | ### Other books and online courses 121 | * __ISLR__: [An Introduction to Statistical Learning (with Applications in R)](http://faculty.marshall.usc.edu/gareth-james/ISL/) by James, Witten, Hastie, and Tibshirani 122 | * Python Implementation: [PHBS/ISLR-python](https://github.com/PHBS/ISLR-python) (PHBS fork) 123 | * __Bishop__: Pattern Recognition and Machine Learning by Bishop (Microsoft) 124 | * __ESL__: [The Elements of Statistical Learning](https://web.stanford.edu/~hastie/ElemStatLearn/) by Hastie, Tibshirani, and Friedman 125 | * __CML__: [Coursera Machine Learning](https://www.coursera.org/learn/machine-learning) by Andrew Ng 126 | * __DL__: [Deep Learning](http://www.deeplearningbook.org/) by Goodfellow, Bengio, and Courville 127 | * __AFML__: [Advances in financial machine learning](https://www.amazon.com/Advances-Financial-Machine-Learning-Marcos/dp/1119482089) by López de Prado 128 | 131 | 132 | ## Assessment / Grading Details 133 | * Attendance 20%, Mid-term exam 30%, Assignments 20%, Course Project 30% 134 | * Attendance: Randomly checked. The score is calculated as __`20 – 2x(#of absence)`__. Leave requests should be made 24 hours before with supporting documents, except for emergencies. Job interview/internship cannot be a valid reason for leave. 135 | * __Mid-term exam__: __11.1 Mon__. In-class open-book without computer/phone/calculator 136 | * __Course project__: Data Proposal and Presentation. Group of up to ?? people. 137 | * __Grade__ in letters (e.g., A+, A-, ... ,D+, D, F). __A- or above < 30% and B- or below > 10%__. 138 | -------------------------------------------------------------------------------- /files/MLF2017_Midterm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF2017_Midterm.pdf -------------------------------------------------------------------------------- /files/MLF2018_Midterm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF2018_Midterm.pdf -------------------------------------------------------------------------------- /files/MLF2019_Midterm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF2019_Midterm.pdf -------------------------------------------------------------------------------- /files/MLF2021_Midterm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF2021_Midterm.pdf -------------------------------------------------------------------------------- /files/MLF2022_Midterm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF2022_Midterm.pdf -------------------------------------------------------------------------------- /files/MLF2023_Midterm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF2023_Midterm.pdf -------------------------------------------------------------------------------- /files/MLF_Bias_Variance_Metric.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Bias_Variance_Metric.pdf -------------------------------------------------------------------------------- /files/MLF_Col_Filtering.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Col_Filtering.pdf -------------------------------------------------------------------------------- /files/MLF_Finance_Research.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Finance_Research.pdf -------------------------------------------------------------------------------- /files/MLF_Graphical_Model.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Graphical_Model.pdf -------------------------------------------------------------------------------- /files/MLF_Intro.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Intro.pdf -------------------------------------------------------------------------------- /files/MLF_Kernel_Method.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Kernel_Method.pdf -------------------------------------------------------------------------------- /files/MLF_Neural_Network.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Neural_Network.pdf -------------------------------------------------------------------------------- /files/MLF_Notes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Notes.pdf -------------------------------------------------------------------------------- /files/MLF_Regression.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Regression.pdf -------------------------------------------------------------------------------- /files/MLF_SVD_PCA_LDA.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_SVD_PCA_LDA.pdf -------------------------------------------------------------------------------- /files/MLF_SVM_KNN_Tree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_SVM_KNN_Tree.pdf -------------------------------------------------------------------------------- /files/MLF_Sentiment.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Sentiment.pdf -------------------------------------------------------------------------------- /files/MLF_Topic_RecessionPrediction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_Topic_RecessionPrediction.pdf -------------------------------------------------------------------------------- /files/MLF_WordEmbedding.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/files/MLF_WordEmbedding.pdf -------------------------------------------------------------------------------- /past-years/2016.M3/Project_List.md: -------------------------------------------------------------------------------- 1 | # Topics in Quantitative Finance: Machine Learning for Finance (2016-17 M3) 2 | 3 | ### Lecture note: [Link](Lectures/Notes%20TFQ.pdf) 4 | 5 | ### Project proposal on 3/27 (Monday). 6 | Please upload a short writeup of your project proposal. Eash student will present the proposal in Monday's class (about 5 minutes). 7 | 8 | [2017/02/21] Notice 9 | * I started creating Wiki page. Anyone in the team can edit the contents of Wiki, so I am looking forward to your participation. You're welcome to share any Chinese resources related to our course. 10 | * I realized that you CANNOT request to join github.com/PHBS. If you already created an account, email me (jaehyuk _AT_ phbs.pku.edu.cn) your github ID so that I send you an invitation to join both PHBS organization and the [team](https://github.com/orgs/PHBS/teams/2016-tqf-ml). 11 | * [This](http://blog.codeeval.com/codeevalblog/2015#.WKwjb1WGOUk=) is why you have to learn Python! 12 | 13 | ## List of student projects 14 | 15 | * Giuseppe Cavallaro: [Credit card fraudolent transactions](https://github.com/GiuseppeCavallaro/2016.M3.TQF-ML.Credit.Card.Fraud) 16 | * Kaiwen Zhou: [Boosting factors in stock market](https://github.com/kevin583475378/2016.M3.TQF-ML.Project) 17 | * Angelina (刘晨茹): [Recommend Commodity system](https://github.com/LiuChenru/2016.M3.TQF-ML.Commodity1) 18 | * Jiayu Cai (蔡佳宇): [Cross currency basis prediction](https://github.com/JiayuCai/2016.M3.TQF-ML.cross-currecy-basis) 19 | * Zhiyun CHEN (陈之昀): [HMM for stock market](https://github.com/chenzhiyunacg/2016.M3.TQF-ML.hmmPrediction) 20 | * Fu Lucheng (扶禄城): [Stock price prediction by multi factor model](https://github.com/1601213521/2016.M3.TQF-ML.relative-stock-price-prediction-by-multi-factor-model) 21 | * Weihang Lian (连伟航): [Fund performance attribution and estimation](https://github.com/1501213456/2016.M3.TQF-ML.FundPerformanceAttribution) 22 | * Yadong Ma (马亚东): [Predicting alpha with RandomForest](https://github.com/YadongMa/2016.M3.TQF-ML.RandomForest_FactorModel) 23 | * Luqi Ye (叶路奇): [Prediction of high bonus shares in Chinese stock market](https://github.com/goodgoodye/2016.M3.TQF-ML.Chinese-Stock-High-Bonus-Share-Prediction) 24 | 25 | * Ming Yin (印明): [Handwritten digit recognition](https://github.com/YMBUAA/2016.M3.TQF-ML.Handwritten-digit-recognition) 26 | * Yifan Ding (丁一凡): [Bryant Kobe's shot analysis](https://github.com/IvonDing/2016.M3.TQF-ML.Kobe_Shot_Selection) 27 | * Henry Kyle: [Predicting House Prices](https://github.com/henrypku/2016.M3.TQF-ML.HousePrices) 28 | * Wang Yu (汪雨): [Hotel review sentiment analysis](https://github.com/renee-wangyu/2016.M3.TQF-ML.HotelReviewSentiment) 29 | * Lipeng YU (余力鹏): [Forest fire predictoin](https://github.com/yulipeng0508/2016.M3.TQF-ML.ForestFiresPrediction) 30 | * Erdi Tac: [News keywords clustering](https://github.com/erditacPHBS/2016.M3.TQF-ML.Keyword.Clustering) 31 | * Michal Topinka: [Loan Default Prediction](https://github.com/mitopi001/2016.M3.TQF-ML.Loan-Default-Prediction) 32 | * Tianhang Yao (姚天航): [Stephen Curry's shot analysis](https://github.com/AlYao2017/2016.M3.TQF-ML.Curry-Shot-Analysis) 33 | * Long Shuyi (龙书翼): [Find efficient factors and predict stocks' return](https://github.com/a1024761/2016.M3.TQF-stock-return-prediction) 34 | -------------------------------------------------------------------------------- /past-years/2017.M3/Project_List.md: -------------------------------------------------------------------------------- 1 | # List of Projects (2017-18 M3) 2 | * [AtomMe](https://github.com/AtomMe/PHBS_TQFML/tree/master/Project/Credit) [x1]: The Prediction of Credit User's Overdue event Based on Machine Learning Method ([Competition](https://open.chinaums.com/#/intro)) 3 | * [kylinanddragon](https://github.com/kylinanddragon/GITHUB_1701213097-PHBS_TQFML-Project) [x1]: Individual P2P data of RenRenDai 4 | * [ZheshengZhang](https://github.com/ZheshengZhang/ZheshengZhang-PHBS_TQFML-Project) [x1]: LSTM-based method for stock returns prediction 5 | * [MattaUmaMaheswaraReddy](http://www.github.com/MattaUmaMaheswaraReddy/PHBS_ML_Project) [x2]: Housing Price (Kagggle) 6 | * [diyawang](https://github.com/diyawang/PHBS_TQFML) [x4]: Factors affecting bank competitive power 7 | * [JOY199603](https://github.com/JOY199603/2017.M3.TQF-Forcasting-price-change-on-IPO-day) [x1]: Forecasting the Price Change on IPO day 8 | * [zhang-yunhe](https://github.com/zhang-yunhe/PHBS_TQFML-Project) [x1]: Predicting default of credit cards clients (UCI) 9 | * [Louie-Lin](https://github.com/Louie-Lin/PHBS_TQFML/tree/master/Project) [x1]: Credit card default (UCI) 10 | * [thomasraph](https://github.com/thomasraph/PHBS_TQFML/) [x1]: High crime area using cryptocurrencies 11 | * [callmebyd](https://github.com/callmebyd/PHBS_TQFML/tree/master/Project) [x4]: Lending Club Loan Data (Kaggle) 12 | * [SunHao95](https://github.com/SunHao95/PHBS_TQFML-Stock-Index-Prediction-based-on-Wavelet-Transformation-and-ARIMA-ML-Model-or-TEA-ML-Model) [x1]: Stock Index Prediction based on Wavelet Transformation and ARIMA-ML Model or TEA-ML Model 13 | * [zsq96512](https://github.com/zsq96512/zsq96512-PHBS_TQFML-Project) [x2]: FX rate prediction 14 | * [Michaelpku](https://github.com/Michaelpku/PHBS_TQFML) [x1]: HCC Survival Data Set (UCI) 15 | * [stuartphbs](https://github.com/stuartphbs/PHBS_TQFML-/tree/master/Project) [x1]: Wine Quality (UCI) 16 | * [yipanglin](https://github.com/yipanglin/PHBS_TQFML/tree/master/Project) [x1]: NBA MVP prediction 17 | * [DengQingqin](https://github.com/DengQingqin/PHBS_TQFML-Sentiment-Measures-on-Stock-Market) [x1]: Sentiment Measures on Stock Market 18 | * [LeiZHANG1995](https://github.com/LeiZHANG1995/PHBS_TQFML/tree/master/Project) [x4]: Bitcoin price prediction 19 | * [zouqinjing](https://github.com/zouqinjing/PHBS_TQFML/tree/master/Project) [x1]: Breast tumor 20 | * [xiechenpku](https://github.com/xiechenpku/PHBS_TQFML/tree/master/Project) [x1]: League of Legends matches (Kaggle) 21 | * [1994115](https://github.com/zzg1994115/PHBS_TQFML/tree/master/Project) [x1]: League of Legends matches (Kaggle) 22 | * [perfectyayra](https://github.com/perfectyayra/PHBS_TQFML) [x3]: Momentum TRADING WITH MACHINE LEARNING METHODOLOGIES 23 | * [evanleungc](https://github.com/evanleungc/PHBS_TQFML/blob/master/Project) [x4]: Predict low-risk profitable trading opportunity with high frequency trading data 24 | * [labro](https://github.com/labro/PHBS_TQFML/tree/master/Project) [x2]: An investment model based on stock price info and stock revivews on the intenet 25 | * [YedaDu](https://github.com/YedaDu/PHBS_TQFML_Project) [x4]: Idiosyncratic Market Value Factor: explaining market value by machine learning methods 26 | * [UvoChow](https://github.com/UvoChow/PHBS_TQFML/tree/master/Project) [x1]: Sentiment Analysis of Guba Forum 27 | * [ansonwongphbs](https://github.com/ansonwongphbs/PHBS_TQFML) [x1]: TBA 28 | 29 | # Course Project Guideline 30 | * Report should be consist of one description `.md` and (possibly many) python notebooks `.ipynb`. ( `.pdf`, `.ppt`, `.doc` __NOT__ accepted.) 31 | * In `.md` report, 32 | * You may update your proposal file. 33 | * briefly describe your motivation, goal, data source, result and conclusion. 34 | * A few figure or table for summary is recommended. 35 | * Use links to data or `.ipynb` files ([example report from last year](https://github.com/JiayuCai/2016.M3.TQF-ML.cross-currecy-basis)) 36 | * In `.ipynb`, 37 | * Put command cell and edit cell (comments) in a balanced way. (Do not only put code!) 38 | * Put a brief table of contents with links (example: __PML__) 39 | * You may breakdown code into several `.ipynb` files by function (e.g., data cleaning, learning, result analysis). In that case, make sure to __save__ intermediate result into file so that I can run the later steps (result analysis) without running previous steps (data cleaning, learning). 40 | * The use of `.py` file should be strictly restricted to function or class only. (Do not put any learning procedure in `.py`) 41 | * I should be able to reproduce the result from your code. Your code should run with no error. Code with error will be severely deduct your score. Make sure to run your code in a new session. 42 | * Other considerations: 43 | * Make sure the workload within team is balanced. (Add your team members to collaborators, each team members committ codes, etc) 44 | * There should be no secret component (e.g., stock trading strategy) 45 | * Creativive (out-of-textbook) ideas are recommended for better result or result analysis 46 | * Deadline for updating report is __5.8 Tues Midnight (11:59 PM)__ 47 | -------------------------------------------------------------------------------- /past-years/2017.M3/README.md: -------------------------------------------------------------------------------- 1 | # Topics in Quantitative Finance: Machine Learning for Finance (2017-18 Module 3) 2 | 3 | ## Announcements 4 | * __[NEW 4.02]__ Group formation, Project proposal (__4.12 W7 Thur__), Presentation (__5.7 Mon 7PM__) ([Project List](Project_List.md)) 5 | * __[NEW 3.19]__ Mid-term exam will be on 4.9 (W7 Monday, __Rm 401__) 6 | * [3.7] Class mailing list is created as PHBS.TQF@allmail.net. If you did not receive a test e-mail, let me know. 7 | * [2.26] Email is the preferred method of communication. Mail list will be set up soon. 8 | 9 | ## Course Note 10 | 11 | ## Lectures: 12 | * (05.07 Mon) [Project Presentation](Project_List.md) 13 | * __18__ (04.26 Thur): ML-related thesis presentation by two students 14 | * __17__ (04.23 Mon): __PML__ Ch. 15 Convolutional Neural Network 15 | * __16__ (04.19 Thur): __PML__ Ch. 13, 14 Back-propagation, Tensorflow/Keras 16 | * __15__ (04.16 Mon): __PML__ Ch. 11 Unsupervised learning, Ch. 12 Neural Networks 17 | * __14__ (04.12 Thurs): Project proposal ([Project List](Project_List.md)), 18 | * __13__ (04.09 Mon): Mid-term exam (Rm 401) [Solution](files/TQF2017_Midterm.pdf) 19 | * __12__ (04.04 Wed): __PML__ Ch. 7 Bagging/RF/AdaBoosting, Ch 8 Quick Glimpse 20 | * __11__ (04.02 Mon): __PML__ Ch. 6 Confusion matrix, F1 score, ROC AUC, Ch 7 21 | * __10__ (03.29 Thur): __PML__ Ch. 6 Bias-variance tradeoff, Cross validation 22 | * __09__ (03.26 Mon): __PML__ Ch. 5 Feature extraction ([SVD/PCA](files/SVD_PCA.pdf) and LDA) 23 | * __08__ (03.22 Thur): __PML__ Ch. 4 (Data preprocessing, Feature selection) 24 | * __07__ (03.19 Mon): __PML__ Ch. 3 (Kernel SVM, KNN, Decision Tree), [Slides](files/TQF_Notes.pdf) (SVM, Tree) 25 | * __06__ (03.15 Thur): __PML__ Ch. 3 (Logistic Regression, Regularization, SVM), [Slides](files/TQF_Notes.pdf) (SVM) 26 | * __05__ (03.12 Mon): __PML__ Ch. 2 (Perceptron, Adaline, Gradient descent), [Slides](files/TQF_Notes.pdf) (Weight update) 27 | * __04__ (03.08 Thur): [Slides](files/TQF_Notes.pdf) (Vector Matrix Notations, Linear/Logistic Regression), __ISLR-python__ Ch. 3 28 | * __03__ (03.05 Mon): [Python Crash Course](py/Cheatsheet_Derek_Banas.ipynb) (continued), [Slides](files/TQF_Notes.pdf) (Intro) 29 | * __02__ (03.01 Thur): Python Notebook, Github Desktop, [Python Crash Course](py/Cheatsheet_Derek_Banas.ipynb) 30 | * __01__ (02.26 Mon): Course overview ([Syllabus](files/syllabus.pdf)), Python, Github, Etc. 31 | 32 | ## Homeworks: 33 | * ### __Set 1__ [Due by 3.5]: 34 | * Register on Github.com and let TA know your ID. Give your full name in your profile. 35 | * Accept invitation to `2017.TQF-ML` team from TA 36 | * Install Python Aanconda and Github Desktop. Clone [PHBS/python-machine-learning-book-2nd-edition](https://github.com/PHBS/python-machine-learning-book-2nd-edition) and run `code/ch01/ch01.ipynb` Send screenshots to TA 37 | * ### __Set 2__ [Due by 3.29] 38 | * Create your own GitHub repository for homework `GITHUB_ID/PHBS_TQFML` (make sure to make it __public__) 39 | * Bank Marketing Data Set: [UCI](http://archive.ics.uci.edu/ml/datasets/Bank+Marketing), [Download](files/DataSet1) 40 | * Write a Jupyter notebook `GITHUB_ID/PHBS_TQFML/HW/bank_marketing.ipynb`: 41 | * load data (`bank.csv`, smaller sample), normalize, and devide training/test sets 42 | * randomly select 2 or 3 features 43 | * apply the methods covered in Ch. 3 with SK-learn (logistic regress, SVM, decision tree, etc) 44 | * check the accuracy and plot the outcome 45 | * repeat above to find better feature 46 | * commit the best result and don't foget to `sync` to the repository 47 | * ### Project proposal [Due by the end of 4.11] 48 | * Email __repository name, team members, data set and brief plan__ to Professor and TA 49 | * Designate one repository `GITHUB_ID/PHBS_TQFML/Project` and create `README.md` file to have the information above 50 | 51 | ## Classes: 52 | * Lectures: Monday & Thursday 8:30 AM – 10:20 AM 53 | * Venue: PHBS Building, Room 229 54 | 55 | ## Instructor: [Jaehyuk Choi](http://www.jaehyukchoi.net/phbs_en) 56 | * Office: PHBS Building, Room 755 57 | * Phone: 86-755-2603-0568 58 | * Email: jaehyuk@phbs.pku.edu.cn 59 | * Office Hour: Monday & Thursday 1:30 – 2:30 PM or by appointment 60 | 61 | ## Teaching Assistance: Chenru LIU (刘晨茹) 62 | * Email: 1501213463@sz.pku.edu.cn 63 | * TA Office Hour: Tuesday & Friday 1-2 PM (Room 213/214) 64 | 65 | ## Course overview 66 | 67 | The purpose of Topics in Quantitative Finance is to introduce students to recent trends and advanced research topics in quantitative methods of business and finance. This year’s course is dedicated to machine learning (ML) for finance. ML has been one of the hottest technology in software engineering. This course will explore the possibility of applying ML to finance and business. The course will give students the basic ideas and intuition behind the popular ML methods and hands-on experience of using ML software package such as SK-learn and Tensorflow (Google). Each student is required to complete a final course project. 68 | 69 | ## Prerequisites 70 | 71 | There is no formal prerequisites. However, undergraduate-level knowledge in probability/statistics and previous experience in programming language is highly recommended. 72 | 73 | ## Textbooks and Reading Materials 74 | * __PML__ (primary textbook): [Python Machine Learning](https://github.com/rasbt/python-machine-learning-book-2nd-edition) by Sebastian Raschka 75 | * __ISLR__: [An Introduction to Statistical Learning (with Applications in R)](http://www-bcf.usc.edu/~gareth/ISL/) by James, Witten, Hastie, and Tibshirani 76 | * __CML__: [Coursera Machine Learning](https://www.coursera.org/learn/machine-learning) taught by Andrew Ng 77 | * __DL__: [Deep Learning](http://www.deeplearningbook.org/) by Goodfellow, Bengio, and Courville 78 | * __JPM-AI__: [Big Data and AI Strategies](http://valuesimplex.com/articles/JPM.pdf) by J.P. Morgan 79 | 80 | ## Useful Github Repositories 81 | * __PML__: [PHBS/python-machine-learning-book-2nd-edition](https://github.com/PHBS/python-machine-learning-book-2nd-edition) (forked) 82 | * __ISLR-Python__: [PHBS/ISLR-python](https://github.com/PHBS/ISLR-python) (forked) __ISRL__ implemented in Python 83 | 84 | ## Assessment / Grading Details 85 | * Attendance 20%, __Mid-term Exam 20% (New)__, Assignments 20%, Final Project 40% 86 | * __Mid-term exam__: 4.9 (W7 Mon) 87 | * __Project proposal__: 4.12 (W7 Thur) 88 | * __Presentation (5.7 Mon 7PM)__ 89 | * Exams are open-book without computer/phone/calculator use 90 | * You may form a group of up to 2 people for course project. Extra credit will be given to individual projects. 91 | * Grade in letters (e.g., A+, A-, ... ,D+, D, F). __A- or above < 30% and B- or above < 90%__. 92 | -------------------------------------------------------------------------------- /past-years/2018.M1/Project.md: -------------------------------------------------------------------------------- 1 | # Course Project (2018-19 M1) 2 | 3 | ## Team List (Presentation Order) 4 | * [OscarHemmingsen](https://github.com/OscarHemmingsen/PHBS_MLF_2018) 5 | * [joelgysel](https://github.com/joelgysel/PHBS_MLF_2018) 6 | * [Lillahbenard](https://github.com/Lillahbenard/GITHUB_Lillahbenard-PHBS_MLF_2018) 7 | * [Davethedata](https://github.com/Davethedata/PHBS_MLF_2018) 8 | * [XiaoqianZhu1997](https://github.com/XiaoqianZhu1997/PHBS_MLF_2018) 9 | * [MatteoRossiTantini](https://github.com/MatteoRossiTantini/PHBS_MLF_2018) 10 | * [TianXiangxun](https://github.com/TianXiangxun/PHBS_MLF_2018) 11 | * [qwerjeff](https://github.com/qwerjeff/PHBS_MLF_2018) 12 | * [raphalecui1990](https://github.com/raphalecui1990/PHBS_MLF_2018) 13 | * [nico-busch](https://github.com/nico-busch/PHBS_MLF_2018) 14 | * [sergeyivanov01](https://github.com/sergeyivanov01/PHBS_MLF_2018) 15 | * [HuangJing1801](https://github.com/HuangJing1801/PHBS_MLF_2018) 16 | * [devon-ge](https://github.com/devon-ge/PHBS_MLF_2018) 17 | * [RasmusAU](https://github.com/RasmusAU/GITHUB_ID-PHBS_MLF_2018) 18 | 19 | ## Data Proposal (__10.23 Tues__) 20 | * Form a group (up to 4 students) and select data set 21 | * No restriction on data set. However, business(fin/ma/econ) related data is welcome (extra credit for creative data selection and pre-processing) 22 | * Create a designate repository `GITHUB_ID/PHBS_MLF_2018` for your team 23 | * Tick `Initialize this repository with a README` and select `python` under `.gitignore` 24 | * Put team members (student # and github ID), brief description of data, and goal of the project in `README.md` (refer to [markdown cheetsheet](https://guides.github.com/features/mastering-markdown/)) 25 | * Put the data under `/data` folder (if too big, put some samples) 26 | * In lieu of submission, invite `jaehyukchoi` as a collaborator (under `Setting` > `Collaborators & teams`) 27 | * In the class, use `README.md` for brief presentation (3 min per team) 28 | 29 | ## Project Guidline 30 | * Report should be consist of the summary in `README.md` and the execusion in python notebooks `.ipynb`. ( `.pdf`, `.ppt`, `.doc` __NOT__ accepted.) 31 | * In the `README.md` summary, 32 | * You may update your proposal file. 33 | * briefly describe your motivation, goal, data source, result and conclusion. 34 | * A few figure or table for summary is recommended. 35 | * Use links to data or `.ipynb` files (see past year examples below) 36 | * In the `.ipynb` execusion, 37 | * Put command cell and edit cell (comments) in a balanced way. (Do not only put code!) 38 | * Put a brief table of contents with links (example: __PML__) 39 | * You may breakdown code into several `.ipynb` files by function (e.g., data cleaning, learning, result analysis). In that case, make sure to __save__ intermediate result into file so that I can run the later steps (result analysis) without running previous steps (data cleaning, learning). 40 | * The use of `.py` file should be strictly restricted to function or class only. (Do not put any learning procedure in `.py`) 41 | * I should be able to reproduce the result from your code. Your code should run with no error. Code with error will be severely deduct your score. Make sure to run your code in a new session. 42 | * Other considerations: 43 | * Make sure the workload within team is balanced. (Add your team members to collaborators, each team members committ codes, etc) 44 | * There should be no secret component (e.g., stock trading strategy) 45 | * Creativive (out-of-textbook) ideas are recommended for better result or result analysis 46 | * Deadline for updating report is __11.13 Tues Midnight (11:59 PM)__ 47 | 48 | ## Past year's project (2017-18 Module 3 Under `Topics in Quantitative Finance: Machine Learning for Finance`) 49 | * [JiayuCai](https://github.com/JiayuCai/2016.M3.TQF-ML.cross-currecy-basis): Cross-currency-basis prediction 50 | * [AtomMe](https://github.com/AtomMe/PHBS_TQFML/tree/master/Project/Credit): The Prediction of Credit User's Overdue event Based on Machine Learning Method ([Competition](https://open.chinaums.com/#/intro)) 51 | * [ZheshengZhang](https://github.com/ZheshengZhang/ZheshengZhang-PHBS_TQFML-Project): LSTM-based method for stock returns prediction 52 | * [diyawang](https://github.com/diyawang/PHBS_TQFML): Factors affecting bank competitive power 53 | * [JOY199603](https://github.com/JOY199603/2017.M3.TQF-Forcasting-price-change-on-IPO-day): Forecasting the Price Change on IPO day 54 | * [zhang-yunhe](https://github.com/zhang-yunhe/PHBS_TQFML-Project): Predicting default of credit cards clients (UCI) 55 | * [Louie-Lin](https://github.com/Louie-Lin/PHBS_TQFML/tree/master/Project): Credit card default (UCI) 56 | * [callmebyd](https://github.com/callmebyd/PHBS_TQFML/tree/master/Project): Lending Club Loan Data (Kaggle) 57 | * [zsq96512](https://github.com/zsq96512/zsq96512-PHBS_TQFML-Project): FX rate prediction 58 | * [stuartphbs](https://github.com/stuartphbs/PHBS_TQFML-/tree/master/Project): Wine Quality (UCI) 59 | * [yipanglin](https://github.com/yipanglin/PHBS_TQFML/tree/master/Project): NBA MVP prediction 60 | * [DengQingqin](https://github.com/DengQingqin/PHBS_TQFML-Sentiment-Measures-on-Stock-Market): Sentiment Measures on Stock Market 61 | * [LeiZHANG1995](https://github.com/LeiZHANG1995/PHBS_TQFML/tree/master/Project): Bitcoin price prediction 62 | * [evanleungc](https://github.com/evanleungc/PHBS_TQFML/blob/master/Project): Predict low-risk profitable trading opportunity with high frequency trading data 63 | * [labro](https://github.com/labro/PHBS_TQFML/tree/master/Project): An investment model based on stock price info and stock revivews on the intenet 64 | * [YedaDu](https://github.com/YedaDu/PHBS_TQFML_Project): Idiosyncratic Market Value Factor: explaining market value by machine learning methods 65 | * [UvoChow](https://github.com/UvoChow/PHBS_TQFML/tree/master/Project): Sentiment Analysis of Guba Forum 66 | -------------------------------------------------------------------------------- /past-years/2018.M1/README.md: -------------------------------------------------------------------------------- 1 | # Machine Learning for Finance (FN 570, 2018-19 Module 1) 2 | 3 | ## Announcements 4 | * Email is the preferred method of communication. Class mailing list will be created as PHBS.MLF@allmail.net. But, the announcements will be also made in DingTalk group chat. 5 | 10 | 11 | ## Lectures: 12 | * 18 (11.09 Fri) Course Project Presentation 13 | * 17 (11.06 Tues): Tensorflow / Keras (XOR, Iris based on here) 14 | * 16 (11.02 Fri): Neural Network (Slides), ML-related research presentation (LOOLSM) 15 | * 15 (10.30 Tues): Use of sklearn in PML Ch. 10, Neural Network (Slides) 16 | * 14 (10.26 Fri): Use of sklearn in PML Ch. 5/6/7 17 | * 13 (10.23 Tues): Course Project Proposal 18 | * 12 (10.19 Fri): Midterm exam (Rm 321) (Solution) 19 | * NO CLASS on 10.16 Tues 20 | * 11 (10.12 Fri): Confusion matrix, ROC curve, LOOCV (Slides) 21 | * 10 (10.09 Tues): SVD/PCA/LDA (Slides) PML Ch. 5, Hyperparameters (Slides) PML Ch. 6 22 | * 09 (09.28 Fri): Data Preprocessing PML Ch. 4, SVD/PCA/LDA (Slides) PML Ch. 5 23 | * 08 (09.25 Tues): Kernel SVM/Bagging/RF (Slides) PML Ch. 3 24 | * 07 (09.21 Fri): SVM/KNN/Decision Tree (Slides) PML Ch. 3 25 | * 06 (09.18 Tues): Logistic Regression (Slides) PML Ch. 3 26 | * 05 (09.14 Fri): PML Ch. 2 (Perceptron, Adaline, Gradient descent, SGD), Regression weight update (Slides) 27 | * 04 (09.12 Wed instead of 10.16 Tues): Python crash course (Basic | Numpy). More cheatsheets also available in MLF CMS. 28 | * 03 (09.11 Tues): ISLR Ch. 3, PML Ch. 1 29 | * 02 (09.07 Fri): Intro (Slides), Regression (Slides) 30 | * 01 (09.04 Tues): Course overview (Syllabus), Python, Github, Etc. 31 | 32 | ## Course Resources 33 | * Course slides: [Intro](files/MLF_Intro.pdf) | [Regression](files/MLF_Regression.pdf) | [SVM/KNN/Tree](files/MLF_SVM_KNN_Tree.pdf) | [SVD/PCA/LDA](files/MLF_SVD_PCA_LDA.pdf) | [Hyperparameter](files/MLF_Bias_Variance_Metric.pdf) | [Neural Network](files/MLF_Neural_Network.pdf) | [Graphical Model](files/MLF_Graphical_Model.pdf) 34 | * Past Slides (All-in-one): [2017-18](files/MLF_Notes.pdf) 35 | * Past Exam: [2017](files/MLF2017_Midterm.pdf) | [2018](files/MLF2018_Midterm.pdf) 36 | * [Exams from Tom Michell's ML course](http://www.cs.cmu.edu/~tom/10701_sp11/prev.shtml) (Carnegie Mellon University) 37 | 38 | ## Homeworks: 39 | * ### __Set 1__ [Due by 09.11 Tues] 40 | * Register on Github.com and let TA and me know your ID. Give your __full name__ in your profile. Accept invitation to the [PHBS organization](https://github.com/orgs/PHBS/people) from TA. Install [Github Desktop](https://desktop.github.com/) (available on [CMS](http://cms.phbs.pku.edu.cn/claroline/course/index.php?cid=FN570)). 41 | * Install [Anaconda](https://www.anaconda.com/download/) Python distribution (__3.X version__, 2.X version). Anaconda distribution is core Python + useful scientific computation libraries (e.g., numpy, scipy, pandas) + package management system (pip or conda) 42 | * Send the screenshot of both softwares installed to TA. (Example: [Github Desktop](files/Choi_Jaehyuk_Github.png), [Anaconda Spyder](files/Choi_Jaehyuk_Python.png)) 43 | 44 | ## Course Project ([link](Project.md)) 45 | 49 | 50 | ## Classes: 51 | * Lectures: Tuesday & Friday 1:30 – 3:20 PM 52 | * Venue: Online/DingTalk ~~PHBS Building, Room 229~~ 53 | 54 | ## Instructor: [Jaehyuk Choi](http://www.jaehyukchoi.net/phbs_en) 55 | * Office: PHBS Building, Room 755 56 | * Phone: 86-755-2603-0568 57 | * Email: jaehyuk@phbs.pku.edu.cn 58 | * Office Hour: Online/DingTalk ~~Thursday 3:30-5:30 PM~~ 59 | 60 | ## Teaching Assistance: Shiqi Zhang (张诗琪) 61 | * Email: 1701213153@sz.pku.edu.cn 62 | * TA Office Hour: Online/DingTalk ~~(Room 213/214)~~ 63 | 64 | ## Course overview 65 | 66 | With the advent of computation power and big data, machine learning recently became one of the most spotlighted research field in industry and academia. This course provides a broad introduction to machine learning in theoretical and practical perspectives. Through this course, students will learn the intuition and implementation behind the popular machine learning methods and gain hands-on experience of using ML software packages such as SK-learn and Tensorflow. This course will also explore the possibility of applying ML to finance and business. Each student is required to complete a final course project. 67 | 68 | ## Prerequisites 69 | 70 | Undergraduate-level knowledge in probability/statistics and previous experience in programming language (python) is highly recommended. 71 | 72 | ## Textbooks and Reading Materials 73 | * __PML__ (primary textbook): [Python Machine Learning](https://github.com/PHBS/python-machine-learning-book-2nd-edition) by Sebastian Raschka 74 | * __ISLR__: [An Introduction to Statistical Learning (with Applications in R)](http://www-bcf.usc.edu/~gareth/ISL/) by James, Witten, Hastie, and Tibshirani 75 | * __Bishop__: Pattern Recognition and Machine Learning by Bishop (Microsoft) 76 | * __ESL__: [The Elements of Statistical Learning](https://web.stanford.edu/~hastie/ElemStatLearn/) by Hastie, Tibshirani, and Friedman 77 | * __CML__: [Coursera Machine Learning](https://www.coursera.org/learn/machine-learning) by Andrew Ng 78 | * __DL__: [Deep Learning](http://www.deeplearningbook.org/) by Goodfellow, Bengio, and Courville 79 | * __JPM-AI__: [Big Data and AI Strategies](http://valuesimplex.com/articles/JPM.pdf) by J.P. Morgan 80 | 81 | ## Useful Github Repositories 82 | * __PML__: [PHBS/python-machine-learning-book-2nd-edition](https://github.com/PHBS/python-machine-learning-book-2nd-edition) (forked) 83 | * __ISLR-Python__: [PHBS/ISLR-python](https://github.com/PHBS/ISLR-python) (forked) __ISRL__ implemented in Python 84 | 85 | ## Assessment / Grading Details 86 | * Attendance 20%, Mid-term exam 30%, Assignments 20%, Course Project 30% 87 | * __Mid-term exam__: 10.19 Fri. Open-book exam without computer/phone/calculator use 88 | * __Course project__: Data Proposal (10.23 Tues) and Presentation (11.09 Fri). Group of up to 4 people. 89 | * __Attendance__: checked randomly. The score is calculated as 20 – 2`x`(#of absence). Leave request should be made 24 hours before with supporting documents, except for emergency. Job interview/internship cannot be a valid reason for leave 90 | * __Grade__ in letters (e.g., A+, A-, ... ,D+, D, F). __A- or above < 30% and C+ or below > 10%__. 91 | -------------------------------------------------------------------------------- /past-years/2018.M1/syllabus.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/past-years/2018.M1/syllabus.pdf -------------------------------------------------------------------------------- /past-years/2019.M3/Project.md: -------------------------------------------------------------------------------- 1 | # Course Project (2019-20 M3) 2 | 3 | 4 | ## Team List (Presentation Order) 5 | 6 | Group | Date | Title 7 | --- | -- | --- 8 | [01](https://github.com/npuchenbowen/MLF_Project) | __Friday__ | Detection of fraudulent credit card transactions 9 | [02](https://github.com/SnakeWayne/PHBS_MLF_2019/blob/master/README.md) | __Tuesday__ | Stock selection with Chinascope sentiment data 10 | [03](https://github.com/Linyi-Wei/2020WeiLinyi) | __Friday__ | Detecting fake job posting 11 | [04](https://github.com/Johnxinlei/PHBS_MLF_Project) | __Friday__ | Predicting Bank Term Deposit Subscription 12 | [05](https://github.com/knowsnothing753/PHBS_MLF_2019/blob/master/README.md) | __Tuesday__ | Yield-curve inversin and recession 13 | [06](https://github.com/eiahb3838ya/PHBS_ML_for_quant_project/blob/master/README.md) | __Tuesday__ | Short-term market timing strategy based on boosting ML algos 14 | [07](https://github.com/dengkeya/PHBS_MLF_2019) | __Tuesday__ | Predictig credit card users' repayment behavior 15 | [08](https://github.com/Mingkai-Zhuang/PHBS_MLF_2019/tree/master/Course%20Project) | __Friday__ | Predict Stock Returns 16 | [09](https://github.com/ZhangPeidong-Mack/PHBS_MLF_2019) | __Friday__ | Predicting trends of stocks and their future prices 17 | [10](https://github.com/YijiaZhang1996/PHBS_MLF_2019/tree/master/GroupProject) | __Friday__ | O2O Coupon Consumption Prediction Based on Past Consumer Behavior 18 | [11](https://github.com/caoxiaolong0521/PHBS_MLF_2019_Project/blob/master/README.md) | __Tuesday__ | Detection of Malicious Website's URL 19 | [12](https://github.com/Parametric3/PHBS_MLF_2019) | __Friday__ | Consumer behavior prediction, based on Taobao data 20 | [13](https://github.com/oyrx/PHBS_MLF_2019_Project) | __Friday__ | Cancel or not? Predictive Analysis for Hotel Booking Data 21 | [14](https://github.com/YanrongWu/YanrongWu-PHBS_MLF_2019/blob/master/Final%20Group%20Project/README.md) | __Friday__ | A Recession Indicator Generated by Interest Rates 22 | 23 | 24 | ## Team Formation (__3. 39 Sun__) 25 | * Form a group (up to 4 students) and select data set 26 | * Designate a repository `GITHUB_ID/PHBS_MLF_2019` of one team member for the team project. 27 | * Let TA know the repository to be used for th eproject 28 | * Put team members' student # and github ID in `README.md` (for the syntax of `.md` file, see [markdown cheetsheet](https://guides.github.com/features/mastering-markdown/)) 29 | * `README.md` will be eventually the report of your course project. 30 | 31 | ## Data Selection (__4.5 Sun__) 32 | * No restriction on data set. However, business(fin/ma/econ) related data is welcome (extra credit for creative data selection and pre-processing) 33 | * Put the data under `GITHUB_ID/PHBS_MLF_2019/data` folder (if too big, put some samples) 34 | * Put a brief description of your data and the goal of the project in `README.md` (refer to [markdown cheetsheet](https://guides.github.com/features/mastering-markdown/)) 35 | 36 | ## Project Guidline 37 | * Report should be consist of the summary in `README.md` and the execution in python notebooks `.ipynb`. ( `.pdf`, `.ppt`, `.doc` __NOT__ accepted.) 38 | * In the `README.md` summary, 39 | * You may update your proposal file. 40 | * briefly describe your motivation, goal, data source, result and conclusion. 41 | * A few figure or table for summary is recommended. 42 | * Use links to data or `.ipynb` files (see past year examples below) 43 | * In the `.ipynb` execution, 44 | * Put command cell and edit cell (comments) in a balanced way. (Do not only put code!) 45 | * Put a brief table of contents with links (example: __PML__) 46 | * You may breakdown code into several `.ipynb` files by function (e.g., data cleaning, learning, result analysis). In that case, make sure to __save__ intermediate result into file so that I can run the later steps (result analysis) without running previous steps (data cleaning, learning). 47 | * The use of `.py` file should be strictly restricted to function or class only. (Do not put any learning procedure in `.py`) 48 | * I should be able to reproduce the result from your code. Your code should run with no error. Code with error will be severely deduct your score. Make sure to run your code in a new session. 49 | * Other considerations: 50 | * Make sure the workload within team is balanced. (Add your team members to collaborators, each team members commit codes, etc) 51 | * There should be no secret component (e.g., stock trading strategy) 52 | * Creative (out-of-textbook) ideas are recommended for better result or result analysis 53 | * Deadline for updating report is __4.26 Sunday Midnight (11:59 PM)__ 54 | -------------------------------------------------------------------------------- /past-years/2019.M3/README.md: -------------------------------------------------------------------------------- 1 | # Machine Learning for Finance (FN 570) 2019-20 Module 3 (Spring 2020) 2 | 3 | ## Announcements 4 | * Email is the preferred method of communication. Class mailing list will be created as PHBS.MLF@allmail.net. But, the announcements will be made in DingTalk group chat. 5 | 10 | 11 | ## Course Project 12 | * Important Dates: 13 | * `3. 29 (Sun)`: Team formation 14 | * `4. 07 (Tues)`: Dataset selection 15 | * `4. 14 (Tues)` (2~3 teams) / `4.17 (Fri)` (the rest): Presentation 16 | * `4. 26 (Sun)`: Submission (Github) deadline 17 | * [Project page](Project.md) 18 | * Previous Years: [2017](past-years/2017.M3/Project_List.md) | [2018](past-years/2018.M1/Project.md) 19 | 23 | 24 | ## Lectures: 25 | * __01__ (2.18 Tue): Course overview ([Syllabus](#syllabus)), Python, Github, Etc. 26 | * __02__ (2.21 Fri): __HSBC Guest Lecture [1/4]__ Model management cycle in banking industry, Tool setup (GCP/Ali Cloud). 27 | * __03__ (2.25 Tue): Brief Python crash course ([Basic](py/PythonCrashCourse_Derek_Banas.ipynb) | [Numpy](py/PythonCrashCourse_Numpy.ipynb), Notebook Shorcut Keys) | 28 | Intro ([Slides](files/MLF_Intro.pdf), Reading: __PML__ Ch. 1) | Notations, Regression ([Slides](files/MLF_Regression.pdf)) 29 | * __04__ (2.28 Fri): Regression weight update ([Slides](files/MLF_Regression.pdf)) __PML__ Ch. 2 (Perceptron, Adaline, Gradient descent, SGD), 30 | * __05__ (3.03 Tue): Logistic Regression ([Slides](files/MLF_Regression.pdf), Reading: __PML__ Ch. 3) 31 | * __06__ (3.06 Fri): LR (continued) | SVM ([Slides](files/MLF_SVM_KNN_Tree.pdf), Reading: __PML__ Ch. 3) 32 | * __07__ (3.10 Tue): KNN and Decision Tree ([Slides](files/MLF_SVM_KNN_Tree.pdf), Reading: __PML__ Ch. 3) 33 | * __08__ (3.13 Fri): Data Preprocessing (Rading: __PML__ Ch. 4), SVD/PCA ([Slides](MLF_SVD_PCA_LDA.pdf), Reading: __PML__ Ch. 5) 34 | * __09__ (3.17 Tue): LDA ([Slides](MLF_SVD_PCA_LDA.pdf), Reading: __PML__ Ch. 5), Hyperparameters ([Slides](files/MLF_Bias_Variance_Metric.pdf), Reading: __PML__ Ch. 6) 35 | * __10__ (3.20 Fri): __HSBC Guest Lecture [2/4]__ Data mining, profiling, visualization, and conclusion. 36 | * __11__ (3.24 Tue): Bias-Variance, Cross-validation ([Slides](files/MLF_Bias_Variance_Metric.pdf), Reading: __PML__ Ch. 6) 37 | * __12__ (3.27 Fri): __HSBC Guest Lecture [3/4]__ Model sharings. 38 | * __13__ (3.31 Tue): Evaluation Metric ([Slides](files/MLF_Bias_Variance_Metric.pdf), Reading: __PML__ Ch. 6), Ensenble (Reading: __PML__ Ch. 7) 39 | * __14__ (4.03 Fri): __HSBC Guest Lecture [4/4]__ Practical issues of applying ML to the real world. 40 | * __15__ (4.07 Tue): __Midterm Exam__ ([Solution](files/MLF2019_Midterm.pdf)) 41 | * __16__ (4.10 Fri): Neural Network, Deep Learning, CNN (Reading: Ch. 12-15) 42 | * __17__ (4.14 Tue): Midterm exam review, More on deep learning (TensorFlow), Course Project Presentation (2~3 teams) 43 | * __18__ (4.17 Fri): Course Project Presentation (the rest) 44 | 65 | 66 | ## Course Resources 67 | * Course slides: [Intro](files/MLF_Intro.pdf) | [Regression](files/MLF_Regression.pdf) | [SVM/KNN/Tree](files/MLF_SVM_KNN_Tree.pdf) | [SVD/PCA/LDA](files/MLF_SVD_PCA_LDA.pdf) | [Hyperparameter](files/MLF_Bias_Variance_Metric.pdf) | [Neural Network](files/MLF_Neural_Network.pdf) | [Graphical Model](files/MLF_Graphical_Model.pdf) 68 | * Past Exam: [2017](files/MLF2017_Midterm.pdf) | [2018](files/MLF2018_Midterm.pdf) | [2019](files/MLF2019_Midterm.pdf) 69 | * [Exams from Tom Michell's ML course](http://www.cs.cmu.edu/~tom/10701_sp11/prev.shtml) (Carnegie Mellon University) 70 | 71 | ## Homeworks: 72 | * ### __Set 0: [Required Software]__ [Due by 2.22 Sat] 73 | * Register on [Github.com](https://github.com/) and let TA know your ID (by DingTalk). Make sure to user your __full real name__ in your profile. Accept invitation to the [PHBS organization](https://github.com/orgs/PHBS/people) from TA. 74 | * Create a designated repository `GITHUB_ID/PHBS_MLF_2019` for your HW and project. Tick `Initialize this repository with a README` and select `python` under `.gitignore` 75 | * Fork [PML repository](https://github.com/PHBS/python-machine-learning-book-2nd-edition) to your repository. 76 | * Install [Github Desktop](https://desktop.github.com/) (available on [CMS](http://cms.phbs.pku.edu.cn/claroline/course/index.php?cid=FN570)). Then __clone__ the two repositories to your local storage. 77 | * Install [Anaconda](https://www.anaconda.com/download/) Python distribution (__3.X version__, not 2.X version). Anaconda distribution is core Python + useful scientific computation libraries (e.g., numpy, scipy, pandas) + package management system (pip or conda) 78 | * Install [PyCharm](https://www.jetbrains.com/pycharm/) Community version. (Or Professional version after applying for [free student license](https://www.jetbrains.com/student/)) 79 | * Save the screenshot of (1) Github Desktop (showing 2 repositories) (2) Jupyter Notebook (Anaconda) (3) PyCharm (See my [example](https://github.com/jaehyukchoi/PHBS_MLF_2019/tree/master/HW0)) and make sure to press __`Push Origin`__ to sync with the online repository in github.com. 80 | * ### __Set 1: [Playing with Pandas dataframe]__ [Due by 3.11 Wed] 81 | * The goal of this HW is to be familiar with `pandas` package and dataframe. Due to limited time, I cannot cover pandas in class. You need to teach yourself. Remenber that there's many answers to do the task I am asking below. Use your own way. 82 | * For this HW, we will use [Polish companies bankruptcy data Data Set](http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data) from UCI Machine Learning Repository. Download the dataset and put the 4th year file (`4year.arff`) in your `YOUR_GITHUB_ID/PHBS_MLF_2019/HW1/` 83 | * I did a basic process of the data (loading to dataframe and creating `bankruptcy` column). See my [github](https://github.com/jaehyukchoi/PHBS_MLF_2019/tree/master/HW1/) 84 | * We are going to use the following 4 features: 85 | `X1 net profit / total assets`, `X2 total liabilities / total assets`, `X7 EBIT / total assets`, `X10 equity / total assets`, and `class` 86 | * Create a new dataframe with only 4 feataures (and and `Bankruptcy`). Properly rename the columns to `X1`, `X2`, `X7`, and `X10` 87 | * Fill-in the missing values `na` with the mean. (See Ch 4 of `PML`) 88 | * Find the mean and std of the 4 features among all, bankrupt and still-operating companies (3 groups). 89 | * How many companies satisfy the condition, `X1 < mean(X1) - stdev(X1)` __AND__ `X10 < mean(X10) - std(X10)`? 90 | * What is the ratio of the bankrupted companies among the sub-groups above? 91 | * ### __Set 2: [Classifiers]__ [Due by 3.19 Thurs] 92 | * The goal of this HW is to be familiar with the basic classifiers __PML__ Ch 3. 93 | * For this HW, we continue to use [Polish companies bankruptcy data Data Set](http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data) from UCI Machine Learning Repository. Download the dataset and put the 4th year file (`4year.arff`) in your `YOUR_GITHUB_ID/PHBS_MLF_2019/HW2/` 94 | * I did a basic process of the data (loading to dataframe, creating `bankruptcy` column, changing column names, filling-in `na` values, training-vs-test split, standardizatino, etc). See my [github](https://github.com/jaehyukchoi/PHBS_MLF_2019/tree/master/HW1/Classifiers.ipynb) 95 | * Select the 2 most important features using LogisticRegression with L1 penalty. (Adjust C until you see 2 features) 96 | * Using the 2 selected features, apply LR / SVM / decision tree. Try your own hyperparameters (C, gamma, tree depth, etc) to maximize the prediction accuracy. (Just try several values. You don't need to show your answer is the maximum.) 97 | * Visualize your classifiers using the `plot_decision_regions` function from __PML__ Ch. 3 98 | * ### __Set 3: [PCA/Hyperparameter/CV]__ [Due by 4.4 Sat] 99 | * The goal of this HW is to be familiar with PCA (feature extraction), grid search, pipeline, etc. 100 | * For this HW, we continue to use [Polish companies bankruptcy data Data Set](http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data) from UCI Machine Learning Repository. Download the dataset and put the 4th year file (`4year.arff`) in your `YOUR_GITHUB_ID/PHBS_MLF_2019/HW3/` 101 | * Use the same pre-precessing provided in __Set 2__ (loading to dataframe, creating `bankruptcy` column, changing column names, filling-in `na` values, training-vs-test split, standardizatino, etc). See my [github](https://github.com/jaehyukchoi/PHBS_MLF_2019/tree/master/HW1/Classifiers.ipynb) 102 | * Extract 3 features using PCA method. 103 | * Using the selected features from above, we are going to apply LR / SVM / decision tree. 104 | * Implement the methods using pipeline. (__PML__ p185) 105 | * Use grid search for finding optimal hyperparameters. (__PML__ p199). In the search, apply 10-fold cross-validation. 106 | 107 | *** 108 | # Syllabus 109 | 110 | ## Classes: 111 | * Lectures: Tuesday & Friday 1:30 – 3:20 PM 112 | * Venue: Online/DingTalk ~~PHBS Building, Room 229~~ 113 | 114 | ## Instructor: [Jaehyuk Choi](http://www.jaehyukchoi.net/phbs_en) 115 | * Office: PHBS Building, Room 755 116 | * Phone: 86-755-2603-0568 117 | * Email: jaehyuk@phbs.pku.edu.cn 118 | * Office Hour: Online/DingTalk (TBA) 119 | 120 | ## Teaching Assistance: Shiqi Zhang (张诗琪) 121 | * Email: 1701213153@sz.pku.edu.cn 122 | * TA Office Hour: Online/DingTalk ~~(Room 213/214)~~ 123 | 124 | ## Course overview 125 | With the advent of computation power and big data, machine learning (ML) recently became one of the most spotlighted research field in industry and academia. This course provides a broad introduction to ML in theoretical and practical perspectives. Through this course, students will learn the intuition and implementation behind the popular ML methods and gain hands-on experience of using ML software packages such as SK-learn and Tensorflow. This course will also explore the possibility of applying ML to finance and business. Each student is required to complete a final course project. 126 | __This year, the compliance analytics team in HSBC bank will give 4 guest lectures thrroughout the course to demonstrate how ML is developed and shared in banking industry. In the guest lectures, students will also learn how to use cloud computing (Google Cloud Platform/Ali Cloud)__ 127 | 128 | ## Prerequisites 129 | This course assumes prior knowkedge in probability/statistics and experience in Python. This course is ideally recommended for those who have taken introductory ML/AI courses from undergraduate program. 130 | 131 | ## Textbooks and Reading Materials 132 | ### Primary textbook 133 | * __PML__ (primary textbook): [Python Machine Learning](https://github.com/PHBS/python-machine-learning-book-2nd-edition) by Sebastian Raschka 134 | ### ML 135 | * __ISLR__: [An Introduction to Statistical Learning (with Applications in R)](http://faculty.marshall.usc.edu/gareth-james/ISL/) by James, Witten, Hastie, and Tibshirani 136 | * __Bishop__: Pattern Recognition and Machine Learning by Bishop (Microsoft) 137 | * __ESL__: [The Elements of Statistical Learning](https://web.stanford.edu/~hastie/ElemStatLearn/) by Hastie, Tibshirani, and Friedman 138 | * __CML__: [Coursera Machine Learning](https://www.coursera.org/learn/machine-learning) by Andrew Ng 139 | * __DL__: [Deep Learning](http://www.deeplearningbook.org/) by Goodfellow, Bengio, and Courville 140 | ### ML in Finance 141 | * __AFML__: [Advances in financial machine learning](https://www.amazon.com/Advances-Financial-Machine-Learning-Marcos/dp/1119482089) by López de Prado 142 | 145 | 146 | ## Useful Github Repositories 147 | * __PML__: [PHBS/python-machine-learning-book-2nd-edition](https://github.com/PHBS/python-machine-learning-book-2nd-edition) (forked) 148 | * __ISLR-Python__: [PHBS/ISLR-python](https://github.com/PHBS/ISLR-python) (forked) __ISRL__ implemented in Python 149 | 150 | ## Assessment / Grading Details 151 | * Attendance 20%, Mid-term exam 30%, Assignments 20%, Course Project 30% 152 | * Attendance: TBA ~~Randomly checked. The score is calculated as __`20 – 2x(#of absence)`__. Leave request should be made 24 hours before with supporting documents, except for emergency. Job interview/internship cannot be a valid reason for leave~~ 153 | * __Mid-term exam__: __4.7 Tues__. In-class open-book without computer/phone/calculator 154 | * __Course project__: Data Proposal and Presentation. Group of up to ?? people. 155 | * __Attendance__: checked randomly. The score is calculated as 20 – 2`x`(#of absence). Leave request should be made 24 hours before with supporting documents, except for emergency. Job interview/internship cannot be a valid reason for leave 156 | * __Grade__ in letters (e.g., A+, A-, ... ,D+, D, F). __A- or above < 30% and B- or below > 10%__. 157 | -------------------------------------------------------------------------------- /past-years/2021.M1/Project.md: -------------------------------------------------------------------------------- 1 | # Course Project 2 | 3 | ## Suggestions on project topics: 4 | ### Hoberg-Phillips similarity 5 | * [Hoberg-Phillips](https://hobergphillips.tuck.dartmouth.edu/) provide firms' product cosine similarity. 6 | * It can be used as the kernel function between firms. 7 | * Use HP similarity as a proxy for stock correlation and calculate portfolio weight 8 | * Consider a proper y variable (?) for Kernel SVM or (Kernel PCA + ML methods) 9 | * Improve HP similarity with `doc2vec` method? (quite a big project). Improve industry classification. 10 | ### Sentiment analysis on central bank statement 11 | * Train the FOMC (or PBoC's) [statements or minute](https://www.federalreserve.gov/monetarypolicy/fomccalendars.htm) with `doc2vec` (or `word2vec`) algorithm to to create vector representation 12 | * Measure the distance between the statement and minute? 13 | * Fit ML models with the policy rate change or market reaction as y variable 14 | * Identify the most important vector (and corresponding word/phrase) with feature selection/extraction 15 | 16 | ## Team List (Presentation Order) 17 | 18 | Group | Members | Repo 19 | --- | --- | --- 20 | 1 | Chen Man, Ning Lei | [XGBOOST model for slecting impotant features of stock and forming unlinear factor](https://github.com/RAY185/MLF_Final_project) 21 | 2 | Li Xinsha | [Predicting Chinese interest rate by machine learning approach](https://github.com/wn0987/PHBS_MLF_2021/blob/main/project/README.md) 22 | 3 | Li Panyu, Li Linxiong | [Signal mining based on machine learning](https://github.com/PanyuLi/PHBS_MLF_2021/blob/main/Project/README.md) 23 | 4 | Xie Zhonglin, Xu Xinyu | [Predicting Rebar Futures Price with Low-mid Frequency Data](https://github.com/sissixyx/PHBS_MLF_2021) 24 | 5 | Zhang Wenchang, Yu Lei | [Would Mr. Market sing FED's songs? -- Sentiment Analysis on the FOMC's documents](https://github.com/ahabug/PHBS_MLF_2021/blob/master/Would%20Mr.%20Market%20sing%20FED's%20songs/README.md) 25 | 6 | Jiang Yifan, Peng Feng | [Discovery of investment opportunities in high-tech industries based on patent information](https://github.com/pf-sjtu/PHBS_MLF_2021/tree/master/Proj) 26 | 7 | Qi Daifeng | [Text-Based Firm Similarity Based on Edgar 10-K Report](https://github.com/daifengqi/PHBS_MLF_2021/blob/main/final/README.md) 27 | 8 | Guo Xinran, Sun Bo | [Quantitative Trading via Machine Learning in the Chinese Stock Market](https://github.com/Harveydentsun/MLF_2021_Final_Project) 28 | 9 | Sihan Zhai, Hu Xueyang | [Sentiment Analysis on FOMC Statements and Minutes](https://github.com/XueyangHu/PHBS_MLF_2021/blob/master/Project/README.md) 29 | 10 | Wang Zijie, Ye Mengjie | [Feauture selection in stock predicition and portfolio management by Lasso and LightBGM](https://github.com/lethe-ye/PHBS_MLF_2021_Proj) 30 | 31 | 32 | ## Team Formation (__10. 24 Sun__) 33 | * Form a group (up to 3 students) and select data set 34 | * Designate a repository `GITHUB_ID/PHBS_MLF_2021` of one team member for the team project. 35 | * Let TA know the repository to be used for th eproject 36 | * Put team members' student # and github ID in `README.md` (for the syntax of `.md` file, see [markdown cheetsheet](https://guides.github.com/features/mastering-markdown/)) 37 | * `README.md` will be eventually the report of your course project. 38 | 39 | ## Data Selection (__10. 28 Thurs__) 40 | * No restriction on data set. However, business(fin/ma/econ) related data is welcome (extra credit for creative data selection and pre-processing) 41 | * Put the data under `GITHUB_ID/PHBS_MLF_2021/data` folder (if too big, put some samples) 42 | * Put a brief description of your data and the goal of the project in `README.md` (refer to [markdown cheetsheet](https://guides.github.com/features/mastering-markdown/)) 43 | 44 | ## Project Guidline 45 | * Report should be consist of the summary in `README.md` and the execution in python notebooks `.ipynb`. ( `.pdf`, `.ppt`, `.doc` __NOT__ accepted.) 46 | * In the `README.md` summary, 47 | * You may update your proposal file. 48 | * briefly describe your motivation, goal, data source, result and conclusion. 49 | * A few figure or table for summary is recommended. 50 | * Use links to data or `.ipynb` files (see past year examples below) 51 | * In the `.ipynb` execution, 52 | * Put command cell and edit cell (comments) in a balanced way. (Do not only put code!) 53 | * Put a brief table of contents with links (example: __PML__) 54 | * You may breakdown code into several `.ipynb` files by function (e.g., data cleaning, learning, result analysis). In that case, make sure to __save__ intermediate result into file so that I can run the later steps (result analysis) without running previous steps (data cleaning, learning). 55 | * The use of `.py` file should be strictly restricted to function or class only. (Do not put any learning procedure in `.py`) 56 | * I should be able to reproduce the result from your code. Your code should run with no error. Code with error will be severely deduct your score. Make sure to run your code in a new session. 57 | * Other considerations: 58 | * Make sure the workload within team is balanced. (Add your team members to collaborators, each team members commit codes, etc) 59 | * There should be no secret component (e.g., stock trading strategy) 60 | * Creative (out-of-textbook) ideas are recommended for better result or result analysis 61 | * Deadline for updating report is __11.21 Sunday Midnight (11:59 PM)__ 62 | -------------------------------------------------------------------------------- /past-years/2021.M1/README.md: -------------------------------------------------------------------------------- 1 | # Machine Learning for Finance (FN 570) 2021-22 Module 1 (Fall 2021) 2 | 3 | ## Announcements 4 | * Email is the preferred method of communication. Class mailing list will be created as PHBS.MLF@allmail.net. But, the announcements will be made in DingTalk group chat. 5 | 10 | 11 | ## Course Resources 12 | * Course slides: [Intro](files/MLF_Intro.pdf) | [Regression](files/MLF_Regression.pdf) | [SVM/KNN/Tree](files/MLF_SVM_KNN_Tree.pdf) | [SVD/PCA/LDA](files/MLF_SVD_PCA_LDA.pdf) | [Hyperparameter](files/MLF_Bias_Variance_Metric.pdf) | [Neural Network](files/MLF_Neural_Network.pdf) | [Graphical Model](files/MLF_Graphical_Model.pdf) 13 | * Project: [Current](Project.md) | [2019](past-years/2019.M3/Project.md) | [2018](past-years/2018.M1/Project.md) | [2017](past-years/2017.M3/Project_List.md) | [2016](past-years/2016.M3/Project_List.md) 14 | * Past years' exam: [2021](files/MLF2021_Midterm.pdf) | [2019](files/MLF2019_Midterm.pdf) (online take-home) | [2018](files/MLF2018_Midterm.pdf) | [2017](files/MLF2017_Midterm.pdf) | [Exams from Tom Michell's ML course](http://www.cs.cmu.edu/~tom/10701_sp11/prev.shtml) (Carnegie Mellon University) 15 | 16 | 20 | 21 | ## Lectures: 22 | No | Date | Contents 23 | --- | :---: | --- 24 | __01__ | 9.06 Mon | Course overview ([Syllabus](#syllabus)) \| Required software (Python, Github, PyCharm) \| Python crash course ([Basic](py/PythonCrashCourse_Derek_Banas.ipynb), [Numpy](py/PythonCrashCourse_Numpy.ipynb), Notebook Shorcut Keys) 25 | __02__ | 9.09 Thur | __PML__ Ch. 1: Intro ([Slides](files/MLF_Intro.pdf)) \| Notations, Regression, Weight update ([Slides](files/MLF_Regression.pdf)) 26 | __03__ | 9.13 Mon | __PML__ Ch. 2: Perceptron, Adaline, Gradient descent, Stochastic Gradient Descent 27 | __04__ | 9.16 Thur | __PML__ Ch. 3: Logistic Regression (LR) ([Slides](files/MLF_Regression.pdf)) and Support Vector Machine (SVM) ([Slides](files/MLF_SVM_KNN_Tree.pdf)) 28 | __05__ | 9.20 Mon | Pandas crash course ([Notebook](py/Pandas-CrashCourse.ipynb). Also see [Datacamp](https://www.datacamp.com/community/blog/python-pandas-cheat-sheet), [CheatSheet](https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf)) \| __PML__ Ch. 3: KNN ([Slides](files/MLF_SVM_KNN_Tree.pdf)) 29 | __06__ | 9.23 Thur | __PML__ Ch. 3: [Code](https://github.com/PHBS/python-machine-learning-book-3rd-edition/blob/master/ch03/ch03.ipynb). Decision Tree ([Slides](files/MLF_SVM_KNN_Tree.pdf)). 30 | __07__ | 9.27 Mon | __PML__ Ch. 4: Data Preprocessing, __PML__ Ch. 5: SVD/PCA ([Slides](MLF_SVD_PCA_LDA.pdf)) 31 | __08__ | 10.11 Mon | __PML__ Ch. 5: LDA ([Slides](MLF_SVD_PCA_LDA.pdf)), __PML__ Ch. 6: Bias-Variance, Cross-validation ([Slides](files/MLF_Bias_Variance_Metric.pdf)) 32 | __09__ | 10.13 Wed | __PML__ Ch. 6: Hyperparameter tuning, Evaluation Metric ([Slides](files/MLF_Bias_Variance_Metric.pdf)) 33 | __10__ | 10.14 Thur | __PML__ Ch. 6: Class imbalance ([Slides](files/MLF_Bias_Variance_Metric.pdf)), __PML__ Ch. 7: Ensenble Learning ([Slides](files/MLF_SVM_KNN_Tree.pdf)), Topics in Finance ML: Recession prediction ([Slides](files/MLF_Topic_RecessionPrediction.pdf)) 34 | __11__ | 10.18 Mon | Kernel Method ([Slides](files/MLF_Kernel_Method.pdf), __PML__ Ch 3, 5), __PML__ Ch. 8: Sentiment Analysis ([Slides](files/MLF_Sentiment.pdf)) 35 | __12__ | 10.21 Thur | Neural Network, Deep Learning, CNN ([Slides](MLF_Neural_Network.pdf), __PML__ Ch. 12) 36 | __13__ | 10.25 Mon | Neural Network, Deep Learning, CNN ([Slides](MLF_Neural_Network.pdf), __PML__ Ch. 13-15) 37 | __14__ | 10.28 Thur | ML in Finance Research ([Slides](files/MLF_Finance_Research.pdf)), Collaborative Filtering ([Slides](files/MLF_Col_Filtering.pdf)) 38 | __15__ | 11.01 Mon | __Midterm Exam__ ([Solution](files/MLF2021_Midterm.pdf)) 39 | __16__ | 11.04 Thur | __HSBC Guest Lecture [1/2]__ 40 | __17__ | 11.08 Mon | __HSBC Guest Lecture [2/2]__ 41 | __18__ | 11.11 Thur | Course Project Presentation 42 | 43 | 64 | 65 | ## Homeworks: 66 | * ### __Set 0: [Required Software]__ [Due by Thursday] 67 | * Register on [Github.com](https://github.com/) and let TA know your ID (by DingTalk). Make sure to user your __full real name__ in your profile. Accept invitation to the [PHBS organization](https://github.com/orgs/PHBS/people) from TA. 68 | * Create a designated repository `GITHUB_ID/PHBS_MLF_2021` for your HW and project. Tick `Initialize this repository with a README` and select `python` under `.gitignore` 69 | * Fork [PML repository](https://github.com/PHBS/python-machine-learning-book-3rd-edition) to your repository. 70 | * Install [Github Desktop](https://desktop.github.com/). Then __clone__ the PML repository to your local storage. 71 | * Install [Anaconda](https://www.anaconda.com/download/) Python distribution (__3.X version__, not 2.X version). Anaconda distribution is core Python + useful scientific computation libraries (e.g., numpy, scipy, pandas) + package management system (pip or conda) 72 | * Install [PyCharm](https://www.jetbrains.com/pycharm/) Community version. (Or Professional version after applying for [free student license](https://www.jetbrains.com/student/)) 73 | * Send to TA the screenshots of (1) Github Desktop (showing the PML repository) (2) Jupyter Notebook (Anaconda) (3) PyCharm (See my [example](https://github.com/jaehyukchoi/PHBS_MLF_2021/blob/master/HW1/Preprocessing.ipynb)). 74 | * ### __Set 1: [Playing with Pandas dataframe]__ [Due by 9.27 Monday] 75 | * The goal of this HW is to be familiar with `pandas` package and dataframe. Due to limited time, I cannot cover pandas in class. You need to teach yourself. Remenber that there's many answers to do the task I am asking below. Use your own way. 76 | * For this HW, we will use [Polish companies bankruptcy data Data Set](http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data) from UCI Machine Learning Repository. Download the dataset and put the 4th year file (`4year.arff`) in your `YOUR_GITHUB_ID/PHBS_MLF_2021/data/` 77 | * I did a basic process of the data (loading to dataframe and creating `bankruptcy` column). See my [github](https://github.com/jaehyukchoi/PHBS_MLF_2021/tree/master/HW1/) 78 | * We are going to use the following 4 features: 79 | `X1 net profit / total assets`, `X2 total liabilities / total assets`, `X7 EBIT / total assets`, `X10 equity / total assets`, and `class` 80 | * Create a new dataframe with only 4 feataures (and and `Bankruptcy`). Properly rename the columns to `X1`, `X2`, `X7`, and `X10` 81 | * Fill-in the missing values (`nan`) with the column means. (Use `pd.fillna()` or See Ch 4 of `PML`) 82 | * Find the mean and std of the 4 features among all, bankrupt and still-operating companies (3 groups). 83 | * How many companies satisfy the condition, `X1 < mean(X1) - stdev(X1)` __AND__ `X10 < mean(X10) - std(X10)`? 84 | * What is the ratio of the bankrupted companies among the sub-groups above? 85 | * ### __Set 2: [Classifiers]__ [Due by 10.11 Monday] 86 | * The goal of this HW is to be familiar with the basic classifiers __PML__ Ch 3. 87 | * For this HW, we continue to use [Polish companies bankruptcy data Data Set](http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data) from UCI Machine Learning Repository. Download the dataset and put the 4th year file (`4year.arff`) in your `YOUR_GITHUB_ID/PHBS_MLF_2021/HW2/` 88 | * I did a basic process of the data (loading to dataframe, creating `bankruptcy` column, changing column names, filling-in `na` values, training-vs-test split, standardizatino, etc). See my [github](https://github.com/jaehyukchoi/PHBS_MLF_2021/tree/master/HW2/Classifiers.ipynb) 89 | * Select the 2 most important features using LogisticRegression with L1 penalty. (Adjust C until you see 2 features) 90 | * Using the 2 selected features, apply LR / SVM / decision tree. Try your own hyperparameters (C, gamma, tree depth, etc) to maximize the prediction accuracy. (Just try several values. You don't need to show your answer is the maximum.) 91 | * Visualize your classifiers using the `plot_decision_regions` function from __PML__ Ch. 3 92 | * Put your result in `YOUR_GITHUB_ID/PHBS_MLF_2021/HW2/Classifiers.ipynb` 93 | * ### __Set 3: [PCA/Hyperparameter/CV]__ [Due by 10.21 Thursday] 94 | * The goal of this HW is to be familiar with PCA (feature extraction), grid search, pipeline, etc. 95 | * For this HW, we continue to use [Polish companies bankruptcy data Data Set](http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data) from UCI Machine Learning Repository. Download the dataset and put the 4th year file (`4year.arff`) in your `YOUR_GITHUB_ID/PHBS_MLF_2021/HW3/` 96 | * Use the same pre-precessing provided in __Set 2__ (loading to dataframe, creating `bankruptcy` column, changing column names, filling-in `na` values, training-vs-test split, standardizatino, etc). See my [github](https://github.com/jaehyukchoi/PHBS_MLF_2021/tree/master/HW3/Classifiers.ipynb) 97 | * Extract 3 features using PCA method. 98 | * Using the selected features from above, we are going to apply LR / SVM / decision tree. 99 | * Implement the methods using pipeline. (__PML__ p185) 100 | * Use grid search for finding optimal hyperparameters. (__PML__ p199). In the search, apply 5-fold cross-validation. 101 | 102 | *** 103 | # Syllabus 104 | 105 | ## Classes: 106 | * Lectures: Monday & Thursday 1:30 – 3:20 PM 107 | * Venue: PHBS Building, Room 231 108 | 109 | ## Instructor: [Jaehyuk Choi](http://www.jaehyukchoi.net/phbs_en) 110 | * Office: PHBS Building, Room 755 111 | * Phone: 86-755-2603-0568 112 | * Email: jaehyuk@phbs.pku.edu.cn 113 | * Office Hour: TBA 114 | 115 | ## Teaching Assistance: 商陈诚 (Shang Chencheng) 116 | * Email: pkuscc@stu.pku.edu.cn 117 | * TA Office Hour (Room 213/214): Monday & Thursday 7-9 PM 118 | 119 | ## Course overview 120 | With the advent of computation power and big data, machine learning (ML) recently became one of the most spotlighted research field in industry and academia. This course provides a broad introduction to ML in theoretical and practical perspectives. Through this course, students will learn the intuition and implementation behind the popular ML methods and gain hands-on experience of using ML software packages such as SK-learn and Tensorflow. This course will also explore the possibility of applying ML to finance and business. Each student is required to complete a final course project. 121 | __This year, the compliance analytics team in HSBC bank (Gunagzhou) will give 2 guest lectures to demonstrate how ML is developed and shared in banking industry.__ 122 | 123 | ## Prerequisites 124 | This course assumes prior knowkedge in probability/statistics and experience in Python. This course is ideally recommended for those who have taken introductory ML/AI courses from undergraduate program. 125 | 126 | ## Textbooks and Reading Materials 127 | ### Primary textbook 128 | * __PML__ (primary textbook): Python Machine Learning 3rd Ed. by Sebastian Raschka. 129 | * [Github](https://github.com/PHBS/python-machine-learning-book-3rd-edition) (PHBS fork) 130 | ### Other books and online courses 131 | * __ISLR__: [An Introduction to Statistical Learning (with Applications in R)](http://faculty.marshall.usc.edu/gareth-james/ISL/) by James, Witten, Hastie, and Tibshirani 132 | * Python Implementation: [PHBS/ISLR-python](https://github.com/PHBS/ISLR-python) (PHBS fork) 133 | * __Bishop__: Pattern Recognition and Machine Learning by Bishop (Microsoft) 134 | * __ESL__: [The Elements of Statistical Learning](https://web.stanford.edu/~hastie/ElemStatLearn/) by Hastie, Tibshirani, and Friedman 135 | * __CML__: [Coursera Machine Learning](https://www.coursera.org/learn/machine-learning) by Andrew Ng 136 | * __DL__: [Deep Learning](http://www.deeplearningbook.org/) by Goodfellow, Bengio, and Courville 137 | * __AFML__: [Advances in financial machine learning](https://www.amazon.com/Advances-Financial-Machine-Learning-Marcos/dp/1119482089) by López de Prado 138 | 141 | 142 | ## Assessment / Grading Details 143 | * Attendance 20%, Mid-term exam 30%, Assignments 20%, Course Project 30% 144 | * Attendance: TBA Randomly checked. The score is calculated as __`20 – 2x(#of absence)`__. Leave request should be made 24 hours before with supporting documents, except for emergency. Job interview/internship cannot be a valid reason for leave. 145 | * __Mid-term exam__: __11.1 Mon__. In-class open-book without computer/phone/calculator 146 | * __Course project__: Data Proposal and Presentation. Group of up to ?? people. 147 | * __Attendance__: checked randomly. The score is calculated as 20 – 2`x`(#of absence). Leave request should be made 24 hours before with supporting documents, except for emergency. Job interview/internship cannot be a valid reason for leave 148 | * __Grade__ in letters (e.g., A+, A-, ... ,D+, D, F). __A- or above < 30% and B- or below > 10%__. 149 | -------------------------------------------------------------------------------- /past-years/2022.M3/Project.md: -------------------------------------------------------------------------------- 1 | # Course Project 2 | 3 | ## Suggestions on project topics: 4 | ### Hoberg-Phillips similarity 5 | * [Hoberg-Phillips](https://hobergphillips.tuck.dartmouth.edu/) provide firms' product cosine similarity. 6 | * It can be used as the kernel function between firms. 7 | * Use HP similarity as a proxy for stock correlation and calculate portfolio weight 8 | * Consider a proper y variable (?) for Kernel SVM or (Kernel PCA + ML methods) 9 | * Improve HP similarity with `doc2vec` method? (quite a big project). Improve industry classification. 10 | ### Sentiment analysis on central bank statement 11 | * Train the FOMC (or PBoC's) [statements or minute](https://www.federalreserve.gov/monetarypolicy/fomccalendars.htm) with `doc2vec` (or `word2vec`) algorithm to to create vector representation 12 | * Measure the distance between the statement and minute? 13 | * Fit ML models with the policy rate change or market reaction as y variable 14 | * Identify the most important vector (and corresponding word/phrase) with feature selection/extraction 15 | 16 | ## Team List (Presentation Order) 17 | 18 | Group | Members | Repo 19 | --- | --- | --- 20 | 1 | Chen Man, Ning Lei | [XGBOOST model for slecting impotant features of stock and forming unlinear factor](https://github.com/RAY185/MLF_Final_project) 21 | 2 | Li Xinsha | [Predicting Chinese interest rate by machine learning approach](https://github.com/wn0987/PHBS_MLF_2021/blob/main/project/README.md) 22 | 3 | Li Panyu, Li Linxiong | [Signal mining based on machine learning](https://github.com/PanyuLi/PHBS_MLF_2021/blob/main/Project/README.md) 23 | 4 | Xie Zhonglin, Xu Xinyu | [Predicting Rebar Futures Price with Low-mid Frequency Data](https://github.com/sissixyx/PHBS_MLF_2021) 24 | 5 | Zhang Wenchang, Yu Lei | [Would Mr. Market sing FED's songs? -- Sentiment Analysis on the FOMC's documents](https://github.com/ahabug/PHBS_MLF_2021/blob/master/Would%20Mr.%20Market%20sing%20FED's%20songs/README.md) 25 | 6 | Jiang Yifan, Peng Feng | [Discovery of investment opportunities in high-tech industries based on patent information](https://github.com/pf-sjtu/PHBS_MLF_2021/tree/master/Proj) 26 | 7 | Qi Daifeng | [Text-Based Firm Similarity Based on Edgar 10-K Report](https://github.com/daifengqi/PHBS_MLF_2021/blob/main/final/README.md) 27 | 8 | Guo Xinran, Sun Bo | [Quantitative Trading via Machine Learning in the Chinese Stock Market](https://github.com/Harveydentsun/MLF_2021_Final_Project) 28 | 9 | Sihan Zhai, Hu Xueyang | [Sentiment Analysis on FOMC Statements and Minutes](https://github.com/XueyangHu/PHBS_MLF_2021/blob/master/Project/README.md) 29 | 10 | Wang Zijie, Ye Mengjie | [Feauture selection in stock predicition and portfolio management by Lasso and LightBGM](https://github.com/lethe-ye/PHBS_MLF_2021_Proj) 30 | 31 | 32 | ## Team Formation (__10. 24 Sun__) 33 | * Form a group (up to 3 students) and select data set 34 | * Designate a repository `GITHUB_ID/PHBS_MLF_2021` of one team member for the team project. 35 | * Let TA know the repository to be used for th eproject 36 | * Put team members' student # and github ID in `README.md` (for the syntax of `.md` file, see [markdown cheetsheet](https://guides.github.com/features/mastering-markdown/)) 37 | * `README.md` will be eventually the report of your course project. 38 | 39 | ## Data Selection (__10. 28 Thurs__) 40 | * No restriction on data set. However, business(fin/ma/econ) related data is welcome (extra credit for creative data selection and pre-processing) 41 | * Put the data under `GITHUB_ID/PHBS_MLF_2021/data` folder (if too big, put some samples) 42 | * Put a brief description of your data and the goal of the project in `README.md` (refer to [markdown cheetsheet](https://guides.github.com/features/mastering-markdown/)) 43 | 44 | ## Project Guidline 45 | * Report should be consist of the summary in `README.md` and the execution in python notebooks `.ipynb`. ( `.pdf`, `.ppt`, `.doc` __NOT__ accepted.) 46 | * In the `README.md` summary, 47 | * You may update your proposal file. 48 | * briefly describe your motivation, goal, data source, result and conclusion. 49 | * A few figure or table for summary is recommended. 50 | * Use links to data or `.ipynb` files (see past year examples below) 51 | * In the `.ipynb` execution, 52 | * Put command cell and edit cell (comments) in a balanced way. (Do not only put code!) 53 | * Put a brief table of contents with links (example: __PML__) 54 | * You may breakdown code into several `.ipynb` files by function (e.g., data cleaning, learning, result analysis). In that case, make sure to __save__ intermediate result into file so that I can run the later steps (result analysis) without running previous steps (data cleaning, learning). 55 | * The use of `.py` file should be strictly restricted to function or class only. (Do not put any learning procedure in `.py`) 56 | * I should be able to reproduce the result from your code. Your code should run with no error. Code with error will be severely deduct your score. Make sure to run your code in a new session. 57 | * Other considerations: 58 | * Make sure the workload within team is balanced. (Add your team members to collaborators, each team members commit codes, etc) 59 | * There should be no secret component (e.g., stock trading strategy) 60 | * Creative (out-of-textbook) ideas are recommended for better result or result analysis 61 | * Deadline for updating report is __11.21 Sunday Midnight (11:59 PM)__ 62 | -------------------------------------------------------------------------------- /past-years/2022.M3/README.md: -------------------------------------------------------------------------------- 1 | # Machine Learning for Finance (FN 570) 2022-23 Module 3 (Spring 2023) 2 | 3 | ## Announcements 4 | * Email is the preferred method of communication. Class mailing list will be created as PHBS.MLF@allmail.net. But, the announcements will be made in DingTalk group chat. 5 | 10 | 11 | ## Course Resources 12 | * Course slides: [Intro](files/MLF_Intro.pdf) | [Regression](files/MLF_Regression.pdf) | [SVM/KNN/Tree](files/MLF_SVM_KNN_Tree.pdf) | [SVD/PCA/LDA](files/MLF_SVD_PCA_LDA.pdf) | [Hyperparameter](files/MLF_Bias_Variance_Metric.pdf) | [Neural Network](files/MLF_Neural_Network.pdf) | [Graphical Model](files/MLF_Graphical_Model.pdf) 13 | * Project: [Current](Project.md) | [2021](past-years/2021.M1/Project.md) | [2019](past-years/2019.M3/Project.md) | [2018](past-years/2018.M1/Project.md) | [2017](past-years/2017.M3/Project_List.md) | [2016](past-years/2016.M3/Project_List.md) 14 | * Past years' exam: [2021](files/MLF2021_Midterm.pdf) | [2019](files/MLF2019_Midterm.pdf) (online take-home) | [2018](files/MLF2018_Midterm.pdf) | [2017](files/MLF2017_Midterm.pdf) | [Exams from Tom Michell's ML course](http://www.cs.cmu.edu/~tom/10701_sp11/prev.shtml) (Carnegie Mellon University) 15 | 16 | 20 | 21 | ## Lectures: 22 | No | Date | Contents 23 | --- | :---: | --- 24 | __01__ | 2.21 Tue | Course overview ([Syllabus](#syllabus)) \| Required software (Python, Github, PyCharm) \| Python crash course ([Basic](py/PythonCrashCourse_Derek_Banas.ipynb), [Numpy](py/PythonCrashCourse_Numpy.ipynb) (Notebook Shorcut Keys), [Pandas](py/Pandas-CrashCourse.ipynb). Also see [Datacamp](https://www.datacamp.com/community/blog/python-pandas-cheat-sheet), [CheatSheet](https://pandas.pydata.org/Pandas_Cheat_Sheet.pdf)) 25 | __02__ | 2.24 Fri | __PML__ Ch. 1: Intro ([Slides](files/MLF_Intro.pdf)) \| Notations, Regression, Weight update ([Slides](files/MLF_Regression.pdf)) 26 | __03__ | 2.28 Tue | __PML__ Ch. 2: Perceptron, Adaline, Gradient descent, Stochastic Gradient Descent 27 | __04__ | 3.03 Fri | __PML__ Ch. 3: Logistic Regression (LR) ([Slides](files/MLF_Regression.pdf)) and Support Vector Machine (SVM) ([Slides](files/MLF_SVM_KNN_Tree.pdf)) 28 | __05__ | 3.07 Tue | __PML__ Ch. 3: KNN ([Slides](files/MLF_SVM_KNN_Tree.pdf), [Code](https://github.com/PHBS/python-machine-learning-book-3rd-edition/blob/master/ch03/ch03.ipynb)), Decision Tree ([Slides](files/MLF_SVM_KNN_Tree.pdf)). 29 | __06__ | 3.10 Fri | __PML__ Ch. 4: Data Preprocessing, __PML__ Ch. 5: SVD/PCA ([Slides](MLF_SVD_PCA_LDA.pdf)) 30 | __07__ | 3.14 Tue | __PML__ Ch. 5: LDA ([Slides](MLF_SVD_PCA_LDA.pdf)), __PML__ Ch. 6: Bias-Variance, Cross-validation ([Slides](files/MLF_Bias_Variance_Metric.pdf)) 31 | __08__ | 3.17 Fri | __PML__ Ch. 6: Hyperparameter tuning, Evaluation Metric, Class imbalance ([Slides](files/MLF_Bias_Variance_Metric.pdf)) 32 | __09__ | 3.21 Tue | __PML__ Ch. 7: Ensenble Learning ([Slides](files/MLF_SVM_KNN_Tree.pdf)), Kernel Method ([Slides](files/MLF_Kernel_Method.pdf), __PML__ Ch 3, 5) 33 | __10__ | 3.24 Fri | __PML__ Ch. 8: Sentiment Analysis ([Slides](files/MLF_Sentiment.pdf)) 34 | __11__ | 3.28 Tue | Topics in Finance ML: Recession prediction ([Slides](files/MLF_Topic_RecessionPrediction.pdf)), ML in Finance Research ([Slides](files/MLF_Finance_Research.pdf)), Collaborative Filtering ([Slides](files/MLF_Col_Filtering.pdf)) 35 | __12__ | 3.31 Fri | Neural Network, Deep Learning, CNN ([Slides](files/MLF_Neural_Network.pdf), __PML__ Ch. 12-15) 36 | __13__ | 4.04 Tue | __Midterm Exam__ (Tentative) 37 | __14__ | 4.07 Fri | __HSBC Guest Lecture [1/4]__ 38 | __15__ | 4.11 Tue | __HSBC Guest Lecture [2/4]__ 39 | __16__ | 4.14 Fri | __HSBC Guest Lecture [3/4]__ 40 | __17__ | 4.18 Tue | __HSBC Guest Lecture [4/4]__ 41 | __18__ | 4.21 Fri | Course Project Presentation (may be scheduled later) 42 | 43 | 64 | 65 | ## Homeworks: 66 | * ### __Set 0: [Required Software]__ [Due by Friday] 67 | * Register on [Github.com](https://github.com/) and let TA know your ID (by DingTalk). Make sure to user your __full real name__ in your profile. Accept invitation to the [PHBS organization](https://github.com/orgs/PHBS/people) from TA. 68 | * Create a designated repository `GITHUB_ID/PHBS_MLF_2021` for your HW and project. Tick `Initialize this repository with a README` and select `python` under `.gitignore` 69 | * Fork [PML repository](https://github.com/PHBS/python-machine-learning-book-3rd-edition) to your repository. 70 | * Install [Github Desktop](https://desktop.github.com/). Then __clone__ the PML repository to your local storage. 71 | * Install [Anaconda](https://www.anaconda.com/download/) Python distribution (__3.X version__, not 2.X version). Anaconda distribution is core Python + useful scientific computation libraries (e.g., numpy, scipy, pandas) + package management system (pip or conda) 72 | * Install [PyCharm](https://www.jetbrains.com/pycharm/) Community version. (Or Professional version after applying for [free student license](https://www.jetbrains.com/student/)) 73 | * Send to TA the screenshots of (1) Github Desktop (showing the PML repository) (2) Jupyter Notebook (Anaconda) (3) PyCharm (See my examples: [Github Desktop](https://github.com/PHBS/ASP/blob/master/files/Choi_Jaehyuk_Github.png), [Anaconda Spyder](https://github.com/PHBS/ASP/blob/master/files/Choi_Jaehyuk_Python.png)). 74 | * ### __Set 1: [Classifiers]__ [Due by 3.22 Wed] 75 | * The goal of this HW is to be familiar with the basic classifiers __PML__ Ch 3. 76 | * For this HW, we will use [Give Me Some Credit]([http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data](https://www.kaggle.com/datasets/brycecf/give-me-some-credit-dataset)) on Kaggle. You may download from Kaggle link or CMS. 77 | * Load `cs-training.csv` into a Pandas dataframe. 78 | * Fill-in the missing values (`nan`) with the column means. (Use `pd.fillna()` or See Ch 4 of `PML`) 79 | * Select the 2 most important features using LogisticRegression with L1 penalty. (Adjust C until you see 2 features) 80 | * Using the 2 selected features, apply LR / SVM / decision tree. Try your own hyperparameters (C, gamma, tree depth, etc) to maximize the prediction accuracy. (Just try several values. You don't need to show your answer is the maximum.) 81 | * Visualize your classifiers using the `plot_decision_regions` function from __PML__ Ch. 3 82 | * Put your result in `YOUR_GITHUB_ID/Give-Me-Some-Credit/code/Classifiers.ipynb` 83 | * ### __Set 2: [PCA/Hyperparameter/CV]__ [Due by 3.29 Wed] 84 | * The goal of this HW is to be familiar with PCA (feature extraction), grid search, pipeline, k-fold CV. 85 | * For this HW, we continue to use [Give Me Some Credit]([http://archive.ics.uci.edu/ml/datasets/Polish+companies+bankruptcy+data](https://www.kaggle.com/datasets/brycecf/give-me-some-credit-dataset)) on Kaggle. 86 | * Extract a few (>2) features using PCA method. 87 | * Using the selected features from above, we are going to apply LR / SVM / decision tree (or any other algorithm). 88 | * Implement the methods using pipeline. (__PML__ p185) 89 | * Use grid search for finding optimal hyperparameters. (__PML__ p199). In the search, apply 5-fold cross-validation. 90 | 91 | *** 92 | # Syllabus 93 | 94 | ## Classes: 95 | * Lectures: Tuesday & Friday 1:30 – 3:20 PM 96 | * Venue: PHBS Building, Room 229 97 | 98 | ## Instructor: [Jaehyuk Choi](http://www.jaehyukchoi.net/phbs_en) 99 | * Office: PHBS Building, Room 755 100 | * Phone: 86-755-2603-0568 101 | * Email: jaehyuk@phbs.pku.edu.cn 102 | * Office Hour: Monday 7-9 PM 103 | 104 | ## Teaching Assistance: 苏南 (Nan SU) 105 | * Email: sunan@stu.pku.edu.cn 106 | * TA Office Hour (Room 213/214): TBA 107 | 108 | ## Course overview 109 | With the advent of computation power and big data, machine learning (ML) recently became one of the most spotlighted research field in industry and academia. This course provides a broad introduction to ML in theoretical and practical perspectives. Through this course, students will learn the intuition and implementation behind the popular ML methods and gain hands-on experience of using ML software packages such as SK-learn and Tensorflow. This course will also explore the possibility of applying ML to finance and business. Each student is required to complete a final course project. 110 | __This year, the compliance analytics team in HSBC bank (Gunagzhou) will give 4 guest lectures to demonstrate how ML is developed and shared in banking industry.__ 111 | 112 | ## Prerequisites 113 | This course assumes prior knowkedge in probability/statistics and experience in Python. This course is ideally recommended for those who have taken introductory ML/AI courses from undergraduate program. 114 | 115 | ## Textbooks and Reading Materials 116 | ### Primary textbook 117 | * __PML__ (primary textbook): Python Machine Learning 3rd Ed. by Sebastian Raschka. 118 | * [Github](https://github.com/PHBS/python-machine-learning-book-3rd-edition) (PHBS fork) 119 | ### Other books and online courses 120 | * __ISLR__: [An Introduction to Statistical Learning (with Applications in R)](http://faculty.marshall.usc.edu/gareth-james/ISL/) by James, Witten, Hastie, and Tibshirani 121 | * Python Implementation: [PHBS/ISLR-python](https://github.com/PHBS/ISLR-python) (PHBS fork) 122 | * __Bishop__: Pattern Recognition and Machine Learning by Bishop (Microsoft) 123 | * __ESL__: [The Elements of Statistical Learning](https://web.stanford.edu/~hastie/ElemStatLearn/) by Hastie, Tibshirani, and Friedman 124 | * __CML__: [Coursera Machine Learning](https://www.coursera.org/learn/machine-learning) by Andrew Ng 125 | * __DL__: [Deep Learning](http://www.deeplearningbook.org/) by Goodfellow, Bengio, and Courville 126 | * __AFML__: [Advances in financial machine learning](https://www.amazon.com/Advances-Financial-Machine-Learning-Marcos/dp/1119482089) by López de Prado 127 | 130 | 131 | ## Assessment / Grading Details 132 | * Attendance 20%, Mid-term exam 30%, Assignments 20%, Course Project 30% 133 | * Attendance: TBA Randomly checked. The score is calculated as __`20 – 2x(#of absence)`__. Leave request should be made 24 hours before with supporting documents, except for emergency. Job interview/internship cannot be a valid reason for leave. 134 | * __Mid-term exam__: __11.1 Mon__. In-class open-book without computer/phone/calculator 135 | * __Course project__: Data Proposal and Presentation. Group of up to ?? people. 136 | * __Attendance__: checked randomly. The score is calculated as 20 – 2`x`(#of absence). Leave request should be made 24 hours before with supporting documents, except for emergency. Job interview/internship cannot be a valid reason for leave 137 | * __Grade__ in letters (e.g., A+, A-, ... ,D+, D, F). __A- or above < 30% and B- or below > 10%__. 138 | -------------------------------------------------------------------------------- /py/FRB_H15m.csv: -------------------------------------------------------------------------------- 1 | "Series Description","Market yield on U.S. Treasury securities at 1-month constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 3-month constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 6-month constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 1-year constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 2-year constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 3-year constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 5-year constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 7-year constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 10-year constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 20-year constant maturity, quoted on investment basis","Market yield on U.S. Treasury securities at 30-year constant maturity, quoted on investment basis" 2 | "Unit:","Percent:_Per_Year","Percent:_Per_Year","Percent:_Per_Year","Percent:_Per_Year","Percent:_Per_Year","Percent:_Per_Year","Percent:_Per_Year","Percent:_Per_Year","Percent:_Per_Year","Percent:_Per_Year","Percent:_Per_Year" 3 | "Multiplier:","1","1","1","1","1","1","1","1","1","1","1" 4 | "Currency:","NA","NA","NA","NA","NA","NA","NA","NA","NA","NA","NA" 5 | "Unique Identifier: ","H15/H15/RIFLGFCM01_N.M","H15/H15/RIFLGFCM03_N.M","H15/H15/RIFLGFCM06_N.M","H15/H15/RIFLGFCY01_N.M","H15/H15/RIFLGFCY02_N.M","H15/H15/RIFLGFCY03_N.M","H15/H15/RIFLGFCY05_N.M","H15/H15/RIFLGFCY07_N.M","H15/H15/RIFLGFCY10_N.M","H15/H15/RIFLGFCY20_N.M","H15/H15/RIFLGFCY30_N.M" 6 | "Time Period","RIFLGFCM01_N.M","RIFLGFCM03_N.M","RIFLGFCM06_N.M","RIFLGFCY01_N.M","RIFLGFCY02_N.M","RIFLGFCY03_N.M","RIFLGFCY05_N.M","RIFLGFCY07_N.M","RIFLGFCY10_N.M","RIFLGFCY20_N.M","RIFLGFCY30_N.M" 7 | 1961-01,,,,2.81,,3.39,3.67,,3.84,3.90, 8 | 1961-02,,,,2.93,,3.46,3.66,,3.78,3.84, 9 | 1961-03,,,,2.88,,3.35,3.60,,3.74,3.81, 10 | 1961-04,,,,2.88,,3.33,3.57,,3.78,3.81, 11 | 1961-05,,,,2.87,,3.23,3.47,,3.71,3.74, 12 | 1961-06,,,,3.06,,3.63,3.81,,3.88,3.89, 13 | 1961-07,,,,2.92,,3.59,3.84,,3.92,3.93, 14 | 1961-08,,,,3.06,,3.76,3.96,,4.04,4.04, 15 | 1961-09,,,,3.06,,3.73,3.90,,3.98,4.04, 16 | 1961-10,,,,3.05,,3.62,3.80,,3.92,4.01, 17 | 1961-11,,,,3.07,,3.61,3.82,,3.94,4.00, 18 | 1961-12,,,,3.18,,3.72,3.91,,4.06,4.07, 19 | 1962-01,,,,3.28,,3.76,3.94,,4.08,4.10, 20 | 1962-02,,,,3.28,,3.69,3.89,,4.04,4.12, 21 | 1962-03,,,,3.06,,3.45,3.68,,3.93,4.04, 22 | 1962-04,,,,2.99,,3.38,3.60,,3.84,3.93, 23 | 1962-05,,,,3.03,,3.40,3.66,,3.87,3.92, 24 | 1962-06,,,,3.03,,3.39,3.64,,3.91,3.96, 25 | 1962-07,,,,3.29,,3.62,3.80,,4.01,4.05, 26 | 1962-08,,,,3.20,,3.46,3.71,,3.98,4.01, 27 | 1962-09,,,,3.06,,3.41,3.70,,3.98,4.00, 28 | 1962-10,,,,2.98,,3.33,3.64,,3.93,3.94, 29 | 1962-11,,,,3.00,,3.40,3.60,,3.92,3.93, 30 | 1962-12,,,,3.01,,3.37,3.56,,3.86,3.92, 31 | 1963-01,,,,3.04,,3.40,3.58,,3.83,3.94, 32 | 1963-02,,,,3.01,,3.39,3.66,,3.92,3.97, 33 | 1963-03,,,,3.03,,3.41,3.68,,3.93,3.98, 34 | 1963-04,,,,3.11,,3.50,3.74,,3.97,4.03, 35 | 1963-05,,,,3.12,,3.54,3.72,,3.93,4.02, 36 | 1963-06,,,,3.20,,3.61,3.81,,3.99,4.02, 37 | 1963-07,,,,3.48,,3.76,3.89,,4.02,4.06, 38 | 1963-08,,,,3.53,,3.77,3.89,,4.00,4.03, 39 | 1963-09,,,,3.57,,3.82,3.96,,4.08,4.09, 40 | 1963-10,,,,3.64,,3.87,3.97,,4.11,4.12, 41 | 1963-11,,,,3.74,,3.95,4.01,,4.12,4.16, 42 | 1963-12,,,,3.81,,4.01,4.04,,4.13,4.19, 43 | 1964-01,,,,3.79,,4.04,4.07,,4.17,4.19, 44 | 1964-02,,,,3.78,,4.00,4.03,,4.15,4.17, 45 | 1964-03,,,,3.91,,4.12,4.14,,4.22,4.22, 46 | 1964-04,,,,3.91,,4.15,4.15,,4.23,4.24, 47 | 1964-05,,,,3.84,,4.04,4.05,,4.20,4.20, 48 | 1964-06,,,,3.83,,4.01,4.02,,4.17,4.17, 49 | 1964-07,,,,3.72,,3.93,4.03,,4.19,4.16, 50 | 1964-08,,,,3.74,,3.93,4.05,,4.19,4.18, 51 | 1964-09,,,,3.84,,4.01,4.08,,4.20,4.20, 52 | 1964-10,,,,3.86,,4.02,4.07,,4.19,4.20, 53 | 1964-11,,,,3.91,,4.04,4.04,,4.15,4.17, 54 | 1964-12,,,,4.02,,4.08,4.09,,4.18,4.18, 55 | 1965-01,,,,3.94,,4.03,4.10,,4.19,4.19, 56 | 1965-02,,,,4.03,,4.08,4.15,,4.21,4.21, 57 | 1965-03,,,,4.06,,4.13,4.15,,4.21,4.20, 58 | 1965-04,,,,4.04,,4.12,4.15,,4.20,4.20, 59 | 1965-05,,,,4.03,,4.11,4.15,,4.21,4.21, 60 | 1965-06,,,,3.99,,4.08,4.15,,4.21,4.21, 61 | 1965-07,,,,3.98,,4.09,4.15,,4.20,4.21, 62 | 1965-08,,,,4.07,,4.16,4.20,,4.25,4.25, 63 | 1965-09,,,,4.20,,4.24,4.25,,4.29,4.30, 64 | 1965-10,,,,4.30,,4.33,4.34,,4.35,4.32, 65 | 1965-11,,,,4.37,,4.45,4.46,,4.45,4.40, 66 | 1965-12,,,,4.72,,4.79,4.72,,4.62,4.50, 67 | 1966-01,,,,4.88,,4.90,4.86,,4.61,4.52, 68 | 1966-02,,,,4.94,,5.02,4.98,,4.83,4.71, 69 | 1966-03,,,,4.97,,4.97,4.92,,4.87,4.72, 70 | 1966-04,,,,4.90,,4.89,4.83,,4.75,4.65, 71 | 1966-05,,,,4.93,,5.00,4.89,,4.78,4.69, 72 | 1966-06,,,,4.97,,5.05,4.97,,4.81,4.73, 73 | 1966-07,,,,5.17,,5.26,5.17,,5.02,4.84, 74 | 1966-08,,,,5.54,,5.68,5.50,,5.22,4.95, 75 | 1966-09,,,,5.82,,5.79,5.50,,5.18,4.94, 76 | 1966-10,,,,5.58,,5.48,5.27,,5.01,4.83, 77 | 1966-11,,,,5.54,,5.53,5.36,,5.16,4.87, 78 | 1966-12,,,,5.20,,5.19,5.00,,4.84,4.76, 79 | 1967-01,,,,4.75,,4.75,4.70,,4.58,4.51, 80 | 1967-02,,,,4.71,,4.73,4.74,,4.63,4.61, 81 | 1967-03,,,,4.35,,4.47,4.54,,4.54,4.57, 82 | 1967-04,,,,4.11,,4.38,4.51,,4.59,4.64, 83 | 1967-05,,,,4.15,,4.61,4.75,,4.85,4.90, 84 | 1967-06,,,,4.48,,4.89,5.01,,5.02,4.99, 85 | 1967-07,,,,5.01,,5.06,5.23,,5.16,5.01, 86 | 1967-08,,,,5.13,,5.23,5.31,,5.28,5.12, 87 | 1967-09,,,,5.24,,5.41,5.40,,5.30,5.16, 88 | 1967-10,,,,5.37,,5.52,5.57,,5.48,5.36, 89 | 1967-11,,,,5.61,,5.71,5.78,,5.75,5.66, 90 | 1967-12,,,,5.71,,5.71,5.75,,5.70,5.59, 91 | 1968-01,,,,5.43,,5.53,5.54,,5.53,5.39, 92 | 1968-02,,,,5.41,,5.61,5.59,,5.56,5.38, 93 | 1968-03,,,,5.58,,5.80,5.76,,5.74,5.59, 94 | 1968-04,,,,5.71,,5.75,5.69,,5.64,5.46, 95 | 1968-05,,,,6.14,,6.11,6.04,,5.87,5.55, 96 | 1968-06,,,,5.98,,5.82,5.85,,5.72,5.40, 97 | 1968-07,,,,5.65,,5.54,5.60,,5.50,5.29, 98 | 1968-08,,,,5.43,,5.42,5.50,,5.42,5.23, 99 | 1968-09,,,,5.45,,5.39,5.48,,5.46,5.28, 100 | 1968-10,,,,5.57,,5.52,5.55,,5.58,5.44, 101 | 1968-11,,,,5.75,,5.57,5.66,,5.70,5.56, 102 | 1968-12,,,,6.19,,6.16,6.12,,6.03,5.88, 103 | 1969-01,,,,6.34,,6.22,6.25,,6.04,5.99, 104 | 1969-02,,,,6.41,,6.32,6.34,,6.19,6.11, 105 | 1969-03,,,,6.34,,6.38,6.41,,6.30,6.22, 106 | 1969-04,,,,6.26,,6.25,6.30,,6.17,6.03, 107 | 1969-05,,,,6.42,,6.51,6.54,,6.32,6.11, 108 | 1969-06,,,,7.04,,6.83,6.75,,6.57,6.28, 109 | 1969-07,,,,7.60,,7.31,7.01,6.80,6.72,6.27, 110 | 1969-08,,,,7.54,,7.29,7.03,6.79,6.69,6.22, 111 | 1969-09,,,,7.82,,7.77,7.57,7.36,7.16,6.55, 112 | 1969-10,,,,7.64,,7.57,7.51,7.24,7.10,6.49, 113 | 1969-11,,,,7.89,,7.65,7.53,7.17,7.14,6.74, 114 | 1969-12,,,,8.17,,8.10,7.96,7.51,7.65,6.91, 115 | 1970-01,,,,8.10,,8.24,8.17,7.73,7.79,6.92, 116 | 1970-02,,,,7.59,,7.79,7.82,7.51,7.24,6.67, 117 | 1970-03,,,,6.97,,7.15,7.21,7.13,7.07,6.72, 118 | 1970-04,,,,7.06,,7.39,7.50,7.45,7.39,6.85, 119 | 1970-05,,,,7.75,,7.94,7.97,7.93,7.91,7.24, 120 | 1970-06,,,,7.55,,7.84,7.85,7.84,7.84,7.34, 121 | 1970-07,,,,7.10,,7.56,7.59,7.61,7.46,6.92, 122 | 1970-08,,,,6.98,,7.46,7.57,7.59,7.53,7.07, 123 | 1970-09,,,,6.73,,7.11,7.29,7.40,7.39,6.88, 124 | 1970-10,,,,6.43,,6.96,7.12,7.32,7.33,6.88, 125 | 1970-11,,,,5.51,,6.25,6.47,6.76,6.84,6.58, 126 | 1970-12,,,,5.00,,5.75,5.95,6.23,6.39,6.28, 127 | 1971-01,,,,4.57,,5.61,5.89,6.16,6.24,6.18, 128 | 1971-02,,,,3.89,,5.07,5.56,5.94,6.11,6.14, 129 | 1971-03,,,,3.69,,4.50,5.00,5.42,5.70,5.94, 130 | 1971-04,,,,4.30,,5.22,5.65,5.87,5.83,6.00, 131 | 1971-05,,,,5.04,,5.97,6.28,6.42,6.39,6.32, 132 | 1971-06,,,,5.64,,6.32,6.53,6.65,6.52,6.38, 133 | 1971-07,,,,6.04,,6.74,6.85,6.92,6.73,6.38, 134 | 1971-08,,,,5.80,,6.35,6.55,6.67,6.58,6.27, 135 | 1971-09,,,,5.41,,5.89,6.14,6.20,6.14,6.05, 136 | 1971-10,,,,4.91,,5.56,5.93,5.98,5.93,5.92, 137 | 1971-11,,,,4.67,,5.35,5.78,5.94,5.81,5.86, 138 | 1971-12,,,,4.60,,5.27,5.69,5.97,5.93,6.00, 139 | 1972-01,,,,4.28,,5.14,5.59,5.91,5.95,6.01, 140 | 1972-02,,,,4.27,,5.25,5.69,5.99,6.08,6.06, 141 | 1972-03,,,,4.67,,5.56,5.87,6.05,6.07,6.06, 142 | 1972-04,,,,4.96,,5.88,6.17,6.22,6.19,6.16, 143 | 1972-05,,,,4.64,,5.55,5.85,6.07,6.13,6.07, 144 | 1972-06,,,,4.93,,5.64,5.91,6.06,6.11,6.01, 145 | 1972-07,,,,4.96,,5.78,5.97,6.09,6.11,6.01, 146 | 1972-08,,,,4.98,,5.79,6.02,6.19,6.21,5.94, 147 | 1972-09,,,,5.52,,6.06,6.25,6.43,6.55,6.05, 148 | 1972-10,,,,5.52,,6.05,6.18,6.35,6.48,6.00, 149 | 1972-11,,,,5.27,,5.94,6.12,6.18,6.28,5.79, 150 | 1972-12,,,,5.52,,6.01,6.16,6.20,6.36,5.96, 151 | 1973-01,,,,5.89,,6.27,6.34,6.36,6.46,6.78, 152 | 1973-02,,,,6.19,,6.58,6.60,6.60,6.64,6.88, 153 | 1973-03,,,,6.85,,6.86,6.80,6.76,6.71,6.91, 154 | 1973-04,,,,6.85,,6.78,6.67,6.67,6.67,6.86, 155 | 1973-05,,,,6.89,,6.83,6.80,6.83,6.85,6.99, 156 | 1973-06,,,,7.31,,6.84,6.69,6.81,6.90,7.06, 157 | 1973-07,,,,8.39,,7.54,7.33,7.23,7.13,7.29, 158 | 1973-08,,,,8.82,,7.89,7.63,7.52,7.40,7.61, 159 | 1973-09,,,,8.31,,7.25,7.05,7.08,7.09,7.25, 160 | 1973-10,,,,7.40,,6.81,6.77,6.78,6.79,7.18, 161 | 1973-11,,,,7.57,,7.00,6.92,6.89,6.73,7.30, 162 | 1973-12,,,,7.27,,6.81,6.80,6.77,6.74,7.29, 163 | 1974-01,,,,7.42,,6.96,6.95,6.88,6.99,7.48, 164 | 1974-02,,,,6.88,,6.76,6.82,6.92,6.96,7.46, 165 | 1974-03,,,,7.76,,7.35,7.31,7.34,7.21,7.73, 166 | 1974-04,,,,8.62,,8.05,7.92,7.77,7.51,8.01, 167 | 1974-05,,,,8.78,,8.27,8.18,7.93,7.58,8.14, 168 | 1974-06,,,,8.67,,8.15,8.10,7.90,7.54,8.10, 169 | 1974-07,,,,8.80,,8.41,8.38,8.19,7.81,8.26, 170 | 1974-08,,,,9.36,,8.66,8.63,8.41,8.04,8.60, 171 | 1974-09,,,,8.87,,8.41,8.37,8.25,8.04,8.60, 172 | 1974-10,,,,8.05,,8.00,7.97,7.92,7.90,8.37, 173 | 1974-11,,,,7.66,,7.61,7.68,7.68,7.68,7.99, 174 | 1974-12,,,,7.31,,7.24,7.31,7.38,7.43,7.91, 175 | 1975-01,,,,6.83,,7.23,7.41,7.45,7.50,7.88, 176 | 1975-02,,,,5.98,,6.65,7.11,7.30,7.39,7.71, 177 | 1975-03,,,,6.11,,6.81,7.30,7.58,7.73,7.99, 178 | 1975-04,,,,6.90,,7.76,7.99,8.10,8.23,8.36, 179 | 1975-05,,,,6.39,,7.39,7.72,7.90,8.06,8.22, 180 | 1975-06,,,,6.29,,7.17,7.51,7.69,7.86,8.04, 181 | 1975-07,,,,7.11,,7.72,7.92,7.99,8.06,8.17, 182 | 1975-08,,,,7.70,,8.16,8.33,8.37,8.40,8.50, 183 | 1975-09,,,,7.75,,8.29,8.37,8.39,8.43,8.57, 184 | 1975-10,,,,6.95,,7.81,7.97,8.06,8.14,8.35, 185 | 1975-11,,,,6.49,,7.46,7.80,7.98,8.05,8.28, 186 | 1975-12,,,,6.60,,7.43,7.76,7.93,8.00,8.23, 187 | 1976-01,,,,5.81,,6.99,7.46,7.67,7.74,8.01, 188 | 1976-02,,,,5.91,,7.06,7.45,7.72,7.79,8.03, 189 | 1976-03,,,,6.21,,7.13,7.49,7.65,7.73,7.97, 190 | 1976-04,,,,5.92,,6.84,7.25,7.44,7.56,7.86, 191 | 1976-05,,,,6.40,,7.27,7.59,7.77,7.90,8.13, 192 | 1976-06,,,,6.52,7.06,7.31,7.61,7.75,7.86,8.03, 193 | 1976-07,,,,6.20,6.85,7.12,7.49,7.70,7.83,8.00, 194 | 1976-08,,,,6.00,6.63,6.86,7.31,7.58,7.77,7.91, 195 | 1976-09,,,,5.84,6.42,6.66,7.13,7.41,7.59,7.78, 196 | 1976-10,,,,5.50,5.98,6.24,6.75,7.16,7.41,7.70, 197 | 1976-11,,,,5.29,5.81,6.09,6.52,6.86,7.29,7.64, 198 | 1976-12,,,,4.89,5.38,5.68,6.10,6.37,6.87,7.30, 199 | 1977-01,,,,5.29,5.90,6.22,6.58,6.92,7.21,7.48, 200 | 1977-02,,,,5.47,6.09,6.44,6.83,7.16,7.39,7.64,7.75 201 | 1977-03,,,,5.50,6.09,6.47,6.93,7.20,7.46,7.73,7.80 202 | 1977-04,,,,5.44,5.96,6.31,6.79,7.11,7.37,7.67,7.73 203 | 1977-05,,,,5.84,6.25,6.55,6.94,7.26,7.46,7.74,7.80 204 | 1977-06,,,,5.80,6.13,6.39,6.76,7.05,7.28,7.64,7.64 205 | 1977-07,,,,5.94,6.27,6.51,6.84,7.12,7.33,7.60,7.64 206 | 1977-08,,,,6.37,6.61,6.79,7.03,7.24,7.40,7.64,7.68 207 | 1977-09,,,,6.53,6.71,6.84,7.04,7.21,7.34,7.57,7.64 208 | 1977-10,,,,6.97,7.11,7.19,7.32,7.44,7.52,7.71,7.77 209 | 1977-11,,,,6.95,7.14,7.22,7.34,7.46,7.58,7.76,7.85 210 | 1977-12,,,,6.96,7.18,7.30,7.48,7.59,7.69,7.87,7.94 211 | 1978-01,,,,7.28,7.49,7.61,7.77,7.86,7.96,8.14,8.18 212 | 1978-02,,,,7.34,7.57,7.67,7.83,7.94,8.03,8.22,8.25 213 | 1978-03,,,,7.31,7.58,7.70,7.86,7.95,8.04,8.21,8.23 214 | 1978-04,,,,7.45,7.74,7.85,7.98,8.06,8.15,8.32,8.34 215 | 1978-05,,,,7.82,8.01,8.07,8.18,8.25,8.35,8.44,8.43 216 | 1978-06,,,,8.09,8.24,8.30,8.36,8.40,8.46,8.53,8.50 217 | 1978-07,,,,8.39,8.49,8.54,8.54,8.55,8.64,8.69,8.65 218 | 1978-08,,,,8.31,8.37,8.33,8.33,8.38,8.41,8.45,8.47 219 | 1978-09,,,,8.64,8.57,8.41,8.43,8.42,8.42,8.47,8.47 220 | 1978-10,,,,9.14,8.85,8.62,8.61,8.64,8.64,8.69,8.67 221 | 1978-11,,,,10.01,9.42,9.04,8.84,8.80,8.81,8.75,8.75 222 | 1978-12,,,,10.30,9.72,9.33,9.08,9.03,9.01,8.90,8.88 223 | 1979-01,,,,10.41,9.86,9.50,9.20,9.14,9.10,8.98,8.94 224 | 1979-02,,,,10.24,9.72,9.29,9.13,9.11,9.10,9.03,9.00 225 | 1979-03,,,,10.25,9.79,9.38,9.20,9.15,9.12,9.08,9.03 226 | 1979-04,,,,10.12,9.78,9.43,9.25,9.21,9.18,9.12,9.08 227 | 1979-05,,,,10.12,9.78,9.42,9.24,9.23,9.25,9.21,9.19 228 | 1979-06,,,,9.57,9.22,8.95,8.85,8.86,8.91,8.91,8.92 229 | 1979-07,,,,9.64,9.14,8.94,8.90,8.92,8.95,8.92,8.93 230 | 1979-08,,,,9.98,9.46,9.14,9.06,9.05,9.03,8.97,8.98 231 | 1979-09,,,,10.84,10.06,9.69,9.41,9.38,9.33,9.21,9.17 232 | 1979-10,,,,12.44,11.49,10.95,10.63,10.47,10.30,9.99,9.85 233 | 1979-11,,,,12.39,11.81,11.18,10.93,10.80,10.65,10.37,10.30 234 | 1979-12,,,,11.98,11.39,10.71,10.42,10.42,10.39,10.18,10.12 235 | 1980-01,,,,12.06,11.50,10.88,10.74,10.77,10.80,10.65,10.60 236 | 1980-02,,,,13.92,13.42,12.84,12.60,12.53,12.41,12.21,12.13 237 | 1980-03,,,,15.82,14.88,14.05,13.47,13.00,12.75,12.49,12.34 238 | 1980-04,,,,13.30,12.50,12.02,11.84,11.49,11.47,11.41,11.40 239 | 1980-05,,,,9.39,9.45,9.44,9.95,10.09,10.18,10.44,10.36 240 | 1980-06,,,,8.16,8.73,8.91,9.21,9.45,9.78,9.89,9.81 241 | 1980-07,,,,8.65,9.03,9.27,9.53,9.84,10.25,10.32,10.24 242 | 1980-08,,,,10.24,10.53,10.63,10.84,10.95,11.10,11.07,11.00 243 | 1980-09,,,,11.52,11.57,11.57,11.62,11.57,11.51,11.47,11.34 244 | 1980-10,,,,12.49,12.09,12.01,11.86,11.79,11.75,11.75,11.59 245 | 1980-11,,,,14.15,13.51,13.31,12.83,12.71,12.68,12.44,12.37 246 | 1980-12,,,,14.88,14.08,13.65,13.25,13.00,12.84,12.49,12.40 247 | 1981-01,,,,14.08,13.26,13.01,12.77,12.66,12.57,12.29,12.14 248 | 1981-02,,,,14.57,13.92,13.65,13.41,13.28,13.19,12.98,12.80 249 | 1981-03,,,,13.71,13.57,13.51,13.41,13.24,13.12,12.94,12.69 250 | 1981-04,,,,14.32,14.15,14.09,13.99,13.85,13.68,13.46,13.20 251 | 1981-05,,,,16.20,15.46,15.08,14.63,14.30,14.10,13.82,13.60 252 | 1981-06,,,,14.86,14.51,14.29,13.95,13.67,13.47,13.20,12.96 253 | 1981-07,,,,15.72,15.35,15.15,14.79,14.49,14.28,13.92,13.59 254 | 1981-08,,,,16.72,16.28,16.00,15.56,15.22,14.94,14.52,14.17 255 | 1981-09,,15.61,16.36,16.52,16.46,16.22,15.93,15.65,15.32,15.07,14.67 256 | 1981-10,,14.23,15.06,15.38,15.54,15.50,15.41,15.33,15.15,15.13,14.68 257 | 1981-11,,11.35,12.12,12.41,12.88,13.11,13.38,13.42,13.39,13.56,13.35 258 | 1981-12,,11.32,12.44,12.85,13.29,13.66,13.60,13.62,13.72,13.73,13.45 259 | 1982-01,,12.92,13.90,14.32,14.57,14.64,14.65,14.67,14.59,14.57,14.22 260 | 1982-02,,14.28,14.81,14.73,14.82,14.73,14.54,14.46,14.43,14.48,14.22 261 | 1982-03,,13.31,13.83,13.95,14.19,14.13,13.98,13.93,13.86,13.75,13.53 262 | 1982-04,,13.34,13.87,13.98,14.20,14.18,14.00,13.94,13.87,13.57,13.37 263 | 1982-05,,12.71,13.13,13.34,13.78,13.77,13.75,13.74,13.62,13.46,13.24 264 | 1982-06,,13.08,13.76,14.07,14.47,14.48,14.43,14.47,14.30,14.18,13.92 265 | 1982-07,,11.86,12.80,13.24,13.80,14.00,14.07,14.07,13.95,13.76,13.55 266 | 1982-08,,9.00,10.51,11.43,12.32,12.62,13.00,13.14,13.06,12.91,12.77 267 | 1982-09,,8.19,9.83,10.85,11.78,12.03,12.25,12.36,12.34,12.16,12.07 268 | 1982-10,,7.97,8.63,9.32,10.19,10.62,10.80,10.88,10.91,10.97,11.17 269 | 1982-11,,8.35,8.80,9.16,9.80,9.98,10.38,10.53,10.55,10.57,10.54 270 | 1982-12,,8.20,8.59,8.91,9.66,9.88,10.22,10.49,10.54,10.62,10.54 271 | 1983-01,,8.12,8.33,8.62,9.33,9.64,10.03,10.36,10.46,10.78,10.63 272 | 1983-02,,8.39,8.65,8.92,9.64,9.91,10.26,10.56,10.72,11.03,10.88 273 | 1983-03,,8.66,8.86,9.04,9.66,9.84,10.08,10.31,10.51,10.80,10.63 274 | 1983-04,,8.51,8.78,8.98,9.57,9.76,10.02,10.29,10.40,10.63,10.48 275 | 1983-05,,8.50,8.70,8.90,9.49,9.66,10.03,10.30,10.38,10.67,10.53 276 | 1983-06,,9.14,9.44,9.66,10.18,10.32,10.63,10.83,10.85,11.12,10.93 277 | 1983-07,,9.45,9.85,10.20,10.69,10.90,11.21,11.35,11.38,11.59,11.40 278 | 1983-08,,9.74,10.16,10.53,11.07,11.30,11.63,11.77,11.85,11.96,11.82 279 | 1983-09,,9.36,9.73,10.16,10.79,11.07,11.43,11.61,11.65,11.82,11.63 280 | 1983-10,,8.99,9.39,9.81,10.57,10.87,11.28,11.47,11.54,11.77,11.58 281 | 1983-11,,9.11,9.48,9.94,10.66,10.96,11.41,11.61,11.69,11.92,11.75 282 | 1983-12,,9.36,9.76,10.11,10.84,11.13,11.54,11.78,11.83,12.02,11.88 283 | 1984-01,,9.26,9.56,9.90,10.64,10.93,11.37,11.58,11.67,11.82,11.75 284 | 1984-02,,9.46,9.77,10.04,10.79,11.05,11.54,11.75,11.84,12.00,11.95 285 | 1984-03,,9.89,10.27,10.59,11.31,11.59,12.02,12.25,12.32,12.45,12.38 286 | 1984-04,,10.07,10.47,10.90,11.69,11.98,12.37,12.56,12.63,12.65,12.65 287 | 1984-05,,10.22,11.02,11.66,12.47,12.75,13.17,13.34,13.41,13.43,13.43 288 | 1984-06,,10.26,11.24,12.08,12.91,13.18,13.48,13.56,13.56,13.54,13.44 289 | 1984-07,,10.53,11.27,12.03,12.88,13.08,13.27,13.35,13.36,13.36,13.21 290 | 1984-08,,10.90,11.37,11.82,12.43,12.50,12.68,12.75,12.72,12.71,12.54 291 | 1984-09,,10.80,11.19,11.58,12.20,12.34,12.53,12.60,12.52,12.42,12.29 292 | 1984-10,,10.12,10.52,10.90,11.60,11.85,12.06,12.16,12.16,12.04,11.98 293 | 1984-11,,8.92,9.34,9.82,10.65,10.90,11.33,11.49,11.57,11.66,11.56 294 | 1984-12,,8.34,8.76,9.33,10.18,10.56,11.07,11.45,11.50,11.64,11.52 295 | 1985-01,,8.02,8.45,9.02,9.93,10.43,10.93,11.27,11.38,11.58,11.45 296 | 1985-02,,8.56,8.87,9.29,10.17,10.55,11.13,11.44,11.51,11.70,11.47 297 | 1985-03,,8.83,9.45,9.86,10.71,11.05,11.52,11.82,11.86,12.06,11.81 298 | 1985-04,,8.22,8.71,9.14,10.09,10.49,11.01,11.34,11.43,11.69,11.47 299 | 1985-05,,7.73,8.07,8.46,9.39,9.75,10.34,10.72,10.85,11.19,11.05 300 | 1985-06,,7.18,7.46,7.80,8.69,9.05,9.60,10.08,10.16,10.57,10.45 301 | 1985-07,,7.32,7.57,7.86,8.77,9.18,9.70,10.16,10.31,10.68,10.50 302 | 1985-08,,7.37,7.71,8.05,8.94,9.31,9.81,10.20,10.33,10.73,10.56 303 | 1985-09,,7.33,7.64,8.07,8.98,9.37,9.81,10.24,10.37,10.80,10.61 304 | 1985-10,,7.40,7.71,8.01,8.86,9.25,9.69,10.11,10.24,10.67,10.50 305 | 1985-11,,7.48,7.68,7.88,8.58,8.88,9.28,9.62,9.78,10.24,10.06 306 | 1985-12,,7.33,7.50,7.67,8.15,8.40,8.73,9.11,9.26,9.75,9.54 307 | 1986-01,,7.30,7.53,7.73,8.14,8.41,8.68,9.03,9.19,9.59,9.40 308 | 1986-02,,7.29,7.47,7.61,7.97,8.10,8.34,8.58,8.70,9.08,8.93 309 | 1986-03,,6.76,6.89,7.03,7.21,7.30,7.46,7.67,7.78,8.09,7.96 310 | 1986-04,,6.24,6.36,6.44,6.70,6.86,7.05,7.16,7.30,7.50,7.39 311 | 1986-05,,6.33,6.47,6.65,7.07,7.27,7.52,7.65,7.71,7.81,7.52 312 | 1986-06,,6.40,6.56,6.73,7.18,7.41,7.64,7.75,7.80,7.69,7.57 313 | 1986-07,,6.00,6.12,6.27,6.67,6.86,7.06,7.22,7.30,7.29,7.27 314 | 1986-08,,5.69,5.79,5.93,6.33,6.49,6.80,7.01,7.17,7.28,7.33 315 | 1986-09,,5.35,5.57,5.77,6.35,6.62,6.92,7.28,7.45,7.56,7.62 316 | 1986-10,,5.32,5.48,5.72,6.28,6.56,6.83,7.24,7.43,7.61,7.70 317 | 1986-11,,5.50,5.64,5.80,6.28,6.46,6.76,7.08,7.25,7.42,7.52 318 | 1986-12,,5.68,5.78,5.87,6.27,6.43,6.67,6.97,7.11,7.28,7.37 319 | 1987-01,,5.58,5.67,5.78,6.23,6.41,6.64,6.92,7.08,7.24,7.39 320 | 1987-02,,5.75,5.83,5.96,6.40,6.56,6.79,7.06,7.25,7.40,7.54 321 | 1987-03,,5.77,5.86,6.03,6.42,6.58,6.79,7.06,7.25,7.40,7.55 322 | 1987-04,,5.82,6.19,6.50,7.02,7.32,7.57,7.83,8.02,8.14,8.25 323 | 1987-05,,5.85,6.35,7.00,7.76,8.02,8.26,8.47,8.61,8.70,8.78 324 | 1987-06,,5.85,6.28,6.80,7.57,7.82,8.02,8.27,8.40,8.49,8.57 325 | 1987-07,,5.88,6.05,6.68,7.44,7.74,8.01,8.27,8.45,8.54,8.64 326 | 1987-08,,6.23,6.46,7.03,7.75,8.03,8.32,8.59,8.76,8.87,8.97 327 | 1987-09,,6.62,6.99,7.67,8.34,8.67,8.94,9.26,9.42,9.51,9.59 328 | 1987-10,,6.35,7.04,7.59,8.40,8.75,9.08,9.37,9.52,9.57,9.61 329 | 1987-11,,5.89,6.50,6.96,7.69,7.99,8.35,8.69,8.86,8.91,8.95 330 | 1987-12,,5.96,6.68,7.17,7.86,8.13,8.45,8.82,8.99,9.06,9.12 331 | 1988-01,,6.00,6.56,6.99,7.63,7.87,8.18,8.48,8.67,8.76,8.83 332 | 1988-02,,5.84,6.21,6.64,7.18,7.38,7.71,8.02,8.21,8.32,8.43 333 | 1988-03,,5.87,6.18,6.71,7.27,7.50,7.83,8.19,8.37,8.50,8.63 334 | 1988-04,,6.08,6.50,7.01,7.59,7.83,8.19,8.52,8.72,8.84,8.95 335 | 1988-05,,6.45,6.89,7.40,8.00,8.24,8.58,8.89,9.09,9.16,9.23 336 | 1988-06,,6.66,7.04,7.49,8.03,8.22,8.49,8.78,8.92,8.96,9.00 337 | 1988-07,,6.95,7.35,7.75,8.28,8.44,8.66,8.91,9.06,9.10,9.14 338 | 1988-08,,7.30,7.79,8.17,8.63,8.77,8.94,9.13,9.26,9.29,9.32 339 | 1988-09,,7.48,7.82,8.09,8.46,8.57,8.69,8.87,8.98,9.02,9.06 340 | 1988-10,,7.60,7.90,8.11,8.35,8.43,8.51,8.69,8.80,8.85,8.89 341 | 1988-11,,8.03,8.30,8.48,8.67,8.72,8.79,8.89,8.96,8.99,9.02 342 | 1988-12,,8.35,8.70,8.99,9.09,9.11,9.09,9.13,9.11,9.06,9.01 343 | 1989-01,,8.56,8.85,9.05,9.18,9.20,9.15,9.14,9.09,9.02,8.93 344 | 1989-02,,8.84,9.05,9.25,9.37,9.32,9.27,9.23,9.17,9.09,9.01 345 | 1989-03,,9.14,9.39,9.57,9.68,9.61,9.51,9.43,9.36,9.26,9.17 346 | 1989-04,,8.96,9.17,9.36,9.45,9.40,9.30,9.24,9.18,9.10,9.03 347 | 1989-05,,8.74,8.91,8.98,9.02,8.98,8.91,8.88,8.86,8.85,8.83 348 | 1989-06,,8.43,8.38,8.44,8.41,8.37,8.29,8.31,8.28,8.27,8.27 349 | 1989-07,,8.15,8.01,7.89,7.82,7.83,7.83,7.94,8.02,8.05,8.08 350 | 1989-08,,8.17,8.17,8.18,8.14,8.13,8.09,8.11,8.11,8.12,8.12 351 | 1989-09,,8.01,8.16,8.22,8.28,8.26,8.17,8.23,8.19,8.18,8.15 352 | 1989-10,,7.90,8.03,7.99,7.98,8.02,7.97,8.03,8.01,8.00,8.00 353 | 1989-11,,7.94,7.89,7.77,7.80,7.80,7.81,7.86,7.87,7.89,7.90 354 | 1989-12,,7.88,7.81,7.72,7.78,7.77,7.75,7.85,7.84,7.87,7.90 355 | 1990-01,,7.90,7.96,7.92,8.09,8.13,8.12,8.20,8.21,8.24,8.26 356 | 1990-02,,8.00,8.12,8.11,8.37,8.39,8.42,8.48,8.47,8.49,8.50 357 | 1990-03,,8.17,8.28,8.35,8.63,8.63,8.60,8.65,8.59,8.58,8.56 358 | 1990-04,,8.04,8.27,8.40,8.72,8.78,8.77,8.81,8.79,8.77,8.76 359 | 1990-05,,8.01,8.19,8.32,8.64,8.69,8.74,8.78,8.76,8.75,8.73 360 | 1990-06,,7.99,8.05,8.10,8.35,8.40,8.43,8.52,8.48,8.47,8.46 361 | 1990-07,,7.87,7.92,7.94,8.16,8.26,8.33,8.46,8.47,8.49,8.50 362 | 1990-08,,7.69,7.77,7.78,8.06,8.22,8.44,8.64,8.75,8.81,8.86 363 | 1990-09,,7.60,7.70,7.76,8.08,8.27,8.51,8.79,8.89,8.96,9.03 364 | 1990-10,,7.40,7.53,7.55,7.88,8.07,8.33,8.59,8.72,8.79,8.86 365 | 1990-11,,7.29,7.39,7.31,7.60,7.74,8.02,8.28,8.39,8.47,8.54 366 | 1990-12,,6.95,7.03,7.05,7.31,7.47,7.73,8.00,8.08,8.16,8.24 367 | 1991-01,,6.41,6.58,6.64,7.13,7.38,7.70,7.97,8.09,8.18,8.27 368 | 1991-02,,6.12,6.19,6.27,6.87,7.08,7.47,7.73,7.85,7.95,8.03 369 | 1991-03,,6.09,6.20,6.40,7.10,7.35,7.77,8.00,8.11,8.20,8.29 370 | 1991-04,,5.83,5.98,6.24,6.95,7.23,7.70,7.92,8.04,8.13,8.21 371 | 1991-05,,5.63,5.87,6.13,6.78,7.12,7.70,7.94,8.07,8.17,8.27 372 | 1991-06,,5.75,6.02,6.36,6.96,7.39,7.94,8.17,8.28,8.38,8.47 373 | 1991-07,,5.75,5.97,6.31,6.92,7.38,7.91,8.15,8.27,8.37,8.45 374 | 1991-08,,5.50,5.63,5.78,6.43,6.80,7.43,7.74,7.90,8.02,8.14 375 | 1991-09,,5.37,5.48,5.57,6.18,6.50,7.14,7.48,7.65,7.80,7.95 376 | 1991-10,,5.14,5.26,5.33,5.91,6.23,6.87,7.25,7.53,7.73,7.93 377 | 1991-11,,4.69,4.80,4.89,5.56,5.90,6.62,7.06,7.42,7.67,7.92 378 | 1991-12,,4.18,4.26,4.38,5.03,5.39,6.19,6.69,7.09,7.40,7.70 379 | 1992-01,,3.91,4.01,4.15,4.96,5.40,6.24,6.70,7.03,7.31,7.58 380 | 1992-02,,3.95,4.08,4.29,5.21,5.72,6.58,6.96,7.34,7.60,7.85 381 | 1992-03,,4.14,4.33,4.63,5.69,6.18,6.95,7.26,7.54,7.76,7.97 382 | 1992-04,,3.84,4.00,4.30,5.34,5.93,6.78,7.15,7.48,7.72,7.96 383 | 1992-05,,3.72,3.88,4.19,5.23,5.81,6.69,7.06,7.39,7.65,7.89 384 | 1992-06,,3.75,3.90,4.17,5.05,5.60,6.48,6.90,7.26,7.55,7.84 385 | 1992-07,,3.28,3.38,3.60,4.36,4.91,5.84,6.36,6.84,7.22,7.60 386 | 1992-08,,3.20,3.31,3.47,4.19,4.72,5.60,6.12,6.59,6.99,7.39 387 | 1992-09,,2.97,3.04,3.18,3.89,4.42,5.38,5.96,6.42,6.88,7.34 388 | 1992-10,,2.93,3.13,3.30,4.08,4.64,5.60,6.15,6.59,7.06,7.53 389 | 1992-11,,3.21,3.44,3.68,4.58,5.14,6.04,6.49,6.87,7.24,7.61 390 | 1992-12,,3.29,3.47,3.71,4.67,5.21,6.08,6.46,6.77,7.11,7.44 391 | 1993-01,,3.07,3.24,3.50,4.39,4.93,5.83,6.26,6.60,6.97,7.34 392 | 1993-02,,2.99,3.16,3.39,4.10,4.58,5.43,5.87,6.26,6.68,7.09 393 | 1993-03,,3.01,3.15,3.33,3.95,4.40,5.19,5.66,5.98,6.40,6.82 394 | 1993-04,,2.93,3.06,3.24,3.84,4.30,5.13,5.59,5.97,6.41,6.85 395 | 1993-05,,3.03,3.17,3.36,3.98,4.40,5.20,5.66,6.04,6.48,6.92 396 | 1993-06,,3.14,3.29,3.54,4.16,4.53,5.22,5.61,5.96,6.39,6.81 397 | 1993-07,,3.11,3.26,3.47,4.07,4.43,5.09,5.48,5.81,6.22,6.63 398 | 1993-08,,3.09,3.24,3.44,4.00,4.36,5.03,5.35,5.68,6.00,6.32 399 | 1993-09,,3.01,3.15,3.36,3.85,4.17,4.73,5.08,5.36,5.68,6.00 400 | 1993-10,,3.09,3.22,3.39,3.87,4.18,4.71,5.05,5.33,6.07,5.94 401 | 1993-11,,3.18,3.36,3.58,4.16,4.50,5.06,5.45,5.72,6.38,6.21 402 | 1993-12,,3.13,3.34,3.61,4.21,4.54,5.15,5.48,5.77,6.40,6.25 403 | 1994-01,,3.04,3.25,3.54,4.14,4.48,5.09,5.43,5.75,6.39,6.29 404 | 1994-02,,3.33,3.53,3.87,4.47,4.83,5.40,5.72,5.97,6.57,6.49 405 | 1994-03,,3.59,3.91,4.32,5.00,5.40,5.94,6.28,6.48,7.00,6.91 406 | 1994-04,,3.78,4.25,4.82,5.55,5.99,6.52,6.80,6.97,7.40,7.27 407 | 1994-05,,4.27,4.79,5.31,5.97,6.34,6.78,7.01,7.18,7.54,7.41 408 | 1994-06,,4.25,4.72,5.27,5.93,6.27,6.70,6.91,7.10,7.51,7.40 409 | 1994-07,,4.46,4.95,5.48,6.13,6.48,6.91,7.12,7.30,7.67,7.58 410 | 1994-08,,4.61,5.08,5.56,6.18,6.50,6.88,7.06,7.24,7.62,7.49 411 | 1994-09,,4.75,5.24,5.76,6.39,6.69,7.08,7.28,7.46,7.87,7.71 412 | 1994-10,,5.10,5.62,6.11,6.73,7.04,7.40,7.58,7.74,8.08,7.94 413 | 1994-11,,5.45,5.98,6.54,7.15,7.44,7.72,7.83,7.96,8.20,8.08 414 | 1994-12,,5.76,6.50,7.14,7.59,7.71,7.78,7.80,7.81,7.99,7.87 415 | 1995-01,,5.90,6.51,7.05,7.51,7.66,7.76,7.79,7.78,7.97,7.85 416 | 1995-02,,5.94,6.31,6.70,7.11,7.25,7.37,7.44,7.47,7.73,7.61 417 | 1995-03,,5.91,6.17,6.43,6.78,6.89,7.05,7.14,7.20,7.57,7.45 418 | 1995-04,,5.84,6.05,6.27,6.57,6.68,6.86,6.95,7.06,7.45,7.36 419 | 1995-05,,5.85,5.93,6.00,6.17,6.27,6.41,6.50,6.63,7.01,6.95 420 | 1995-06,,5.64,5.66,5.64,5.72,5.80,5.93,6.05,6.17,6.59,6.57 421 | 1995-07,,5.59,5.62,5.59,5.78,5.89,6.01,6.20,6.28,6.74,6.72 422 | 1995-08,,5.57,5.65,5.75,5.98,6.10,6.24,6.41,6.49,6.92,6.86 423 | 1995-09,,5.43,5.54,5.62,5.81,5.89,6.00,6.13,6.20,6.65,6.55 424 | 1995-10,,5.44,5.56,5.59,5.70,5.77,5.86,5.97,6.04,6.45,6.37 425 | 1995-11,,5.52,5.51,5.43,5.48,5.57,5.69,5.83,5.93,6.33,6.26 426 | 1995-12,,5.29,5.35,5.31,5.32,5.39,5.51,5.63,5.71,6.12,6.06 427 | 1996-01,,5.15,5.13,5.09,5.11,5.20,5.36,5.54,5.65,6.11,6.05 428 | 1996-02,,4.96,4.97,4.94,5.03,5.14,5.38,5.64,5.81,6.30,6.24 429 | 1996-03,,5.10,5.16,5.34,5.66,5.79,5.97,6.19,6.27,6.74,6.60 430 | 1996-04,,5.09,5.27,5.54,5.96,6.11,6.30,6.48,6.51,6.98,6.79 431 | 1996-05,,5.15,5.33,5.64,6.10,6.27,6.48,6.66,6.74,7.11,6.93 432 | 1996-06,,5.23,5.46,5.81,6.30,6.49,6.69,6.83,6.91,7.22,7.06 433 | 1996-07,,5.30,5.52,5.85,6.27,6.45,6.64,6.76,6.87,7.14,7.03 434 | 1996-08,,5.19,5.34,5.67,6.03,6.21,6.39,6.52,6.64,6.97,6.84 435 | 1996-09,,5.24,5.45,5.83,6.23,6.41,6.60,6.73,6.83,7.17,7.03 436 | 1996-10,,5.12,5.32,5.55,5.91,6.08,6.27,6.42,6.53,6.90,6.81 437 | 1996-11,,5.17,5.27,5.42,5.70,5.82,5.97,6.10,6.20,6.58,6.48 438 | 1996-12,,5.04,5.24,5.47,5.78,5.91,6.07,6.20,6.30,6.65,6.55 439 | 1997-01,,5.17,5.31,5.61,6.01,6.16,6.33,6.47,6.58,6.91,6.83 440 | 1997-02,,5.14,5.27,5.53,5.90,6.03,6.20,6.32,6.42,6.77,6.69 441 | 1997-03,,5.28,5.48,5.80,6.22,6.38,6.54,6.65,6.69,7.05,6.93 442 | 1997-04,,5.30,5.60,5.99,6.45,6.61,6.76,6.86,6.89,7.20,7.09 443 | 1997-05,,5.20,5.53,5.87,6.28,6.42,6.57,6.66,6.71,7.02,6.94 444 | 1997-06,,5.07,5.34,5.69,6.09,6.24,6.38,6.46,6.49,6.84,6.77 445 | 1997-07,,5.19,5.33,5.54,5.89,6.00,6.12,6.20,6.22,6.56,6.51 446 | 1997-08,,5.28,5.40,5.56,5.94,6.06,6.16,6.29,6.30,6.65,6.58 447 | 1997-09,,5.08,5.30,5.52,5.88,5.98,6.11,6.20,6.21,6.56,6.50 448 | 1997-10,,5.11,5.30,5.46,5.77,5.84,5.93,6.05,6.03,6.38,6.33 449 | 1997-11,,5.28,5.38,5.46,5.71,5.76,5.80,5.90,5.88,6.20,6.11 450 | 1997-12,,5.30,5.45,5.53,5.72,5.74,5.77,5.83,5.81,6.07,5.99 451 | 1998-01,,5.18,5.23,5.24,5.36,5.38,5.42,5.53,5.54,5.88,5.81 452 | 1998-02,,5.23,5.27,5.31,5.42,5.43,5.49,5.60,5.57,5.96,5.89 453 | 1998-03,,5.16,5.25,5.39,5.56,5.57,5.61,5.71,5.65,6.01,5.95 454 | 1998-04,,5.08,5.26,5.38,5.56,5.58,5.61,5.70,5.64,6.00,5.92 455 | 1998-05,,5.14,5.36,5.44,5.59,5.61,5.63,5.72,5.65,6.01,5.93 456 | 1998-06,,5.12,5.32,5.41,5.52,5.52,5.52,5.56,5.50,5.80,5.70 457 | 1998-07,,5.09,5.23,5.36,5.46,5.47,5.46,5.52,5.46,5.78,5.68 458 | 1998-08,,5.04,5.15,5.21,5.27,5.24,5.27,5.36,5.34,5.66,5.54 459 | 1998-09,,4.74,4.81,4.71,4.67,4.62,4.62,4.76,4.81,5.38,5.20 460 | 1998-10,,4.07,4.20,4.12,4.09,4.18,4.18,4.46,4.53,5.30,5.01 461 | 1998-11,,4.53,4.59,4.53,4.54,4.57,4.54,4.78,4.83,5.48,5.25 462 | 1998-12,,4.50,4.57,4.52,4.51,4.48,4.45,4.65,4.65,5.36,5.06 463 | 1999-01,,4.45,4.49,4.51,4.62,4.61,4.60,4.80,4.72,5.45,5.16 464 | 1999-02,,4.56,4.61,4.70,4.88,4.90,4.91,5.10,5.00,5.66,5.37 465 | 1999-03,,4.57,4.65,4.78,5.05,5.11,5.14,5.36,5.23,5.87,5.58 466 | 1999-04,,4.41,4.54,4.69,4.98,5.03,5.08,5.28,5.18,5.82,5.55 467 | 1999-05,,4.63,4.75,4.85,5.25,5.33,5.44,5.64,5.54,6.08,5.81 468 | 1999-06,,4.72,5.03,5.10,5.62,5.70,5.81,6.05,5.90,6.36,6.04 469 | 1999-07,,4.69,4.75,5.03,5.55,5.62,5.68,5.94,5.79,6.28,5.98 470 | 1999-08,,4.87,5.09,5.20,5.68,5.77,5.84,6.15,5.94,6.43,6.07 471 | 1999-09,,4.82,5.08,5.25,5.66,5.75,5.80,6.12,5.92,6.50,6.07 472 | 1999-10,,5.02,5.20,5.43,5.86,5.94,6.03,6.33,6.11,6.66,6.26 473 | 1999-11,,5.23,5.43,5.55,5.86,5.92,5.97,6.17,6.03,6.48,6.15 474 | 1999-12,,5.36,5.68,5.84,6.10,6.14,6.19,6.38,6.28,6.69,6.35 475 | 2000-01,,5.50,5.76,6.12,6.44,6.49,6.58,6.70,6.66,6.86,6.63 476 | 2000-02,,5.73,6.00,6.22,6.61,6.65,6.68,6.72,6.52,6.54,6.23 477 | 2000-03,,5.86,6.11,6.22,6.53,6.53,6.50,6.51,6.26,6.38,6.05 478 | 2000-04,,5.82,6.07,6.15,6.40,6.36,6.26,6.27,5.99,6.18,5.85 479 | 2000-05,,5.99,6.39,6.33,6.81,6.77,6.69,6.69,6.44,6.55,6.15 480 | 2000-06,,5.86,6.24,6.17,6.48,6.43,6.30,6.33,6.10,6.28,5.93 481 | 2000-07,,6.14,6.27,6.08,6.34,6.28,6.18,6.22,6.05,6.20,5.85 482 | 2000-08,,6.28,6.35,6.18,6.23,6.17,6.06,6.05,5.83,6.02,5.72 483 | 2000-09,,6.18,6.25,6.13,6.08,6.02,5.93,5.98,5.80,6.09,5.83 484 | 2000-10,,6.29,6.32,6.01,5.91,5.85,5.78,5.84,5.74,6.04,5.80 485 | 2000-11,,6.36,6.34,6.09,5.88,5.79,5.70,5.78,5.72,5.98,5.78 486 | 2000-12,,5.94,5.92,5.60,5.35,5.26,5.17,5.28,5.24,5.64,5.49 487 | 2001-01,,5.29,5.15,4.81,4.76,4.77,4.86,5.13,5.16,5.65,5.54 488 | 2001-02,,5.01,4.89,4.68,4.66,4.71,4.89,5.10,5.10,5.62,5.45 489 | 2001-03,,4.54,4.44,4.30,4.34,4.43,4.64,4.88,4.89,5.49,5.34 490 | 2001-04,,3.97,3.99,3.98,4.23,4.42,4.76,5.03,5.14,5.78,5.65 491 | 2001-05,,3.70,3.74,3.78,4.26,4.51,4.93,5.24,5.39,5.92,5.78 492 | 2001-06,,3.57,3.56,3.58,4.08,4.35,4.81,5.14,5.28,5.82,5.67 493 | 2001-07,3.67,3.59,3.56,3.62,4.04,4.31,4.76,5.06,5.24,5.75,5.61 494 | 2001-08,3.53,3.44,3.39,3.47,3.76,4.04,4.57,4.84,4.97,5.58,5.48 495 | 2001-09,2.68,2.69,2.71,2.82,3.12,3.45,4.12,4.51,4.73,5.53,5.48 496 | 2001-10,2.27,2.20,2.17,2.33,2.73,3.14,3.91,4.31,4.57,5.34,5.32 497 | 2001-11,1.99,1.91,1.92,2.18,2.78,3.22,3.97,4.42,4.65,5.33,5.12 498 | 2001-12,1.72,1.72,1.82,2.22,3.11,3.62,4.39,4.86,5.09,5.76,5.48 499 | 2002-01,1.68,1.68,1.77,2.16,3.03,3.56,4.34,4.79,5.04,5.69,5.45 500 | 2002-02,1.74,1.76,1.86,2.23,3.02,3.55,4.30,4.71,4.91,5.61,5.45 501 | 2002-03,1.79,1.83,2.06,2.57,3.56,4.14,4.74,5.14,5.28,5.93,5.81 502 | 2002-04,1.72,1.75,1.98,2.48,3.42,4.01,4.65,5.02,5.21,5.85,5.79 503 | 2002-05,1.74,1.76,1.91,2.35,3.26,3.80,4.49,4.90,5.16,5.81,5.76 504 | 2002-06,1.72,1.73,1.83,2.20,2.99,3.49,4.19,4.60,4.93,5.65,5.68 505 | 2002-07,1.72,1.71,1.74,1.96,2.56,3.01,3.81,4.30,4.65,5.51,5.59 506 | 2002-08,1.68,1.65,1.64,1.76,2.13,2.52,3.29,3.88,4.26,5.19,5.28 507 | 2002-09,1.67,1.66,1.64,1.72,2.00,2.32,2.94,3.50,3.87,4.87,4.96 508 | 2002-10,1.62,1.61,1.59,1.65,1.91,2.25,2.95,3.54,3.94,5.00,5.18 509 | 2002-11,1.26,1.25,1.30,1.49,1.92,2.32,3.05,3.64,4.05,5.04,5.18 510 | 2002-12,1.20,1.21,1.27,1.45,1.84,2.23,3.03,3.63,4.03,5.01,5.13 511 | 2003-01,1.17,1.19,1.22,1.36,1.74,2.18,3.05,3.60,4.05,5.02,5.14 512 | 2003-02,1.20,1.19,1.20,1.30,1.63,2.05,2.90,3.45,3.90,4.87,5.02 513 | 2003-03,1.18,1.15,1.16,1.24,1.57,1.98,2.78,3.34,3.81,4.82,5.03 514 | 2003-04,1.16,1.15,1.17,1.27,1.62,2.06,2.93,3.47,3.96,4.91,5.13 515 | 2003-05,1.08,1.09,1.11,1.18,1.42,1.75,2.52,3.07,3.57,4.52,4.76 516 | 2003-06,0.97,0.94,0.94,1.01,1.23,1.51,2.27,2.84,3.33,4.34,4.62 517 | 2003-07,0.90,0.92,0.97,1.12,1.47,1.93,2.87,3.45,3.98,4.92,5.13 518 | 2003-08,0.95,0.97,1.05,1.31,1.86,2.44,3.37,3.96,4.45,5.39,5.45 519 | 2003-09,0.91,0.96,1.03,1.24,1.71,2.23,3.18,3.74,4.27,5.21,5.28 520 | 2003-10,0.91,0.94,1.02,1.25,1.75,2.26,3.19,3.75,4.29,5.21,5.30 521 | 2003-11,0.94,0.95,1.04,1.34,1.93,2.45,3.29,3.81,4.30,5.17,5.25 522 | 2003-12,0.89,0.91,1.01,1.31,1.91,2.44,3.27,3.79,4.27,5.11,5.21 523 | 2004-01,0.85,0.90,0.99,1.24,1.76,2.27,3.12,3.65,4.15,5.01,5.13 524 | 2004-02,0.92,0.94,1.01,1.24,1.74,2.25,3.07,3.59,4.08,4.94,5.08 525 | 2004-03,0.96,0.95,1.01,1.19,1.58,2.00,2.79,3.31,3.83,4.72,4.90 526 | 2004-04,0.91,0.96,1.11,1.43,2.07,2.57,3.39,3.89,4.35,5.16,5.28 527 | 2004-05,0.91,1.04,1.33,1.78,2.53,3.10,3.85,4.31,4.72,5.46,5.51 528 | 2004-06,1.05,1.29,1.64,2.12,2.76,3.26,3.93,4.35,4.73,5.45,5.48 529 | 2004-07,1.19,1.36,1.70,2.10,2.64,3.05,3.69,4.11,4.50,5.24,5.31 530 | 2004-08,1.37,1.50,1.76,2.02,2.51,2.88,3.47,3.90,4.28,5.07,5.15 531 | 2004-09,1.55,1.68,1.91,2.12,2.53,2.83,3.36,3.75,4.13,4.89,4.98 532 | 2004-10,1.63,1.79,2.05,2.23,2.58,2.85,3.35,3.75,4.10,4.85,4.94 533 | 2004-11,1.92,2.11,2.32,2.50,2.85,3.09,3.53,3.88,4.19,4.89,4.95 534 | 2004-12,1.96,2.22,2.50,2.67,3.01,3.21,3.60,3.93,4.23,4.88,4.91 535 | 2005-01,2.05,2.37,2.68,2.86,3.22,3.39,3.71,3.97,4.22,4.77,4.77 536 | 2005-02,2.36,2.58,2.85,3.03,3.38,3.54,3.77,3.97,4.17,4.61,4.56 537 | 2005-03,2.65,2.80,3.09,3.30,3.73,3.91,4.17,4.33,4.50,4.89,4.77 538 | 2005-04,2.64,2.84,3.14,3.32,3.65,3.79,4.00,4.16,4.34,4.75,4.65 539 | 2005-05,2.65,2.90,3.17,3.33,3.64,3.72,3.85,3.94,4.14,4.56,4.49 540 | 2005-06,2.83,3.04,3.22,3.36,3.64,3.69,3.77,3.86,4.00,4.35,4.28 541 | 2005-07,3.10,3.29,3.53,3.64,3.87,3.91,3.98,4.06,4.18,4.48,4.38 542 | 2005-08,3.34,3.52,3.78,3.87,4.04,4.08,4.12,4.18,4.26,4.53,4.44 543 | 2005-09,3.23,3.49,3.79,3.85,3.95,3.96,4.01,4.08,4.20,4.51,4.45 544 | 2005-10,3.51,3.79,4.13,4.18,4.27,4.29,4.33,4.38,4.46,4.74,4.64 545 | 2005-11,3.91,3.97,4.30,4.33,4.42,4.43,4.45,4.48,4.54,4.83,4.70 546 | 2005-12,3.69,3.97,4.33,4.35,4.40,4.39,4.39,4.41,4.47,4.73,4.62 547 | 2006-01,4.12,4.34,4.47,4.45,4.40,4.35,4.35,4.37,4.42,4.65,4.57 548 | 2006-02,4.38,4.54,4.69,4.68,4.67,4.64,4.57,4.56,4.57,4.73,4.57 549 | 2006-03,4.55,4.63,4.79,4.77,4.73,4.74,4.72,4.71,4.72,4.91,4.73 550 | 2006-04,4.61,4.72,4.90,4.90,4.89,4.89,4.90,4.94,4.99,5.22,5.06 551 | 2006-05,4.70,4.84,5.01,5.00,4.97,4.97,5.00,5.03,5.11,5.35,5.20 552 | 2006-06,4.71,4.92,5.17,5.16,5.12,5.09,5.07,5.08,5.11,5.29,5.15 553 | 2006-07,4.90,5.08,5.27,5.22,5.12,5.07,5.04,5.05,5.09,5.25,5.13 554 | 2006-08,5.16,5.09,5.17,5.08,4.90,4.85,4.82,4.83,4.88,5.08,5.00 555 | 2006-09,4.77,4.93,5.08,4.97,4.77,4.69,4.67,4.68,4.72,4.93,4.85 556 | 2006-10,4.97,5.05,5.12,5.01,4.80,4.72,4.69,4.69,4.73,4.94,4.85 557 | 2006-11,5.21,5.07,5.15,5.01,4.74,4.64,4.58,4.58,4.60,4.78,4.69 558 | 2006-12,4.87,4.97,5.07,4.94,4.67,4.58,4.53,4.54,4.56,4.78,4.68 559 | 2007-01,4.94,5.11,5.15,5.06,4.88,4.79,4.75,4.75,4.76,4.95,4.85 560 | 2007-02,5.18,5.16,5.16,5.05,4.85,4.75,4.71,4.71,4.72,4.93,4.82 561 | 2007-03,5.21,5.08,5.10,4.92,4.57,4.51,4.48,4.50,4.56,4.81,4.72 562 | 2007-04,4.99,5.01,5.07,4.93,4.67,4.60,4.59,4.62,4.69,4.95,4.87 563 | 2007-05,4.82,4.87,4.98,4.91,4.77,4.69,4.67,4.69,4.75,4.98,4.90 564 | 2007-06,4.52,4.74,4.95,4.96,4.98,5.00,5.03,5.05,5.10,5.29,5.20 565 | 2007-07,4.82,4.96,5.04,4.96,4.82,4.82,4.88,4.93,5.00,5.19,5.11 566 | 2007-08,4.20,4.32,4.55,4.47,4.31,4.34,4.43,4.53,4.67,5.00,4.93 567 | 2007-09,3.78,3.99,4.20,4.14,4.01,4.06,4.20,4.33,4.52,4.84,4.79 568 | 2007-10,3.81,4.00,4.16,4.10,3.97,4.01,4.20,4.33,4.53,4.83,4.77 569 | 2007-11,3.68,3.35,3.58,3.50,3.34,3.35,3.67,3.87,4.15,4.56,4.52 570 | 2007-12,2.86,3.07,3.34,3.26,3.12,3.13,3.49,3.74,4.10,4.57,4.53 571 | 2008-01,2.74,2.82,2.84,2.71,2.48,2.51,2.98,3.31,3.74,4.35,4.33 572 | 2008-02,2.27,2.17,2.10,2.05,1.97,2.19,2.78,3.21,3.74,4.49,4.52 573 | 2008-03,1.35,1.28,1.51,1.54,1.62,1.80,2.48,2.93,3.51,4.36,4.39 574 | 2008-04,1.07,1.31,1.58,1.74,2.05,2.23,2.84,3.19,3.68,4.44,4.44 575 | 2008-05,1.76,1.76,1.86,2.06,2.45,2.69,3.15,3.46,3.88,4.60,4.60 576 | 2008-06,1.72,1.89,2.19,2.42,2.77,3.08,3.49,3.73,4.10,4.74,4.69 577 | 2008-07,1.60,1.66,1.98,2.28,2.57,2.87,3.30,3.60,4.01,4.62,4.57 578 | 2008-08,1.68,1.75,1.97,2.18,2.42,2.70,3.14,3.46,3.89,4.53,4.50 579 | 2008-09,0.89,1.15,1.64,1.91,2.08,2.32,2.88,3.25,3.69,4.32,4.27 580 | 2008-10,0.29,0.69,1.23,1.42,1.61,1.86,2.73,3.19,3.81,4.45,4.17 581 | 2008-11,0.09,0.19,0.74,1.07,1.21,1.51,2.29,2.82,3.53,4.27,4.00 582 | 2008-12,0.03,0.03,0.26,0.49,0.82,1.07,1.52,1.89,2.42,3.18,2.87 583 | 2009-01,0.05,0.13,0.30,0.44,0.81,1.13,1.60,1.98,2.52,3.46,3.13 584 | 2009-02,0.22,0.30,0.46,0.62,0.98,1.37,1.87,2.30,2.87,3.83,3.59 585 | 2009-03,0.10,0.22,0.43,0.64,0.93,1.31,1.82,2.42,2.82,3.78,3.64 586 | 2009-04,0.10,0.16,0.35,0.55,0.93,1.32,1.86,2.47,2.93,3.84,3.76 587 | 2009-05,0.14,0.18,0.30,0.50,0.93,1.39,2.13,2.81,3.29,4.22,4.23 588 | 2009-06,0.10,0.18,0.31,0.51,1.18,1.76,2.71,3.37,3.72,4.51,4.52 589 | 2009-07,0.15,0.18,0.28,0.48,1.02,1.55,2.46,3.14,3.56,4.38,4.41 590 | 2009-08,0.12,0.17,0.27,0.46,1.12,1.65,2.57,3.21,3.59,4.33,4.37 591 | 2009-09,0.06,0.12,0.21,0.40,0.96,1.48,2.37,3.02,3.40,4.14,4.19 592 | 2009-10,0.04,0.07,0.16,0.37,0.95,1.46,2.33,2.96,3.39,4.16,4.19 593 | 2009-11,0.05,0.05,0.15,0.31,0.80,1.32,2.23,2.92,3.40,4.24,4.31 594 | 2009-12,0.03,0.05,0.17,0.37,0.87,1.38,2.34,3.07,3.59,4.40,4.49 595 | 2010-01,0.02,0.06,0.15,0.35,0.93,1.49,2.48,3.21,3.73,4.50,4.60 596 | 2010-02,0.06,0.11,0.18,0.35,0.86,1.40,2.36,3.12,3.69,4.48,4.62 597 | 2010-03,0.12,0.15,0.23,0.40,0.96,1.51,2.43,3.16,3.73,4.49,4.64 598 | 2010-04,0.15,0.16,0.24,0.45,1.06,1.64,2.58,3.28,3.85,4.53,4.69 599 | 2010-05,0.15,0.16,0.22,0.37,0.83,1.32,2.18,2.86,3.42,4.11,4.29 600 | 2010-06,0.08,0.12,0.19,0.32,0.72,1.17,2.00,2.66,3.20,3.95,4.13 601 | 2010-07,0.16,0.16,0.20,0.29,0.62,0.98,1.76,2.43,3.01,3.80,3.99 602 | 2010-08,0.15,0.16,0.19,0.26,0.52,0.78,1.47,2.10,2.70,3.52,3.80 603 | 2010-09,0.12,0.15,0.19,0.26,0.48,0.74,1.41,2.05,2.65,3.47,3.77 604 | 2010-10,0.14,0.13,0.18,0.23,0.38,0.57,1.18,1.85,2.54,3.52,3.87 605 | 2010-11,0.13,0.14,0.18,0.25,0.45,0.67,1.35,2.02,2.76,3.82,4.19 606 | 2010-12,0.09,0.14,0.19,0.29,0.62,0.99,1.93,2.66,3.29,4.17,4.42 607 | 2011-01,0.14,0.15,0.18,0.27,0.61,1.03,1.99,2.72,3.39,4.28,4.52 608 | 2011-02,0.11,0.13,0.17,0.29,0.77,1.28,2.26,2.96,3.58,4.42,4.65 609 | 2011-03,0.06,0.10,0.16,0.26,0.70,1.17,2.11,2.80,3.41,4.27,4.51 610 | 2011-04,0.03,0.06,0.12,0.25,0.73,1.21,2.17,2.84,3.46,4.28,4.50 611 | 2011-05,0.02,0.04,0.09,0.19,0.56,0.94,1.84,2.51,3.17,4.01,4.29 612 | 2011-06,0.02,0.04,0.10,0.18,0.41,0.71,1.58,2.29,3.00,3.91,4.23 613 | 2011-07,0.04,0.04,0.08,0.19,0.41,0.68,1.54,2.28,3.00,3.95,4.27 614 | 2011-08,0.02,0.02,0.06,0.11,0.23,0.38,1.02,1.63,2.30,3.24,3.65 615 | 2011-09,0.01,0.01,0.04,0.10,0.21,0.35,0.90,1.42,1.98,2.83,3.18 616 | 2011-10,0.01,0.02,0.05,0.11,0.28,0.47,1.06,1.62,2.15,2.87,3.13 617 | 2011-11,0.01,0.01,0.05,0.11,0.25,0.39,0.91,1.45,2.01,2.72,3.02 618 | 2011-12,0.00,0.01,0.05,0.12,0.26,0.39,0.89,1.43,1.98,2.67,2.98 619 | 2012-01,0.02,0.03,0.07,0.12,0.24,0.36,0.84,1.38,1.97,2.70,3.03 620 | 2012-02,0.06,0.09,0.12,0.16,0.28,0.38,0.83,1.37,1.97,2.75,3.11 621 | 2012-03,0.06,0.08,0.14,0.19,0.34,0.51,1.02,1.56,2.17,2.94,3.28 622 | 2012-04,0.07,0.08,0.14,0.18,0.29,0.43,0.89,1.43,2.05,2.82,3.18 623 | 2012-05,0.07,0.09,0.15,0.19,0.29,0.39,0.76,1.21,1.80,2.53,2.93 624 | 2012-06,0.05,0.09,0.15,0.19,0.29,0.39,0.71,1.08,1.62,2.31,2.70 625 | 2012-07,0.07,0.10,0.15,0.19,0.25,0.33,0.62,0.98,1.53,2.22,2.59 626 | 2012-08,0.09,0.10,0.14,0.18,0.27,0.37,0.71,1.14,1.68,2.40,2.77 627 | 2012-09,0.08,0.11,0.14,0.18,0.26,0.34,0.67,1.12,1.72,2.49,2.88 628 | 2012-10,0.11,0.10,0.15,0.18,0.28,0.37,0.71,1.15,1.75,2.51,2.90 629 | 2012-11,0.12,0.09,0.14,0.18,0.27,0.36,0.67,1.08,1.65,2.39,2.80 630 | 2012-12,0.04,0.07,0.12,0.16,0.26,0.35,0.70,1.13,1.72,2.47,2.88 631 | 2013-01,0.05,0.07,0.11,0.15,0.27,0.39,0.81,1.30,1.91,2.68,3.08 632 | 2013-02,0.08,0.10,0.12,0.16,0.27,0.40,0.85,1.35,1.98,2.78,3.17 633 | 2013-03,0.08,0.09,0.11,0.15,0.26,0.39,0.82,1.32,1.96,2.78,3.16 634 | 2013-04,0.05,0.06,0.09,0.12,0.23,0.34,0.71,1.15,1.76,2.55,2.93 635 | 2013-05,0.02,0.04,0.08,0.12,0.25,0.40,0.84,1.31,1.93,2.73,3.11 636 | 2013-06,0.03,0.05,0.09,0.14,0.33,0.58,1.20,1.71,2.30,3.07,3.40 637 | 2013-07,0.02,0.04,0.07,0.12,0.34,0.64,1.40,1.99,2.58,3.31,3.61 638 | 2013-08,0.04,0.04,0.07,0.13,0.36,0.70,1.52,2.15,2.74,3.49,3.76 639 | 2013-09,0.02,0.02,0.04,0.12,0.40,0.78,1.60,2.22,2.81,3.53,3.79 640 | 2013-10,0.11,0.05,0.08,0.12,0.34,0.63,1.37,1.99,2.62,3.38,3.68 641 | 2013-11,0.05,0.07,0.10,0.12,0.30,0.58,1.37,2.07,2.72,3.50,3.80 642 | 2013-12,0.02,0.07,0.10,0.13,0.34,0.69,1.58,2.29,2.90,3.63,3.89 643 | 2014-01,0.02,0.04,0.07,0.12,0.39,0.78,1.65,2.29,2.86,3.52,3.77 644 | 2014-02,0.05,0.05,0.08,0.12,0.33,0.69,1.52,2.15,2.71,3.38,3.66 645 | 2014-03,0.05,0.05,0.08,0.13,0.40,0.82,1.64,2.23,2.72,3.35,3.62 646 | 2014-04,0.02,0.03,0.05,0.11,0.42,0.88,1.70,2.27,2.71,3.27,3.52 647 | 2014-05,0.03,0.03,0.05,0.10,0.39,0.83,1.59,2.12,2.56,3.12,3.39 648 | 2014-06,0.02,0.04,0.06,0.10,0.45,0.90,1.68,2.19,2.60,3.15,3.42 649 | 2014-07,0.02,0.03,0.06,0.11,0.51,0.97,1.70,2.17,2.54,3.07,3.33 650 | 2014-08,0.03,0.03,0.05,0.11,0.47,0.93,1.63,2.08,2.42,2.94,3.20 651 | 2014-09,0.01,0.02,0.04,0.11,0.57,1.05,1.77,2.22,2.53,3.01,3.26 652 | 2014-10,0.02,0.02,0.05,0.10,0.45,0.88,1.55,1.98,2.30,2.77,3.04 653 | 2014-11,0.04,0.02,0.07,0.13,0.53,0.96,1.62,2.03,2.33,2.76,3.04 654 | 2014-12,0.03,0.03,0.11,0.21,0.64,1.06,1.64,1.98,2.21,2.55,2.83 655 | 2015-01,0.02,0.03,0.08,0.20,0.55,0.90,1.37,1.67,1.88,2.20,2.46 656 | 2015-02,0.02,0.02,0.07,0.22,0.62,0.99,1.47,1.79,1.98,2.34,2.57 657 | 2015-03,0.02,0.03,0.11,0.25,0.64,1.02,1.52,1.84,2.04,2.41,2.63 658 | 2015-04,0.02,0.02,0.09,0.23,0.54,0.87,1.35,1.69,1.94,2.33,2.59 659 | 2015-05,0.01,0.02,0.08,0.24,0.61,0.98,1.54,1.93,2.20,2.69,2.96 660 | 2015-06,0.01,0.02,0.09,0.28,0.69,1.07,1.68,2.10,2.36,2.85,3.11 661 | 2015-07,0.03,0.03,0.12,0.30,0.67,1.03,1.63,2.04,2.32,2.77,3.07 662 | 2015-08,0.04,0.07,0.22,0.38,0.70,1.03,1.54,1.91,2.17,2.55,2.86 663 | 2015-09,0.01,0.02,0.18,0.37,0.71,1.01,1.49,1.88,2.17,2.62,2.95 664 | 2015-10,0.01,0.02,0.11,0.26,0.64,0.93,1.39,1.76,2.07,2.50,2.89 665 | 2015-11,0.07,0.13,0.33,0.48,0.88,1.20,1.67,2.02,2.26,2.69,3.03 666 | 2015-12,0.17,0.23,0.50,0.65,0.98,1.28,1.70,2.04,2.24,2.61,2.97 667 | 2016-01,0.23,0.26,0.43,0.54,0.90,1.14,1.52,1.85,2.09,2.49,2.86 668 | 2016-02,0.26,0.31,0.45,0.53,0.73,0.90,1.22,1.53,1.78,2.20,2.62 669 | 2016-03,0.25,0.30,0.47,0.66,0.88,1.04,1.38,1.68,1.89,2.28,2.68 670 | 2016-04,0.19,0.23,0.37,0.56,0.77,0.92,1.26,1.57,1.81,2.21,2.62 671 | 2016-05,0.23,0.28,0.42,0.59,0.82,0.97,1.30,1.60,1.81,2.22,2.63 672 | 2016-06,0.22,0.27,0.40,0.55,0.73,0.86,1.17,1.44,1.64,2.02,2.45 673 | 2016-07,0.26,0.30,0.40,0.51,0.67,0.79,1.07,1.33,1.50,1.82,2.23 674 | 2016-08,0.26,0.30,0.45,0.57,0.74,0.85,1.13,1.40,1.56,1.89,2.26 675 | 2016-09,0.19,0.29,0.47,0.59,0.77,0.90,1.18,1.46,1.63,2.02,2.35 676 | 2016-10,0.24,0.33,0.48,0.66,0.84,0.99,1.27,1.56,1.76,2.17,2.50 677 | 2016-11,0.30,0.45,0.58,0.74,0.98,1.22,1.60,1.93,2.14,2.54,2.86 678 | 2016-12,0.42,0.51,0.64,0.87,1.20,1.49,1.96,2.29,2.49,2.84,3.11 679 | 2017-01,0.50,0.52,0.62,0.83,1.21,1.48,1.92,2.23,2.43,2.75,3.02 680 | 2017-02,0.48,0.53,0.65,0.82,1.20,1.47,1.90,2.22,2.42,2.76,3.03 681 | 2017-03,0.66,0.75,0.89,1.01,1.31,1.59,2.01,2.30,2.48,2.83,3.08 682 | 2017-04,0.75,0.81,0.95,1.04,1.24,1.44,1.82,2.10,2.30,2.67,2.94 683 | 2017-05,0.73,0.90,1.04,1.12,1.30,1.48,1.84,2.11,2.30,2.70,2.96 684 | 2017-06,0.84,1.00,1.11,1.20,1.34,1.49,1.77,2.01,2.19,2.54,2.80 685 | 2017-07,0.97,1.09,1.13,1.22,1.37,1.54,1.87,2.13,2.32,2.65,2.88 686 | 2017-08,0.98,1.03,1.13,1.23,1.34,1.48,1.78,2.03,2.21,2.55,2.80 687 | 2017-09,0.99,1.05,1.17,1.28,1.38,1.51,1.80,2.03,2.20,2.53,2.78 688 | 2017-10,1.00,1.09,1.25,1.40,1.55,1.68,1.98,2.20,2.36,2.65,2.88 689 | 2017-11,1.09,1.25,1.39,1.56,1.70,1.81,2.05,2.23,2.35,2.60,2.80 690 | 2017-12,1.20,1.34,1.50,1.70,1.84,1.96,2.18,2.32,2.40,2.60,2.77 691 | 2018-01,1.30,1.43,1.62,1.80,2.03,2.15,2.38,2.51,2.58,2.73,2.88 692 | 2018-02,1.38,1.59,1.79,1.96,2.18,2.36,2.60,2.78,2.86,3.02,3.13 693 | 2018-03,1.64,1.73,1.92,2.06,2.28,2.42,2.63,2.77,2.84,2.97,3.09 694 | 2018-04,1.66,1.79,1.98,2.15,2.38,2.52,2.70,2.82,2.87,2.96,3.07 695 | 2018-05,1.71,1.90,2.07,2.27,2.51,2.66,2.82,2.93,2.98,3.05,3.13 696 | 2018-06,1.81,1.94,2.11,2.33,2.53,2.65,2.78,2.87,2.91,2.98,3.05 697 | 2018-07,1.89,1.99,2.17,2.39,2.61,2.70,2.78,2.85,2.89,2.94,3.01 698 | 2018-08,1.94,2.07,2.24,2.45,2.64,2.71,2.77,2.84,2.89,2.97,3.04 699 | 2018-09,2.04,2.17,2.34,2.56,2.77,2.84,2.89,2.96,3.00,3.08,3.15 700 | 2018-10,2.17,2.29,2.46,2.65,2.86,2.94,3.00,3.09,3.15,3.27,3.34 701 | 2018-11,2.24,2.37,2.52,2.70,2.86,2.91,2.95,3.04,3.12,3.27,3.36 702 | 2018-12,2.37,2.41,2.54,2.66,2.68,2.67,2.68,2.75,2.83,2.98,3.10 703 | 2019-01,2.40,2.42,2.51,2.58,2.54,2.52,2.54,2.61,2.71,2.89,3.04 704 | 2019-02,2.43,2.44,2.50,2.55,2.50,2.48,2.49,2.57,2.68,2.87,3.02 705 | 2019-03,2.45,2.45,2.51,2.49,2.41,2.37,2.37,2.47,2.57,2.80,2.98 706 | 2019-04,2.43,2.43,2.46,2.42,2.34,2.31,2.33,2.43,2.53,2.76,2.94 707 | 2019-05,2.40,2.40,2.42,2.34,2.21,2.16,2.19,2.29,2.40,2.63,2.82 708 | 2019-06,2.22,2.22,2.17,2.00,1.81,1.78,1.83,1.95,2.07,2.36,2.57 709 | 2019-07,2.15,2.15,2.08,1.96,1.84,1.80,1.83,1.93,2.06,2.36,2.57 710 | 2019-08,2.07,1.99,1.93,1.77,1.57,1.51,1.49,1.55,1.63,1.91,2.12 711 | 2019-09,1.99,1.93,1.89,1.80,1.65,1.59,1.57,1.64,1.70,1.97,2.16 712 | 2019-10,1.73,1.68,1.67,1.61,1.55,1.53,1.53,1.62,1.71,2.00,2.19 713 | 2019-11,1.58,1.57,1.59,1.57,1.61,1.61,1.64,1.74,1.81,2.13,2.28 714 | 2019-12,1.55,1.57,1.58,1.55,1.61,1.63,1.68,1.79,1.86,2.16,2.30 715 | 2020-01,1.53,1.55,1.56,1.53,1.52,1.52,1.56,1.67,1.76,2.07,2.22 716 | 2020-02,1.58,1.54,1.51,1.41,1.33,1.31,1.32,1.42,1.50,1.81,1.97 717 | 2020-03,0.37,0.30,0.30,0.33,0.45,0.50,0.59,0.78,0.87,1.26,1.46 718 | 2020-04,0.11,0.14,0.17,0.18,0.22,0.28,0.39,0.55,0.66,1.06,1.27 719 | 2020-05,0.10,0.13,0.15,0.16,0.17,0.22,0.34,0.53,0.67,1.12,1.38 720 | 2020-06,0.13,0.16,0.18,0.18,0.19,0.22,0.34,0.55,0.73,1.27,1.49 721 | 2020-07,0.11,0.13,0.14,0.15,0.15,0.17,0.28,0.46,0.62,1.09,1.31 722 | 2020-08,0.08,0.10,0.12,0.13,0.14,0.16,0.27,0.46,0.65,1.14,1.36 723 | 2020-09,0.09,0.11,0.12,0.13,0.13,0.16,0.27,0.46,0.68,1.21,1.42 724 | 2020-10,0.09,0.10,0.11,0.13,0.15,0.19,0.34,0.55,0.79,1.34,1.57 725 | 2020-11,0.09,0.09,0.10,0.12,0.17,0.22,0.39,0.63,0.87,1.40,1.62 726 | 2020-12,0.08,0.09,0.09,0.10,0.14,0.19,0.39,0.66,0.93,1.47,1.67 727 | 2021-01,0.08,0.08,0.09,0.10,0.13,0.20,0.45,0.77,1.08,1.63,1.82 728 | 2021-02,0.04,0.04,0.06,0.07,0.12,0.21,0.54,0.91,1.26,1.88,2.04 729 | 2021-03,0.02,0.03,0.05,0.08,0.15,0.32,0.82,1.27,1.61,2.24,2.34 730 | 2021-04,0.02,0.02,0.04,0.06,0.16,0.35,0.86,1.31,1.64,2.20,2.30 731 | 2021-05,0.01,0.02,0.04,0.05,0.16,0.32,0.82,1.28,1.62,2.22,2.32 732 | 2021-06,0.03,0.04,0.05,0.07,0.20,0.39,0.84,1.23,1.52,2.09,2.16 733 | 2021-07,0.05,0.05,0.05,0.08,0.22,0.40,0.76,1.07,1.32,1.87,1.94 734 | 2021-08,0.04,0.05,0.06,0.07,0.22,0.42,0.77,1.06,1.28,1.83,1.92 -------------------------------------------------------------------------------- /py/Keras_Iris.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Implementing Neural Network with Keras\n", 8 | "\n", 9 | "I modified Jason Brownlee's tutorial to conform to the current version of Keras\n", 10 | "\n", 11 | "### Multi-Class Classification Tutorial with the Keras Deep Learning Library: [Link]( https://machinelearningmastery.com/multi-class-classification-tutorial-keras-deep-learning-library/)" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 1, 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "import numpy\n", 21 | "import pandas" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 4, 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "import tensorflow.keras as keras # this is important\n", 31 | "\n", 32 | "from tensorflow.keras.models import Sequential\n", 33 | "from tensorflow.keras.layers import Dense\n", 34 | "from tensorflow.keras.wrappers.scikit_learn import KerasClassifier\n", 35 | "from tensorflow.python.keras.utils import np_utils" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": 5, 41 | "metadata": {}, 42 | "outputs": [], 43 | "source": [ 44 | "from sklearn.model_selection import cross_val_score\n", 45 | "from sklearn.model_selection import KFold\n", 46 | "from sklearn.preprocessing import LabelEncoder\n", 47 | "from sklearn.pipeline import Pipeline" 48 | ] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "execution_count": null, 53 | "metadata": {}, 54 | "outputs": [], 55 | "source": [] 56 | }, 57 | { 58 | "cell_type": "code", 59 | "execution_count": 6, 60 | "metadata": {}, 61 | "outputs": [], 62 | "source": [ 63 | "from sklearn import datasets\n", 64 | "import numpy as np\n", 65 | "\n", 66 | "iris = datasets.load_iris()\n", 67 | "X = iris.data\n", 68 | "Y = iris.target\n", 69 | "# convert integers to dummy variables (i.e. one hot encoded)\n", 70 | "dummy_y = np_utils.to_categorical(Y)" 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": null, 76 | "metadata": {}, 77 | "outputs": [], 78 | "source": [] 79 | }, 80 | { 81 | "cell_type": "code", 82 | "execution_count": 7, 83 | "metadata": {}, 84 | "outputs": [], 85 | "source": [ 86 | "# fix random seed for reproducibility\n", 87 | "seed = 7\n", 88 | "numpy.random.seed(seed)" 89 | ] 90 | }, 91 | { 92 | "cell_type": "markdown", 93 | "metadata": {}, 94 | "source": [ 95 | "## Define NN" 96 | ] 97 | }, 98 | { 99 | "cell_type": "code", 100 | "execution_count": 8, 101 | "metadata": {}, 102 | "outputs": [], 103 | "source": [ 104 | "# define baseline model\n", 105 | "def baseline_model():\n", 106 | " # create model\n", 107 | " model = keras.models.Sequential()\n", 108 | " model.add(Dense(8, input_dim=4, activation='relu'))\n", 109 | " model.add(Dense(3, activation='softmax'))\n", 110 | " # Compile model\n", 111 | " model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])\n", 112 | " return model" 113 | ] 114 | }, 115 | { 116 | "cell_type": "code", 117 | "execution_count": 9, 118 | "metadata": {}, 119 | "outputs": [], 120 | "source": [ 121 | "## SKLearn wrapper\n", 122 | "nn = KerasClassifier(build_fn=baseline_model, epochs=200, batch_size=5, verbose=0)" 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "execution_count": 10, 128 | "metadata": {}, 129 | "outputs": [ 130 | { 131 | "data": { 132 | "text/plain": [ 133 | "" 134 | ] 135 | }, 136 | "execution_count": 10, 137 | "metadata": {}, 138 | "output_type": "execute_result" 139 | } 140 | ], 141 | "source": [ 142 | "nn.fit(X, dummy_y)" 143 | ] 144 | }, 145 | { 146 | "cell_type": "code", 147 | "execution_count": 11, 148 | "metadata": {}, 149 | "outputs": [ 150 | { 151 | "name": "stdout", 152 | "output_type": "stream", 153 | "text": [ 154 | "Training accuracy: 0.97333336\n" 155 | ] 156 | } 157 | ], 158 | "source": [ 159 | "print('Training accuracy:', nn.score(X, dummy_y))" 160 | ] 161 | }, 162 | { 163 | "cell_type": "markdown", 164 | "metadata": {}, 165 | "source": [ 166 | "## K-fold CV" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": 12, 172 | "metadata": {}, 173 | "outputs": [], 174 | "source": [ 175 | "kfold = KFold(n_splits=5, shuffle=True, random_state=seed)" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": 13, 181 | "metadata": {}, 182 | "outputs": [ 183 | { 184 | "name": "stdout", 185 | "output_type": "stream", 186 | "text": [ 187 | "Baseline: 97.33% (2.49%)\n" 188 | ] 189 | } 190 | ], 191 | "source": [ 192 | "results = cross_val_score(nn, X, dummy_y, cv=kfold)\n", 193 | "print(\"Baseline: %.2f%% (%.2f%%)\" % (results.mean()*100, results.std()*100))" 194 | ] 195 | }, 196 | { 197 | "cell_type": "code", 198 | "execution_count": null, 199 | "metadata": {}, 200 | "outputs": [], 201 | "source": [] 202 | } 203 | ], 204 | "metadata": { 205 | "kernelspec": { 206 | "display_name": "Python 3", 207 | "language": "python", 208 | "name": "python3" 209 | }, 210 | "language_info": { 211 | "codemirror_mode": { 212 | "name": "ipython", 213 | "version": 3 214 | }, 215 | "file_extension": ".py", 216 | "mimetype": "text/x-python", 217 | "name": "python", 218 | "nbconvert_exporter": "python", 219 | "pygments_lexer": "ipython3", 220 | "version": "3.7.3" 221 | } 222 | }, 223 | "nbformat": 4, 224 | "nbformat_minor": 2 225 | } 226 | -------------------------------------------------------------------------------- /py/PythonCrashCourse_Derek_Banas.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "This cheatsheet is modified from Derek Banas'. You can find the youtube tutorial and the original cheatsheet below.\n", 8 | "\n", 9 | "Youtube tutorial (43 min): https://www.youtube.com/watch?v=N4mEzFDjqtA\n", 10 | "\n", 11 | "Original cheatsheet: https://ehmatthes.github.io/pcc/cheatsheets/README.html" 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "metadata": {}, 17 | "source": [ 18 | "## Python Notebook\n", 19 | "\n", 20 | "### Useful keyboard shortcuts (under \"Help\" menu)\n", 21 | "* [ESC] command mode (vs edit mode)\n", 22 | "* [A] / [B] insert [A]bove/[B]elow\n", 23 | "* [DD] delete cell\n", 24 | "* [Sh-M] [Ctrl-Sh-Minus] merge (command mode) / split (edit mode) cells below\n", 25 | "* [M] / [Y] to [M]arkdown/code[Y] \n", 26 | "* [Ctrl-Enter] / [Sh-Enter] run the cell (and go below)" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": null, 32 | "metadata": {}, 33 | "outputs": [], 34 | "source": [ 35 | "## Markdown Cell\n", 36 | "\n", 37 | "## Markdown Cell\n", 38 | "\n", 39 | "## Markdown Cell\n", 40 | "\n", 41 | "## Markdown Cell\n", 42 | "\n", 43 | "## Markdown Cell\n", 44 | "\n", 45 | "## Markdown Cell" 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": null, 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "## Notebook Cell" 55 | ] 56 | }, 57 | { 58 | "cell_type": "markdown", 59 | "metadata": {}, 60 | "source": [ 61 | "## Section 1" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": 1, 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [ 70 | "# import is used to make specialty functions available\n", 71 | "# These are called modules\n", 72 | "import random\n", 73 | "import numpy as np\n", 74 | "\n", 75 | "# import random as rnd\n", 76 | "import sys\n", 77 | "import os" 78 | ] 79 | }, 80 | { 81 | "cell_type": "code", 82 | "execution_count": 4, 83 | "metadata": {}, 84 | "outputs": [ 85 | { 86 | "name": "stdout", 87 | "output_type": "stream", 88 | "text": [ 89 | "Hello World\n" 90 | ] 91 | } 92 | ], 93 | "source": [ 94 | "# Hello world is just one line of code\n", 95 | "# print() outputs data to the screen\n", 96 | "print(\"Hello World\")" 97 | ] 98 | }, 99 | { 100 | "cell_type": "code", 101 | "execution_count": 7, 102 | "metadata": {}, 103 | "outputs": [ 104 | { 105 | "data": { 106 | "text/plain": [ 107 | "'\\nThis is a multi-line comment\\nThis is a multi-line comment\\nThis is a multi-line comment\\nThis is a multi-line comment\\n'" 108 | ] 109 | }, 110 | "execution_count": 7, 111 | "metadata": {}, 112 | "output_type": "execute_result" 113 | } 114 | ], 115 | "source": [ 116 | "# this is a single line comment\n", 117 | "\"\"\"\n", 118 | "This is a multi-line comment\n", 119 | "This is a multi-line comment\n", 120 | "This is a multi-line comment\n", 121 | "This is a multi-line comment\n", 122 | "\"\"\"" 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "execution_count": 6, 128 | "metadata": {}, 129 | "outputs": [ 130 | { 131 | "name": "stdout", 132 | "output_type": "stream", 133 | "text": [ 134 | "Jaehyuk\n" 135 | ] 136 | } 137 | ], 138 | "source": [ 139 | "# A variable is a place to store values\n", 140 | "# Its name is like a label for that value\n", 141 | "name = \"Jaehyuk\"\n", 142 | "print(name)" 143 | ] 144 | }, 145 | { 146 | "cell_type": "code", 147 | "execution_count": 7, 148 | "metadata": {}, 149 | "outputs": [ 150 | { 151 | "name": "stdout", 152 | "output_type": "stream", 153 | "text": [ 154 | "888\n" 155 | ] 156 | } 157 | ], 158 | "source": [ 159 | "# There are 5 data types Numbers, Strings, List, Tuple, Dictionary\n", 160 | "# You can store any of them in the same variable\n", 161 | "\n", 162 | "number = 888\n", 163 | "print(number)" 164 | ] 165 | }, 166 | { 167 | "cell_type": "markdown", 168 | "metadata": {}, 169 | "source": [ 170 | "## The arithmetic operators +, -, *, /, %, **, //" 171 | ] 172 | }, 173 | { 174 | "cell_type": "code", 175 | "execution_count": 8, 176 | "metadata": {}, 177 | "outputs": [ 178 | { 179 | "name": "stdout", 180 | "output_type": "stream", 181 | "text": [ 182 | "5 + 2 = 7\n", 183 | "5 - 2 = 3\n", 184 | "5 * 2 = 10\n", 185 | "5 / 2 = 2.5\n", 186 | "5 % 2 = 1\n", 187 | "5 ** 2 = 25\n", 188 | "5 // 2 = 2\n" 189 | ] 190 | } 191 | ], 192 | "source": [ 193 | "print(\"5 + 2 =\", 5+2)\n", 194 | "print(\"5 - 2 =\", 5-2)\n", 195 | "print(\"5 * 2 =\", 5*2)\n", 196 | "print(\"5 / 2 =\", 5/2)\n", 197 | "print(\"5 % 2 =\", 5%2)\n", 198 | "print(\"5 ** 2 =\", 5**2) # ** Exponential calculation\n", 199 | "print(\"5 // 2 =\", 5//2) # // Floor Division" 200 | ] 201 | }, 202 | { 203 | "cell_type": "code", 204 | "execution_count": 18, 205 | "metadata": {}, 206 | "outputs": [ 207 | { 208 | "name": "stdout", 209 | "output_type": "stream", 210 | "text": [ 211 | "1 + 2 - 3 * 2 = -3\n", 212 | "(1 + 2 - 3) * 2 = 0\n" 213 | ] 214 | } 215 | ], 216 | "source": [ 217 | "# Order of Operation states * and / is performed before + and -\n", 218 | "\n", 219 | "print(\"1 + 2 - 3 * 2 =\", 1 + 2 - 3 * 2)\n", 220 | "print(\"(1 + 2 - 3) * 2 =\", (1 + 2 - 3) * 2)" 221 | ] 222 | }, 223 | { 224 | "cell_type": "markdown", 225 | "metadata": {}, 226 | "source": [ 227 | "## Strings" 228 | ] 229 | }, 230 | { 231 | "cell_type": "code", 232 | "execution_count": 21, 233 | "metadata": {}, 234 | "outputs": [ 235 | { 236 | "name": "stdout", 237 | "output_type": "stream", 238 | "text": [ 239 | "\"Always remember your unique, just\n", 240 | "like everyone else\" \n" 241 | ] 242 | } 243 | ], 244 | "source": [ 245 | "# A string is a string of characters surrounded by \" or '\n", 246 | "# If you must use a \" or ' between the same quote escape it with \\\n", 247 | "quote = \"\\\"Always remember your unique,\"\n", 248 | "# A multi-line quote\n", 249 | "multi_line_quote = ''' just\n", 250 | "like everyone else\" '''\n", 251 | "\n", 252 | "print(quote + multi_line_quote)" 253 | ] 254 | }, 255 | { 256 | "cell_type": "code", 257 | "execution_count": 103, 258 | "metadata": {}, 259 | "outputs": [ 260 | { 261 | "name": "stdout", 262 | "output_type": "stream", 263 | "text": [ 264 | "I like the quote \"Always remember your unique, just\n", 265 | "like everyone else\" \n", 266 | "10 / 20\n" 267 | ] 268 | } 269 | ], 270 | "source": [ 271 | "# To embed a string in output use %s\n", 272 | "print(\"{} {} {}\".format('I like the quote', quote, multi_line_quote))" 273 | ] 274 | }, 275 | { 276 | "cell_type": "code", 277 | "execution_count": 11, 278 | "metadata": {}, 279 | "outputs": [ 280 | { 281 | "name": "stdout", 282 | "output_type": "stream", 283 | "text": [ 284 | "I don't like newlines\n" 285 | ] 286 | } 287 | ], 288 | "source": [ 289 | "# To keep from printing newlines use end=\"\"\n", 290 | "print(\"I don't like \",end=\"\")\n", 291 | "print(\"newlines\")" 292 | ] 293 | }, 294 | { 295 | "cell_type": "code", 296 | "execution_count": 12, 297 | "metadata": {}, 298 | "outputs": [ 299 | { 300 | "name": "stdout", 301 | "output_type": "stream", 302 | "text": [ 303 | "abc\n", 304 | "abc\n", 305 | "abc\n", 306 | "abc\n", 307 | "abc\n", 308 | "\n" 309 | ] 310 | } 311 | ], 312 | "source": [ 313 | "# You can print a string multiple times with *\n", 314 | "print('abc\\n' * 5)" 315 | ] 316 | }, 317 | { 318 | "cell_type": "code", 319 | "execution_count": null, 320 | "metadata": {}, 321 | "outputs": [], 322 | "source": [] 323 | }, 324 | { 325 | "cell_type": "code", 326 | "execution_count": 117, 327 | "metadata": {}, 328 | "outputs": [ 329 | { 330 | "name": "stdout", 331 | "output_type": "stream", 332 | "text": [ 333 | "10 / 20\n", 334 | "two / one\n", 335 | "3.141593\n", 336 | "0.33333 3.14159\n", 337 | "0.33333 3.14159\n" 338 | ] 339 | } 340 | ], 341 | "source": [ 342 | "# Printing with formsts\n", 343 | "print(\"{} / {}\".format(10,20))\n", 344 | "\n", 345 | "print(\"{1} / {0}\".format('one','two'))\n", 346 | "\n", 347 | "print('{:f}'.format(3.141592653589793))\n", 348 | "\n", 349 | "print('{1:0.5f} {0:0.5f}'.format(3.141592653589793, 0.33333333333))\n", 350 | "\n", 351 | "print('{onethird:0.5f} {pi:0.5f}'.format(pi=3.141592653589793, onethird=0.33333333333))" 352 | ] 353 | }, 354 | { 355 | "cell_type": "code", 356 | "execution_count": 16, 357 | "metadata": {}, 358 | "outputs": [ 359 | { 360 | "name": "stdout", 361 | "output_type": "stream", 362 | "text": [ 363 | "Name=Jaehyuk, onethird=0.333\n" 364 | ] 365 | } 366 | ], 367 | "source": [ 368 | "onethird = 1/3\n", 369 | "print(f'Name={name}, onethird={onethird:0.3f}')" 370 | ] 371 | }, 372 | { 373 | "cell_type": "markdown", 374 | "metadata": {}, 375 | "source": [ 376 | "## Lists" 377 | ] 378 | }, 379 | { 380 | "cell_type": "code", 381 | "execution_count": 17, 382 | "metadata": {}, 383 | "outputs": [ 384 | { 385 | "name": "stdout", 386 | "output_type": "stream", 387 | "text": [ 388 | "The first item is Tomatoes\n" 389 | ] 390 | } 391 | ], 392 | "source": [ 393 | "# A list allows you to create a list of values and manipulate them\n", 394 | "# Each value has an index with the first one starting at 0\n", 395 | "\n", 396 | "grocery_list = ['Juice', 'Tomatoes', 'Potatoes', 'Bananas']\n", 397 | "print('The first item is', grocery_list[1])" 398 | ] 399 | }, 400 | { 401 | "cell_type": "code", 402 | "execution_count": 18, 403 | "metadata": {}, 404 | "outputs": [ 405 | { 406 | "name": "stdout", 407 | "output_type": "stream", 408 | "text": [ 409 | "['Green Juice', 'Tomatoes', 'Potatoes', 'Bananas']\n" 410 | ] 411 | } 412 | ], 413 | "source": [ 414 | "# You can change the value stored in a list box\n", 415 | "grocery_list[0] = \"Green Juice\"\n", 416 | "print(grocery_list)" 417 | ] 418 | }, 419 | { 420 | "cell_type": "code", 421 | "execution_count": 20, 422 | "metadata": {}, 423 | "outputs": [ 424 | { 425 | "name": "stdout", 426 | "output_type": "stream", 427 | "text": [ 428 | "['Tomatoes', 'Potatoes']\n" 429 | ] 430 | } 431 | ], 432 | "source": [ 433 | "# You can get a subset of the list with [min:up to but not including max]\n", 434 | "\n", 435 | "print(grocery_list[1:3])" 436 | ] 437 | }, 438 | { 439 | "cell_type": "code", 440 | "execution_count": 21, 441 | "metadata": {}, 442 | "outputs": [ 443 | { 444 | "name": "stdout", 445 | "output_type": "stream", 446 | "text": [ 447 | "[['Wash Car', 'Pick up Kids', 'Cash Check'], ['Green Juice', 'Tomatoes', 'Potatoes', 'Bananas']]\n" 448 | ] 449 | } 450 | ], 451 | "source": [ 452 | "# You can put any data type in a a list including a list\n", 453 | "other_events = ['Wash Car', 'Pick up Kids', 'Cash Check']\n", 454 | "to_do_list = [other_events, grocery_list]\n", 455 | "\n", 456 | "print(to_do_list)" 457 | ] 458 | }, 459 | { 460 | "cell_type": "code", 461 | "execution_count": 22, 462 | "metadata": {}, 463 | "outputs": [ 464 | { 465 | "name": "stdout", 466 | "output_type": "stream", 467 | "text": [ 468 | "Tomatoes\n" 469 | ] 470 | } 471 | ], 472 | "source": [ 473 | "# Get the second item in the second list (Boxes inside of boxes)\n", 474 | "print(to_do_list[1][1])" 475 | ] 476 | }, 477 | { 478 | "cell_type": "code", 479 | "execution_count": 23, 480 | "metadata": {}, 481 | "outputs": [ 482 | { 483 | "name": "stdout", 484 | "output_type": "stream", 485 | "text": [ 486 | "[['Wash Car', 'Pick up Kids', 'Cash Check'], ['Green Juice', 'Tomatoes', 'Potatoes', 'Bananas', 'Onions']]\n" 487 | ] 488 | } 489 | ], 490 | "source": [ 491 | "# You add values using append\n", 492 | "grocery_list.append('Onions')\n", 493 | "print(to_do_list)" 494 | ] 495 | }, 496 | { 497 | "cell_type": "code", 498 | "execution_count": 24, 499 | "metadata": {}, 500 | "outputs": [ 501 | { 502 | "name": "stdout", 503 | "output_type": "stream", 504 | "text": [ 505 | "['Green Juice', 'Pickle', 'Tomatoes', 'Potatoes', 'Bananas', 'Onions']\n" 506 | ] 507 | } 508 | ], 509 | "source": [ 510 | "# Insert item at given index\n", 511 | "grocery_list.insert(1, \"Pickle\")\n", 512 | "print(grocery_list)" 513 | ] 514 | }, 515 | { 516 | "cell_type": "code", 517 | "execution_count": 25, 518 | "metadata": {}, 519 | "outputs": [ 520 | { 521 | "name": "stdout", 522 | "output_type": "stream", 523 | "text": [ 524 | "['Green Juice', 'Tomatoes', 'Potatoes', 'Bananas', 'Onions']\n" 525 | ] 526 | } 527 | ], 528 | "source": [ 529 | "# Remove item from list\n", 530 | "grocery_list.remove(\"Pickle\")\n", 531 | "print(grocery_list)" 532 | ] 533 | }, 534 | { 535 | "cell_type": "code", 536 | "execution_count": 26, 537 | "metadata": {}, 538 | "outputs": [ 539 | { 540 | "name": "stdout", 541 | "output_type": "stream", 542 | "text": [ 543 | "['Bananas', 'Green Juice', 'Onions', 'Potatoes', 'Tomatoes']\n" 544 | ] 545 | } 546 | ], 547 | "source": [ 548 | "# Sorts items in list\n", 549 | "grocery_list.sort()\n", 550 | "print(grocery_list)" 551 | ] 552 | }, 553 | { 554 | "cell_type": "code", 555 | "execution_count": 27, 556 | "metadata": {}, 557 | "outputs": [ 558 | { 559 | "name": "stdout", 560 | "output_type": "stream", 561 | "text": [ 562 | "['Tomatoes', 'Potatoes', 'Onions', 'Green Juice', 'Bananas']\n" 563 | ] 564 | } 565 | ], 566 | "source": [ 567 | "# Reverse sort items in list\n", 568 | "grocery_list.reverse()\n", 569 | "print(grocery_list)" 570 | ] 571 | }, 572 | { 573 | "cell_type": "code", 574 | "execution_count": 28, 575 | "metadata": {}, 576 | "outputs": [ 577 | { 578 | "name": "stdout", 579 | "output_type": "stream", 580 | "text": [ 581 | "[['Wash Car', 'Pick up Kids', 'Cash Check'], ['Tomatoes', 'Potatoes', 'Onions', 'Green Juice']]\n" 582 | ] 583 | } 584 | ], 585 | "source": [ 586 | "# del deletes an item at specified index\n", 587 | "del grocery_list[4]\n", 588 | "print(to_do_list)" 589 | ] 590 | }, 591 | { 592 | "cell_type": "code", 593 | "execution_count": 29, 594 | "metadata": {}, 595 | "outputs": [ 596 | { 597 | "name": "stdout", 598 | "output_type": "stream", 599 | "text": [ 600 | "['Wash Car', 'Pick up Kids', 'Cash Check', 'Tomatoes', 'Potatoes', 'Onions', 'Green Juice']\n", 601 | "7\n", 602 | "Wash Car\n", 603 | "Cash Check\n" 604 | ] 605 | } 606 | ], 607 | "source": [ 608 | "# We can combine lists with a +\n", 609 | "to_do_list = other_events + grocery_list\n", 610 | "print(to_do_list)\n", 611 | "\n", 612 | "# Get length of list\n", 613 | "print(len(to_do_list))\n", 614 | "\n", 615 | "# Get the max item in list\n", 616 | "print(max(to_do_list))\n", 617 | "\n", 618 | "# Get the minimum item in list\n", 619 | "print(min(to_do_list))" 620 | ] 621 | }, 622 | { 623 | "cell_type": "markdown", 624 | "metadata": {}, 625 | "source": [ 626 | "## Tuples\n", 627 | "* Values in a tuple can't change like lists" 628 | ] 629 | }, 630 | { 631 | "cell_type": "code", 632 | "execution_count": null, 633 | "metadata": { 634 | "collapsed": true 635 | }, 636 | "outputs": [], 637 | "source": [ 638 | "pi_tuple = (3, 1, 4, 1, 5, 9)\n", 639 | "\n", 640 | "# Convert tuple into a list\n", 641 | "new_tuple = list(pi_tuple)\n", 642 | "\n", 643 | "# Convert a list into a tuple\n", 644 | "# new_list = tuple(grocery_list)\n", 645 | "\n", 646 | "# tuples also have len(tuple), min(tuple) and max(tuple)" 647 | ] 648 | }, 649 | { 650 | "cell_type": "markdown", 651 | "metadata": {}, 652 | "source": [ 653 | "## Dictionary or Map\n", 654 | "* Made up of values with a unique key for each value\n", 655 | "* Similar to lists, but you can't join dicts with a +" 656 | ] 657 | }, 658 | { 659 | "cell_type": "code", 660 | "execution_count": 14, 661 | "metadata": {}, 662 | "outputs": [ 663 | { 664 | "name": "stdout", 665 | "output_type": "stream", 666 | "text": [ 667 | "{'Weather Wizard': 'Mark Mardon', 'Mirror Master': 'Sam Scudder', 'Fiddler': 'Isaac Bowin', 'Pied Piper': 'Thomas Peterson', 'Captain Cold': 'Leonard Snart'}\n", 668 | "Leonard Snart\n" 669 | ] 670 | } 671 | ], 672 | "source": [ 673 | "super_villains = {'Fiddler' : 'Isaac Bowin',\n", 674 | " 'Captain Cold' : 'Leonard Snart',\n", 675 | " 'Weather Wizard' : 'Mark Mardon',\n", 676 | " 'Mirror Master' : 'Sam Scudder',\n", 677 | " 'Pied Piper' : 'Thomas Peterson'}\n", 678 | "print(super_villains)\n", 679 | "print(super_villains['Captain Cold'])" 680 | ] 681 | }, 682 | { 683 | "cell_type": "code", 684 | "execution_count": 15, 685 | "metadata": {}, 686 | "outputs": [ 687 | { 688 | "name": "stdout", 689 | "output_type": "stream", 690 | "text": [ 691 | "{'Weather Wizard': 'Mark Mardon', 'Mirror Master': 'Sam Scudder', 'Pied Piper': 'Thomas Peterson', 'Captain Cold': 'Leonard Snart'}\n", 692 | "4\n", 693 | "Hartley Rathaway\n" 694 | ] 695 | } 696 | ], 697 | "source": [ 698 | "# Delete an entry\n", 699 | "del super_villains['Fiddler']\n", 700 | "print(super_villains)\n", 701 | "\n", 702 | "# Replace a value\n", 703 | "super_villains['Pied Piper'] = 'Hartley Rathaway'\n", 704 | "\n", 705 | "# Print the number of items in the dictionary\n", 706 | "print(len(super_villains))\n", 707 | "\n", 708 | "# Get the value for the passed key\n", 709 | "print(super_villains.get(\"Pied Piper\"))" 710 | ] 711 | }, 712 | { 713 | "cell_type": "code", 714 | "execution_count": 16, 715 | "metadata": {}, 716 | "outputs": [ 717 | { 718 | "name": "stdout", 719 | "output_type": "stream", 720 | "text": [ 721 | "dict_keys(['Weather Wizard', 'Mirror Master', 'Pied Piper', 'Captain Cold'])\n", 722 | "dict_values(['Mark Mardon', 'Sam Scudder', 'Hartley Rathaway', 'Leonard Snart'])\n" 723 | ] 724 | } 725 | ], 726 | "source": [ 727 | "# Get a list of dictionary keys\n", 728 | "print(super_villains.keys())\n", 729 | "\n", 730 | "# Get a list of dictionary values\n", 731 | "print(super_villains.values())" 732 | ] 733 | }, 734 | { 735 | "cell_type": "markdown", 736 | "metadata": {}, 737 | "source": [ 738 | "## CONDITIONALS\n", 739 | "* The if, else and elif statements are used to perform different\n", 740 | "* actions based off of conditions\n", 741 | "* Comparison Operators : ==, !=, >, <, >=, <=" 742 | ] 743 | }, 744 | { 745 | "cell_type": "code", 746 | "execution_count": 24, 747 | "metadata": {}, 748 | "outputs": [ 749 | { 750 | "name": "stdout", 751 | "output_type": "stream", 752 | "text": [ 753 | "You are old enough to drive\n" 754 | ] 755 | } 756 | ], 757 | "source": [ 758 | "# The if statement will execute code if a condition is met\n", 759 | "# White space is used to group blocks of code in Python\n", 760 | "# Use the same number of proceeding spaces for blocks of code\n", 761 | "\n", 762 | "age = 30\n", 763 | "if age > 16 :\n", 764 | " print('You are old enough to drive')" 765 | ] 766 | }, 767 | { 768 | "cell_type": "code", 769 | "execution_count": 25, 770 | "metadata": {}, 771 | "outputs": [ 772 | { 773 | "name": "stdout", 774 | "output_type": "stream", 775 | "text": [ 776 | "You are old enough to drive\n", 777 | "Go home.\n" 778 | ] 779 | } 780 | ], 781 | "source": [ 782 | "# Use an if statement if you want to execute different code regardless\n", 783 | "# of whether the condition ws met or not\n", 784 | "\n", 785 | "if age > 16 :\n", 786 | " print('You are old enough to drive')\n", 787 | "else :\n", 788 | " print('You are not old enough to drive')\n", 789 | "print('Go home.') " 790 | ] 791 | }, 792 | { 793 | "cell_type": "code", 794 | "execution_count": null, 795 | "metadata": { 796 | "collapsed": true 797 | }, 798 | "outputs": [], 799 | "source": [ 800 | "# If you want to check for multiple conditions use elif\n", 801 | "# If the first matches it won't check other conditions that follow\n", 802 | "\n", 803 | "if age >= 21 :\n", 804 | " print('You are old enough to drive a tractor trailer')\n", 805 | "elif age >= 16:\n", 806 | " print('You are old enough to drive a car')\n", 807 | "else :\n", 808 | " print('You are not old enough to drive')" 809 | ] 810 | }, 811 | { 812 | "cell_type": "code", 813 | "execution_count": 5, 814 | "metadata": {}, 815 | "outputs": [ 816 | { 817 | "name": "stdout", 818 | "output_type": "stream", 819 | "text": [ 820 | "You get a birthday party yeah\n" 821 | ] 822 | } 823 | ], 824 | "source": [ 825 | "# You can combine conditions with logical operators\n", 826 | "# Logical Operators : and, or, not\n", 827 | "\n", 828 | "if ((age >= 1) and (age <= 18)):\n", 829 | " print(\"You get a birthday party\")\n", 830 | "elif (age == 21) or (age >= 65):\n", 831 | " print(\"You get a birthday party\")\n", 832 | "elif not(age == 30): # !(age == 30) doesn't work\n", 833 | " print(\"You don't get a birthday party\")\n", 834 | "else:\n", 835 | " print(\"You get a birthday party yeah\")" 836 | ] 837 | }, 838 | { 839 | "cell_type": "markdown", 840 | "metadata": {}, 841 | "source": [ 842 | "## FOR LOOPS\n", 843 | "* Allows you to perform an action a set number of times" 844 | ] 845 | }, 846 | { 847 | "cell_type": "code", 848 | "execution_count": 33, 849 | "metadata": {}, 850 | "outputs": [ 851 | { 852 | "name": "stdout", 853 | "output_type": "stream", 854 | "text": [ 855 | "0 1 2 3 4 5 6 7 8 9 \n", 856 | "\n" 857 | ] 858 | } 859 | ], 860 | "source": [ 861 | "# Range performs the action 10 times 0 - 9\n", 862 | "for x in range(10):\n", 863 | " print(x , ' ', end=\"\")\n", 864 | "\n", 865 | "print('\\n')" 866 | ] 867 | }, 868 | { 869 | "cell_type": "code", 870 | "execution_count": 27, 871 | "metadata": {}, 872 | "outputs": [ 873 | { 874 | "name": "stdout", 875 | "output_type": "stream", 876 | "text": [ 877 | "Juice\n", 878 | "Tomatoes\n", 879 | "Potatoes\n", 880 | "Bananas\n" 881 | ] 882 | } 883 | ], 884 | "source": [ 885 | "# You can use for loops to cycle through a list\n", 886 | "grocery_list = ['Juice', 'Tomatoes', 'Potatoes', 'Bananas']\n", 887 | "\n", 888 | "for y in grocery_list:\n", 889 | " print(y)" 890 | ] 891 | }, 892 | { 893 | "cell_type": "code", 894 | "execution_count": 28, 895 | "metadata": {}, 896 | "outputs": [ 897 | { 898 | "name": "stdout", 899 | "output_type": "stream", 900 | "text": [ 901 | "2\n", 902 | "4\n", 903 | "6\n", 904 | "8\n", 905 | "10\n" 906 | ] 907 | } 908 | ], 909 | "source": [ 910 | "# You can also define a list of numbers to cycle through\n", 911 | "for x in [2,4,6,8,10]:\n", 912 | " print(x)" 913 | ] 914 | }, 915 | { 916 | "cell_type": "code", 917 | "execution_count": 29, 918 | "metadata": {}, 919 | "outputs": [ 920 | { 921 | "name": "stdout", 922 | "output_type": "stream", 923 | "text": [ 924 | "1\n", 925 | "2\n", 926 | "3\n", 927 | "10\n", 928 | "20\n", 929 | "30\n", 930 | "100\n", 931 | "200\n", 932 | "300\n", 933 | "1\n", 934 | "2\n", 935 | "3\n", 936 | "10\n", 937 | "20\n", 938 | "30\n", 939 | "100\n", 940 | "200\n", 941 | "300\n" 942 | ] 943 | } 944 | ], 945 | "source": [ 946 | "# You can double up for loops to cycle through lists\n", 947 | "num_list =[[1,2,3],[10,20,30],[100,200,300]];\n", 948 | "\n", 949 | "for x in range(0,3):\n", 950 | " for y in range(0,3):\n", 951 | " print(num_list[x][y])\n", 952 | "\n", 953 | "# Instead you can do \n", 954 | "for x in num_list:\n", 955 | " for y in x:\n", 956 | " print(y)" 957 | ] 958 | }, 959 | { 960 | "cell_type": "markdown", 961 | "metadata": {}, 962 | "source": [ 963 | "## WHILE LOOPS -------------\n", 964 | "* While loops are used when you don't know ahead of time how many times you'll have to loop" 965 | ] 966 | }, 967 | { 968 | "cell_type": "code", 969 | "execution_count": 35, 970 | "metadata": {}, 971 | "outputs": [ 972 | { 973 | "name": "stdout", 974 | "output_type": "stream", 975 | "text": [ 976 | "40\n", 977 | "21\n", 978 | "71\n", 979 | "79\n", 980 | "10\n", 981 | "27\n", 982 | "70\n", 983 | "46\n", 984 | "37\n", 985 | "25\n", 986 | "94\n" 987 | ] 988 | } 989 | ], 990 | "source": [ 991 | "random_num = 50\n", 992 | "\n", 993 | "while (True):\n", 994 | " random_num = random.randrange(0,100)\n", 995 | " print(random_num)\n", 996 | " if random_num > 80:\n", 997 | " break" 998 | ] 999 | }, 1000 | { 1001 | "cell_type": "code", 1002 | "execution_count": 9, 1003 | "metadata": {}, 1004 | "outputs": [ 1005 | { 1006 | "name": "stdout", 1007 | "output_type": "stream", 1008 | "text": [ 1009 | "0\n", 1010 | "2\n", 1011 | "4\n", 1012 | "6\n", 1013 | "8\n" 1014 | ] 1015 | } 1016 | ], 1017 | "source": [ 1018 | "# An iterator for a while loop is defined before the loop\n", 1019 | "i = 0;\n", 1020 | "while (i <= 20):\n", 1021 | " if(i%2 == 0):\n", 1022 | " print(i)\n", 1023 | " elif(i == 9):\n", 1024 | " # Forces the loop to end all together\n", 1025 | " break\n", 1026 | " else:\n", 1027 | " # Shorthand for i = i + 1\n", 1028 | " i += 1\n", 1029 | " # Skips to the next iteration of the loop\n", 1030 | " continue\n", 1031 | "\n", 1032 | " i += 1" 1033 | ] 1034 | }, 1035 | { 1036 | "cell_type": "markdown", 1037 | "metadata": {}, 1038 | "source": [ 1039 | "## FUNCTIONS\n", 1040 | "* Functions allow you to reuse and write readable code\n", 1041 | "* Type def (define), function name and parameters it receives\n", 1042 | "* return is used to return something to the caller of the function" 1043 | ] 1044 | }, 1045 | { 1046 | "cell_type": "code", 1047 | "execution_count": 36, 1048 | "metadata": {}, 1049 | "outputs": [ 1050 | { 1051 | "name": "stdout", 1052 | "output_type": "stream", 1053 | "text": [ 1054 | "5\n" 1055 | ] 1056 | } 1057 | ], 1058 | "source": [ 1059 | "def addNumbers(fNum, sNum):\n", 1060 | " sumNum = fNum + sNum\n", 1061 | " return sumNum\n", 1062 | "\n", 1063 | "print(addNumbers(1, 4))" 1064 | ] 1065 | }, 1066 | { 1067 | "cell_type": "code", 1068 | "execution_count": 34, 1069 | "metadata": {}, 1070 | "outputs": [], 1071 | "source": [ 1072 | "# Can't get the value of sumNum because it was created in a function\n", 1073 | "# It is said to be out of scope\n", 1074 | "#print(sumNum)" 1075 | ] 1076 | }, 1077 | { 1078 | "cell_type": "code", 1079 | "execution_count": 121, 1080 | "metadata": {}, 1081 | "outputs": [ 1082 | { 1083 | "name": "stdout", 1084 | "output_type": "stream", 1085 | "text": [ 1086 | "-3\n", 1087 | "0\n" 1088 | ] 1089 | } 1090 | ], 1091 | "source": [ 1092 | "# If you define a variable outside of the function it works every place\n", 1093 | "newNum = 0;\n", 1094 | "def subNumbers(fNum, sNum):\n", 1095 | " newNum = fNum - sNum\n", 1096 | " return newNum\n", 1097 | "\n", 1098 | "print(subNumbers(1, 4))\n", 1099 | "print(newNum)" 1100 | ] 1101 | }, 1102 | { 1103 | "cell_type": "code", 1104 | "execution_count": null, 1105 | "metadata": { 1106 | "collapsed": true 1107 | }, 1108 | "outputs": [], 1109 | "source": [ 1110 | "# USER INPUT -------------\n", 1111 | "print('What is your name?')\n", 1112 | "\n", 1113 | "# Stores everything typed up until ENTER\n", 1114 | "#name = sys.stdin.readline()\n", 1115 | "\n", 1116 | "#print('Hello', name)" 1117 | ] 1118 | }, 1119 | { 1120 | "cell_type": "markdown", 1121 | "metadata": {}, 1122 | "source": [ 1123 | "## STRINGS" 1124 | ] 1125 | }, 1126 | { 1127 | "cell_type": "code", 1128 | "execution_count": 37, 1129 | "metadata": {}, 1130 | "outputs": [ 1131 | { 1132 | "name": "stdout", 1133 | "output_type": "stream", 1134 | "text": [ 1135 | "I'll\n", 1136 | "Floor\n", 1137 | "I'll catch you if you fall - The \n", 1138 | "I'll be there\n" 1139 | ] 1140 | } 1141 | ], 1142 | "source": [ 1143 | "# A string is a series of characters surrounded by ' or \"\n", 1144 | "long_string = \"I'll catch you if you fall - The Floor\"\n", 1145 | "\n", 1146 | "# Retrieve the first 4 characters\n", 1147 | "print(long_string[0:4])\n", 1148 | "\n", 1149 | "# Get the last 5 characters\n", 1150 | "print(long_string[-5:])\n", 1151 | "\n", 1152 | "# Everything up to the last 5 characters\n", 1153 | "print(long_string[:-5])\n", 1154 | "\n", 1155 | "# Concatenate part of a string to another\n", 1156 | "print(long_string[:4] + \" be there\")" 1157 | ] 1158 | }, 1159 | { 1160 | "cell_type": "code", 1161 | "execution_count": 38, 1162 | "metadata": {}, 1163 | "outputs": [ 1164 | { 1165 | "data": { 1166 | "text/plain": [ 1167 | "\"I'll catch you if you fall - the floor\"" 1168 | ] 1169 | }, 1170 | "execution_count": 38, 1171 | "metadata": {}, 1172 | "output_type": "execute_result" 1173 | } 1174 | ], 1175 | "source": [ 1176 | "long_string." 1177 | ] 1178 | }, 1179 | { 1180 | "cell_type": "code", 1181 | "execution_count": 14, 1182 | "metadata": {}, 1183 | "outputs": [ 1184 | { 1185 | "name": "stdout", 1186 | "output_type": "stream", 1187 | "text": [ 1188 | "X is my favorite letter and my number 1 number is 0.14000\n", 1189 | "I'll catch you if you fall - the floor\n", 1190 | "33\n", 1191 | "False\n", 1192 | "False\n" 1193 | ] 1194 | } 1195 | ], 1196 | "source": [ 1197 | "# String formatting <-- This is old format\n", 1198 | "print(\"%c is my %s letter and my number %d number is %.5f\" % ('X', 'favorite', 1, .14))\n", 1199 | "\n", 1200 | "# Capitalizes the first letter\n", 1201 | "print(long_string.capitalize())\n", 1202 | "\n", 1203 | "# Returns the index of the start of the string\n", 1204 | "# case sensitive\n", 1205 | "print(long_string.find(\"Floor\"))\n", 1206 | "\n", 1207 | "# Returns true if all characters are letters ' isn't a letter\n", 1208 | "print(long_string.isalpha())\n", 1209 | "\n", 1210 | "# Returns true if all characters are numbers\n", 1211 | "print(long_string.isalnum())" 1212 | ] 1213 | }, 1214 | { 1215 | "cell_type": "code", 1216 | "execution_count": 17, 1217 | "metadata": {}, 1218 | "outputs": [ 1219 | { 1220 | "name": "stdout", 1221 | "output_type": "stream", 1222 | "text": [ 1223 | "38\n", 1224 | "I'll catch you if you fall - The Ground\n", 1225 | "I'll catch you if you fall - The Floor\n", 1226 | "[\"I'll\", 'catch', 'you', 'if', 'you', 'fall', '-', 'The', 'Floor']\n" 1227 | ] 1228 | } 1229 | ], 1230 | "source": [ 1231 | "# Returns the string length\n", 1232 | "print(len(long_string))\n", 1233 | "\n", 1234 | "# Replace the first word with the second (Add a number to replace more)\n", 1235 | "print(long_string.replace(\"Floor\", \"Ground\"))\n", 1236 | "\n", 1237 | "# Remove white space from front and end\n", 1238 | "print(long_string.strip())\n", 1239 | "\n", 1240 | "# Split a string into a list based on the delimiter you provide\n", 1241 | "quote_list = long_string.split(\" \")\n", 1242 | "print(quote_list)" 1243 | ] 1244 | }, 1245 | { 1246 | "cell_type": "markdown", 1247 | "metadata": {}, 1248 | "source": [ 1249 | "## FILE I/O" 1250 | ] 1251 | }, 1252 | { 1253 | "cell_type": "code", 1254 | "execution_count": 15, 1255 | "metadata": {}, 1256 | "outputs": [ 1257 | { 1258 | "name": "stdout", 1259 | "output_type": "stream", 1260 | "text": [ 1261 | "wb\n", 1262 | "test.txt\n", 1263 | "Write me to the file\n", 1264 | "\n" 1265 | ] 1266 | }, 1267 | { 1268 | "ename": "PermissionError", 1269 | "evalue": "[WinError 32] The process cannot access the file because it is being used by another process: 'test.txt'", 1270 | "output_type": "error", 1271 | "traceback": [ 1272 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 1273 | "\u001b[0;31mPermissionError\u001b[0m Traceback (most recent call last)", 1274 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[1;31m# Delete the file\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m---> 25\u001b[0;31m \u001b[0mos\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mremove\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"test.txt\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", 1275 | "\u001b[0;31mPermissionError\u001b[0m: [WinError 32] The process cannot access the file because it is being used by another process: 'test.txt'" 1276 | ] 1277 | } 1278 | ], 1279 | "source": [ 1280 | "# Overwrite or create a file for writing\n", 1281 | "test_file = open(\"test.txt\", \"wb\")\n", 1282 | "\n", 1283 | "# Get the file mode used\n", 1284 | "print(test_file.mode)\n", 1285 | "\n", 1286 | "# Get the files name\n", 1287 | "print(test_file.name)\n", 1288 | "\n", 1289 | "# Write text to a file with a newline\n", 1290 | "test_file.write(bytes(\"Write me to the file\\n\", 'UTF-8'))\n", 1291 | "\n", 1292 | "# Close the file\n", 1293 | "test_file.close()\n", 1294 | "\n", 1295 | "# Opens a file for reading and writing\n", 1296 | "test_file = open(\"test.txt\", \"r+\")\n", 1297 | "\n", 1298 | "# Read text from the file\n", 1299 | "text_in_file = test_file.read()\n", 1300 | "\n", 1301 | "print(text_in_file)\n", 1302 | "\n", 1303 | "# Delete the file\n", 1304 | "os.remove(\"test.txt\")" 1305 | ] 1306 | }, 1307 | { 1308 | "cell_type": "markdown", 1309 | "metadata": {}, 1310 | "source": [ 1311 | "## CLASSES AND OBJECTS\n", 1312 | "* The concept of OOP allows us to model real world things using code\n", 1313 | "* Every object has attributes (color, height, weight) which are object variables\n", 1314 | "* Every object has abilities (walk, talk, eat) which are object functions" 1315 | ] 1316 | }, 1317 | { 1318 | "cell_type": "code", 1319 | "execution_count": 39, 1320 | "metadata": {}, 1321 | "outputs": [], 1322 | "source": [ 1323 | "class Animal:\n", 1324 | " # None signifies the lack of a value\n", 1325 | " # You can make a variable private by starting it with __\n", 1326 | " __name = None\n", 1327 | " __height = None\n", 1328 | " __weight = None\n", 1329 | " __sound = None\n", 1330 | " __sex = None\n", 1331 | "\n", 1332 | " # The constructor is called to set up or initialize an object\n", 1333 | " # self allows an object to refer to itself inside of the class\n", 1334 | " def __init__(self, name, height, weight, sound, sex):\n", 1335 | " self.__name = name\n", 1336 | " self.__height = height\n", 1337 | " self.__weight = weight\n", 1338 | " self.__sound = sound\n", 1339 | " self.__sex = sex\n", 1340 | "\n", 1341 | " def set_name(self, name):\n", 1342 | " self.__name = name\n", 1343 | "\n", 1344 | " def set_height(self, height):\n", 1345 | " self.__height = height\n", 1346 | "\n", 1347 | " def set_weight(self, height):\n", 1348 | " self.__height = height\n", 1349 | "\n", 1350 | " def set_sound(self, sound):\n", 1351 | " self.__sound = sound\n", 1352 | "\n", 1353 | " def get_name(self):\n", 1354 | " return self.__name\n", 1355 | "\n", 1356 | " def get_height(self):\n", 1357 | " return str(self.__height)\n", 1358 | "\n", 1359 | " def get_weight(self):\n", 1360 | " return str(self.__weight)\n", 1361 | "\n", 1362 | " def get_sound(self):\n", 1363 | " return self.__sound\n", 1364 | "\n", 1365 | " def get_type(self):\n", 1366 | " print(\"Animal\")\n", 1367 | "\n", 1368 | " def toString(self):\n", 1369 | " return \"{} is {} cm tall and {} kilograms and says {}\".format(self.__name, self.__height, self.__weight, self.__sound)" 1370 | ] 1371 | }, 1372 | { 1373 | "cell_type": "code", 1374 | "execution_count": 41, 1375 | "metadata": {}, 1376 | "outputs": [ 1377 | { 1378 | "name": "stdout", 1379 | "output_type": "stream", 1380 | "text": [ 1381 | "Whiskers is 33 cm tall and 10 kilograms and says Meow\n" 1382 | ] 1383 | } 1384 | ], 1385 | "source": [ 1386 | "# How to create a Animal object\n", 1387 | "cat = Animal('Whiskers', 33, 10, 'Meow', 'M')\n", 1388 | "print(cat.toString())" 1389 | ] 1390 | }, 1391 | { 1392 | "cell_type": "code", 1393 | "execution_count": 38, 1394 | "metadata": {}, 1395 | "outputs": [ 1396 | { 1397 | "name": "stdout", 1398 | "output_type": "stream", 1399 | "text": [ 1400 | "{'_Animal__height': 33, '_Animal__weight': 10, '_Animal__sound': 'Meow', '_Animal__name': 'Whiskers'}\n" 1401 | ] 1402 | } 1403 | ], 1404 | "source": [ 1405 | "# You can't access this value directly because it is private\n", 1406 | "#print(cat.__name)\n", 1407 | "print(cat.__dict__)" 1408 | ] 1409 | }, 1410 | { 1411 | "cell_type": "code", 1412 | "execution_count": 127, 1413 | "metadata": {}, 1414 | "outputs": [ 1415 | { 1416 | "name": "stdout", 1417 | "output_type": "stream", 1418 | "text": [ 1419 | "Spot is 53 cm tall and 27 kilograms and says Ruff. His owner is Derek\n", 1420 | "Animal\n", 1421 | "Dog\n", 1422 | "RuffRuffRuffRuff\n" 1423 | ] 1424 | } 1425 | ], 1426 | "source": [ 1427 | "# INHERITANCE -------------\n", 1428 | "# You can inherit all of the variables and methods from another class\n", 1429 | "\n", 1430 | "class Dog(Animal):\n", 1431 | " __owner = None\n", 1432 | "\n", 1433 | " def __init__(self, name, height, weight, sound, owner):\n", 1434 | " self.__owner = owner\n", 1435 | " self.__animal_type = None\n", 1436 | "\n", 1437 | " # How to call the super class constructor\n", 1438 | " super(Dog, self).__init__(name, height, weight, sound)\n", 1439 | "\n", 1440 | " def set_owner(self, owner):\n", 1441 | " self.__owner = owner\n", 1442 | "\n", 1443 | " def get_owner(self):\n", 1444 | " return self.__owner\n", 1445 | "\n", 1446 | " def get_type(self):\n", 1447 | " print (\"Dog\")\n", 1448 | "\n", 1449 | " # We can overwrite functions in the super class\n", 1450 | " def toString(self):\n", 1451 | " return \"{} is {} cm tall and {} kilograms and says {}. His owner is {}\".format(self.get_name(), self.get_height(), self.get_weight(), self.get_sound(), self.__owner)\n", 1452 | "\n", 1453 | " # You don't have to require attributes to be sent\n", 1454 | " # This allows for method overloading\n", 1455 | " def multiple_sounds(self, how_many=None):\n", 1456 | " if how_many is None:\n", 1457 | " print(self.get_sound)\n", 1458 | " else:\n", 1459 | " print(self.get_sound() * how_many)\n", 1460 | "\n", 1461 | "spot = Dog(\"Spot\", 53, 27, \"Ruff\", \"Derek\")\n", 1462 | "\n", 1463 | "print(spot.toString())\n", 1464 | "\n", 1465 | "# Polymorphism allows use to refer to objects as their super class\n", 1466 | "# and the correct functions are called automatically\n", 1467 | "\n", 1468 | "class AnimalTesting:\n", 1469 | " def get_type(self, animal):\n", 1470 | " animal.get_type()\n", 1471 | "\n", 1472 | "test_animals = AnimalTesting()\n", 1473 | "\n", 1474 | "test_animals.get_type(cat)\n", 1475 | "test_animals.get_type(spot)\n", 1476 | "\n", 1477 | "spot.multiple_sounds(4)" 1478 | ] 1479 | }, 1480 | { 1481 | "cell_type": "code", 1482 | "execution_count": null, 1483 | "metadata": { 1484 | "collapsed": true 1485 | }, 1486 | "outputs": [], 1487 | "source": [] 1488 | } 1489 | ], 1490 | "metadata": { 1491 | "anaconda-cloud": {}, 1492 | "kernelspec": { 1493 | "display_name": "Python 3 (ipykernel)", 1494 | "language": "python", 1495 | "name": "python3" 1496 | }, 1497 | "language_info": { 1498 | "codemirror_mode": { 1499 | "name": "ipython", 1500 | "version": 3 1501 | }, 1502 | "file_extension": ".py", 1503 | "mimetype": "text/x-python", 1504 | "name": "python", 1505 | "nbconvert_exporter": "python", 1506 | "pygments_lexer": "ipython3", 1507 | "version": "3.9.7" 1508 | } 1509 | }, 1510 | "nbformat": 4, 1511 | "nbformat_minor": 1 1512 | } 1513 | -------------------------------------------------------------------------------- /py/ReturnMonthly2020.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHBS/MLF/c2457b599cec3a62f6fabddcbd3c2193b130d82f/py/ReturnMonthly2020.csv.gz -------------------------------------------------------------------------------- /wiki/Alpha Go.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | * [ICML 2017: Test of Time Award](https://www.youtube.com/watch?v=Bm7zah_LrmE) (Sylvain Gelly & David Silver) 4 | -------------------------------------------------------------------------------- /wiki/Benfords law.md: -------------------------------------------------------------------------------- 1 | ## Background 2 | Benford’s Law, also known as the Law of First Digits or the Phenomenon of Significant Digits, is the finding that the first digits (or numerals to be exact) of the numbers found in series of records of the most varied sources do not display a uniform distribution, but rather are arranged in such a way that the digit 1 is the most frequent, followed by 2, 3, and so in a successively decreasing manner down to 9. 3 | 4 | ![Law](https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Rozklad_benforda.svg/220px-Rozklad_benforda.svg.png) 5 | 6 | Figure: The distribution of first digits, according to Benford's law. Each bar represents a digit, and the height of the bar is the percentage of numbers that start with that digit. ([Source: Wikipedia](https://en.wikipedia.org/wiki/Benford%27s_law)) 7 | 8 | ## Project goals 9 | Benford's law has been used to detect financial fraud/crime because artificially generated numbers do not follow Benford's law. The goal of project is how to use Benford's law and machine learning together to further increase the accuracy of the detection. Read some references below. 10 | 11 | ## References 12 | * Benford's law: [Wikipedia](https://en.wikipedia.org/wiki/Benford%27s_law) 13 | * Koch, C., & Okamura, K. (2020). Benford’s Law and COVID-19 reporting. [Economics Letters, 196, 109573.](https://doi.org/10.1016/j.econlet.2020.109573): Media and politicians have cast doubt on Chinese reported data on COVID-19 cases. We find Chinese confirmed infections match the distribution expected in Benford’s Law and are similar to that seen in the U.S. and Italy. 14 | * Badal-Valero, E., Alvarez-Jareño, J. A., & Pavía, J. M. (2018). Combining Benford’s Law and machine learning to detect money laundering. An actual Spanish court case. [Forensic Science International, 282, 24–34.](https://doi.org/10.1016/j.forsciint.2017.11.008) 15 | * Bauer, J., & Groß, J. (2011). Difficulties Detecting Fraud? The Use of Benford’s Law on Regression Tables. [Jahrbücher Für Nationalökonomie Und Statistik, 231(5–6).](https://doi.org/10.1515/jbnst-2011-5-611) 16 | * https://towardsdatascience.com/what-is-benfords-law-and-why-is-it-important-for-data-science-312cb8b61048 17 | 18 | 19 | 20 | First Digit Distribution Pre-Lockdown number of confirmed cases in Chinese Provinces, U.S. States and Italian Regions.([Source: Koch, C., & Okamura, K. (2020)](https://doi.org/10.1016/j.econlet.2020.109573)) 21 | -------------------------------------------------------------------------------- /wiki/Extra Reading.md: -------------------------------------------------------------------------------- 1 | * ### [China's AI Awakening](https://www.technologyreview.com/s/609038/chinas-ai-awakening/) in MIT Technology Review 2 | 3 | * ### Articles in Harvard Business Review by Andrew Ng 4 | * [What Artificial Intelligence Can and Can’t Do Right Now](https://hbr.org/2016/11/what-artificial-intelligence-can-and-cant-do-right-now) 5 | * [Hiring Your First Chief AI Officer](https://hbr.org/2016/11/hiring-your-first-chief-ai-officer) 6 | 7 | Andrew Ng is VP & Chief Scientist of Baidu, Co-Chairman and Co-Founder of Coursera, and an Adjunct Professor at Stanford University. 8 | 9 | * ### A 'Brief' History of Neural Nets and Deep Learning by Andrey Kurenkov 10 | ( [Part 1](http://www.andreykurenkov.com/writing/a-brief-history-of-neural-nets-and-deep-learning/) 11 | | [Part 2](http://www.andreykurenkov.com/writing/a-brief-history-of-neural-nets-and-deep-learning-part-2/) 12 | | [Part 3](http://www.andreykurenkov.com/writing/a-brief-history-of-neural-nets-and-deep-learning-part-3/) 13 | | [Part 4](http://www.andreykurenkov.com/writing/a-brief-history-of-neural-nets-and-deep-learning-part-4/) ) 14 | 15 | * ### [Deep learning 101 by Andrew L. Beam](http://beamandrew.github.io/deeplearning/2017/02/23/deep_learning_101_part1.html) 16 | -------------------------------------------------------------------------------- /wiki/ML Books.md: -------------------------------------------------------------------------------- 1 | # Python Machine Learning [PML] 2 | - [Github](https://github.com/rasbt/python-machine-learning-book) 3 | 4 | # An Introduction to Statistical Learning with Applications in R [ISLR] 5 | - [link](http://www-bcf.usc.edu/~gareth/ISL/) 6 | - [Python implementation Github](https://github.com/JWarmenhoven/ISLR-python) 7 | 8 | # The Elements of Statistical Learning [ESL] 9 | - [link](https://statweb.stanford.edu/~tibs/ElemStatLearn/) 10 | 11 | # Pattern Recognition and Machine Learning [PRML] 12 | - [Amazon link](https://www.amazon.com/Pattern-Recognition-Learning-Information-Statistics/dp/0387310738) 13 | 14 | -------------------------------------------------------------------------------- /wiki/Project Ideas.md: -------------------------------------------------------------------------------- 1 | 2 | * [Stanford CS299 Machine Learning](http://cs229.stanford.edu/): You can find student projects if you scroll down 3 | 4 | * [Zipper Classification](https://m.oursky.com/using-tensorflow-and-support-vector-machine-to-create-an-image-classifications-engine-7ee51b5617d5#.yfp3q6ym9) 5 | 6 | * [“结巴”中文分词:做最好的 Python 中文分词组件](https://github.com/fxsjy/jieba) 7 | 8 | * [語言處理技術](http://ccckmit.github.io/BookLanguageProcessing/) 9 | 10 | * [Benfor's law (wikipedia)](https://en.wikipedia.org/wiki/Benford's_law): e.g., accounting fraud detection 11 | ## ML Data Set 12 | 13 | * [UC Irvine Machine Learning Repository](http://archive.ics.uci.edu/ml/) 14 | 15 | * [THE MNIST Database of handwritten digits](http://yann.lecun.com/exdb/mnist/) 16 | -------------------------------------------------------------------------------- /wiki/Python Resources.md: -------------------------------------------------------------------------------- 1 | # Why Python? 2 | * [Most popular coding languages of 2016](http://blog.codeeval.com/codeevalblog/2016/2/2/most-popular-coding-languages-of-2016) 3 | 4 | # Python Installation 5 | 6 | * Please install [Anaconda](https://www.anaconda.com/download/) Python distribution (__3.X version__, __2.X version). Anaconda distribution is core Python + useful scientific computation libraries (e.g., numpy, scipy, pandas) + package management system (pip or conda) 7 | 8 | # Python Tutorials 9 | 10 | * [YouTube tutorial](https://www.youtube.com/watch?v=N4mEzFDjqtA) and [cheat sheet](http://www.newthinktank.com/2014/11/python-programming/) by Derek Banas 11 | 12 | * [Python Crash Course cheat sheets](https://ehmatthes.github.io/pcc/cheatsheets/README.html) 13 | 14 | * [Python教程 by 廖雪峰](http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/) 15 | 16 | * [Python introduction](https://lectures.quantecon.org/py/learning_python.html) in [Quantitative Economics](https://lectures.quantecon.org/) by Thomas Sargent 17 | 18 | # Python Packages 19 | 20 | * [Anaconda](https://www.continuum.io/downloads): Python distribution for scientific computing with [conda](https://conda.io/docs/intro.html) environment management tool 21 | 22 | * [NumPy](http://www.numpy.org/): the numerical/mathematical computation package 23 | 24 | * [Scikit-Learn](http://scikit-learn.org/): a popular machine learning package for python 25 | 26 | * [Pandas](http://pandas.pydata.org/): Python Data Analysis Library 27 | 28 | # Python Editor 29 | * [Jupyter Notebook](http://jupyter.org/): Enough for lectures and presentation (running in browser) 30 | 31 | * [Spyder](https://pythonhosted.org/spyder/): Included in Anaconda 32 | 33 | * [PyCharm](https://www.jetbrains.com/pycharm/) ([student account](https://www.jetbrains.com/student/)): Professional editor for programming 34 | -------------------------------------------------------------------------------- /wiki/Useful Links.md: -------------------------------------------------------------------------------- 1 | 2 | * [UC Irvine Machine Learning Repository](http://archive.ics.uci.edu/ml/) 3 | 4 | * [Awesome - Most Cited Deep Learning Papers](https://github.com/terryum/awesome-deep-learning-papers/blob/master/README.md) 5 | 6 | * [Deep Learning Papers Reading Roadmap](https://github.com/songrotek/Deep-Learning-Papers-Reading-Roadmap) 7 | --------------------------------------------------------------------------------