ItAI/LS/z4
From WikiZMSI
[edytuj]
Classroom
- According to teacher's hints prepare a fake linearly-separable data set on the two-dimensional plane.
- Implement the simple perceptron as a class (again, in compliance with scikit-learn) and its learning algorithm (in the fit function). Apart from the vector of weights, memorize the number of perfomed steps of the main loop (for information purposes).
- Write a suitable predict function (with decision_function as a helper).
- Plot your data the final straight line that separates the classes (trained by the perceptron).
- Check what is the influence on the number of steps of: sample size (m), learning rate, and separation margin (gap between the classes).
[edytuj]
Homework
- Get familiar with the "Breast Cancer Wisconsin" data set present in the UCI repository.
- Download and suitably read the wdbc.data text file (to obtain X and y numpy arrays).
- Introduce in your Simple Perceptron class a parameter (k_max) that limits the number of steps of the main loop.
- Carry out multiple experiments on breast cancer data (fit, predict) and report obtained testing accuracies for: different k_max values (1k, 2k, 10k). Every reported accuracy should be an avarage taken over 10 experiments with random splits into training and testing data (proportion 75% : 25%).