# Lists few of the popular Machine learning regression models and the code snippets for processing 
# Assumption: Input is an numpy array of X_train, y_train
# To Predict: X_test
#------------------------------------------------------------------------------------------------


#
# Linear Model 
#
from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
regressor.fit(X_train,y_train)
y_pred = regressor.predict(X_test)

#
# Logistic regression # (Action taken Y/N) - 0 or 1 to be predicted
# Uses sigmoid function
#
from sklearn.linear_model import LogisticRegression
regressor = LogisticRegression(random_state=0)
regressor.fit(X_train,y_train)
y_pred = regressor.predict(X_test)

#
# Polynomial Regression 
#
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import LinearRegression
regressor=make_pipeline(PolynomialFeatures(degree=4),LinearRegression())
regressor.fit(X_train,y_train)
y_pred = regressor.predict(X_test)
#
# Decision Tree 
#
from sklearn.tree import DecisionTreeRegressor
regressor = DecisonTreeRegressor(random_state=0)
regressor.fit(X_train,y_train)
y_pred = regressor.predict(X_test)

#
# Random Forest 
# Pick K random data points, N different trees - average the prediction
#
from sklearn.ensemble import RandomForestRegressor
regressor = RandomForestRegressor(n_estimators=10,random_state=0)
regressor.fit(X_train,y_train)
y_pred = regressor.predict(X_test)

#
# Support Vector #
# polynomial, linear,gaussian, sigmoid
#
from sklearn.svm import SVR
regressor = SVR(kernel='rbf') 
regressor.fit(X_train,y_train)
y_pred = regressor.predict(X_test)
