Question: Need answered asap!! Question 1: Study the example on creating a pandas dataframe object given in Topic 2 part A lecture notes. Create a dataframe
Need answered asap!!
Question 1:
Study the example on creating a pandas dataframe object given in Topic 2 part A lecture notes. Create a dataframe object named demo_data and store the age, employment status (employed, unemployed or retired) and zip code of three people. Print your dataframe object. Submit the notebook file (name it __HWA3Q1.ipynb) containing your code and output. Add a cell to with the answers to the following questions: How many pattern vectors are in your dataset? How many attributes or features does each input pattern have?
Question 2
The code for the steps 1-3 are given below. Your task is to fill in the rest of the code for steps 4-7, with the code for each task in a separate cell in a Jupyter notebook.
X = iris.data # store the feature data for the samples y = iris.target # store the target data # split the data using Scikit-Learn's train_test_split X_train, x_test, y_train, y_test = train_test_split(x, y) # Print the shape or dimension information for the training and test datasets print (X_train. shape) print (x_test. shape) # Create MLP model with 3 hidden layers of 8 neurons each, the 'relu' transfer function and the 'adam' optimizer (Online documentation on the MLPClassifer function
# Train the MLP model # Plot error vs. epochs during training plt. ylabel('cost') plt.xlabel('iterations') plt.title ("Learning rate =" + str(0.001)) plt.plot(mlp.loss_curve) plt.show() # Perform classifcations using the model # Evaluate the model using a confusion matrix
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
