: import pandas as pd file_path='/Users//Downloads/Data 2/ExampleTrainDataset.csv' filepath2 = '/Users//Downloads/Data data = pd.read_csv(file_path) data2 = pd.read_csv(filepath2) 2/ExampleTestDataset.csv' print(data) print(data2) x1 x2 x3 Y 012345678 2 3.0 2 0 2 3.0 4 0 2 3 9.0 1 0 3 1 0.5 2 0 4 2.0 1 0 5 7 2.0 1 1 3 2.0 5 1 5 2.0 2 1 8 2 4.0 3 1 2 226 11234 9 3 2.0 0 x1 1 1 x2 x3 Y 2 6 3 7 4 3 32243 3 1 0 2 4 0 2 2 1 4 3 31 3 1 1 1

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter14: Files And Streams
Section: Chapter Questions
Problem 2CP: In Chapter 11, you created the most recent version of the MarshallsRevenue program, which prompts...
icon
Related questions
Question


a):  Implement a single perceptron to learn/train from
“ExampleTrainDataset.csv“.
- Use squared error as the loss function.
- Implement batch-based learning (i.e, accumulate loss for all samples in
each iteration, and update weights once at the end)
- Use sigmoid activation function for the perceptron. Learning rate = 0.01
- Perform 50 iterations of learning.
- Plot a graph of training Loss with respect to iterations. Include this graph in
your report with the final weight vector.

a): Using the trained perceptron, perform predictions on
“ExampleTestDataset.csv” and report the test loss.

: import pandas as pd
file_path='/Users//Downloads/Data 2/ExampleTrainDataset.csv'
filepath2 = '/Users//Downloads/Data
data = pd.read_csv(file_path)
data2 = pd.read_csv(filepath2)
2/ExampleTestDataset.csv'
print(data)
print(data2)
x1 x2 x3 Y
012345678
2
3.0
2 0
2
3.0
4
0
2
3 9.0
1
0
3 1 0.5
2
0
4
2.0
1
0
5
7
2.0
1
1
3
2.0
5
1
5
2.0
2
1
8 2 4.0
3
1
2
226
11234
9 3 2.0
0
x1
1 1
x2
x3 Y
2
6
3 7
4 3
32243
3 1 0
2
4 0
2
2 1
4
3
31
3 1
1 1
Transcribed Image Text:: import pandas as pd file_path='/Users//Downloads/Data 2/ExampleTrainDataset.csv' filepath2 = '/Users//Downloads/Data data = pd.read_csv(file_path) data2 = pd.read_csv(filepath2) 2/ExampleTestDataset.csv' print(data) print(data2) x1 x2 x3 Y 012345678 2 3.0 2 0 2 3.0 4 0 2 3 9.0 1 0 3 1 0.5 2 0 4 2.0 1 0 5 7 2.0 1 1 3 2.0 5 1 5 2.0 2 1 8 2 4.0 3 1 2 226 11234 9 3 2.0 0 x1 1 1 x2 x3 Y 2 6 3 7 4 3 32243 3 1 0 2 4 0 2 2 1 4 3 31 3 1 1 1
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage