예제 #1
0
def compare_pdfs_reclass():
    """
  Affiche et compare les pdfs avant et après reclassification automatique.
  """
    from results import AnalyseResults
    opt = AnalyseResults()

    opt.opdict['stations'] = ['IJEN']
    opt.opdict['channels'] = ['Z']
    opt.opdict['Types'] = ['Tremor', 'VulkanikB', '?']
    opt.opdict['feat_list'] = [
        'Centroid_time', 'Dur', 'Ene0-5', 'F_up', 'Growth', 'Kurto',
        'RappMaxMean', 'RappMaxMeanTF', 'Skewness', 'TimeMaxSpec', 'Width'
    ]

    for sta in opt.opdict['stations']:
        for comp in opt.opdict['channels']:
            opt.opdict[
                'label_filename'] = '%s/Ijen_3class_all.csv' % opt.opdict[
                    'libdir']
            opt.x, opt.y = opt.features_onesta(sta, comp)
            opt.classname2number()
            opt.compute_pdfs()
            g1 = opt.gaussians

            opt.opdict[
                'label_filename'] = '%s/Ijen_3class_all_SVM.csv' % opt.opdict[
                    'libdir']
            opt.x, opt.y = opt.features_onesta(sta, comp)
            opt.classname2number()
            opt.compute_pdfs()
            g2 = opt.gaussians

            c = ['r', 'b', 'g']
            for feat in opt.opdict['feat_list']:
                fig = plt.figure()
                fig.set_facecolor('white')
                for it, t in enumerate(opt.types):
                    plt.plot(g1[feat]['vec'],
                             g1[feat][t],
                             ls='-',
                             color=c[it],
                             label=t)
                    plt.plot(g2[feat]['vec'],
                             g2[feat][t],
                             ls='--',
                             color=c[it])
                plt.title(feat)
                plt.legend()
                #plt.savefig('../results/Ijen/comp_BrutReclass_%s.png'%feat)
                plt.show()
예제 #2
0
def compare_pdfs_reclass():
  """
  Affiche et compare les pdfs avant et après reclassification automatique.
  """
  from results import AnalyseResults
  opt = AnalyseResults()

  opt.opdict['stations'] = ['IJEN']
  opt.opdict['channels'] = ['Z']
  opt.opdict['Types'] = ['Tremor','VulkanikB','?']
  opt.opdict['feat_list'] = ['Centroid_time','Dur','Ene0-5','F_up','Growth','Kurto','RappMaxMean','RappMaxMeanTF','Skewness','TimeMaxSpec','Width']

  for sta in opt.opdict['stations']:
    for comp in opt.opdict['channels']:
      opt.opdict['label_filename'] = '%s/Ijen_3class_all.csv'%opt.opdict['libdir']
      opt.x, opt.y = opt.features_onesta(sta,comp)
      opt.classname2number()
      opt.compute_pdfs()
      g1 = opt.gaussians

      opt.opdict['label_filename'] = '%s/Ijen_reclass_all.csv'%opt.opdict['libdir']
      opt.x, opt.y = opt.features_onesta(sta,comp)
      opt.classname2number()
      opt.compute_pdfs()
      g2 = opt.gaussians

      c = ['r','b','g']
      for feat in opt.opdict['feat_list']:
        fig = plt.figure()
        fig.set_facecolor('white')
        for it,t in enumerate(opt.types):
          plt.plot(g1[feat]['vec'],g1[feat][t],ls='-',color=c[it],label=t)
          plt.plot(g2[feat]['vec'],g2[feat][t],ls='--',color=c[it])
        plt.title(feat)
        plt.legend()
        #plt.savefig('../results/Ijen/comp_BrutReclass_%s.png'%feat)
        plt.show()