GithubHelp home page GithubHelp logo

tdga's People

Contributors

chushuai avatar jing1128 avatar

Watchers

 avatar  avatar  avatar  avatar

tdga's Issues

添加命令行参数处理

dga_test = dga_dect('2-gram', 'svm')

from optparse import OptionParser
parser.add_option("-i", "--input",dest="input", action="store", type="string",help="input file for predict dga domains" )
parser.add_option("-o", "--output", dest="output" ,action="store", type="string",help='output file tag dag domains')
parser.add_option('-f', '--feature', dest='feature', type='choice', choices=['2-gram', '234-gram', 'charseq'], default=None, help='feature ....')
parser.add_option('-m', '--method', dest='method', type='choice', choices=['kmeans', 'mlp', 'rnn','svm'], default=None, help='method ....')
options, args = parser.parse_args()

dga_test = dga_dect(options.feature, options.method)
dga_test.predict(options.input)
outcome = pd.read_csv(options.outcome, header = True, sep = ',')
print sample(outcome, 100)

输入输出问题

结果保存到输出文件中

print label.values[0][0]

每一百条数据预测一次,增加函数def predict_domains(self, domains):

def predict(self, filepath):

修改为
class dga_dect():

def predict_domains(self, domains):
   pass
   
   
def predict(self, filepath):
   count = 0
   fp = open(filepath,"rb")
   domains = []
   for line in fp: 
     if len(domains) > 100:
	    #每100条处理一次
	    self.predict_domains(domains)
	    domains=[]
	 domains.append(line)
   #最后再处理一次 
   self.predict_domains(domains)

@Jing1128

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.