Advertisement

sklearn降维:线性判别分析(LDA)原理Python实现流程

阅读量:
复制代码
    import pandas as pd
    
    #df = pd.read_csv('iris.data', header=None, sep=',')
    df = pd.io.parsers.read_csv(filepath_or_buffer='https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data',header=None,sep=',')
    
    feature_dict = {i:label for i,label in zip(range(4), ('sepal length', 'sepal width','petal lenth', 'petal width'))}
    df.columns = [l for i,l in sorted(feature_dict.items())] + ['class label']
    df.dropna(how = 'all', inplace = True)
    df.head()
    
    
      
      
      
      
      
      
      
      
      
    

![在这里插入图片描述](https:

全部评论 (0)

还没有任何评论哟~