from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import SGDClassifier
from sklearn import svm

def RandomForest(X_train, X_test, y_train):
    random_forest = RandomForestClassifier(n_estimators=100, 
                                       criterion='entropy', 
                                       max_depth=10, 
                                       min_samples_split=2,
                                       min_samples_leaf=1, 
                                       random_state=0)                              
    random_forest.fit(X_train, y_train)
    return  random_forest.predict(X_test), random_forest

def KNN(X_train, X_test, y_train):
    knn = KNeighborsClassifier(n_neighbors=5)
    knn.fit(X_train, y_train)
    return knn.predict(X_test),knn


def SVM(X_train, X_test, y_train):
    clf = svm.SVC(gamma=0.001)
    clf.fit(X_train,y_train)
    return clf.predict(X_test),clf

def DecisionTree(X_train, X_test, y_train):
    decisionTree = DecisionTreeClassifier()
    decisionTree = decisionTree.fit(X_train,y_train)
    return decisionTree.predict(X_test),decisionTree

def LogisticRegress(X_train, X_test, y_train):
    logistic = LogisticRegression()
    logistic.fit(X_train,y_train)
    return logistic.predict(X_test),logistic
