ml-homework/main.py

30 lines
978 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import numpy as np
import matplotlib.pyplot as plt
from experiments import ExperimentRunner
def main():
"""主函数"""
print("机器学习算法实现与比较系统")
print("="*50)
print("本系统实现了以下内容:")
print("1. 改进的BP神经网络 vs 标准BP网络")
print("2. 特征提取(PCA, 特征选择)对分类性能的影响")
print("3. 多种分类算法比较(朴素贝叶斯, KNN, 决策树)")
print("4. 集成学习算法(Bagging, Voting)")
print("5. 所有算法均为自主实现未使用任何ML库")
print("="*50)
# 设置matplotlib中文显示
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
# 运行实验
runner = ExperimentRunner()
results = runner.run_all_experiments()
print("\n实验完成!结果已保存在实验报告中。")
print("图表已保存到本地文件。")
if __name__ == "__main__":
main()