小编Ano*_*ym6的帖子

t-SNE:Sklearn AttributeError:“NoneType”对象没有属性“split”

对以下错误有帮助吗?我正在运行 PCA 和 t-SNE,PCA 似乎运行良好,但无论我在哪里运行 t-SNE,都会遇到以下错误。我的 t-SNE 代码如下:

def T_SNE(X,Label,Component=2,title=""):

    tsne = TSNE(n_components=Component)

    tsne_result = tsne.fit_transform(X)
   
    tsne_result_df = pd.DataFrame({'T_SNE_1': tsne_result[:,0], 'T_SNE_2': tsne_result[:,1], 
                                   'label': Label})
    lim = (tsne_result.min()-0.1*tsne_result.min(), tsne_result.max()+0.1*tsne_result.min())
    
    PLOT(TITLE=title,Product="T_SNE",Label=Label,Data=tsne_result_df,lim=lim)

    return tsne_result,tsne
    

result,tsne=T_SNE(X=X_Number,Label=Y_Number,Component=2,title="Digit_data")
Run Code Online (Sandbox Code Playgroud)

以下错误

AttributeError: 'NoneType' object has no attribute 'split'
Run Code Online (Sandbox Code Playgroud)

python nonetype scikit-learn

5
推荐指数
2
解决办法
2042
查看次数

标签 统计

nonetype ×1

python ×1

scikit-learn ×1