@liushiya
2018-10-25T10:11:06.000000Z
字数 4106
阅读 1039
机器学习
实验
你可以点击这里查看中文版本。
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
2018-10-14 2:00-5:00 PM B7-138(Mingkui Tan) B7-238(Qingyao Wu)
2018-11-18 12:00 AM
Complete Independently.
Face Classification
1. Load data set data. The images are supposed to converted into grayscale images with size of 24 * 24, the number and the proportion of the positive and negative samples is not limited, the data set label is not limited.
2. Processing data set data to extract NPD features. Extract features using the NPDFeature class in feature.py. (Tip: Because the time of the pretreatment is relatively long, it can be pretreated with pickle function library dump() save the data in the cache, then may be used load() function reads the characteristic data from cache.)
3. The data set is divisded into training set and calidation set, this experiment does not divide the test set.
4. Write all AdaBoostClassifier functions based on the reserved interface in ensemble.py. The following is the guide of fit function in the AdaBoostClassifier class:
4.1 Initialize training set weights , each training sample is given the same weight.
4.2 Training a base classifier , which can be sklearn.tree library DecisionTreeClassifier (note that the training time you need to pass the weight as a parameter).
4.3 Calculate the classification error rate of the base classifier on the training set.
4.4 Calculate the parameter according to the classification error rate .
4.5 Update training set weights .
4.6 Repeat steps 4.2-4.6 above for iteration, the number of iterations is based on the number of classifiers.
5. Predict and verify the accuracy on the validation set using the method in AdaBoostClassifier and use classification_report () of the sklearn.metrics library function writes predicted result to classifier_report.txt .
Finishing experiment report according to results(The template of report can be found in the example repository.
Item | Proportion | Description |
---|---|---|
Attendance | 40% | Ask for a leave if time conflict |
Code availability | 20% | Complied successfully |
Report | 30% | According to report model |
Code specification | 10% | Mainly consider whether using the readable variable name |
Any advice or idea is welcome to discuss with teaching assistant in QQ group.
[1] Liao, S., Jain, A. K., & Li, S. Z. (2016). A fast and accurate unconstrained face detector. IEEE transactions on pattern analysis and machine intelligence, 38(2), 211-223.
[2] 周志华. 机器学习. 北京:清华大学出版社,2016:173-177