大数据分析 MATLAB 篇
沉沙 2018-10-12 来源 : 阅读 3714 评论 0

摘要:本篇教程介绍了大数据分析 MATLAB 篇,希望阅读本篇文章以后大家有所收获,帮助大家对大数据云计算大数据分析的理解更加深入。

本篇教程介绍了大数据分析 MATLAB 篇,希望阅读本篇文章以后大家有所收获,帮助大家对大数据云计算大数据分析的理解更加深入。

<

一:起因
(1)最近一直在处理大数据,从MB ----> GB的变化,是一次质的飞跃,相应的工具也在变 从widows到linux,从单机单核 到 hadoop多节点的计算
(2)问题来了,面对海量的数据,如何从中挖掘实用的信息或者发现潜在的现象,可视化工具可能是必不可少的 ;
(3)可视化工具可以说百度一大篇,可是作为研究者的我们,程序猿的我们可能更希望能够抽象出一种数学模型,对现实的现象进行非常好的描述和刻画
(4)Python(数据清洗和处理) + MATLAB(模型分析) 或 c++/java/hadoop(数据清洗和处理) + MATLAB(模型分析)



二:MATLAB 学习
(1)伽马分布(gamfit)
clc
clear all
close all
dataall = load('G:\zyp_thanks\metro_test\1-07\529_2.csv');
data = dataall(:,3);%指定列

[y,x]=hist(data,6);%creates a histogram bar plot of data,sorts data into the number of bins specified by nbins
%return the categorical levels correponding to each count in N
subplot(2,2,1)
bar(x,y,'FaceColor','r','EdgeColor','w');box off

cxd1=gamfit(data);% returns the maximum likehood estimates(MLEs) for the parameters of the gamma distribution given the data in vector data.
% 伽玛分布中的参数α,称为形状参数,β称为尺度参数。
a = cxd1(1);
b = cxd1(2);
cxd2=gamcdf(data,cxd1(1),cxd1(2));%return the gamma cdf(分布函数) at each of the values in x using the corresponding shape parameters a and scale parameter
%cxd2 = gampdf(data,cxd1(1),cxd1(2));%%return the gamma pdf(密度函数) at each of the values in x using the corresponding shape parameters a and scale parameter
H=kstest(data,[data,cxd2]);
subplot(2,2,2);
plot(data,cxd2);

(2)MATALAB 下 .m 文件的命名
% 错误提示:
%Attempt to execute SCRIPT *** as a function     在运行MATLAB程序的时候,出现如题的报错。
% 原因:
% 在系统中,现有的.m文件有的与***函数重名,所以matlab编译器不知道在遇到***的时候到底该执行哪一个函数。
% 例如:我编写了一个.m文件,命名为:fft2.m.用于实现通过频域分析提取图像的纹理特征。
% 当命令执行到X=fft2(ImageM)这句话的时候,不知道fft2是指系统函数还是自定义的纹理特征提取函数。

% 解决:
% 把自定义的函数名改成其他名字。如上例中的fft2改为ffttexture.m?
(3)pdf 和 cdf函数的说明、
Probability density function(PDF) 概率密度函数;  

cumulative distribution function ; CDF 是累积分布函数
(4)正态分布(normpdf normcdf)
clc
clear all
close all
dataall = load('G:\zyp_thanks\metro_test\1-07\529_2.csv');
data = dataall(:,3);%指定列
[mu,sigma]=normfit(data);%estimate of the mean and standard deviation in data
[y,x]=hist(data,6);%creates a histogram bar plot of data,sorts data into the number of bins specified by nbins
%return the categorical levels correponding to each count in N
bar(x,y,'FaceColor','r','EdgeColor','w');box off
xlim([mu-3*sigma,mu+3*sigma]) % sets the axis limits in the current axes to the specified values
a2=axes;
% computes the pdf at each of the values in X using the normal distribution
% with mean and standard deviation sigma.
ezplot(@(x)normpdf(x,mu,sigma),[mu-3*sigma,mu+3*sigma])
set(a2,'box','off','yaxislocation','right','color','none')
title '频数直方图与正态分布密度函数(拟合)'

(5) quantile - quantile plot (Q-Q plot)
clc
clear all
close all
dataall = load('G:\zyp_thanks\metro_test\1-07\529_2.csv');
data = dataall(:,3);%指定列
qqplot(data);
% displays a quantile-quantile plot of the sample quantiles of X versus
% theoretical from a normal distribution. if the distribution of X is
% normal,the plot will be close to linear.

   

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标大数据云计算大数据分析频道!

本文由 @沉沙 发布于职坐标。未经许可,禁止转载。
喜欢 | 5 不喜欢 | 2
看完这篇文章有何感觉?已经有7人表态,71%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程