ImageVerifierCode 换一换
格式:DOCX , 页数:12 ,大小:62.87KB ,
资源ID:28220721      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/28220721.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(昆明理工大学人工智能第二次实验报告.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

昆明理工大学人工智能第二次实验报告.docx

1、昆明理工大学人工智能第二次实验报告理工大学信息工程与自动化学院学生实验报告( 2013 2014 学年 第 1 学期 )课程名称:人工智能 开课实验室:信自楼445 2013 年12月 20日年级、专业、班计科113学号4周国映成绩教师评语该同学是否了解实验原理: A.了解 B.基本了解 C.不了解该同学的实验能力: A.强 B.中等 C.差 该同学的实验是否达到要求: A.达到 B.基本达到 C.未达到实验报告是否规: A.规 B.基本规 C.不规实验过程是否详细记录: A.详细 B.一般 C.没有 教师签名: 年 月 日实验项目名称天气决策树指导教师 英莉一、上机目的及容1.上机容用确定性

2、推理算法求解教材65-66页介绍的八数码难题。2.上机目的(1)复习程序设计和数据结构课程的相关知识,实现课程间的平滑过渡;(2)掌握并实现在小规模状态空间中进行图搜索的方法;(3)理解并掌握图搜索的技术要点。二、实验原理及基本技术路线图(方框原理图或程序流程图)(1)设计并实现程序,求解出正确的解答路径;(2)对所设计的算法采用大O符号进行时间复杂性和空间复杂性分析;(3)对一般图搜索的技术要点和技术难点进行评述性分析。三、所用仪器、材料(设备名称、型号、规格等或使用软件)1台PC及VISUAL C+6.0软件四、实验方法、步骤(或:程序代码或操作过程) 建立工程后建立5个source Fi

3、les文件分别为1.AttributeValue.cpp#include AttributeValue.h#include base.hAttributeValue:AttributeValue(std:string const& instring): m_value(instring)bool AttributeValue:GetType() if (m_value = P) return true; else if (m_value = N) return false; else throw DataErrException(); 2.basefun.cpp#include float l

4、og2 (float x) return 1.0 / log10(2) * log10(x);float calEntropy(float prob) float sum=0; if (prob = 0 | prob = 1) return 0; sum -= prob * log2(prob); sum -= (1 - prob) * log2 ( 1 - prob ); return sum;3.DataPoint.cpp#include #include DataPoint.hDataPoint:DataPoint(std:vector const& attributes, bool t

5、ype): m_type(type) for (int i=0; iattributes.size(); +i) m_attributes.push_back( attributesi ); void DataPoint:display() for (int i=0; im_attributes.size(); +i) std:cout t m_attributesi.getValue(); if (true = m_type) std:cout tP; else std:cout tN; std:cout std:endl;4.DataSet.cpp5.main.cpp#include #i

6、nclude #include #include #include #include #include AttributeValue.h#include DataPoint.h#include DataSet.hDataPoint processLine(std:string const& sLine) std:istringstream isLine(sLine, std:istringstream:in); std:vector attributes; / TODO: need to handle beginning and ending empty spaces. while( isLi

7、ne.good() ) std:string rawfield; isLine rawfield; attributes.push_back( AttributeValue( rawfield ) ); AttributeValue v = attributes.back(); attributes.pop_back(); bool type = v.GetType(); return DataPoint(attributes, type); void main() std:ifstream ifs(in.txt, std:ifstream:in); DataSet initDataset;

8、while( ifs.good() ) / TODO: need to handle empty lines. std:string sLine; std:getline(ifs, sLine); initDataset.addDataPoint( processLine(sLine) ); std:list processQ; std:vector finishedDataSet; processQ.push_back(initDataset); while ( processQ.size() 0 ) std:vector splittedDataSets; DataSet dataset

9、= processQ.front(); dataset.splitDataSet(splittedDataSets); processQ.pop_front(); for (int i=0; isplittedDataSets.size(); +i) float prob = splittedDataSetsi.getPositiveProb(); if (prob = 0.0 | prob = 1.0) finishedDataSet.push_back(splittedDataSetsi); else processQ.push_back(splittedDataSetsi); std:c

10、out The dicision tree is: std:endl; for (int i = 0; i finishedDataSet.size(); +i) finishedDataSeti.display(); 建立4个Header Files文件1.AttributeValue.h#ifndef ATTRIBUTE_VALUE_H_#define ATTRIBUTE_VALUE_H_#include class AttributeValuepublic: AttributeValue(std:string const& instring); bool GetType(); std:s

11、tring const& getValue() const return m_value; private: std:string m_value;struct AttributeValueCmp bool operator() (AttributeValue const& lhs, AttributeValue const& rhs) const return lhs.getValue() rhs.getValue(); ;#endif2.base.hclass DataErrException : public std:exception;float calEntropy(float pr

12、ob);3.DatePoint.h#ifndef DATA_POINT_H_#define DATA_POINT_H_#include #include AttributeValue.hclass DataPointpublic: DataPoint(std:vector const& attributes, bool type); bool isPositive() return m_type; int getNAttributes() return m_attributes.size(); AttributeValue const& getAttribute(int index) retu

13、rn m_attributesindex; void display();private: std:vector m_attributes; bool m_type;#endif4.DateSet.h#include #include #include DataPoint.hclass SplitAttributeValuepublic: SplitAttributeValue(AttributeValue v, int id) : m_v(v) , m_attributeIndex(id) int getAttributeIndex() return m_attributeIndex; vo

14、id display();private: int m_attributeIndex; AttributeValue m_v;class DataSetpublic: void addDataPoint(DataPoint const& datapoint); float getPositiveProb(); void splitDataSet(std:vector& splittedSets); void display();private: std:vector m_splitAttributes; std:vector m_data;五、实验过程原始记录( 测试数据、图表、计算等)实验运行截图六、实验结果、分析和结论(误差分析与数据处理、成果总结等。其中,绘制曲线图时必须用计算纸或程序运行结果、改进、收获) 这次事件让我的编程能力有了很大的提高,查阅资料等能力也有很大的提升。让我对人工智能技术有了进一步的认识。在解决问题和算法设计上的能力也极提高。这次作业我收集相关材料阅读并消化, 在实际应用中,我发现人工智能是一门很有意思的学科,对本门课程产生了兴趣。在以后的学习中,我会认真学好这门课程。

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1