• 吴裕雄 python深度学习与实践(6)


    from pylab import *
    import pandas as pd
    import matplotlib.pyplot as plot
    import numpy as np
    
    filePath = ("G:\MyLearning\TensorFlow_deep_learn\data\dataTest.csv")
    dataFile = pd.read_csv(filePath,header=None, prefix="V")
    summary = dataFile.describe()
    dataFileNormalized = dataFile.iloc[:,1:6]
    for i in range(1,6):
        mean = summary.iloc[1, i]
        sd = summary.iloc[2, i]
        dataFileNormalized.iloc[:,(i-1)] = (dataFileNormalized.iloc[:,(i-1)] - mean) / sd
    array = dataFileNormalized.values
    print(np.shape(array))
    boxplot(array)
    plot.xlabel("Attribute")
    plot.ylabel("Score")
    show()

    from pylab import *                                            
    import pandas as pd                                            
    import matplotlib.pyplot as plot                                    
    filePath = ("c://dataTest.csv")                                    
    dataFile = pd.read_csv(filePath,header=None, prefix="V")                
    
    summary = dataFile.describe()                                    
    minRings = -1                                                
    maxRings = 99                                                
    nrows = 10                                                
    for i in range(nrows):                                            
        dataRow = dataFile.iloc[i,1:10]                                
        labelColor = (dataFile.iloc[i,10] - minRings) / (maxRings - minRings)    
        dataRow.plot(color=plot.cm.RdYlBu(labelColor), alpha=0.5)        
    plot.xlabel("Attribute")                                        
    plot.ylabel("Score")                                            
    show()            

    import numpy as np
    from pylab import *
    import pandas as pd
    import matplotlib.pyplot as plot
    
    filePath = ("G:\MyLearning\TensorFlow_deep_learn\data\dataTest.csv")
    dataFile = pd.read_csv(filePath,header=None, prefix="V")
    
    corMat = pd.DataFrame(dataFile.iloc[1:20,1:20].corr())
    plot.pcolor(corMat)
    plot.show()
    print(np.shape(corMat))
    print(corMat)

    from pylab import *
    import pandas as pd
    import matplotlib.pyplot as plot
    
    filePath = ("G:\MyLearning\TensorFlow_deep_learn\data\rain.csv")
    dataFile = pd.read_csv(filePath)
    summary = dataFile.describe()
    print(summary)
    
    array = dataFile.iloc[:,1:13].values
    boxplot(array)
    plot.xlabel("month")
    plot.ylabel("rain")
    show()

    from pylab import *
    import pandas as pd
    import matplotlib.pyplot as plot
    
    filePath = ("G:\MyLearning\TensorFlow_deep_learn\data\rain.csv")
    dataFile = pd.read_csv(filePath)
    
    minRings = -1
    maxRings = 99
    nrows = 12
    for i in range(nrows):
        dataRow = dataFile.iloc[i,1:13]
        labelColor = (dataFile.iloc[i,12] - minRings) / (maxRings - minRings)
        dataRow.plot(color=plot.cm.RdYlBu(labelColor), alpha=0.5)
    plot.xlabel("Attribute")
    plot.ylabel("Score")
    show()

    from pylab import *
    import pandas as pd
    import matplotlib.pyplot as plot
    
    filePath = ("G:\MyLearning\TensorFlow_deep_learn\data\rain.csv")
    dataFile = pd.read_csv(filePath)
    
    corMat = pd.DataFrame(dataFile.iloc[1:20,1:20].corr())
    
    plot.pcolor(corMat)
    plot.show()

  • 相关阅读:
    安卓系统浏览器中select下拉按钮无法弹出选择面板奇怪问题解决
    Webkit浏览器点击控件时出现的边框消除
    UML序列图总结
    UML序列图总结
    UML类图几种关系的总结
    UML类图几种关系的总结
    UML用例图总结
    UML用例图总结
    类与类之间的关系
    java核心技术----Object类
  • 原文地址:https://www.cnblogs.com/tszr/p/10354719.html
Copyright © 2020-2023  润新知