예제 #1
0
def tsne_layout(ndf, ldf, plot=True):
    ## add tsne-layout coordinates and draw
    bn.add_layout(ndf, linksdf=ldf, nw=None)
    ndf.rename(columns={"x": "x_tsne", "y": "y_tsne"}, inplace=True)
    if plot:
        bn.draw_network_categorical(nw,
                                    ndf,
                                    node_attr="keyword_theme",
                                    x='x_tsne',
                                    y='y_tsne',
                                    plotfile="network_tsne.pdf")
    return ndf
예제 #2
0
def tsne_layout(ndf, ldf):
    ## add tsne-layout coordinates and draw
    # dependency: https://github.com/foodwebster/Tag2Network
    bn.add_layout(ndf, linksdf=ldf, nw=None)
    ndf.rename(columns={"x": "x_tsne", "y": "y_tsne"}, inplace=True)
    return ndf