注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

阿弥陀佛

街树飘影未见尘 潭月潜水了无声 般若观照心空静...

 
 
 

日志

 
 
关于我

一直从事气象预报、服务建模实践应用。 注重气象物理场、实况场、地理信息、本体知识库、分布式气象内容管理系统建立。 对Barnes客观分析, 小波,计算神经网络、信任传播、贝叶斯推理、专家系统、网络本体语言有一定体会。 一直使用Java、Delphi、Prolog、SQL编程。

网易考拉推荐

ROCR 降水测试  

2016-11-22 21:37:20|  分类: R |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
# new version
library(rbokeh)
library(data.table)
ymdhmStr <- '201607180000'
elenm <- 'PRE_1h'

elenms <- c("PRS", "PRS_Sea", "TEM", "DPT", "RHU", "VAP", "PRE_1h", "WIN_D_Avg_2mi", "WIN_S_Avg_2mi",
            "GST", "T_5cm", "T_10cm", "T_15cm", "T_20cm", "T_40cm", "U", "V", "QSE",
            "GTEM","VISM","DDDMAX","FFMAX","PRE_10m","PRE_5mprev","PRE_5mpost")
vnms <- c("V1","V2","V3","V4","V5","V6","V7","V8","V9","V10",
          "V11","V12","V13","V14","V15","V16","V17","V18","V19","V20",
          "V21","V22","V23","V24","V25","V26","V27","V28","V29","V30")
csvnms <- c("ymdhm","sta","lat","lon","alt",elenms)
ssnms <- c("ymdhm","cnm","bias","rmse","cor","nsamp")
ymdhms <- c(substr(ymdhmStr,1,4),substr(ymdhmStr,1,8))
eleIdx <- match(elenm,elenms)
vnm <- vnms[match(elenm,csvnms)]

fnmReal <- sprintf("/data/calf/csv/eleh/csvreal/%s/%s/%s.csv",
                   ymdhms[1],ymdhms[2],ymdhmStr)
fnmFit  <- sprintf("/data/calf/csv/eleh/csvfit/%s/%s/%s.csv",
                   ymdhms[1],ymdhms[2],ymdhmStr)
fnmStats<- sprintf("/data/calf/logs/RMSE/%s/%s/%s.txt",
                   ymdhms[1],ymdhms[2],ymdhmStr)
if (file.exists(fnmReal) & file.exists(fnmFit) & file.exists(fnmStats) ){
  print('all file exists')
} else {
  stop('some file not exists !')
}

dReal <- fread(fnmReal,select=c('V2',vnm))
names(dReal) <- c('sta','V2')

dFit <- fread(fnmFit,select=c('V2',vnm))
names(dFit)  <- c('sta','V2')

ss0 <- read.csv(fnmStats,header = F)
ss1 <- ss0[eleIdx,] #提取统计向量
std <- ss1[4]       #均方根误擦
names(ss1) <- ssnms

rf0 <- merge(dReal,dFit,by='sta')
rf <- subset(rf0, !is.nan(rf0$V2.x) & !is.nan(rf0$V2.y) )
tReal <- rf$V2.x
tFit  <- rf$V2.y
tmm <- c(min(tFit,na.rm = T),max(tFit,na.rm = T))

m <- sprintf("%s,%s,%s=%s,%s=%s,%s=%s,%s=%s,"
             ,ss1[1],elenm,ssnms[3],ss1[3],ssnms[4],ss1[4],ssnms[5],ss1[5],ssnms[6],ss1[6])

# z <- lm(tReal ~ tFit)
figure(width = 800, height = 600,title=m,xlab=elenm,ylab='拟合') %>%
  ly_points(tReal, tFit,size=2) %>%
  ly_lines(tmm, tmm, type = 1, legend = "理想线",color = "black")
##########################################################
# install.packages('ROCR')
library(gplots)
library(ROCR)
lb <- as.integer(tReal >= 0.1)
pred <- prediction(tFit, lb)
perf <- performance(pred,"tpr","fpr")
plot(perf,colorize=TRUE)
ROCR 降水测试 - 险峰 - 阿弥陀佛
 
ROCR 降水测试 - 险峰 - 阿弥陀佛
  评论这张
 
阅读(59)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017