I am trying to build a classifier that predicts the compiler given some operations of assembly code. Here is the pandas dataframe:
What I do is using a TfidfVectorizer and select the features that have most predictive power by doing:
max_features=500 to select the 500 features with the highest idf. The problem is that the accuracy is still low, infact it is around 0.69. I would like to arrive at least at 0.9, but I dont't know what else do.
I am using support vector machines and this gives me the accuracy of 0.69. I also tried random fores and I was around 0.75.
My code is the following:
from sklearn.feature_extraction.text import TfidfVectorizer tfidf_vectorizer=TfidfVectorizer(max_features=1000) df_x = df['opcodes'] X_all = tfidf_vectorizer_vectors=tfidf_vectorizer.fit_transform(df_x) y_all = df['compiler'] X_train, X_test, y_train, y_test = train_test_split(X_all, y_all, test_size=0.2, random_state=15) from sklearn import svm model = svm.SVC(kernel='linear', C=1).fit(X_train,y_train) y_pred = model.predict(X_test) acc = model.score(X_test, y_test) print("Accuracy %.3f" %acc)
moreover the dataset is balanced, infact I have 3 compilers with 1000 samples each.
I don't know what other startegy to try to increase accuracy and get at 0.9.
Can somebody please help me? Thank's in advance.