Ch 4 Regression - aswalker-lab/AIChemBiochem GitHub Wiki
In regression, we are trying to predict a continuous value from the features. Models are fit to minimize the difference between predicted and actual values.
As with classification, there are many different regression methods. We will go through some of the most common ones that are available through scikit-learn.
Linear regression is fit by minimizing the residual sum of squares.
Residual sum of squares:
This is the same as linear regression that you've learned before (e.g. fitting y=mx+b) but here we have multiple ms (
Support vector regression tries to get all predicted values within a set threshold (
Trees can act as regression models instead of classification. Instead of predicting the class, the leaf will predict the output value. The regression can be done with a single tree or multiple trees in a random forest.
Metrics for regression include mean absolute error (MAE), root mean squared error (RMSE), R2 score, and pearson's correlation. R2 score can be calculated with the formula:
Ridge and lasso penalties can help mitigate overfitting, they can be applied to any classification or regression model that uses weights (also called coefficients) and minimizes an objective function. Ridge (or l2) penalties add a sum of the squared weight terms to the objective function and lasso (or l1) penalties add a sum of the absolute values of the weight terms to the objective, in both cases they are weighted by a hyperparameter
https://colab.research.google.com/github/aswalker-lab/AIChemBiochem/blob/main/4_Regression/Regression%20for%20Chemistry.ipynb
You will need to upload the delaney dataset.
https://colab.research.google.com/github/aswalker-lab/AIChemBiochem/blob/main/4_Regression/Regression%20for%20Biochemistry.ipynb
You will need to upload the promelt dataset