#!/usr/bin/env python
# coding: utf-8

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

datasets = pd.read_csv('/home/aman/kans/work_folder/malware456.csv')

Y = datasets.iloc[:, 456].values
X = datasets.iloc[:, 0:456].values

from sklearn.model_selection import train_test_split
X_Train, X_Test, Y_Train, Y_Test = train_test_split(X, Y, test_size = 0.25, random_state = 0)

from sklearn.ensemble import RandomForestClassifier
classifier = RandomForestClassifier(n_estimators = 200, criterion = 'entropy', random_state = 0)
classifier.fit(X_Train,Y_Train)

Y_Pred = classifier.predict(X_Test)

from sklearn.metrics import confusion_matrix
cm = confusion_matrix(Y_Test, Y_Pred)


from sklearn.metrics import accuracy_score
accuracy_score(Y_Test, Y_Pred)

print('Accuracy of Random Forestclassifier on training set: {:.2f}'
     .format(classifier.score(X_Train, Y_Train)))
print('Accuracy of Random Forest classifier on test set: {:.2f}'
     .format(classifier.score(X_Test, Y_Test)))





