1
$\begingroup$

I have a list of full path of about 10,000 excel macro files. The task is to train a machine to classify which file path is Important or Not Important. The training set is labelled.

For example:

Important      c:\Somefolder\ProcessA.xlsm             
Not Important  c:\Somefolder\backup\ProcessA.xlsm
Not Important  c:\Somefolder\ProcessA_backup.xlsm      
Not Important  c:\Somefolder\ProcessA_20161004.xlsm      
Important      c:\Somefolder\ProcessB.xlsm             
Important      c:\Somefolder\OtherF.xlsm             
Not Important  c:\Somefolder\ProcessD.xlsm
Not Important  c:\Somefolder\folder1\folder2\ProcessD.xlsm  (all files under folder2 are not important)

I think it's kind of SVM with some similarity kernel. But I don't know how to do it.

The classifiers are all based on numeric input, like how many times this word appear, etc. But here it is not a document, second the order of the word in the file path are very important.

So what is the general idea in machine learning classifier that can handle this kind of task? To be more specific, do i need to apply the similar concept like bag of words to numericalize the string?

Or do i need to do something like hash the text of each component of the full path, so that it can become a number of a SVM to work? And than for the filename part, i need to tokenize it and then hash?

$\endgroup$
1

1 Answer 1

2
$\begingroup$

You can make two different kinds of features from the file names. Use BoW on the file names. The tokenizer in TFIDF is set such that it extracts each words separated by / or . or _. Remember that there should be no stop words. Try with small values of n-grams like unigram or bigram. The other feature to use will be letter tokens. This will help capture the A, B, D etc. in each file names. You'll have to use tokenizer properly. Also a longer value of n-gram might work better. If you use FeatureUnion in Pipeline then you can try different settings of transformer_weights. Finally when your features are ready try SVM with default RBF. Naive Bayes might also work fine because enough priors might be available. If you have large amount of features then try linear kernel. ~Sarah

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.