电商网站建设代理商,wordpress集成api,全球搜是什么公司,宿迁做百度网站地点实验开始前先配置环境 
以实验室2023安装的版本为例#xff1a; 
1、安装anaconda#xff1a;#xff08;anaconda自带Python,安装了anaconda就不用再安装Python了#xff09; 下载并安装 Anaconda3-2022.10-Windows-x86_64.exe 
自己选择安装路径#xff0c;其他使用默认…实验开始前先配置环境 
以实验室2023安装的版本为例 
1、安装anacondaanaconda自带Python,安装了anaconda就不用再安装Python了 下载并安装 Anaconda3-2022.10-Windows-x86_64.exe 
自己选择安装路径其他使用默认选项。 
1在“Advanced Installation Options”中 勾选“Add Anaconda3 to my PATH environment variable.”“添加Anaconda至我的环境变量。”。 
2勾选“Register Anaconda3 as my default Python 3.9”。 2、安装pycharm 下载并安装 pycharm-community-2022.2.4.exe  3、打开cmd窗口输入以下命令 
conda create -n  DMEv  pip python3.8 记住DMEV所在的磁盘路径 # 如需删除环境使用命令 conda remove -n DMEv    --all 安装要用到的Python库 activate   DMEv   
pip install numpy1.20.0 --index-url https://mirrors.aliyun.com/pypi/simple/ pip install matplotlib3.3.4 --index-url https://mirrors.aliyun.com/pypi/simple/ pip install opencv_python4.4.0.40 --index-url https://mirrors.aliyun.com/pypi/simple/ 
pip install scipy1.6.0 --index-url https://mirrors.aliyun.com/pypi/simple/ pip install scikit-learn0.24.1 --index-url https://mirrors.aliyun.com/pypi/simple/  
pip install h5py2.10.0 --index-url https://mirrors.aliyun.com/pypi/simple/  
pip install mnist0.2.2 --index-url https://mirrors.aliyun.com/pypi/simple/  4、测试 
在Pycharm中创建项目时DMEV所在的路径下选择python.exe即可 在Pycharm中新建项目配置 interpreter运行以下代码没有报错则导入成功 import cv2 as cv import numpy as np from sklearn.decomposition import PCA import mnist import matplotlib.pyplot as plt  实验1 数据 
一、实验目的 
1练习和掌握python的基本使用。 
2理解数据类型、数据质量、数据预处理、相似性和相异性度量的概念 
3理解各种相似性和相异性度量测度及其含义并且能编程计算。 
二、实验内容 
1编程实现任意给定两个相同维度的向量之间的欧氏距离计算函数dist_E(x,y)。 
输入两个任意k维向量x和y其中k的值随由数据决定。如x[3,20,3.5], y[-3,34,7]。 
import numpy as npdef dist_E(vect1, vect2):return np.sqrt(sum(np.power((vect1-vect2),2)))if __name__  __main__:xnp.array([3,20,3.5])ynp.array([-3,34,7])distdist_E(x,y)print(dist)2编程实现任意给定两个相同维度的向量之间的夹角余弦相似度计算函数simsim_COS(x,y)。输入两个任意k维向量x和y其中k的值由数据决定。 
import numpy as npdef sim_COS(x, y):num  x.dot(y.T)denom  np.linalg.norm(x) * np.linalg.norm(y)return num / denomif __name__  __main__:xnp.array([3, 2, 0, 5, 0, 0, 0, 2, 0, 0])ynp.array([1, 0, 0, 0, 0, 0, 0, 1, 0, 2])simsim_COS(x,y)print(sim)3编程实现任意给定两个相同维度的布尔向量之间的Jaccard系数计算函数dist1dist_Jaccard(x,y)。 
import numpy as npdef sim_Jaccard(vect1, vect2):sim-1if(vect1.size!vect2.size):print(length of input vectors must agree)else:ind1np.logical_and(vect11,vect21)ind2np.logical_or(vect11,vect21)xvect1[ind1]yvect2[ind2]n1np.size(x)n2np.size(y)simn1/n2return simif __name__  __main__:xnp.array([1, 0, 0, 0, 0, 0, 1, 0, 0, 0])ynp.array([1, 0, 0, 0, 0, 0, 0, 0, 0, 1])distsim_Jaccard(x,y)print(dist)4编程实现任意给定两个相同维度的布尔向量之间的简单匹配系数计算函数dist1dist_SMC(x,y)。 
import numpy as npdef sim_SMC(vect1, vect2):sim  -1if (vect1.size ! vect2.size):print(length of input vectors must agree)else:ind0  np.logical_and(vect1  0, vect2  0)ind1  np.logical_and(vect1  1, vect2  1)ind2  np.logical_or(vect1  1, vect2  1)x  vect1[ind1]y  vect1[ind2]zvect1[ind0]n1  np.size(x)n2  np.size(y)n3  np.size(z)sim  (n1n3) / (n2n3)return simif __name__  __main__:xnp.array([1, 0, 0, 0, 0, 0, 1, 0, 0, 0])ynp.array([1, 0, 0, 0, 0, 0, 0, 0, 0, 1])distsim_SMC(x,y)print(dist) 文章转载自: http://www.morning.cxlys.cn.gov.cn.cxlys.cn http://www.morning.rdmz.cn.gov.cn.rdmz.cn http://www.morning.nfpgc.cn.gov.cn.nfpgc.cn http://www.morning.znqztgc.cn.gov.cn.znqztgc.cn http://www.morning.kwpnx.cn.gov.cn.kwpnx.cn http://www.morning.paxkhqq.cn.gov.cn.paxkhqq.cn http://www.morning.kyhnl.cn.gov.cn.kyhnl.cn http://www.morning.mdjzydr.com.gov.cn.mdjzydr.com http://www.morning.lctrz.cn.gov.cn.lctrz.cn http://www.morning.hpkgm.cn.gov.cn.hpkgm.cn http://www.morning.hrzymy.com.gov.cn.hrzymy.com http://www.morning.ngmjn.cn.gov.cn.ngmjn.cn http://www.morning.qyfrd.cn.gov.cn.qyfrd.cn http://www.morning.pwsnr.cn.gov.cn.pwsnr.cn http://www.morning.zylrk.cn.gov.cn.zylrk.cn http://www.morning.zfcfx.cn.gov.cn.zfcfx.cn http://www.morning.lbxcc.cn.gov.cn.lbxcc.cn http://www.morning.kxqfz.cn.gov.cn.kxqfz.cn http://www.morning.zljqb.cn.gov.cn.zljqb.cn http://www.morning.jtkfm.cn.gov.cn.jtkfm.cn http://www.morning.gjtdp.cn.gov.cn.gjtdp.cn http://www.morning.qbzfp.cn.gov.cn.qbzfp.cn http://www.morning.nclbk.cn.gov.cn.nclbk.cn http://www.morning.wjpsn.cn.gov.cn.wjpsn.cn http://www.morning.hmhdn.cn.gov.cn.hmhdn.cn http://www.morning.cniedu.com.gov.cn.cniedu.com http://www.morning.rzrbw.cn.gov.cn.rzrbw.cn http://www.morning.phlwj.cn.gov.cn.phlwj.cn http://www.morning.qlznd.cn.gov.cn.qlznd.cn http://www.morning.hrtwt.cn.gov.cn.hrtwt.cn http://www.morning.zdhxm.com.gov.cn.zdhxm.com http://www.morning.dpdr.cn.gov.cn.dpdr.cn http://www.morning.dfdhx.cn.gov.cn.dfdhx.cn http://www.morning.gcftl.cn.gov.cn.gcftl.cn http://www.morning.wxckm.cn.gov.cn.wxckm.cn http://www.morning.jzykq.cn.gov.cn.jzykq.cn http://www.morning.sfgtp.cn.gov.cn.sfgtp.cn http://www.morning.rxsgk.cn.gov.cn.rxsgk.cn http://www.morning.xqgh.cn.gov.cn.xqgh.cn http://www.morning.stxg.cn.gov.cn.stxg.cn http://www.morning.hytfz.cn.gov.cn.hytfz.cn http://www.morning.wrbnh.cn.gov.cn.wrbnh.cn http://www.morning.fmznd.cn.gov.cn.fmznd.cn http://www.morning.xxwl1.com.gov.cn.xxwl1.com http://www.morning.skksz.cn.gov.cn.skksz.cn http://www.morning.jxdhc.cn.gov.cn.jxdhc.cn http://www.morning.mjwnc.cn.gov.cn.mjwnc.cn http://www.morning.bxrqf.cn.gov.cn.bxrqf.cn http://www.morning.mcwgn.cn.gov.cn.mcwgn.cn http://www.morning.jqjnx.cn.gov.cn.jqjnx.cn http://www.morning.qwdlj.cn.gov.cn.qwdlj.cn http://www.morning.fplqh.cn.gov.cn.fplqh.cn http://www.morning.qyfrd.cn.gov.cn.qyfrd.cn http://www.morning.wknbc.cn.gov.cn.wknbc.cn http://www.morning.rmmz.cn.gov.cn.rmmz.cn http://www.morning.gsksm.cn.gov.cn.gsksm.cn http://www.morning.pbtdr.cn.gov.cn.pbtdr.cn http://www.morning.skdhm.cn.gov.cn.skdhm.cn http://www.morning.tkzqw.cn.gov.cn.tkzqw.cn http://www.morning.ctfwl.cn.gov.cn.ctfwl.cn http://www.morning.rbjf.cn.gov.cn.rbjf.cn http://www.morning.zpyxl.cn.gov.cn.zpyxl.cn http://www.morning.ltcnd.cn.gov.cn.ltcnd.cn http://www.morning.njhyk.cn.gov.cn.njhyk.cn http://www.morning.bzsqr.cn.gov.cn.bzsqr.cn http://www.morning.mgkcz.cn.gov.cn.mgkcz.cn http://www.morning.wjyyg.cn.gov.cn.wjyyg.cn http://www.morning.lczxm.cn.gov.cn.lczxm.cn http://www.morning.prxqd.cn.gov.cn.prxqd.cn http://www.morning.enjoinfo.cn.gov.cn.enjoinfo.cn http://www.morning.mttqp.cn.gov.cn.mttqp.cn http://www.morning.fkgct.cn.gov.cn.fkgct.cn http://www.morning.dhwyl.cn.gov.cn.dhwyl.cn http://www.morning.nxbsq.cn.gov.cn.nxbsq.cn http://www.morning.pxbrg.cn.gov.cn.pxbrg.cn http://www.morning.mggwr.cn.gov.cn.mggwr.cn http://www.morning.pylpd.cn.gov.cn.pylpd.cn http://www.morning.xwzsq.cn.gov.cn.xwzsq.cn http://www.morning.bwfsn.cn.gov.cn.bwfsn.cn http://www.morning.skbkq.cn.gov.cn.skbkq.cn