11 Regression and Classification Using Neural Networks
11 Regression and Classification Using Neural Networks
618535-EPP-1-2020-1-JO-EPPKA2-CBHE-JP
Experiment Number 11
Objectives The students learn to solve regression and classification problems using neural networks.
Introduction The students continue learning to solve machine learning problems using neural networks
with Scikit-Learn and Keras.
Materials Computer with Python integrated development environment (IDE) software installed
(PyCharm is recommended).
Train the following two regressors to predict the target from the scaled features. Using
RMSE, evaluate your models on a 25%-test set, randomly selected.
1. sklearn.linear_model.LinearRegression
2. sklearn.neural_network.MLPRegressor
Your MLP model should have one hidden layer of 100 neurons.
Train the following three classifiers to predict the iris species from the four scaled features.
Evaluate the three models according to the accuracy of the predicted classes on 25%-test
set, randomly selected:
1. sklearn.linear_model.Perceptron
2. sklearn.neural_network.MLPClassifier
3. tf.keras.Sequential
Your MLP model should have two hidden layers, 10 neurons each. For the Keras classifier,
use the following parameters:
• Two hidden layers each is 100 cells.
• ReLU activation for the hidden layers.
• epochs = 100
The European Commission's support for the production of this publication does not constitute an endorsement of the contents, which reflect
the views only of the authors, and the Commission cannot be held responsible for any use which may be made of the information contained
therein.
2
Developing Curricula for Artificial Intelligence and Robotics (DeCAIR)
618535-EPP-1-2020-1-JO-EPPKA2-CBHE-JP
• validation_split = 0.25
References 1. Applied Machine Learning presentation titled “End-to-End Machine Learning Project.”
2. Applied Machine Learning presentation titled “Classification.”
3. Applied Machine Learning presentation titled “Artificial Neural Networks with Keras.”
4. Aurélien Géron, Hands-On Machine Learning with Scikit-Learn, Keras and TensorFlow,
O’Reilly, 3rd Edition, 2022.
The European Commission's support for the production of this publication does not constitute an endorsement of the contents, which reflect
the views only of the authors, and the Commission cannot be held responsible for any use which may be made of the information contained
therein.