vgg16svm.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:cancer_nn 作者: tanmoyopenroot 项目源码 文件源码
def plotInputData(X, Y, title, data_len):

    time_start = time.time()   
    X = TSNE(n_components=2, verbose=1, perplexity=40, n_iter=300).fit_transform(X)
    print("After Reduction Data Shape : {0}".format(X.shape))    
    print 't-SNE done! Time elapsed: {} seconds'.format(time.time()-time_start) 

    # Main scatter plot and plot annotation
    f, ax = plt.subplots(figsize=(7, 7))
    ax.scatter(X[:data_len / 2, 0] * 10, X[:data_len / 2, 1] * 10, marker = 'o', color = 'green', s=30, alpha=0.5)
    ax.scatter(X[data_len / 2:, 0] * 10, X[data_len / 2:, 1] * 10, marker = '^', color = 'blue', s=30, alpha=0.5)
    plt.legend(["Melanoma", "Benign"], loc='upper right') 
    plt.title(title)
    plt.ylabel('Y')
    plt.xlabel('X')

    # plt.scatter(X[:, 0], X[:, 1], c=Y, cmap=plt.cm.Paired)
    # plt.xlabel('X')
    # plt.ylabel('Y')
    # plt.title('SVC Data Plot')
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号