This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kafkacat \ | |
| -C \ | |
| -b localhost:9092 \ | |
| -t testTopic \ | |
| -o beginning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kafkacat \ | |
| -C \ | |
| -b localhost:9092 \ | |
| -t testTopic \ | |
| -o beginning \ | |
| -c 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kafkacat \ | |
| -C \ | |
| -b localhost:9092 \ | |
| -t testTopic \ | |
| -c 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bin/kafka-simple-consumer-shell.sh \ | |
| --bootstrap-server localhost:9092 \ | |
| --topic testTopic \ | |
| --partition 1 \ | |
| --offset 12873 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kafkacat \ | |
| -C \ | |
| -b localhost:9092 \ | |
| -t testTopic \ | |
| -o -10 \ | |
| -p 1 \ | |
| -e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kafkacat \ | |
| -C \ | |
| -b localhost:9092 \ | |
| -t testTopic \ | |
| -o 11 \ | |
| -c 10 \ | |
| -e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| scikit-learn example to fit a SVC model for recognizing images of hand-written digits. | |
| The images attribute of the dataset stores 8x8 arrays of grayscale values for each image. | |
| We will use these arrays to visualize the first 4 images. To apply a classifier on this data, | |
| we need to flatten the images, turning each 2-D array of grayscale values from | |
| shape (8, 8) into shape (64,). | |
| Reference: https://scikit-learn.org/stable/auto_examples/classification/plot_digits_classification.html | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print(f'Classes: {clf.classes_}') | |
| print(f'Class Weight: {clf.class_weight_}') | |
| print(f'Intercept: {clf.intercept_}') | |
| # Classes: [0 1 2 3 4 5 6 7 8 9] | |
| # Class Weight: [1. 1. 1. 1. 1. 1. 1. 1. 1. 1.] | |
| # Intercept: [-0.41399582 -0.34935705 -0.26415146 -0.34374548 -0.43664007 -0.15259734 | |
| # -0.29982087 -0.33727371 -0.31727775 0.16939161 0.23074142 0.12799678 | |
| # 0.09363933 0.30598209 0.13243965 0.33420154 0.20281266 0.09384162 | |
| # 0.01898659 -0.0295118 0.22687243 0.00904582 -0.02964941 0.02867172 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Predict the digits in the test data | |
| predictions = clf.predict(X_test) | |
| print(predictions) | |
| # [2 3 4 5 6 7 8 9 0 9 5 5 6 5 0 9 8 9 8 4 1 7 7 3 5 1 0 0 2 2 7 9 2 0 1 2 6 | |
| # 3 3 7 3 3 4 6 6 6 4 9 1 5 0 9 5 2 8 2 0 0 1 7 6 3 2 1 7 4 6 3 1 3 9 1 7 6 | |
| # 8 4 3 1 4 0 5 3 6 9 6 1 7 5 4 4 7 2 8 2 2 5 7 9 5 4 8 8 4 9 0 8 9 8 0 1 2 | |
| # 3 4 5 6 7 1 9 0 1 2 3 4 5 6 9 0 1 2 3 4 5 6 7 8 9 4 9 5 5 6 5 0 9 8 9 8 4 | |
| # 1 7 7 3 5 1 0 0 2 2 7 8 2 0 1 2 6 8 3 7 7 3 4 6 6 6 9 9 1 5 0 9 5 2 8 0 1 | |
| # 7 6 3 2 1 7 8 6 3 1 3 9 1 7 6 8 4 3 1 4 0 5 3 6 9 6 1 7 5 4 4 7 2 2 5 7 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sklearn.exceptions.NotFittedError: This SVC instance is not fitted yet. | |
| Call 'fit' with appropriate arguments before using this estimator. |