MACHINE LEARNING RECIPES
# How to use Regression Metrics in Python?

# How to use Regression Metrics in Python?

This recipe helps you use Regression Metrics in Python

In [1]:

```
## How to use Regression Metrics in Python
## DataSet: skleran.load_boston()
def Snippet_182():
print()
print(format('How to use Regression Metrics in Python','*^82'))
import warnings
warnings.filterwarnings("ignore")
# load libraries
from sklearn import datasets
from sklearn import tree, model_selection
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
plt.style.use('ggplot')
# load the iris datasets
seed = 42
dataset = datasets.load_boston()
X = dataset.data; y = dataset.target
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25)
kfold = model_selection.KFold(n_splits=10, random_state=seed)
# fit a tree.DecisionTreeClassifier() model to the data
model = tree.DecisionTreeRegressor()
# metrics -> Mean Absolute Error
scoring = 'neg_mean_absolute_error'
results = model_selection.cross_val_score(model, X_train, y_train, cv=kfold, scoring=scoring)
print(); print("Mean Absolute Error: ", results.mean()); print("Standard Deviation: ", results.std())
# metrics -> Mean Squred Error
scoring = 'neg_mean_squared_error'
results = model_selection.cross_val_score(model, X_train, y_train, cv=kfold, scoring=scoring)
print(); print("Mean Squared Error: ", results.mean()); print("Standard Deviation: ", results.std())
# metrics -> R squared
scoring = 'r2'
results = model_selection.cross_val_score(model, X_train, y_train, cv=kfold, scoring=scoring)
print(); print("R squared val: ", results.mean()); print("Standard Deviation: ", results.std())
Snippet_182()
```

In this project, we are going to talk about H2O and functionality in terms of building Machine Learning models.

In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

This data science in python project predicts if a loan should be given to an applicant or not. We predict if the customer is eligible for loan based on several factors like credit score and past history.

In this deep learning project, we will predict customer churn using Artificial Neural Networks and learn how to model an ANN in R with the keras deep learning package.

Machine Learning Project in R-Detect fraudulent click traffic for mobile app ads using R data science programming language.

In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Datasetâ€‹ using Keras in Python.

Machine Learning Project - Work with KKBOX's Music Recommendation System dataset to build the best music recommendation engine.

There are different time series forecasting methods to forecast stock price, demand etc. In this machine learning project, you will learn to determine which forecasting method to be used when and how to apply with time series forecasting example.

Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

This project analyzes a dataset containing ecommerce product reviews. The goal is to use machine learning models to perform sentiment analysis on product reviews and rank them based on relevance. Reviews play a key role in product recommendation systems.