cli/streamingphish/streamingphish/features.py
def _fe_extract_tld(self, sample):
        """
        Check if TLD is in a list of ~30 TLDs indicative of phishing / not phishing. Originally,
        this was a categorical feature extended via get_dummies / one hot encoding, but it was
        adding too many unnecessary features to the feature vector resulting in a large tax
        performance wise.

        Args:
            sample (dictionary): Info about the sample being analyzed i.e. subdomain, tld, fqdn

        Returns:
            result (dictionary): Keys are feature names, values are feature scores.
        """
        result = OrderedDict()
        for item in self._tlds:
            result["tld_{}".format(item)] = 1 if item == sample['tld'] else 0

        return result

        Check if TLD is in a list of ~30 TLDs indicative of phishing / not phishing. Originally,
        this was a categorical feature extended via get_dummies / one hot encoding, but it was
        adding too many unnecessary features to the feature vector resulting in a large tax
        performance wise.

        Args:
            sample (dictionary): Info about the sample being analyzed i.e. subdomain, tld, fqdn

        Returns:
            result (dictionary): Keys are feature names, values are feature scores.
        
Check if TLD is in a list of ~30 TLDs indicative of phishing / not phishing. Originally,
this was a categorical feature extended via get_dummies / one hot encoding, but it was
adding too many unnecessary features to the feature vector resulting in a large tax
performance wise.
Check if TLD is in a list of ~30 TLDs indicative of phishing / not phishing . Originally this was a categorical feature extended via get_dummies / one hot encoding but it was adding too many unnecessary features to the feature vector resulting in a large tax performance wise .
def _fe_extract_tld(self, sample):
        result = OrderedDict()
        for item in self._tlds:
            result["tld_{}".format(item)] = 1 if item == sample['tld'] else 0
        return result
def _fe_extract_tld ( self , sample ) : result = OrderedDict ( ) for item in self . _tlds : result [ "tld_{}" . format ( item ) ] = 1 if item == sample [ 'tld' ] else 0 return result
Check if TLD is in a list of ~30 TLDs indicative of phishing / not phishing.
Check if TLD is in a list of ~30 TLDs indicative of phishing / not phishing .
"""
        Check if TLD is in a list of ~30 TLDs indicative of phishing / not phishing. Originally,
        this was a categorical feature extended via get_dummies / one hot encoding, but it was
        adding too many unnecessary features to the feature vector resulting in a large tax
        performance wise.

        Args:
            sample (dictionary): Info about the sample being analyzed i.e. subdomain, tld, fqdn

        Returns:
            result (dictionary): Keys are feature names, values are feature scores.
        """
result (dictionary): Keys are feature names, values are feature scores.
result ( dictionary ) : Keys are feature names values are feature scores .
self
sample
Info about the sample being analyzed i.e. subdomain, tld, fqdn
Info about the sample being analyzed i . e . subdomain tld fqdn