pin.py 文件源码

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

项目:protein-interaction-network 作者: ericmjl 项目源码 文件源码
def encode_bond_features(self, bond_set):
        """
        We break out this function for encoding bond types because it is
        reused and occupies several lines.

        Parameters:
        ===========
        - bond_set: (set or list) of bonds.
        """
        bond_lb = LabelBinarizer()
        bond_lb.fit(BOND_TYPES)

        bonds = np.zeros(len(BOND_TYPES))
        if len(bond_set) > 0:
            bond_array = bond_lb.transform([i for i in bond_set])

            for b in bond_array:
                bonds = bonds + b

        return bonds
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号