├── LICENSE ├── Machine learning & Deep learning ├── AI Agents │ ├── Caller AI Agent │ │ ├── README.md │ │ ├── main.py │ │ └── requirements.txt │ └── README.md ├── Computer Vision │ ├── Face-detection-and-attendence marking system │ │ ├── LICENSE │ │ ├── README.md │ │ ├── encode_faces.py │ │ └── recognize_faces_video_file.py │ ├── Images Noise reduction by cycle gan │ │ ├── README.MD │ │ ├── Results │ │ │ └── rsult │ │ ├── Results │ │ │ ├── AtoB_generated_plot_025000.png │ │ │ ├── BtoA_generated_plot_025000.png │ │ │ ├── Model_architechure.png │ │ │ ├── atob.JPG │ │ │ └── btoa.JPG │ │ └── cycleganforscope.ipynb │ ├── Read me │ └── T-shirts and dress shirts Images CLassification from Fashion MNIST │ │ ├── Dataset.zip │ │ ├── Output │ │ └── myPredictions.csv │ │ ├── README.md │ │ ├── cross-validation code.ipynb │ │ ├── model │ │ ├── RandomforestForMinist.pkl │ │ └── myPredictions.csv │ │ ├── test.ipynb │ │ └── training.ipynb ├── Cyber security with AI │ ├── DDoS Attack Classification │ │ ├── README.md │ │ ├── data │ │ │ └── DDos.csv │ │ └── main_file.ipynb │ ├── Detect AI-Generated Phishing Emails with BERT │ │ ├── Phishing detection.ipynb │ │ ├── Presentation.pptx │ │ ├── README.md │ │ └── Read.md │ ├── Malware-detection-with-ML-and-deep-learning-main │ │ ├── MalwareData.zip │ │ ├── README.md │ │ └── malware detection and classification.ipynb │ └── read me ├── Natural language processing │ └── Sentiment analysis with twitter tweet │ │ └── Sentiment analysis with twitter tweets │ │ ├── README.md │ │ └── Sentiment Analysis project.ipynb ├── Predictive Modelling │ ├── Heart disease prediction by voting algorithms │ │ ├── Data │ │ │ ├── Selected_test_data.csv │ │ │ ├── X_Train.csv │ │ │ ├── X_test.csv │ │ │ └── Y_train.csv │ │ ├── Output │ │ │ └── Output predictions.csv │ │ ├── README.md │ │ └── Testing.ipynb │ └── read me ├── Read me └── Time Series │ └── Read me ├── Python programming └── Read.MD └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/AI Agents/Caller AI Agent/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/AI Agents/Caller AI Agent/main.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, request 2 | from twilio.twiml.voice_response import VoiceResponse 3 | 4 | app = Flask(__name__) 5 | 6 | 7 | @app.route('/') 8 | def home(): 9 | return "Hello! Your Flask app is running." 10 | 11 | @app.route("/voice", methods=['POST']) 12 | def voice(): 13 | response = VoiceResponse() 14 | response.say("Hello! This is your AI voice assistant.") 15 | response.pause(length=1) 16 | response.say("How can I help you today? ") 17 | return str(response) 18 | 19 | if __name__ == "__main__": 20 | app.run(debug=True) 21 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/AI Agents/Caller AI Agent/requirements.txt: -------------------------------------------------------------------------------- 1 | # Web framework 2 | flask==2.2.5 3 | 4 | # Telephony Integration (e.g., Twilio) 5 | twilio==8.10.1 6 | 7 | # Real-time tunneling for local dev 8 | pyngrok==5.3.0 9 | 10 | # HTTP requests 11 | requests==2.31.0 12 | 13 | # For handling environment variables 14 | python-dotenv==1.0.1 15 | 16 | # For Speech Recognition (if using local ASR like Whisper) 17 | whisper==1.1.10 18 | torchaudio==2.2.0 19 | torch==2.2.0 20 | 21 | # For Text-to-Speech (optional: local TTS) 22 | TTS==0.22.0 # Coqui TTS for local voice synthesis 23 | 24 | # For OpenAI GPT Integration (or Claude etc.) 25 | openai==1.14.3 26 | 27 | # Optional: FastAPI (if you want async backend instead of Flask) 28 | fastapi==0.110.0 29 | uvicorn==0.29.0 30 | 31 | # Optional: For data handling, caching 32 | redis==5.0.1 33 | pandas==2.2.2 34 | 35 | # Optional: WebSocket for real-time interactions 36 | websockets==12.0 37 | 38 | # Optional: Guardrails for AI 39 | guardrails-ai==0.4.0 40 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/AI Agents/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Face-detection-and-attendence marking system/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Face-detection-and-attendence marking system/README.md: -------------------------------------------------------------------------------- 1 | # Face Recognition in Video Files 2 | 3 | ## Overview 4 | This project demonstrates a face recognition system that processes video files to detect and recognize faces using pre-trained facial encodings. The system takes an input video, processes each frame to identify faces, and outputs a video with the recognized faces labeled. 5 | 6 | ## Features 7 | - Detects faces in video frames using the `face_recognition` library. 8 | - Recognizes and labels known faces using pre-trained facial encodings. 9 | - Outputs a processed video with bounding boxes and names around recognized faces. 10 | - Optionally displays the video frames in real-time during processing. 11 | 12 | ## Requirements 13 | - Python 3.x 14 | - OpenCV 15 | - face_recognition 16 | - imutils 17 | - argparse 18 | - pickle 19 | 20 | ## Usage 21 | To run the face recognition system on a video file, use the following command: 22 | 23 | python recognize_faces_video_file.py --encodings encodings.pickle --input {path to input video} --output {path to output video} --display 0 24 | 25 | ### Arguments 26 | --encodings: Path to the serialized database of facial encodings. 27 | --input: Path to the input video file. 28 | --output: Path to the output video file. 29 | --display: Whether or not to display the output frame to the screen (1 to display, 0 to not display). 30 | --detection-method: Face detection model to use: either hog or cnn (default: cnn). 31 | ## Project Structure 32 | recognize_faces_video_file.py: The main script to run the face recognition system. 33 | encodings.pickle: A serialized file containing pre-trained facial encodings. 34 | Example 35 | To run the face recognition on a sample video, you might use: 36 | 37 | python recognize_faces_video_file.py --encodings encodings.pickle --input sample_video.avi --output output_video.avi --display 1 38 | 39 | ### How It Works 40 | Loading Encodings: The script loads the known facial encodings from a pickle file. 41 | Processing Video: It processes the input video frame by frame. 42 | Face Detection and Recognition: For each frame, it detects faces and compares them against the known encodings. 43 | Annotating Frames: Recognized faces are labeled, and bounding boxes are drawn around them. 44 | Output: The processed video is written to the specified output file, and optionally displayed in real-time. 45 | Contributing 46 | Contributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a pull request. 47 | 48 | ### License 49 | This project is licensed under the MIT License. See the LICENSE file for more details. 50 | 51 | 52 | This format should make it easy for users to understand the purpose and functionality of your project, as well as how to set it up and run it. 53 | 54 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Face-detection-and-attendence marking system/encode_faces.py: -------------------------------------------------------------------------------- 1 | # import the necessary packages 2 | from imutils import paths 3 | import face_recognition 4 | import argparse 5 | import pickle 6 | import cv2 7 | import os 8 | 9 | # construct the argument parser and parse the arguments 10 | ap = argparse.ArgumentParser() 11 | ap.add_argument("-i", "--dataset", required=True, 12 | help="path to input directory of faces + images") 13 | ap.add_argument("-e", "--encodings", required=True, 14 | help="path to serialized db of facial encodings") 15 | ap.add_argument("-d", "--detection-method", type=str, default="cnn", 16 | help="face detection model to use: either `hog` or `cnn`") 17 | args = vars(ap.parse_args()) 18 | 19 | # grab the paths to the input images in our dataset 20 | print("[INFO] quantifying faces...") 21 | imagePaths = list(paths.list_images(args["dataset"])) 22 | 23 | # initialize the list of known encodings and known names 24 | knownEncodings = [] 25 | knownNames = [] 26 | 27 | # loop over the image paths 28 | for (i, imagePath) in enumerate(imagePaths): 29 | # extract the person name from the image path 30 | print("[INFO] processing image {}/{}".format(i + 1, 31 | len(imagePaths))) 32 | name = imagePath.split(os.path.sep)[-2] 33 | 34 | # load the input image and convert it from RGB (OpenCV ordering) 35 | # to dlib ordering (RGB) 36 | image = cv2.imread(imagePath) 37 | rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) 38 | 39 | # detect the (x, y)-coordinates of the bounding boxes 40 | # corresponding to each face in the input image 41 | boxes = face_recognition.face_locations(rgb, 42 | model=args["detection_method"]) 43 | 44 | # compute the facial embedding for the face 45 | encodings = face_recognition.face_encodings(rgb, boxes) 46 | 47 | # loop over the encodings 48 | for encoding in encodings: 49 | # add each encoding + name to our set of known names and 50 | # encodings 51 | knownEncodings.append(encoding) 52 | knownNames.append(name) 53 | 54 | # dump the facial encodings + names to disk 55 | print("[INFO] serializing encodings...") 56 | data = {"encodings": knownEncodings, "names": knownNames} 57 | f = open(args["encodings"], "wb") 58 | f.write(pickle.dumps(data)) 59 | f.close() 60 | 61 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Face-detection-and-attendence marking system/recognize_faces_video_file.py: -------------------------------------------------------------------------------- 1 | 2 | # python recognize_faces_video_file.py --encodings encodings.pickle --input {directory of input video}--output {directory of output with name and avi extension} --display 0 3 | 4 | # import the necessary packages 5 | from imutils.video import VideoStream 6 | import face_recognition 7 | import argparse 8 | import imutils 9 | import pickle 10 | import time 11 | import cv2 12 | import os 13 | 14 | # construct the argument parser and parse the arguments 15 | ap = argparse.ArgumentParser() 16 | ap.add_argument("-e", "--encodings", required=True, 17 | help="path to serialized db of facial encodings") 18 | ap.add_argument("-i", "--input", required=True, 19 | help="path to input video") 20 | ap.add_argument("-o", "--output", required=True, 21 | help="path to output video") 22 | ap.add_argument("-y", "--display", type=int, default=1, 23 | help="whether or not to display output frame to screen") 24 | ap.add_argument("-d", "--detection-method", type=str, default="cnn", 25 | help="face detection model to use: either `hog` or `cnn`") 26 | args = vars(ap.parse_args()) 27 | 28 | # load the known faces and embeddings 29 | print("[INFO] loading encodings...") 30 | data = pickle.loads(open(args["encodings"], "rb").read()) 31 | 32 | # initialize the pointer to the video file and the video writer 33 | print("[INFO] processing video...") 34 | stream = cv2.VideoCapture(args["input"]) 35 | writer = None 36 | 37 | # loop over frames from the video file stream 38 | while True: 39 | # grab the next frame 40 | (grabbed, frame) = stream.read() 41 | 42 | # if the frame was not grabbed, then we have reached the 43 | # end of the stream 44 | if not grabbed: 45 | break 46 | 47 | # convert the input frame from BGR to RGB then resize it to have 48 | # a width of 750px (to speedup processing) 49 | rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) 50 | rgb = imutils.resize(frame, width=750) 51 | r = frame.shape[1] / float(rgb.shape[1]) 52 | 53 | # detect the (x, y)-coordinates of the bounding boxes 54 | # corresponding to each face in the input frame, then compute 55 | # the facial embeddings for each face 56 | boxes = face_recognition.face_locations(rgb, 57 | model=args["detection_method"]) 58 | encodings = face_recognition.face_encodings(rgb, boxes) 59 | 60 | # initialize the list of names for each face detected 61 | names = [] 62 | 63 | # loop over the facial embeddings 64 | for encoding in encodings: 65 | # attempt to match each face in the input image to our known 66 | # encodings 67 | matches = face_recognition.compare_faces(data["encodings"], 68 | encoding) 69 | name = "Unknown" 70 | 71 | # check to see if we have found a match 72 | if True in matches: 73 | # find the indexes of all matched faces then initialize a 74 | # dictionary to count the total number of times each face 75 | # was matched 76 | matchedIdxs = [i for (i, b) in enumerate(matches) if b] 77 | counts = {} 78 | 79 | # loop over the matched indexes and maintain a count for 80 | # each recognized face face 81 | for i in matchedIdxs: 82 | name = data["names"][i] 83 | counts[name] = counts.get(name, 0) + 1 84 | 85 | # determine the recognized face with the largest number 86 | # of votes (note: in the event of an unlikely tie Python 87 | # will select first entry in the dictionary) 88 | name = max(counts, key=counts.get) 89 | 90 | # update the list of names 91 | names.append(name) 92 | 93 | # loop over the recognized faces 94 | for ((top, right, bottom, left), name) in zip(boxes, names): 95 | # rescale the face coordinates 96 | top = int(top * r) 97 | right = int(right * r) 98 | bottom = int(bottom * r) 99 | left = int(left * r) 100 | 101 | # draw the predicted face name on the image 102 | cv2.rectangle(frame, (left, top), (right, bottom), (0, 255, 0), 2) 103 | y = top - 15 if top - 15 > 15 else top + 15 104 | cv2.putText(frame, name, (left, y), cv2.FONT_HERSHEY_SIMPLEX,0.75, (0, 255, 0), 2) 105 | 106 | # if the video writer is None *AND* we are supposed to write 107 | # the output video to disk initialize the writer 108 | if writer is None and args["output"] is not None: 109 | fourcc = cv2.VideoWriter_fourcc(*"MJPG") 110 | writer = cv2.VideoWriter(args["output"], fourcc, 24, 111 | (frame.shape[1], frame.shape[0]), True) 112 | 113 | # if the writer is not None, write the frame with recognized 114 | # faces t odisk 115 | if writer is not None: 116 | writer.write(frame) 117 | 118 | # check to see if we are supposed to display the output frame to 119 | # the screen 120 | if args["display"] > 0: 121 | cv2.imshow("Frame", frame) 122 | key = cv2.waitKey(1) & 0xFF 123 | 124 | # if the `q` key was pressed, break from the loop 125 | if key == ord("q"): 126 | break 127 | 128 | # do a bit of cleanup 129 | cv2.destroyAllWindows() 130 | stream.stop() 131 | 132 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/README.MD: -------------------------------------------------------------------------------- 1 | ## Implement CycleGAN for converting poor-quality images of Specular/ confocal microscopy into good quality 2 | 3 | 4 | ### Project background: 5 | The critical business problem addressed by this project is the enhancement of low-quality corneal endothelium images obtained from specular and confocal microscopy. These images often suffer from blurring effects or uneven intensity, which hinders automated screening, assessment, and diagnosis. By improving the quality of these images, the project aims to assist eye practitioners in better understanding and analyzing the corneal endothelium layer, potentially leading to more accurate diagnostics and treatment plans. 6 | 7 | Dataset: https://github.com/daboe01/SREP-18-33533B 8 | ### Preprocessing Steps: 9 | 1. **Separating Images**: 10 | - The dataset includes both good and bad images, with labels provided in an Excel file. 11 | - Using SQL, the bad images are separated and moved to a different folder. 12 | 13 | 2. **Cropping Images**: 14 | - The black boundaries around the images are removed to facilitate better data augmentation. 15 | 16 | 3. **Image Augmentation**: 17 | - Data augmentation techniques (e.g., rotation, width shift, height shift, zoom, and horizontal flip) are applied to increase the dataset size. 18 | 19 | 4. **Loading and Converting Images to Arrays**: 20 | - Images are loaded and converted to numpy arrays, and then saved in a compressed file format. 21 | 22 | ![Alt Text](./Results/Model_architechure.png) 23 | 24 | ### Model Training: 25 | 1. **CycleGAN Architecture**: 26 | - **Discriminator**: Uses InstanceNormalization instead of BatchNormalization. 27 | - **Generator**: An encoder-decoder model with ResNet blocks, which takes an input image, generates a target image, and reconstructs the original image using skip connections. 28 | 29 | 2. **Composite Model**: 30 | - Combines the generator and discriminator models for both directions (A->B and B->A). 31 | - Uses adversarial and cycle consistency losses for training. 32 | 33 | 3. **Training Process**: 34 | - The model is trained over multiple epochs with batches of real and fake samples. 35 | - Discriminator and generator losses are calculated and updated iteratively. 36 | - Performance is periodically summarized by generating and saving images. 37 | 38 | ### Evaluation Steps: 39 | 1. **Loading Trained Models**: 40 | - Pre-trained models are loaded for evaluation. 41 | 42 | 2. **Generating and Plotting Images**: 43 | - Real, generated, and reconstructed images are selected and plotted to visually assess the quality of the image enhancement. 44 | 45 | 46 | 47 | ![Alt Text](./Results/atob.JPG) 48 | 49 | 50 | 51 | ### Summary: 52 | This project uses CycleGAN to improve low-quality corneal endothelium images by transforming them into high-quality images without requiring paired datasets. The preprocessing includes separating, cropping, and augmenting images. The model training involves a complex CycleGAN architecture with adversarial and cycle consistency losses. Evaluation involves visual assessment of generated and reconstructed images, showing promising results for better understanding and diagnosis of corneal endothelium. 53 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results /rsult: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/AtoB_generated_plot_025000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/AtoB_generated_plot_025000.png -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/BtoA_generated_plot_025000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/BtoA_generated_plot_025000.png -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/Model_architechure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/Model_architechure.png -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/atob.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/atob.JPG -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/btoa.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/Results/btoa.JPG -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Images Noise reduction by cycle gan/cycleganforscope.ipynb: -------------------------------------------------------------------------------- 1 | {"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":3036702,"sourceType":"datasetVersion","datasetId":1859793},{"sourceId":3038649,"sourceType":"datasetVersion","datasetId":1861034},{"sourceId":3050058,"sourceType":"datasetVersion","datasetId":1867656}],"dockerImageVersionId":30154,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Microscope images improvement by Cycle GAN","metadata":{}},{"cell_type":"markdown","source":"-\n-\n### Importing Libraries\n-\n-","metadata":{}},{"cell_type":"code","source":"!pip install git+https://www.github.com/keras-team/keras-contrib.git\nimport tensorflow as tf\nfrom tensorflow import keras \nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom os import listdir\nfrom numpy import vstack\nfrom numpy import asarray\nfrom tensorflow.keras.preprocessing.image import load_img,img_to_array, array_to_img,ImageDataGenerator\nfrom numpy import savez_compressed\nfrom numpy import load\n\n# example of training a cyclegan on the horse2zebra dataset\nfrom random import random\nfrom numpy import zeros\nfrom numpy import ones\nfrom numpy.random import randint\nfrom tensorflow.keras.optimizers import Adam\nfrom tensorflow.keras.initializers import RandomNormal\nfrom tensorflow.keras.models import Model\nfrom keras.models import Input\nfrom tensorflow.keras.layers import Conv2D\nfrom tensorflow.keras.layers import Conv2DTranspose\nfrom tensorflow.keras.layers import LeakyReLU\nfrom tensorflow.keras.layers import Activation\nfrom tensorflow.keras.layers import Concatenate\nfrom keras_contrib.layers.normalization.instancenormalization import InstanceNormalization\nfrom matplotlib import pyplot\n\n# Importing Image class from PIL module\nfrom PIL import Image","metadata":{"execution":{"iopub.status.busy":"2022-01-16T23:38:46.898234Z","iopub.execute_input":"2022-01-16T23:38:46.898836Z","iopub.status.idle":"2022-01-16T23:39:07.900097Z","shell.execute_reply.started":"2022-01-16T23:38:46.898713Z","shell.execute_reply":"2022-01-16T23:39:07.899239Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"-\n-\n### Data Preprocessing\n-\n-","metadata":{}},{"cell_type":"markdown","source":"#### A) Separating the bad and good images\nThe dataset of images contains mix images of bad and good and the labels are mentioned in Excel file for each image whether it is good or bad. I use sql to read and separate the bad images records from the good one and store in separate file.\nThe below code takes the bad image name from the file and find it in image folder. if it finds the image there, it simply move that image into another folder. this is how it is separating the images.","metadata":{}},{"cell_type":"code","source":"# Importing and cleaning dataset\nimport csv\nimport pandas as pd\nimport openpyxl \nimport shutil\n\nimport os\nj=0\nk=0\n\npath='D:/Masters/Machine Learning/scopeImage/images/'\n\ndf=pd.read_csv('D:/Masters/Machine Learning/scopeImage/Bad_final_csv.csv')\nnames =df['filenaame'].unique()\nfor i in names:\n listOfFile = os.listdir(path)\n if i in listOfFile:\n j+=1\n shutil.move(path+i, 'D:/Masters/Machine Learning/scopeImage/TrainA')\n else:\n k+=1\n \n \nprint(\"Good files moved =\",j) \nprint(\"files not found =\",k) ","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### B) Crop images \n\nAs each image boundires are black, showing that some one has edit them in a good way. so i need to remove those black boundries in order to have better data augumentations \n","metadata":{}},{"cell_type":"code","source":"\n\ndef image_crop(image):\n# Opens a image in RGB mode\n im = image\n \n # Setting the points for cropped image\n left = 10\n top = 10\n right = 768\n bottom = 500\n \n # Cropped image of above dimension\n # (It will not change original image)\n im1 = im.crop((left, top, right, bottom))\n return im1\n","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### C) Loading and Image Augumentation \n\nNow i will load the images and perform data augmentation on them to increase the size of dataset.","metadata":{}},{"cell_type":"code","source":"datagen = ImageDataGenerator(\n rotation_range=90,\n width_shift_range=0.2,\n height_shift_range=0.2,\n #shear_range=0.15,\n zoom_range=0.15,\n horizontal_flip=True,\n fill_mode='wrap')\n\ndef load_images_Augumentation(path,path_destination,im_prefix,batch_size, size=(256,256)):\n for filename in listdir(path):\n pixels=load_img(path+filename) #, target_size=size\n\n img =image_crop(pixels)\n x = img_to_array(img) # this is a Numpy array with shape (3, 150, 150)\n x = x.reshape((1,) + x.shape) # this is a Numpy array with shape (1, 3, 150, 150)\n i = 0\n for batch in datagen.flow(x, batch_size=1,\n save_to_dir=path_destination, save_prefix=im_prefix, save_format='jpg'):\n i += 1\n if i > batch_size:\n break # otherwise the generator would loop indefinitely\n \n","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"path='D:/Masters/Machine Learning/scopeImage/'\n\nload_images_Augumentation(path+'bad/',path+'trainBad/','low',10 )\nload_images_Augumentation(path+ 'good/', path+'trainGood/', 'high',4)","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### D) Loading images into notebook and then convert to array\n\nNow its time to load all images and convert them into array for futher model building","metadata":{}},{"cell_type":"code","source":"def load_images(path, size=(256,256)):\n data_list=list()\n for filename in listdir(path):\n pixels=load_img(path+filename, target_size=size)\n pixels=img_to_array(pixels)\n data_list.append(pixels)\n return asarray(data_list)","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Data main path\npath='D:/Masters/Machine Learning/scopeImage/'\ndataA=load_images(path+'trainBad/')\n\nprint(\"The shape of not good images :\", dataA.shape)\n\ndataB=load_images(path+\"trainGood/\")\n\nprint(\"The Shape of the good images:\", dataB.shape)\n","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"filename = 'microscope_for_corena.npz'\nsavez_compressed(path +filename, dataA, dataB)\nprint('Saved dataset: ', filename)","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Now plotting the Images from npz compressed file","metadata":{}},{"cell_type":"code","source":"path='../input/microscope-500-128x128/'\nfilename = 'microscope_500_128x128.npz'\ndata= load(path+filename)\ndataA,dataB=data['arr_0'],data['arr_1']","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:16.403401Z","iopub.execute_input":"2022-01-13T11:31:16.403813Z","iopub.status.idle":"2022-01-13T11:31:17.378307Z","shell.execute_reply.started":"2022-01-13T11:31:16.403763Z","shell.execute_reply":"2022-01-13T11:31:17.377507Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = plt.figure(figsize=(15, 15))\nfig.add_subplot(3, 3, 1)\n\nplt.imshow(dataA[1].astype('uint8'))\nplt.title(\"Not Good\")\nfig.add_subplot(3, 3, 2)\nplt.imshow(dataA[100].astype('uint8'))\nplt.title(\"Not Good\")\nfig.add_subplot(3, 3, 3)\nplt.imshow(dataA[50].astype('uint8'))\nplt.title(\"Not Good\")\n\n","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:17.379993Z","iopub.execute_input":"2022-01-13T11:31:17.380287Z","iopub.status.idle":"2022-01-13T11:31:17.912498Z","shell.execute_reply.started":"2022-01-13T11:31:17.380252Z","shell.execute_reply":"2022-01-13T11:31:17.911881Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig = plt.figure(figsize=(15, 15))\nfig.add_subplot(1, 3, 1)\nplt.imshow(dataB[1].astype('uint8'))\nplt.title(\"Good\")\n\nfig.add_subplot(1, 3, 2)\nplt.imshow(dataB[100].astype('uint8'))\nplt.title(\"Good\")\n\nfig.add_subplot(1, 3, 3)\nplt.imshow(dataB[400].astype('uint8'))\nplt.title(\"Good\")","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:17.913918Z","iopub.execute_input":"2022-01-13T11:31:17.914403Z","iopub.status.idle":"2022-01-13T11:31:18.459827Z","shell.execute_reply.started":"2022-01-13T11:31:17.914366Z","shell.execute_reply":"2022-01-13T11:31:18.459206Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Creating Cycle GAN Model","metadata":{}},{"cell_type":"markdown","source":"#### Storing Key point\nThe CycleGAN discriminator uses InstanceNormalization instead of BatchNormalization.","metadata":{}},{"cell_type":"code","source":"# Discriminator\n\ndef define_discriminator(image_shape):\n init=RandomNormal(stddev=0.05)\n in_image=Input(shape=image_shape)\n add=Conv2D(64,(4,4),strides=(2,2),padding='same',kernel_initializer=init)(in_image)\n add=LeakyReLU(alpha=0.2)(add)\n \n #layer 2\n add=Conv2D(128, (4,4),strides=(2,2),padding='same',kernel_initializer=init)(add)\n add=InstanceNormalization(axis=-1)(add)\n add=LeakyReLU(alpha=0.2)(add)\n \n add=Conv2D(256, (4,4),strides=(2,2),padding='same',kernel_initializer=init)(add)\n add=InstanceNormalization(axis=-1)(add)\n add=LeakyReLU(alpha=0.2)(add)\n \n add=Conv2D(512, (4,4),strides=(2,2),padding='same',kernel_initializer=init)(add)\n add=InstanceNormalization(axis=-1)(add)\n add=LeakyReLU(alpha=0.2)(add)\n \n add=Conv2D(512, (4,4),strides=(2,2),padding='same',kernel_initializer=init)(add)\n add=InstanceNormalization(axis=-1)(add)\n add=LeakyReLU(alpha=0.2)(add)\n \n patch_output=Conv2D(1, (4,4),padding='same',kernel_initializer=init)(add)\n \n model= Model(in_image,patch_output)\n model.compile(loss='mse', optimizer=Adam(lr=0.002, beta_1=0.5), loss_weights=[0.5])\n return model\n \n","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:18.461612Z","iopub.execute_input":"2022-01-13T11:31:18.462246Z","iopub.status.idle":"2022-01-13T11:31:18.476403Z","shell.execute_reply.started":"2022-01-13T11:31:18.462209Z","shell.execute_reply":"2022-01-13T11:31:18.475509Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The generator is an encoder-decoder model architecture. The model takes a source image (e.g. horse photo) and generates a target image (e.g. zebra photo). It does this by first downsampling or encoding the input image down to a bottleneck layer, then interpreting the encoding with a number of ResNet layers that use skip connections, followed by a series of layers that upsample or decode the representation to the size of the output image.","metadata":{}},{"cell_type":"markdown","source":"### Resnet Block","metadata":{}},{"cell_type":"code","source":"def resnet_block(n_filters, input_layer):\n # weight initialization\n init=RandomNormal(stddev=0.02)\n #First layer convolutional layer\n \n g=Conv2D(n_filters,(3,3),padding='same',kernel_initializer=init)(input_layer)\n g=InstanceNormalization(axis=-1)(g)\n g=Activation('relu')(g)\n \n #Second convolution layer\n g=Conv2D(n_filters, (3,3), padding='same',kernel_initializer=init)(g)\n g=InstanceNormalization(axis=-1)(g)\n \n g=Concatenate()([g,input_layer])\n return g","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:18.477945Z","iopub.execute_input":"2022-01-13T11:31:18.478405Z","iopub.status.idle":"2022-01-13T11:31:18.486768Z","shell.execute_reply.started":"2022-01-13T11:31:18.47837Z","shell.execute_reply":"2022-01-13T11:31:18.485855Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Implementing Generator","metadata":{}},{"cell_type":"code","source":"def define_generator(image_shape, n_resnet=9):\n \n init=RandomNormal(stddev=0.02)\n #image Input\n in_image=Input(shape=image_shape)\n \n # 64 Filter\n g=Conv2D(64, (7,7), padding='same', kernel_initializer=init )(in_image)\n g=Activation('relu')(g)\n \n # 128 filter\n g = Conv2D(128, (3,3), strides=(2,2), padding='same', kernel_initializer=init)(g)\n g = InstanceNormalization(axis=-1)(g)\n g = Activation('relu')(g)\n \n # 256\n g=Conv2D(256,(3,3), strides=(2,2), padding='same', kernel_initializer=init)(g)\n g = InstanceNormalization(axis=-1)(g)\n g = Activation('relu')(g)\n \n # Now creating 9 blocks of resnet in the architecture \n for i in range(n_resnet):\n g=resnet_block(256,g)\n\n #Now expanding the image from here\n # 128 filter size\n g=Conv2DTranspose(128,(3,3), strides=(2,2), padding='same', kernel_initializer=init )(g)\n g=InstanceNormalization(axis=-1)(g)\n g=Activation('relu')(g)\n \n #64 filter size\n g=Conv2DTranspose(64,(3,3), strides=(2,2), padding='same', kernel_initializer=init )(g)\n g=InstanceNormalization(axis=-1)(g)\n g=Activation('relu')(g)\n \n # size filter 3\n g=Conv2D(3, (7,7), padding='same', kernel_initializer=init)(g)\n g=InstanceNormalization(axis=-1)(g)\n out_image=Activation('tanh')(g)\n \n #Define Model\n model=Model(in_image,out_image)\n return model\n ","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:18.490237Z","iopub.execute_input":"2022-01-13T11:31:18.490478Z","iopub.status.idle":"2022-01-13T11:31:18.505401Z","shell.execute_reply.started":"2022-01-13T11:31:18.490446Z","shell.execute_reply":"2022-01-13T11:31:18.504677Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def define_composite_model(g_model_1,d_model,g_model_2,image_shape):\n g_model_1.trainable=True\n d_model.trainable=False\n g_model_2.trainable=False\n \n\n #discriminator elements \n input_gen=Input(shape=image_shape)\n gen1_out=g_model_1(input_gen)\n output_d=d_model(gen1_out)\n \n #identity element\n input_id=Input(shape=image_shape)\n output_id=g_model_1(input_id)\n \n #forward\n output_f=g_model_2(gen1_out)\n \n #Backward cycle\n gen2_out=g_model_2(input_id)\n output_b=g_model_1(gen2_out)\n \n \n #define the model complete graph\n model=Model([input_gen,input_id],[output_d,output_id,output_f,output_b])\n #define optimization algoithm configuration\n opt=Adam(lr=0.0002,beta_1=0.5)\n #compile mode\n model.compile(loss=['mse','mae','mae','mae'],loss_weights=[1,5,10,10], optimizer=opt)\n return model ","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:18.507655Z","iopub.execute_input":"2022-01-13T11:31:18.50797Z","iopub.status.idle":"2022-01-13T11:31:18.515934Z","shell.execute_reply.started":"2022-01-13T11:31:18.507934Z","shell.execute_reply":"2022-01-13T11:31:18.515132Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# load and prepare training images\ndef load_real_samples(filename):\n # load the dataset\n data = load(filename)\n # unpack arrays\n X1, X2 = data['arr_0'], data['arr_1']\n # scale from [0,255] to [-1,1]\n X1 = (X1 - 127.5) / 127.5\n X2 = (X2 - 127.5) / 127.5\n return [X1, X2]","metadata":{"execution":{"iopub.status.busy":"2022-01-16T23:39:08.195951Z","iopub.execute_input":"2022-01-16T23:39:08.196280Z","iopub.status.idle":"2022-01-16T23:39:08.202399Z","shell.execute_reply.started":"2022-01-16T23:39:08.196245Z","shell.execute_reply":"2022-01-16T23:39:08.201431Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def generate_real_samples(dataset, n_samples, patch_shape):\n # choose random instances\n ix = randint(0, dataset.shape[0], n_samples)\n # retrieve selected images\n X = dataset[ix]\n # generate 'real' class labels (1)\n y = ones((n_samples, patch_shape, patch_shape, 1))\n return X, y","metadata":{"execution":{"iopub.status.busy":"2022-01-16T23:39:12.078694Z","iopub.execute_input":"2022-01-16T23:39:12.079013Z","iopub.status.idle":"2022-01-16T23:39:12.084684Z","shell.execute_reply.started":"2022-01-16T23:39:12.078981Z","shell.execute_reply":"2022-01-16T23:39:12.083747Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# generate a batch of images, returns images and targets\ndef generate_fake_samples(g_model, dataset, patch_shape):\n # generate fake instance\n X = g_model.predict(dataset)\n # create 'fake' class labels (0)\n y = zeros((len(X), patch_shape, patch_shape, 1))\n return X, y","metadata":{"execution":{"iopub.status.busy":"2022-01-16T23:39:14.266843Z","iopub.execute_input":"2022-01-16T23:39:14.267123Z","iopub.status.idle":"2022-01-16T23:39:14.272323Z","shell.execute_reply.started":"2022-01-16T23:39:14.267093Z","shell.execute_reply":"2022-01-16T23:39:14.271622Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def save_models(step, g_model_AtoB, g_model_BtoA):\n # save the first generator model\n filename1 = 'g_model_AtoB_%06d.h5' % (step+1)\n g_model_AtoB.save(filename1)\n # save the second generator model\n filename2 = 'g_model_BtoA_%06d.h5' % (step+1)\n g_model_BtoA.save(filename2)\n print('>Saved: %s and %s' % (filename1, filename2))","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:18.546084Z","iopub.execute_input":"2022-01-13T11:31:18.546475Z","iopub.status.idle":"2022-01-13T11:31:18.554982Z","shell.execute_reply.started":"2022-01-13T11:31:18.546438Z","shell.execute_reply":"2022-01-13T11:31:18.55439Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# generate samples and save as a plot and save the model\ndef summarize_performance(step, g_model, trainX, name, n_samples=5):\n # select a sample of input images\n X_in, _ = generate_real_samples(trainX, n_samples, 0)\n # generate translated images\n X_out, _ = generate_fake_samples(g_model, X_in, 0)\n # scale all pixels from [-1,1] to [0,1]\n X_in = (X_in + 1) / 2.0\n X_out = (X_out + 1) / 2.0\n # plot real images\n for i in range(n_samples):\n pyplot.subplot(2, n_samples, 1 + i)\n pyplot.axis('off')\n pyplot.imshow(X_in[i])\n # plot translated image\n for i in range(n_samples):\n pyplot.subplot(2, n_samples, 1 + n_samples + i)\n pyplot.axis('off')\n pyplot.imshow(X_out[i])\n # save lot to file\n filename1 = '%s_generated_plot_%06d.png' % (name, (step+1))\n pyplot.savefig(filename1)\n pyplot.close()","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:18.555887Z","iopub.execute_input":"2022-01-13T11:31:18.55617Z","iopub.status.idle":"2022-01-13T11:31:18.567728Z","shell.execute_reply.started":"2022-01-13T11:31:18.556136Z","shell.execute_reply":"2022-01-13T11:31:18.567055Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# update image pool for fake images\ndef update_image_pool(pool, images, max_size=50):\n selected = list()\n for image in images:\n if len(pool) < max_size:\n # stock the pool\n pool.append(image)\n selected.append(image)\n elif random() < 0.5:\n # use image, but don't add it to the pool\n selected.append(image)\n else:\n # replace an existing image and use replaced image\n ix = randint(0, len(pool))\n selected.append(pool[ix])\n pool[ix] = image\n return asarray(selected)","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:18.569154Z","iopub.execute_input":"2022-01-13T11:31:18.56942Z","iopub.status.idle":"2022-01-13T11:31:18.577133Z","shell.execute_reply.started":"2022-01-13T11:31:18.569385Z","shell.execute_reply":"2022-01-13T11:31:18.576469Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def train(d_model_A, d_model_B, g_model_AtoB, g_model_BtoA, c_model_AtoB, c_model_BtoA, dataset):\n # define properties of the training run\n n_epochs, n_batch, = 50, 1\n # determine the output square shape of the discriminator\n n_patch = d_model_A.output_shape[1]\n # unpack dataset\n trainA, trainB = dataset\n # prepare image pool for fakes\n poolA, poolB = list(), list()\n # calculate the number of batches per training epoch\n bat_per_epo = int(len(trainA) / n_batch)\n # calculate the number of training iterations\n n_steps = bat_per_epo * n_epochs\n # manually enumerate epochs\n for i in range(n_steps):\n # select a batch of real samples\n X_realA, y_realA = generate_real_samples(trainA, n_batch, n_patch)\n X_realB, y_realB = generate_real_samples(trainB, n_batch, n_patch)\n # generate a batch of fake samples\n X_fakeA, y_fakeA = generate_fake_samples(g_model_BtoA, X_realB, n_patch)\n X_fakeB, y_fakeB = generate_fake_samples(g_model_AtoB, X_realA, n_patch)\n # update fakes from pool\n X_fakeA = update_image_pool(poolA, X_fakeA)\n X_fakeB = update_image_pool(poolB, X_fakeB)\n # update generator B->A via adversarial and cycle loss\n g_loss2, _, _, _, _ = c_model_BtoA.train_on_batch([X_realB, X_realA], [y_realA, X_realA, X_realB, X_realA])\n # update discriminator for A -> [real/fake]\n dA_loss1 = d_model_A.train_on_batch(X_realA, y_realA)\n dA_loss2 = d_model_A.train_on_batch(X_fakeA, y_fakeA)\n # update generator A->B via adversarial and cycle loss\n g_loss1, _, _, _, _ = c_model_AtoB.train_on_batch([X_realA, X_realB], [y_realB, X_realB, X_realA, X_realB])\n # update discriminator for B -> [real/fake]\n dB_loss1 = d_model_B.train_on_batch(X_realB, y_realB)\n dB_loss2 = d_model_B.train_on_batch(X_fakeB, y_fakeB)\n # summarize performance\n print('>%d, dA[%.3f,%.3f] dB[%.3f,%.3f] g[%.3f,%.3f]' % (i+1, dA_loss1,dA_loss2, dB_loss1,dB_loss2, g_loss1,g_loss2))\n # evaluate the model performance every so often\n if (i+1) % (bat_per_epo * 1) == 0:\n # plot A->B translation\n summarize_performance(i, g_model_AtoB, trainA, 'AtoB')\n # plot B->A translation\n summarize_performance(i, g_model_BtoA, trainB, 'BtoA')\n if (i+1) % (bat_per_epo * 5) == 0:\n # save the models\n save_models(i, g_model_AtoB, g_model_BtoA)","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:39:39.41706Z","iopub.execute_input":"2022-01-13T11:39:39.417633Z","iopub.status.idle":"2022-01-13T11:39:39.429601Z","shell.execute_reply.started":"2022-01-13T11:39:39.417596Z","shell.execute_reply":"2022-01-13T11:39:39.428597Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# load image data\npath='../input/microscope-500-128x128/'\nfilename = 'microscope_500_128x128.npz'\ndataset = load_real_samples(path+filename)\nprint('Loaded')\nprint(\"Not Good Images\", dataset[0].shape)\nprint(\"Good Images\", dataset[1].shape)\n\n# define input shape based on the loaded dataset\nimage_shape = dataset[0].shape[1:]\n# generator: A -> B\ng_model_AtoB = define_generator(image_shape)\n# generator: B -> A\ng_model_BtoA = define_generator(image_shape)\n# discriminator: A -> [real/fake]\nd_model_A = define_discriminator(image_shape)\n# discriminator: B -> [real/fake]\nd_model_B = define_discriminator(image_shape)\n# composite: A -> B -> [real/fake, A]\nc_model_AtoB = define_composite_model(g_model_AtoB, d_model_B, g_model_BtoA, image_shape)\n# composite: B -> A -> [real/fake, B]\nc_model_BtoA = define_composite_model(g_model_BtoA, d_model_A, g_model_AtoB, image_shape)\n# train models\ntrain(d_model_A, d_model_B, g_model_AtoB, g_model_BtoA, c_model_AtoB, c_model_BtoA, dataset)","metadata":{"scrolled":true,"execution":{"iopub.status.busy":"2022-01-13T11:39:56.927824Z","iopub.execute_input":"2022-01-13T11:39:56.928348Z","iopub.status.idle":"2022-01-13T15:35:59.627375Z","shell.execute_reply.started":"2022-01-13T11:39:56.928308Z","shell.execute_reply":"2022-01-13T15:35:59.625875Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(tf.__version__)\nprint(keras.__version__)","metadata":{"execution":{"iopub.status.busy":"2022-01-13T11:31:18.638155Z","iopub.status.idle":"2022-01-13T11:31:18.638759Z","shell.execute_reply.started":"2022-01-13T11:31:18.638525Z","shell.execute_reply":"2022-01-13T11:31:18.638549Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def save_models(step, g_model_AtoB, g_model_BtoA):\n # save the first generator model\n filename1 = './g_model_AtoB_%06d.h5' % (step+1)\n g_model_AtoB.save(filename1)\n # save the second generator model\n filename2 = './g_model_BtoA_%06d.h5' % (step+1)\n g_model_BtoA.save(filename2)\n print('>Saved: %s and %s' % (filename1, filename2))","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Evaluation\n","metadata":{}},{"cell_type":"code","source":"def select_sample(dataset, n_samples):\n # choose random instances\n ix = randint(0, dataset.shape[0], n_samples)\n # retrieve selected images\n X = dataset[ix]\n return X\n# plot the image, the translation, and the reconstruction\ndef show_plot(imagesX, imagesY1, imagesY2):\n images = vstack((imagesX, imagesY1, imagesY2))\n titles = ['Real', 'Generated', 'Reconstructed']\n # scale from [-1,1] to [0,1]\n images = (images + 1) / 2.0\n # plot images row by row\n fig = plt.figure(figsize=(20, 20))\n for i in range(len(images)):\n # define subplot\n fig.add_subplot(1, len(images), 1 + i)\n #pyplot.subplot(1, len(images), 1 + i)\n # turn off axis\n \n # plot raw pixel data\n plt.imshow(images[i])\n plt.axis('off')\n # title\n plt.title(titles[i])\n pyplot.show()","metadata":{"execution":{"iopub.status.busy":"2022-01-16T23:55:30.657082Z","iopub.execute_input":"2022-01-16T23:55:30.657428Z","iopub.status.idle":"2022-01-16T23:55:30.665321Z","shell.execute_reply.started":"2022-01-16T23:55:30.657390Z","shell.execute_reply":"2022-01-16T23:55:30.664638Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Loading sample dataset\nA_data, B_data = load_real_samples('../input/microscope/microscope_for_corena.npz')\nprint('Loaded', A_data.shape, B_data.shape)","metadata":{"execution":{"iopub.status.busy":"2022-01-16T23:39:30.632908Z","iopub.execute_input":"2022-01-16T23:39:30.633448Z","iopub.status.idle":"2022-01-16T23:39:48.414389Z","shell.execute_reply.started":"2022-01-16T23:39:30.633411Z","shell.execute_reply":"2022-01-16T23:39:48.413381Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from keras.models import load_model\n# load the models\ncust = {'InstanceNormalization': InstanceNormalization}\nmodel_AtoB = load_model('../input/modelsss/g_model_AtoB_025000.h5', cust)\nmodel_BtoA = load_model('../input/modelsss/g_model_BtoA_025000.h5', cust)","metadata":{"execution":{"iopub.status.busy":"2022-01-16T23:40:06.687461Z","iopub.execute_input":"2022-01-16T23:40:06.687911Z","iopub.status.idle":"2022-01-16T23:40:11.142798Z","shell.execute_reply.started":"2022-01-16T23:40:06.687877Z","shell.execute_reply":"2022-01-16T23:40:11.141929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n# plot A->B->A\nA_real = select_sample(A_data, 1)\nB_generated = model_AtoB.predict(A_real)\nA_reconstructed = model_BtoA.predict(B_generated)\nshow_plot(A_real, B_generated, A_reconstructed)","metadata":{"execution":{"iopub.status.busy":"2022-01-16T23:52:14.475670Z","iopub.execute_input":"2022-01-16T23:52:14.476367Z","iopub.status.idle":"2022-01-16T23:52:20.692376Z","shell.execute_reply.started":"2022-01-16T23:52:14.476321Z","shell.execute_reply":"2022-01-16T23:52:20.691340Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# plot B->A->B\nB_real = select_sample(B_data, 1)\nA_generated = model_BtoA.predict(B_real)\nB_reconstructed = model_AtoB.predict(A_generated)\nshow_plot(B_real, A_generated, B_reconstructed)","metadata":{"execution":{"iopub.status.busy":"2022-01-16T23:58:02.769632Z","iopub.execute_input":"2022-01-16T23:58:02.769915Z","iopub.status.idle":"2022-01-16T23:58:09.373150Z","shell.execute_reply.started":"2022-01-16T23:58:02.769886Z","shell.execute_reply":"2022-01-16T23:58:09.372423Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]}]} -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/Read me: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/Dataset.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/Dataset.zip -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/Output/myPredictions.csv: -------------------------------------------------------------------------------- 1 | Id,Label 2 | 1,-1.00E+00 3 | 2,-1.00E+00 4 | 3,-1.00E+00 5 | 4,-1.00E+00 6 | 5,-1.00E+00 7 | 6,1.00E+00 8 | 7,1.00E+00 9 | 8,-1.00E+00 10 | 9,-1.00E+00 11 | 10,-1.00E+00 12 | 11,-1.00E+00 13 | 12,-1.00E+00 14 | 13,1.00E+00 15 | 14,-1.00E+00 16 | 15,-1.00E+00 17 | 16,1.00E+00 18 | 17,1.00E+00 19 | 18,1.00E+00 20 | 19,1.00E+00 21 | 20,-1.00E+00 22 | 21,-1.00E+00 23 | 22,-1.00E+00 24 | 23,-1.00E+00 25 | 24,-1.00E+00 26 | 25,-1.00E+00 27 | 26,1.00E+00 28 | 27,-1.00E+00 29 | 28,-1.00E+00 30 | 29,-1.00E+00 31 | 30,-1.00E+00 32 | 31,-1.00E+00 33 | 32,1.00E+00 34 | 33,-1.00E+00 35 | 34,1.00E+00 36 | 35,-1.00E+00 37 | 36,1.00E+00 38 | 37,1.00E+00 39 | 38,1.00E+00 40 | 39,-1.00E+00 41 | 40,-1.00E+00 42 | 41,1.00E+00 43 | 42,1.00E+00 44 | 43,1.00E+00 45 | 44,1.00E+00 46 | 45,1.00E+00 47 | 46,-1.00E+00 48 | 47,-1.00E+00 49 | 48,-1.00E+00 50 | 49,1.00E+00 51 | 50,-1.00E+00 52 | 51,-1.00E+00 53 | 52,1.00E+00 54 | 53,1.00E+00 55 | 54,-1.00E+00 56 | 55,1.00E+00 57 | 56,-1.00E+00 58 | 57,1.00E+00 59 | 58,-1.00E+00 60 | 59,-1.00E+00 61 | 60,-1.00E+00 62 | 61,1.00E+00 63 | 62,1.00E+00 64 | 63,-1.00E+00 65 | 64,1.00E+00 66 | 65,1.00E+00 67 | 66,-1.00E+00 68 | 67,1.00E+00 69 | 68,-1.00E+00 70 | 69,1.00E+00 71 | 70,1.00E+00 72 | 71,1.00E+00 73 | 72,1.00E+00 74 | 73,1.00E+00 75 | 74,-1.00E+00 76 | 75,-1.00E+00 77 | 76,1.00E+00 78 | 77,-1.00E+00 79 | 78,-1.00E+00 80 | 79,1.00E+00 81 | 80,-1.00E+00 82 | 81,1.00E+00 83 | 82,-1.00E+00 84 | 83,-1.00E+00 85 | 84,-1.00E+00 86 | 85,-1.00E+00 87 | 86,-1.00E+00 88 | 87,-1.00E+00 89 | 88,-1.00E+00 90 | 89,-1.00E+00 91 | 90,-1.00E+00 92 | 91,-1.00E+00 93 | 92,-1.00E+00 94 | 93,-1.00E+00 95 | 94,-1.00E+00 96 | 95,-1.00E+00 97 | 96,1.00E+00 98 | 97,1.00E+00 99 | 98,-1.00E+00 100 | 99,-1.00E+00 101 | 100,-1.00E+00 102 | 101,1.00E+00 103 | 102,-1.00E+00 104 | 103,-1.00E+00 105 | 104,1.00E+00 106 | 105,-1.00E+00 107 | 106,-1.00E+00 108 | 107,-1.00E+00 109 | 108,1.00E+00 110 | 109,1.00E+00 111 | 110,-1.00E+00 112 | 111,1.00E+00 113 | 112,1.00E+00 114 | 113,-1.00E+00 115 | 114,1.00E+00 116 | 115,1.00E+00 117 | 116,-1.00E+00 118 | 117,-1.00E+00 119 | 118,-1.00E+00 120 | 119,1.00E+00 121 | 120,1.00E+00 122 | 121,-1.00E+00 123 | 122,-1.00E+00 124 | 123,1.00E+00 125 | 124,-1.00E+00 126 | 125,-1.00E+00 127 | 126,-1.00E+00 128 | 127,-1.00E+00 129 | 128,-1.00E+00 130 | 129,-1.00E+00 131 | 130,1.00E+00 132 | 131,-1.00E+00 133 | 132,-1.00E+00 134 | 133,-1.00E+00 135 | 134,-1.00E+00 136 | 135,1.00E+00 137 | 136,1.00E+00 138 | 137,-1.00E+00 139 | 138,-1.00E+00 140 | 139,1.00E+00 141 | 140,-1.00E+00 142 | 141,-1.00E+00 143 | 142,1.00E+00 144 | 143,1.00E+00 145 | 144,-1.00E+00 146 | 145,-1.00E+00 147 | 146,-1.00E+00 148 | 147,-1.00E+00 149 | 148,-1.00E+00 150 | 149,-1.00E+00 151 | 150,1.00E+00 152 | 151,-1.00E+00 153 | 152,-1.00E+00 154 | 153,-1.00E+00 155 | 154,-1.00E+00 156 | 155,-1.00E+00 157 | 156,1.00E+00 158 | 157,-1.00E+00 159 | 158,-1.00E+00 160 | 159,-1.00E+00 161 | 160,1.00E+00 162 | 161,-1.00E+00 163 | 162,1.00E+00 164 | 163,1.00E+00 165 | 164,-1.00E+00 166 | 165,-1.00E+00 167 | 166,1.00E+00 168 | 167,-1.00E+00 169 | 168,-1.00E+00 170 | 169,-1.00E+00 171 | 170,-1.00E+00 172 | 171,-1.00E+00 173 | 172,-1.00E+00 174 | 173,-1.00E+00 175 | 174,-1.00E+00 176 | 175,-1.00E+00 177 | 176,-1.00E+00 178 | 177,-1.00E+00 179 | 178,-1.00E+00 180 | 179,1.00E+00 181 | 180,-1.00E+00 182 | 181,1.00E+00 183 | 182,-1.00E+00 184 | 183,-1.00E+00 185 | 184,-1.00E+00 186 | 185,1.00E+00 187 | 186,-1.00E+00 188 | 187,1.00E+00 189 | 188,1.00E+00 190 | 189,-1.00E+00 191 | 190,-1.00E+00 192 | 191,-1.00E+00 193 | 192,-1.00E+00 194 | 193,-1.00E+00 195 | 194,1.00E+00 196 | 195,-1.00E+00 197 | 196,-1.00E+00 198 | 197,-1.00E+00 199 | 198,-1.00E+00 200 | 199,-1.00E+00 201 | 200,-1.00E+00 202 | 201,-1.00E+00 203 | 202,1.00E+00 204 | 203,-1.00E+00 205 | 204,-1.00E+00 206 | 205,-1.00E+00 207 | 206,-1.00E+00 208 | 207,-1.00E+00 209 | 208,-1.00E+00 210 | 209,1.00E+00 211 | 210,-1.00E+00 212 | 211,-1.00E+00 213 | 212,-1.00E+00 214 | 213,1.00E+00 215 | 214,1.00E+00 216 | 215,-1.00E+00 217 | 216,-1.00E+00 218 | 217,1.00E+00 219 | 218,1.00E+00 220 | 219,-1.00E+00 221 | 220,1.00E+00 222 | 221,-1.00E+00 223 | 222,1.00E+00 224 | 223,1.00E+00 225 | 224,1.00E+00 226 | 225,-1.00E+00 227 | 226,1.00E+00 228 | 227,1.00E+00 229 | 228,-1.00E+00 230 | 229,1.00E+00 231 | 230,-1.00E+00 232 | 231,-1.00E+00 233 | 232,1.00E+00 234 | 233,1.00E+00 235 | 234,1.00E+00 236 | 235,-1.00E+00 237 | 236,1.00E+00 238 | 237,-1.00E+00 239 | 238,-1.00E+00 240 | 239,-1.00E+00 241 | 240,-1.00E+00 242 | 241,-1.00E+00 243 | 242,1.00E+00 244 | 243,1.00E+00 245 | 244,1.00E+00 246 | 245,-1.00E+00 247 | 246,-1.00E+00 248 | 247,-1.00E+00 249 | 248,1.00E+00 250 | 249,-1.00E+00 251 | 250,1.00E+00 252 | 251,1.00E+00 253 | 252,-1.00E+00 254 | 253,1.00E+00 255 | 254,-1.00E+00 256 | 255,1.00E+00 257 | 256,1.00E+00 258 | 257,-1.00E+00 259 | 258,-1.00E+00 260 | 259,-1.00E+00 261 | 260,-1.00E+00 262 | 261,1.00E+00 263 | 262,1.00E+00 264 | 263,-1.00E+00 265 | 264,-1.00E+00 266 | 265,1.00E+00 267 | 266,1.00E+00 268 | 267,-1.00E+00 269 | 268,-1.00E+00 270 | 269,-1.00E+00 271 | 270,-1.00E+00 272 | 271,-1.00E+00 273 | 272,-1.00E+00 274 | 273,-1.00E+00 275 | 274,1.00E+00 276 | 275,-1.00E+00 277 | 276,1.00E+00 278 | 277,1.00E+00 279 | 278,1.00E+00 280 | 279,1.00E+00 281 | 280,-1.00E+00 282 | 281,-1.00E+00 283 | 282,1.00E+00 284 | 283,-1.00E+00 285 | 284,1.00E+00 286 | 285,-1.00E+00 287 | 286,1.00E+00 288 | 287,-1.00E+00 289 | 288,1.00E+00 290 | 289,1.00E+00 291 | 290,1.00E+00 292 | 291,1.00E+00 293 | 292,-1.00E+00 294 | 293,-1.00E+00 295 | 294,-1.00E+00 296 | 295,1.00E+00 297 | 296,-1.00E+00 298 | 297,-1.00E+00 299 | 298,-1.00E+00 300 | 299,-1.00E+00 301 | 300,-1.00E+00 302 | 301,1.00E+00 303 | 302,-1.00E+00 304 | 303,-1.00E+00 305 | 304,-1.00E+00 306 | 305,-1.00E+00 307 | 306,1.00E+00 308 | 307,1.00E+00 309 | 308,1.00E+00 310 | 309,-1.00E+00 311 | 310,1.00E+00 312 | 311,1.00E+00 313 | 312,1.00E+00 314 | 313,1.00E+00 315 | 314,-1.00E+00 316 | 315,-1.00E+00 317 | 316,-1.00E+00 318 | 317,1.00E+00 319 | 318,1.00E+00 320 | 319,-1.00E+00 321 | 320,-1.00E+00 322 | 321,-1.00E+00 323 | 322,1.00E+00 324 | 323,1.00E+00 325 | 324,-1.00E+00 326 | 325,1.00E+00 327 | 326,1.00E+00 328 | 327,1.00E+00 329 | 328,-1.00E+00 330 | 329,-1.00E+00 331 | 330,-1.00E+00 332 | 331,-1.00E+00 333 | 332,-1.00E+00 334 | 333,-1.00E+00 335 | 334,-1.00E+00 336 | 335,1.00E+00 337 | 336,1.00E+00 338 | 337,-1.00E+00 339 | 338,-1.00E+00 340 | 339,1.00E+00 341 | 340,1.00E+00 342 | 341,1.00E+00 343 | 342,-1.00E+00 344 | 343,-1.00E+00 345 | 344,-1.00E+00 346 | 345,1.00E+00 347 | 346,-1.00E+00 348 | 347,-1.00E+00 349 | 348,-1.00E+00 350 | 349,1.00E+00 351 | 350,-1.00E+00 352 | 351,1.00E+00 353 | 352,1.00E+00 354 | 353,1.00E+00 355 | 354,1.00E+00 356 | 355,-1.00E+00 357 | 356,1.00E+00 358 | 357,-1.00E+00 359 | 358,-1.00E+00 360 | 359,-1.00E+00 361 | 360,-1.00E+00 362 | 361,-1.00E+00 363 | 362,-1.00E+00 364 | 363,-1.00E+00 365 | 364,-1.00E+00 366 | 365,1.00E+00 367 | 366,-1.00E+00 368 | 367,-1.00E+00 369 | 368,-1.00E+00 370 | 369,-1.00E+00 371 | 370,-1.00E+00 372 | 371,-1.00E+00 373 | 372,1.00E+00 374 | 373,-1.00E+00 375 | 374,-1.00E+00 376 | 375,1.00E+00 377 | 376,-1.00E+00 378 | 377,-1.00E+00 379 | 378,-1.00E+00 380 | 379,1.00E+00 381 | 380,-1.00E+00 382 | 381,1.00E+00 383 | 382,-1.00E+00 384 | 383,-1.00E+00 385 | 384,1.00E+00 386 | 385,-1.00E+00 387 | 386,-1.00E+00 388 | 387,1.00E+00 389 | 388,1.00E+00 390 | 389,-1.00E+00 391 | 390,-1.00E+00 392 | 391,-1.00E+00 393 | 392,-1.00E+00 394 | 393,1.00E+00 395 | 394,-1.00E+00 396 | 395,-1.00E+00 397 | 396,-1.00E+00 398 | 397,-1.00E+00 399 | 398,1.00E+00 400 | 399,-1.00E+00 401 | 400,1.00E+00 402 | 401,1.00E+00 403 | 402,-1.00E+00 404 | 403,-1.00E+00 405 | 404,-1.00E+00 406 | 405,1.00E+00 407 | 406,-1.00E+00 408 | 407,-1.00E+00 409 | 408,-1.00E+00 410 | 409,-1.00E+00 411 | 410,1.00E+00 412 | 411,-1.00E+00 413 | 412,1.00E+00 414 | 413,-1.00E+00 415 | 414,-1.00E+00 416 | 415,1.00E+00 417 | 416,-1.00E+00 418 | 417,1.00E+00 419 | 418,1.00E+00 420 | 419,-1.00E+00 421 | 420,-1.00E+00 422 | 421,1.00E+00 423 | 422,-1.00E+00 424 | 423,-1.00E+00 425 | 424,1.00E+00 426 | 425,1.00E+00 427 | 426,1.00E+00 428 | 427,-1.00E+00 429 | 428,-1.00E+00 430 | 429,-1.00E+00 431 | 430,1.00E+00 432 | 431,1.00E+00 433 | 432,1.00E+00 434 | 433,-1.00E+00 435 | 434,-1.00E+00 436 | 435,-1.00E+00 437 | 436,-1.00E+00 438 | 437,1.00E+00 439 | 438,-1.00E+00 440 | 439,-1.00E+00 441 | 440,1.00E+00 442 | 441,-1.00E+00 443 | 442,1.00E+00 444 | 443,-1.00E+00 445 | 444,-1.00E+00 446 | 445,1.00E+00 447 | 446,-1.00E+00 448 | 447,1.00E+00 449 | 448,-1.00E+00 450 | 449,-1.00E+00 451 | 450,-1.00E+00 452 | 451,-1.00E+00 453 | 452,-1.00E+00 454 | 453,1.00E+00 455 | 454,-1.00E+00 456 | 455,-1.00E+00 457 | 456,-1.00E+00 458 | 457,-1.00E+00 459 | 458,1.00E+00 460 | 459,1.00E+00 461 | 460,-1.00E+00 462 | 461,1.00E+00 463 | 462,-1.00E+00 464 | 463,1.00E+00 465 | 464,-1.00E+00 466 | 465,-1.00E+00 467 | 466,-1.00E+00 468 | 467,1.00E+00 469 | 468,1.00E+00 470 | 469,-1.00E+00 471 | 470,1.00E+00 472 | 471,-1.00E+00 473 | 472,1.00E+00 474 | 473,-1.00E+00 475 | 474,1.00E+00 476 | 475,-1.00E+00 477 | 476,-1.00E+00 478 | 477,-1.00E+00 479 | 478,-1.00E+00 480 | 479,-1.00E+00 481 | 480,1.00E+00 482 | 481,1.00E+00 483 | 482,-1.00E+00 484 | 483,1.00E+00 485 | 484,-1.00E+00 486 | 485,-1.00E+00 487 | 486,-1.00E+00 488 | 487,-1.00E+00 489 | 488,-1.00E+00 490 | 489,-1.00E+00 491 | 490,1.00E+00 492 | 491,-1.00E+00 493 | 492,-1.00E+00 494 | 493,-1.00E+00 495 | 494,-1.00E+00 496 | 495,-1.00E+00 497 | 496,-1.00E+00 498 | 497,-1.00E+00 499 | 498,1.00E+00 500 | 499,-1.00E+00 501 | 500,1.00E+00 502 | 501,-1.00E+00 503 | 502,-1.00E+00 504 | 503,-1.00E+00 505 | 504,1.00E+00 506 | 505,-1.00E+00 507 | 506,-1.00E+00 508 | 507,1.00E+00 509 | 508,1.00E+00 510 | 509,1.00E+00 511 | 510,1.00E+00 512 | 511,-1.00E+00 513 | 512,-1.00E+00 514 | 513,-1.00E+00 515 | 514,-1.00E+00 516 | 515,-1.00E+00 517 | 516,-1.00E+00 518 | 517,1.00E+00 519 | 518,-1.00E+00 520 | 519,-1.00E+00 521 | 520,-1.00E+00 522 | 521,1.00E+00 523 | 522,1.00E+00 524 | 523,1.00E+00 525 | 524,-1.00E+00 526 | 525,1.00E+00 527 | 526,-1.00E+00 528 | 527,1.00E+00 529 | 528,1.00E+00 530 | 529,1.00E+00 531 | 530,1.00E+00 532 | 531,-1.00E+00 533 | 532,1.00E+00 534 | 533,-1.00E+00 535 | 534,-1.00E+00 536 | 535,1.00E+00 537 | 536,1.00E+00 538 | 537,1.00E+00 539 | 538,-1.00E+00 540 | 539,-1.00E+00 541 | 540,-1.00E+00 542 | 541,1.00E+00 543 | 542,-1.00E+00 544 | 543,-1.00E+00 545 | 544,-1.00E+00 546 | 545,1.00E+00 547 | 546,1.00E+00 548 | 547,-1.00E+00 549 | 548,-1.00E+00 550 | 549,-1.00E+00 551 | 550,-1.00E+00 552 | 551,-1.00E+00 553 | 552,1.00E+00 554 | 553,1.00E+00 555 | 554,1.00E+00 556 | 555,-1.00E+00 557 | 556,-1.00E+00 558 | 557,-1.00E+00 559 | 558,-1.00E+00 560 | 559,-1.00E+00 561 | 560,-1.00E+00 562 | 561,1.00E+00 563 | 562,-1.00E+00 564 | 563,-1.00E+00 565 | 564,1.00E+00 566 | 565,1.00E+00 567 | 566,-1.00E+00 568 | 567,-1.00E+00 569 | 568,1.00E+00 570 | 569,1.00E+00 571 | 570,1.00E+00 572 | 571,-1.00E+00 573 | 572,-1.00E+00 574 | 573,1.00E+00 575 | 574,-1.00E+00 576 | 575,1.00E+00 577 | 576,-1.00E+00 578 | 577,1.00E+00 579 | 578,-1.00E+00 580 | 579,-1.00E+00 581 | 580,-1.00E+00 582 | 581,-1.00E+00 583 | 582,-1.00E+00 584 | 583,1.00E+00 585 | 584,1.00E+00 586 | 585,-1.00E+00 587 | 586,-1.00E+00 588 | 587,-1.00E+00 589 | 588,-1.00E+00 590 | 589,-1.00E+00 591 | 590,-1.00E+00 592 | 591,-1.00E+00 593 | 592,-1.00E+00 594 | 593,1.00E+00 595 | 594,1.00E+00 596 | 595,1.00E+00 597 | 596,1.00E+00 598 | 597,1.00E+00 599 | 598,-1.00E+00 600 | 599,-1.00E+00 601 | 600,1.00E+00 602 | 601,-1.00E+00 603 | 602,1.00E+00 604 | 603,-1.00E+00 605 | 604,1.00E+00 606 | 605,1.00E+00 607 | 606,1.00E+00 608 | 607,-1.00E+00 609 | 608,-1.00E+00 610 | 609,-1.00E+00 611 | 610,1.00E+00 612 | 611,-1.00E+00 613 | 612,1.00E+00 614 | 613,1.00E+00 615 | 614,-1.00E+00 616 | 615,1.00E+00 617 | 616,1.00E+00 618 | 617,-1.00E+00 619 | 618,-1.00E+00 620 | 619,-1.00E+00 621 | 620,1.00E+00 622 | 621,-1.00E+00 623 | 622,1.00E+00 624 | 623,1.00E+00 625 | 624,1.00E+00 626 | 625,1.00E+00 627 | 626,1.00E+00 628 | 627,1.00E+00 629 | 628,1.00E+00 630 | 629,-1.00E+00 631 | 630,-1.00E+00 632 | 631,1.00E+00 633 | 632,-1.00E+00 634 | 633,1.00E+00 635 | 634,1.00E+00 636 | 635,1.00E+00 637 | 636,1.00E+00 638 | 637,-1.00E+00 639 | 638,-1.00E+00 640 | 639,1.00E+00 641 | 640,-1.00E+00 642 | 641,-1.00E+00 643 | 642,1.00E+00 644 | 643,1.00E+00 645 | 644,1.00E+00 646 | 645,1.00E+00 647 | 646,-1.00E+00 648 | 647,-1.00E+00 649 | 648,1.00E+00 650 | 649,-1.00E+00 651 | 650,1.00E+00 652 | 651,1.00E+00 653 | 652,1.00E+00 654 | 653,-1.00E+00 655 | 654,1.00E+00 656 | 655,1.00E+00 657 | 656,1.00E+00 658 | 657,-1.00E+00 659 | 658,-1.00E+00 660 | 659,1.00E+00 661 | 660,-1.00E+00 662 | 661,-1.00E+00 663 | 662,1.00E+00 664 | 663,-1.00E+00 665 | 664,-1.00E+00 666 | 665,1.00E+00 667 | 666,-1.00E+00 668 | 667,1.00E+00 669 | 668,-1.00E+00 670 | 669,-1.00E+00 671 | 670,1.00E+00 672 | 671,-1.00E+00 673 | 672,-1.00E+00 674 | 673,-1.00E+00 675 | 674,-1.00E+00 676 | 675,-1.00E+00 677 | 676,1.00E+00 678 | 677,-1.00E+00 679 | 678,-1.00E+00 680 | 679,-1.00E+00 681 | 680,-1.00E+00 682 | 681,-1.00E+00 683 | 682,-1.00E+00 684 | 683,1.00E+00 685 | 684,1.00E+00 686 | 685,1.00E+00 687 | 686,1.00E+00 688 | 687,1.00E+00 689 | 688,1.00E+00 690 | 689,-1.00E+00 691 | 690,1.00E+00 692 | 691,-1.00E+00 693 | 692,1.00E+00 694 | 693,-1.00E+00 695 | 694,-1.00E+00 696 | 695,-1.00E+00 697 | 696,-1.00E+00 698 | 697,-1.00E+00 699 | 698,1.00E+00 700 | 699,-1.00E+00 701 | 700,-1.00E+00 702 | 701,-1.00E+00 703 | 702,1.00E+00 704 | 703,1.00E+00 705 | 704,1.00E+00 706 | 705,-1.00E+00 707 | 706,1.00E+00 708 | 707,1.00E+00 709 | 708,1.00E+00 710 | 709,-1.00E+00 711 | 710,-1.00E+00 712 | 711,-1.00E+00 713 | 712,1.00E+00 714 | 713,-1.00E+00 715 | 714,-1.00E+00 716 | 715,-1.00E+00 717 | 716,1.00E+00 718 | 717,-1.00E+00 719 | 718,1.00E+00 720 | 719,-1.00E+00 721 | 720,-1.00E+00 722 | 721,-1.00E+00 723 | 722,-1.00E+00 724 | 723,1.00E+00 725 | 724,-1.00E+00 726 | 725,1.00E+00 727 | 726,1.00E+00 728 | 727,1.00E+00 729 | 728,1.00E+00 730 | 729,1.00E+00 731 | 730,1.00E+00 732 | 731,-1.00E+00 733 | 732,-1.00E+00 734 | 733,-1.00E+00 735 | 734,1.00E+00 736 | 735,-1.00E+00 737 | 736,-1.00E+00 738 | 737,-1.00E+00 739 | 738,1.00E+00 740 | 739,1.00E+00 741 | 740,-1.00E+00 742 | 741,-1.00E+00 743 | 742,1.00E+00 744 | 743,-1.00E+00 745 | 744,-1.00E+00 746 | 745,1.00E+00 747 | 746,1.00E+00 748 | 747,-1.00E+00 749 | 748,-1.00E+00 750 | 749,1.00E+00 751 | 750,1.00E+00 752 | 751,-1.00E+00 753 | 752,1.00E+00 754 | 753,1.00E+00 755 | 754,1.00E+00 756 | 755,1.00E+00 757 | 756,-1.00E+00 758 | 757,1.00E+00 759 | 758,1.00E+00 760 | 759,-1.00E+00 761 | 760,1.00E+00 762 | 761,-1.00E+00 763 | 762,1.00E+00 764 | 763,-1.00E+00 765 | 764,-1.00E+00 766 | 765,-1.00E+00 767 | 766,1.00E+00 768 | 767,-1.00E+00 769 | 768,-1.00E+00 770 | 769,1.00E+00 771 | 770,1.00E+00 772 | 771,1.00E+00 773 | 772,1.00E+00 774 | 773,-1.00E+00 775 | 774,-1.00E+00 776 | 775,-1.00E+00 777 | 776,1.00E+00 778 | 777,-1.00E+00 779 | 778,1.00E+00 780 | 779,-1.00E+00 781 | 780,1.00E+00 782 | 781,-1.00E+00 783 | 782,1.00E+00 784 | 783,-1.00E+00 785 | 784,1.00E+00 786 | 785,1.00E+00 787 | 786,-1.00E+00 788 | 787,1.00E+00 789 | 788,1.00E+00 790 | 789,1.00E+00 791 | 790,-1.00E+00 792 | 791,1.00E+00 793 | 792,-1.00E+00 794 | 793,1.00E+00 795 | 794,-1.00E+00 796 | 795,1.00E+00 797 | 796,1.00E+00 798 | 797,-1.00E+00 799 | 798,-1.00E+00 800 | 799,-1.00E+00 801 | 800,-1.00E+00 802 | 801,-1.00E+00 803 | 802,1.00E+00 804 | 803,-1.00E+00 805 | 804,-1.00E+00 806 | 805,-1.00E+00 807 | 806,1.00E+00 808 | 807,-1.00E+00 809 | 808,-1.00E+00 810 | 809,-1.00E+00 811 | 810,-1.00E+00 812 | 811,1.00E+00 813 | 812,-1.00E+00 814 | 813,1.00E+00 815 | 814,-1.00E+00 816 | 815,-1.00E+00 817 | 816,1.00E+00 818 | 817,1.00E+00 819 | 818,1.00E+00 820 | 819,1.00E+00 821 | 820,-1.00E+00 822 | 821,-1.00E+00 823 | 822,1.00E+00 824 | 823,1.00E+00 825 | 824,1.00E+00 826 | 825,1.00E+00 827 | 826,1.00E+00 828 | 827,1.00E+00 829 | 828,1.00E+00 830 | 829,1.00E+00 831 | 830,1.00E+00 832 | 831,1.00E+00 833 | 832,1.00E+00 834 | 833,1.00E+00 835 | 834,-1.00E+00 836 | 835,1.00E+00 837 | 836,1.00E+00 838 | 837,-1.00E+00 839 | 838,-1.00E+00 840 | 839,-1.00E+00 841 | 840,1.00E+00 842 | 841,-1.00E+00 843 | 842,1.00E+00 844 | 843,1.00E+00 845 | 844,1.00E+00 846 | 845,-1.00E+00 847 | 846,-1.00E+00 848 | 847,1.00E+00 849 | 848,-1.00E+00 850 | 849,-1.00E+00 851 | 850,1.00E+00 852 | 851,1.00E+00 853 | 852,1.00E+00 854 | 853,-1.00E+00 855 | 854,1.00E+00 856 | 855,1.00E+00 857 | 856,1.00E+00 858 | 857,1.00E+00 859 | 858,-1.00E+00 860 | 859,-1.00E+00 861 | 860,1.00E+00 862 | 861,-1.00E+00 863 | 862,1.00E+00 864 | 863,1.00E+00 865 | 864,1.00E+00 866 | 865,1.00E+00 867 | 866,1.00E+00 868 | 867,-1.00E+00 869 | 868,1.00E+00 870 | 869,-1.00E+00 871 | 870,-1.00E+00 872 | 871,-1.00E+00 873 | 872,1.00E+00 874 | 873,1.00E+00 875 | 874,-1.00E+00 876 | 875,1.00E+00 877 | 876,-1.00E+00 878 | 877,-1.00E+00 879 | 878,1.00E+00 880 | 879,-1.00E+00 881 | 880,-1.00E+00 882 | 881,-1.00E+00 883 | 882,1.00E+00 884 | 883,1.00E+00 885 | 884,1.00E+00 886 | 885,-1.00E+00 887 | 886,1.00E+00 888 | 887,1.00E+00 889 | 888,-1.00E+00 890 | 889,-1.00E+00 891 | 890,-1.00E+00 892 | 891,-1.00E+00 893 | 892,-1.00E+00 894 | 893,-1.00E+00 895 | 894,-1.00E+00 896 | 895,-1.00E+00 897 | 896,1.00E+00 898 | 897,-1.00E+00 899 | 898,-1.00E+00 900 | 899,1.00E+00 901 | 900,-1.00E+00 902 | 901,1.00E+00 903 | 902,1.00E+00 904 | 903,1.00E+00 905 | 904,1.00E+00 906 | 905,-1.00E+00 907 | 906,1.00E+00 908 | 907,-1.00E+00 909 | 908,-1.00E+00 910 | 909,1.00E+00 911 | 910,-1.00E+00 912 | 911,1.00E+00 913 | 912,-1.00E+00 914 | 913,1.00E+00 915 | 914,-1.00E+00 916 | 915,-1.00E+00 917 | 916,-1.00E+00 918 | 917,1.00E+00 919 | 918,-1.00E+00 920 | 919,1.00E+00 921 | 920,-1.00E+00 922 | 921,1.00E+00 923 | 922,1.00E+00 924 | 923,-1.00E+00 925 | 924,-1.00E+00 926 | 925,-1.00E+00 927 | 926,-1.00E+00 928 | 927,1.00E+00 929 | 928,-1.00E+00 930 | 929,1.00E+00 931 | 930,1.00E+00 932 | 931,1.00E+00 933 | 932,-1.00E+00 934 | 933,-1.00E+00 935 | 934,-1.00E+00 936 | 935,-1.00E+00 937 | 936,-1.00E+00 938 | 937,1.00E+00 939 | 938,1.00E+00 940 | 939,1.00E+00 941 | 940,-1.00E+00 942 | 941,-1.00E+00 943 | 942,1.00E+00 944 | 943,-1.00E+00 945 | 944,1.00E+00 946 | 945,-1.00E+00 947 | 946,-1.00E+00 948 | 947,-1.00E+00 949 | 948,-1.00E+00 950 | 949,-1.00E+00 951 | 950,-1.00E+00 952 | 951,-1.00E+00 953 | 952,-1.00E+00 954 | 953,1.00E+00 955 | 954,1.00E+00 956 | 955,1.00E+00 957 | 956,-1.00E+00 958 | 957,-1.00E+00 959 | 958,1.00E+00 960 | 959,-1.00E+00 961 | 960,-1.00E+00 962 | 961,-1.00E+00 963 | 962,-1.00E+00 964 | 963,-1.00E+00 965 | 964,1.00E+00 966 | 965,-1.00E+00 967 | 966,1.00E+00 968 | 967,-1.00E+00 969 | 968,-1.00E+00 970 | 969,1.00E+00 971 | 970,-1.00E+00 972 | 971,-1.00E+00 973 | 972,-1.00E+00 974 | 973,-1.00E+00 975 | 974,-1.00E+00 976 | 975,-1.00E+00 977 | 976,-1.00E+00 978 | 977,-1.00E+00 979 | 978,1.00E+00 980 | 979,-1.00E+00 981 | 980,-1.00E+00 982 | 981,-1.00E+00 983 | 982,-1.00E+00 984 | 983,1.00E+00 985 | 984,1.00E+00 986 | 985,-1.00E+00 987 | 986,1.00E+00 988 | 987,1.00E+00 989 | 988,-1.00E+00 990 | 989,1.00E+00 991 | 990,-1.00E+00 992 | 991,-1.00E+00 993 | 992,-1.00E+00 994 | 993,-1.00E+00 995 | 994,-1.00E+00 996 | 995,-1.00E+00 997 | 996,-1.00E+00 998 | 997,-1.00E+00 999 | 998,-1.00E+00 1000 | 999,-1.00E+00 1001 | 1000,1.00E+00 1002 | 1001,1.00E+00 1003 | 1002,1.00E+00 1004 | 1003,-1.00E+00 1005 | 1004,-1.00E+00 1006 | 1005,-1.00E+00 1007 | 1006,-1.00E+00 1008 | 1007,-1.00E+00 1009 | 1008,-1.00E+00 1010 | 1009,1.00E+00 1011 | 1010,1.00E+00 1012 | 1011,-1.00E+00 1013 | 1012,-1.00E+00 1014 | 1013,1.00E+00 1015 | 1014,-1.00E+00 1016 | 1015,-1.00E+00 1017 | 1016,-1.00E+00 1018 | 1017,1.00E+00 1019 | 1018,1.00E+00 1020 | 1019,-1.00E+00 1021 | 1020,-1.00E+00 1022 | 1021,-1.00E+00 1023 | 1022,1.00E+00 1024 | 1023,1.00E+00 1025 | 1024,1.00E+00 1026 | 1025,-1.00E+00 1027 | 1026,-1.00E+00 1028 | 1027,-1.00E+00 1029 | 1028,1.00E+00 1030 | 1029,-1.00E+00 1031 | 1030,-1.00E+00 1032 | 1031,-1.00E+00 1033 | 1032,1.00E+00 1034 | 1033,1.00E+00 1035 | 1034,1.00E+00 1036 | 1035,1.00E+00 1037 | 1036,1.00E+00 1038 | 1037,1.00E+00 1039 | 1038,-1.00E+00 1040 | 1039,-1.00E+00 1041 | 1040,1.00E+00 1042 | 1041,-1.00E+00 1043 | 1042,-1.00E+00 1044 | 1043,-1.00E+00 1045 | 1044,-1.00E+00 1046 | 1045,-1.00E+00 1047 | 1046,-1.00E+00 1048 | 1047,1.00E+00 1049 | 1048,1.00E+00 1050 | 1049,-1.00E+00 1051 | 1050,-1.00E+00 1052 | 1051,-1.00E+00 1053 | 1052,-1.00E+00 1054 | 1053,-1.00E+00 1055 | 1054,-1.00E+00 1056 | 1055,-1.00E+00 1057 | 1056,1.00E+00 1058 | 1057,-1.00E+00 1059 | 1058,-1.00E+00 1060 | 1059,1.00E+00 1061 | 1060,-1.00E+00 1062 | 1061,-1.00E+00 1063 | 1062,-1.00E+00 1064 | 1063,1.00E+00 1065 | 1064,-1.00E+00 1066 | 1065,1.00E+00 1067 | 1066,1.00E+00 1068 | 1067,1.00E+00 1069 | 1068,-1.00E+00 1070 | 1069,1.00E+00 1071 | 1070,1.00E+00 1072 | 1071,-1.00E+00 1073 | 1072,-1.00E+00 1074 | 1073,-1.00E+00 1075 | 1074,1.00E+00 1076 | 1075,-1.00E+00 1077 | 1076,-1.00E+00 1078 | 1077,1.00E+00 1079 | 1078,-1.00E+00 1080 | 1079,-1.00E+00 1081 | 1080,1.00E+00 1082 | 1081,-1.00E+00 1083 | 1082,-1.00E+00 1084 | 1083,-1.00E+00 1085 | 1084,1.00E+00 1086 | 1085,1.00E+00 1087 | 1086,1.00E+00 1088 | 1087,1.00E+00 1089 | 1088,-1.00E+00 1090 | 1089,-1.00E+00 1091 | 1090,-1.00E+00 1092 | 1091,-1.00E+00 1093 | 1092,-1.00E+00 1094 | 1093,1.00E+00 1095 | 1094,-1.00E+00 1096 | 1095,-1.00E+00 1097 | 1096,-1.00E+00 1098 | 1097,-1.00E+00 1099 | 1098,-1.00E+00 1100 | 1099,-1.00E+00 1101 | 1100,1.00E+00 1102 | 1101,-1.00E+00 1103 | 1102,1.00E+00 1104 | 1103,1.00E+00 1105 | 1104,-1.00E+00 1106 | 1105,1.00E+00 1107 | 1106,-1.00E+00 1108 | 1107,-1.00E+00 1109 | 1108,-1.00E+00 1110 | 1109,1.00E+00 1111 | 1110,-1.00E+00 1112 | 1111,1.00E+00 1113 | 1112,1.00E+00 1114 | 1113,-1.00E+00 1115 | 1114,-1.00E+00 1116 | 1115,-1.00E+00 1117 | 1116,1.00E+00 1118 | 1117,1.00E+00 1119 | 1118,1.00E+00 1120 | 1119,-1.00E+00 1121 | 1120,-1.00E+00 1122 | 1121,1.00E+00 1123 | 1122,-1.00E+00 1124 | 1123,-1.00E+00 1125 | 1124,1.00E+00 1126 | 1125,-1.00E+00 1127 | 1126,-1.00E+00 1128 | 1127,-1.00E+00 1129 | 1128,-1.00E+00 1130 | 1129,1.00E+00 1131 | 1130,-1.00E+00 1132 | 1131,1.00E+00 1133 | 1132,1.00E+00 1134 | 1133,-1.00E+00 1135 | 1134,1.00E+00 1136 | 1135,1.00E+00 1137 | 1136,-1.00E+00 1138 | 1137,1.00E+00 1139 | 1138,1.00E+00 1140 | 1139,-1.00E+00 1141 | 1140,1.00E+00 1142 | 1141,-1.00E+00 1143 | 1142,-1.00E+00 1144 | 1143,-1.00E+00 1145 | 1144,1.00E+00 1146 | 1145,1.00E+00 1147 | 1146,1.00E+00 1148 | 1147,-1.00E+00 1149 | 1148,-1.00E+00 1150 | 1149,1.00E+00 1151 | 1150,-1.00E+00 1152 | 1151,1.00E+00 1153 | 1152,1.00E+00 1154 | 1153,1.00E+00 1155 | 1154,-1.00E+00 1156 | 1155,-1.00E+00 1157 | 1156,1.00E+00 1158 | 1157,-1.00E+00 1159 | 1158,1.00E+00 1160 | 1159,1.00E+00 1161 | 1160,-1.00E+00 1162 | 1161,1.00E+00 1163 | 1162,-1.00E+00 1164 | 1163,-1.00E+00 1165 | 1164,1.00E+00 1166 | 1165,-1.00E+00 1167 | 1166,-1.00E+00 1168 | 1167,1.00E+00 1169 | 1168,-1.00E+00 1170 | 1169,-1.00E+00 1171 | 1170,1.00E+00 1172 | 1171,-1.00E+00 1173 | 1172,-1.00E+00 1174 | 1173,1.00E+00 1175 | 1174,-1.00E+00 1176 | 1175,1.00E+00 1177 | 1176,-1.00E+00 1178 | 1177,1.00E+00 1179 | 1178,-1.00E+00 1180 | 1179,1.00E+00 1181 | 1180,-1.00E+00 1182 | 1181,-1.00E+00 1183 | 1182,1.00E+00 1184 | 1183,1.00E+00 1185 | 1184,1.00E+00 1186 | 1185,-1.00E+00 1187 | 1186,-1.00E+00 1188 | 1187,1.00E+00 1189 | 1188,-1.00E+00 1190 | 1189,-1.00E+00 1191 | 1190,1.00E+00 1192 | 1191,1.00E+00 1193 | 1192,-1.00E+00 1194 | 1193,1.00E+00 1195 | 1194,1.00E+00 1196 | 1195,1.00E+00 1197 | 1196,-1.00E+00 1198 | 1197,-1.00E+00 1199 | 1198,-1.00E+00 1200 | 1199,1.00E+00 1201 | 1200,1.00E+00 1202 | 1201,-1.00E+00 1203 | 1202,-1.00E+00 1204 | 1203,1.00E+00 1205 | 1204,-1.00E+00 1206 | 1205,-1.00E+00 1207 | 1206,-1.00E+00 1208 | 1207,-1.00E+00 1209 | 1208,1.00E+00 1210 | 1209,-1.00E+00 1211 | 1210,-1.00E+00 1212 | 1211,1.00E+00 1213 | 1212,-1.00E+00 1214 | 1213,1.00E+00 1215 | 1214,1.00E+00 1216 | 1215,-1.00E+00 1217 | 1216,1.00E+00 1218 | 1217,-1.00E+00 1219 | 1218,-1.00E+00 1220 | 1219,-1.00E+00 1221 | 1220,1.00E+00 1222 | 1221,-1.00E+00 1223 | 1222,-1.00E+00 1224 | 1223,1.00E+00 1225 | 1224,1.00E+00 1226 | 1225,1.00E+00 1227 | 1226,-1.00E+00 1228 | 1227,1.00E+00 1229 | 1228,-1.00E+00 1230 | 1229,1.00E+00 1231 | 1230,-1.00E+00 1232 | 1231,-1.00E+00 1233 | 1232,1.00E+00 1234 | 1233,-1.00E+00 1235 | 1234,1.00E+00 1236 | 1235,1.00E+00 1237 | 1236,-1.00E+00 1238 | 1237,-1.00E+00 1239 | 1238,1.00E+00 1240 | 1239,-1.00E+00 1241 | 1240,1.00E+00 1242 | 1241,-1.00E+00 1243 | 1242,1.00E+00 1244 | 1243,-1.00E+00 1245 | 1244,-1.00E+00 1246 | 1245,1.00E+00 1247 | 1246,1.00E+00 1248 | 1247,-1.00E+00 1249 | 1248,1.00E+00 1250 | 1249,1.00E+00 1251 | 1250,1.00E+00 1252 | 1251,-1.00E+00 1253 | 1252,-1.00E+00 1254 | 1253,1.00E+00 1255 | 1254,1.00E+00 1256 | 1255,-1.00E+00 1257 | 1256,-1.00E+00 1258 | 1257,-1.00E+00 1259 | 1258,1.00E+00 1260 | 1259,-1.00E+00 1261 | 1260,-1.00E+00 1262 | 1261,-1.00E+00 1263 | 1262,-1.00E+00 1264 | 1263,1.00E+00 1265 | 1264,1.00E+00 1266 | 1265,-1.00E+00 1267 | 1266,1.00E+00 1268 | 1267,-1.00E+00 1269 | 1268,-1.00E+00 1270 | 1269,-1.00E+00 1271 | 1270,1.00E+00 1272 | 1271,1.00E+00 1273 | 1272,-1.00E+00 1274 | 1273,-1.00E+00 1275 | 1274,-1.00E+00 1276 | 1275,-1.00E+00 1277 | 1276,-1.00E+00 1278 | 1277,1.00E+00 1279 | 1278,-1.00E+00 1280 | 1279,1.00E+00 1281 | 1280,1.00E+00 1282 | 1281,-1.00E+00 1283 | 1282,-1.00E+00 1284 | 1283,-1.00E+00 1285 | 1284,-1.00E+00 1286 | 1285,-1.00E+00 1287 | 1286,1.00E+00 1288 | 1287,1.00E+00 1289 | 1288,-1.00E+00 1290 | 1289,-1.00E+00 1291 | 1290,-1.00E+00 1292 | 1291,1.00E+00 1293 | 1292,-1.00E+00 1294 | 1293,-1.00E+00 1295 | 1294,-1.00E+00 1296 | 1295,1.00E+00 1297 | 1296,-1.00E+00 1298 | 1297,1.00E+00 1299 | 1298,-1.00E+00 1300 | 1299,-1.00E+00 1301 | 1300,1.00E+00 1302 | 1301,-1.00E+00 1303 | 1302,1.00E+00 1304 | 1303,-1.00E+00 1305 | 1304,-1.00E+00 1306 | 1305,-1.00E+00 1307 | 1306,-1.00E+00 1308 | 1307,1.00E+00 1309 | 1308,-1.00E+00 1310 | 1309,-1.00E+00 1311 | 1310,-1.00E+00 1312 | 1311,1.00E+00 1313 | 1312,-1.00E+00 1314 | 1313,1.00E+00 1315 | 1314,-1.00E+00 1316 | 1315,-1.00E+00 1317 | 1316,1.00E+00 1318 | 1317,-1.00E+00 1319 | 1318,1.00E+00 1320 | 1319,-1.00E+00 1321 | 1320,-1.00E+00 1322 | 1321,-1.00E+00 1323 | 1322,-1.00E+00 1324 | 1323,-1.00E+00 1325 | 1324,-1.00E+00 1326 | 1325,-1.00E+00 1327 | 1326,-1.00E+00 1328 | 1327,1.00E+00 1329 | 1328,1.00E+00 1330 | 1329,-1.00E+00 1331 | 1330,-1.00E+00 1332 | 1331,-1.00E+00 1333 | 1332,-1.00E+00 1334 | 1333,-1.00E+00 1335 | 1334,1.00E+00 1336 | 1335,-1.00E+00 1337 | 1336,-1.00E+00 1338 | 1337,1.00E+00 1339 | 1338,-1.00E+00 1340 | 1339,-1.00E+00 1341 | 1340,-1.00E+00 1342 | 1341,-1.00E+00 1343 | 1342,1.00E+00 1344 | 1343,1.00E+00 1345 | 1344,1.00E+00 1346 | 1345,-1.00E+00 1347 | 1346,-1.00E+00 1348 | 1347,-1.00E+00 1349 | 1348,1.00E+00 1350 | 1349,-1.00E+00 1351 | 1350,-1.00E+00 1352 | 1351,1.00E+00 1353 | 1352,1.00E+00 1354 | 1353,-1.00E+00 1355 | 1354,-1.00E+00 1356 | 1355,-1.00E+00 1357 | 1356,1.00E+00 1358 | 1357,-1.00E+00 1359 | 1358,1.00E+00 1360 | 1359,1.00E+00 1361 | 1360,1.00E+00 1362 | 1361,-1.00E+00 1363 | 1362,-1.00E+00 1364 | 1363,1.00E+00 1365 | 1364,1.00E+00 1366 | 1365,1.00E+00 1367 | 1366,1.00E+00 1368 | 1367,-1.00E+00 1369 | 1368,1.00E+00 1370 | 1369,-1.00E+00 1371 | 1370,-1.00E+00 1372 | 1371,-1.00E+00 1373 | 1372,1.00E+00 1374 | 1373,-1.00E+00 1375 | 1374,-1.00E+00 1376 | 1375,-1.00E+00 1377 | 1376,-1.00E+00 1378 | 1377,1.00E+00 1379 | 1378,1.00E+00 1380 | 1379,-1.00E+00 1381 | 1380,-1.00E+00 1382 | 1381,1.00E+00 1383 | 1382,-1.00E+00 1384 | 1383,1.00E+00 1385 | 1384,-1.00E+00 1386 | 1385,-1.00E+00 1387 | 1386,-1.00E+00 1388 | 1387,-1.00E+00 1389 | 1388,1.00E+00 1390 | 1389,-1.00E+00 1391 | 1390,-1.00E+00 1392 | 1391,-1.00E+00 1393 | 1392,-1.00E+00 1394 | 1393,1.00E+00 1395 | 1394,1.00E+00 1396 | 1395,1.00E+00 1397 | 1396,-1.00E+00 1398 | 1397,1.00E+00 1399 | 1398,-1.00E+00 1400 | 1399,1.00E+00 1401 | 1400,1.00E+00 1402 | 1401,-1.00E+00 1403 | 1402,-1.00E+00 1404 | 1403,-1.00E+00 1405 | 1404,-1.00E+00 1406 | 1405,1.00E+00 1407 | 1406,1.00E+00 1408 | 1407,-1.00E+00 1409 | 1408,-1.00E+00 1410 | 1409,-1.00E+00 1411 | 1410,-1.00E+00 1412 | 1411,-1.00E+00 1413 | 1412,1.00E+00 1414 | 1413,-1.00E+00 1415 | 1414,-1.00E+00 1416 | 1415,-1.00E+00 1417 | 1416,1.00E+00 1418 | 1417,1.00E+00 1419 | 1418,-1.00E+00 1420 | 1419,1.00E+00 1421 | 1420,-1.00E+00 1422 | 1421,-1.00E+00 1423 | 1422,1.00E+00 1424 | 1423,1.00E+00 1425 | 1424,-1.00E+00 1426 | 1425,-1.00E+00 1427 | 1426,-1.00E+00 1428 | 1427,1.00E+00 1429 | 1428,-1.00E+00 1430 | 1429,-1.00E+00 1431 | 1430,-1.00E+00 1432 | 1431,-1.00E+00 1433 | 1432,-1.00E+00 1434 | 1433,-1.00E+00 1435 | 1434,1.00E+00 1436 | 1435,1.00E+00 1437 | 1436,-1.00E+00 1438 | 1437,1.00E+00 1439 | 1438,1.00E+00 1440 | 1439,1.00E+00 1441 | 1440,1.00E+00 1442 | 1441,-1.00E+00 1443 | 1442,-1.00E+00 1444 | 1443,1.00E+00 1445 | 1444,-1.00E+00 1446 | 1445,-1.00E+00 1447 | 1446,1.00E+00 1448 | 1447,-1.00E+00 1449 | 1448,1.00E+00 1450 | 1449,-1.00E+00 1451 | 1450,-1.00E+00 1452 | 1451,-1.00E+00 1453 | 1452,-1.00E+00 1454 | 1453,-1.00E+00 1455 | 1454,1.00E+00 1456 | 1455,-1.00E+00 1457 | 1456,-1.00E+00 1458 | 1457,-1.00E+00 1459 | 1458,-1.00E+00 1460 | 1459,1.00E+00 1461 | 1460,1.00E+00 1462 | 1461,1.00E+00 1463 | 1462,-1.00E+00 1464 | 1463,-1.00E+00 1465 | 1464,1.00E+00 1466 | 1465,-1.00E+00 1467 | 1466,-1.00E+00 1468 | 1467,-1.00E+00 1469 | 1468,-1.00E+00 1470 | 1469,1.00E+00 1471 | 1470,-1.00E+00 1472 | 1471,-1.00E+00 1473 | 1472,-1.00E+00 1474 | 1473,-1.00E+00 1475 | 1474,-1.00E+00 1476 | 1475,-1.00E+00 1477 | 1476,1.00E+00 1478 | 1477,-1.00E+00 1479 | 1478,1.00E+00 1480 | 1479,-1.00E+00 1481 | 1480,-1.00E+00 1482 | 1481,1.00E+00 1483 | 1482,1.00E+00 1484 | 1483,-1.00E+00 1485 | 1484,-1.00E+00 1486 | 1485,1.00E+00 1487 | 1486,1.00E+00 1488 | 1487,-1.00E+00 1489 | 1488,1.00E+00 1490 | 1489,-1.00E+00 1491 | 1490,-1.00E+00 1492 | 1491,1.00E+00 1493 | 1492,-1.00E+00 1494 | 1493,-1.00E+00 1495 | 1494,-1.00E+00 1496 | 1495,1.00E+00 1497 | 1496,-1.00E+00 1498 | 1497,1.00E+00 1499 | 1498,1.00E+00 1500 | 1499,-1.00E+00 1501 | 1500,1.00E+00 1502 | 1501,-1.00E+00 1503 | 1502,1.00E+00 1504 | 1503,-1.00E+00 1505 | 1504,-1.00E+00 1506 | 1505,-1.00E+00 1507 | 1506,1.00E+00 1508 | 1507,1.00E+00 1509 | 1508,-1.00E+00 1510 | 1509,-1.00E+00 1511 | 1510,1.00E+00 1512 | 1511,1.00E+00 1513 | 1512,1.00E+00 1514 | 1513,-1.00E+00 1515 | 1514,-1.00E+00 1516 | 1515,1.00E+00 1517 | 1516,1.00E+00 1518 | 1517,-1.00E+00 1519 | 1518,-1.00E+00 1520 | 1519,1.00E+00 1521 | 1520,-1.00E+00 1522 | 1521,-1.00E+00 1523 | 1522,1.00E+00 1524 | 1523,-1.00E+00 1525 | 1524,1.00E+00 1526 | 1525,-1.00E+00 1527 | 1526,-1.00E+00 1528 | 1527,-1.00E+00 1529 | 1528,1.00E+00 1530 | 1529,1.00E+00 1531 | 1530,-1.00E+00 1532 | 1531,-1.00E+00 1533 | 1532,-1.00E+00 1534 | 1533,-1.00E+00 1535 | 1534,-1.00E+00 1536 | 1535,-1.00E+00 1537 | 1536,-1.00E+00 1538 | 1537,-1.00E+00 1539 | 1538,-1.00E+00 1540 | 1539,1.00E+00 1541 | 1540,1.00E+00 1542 | 1541,-1.00E+00 1543 | 1542,-1.00E+00 1544 | 1543,1.00E+00 1545 | 1544,-1.00E+00 1546 | 1545,1.00E+00 1547 | 1546,-1.00E+00 1548 | 1547,-1.00E+00 1549 | 1548,-1.00E+00 1550 | 1549,-1.00E+00 1551 | 1550,1.00E+00 1552 | 1551,1.00E+00 1553 | 1552,1.00E+00 1554 | 1553,-1.00E+00 1555 | 1554,1.00E+00 1556 | 1555,-1.00E+00 1557 | 1556,-1.00E+00 1558 | 1557,1.00E+00 1559 | 1558,1.00E+00 1560 | 1559,1.00E+00 1561 | 1560,1.00E+00 1562 | 1561,-1.00E+00 1563 | 1562,1.00E+00 1564 | 1563,1.00E+00 1565 | 1564,-1.00E+00 1566 | 1565,1.00E+00 1567 | 1566,1.00E+00 1568 | 1567,-1.00E+00 1569 | 1568,-1.00E+00 1570 | 1569,-1.00E+00 1571 | 1570,1.00E+00 1572 | 1571,-1.00E+00 1573 | 1572,1.00E+00 1574 | 1573,-1.00E+00 1575 | 1574,1.00E+00 1576 | 1575,-1.00E+00 1577 | 1576,1.00E+00 1578 | 1577,-1.00E+00 1579 | 1578,-1.00E+00 1580 | 1579,-1.00E+00 1581 | 1580,-1.00E+00 1582 | 1581,-1.00E+00 1583 | 1582,-1.00E+00 1584 | 1583,1.00E+00 1585 | 1584,-1.00E+00 1586 | 1585,-1.00E+00 1587 | 1586,1.00E+00 1588 | 1587,-1.00E+00 1589 | 1588,-1.00E+00 1590 | 1589,-1.00E+00 1591 | 1590,-1.00E+00 1592 | 1591,-1.00E+00 1593 | 1592,1.00E+00 1594 | 1593,1.00E+00 1595 | 1594,-1.00E+00 1596 | 1595,1.00E+00 1597 | 1596,-1.00E+00 1598 | 1597,-1.00E+00 1599 | 1598,-1.00E+00 1600 | 1599,1.00E+00 1601 | 1600,-1.00E+00 1602 | 1601,1.00E+00 1603 | 1602,-1.00E+00 1604 | 1603,-1.00E+00 1605 | 1604,1.00E+00 1606 | 1605,-1.00E+00 1607 | 1606,1.00E+00 1608 | 1607,1.00E+00 1609 | 1608,1.00E+00 1610 | 1609,1.00E+00 1611 | 1610,-1.00E+00 1612 | 1611,-1.00E+00 1613 | 1612,-1.00E+00 1614 | 1613,-1.00E+00 1615 | 1614,-1.00E+00 1616 | 1615,1.00E+00 1617 | 1616,1.00E+00 1618 | 1617,-1.00E+00 1619 | 1618,-1.00E+00 1620 | 1619,-1.00E+00 1621 | 1620,-1.00E+00 1622 | 1621,-1.00E+00 1623 | 1622,1.00E+00 1624 | 1623,-1.00E+00 1625 | 1624,-1.00E+00 1626 | 1625,1.00E+00 1627 | 1626,-1.00E+00 1628 | 1627,-1.00E+00 1629 | 1628,-1.00E+00 1630 | 1629,1.00E+00 1631 | 1630,-1.00E+00 1632 | 1631,-1.00E+00 1633 | 1632,-1.00E+00 1634 | 1633,-1.00E+00 1635 | 1634,1.00E+00 1636 | 1635,1.00E+00 1637 | 1636,-1.00E+00 1638 | 1637,-1.00E+00 1639 | 1638,-1.00E+00 1640 | 1639,1.00E+00 1641 | 1640,1.00E+00 1642 | 1641,-1.00E+00 1643 | 1642,-1.00E+00 1644 | 1643,-1.00E+00 1645 | 1644,1.00E+00 1646 | 1645,-1.00E+00 1647 | 1646,-1.00E+00 1648 | 1647,-1.00E+00 1649 | 1648,-1.00E+00 1650 | 1649,1.00E+00 1651 | 1650,-1.00E+00 1652 | 1651,-1.00E+00 1653 | 1652,1.00E+00 1654 | 1653,1.00E+00 1655 | 1654,1.00E+00 1656 | 1655,1.00E+00 1657 | 1656,1.00E+00 1658 | 1657,-1.00E+00 1659 | 1658,1.00E+00 1660 | 1659,1.00E+00 1661 | 1660,1.00E+00 1662 | 1661,1.00E+00 1663 | 1662,1.00E+00 1664 | 1663,1.00E+00 1665 | 1664,1.00E+00 1666 | 1665,1.00E+00 1667 | 1666,-1.00E+00 1668 | 1667,-1.00E+00 1669 | 1668,-1.00E+00 1670 | 1669,-1.00E+00 1671 | 1670,-1.00E+00 1672 | 1671,1.00E+00 1673 | 1672,-1.00E+00 1674 | 1673,-1.00E+00 1675 | 1674,-1.00E+00 1676 | 1675,-1.00E+00 1677 | 1676,-1.00E+00 1678 | 1677,-1.00E+00 1679 | 1678,-1.00E+00 1680 | 1679,1.00E+00 1681 | 1680,-1.00E+00 1682 | 1681,1.00E+00 1683 | 1682,-1.00E+00 1684 | 1683,1.00E+00 1685 | 1684,1.00E+00 1686 | 1685,-1.00E+00 1687 | 1686,-1.00E+00 1688 | 1687,-1.00E+00 1689 | 1688,-1.00E+00 1690 | 1689,-1.00E+00 1691 | 1690,-1.00E+00 1692 | 1691,1.00E+00 1693 | 1692,-1.00E+00 1694 | 1693,-1.00E+00 1695 | 1694,-1.00E+00 1696 | 1695,1.00E+00 1697 | 1696,-1.00E+00 1698 | 1697,-1.00E+00 1699 | 1698,-1.00E+00 1700 | 1699,-1.00E+00 1701 | 1700,1.00E+00 1702 | 1701,-1.00E+00 1703 | 1702,-1.00E+00 1704 | 1703,-1.00E+00 1705 | 1704,-1.00E+00 1706 | 1705,-1.00E+00 1707 | 1706,1.00E+00 1708 | 1707,-1.00E+00 1709 | 1708,-1.00E+00 1710 | 1709,-1.00E+00 1711 | 1710,-1.00E+00 1712 | 1711,1.00E+00 1713 | 1712,1.00E+00 1714 | 1713,1.00E+00 1715 | 1714,-1.00E+00 1716 | 1715,-1.00E+00 1717 | 1716,-1.00E+00 1718 | 1717,-1.00E+00 1719 | 1718,1.00E+00 1720 | 1719,1.00E+00 1721 | 1720,1.00E+00 1722 | 1721,-1.00E+00 1723 | 1722,1.00E+00 1724 | 1723,-1.00E+00 1725 | 1724,-1.00E+00 1726 | 1725,1.00E+00 1727 | 1726,-1.00E+00 1728 | 1727,-1.00E+00 1729 | 1728,1.00E+00 1730 | 1729,-1.00E+00 1731 | 1730,1.00E+00 1732 | 1731,-1.00E+00 1733 | 1732,-1.00E+00 1734 | 1733,1.00E+00 1735 | 1734,-1.00E+00 1736 | 1735,-1.00E+00 1737 | 1736,-1.00E+00 1738 | 1737,-1.00E+00 1739 | 1738,-1.00E+00 1740 | 1739,-1.00E+00 1741 | 1740,1.00E+00 1742 | 1741,1.00E+00 1743 | 1742,1.00E+00 1744 | 1743,-1.00E+00 1745 | 1744,-1.00E+00 1746 | 1745,-1.00E+00 1747 | 1746,-1.00E+00 1748 | 1747,-1.00E+00 1749 | 1748,-1.00E+00 1750 | 1749,-1.00E+00 1751 | 1750,-1.00E+00 1752 | 1751,1.00E+00 1753 | 1752,1.00E+00 1754 | 1753,-1.00E+00 1755 | 1754,-1.00E+00 1756 | 1755,-1.00E+00 1757 | 1756,1.00E+00 1758 | 1757,-1.00E+00 1759 | 1758,1.00E+00 1760 | 1759,1.00E+00 1761 | 1760,1.00E+00 1762 | 1761,-1.00E+00 1763 | 1762,-1.00E+00 1764 | 1763,1.00E+00 1765 | 1764,-1.00E+00 1766 | 1765,-1.00E+00 1767 | 1766,1.00E+00 1768 | 1767,-1.00E+00 1769 | 1768,1.00E+00 1770 | 1769,1.00E+00 1771 | 1770,1.00E+00 1772 | 1771,1.00E+00 1773 | 1772,1.00E+00 1774 | 1773,-1.00E+00 1775 | 1774,-1.00E+00 1776 | 1775,1.00E+00 1777 | 1776,1.00E+00 1778 | 1777,-1.00E+00 1779 | 1778,1.00E+00 1780 | 1779,1.00E+00 1781 | 1780,-1.00E+00 1782 | 1781,1.00E+00 1783 | 1782,-1.00E+00 1784 | 1783,1.00E+00 1785 | 1784,-1.00E+00 1786 | 1785,-1.00E+00 1787 | 1786,1.00E+00 1788 | 1787,1.00E+00 1789 | 1788,-1.00E+00 1790 | 1789,-1.00E+00 1791 | 1790,1.00E+00 1792 | 1791,-1.00E+00 1793 | 1792,-1.00E+00 1794 | 1793,1.00E+00 1795 | 1794,1.00E+00 1796 | 1795,1.00E+00 1797 | 1796,-1.00E+00 1798 | 1797,-1.00E+00 1799 | 1798,-1.00E+00 1800 | 1799,-1.00E+00 1801 | 1800,-1.00E+00 1802 | 1801,-1.00E+00 1803 | 1802,-1.00E+00 1804 | 1803,-1.00E+00 1805 | 1804,-1.00E+00 1806 | 1805,1.00E+00 1807 | 1806,1.00E+00 1808 | 1807,1.00E+00 1809 | 1808,-1.00E+00 1810 | 1809,-1.00E+00 1811 | 1810,1.00E+00 1812 | 1811,-1.00E+00 1813 | 1812,-1.00E+00 1814 | 1813,1.00E+00 1815 | 1814,-1.00E+00 1816 | 1815,-1.00E+00 1817 | 1816,-1.00E+00 1818 | 1817,1.00E+00 1819 | 1818,-1.00E+00 1820 | 1819,1.00E+00 1821 | 1820,-1.00E+00 1822 | 1821,-1.00E+00 1823 | 1822,1.00E+00 1824 | 1823,1.00E+00 1825 | 1824,1.00E+00 1826 | 1825,-1.00E+00 1827 | 1826,-1.00E+00 1828 | 1827,-1.00E+00 1829 | 1828,-1.00E+00 1830 | 1829,1.00E+00 1831 | 1830,-1.00E+00 1832 | 1831,-1.00E+00 1833 | 1832,-1.00E+00 1834 | 1833,-1.00E+00 1835 | 1834,-1.00E+00 1836 | 1835,-1.00E+00 1837 | 1836,-1.00E+00 1838 | 1837,1.00E+00 1839 | 1838,-1.00E+00 1840 | 1839,-1.00E+00 1841 | 1840,-1.00E+00 1842 | 1841,1.00E+00 1843 | 1842,-1.00E+00 1844 | 1843,1.00E+00 1845 | 1844,-1.00E+00 1846 | 1845,-1.00E+00 1847 | 1846,-1.00E+00 1848 | 1847,1.00E+00 1849 | 1848,1.00E+00 1850 | 1849,-1.00E+00 1851 | 1850,-1.00E+00 1852 | 1851,1.00E+00 1853 | 1852,-1.00E+00 1854 | 1853,-1.00E+00 1855 | 1854,-1.00E+00 1856 | 1855,-1.00E+00 1857 | 1856,1.00E+00 1858 | 1857,-1.00E+00 1859 | 1858,1.00E+00 1860 | 1859,-1.00E+00 1861 | 1860,1.00E+00 1862 | 1861,1.00E+00 1863 | 1862,-1.00E+00 1864 | 1863,-1.00E+00 1865 | 1864,-1.00E+00 1866 | 1865,-1.00E+00 1867 | 1866,-1.00E+00 1868 | 1867,1.00E+00 1869 | 1868,1.00E+00 1870 | 1869,-1.00E+00 1871 | 1870,1.00E+00 1872 | 1871,1.00E+00 1873 | 1872,1.00E+00 1874 | 1873,-1.00E+00 1875 | 1874,-1.00E+00 1876 | 1875,1.00E+00 1877 | 1876,-1.00E+00 1878 | 1877,-1.00E+00 1879 | 1878,1.00E+00 1880 | 1879,1.00E+00 1881 | 1880,1.00E+00 1882 | 1881,1.00E+00 1883 | 1882,-1.00E+00 1884 | 1883,1.00E+00 1885 | 1884,-1.00E+00 1886 | 1885,1.00E+00 1887 | 1886,-1.00E+00 1888 | 1887,-1.00E+00 1889 | 1888,-1.00E+00 1890 | 1889,-1.00E+00 1891 | 1890,1.00E+00 1892 | 1891,-1.00E+00 1893 | 1892,-1.00E+00 1894 | 1893,1.00E+00 1895 | 1894,1.00E+00 1896 | 1895,1.00E+00 1897 | 1896,-1.00E+00 1898 | 1897,-1.00E+00 1899 | 1898,1.00E+00 1900 | 1899,1.00E+00 1901 | 1900,1.00E+00 1902 | 1901,1.00E+00 1903 | 1902,-1.00E+00 1904 | 1903,-1.00E+00 1905 | 1904,-1.00E+00 1906 | 1905,-1.00E+00 1907 | 1906,-1.00E+00 1908 | 1907,-1.00E+00 1909 | 1908,-1.00E+00 1910 | 1909,1.00E+00 1911 | 1910,-1.00E+00 1912 | 1911,-1.00E+00 1913 | 1912,1.00E+00 1914 | 1913,1.00E+00 1915 | 1914,-1.00E+00 1916 | 1915,-1.00E+00 1917 | 1916,1.00E+00 1918 | 1917,1.00E+00 1919 | 1918,-1.00E+00 1920 | 1919,-1.00E+00 1921 | 1920,1.00E+00 1922 | 1921,1.00E+00 1923 | 1922,-1.00E+00 1924 | 1923,1.00E+00 1925 | 1924,-1.00E+00 1926 | 1925,1.00E+00 1927 | 1926,1.00E+00 1928 | 1927,1.00E+00 1929 | 1928,-1.00E+00 1930 | 1929,-1.00E+00 1931 | 1930,1.00E+00 1932 | 1931,-1.00E+00 1933 | 1932,-1.00E+00 1934 | 1933,-1.00E+00 1935 | 1934,-1.00E+00 1936 | 1935,-1.00E+00 1937 | 1936,-1.00E+00 1938 | 1937,-1.00E+00 1939 | 1938,-1.00E+00 1940 | 1939,1.00E+00 1941 | 1940,-1.00E+00 1942 | 1941,-1.00E+00 1943 | 1942,1.00E+00 1944 | 1943,-1.00E+00 1945 | 1944,-1.00E+00 1946 | 1945,1.00E+00 1947 | 1946,1.00E+00 1948 | 1947,-1.00E+00 1949 | 1948,-1.00E+00 1950 | 1949,-1.00E+00 1951 | 1950,-1.00E+00 1952 | 1951,1.00E+00 1953 | 1952,1.00E+00 1954 | 1953,1.00E+00 1955 | 1954,1.00E+00 1956 | 1955,-1.00E+00 1957 | 1956,-1.00E+00 1958 | 1957,-1.00E+00 1959 | 1958,-1.00E+00 1960 | 1959,1.00E+00 1961 | 1960,-1.00E+00 1962 | 1961,1.00E+00 1963 | 1962,-1.00E+00 1964 | 1963,1.00E+00 1965 | 1964,1.00E+00 1966 | 1965,-1.00E+00 1967 | 1966,-1.00E+00 1968 | 1967,-1.00E+00 1969 | 1968,-1.00E+00 1970 | 1969,1.00E+00 1971 | 1970,-1.00E+00 1972 | 1971,1.00E+00 1973 | 1972,-1.00E+00 1974 | 1973,-1.00E+00 1975 | 1974,-1.00E+00 1976 | 1975,-1.00E+00 1977 | 1976,-1.00E+00 1978 | 1977,-1.00E+00 1979 | 1978,1.00E+00 1980 | 1979,1.00E+00 1981 | 1980,-1.00E+00 1982 | 1981,1.00E+00 1983 | 1982,-1.00E+00 1984 | 1983,1.00E+00 1985 | 1984,-1.00E+00 1986 | 1985,1.00E+00 1987 | 1986,1.00E+00 1988 | 1987,-1.00E+00 1989 | 1988,-1.00E+00 1990 | 1989,-1.00E+00 1991 | 1990,-1.00E+00 1992 | 1991,1.00E+00 1993 | 1992,-1.00E+00 1994 | 1993,-1.00E+00 1995 | 1994,-1.00E+00 1996 | 1995,-1.00E+00 1997 | 1996,-1.00E+00 1998 | 1997,1.00E+00 1999 | 1998,-1.00E+00 2000 | 1999,-1.00E+00 2001 | 2000,-1.00E+00 2002 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/README.md: -------------------------------------------------------------------------------- 1 | # T-shirts-and-dress-shirts-Images-MachineLearnign-CLassification-from-Fashion-MNIST- 2 | 3 | #### Develop a machine learning model that can classify between images of T-shirts and dress-shirts. 4 | You are given the following files: 5 | 1. TrainData.csv: It contains 12000 training examples. Each row contains 784 values. The dataset has been derived from Fashion-MNIST dataset. Each example is a flattened 28x28 pixel gray-scale image. You can reshape the examples to visualize what each image looks like. 6 | 2. TrainLabels.csv: This file contains true labels for the examples in TrainExamples.csv 7 | 3. TestData.csv: This file contains test examples. 8 | ### You can load train and test data using the following code: 9 | 1. Xtr=np.loadtxt("TrainData.csv") 10 | 2. Ytr=np.loadtxt("TrainLabels.csv") 11 | 3. Xts=np.loadtxt("TestData.csv") 12 | ### To visualize 13 | 1. import matplotlib.pyplot as plt 14 | 2. plt.imshow(Xtr[10].reshape([28,28])) 15 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/cross-validation code.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "import matplotlib.pyplot as plt\n", 12 | "%matplotlib inline" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 2, 18 | "metadata": {}, 19 | "outputs": [], 20 | "source": [ 21 | "import warnings\n", 22 | "warnings.filterwarnings('ignore')" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": 3, 28 | "metadata": {}, 29 | "outputs": [], 30 | "source": [ 31 | "Xtr=np.loadtxt(\"D:/freeLancing/Mini ML As-2/TrainData.csv\") \n", 32 | "Ytr=np.loadtxt(\"D:/freeLancing/Mini ML As-2/TrainLabels.csv\")\n", 33 | "Xts=np.loadtxt(\"D:/freeLancing/Mini ML As-2/TestData.csv\")" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": 4, 39 | "metadata": {}, 40 | "outputs": [ 41 | { 42 | "data": { 43 | "text/plain": [ 44 | "" 45 | ] 46 | }, 47 | "execution_count": 4, 48 | "metadata": {}, 49 | "output_type": "execute_result" 50 | }, 51 | { 52 | "data": { 53 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFOxJREFUeJzt3Xt0ldWZBvDnTXKSAAmXEEi4RO6CDCitkapYwWFQ8YZ2lo6sroqVirRlKjPOWrL4R5ZrOsPqtLa2ta7ByogjWnHUwqgzojiKUqUGinJXRC6BkBCuIRdyOe/8kYMravb7xXP7TtzPby1XTs5z9jk7n3n5zsn+9t6iqiAi/2SF3QEiCgeLn8hTLH4iT7H4iTzF4ifyFIufyFMsfiJPsfiJPMXiJ/JUTjpfLFfyNB+90vmSFDKJRJyZtrbajVN59akE5N30wtcm1KNZzwb9dAASLH4RuRbAwwCyAfxeVZdaj89HL3xLpifykvGTgOORyC9aKp+7m8spGezM2mqPmW317Nlkd+czkmP/6mtbW2IvENL/8426rsuPjfttv4hkA3gEwEwA4wHMFpHx8T4fEaVXIp/5JwPYo6p7VbUZwB8AzEpOt4go1RIp/iEADnb4vj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jtOQBWh9iXz8mUnZtdO0sj5GOXaTteh3KRT2wo41cAsgEsV9Wfpr0TnRCRkWg/2wPtKxs/HWbfROQZANPQPuurGsADAP4IYBWA8wAcAHCrqqb9D2+Ovk1D+1vXz3ZuPvcZO819uwLA2wC2Aji3xO9itH++Du3YGf2ajRCOG6/wI/IUr/Aj8hSLn8hTLH4iT7H4iTzF4ifyFIufyFMsfiJPsfiJPPX/5jL0UE7l3gAAAAAASUVORK5CYII=\n", 54 | "text/plain": [ 55 | "
" 56 | ] 57 | }, 58 | "metadata": { 59 | "needs_background": "light" 60 | }, 61 | "output_type": "display_data" 62 | } 63 | ], 64 | "source": [ 65 | "plt.imshow(Xts[1].reshape(28,28))" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": 5, 71 | "metadata": {}, 72 | "outputs": [ 73 | { 74 | "name": "stdout", 75 | "output_type": "stream", 76 | "text": [ 77 | "(12000, 784)\n", 78 | "(2000, 784)\n", 79 | "(12000,)\n" 80 | ] 81 | } 82 | ], 83 | "source": [ 84 | "print(Xtr.shape)\n", 85 | "print(Xts.shape)\n", 86 | "print(Ytr.shape)" 87 | ] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": {}, 92 | "source": [ 93 | "\n", 94 | "Shuffling the training dataset" 95 | ] 96 | }, 97 | { 98 | "cell_type": "code", 99 | "execution_count": 15, 100 | "metadata": {}, 101 | "outputs": [], 102 | "source": [ 103 | "np.random.seed(101)\n", 104 | "shuffle_index = np.random.permutation(12000)\n", 105 | "X_train, y_train = Xtr[shuffle_index], Ytr[shuffle_index]" 106 | ] 107 | }, 108 | { 109 | "cell_type": "markdown", 110 | "metadata": {}, 111 | "source": [ 112 | "After shuffling,The image at X_train[4]" 113 | ] 114 | }, 115 | { 116 | "cell_type": "code", 117 | "execution_count": 16, 118 | "metadata": {}, 119 | "outputs": [ 120 | { 121 | "data": { 122 | "text/plain": [ 123 | "" 124 | ] 125 | }, 126 | "execution_count": 16, 127 | "met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lbVd1V1BMBPAGxMYRwNT1X3ADhzxc0bAewsf74TY//zJC5ibA1BVftU9eXy5wMALu8sneprZ4wrFWmEfxGA8dvn9KKxtvxWAC+IyH4R2ZL2YCYwr7xt+uXt0+emPJ4rBXduTtIVO0s3zGtXzY7XtZZG+CdaYqiRWg7rVPUzAO4C8PXyr7dUmYp2bk7KBDtLN4Rqd7yutTTC3wtgybivFwOwF9BLkKqeKH/sB/A0Gm/34ZOXN0ktf+xPeTy/10g7N0+0szQa4LVrpB2v0wj/PgArRGSZiDQDuA/ArhTG8TEiki//IQYikgdwBxpv9+FdADaXP98M4JkUx/IRjbJzc9TO0kj5tWu0Ha9Tucin3Mr4VwBZADtU9R8TH8QERGQ5xs72wNgmpk+kOTYReRLAeozN+joJYBuA/wTwMwDXAngPwJdUNfE/vEWMbT3GfnX9/c7Nl99jJzy22wD8CsBBAJf3+t2KsffXqb12xrg2IYXXjVf4ETnFK/yInGL4iZxi+ImcYviJnGL4iZxi+ImcYviJnGL4iZz6f5bx6HTMRF24AAAAAElFTkSuQmCC\n", 133 | "text/plain": [ 134 | "
" 135 | ] 136 | }, 137 | "metadata": { 138 | "needs_background": "light" 139 | }, 140 | "output_type": "display_data" 141 | } 142 | ], 143 | "source": [ 144 | "plt.imshow(X_train[4].reshape(28,28))" 145 | ] 146 | }, 147 | { 148 | "cell_type": "markdown", 149 | "metadata": {}, 150 | "source": [ 151 | "# Feature Extraction" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": 17, 157 | "metadata": {}, 158 | "outputs": [], 159 | "source": [ 160 | "from sklearn.preprocessing import StandardScaler\n", 161 | "from sklearn.metrics import accuracy_score\n", 162 | "from sklearn.datasets import make_classification\n", 163 | "from sklearn.feature_selection import SelectKBest\n", 164 | "from sklearn.feature_selection import f_classif\n" 165 | ] 166 | }, 167 | { 168 | "cell_type": "code", 169 | "execution_count": 18, 170 | "metadata": {}, 171 | "outputs": [], 172 | "source": [ 173 | "def featureExtraction(X,Y):\n", 174 | " # define feature selection\n", 175 | " fs = SelectKBest(score_func=f_classif,)\n", 176 | " # apply feature selection\n", 177 | " X_selected = fs.fit_transform(X,Y)\n", 178 | " return X_selected" 179 | ] 180 | }, 181 | { 182 | "cell_type": "code", 183 | "execution_count": 19, 184 | "metadata": {}, 185 | "outputs": [ 186 | { 187 | "data": { 188 | "text/plain": [ 189 | "(12000, 10)" 190 | ] 191 | }, 192 | "execution_count": 19, 193 | "metadata": {}, 194 | "output_type": "execute_result" 195 | } 196 | ], 197 | "source": [ 198 | "x_new_train=featureExtraction(X_train,y_train)\n", 199 | "x_new_train.shape" 200 | ] 201 | }, 202 | { 203 | "cell_type": "code", 204 | "execution_count": 20, 205 | "metadata": {}, 206 | "outputs": [], 207 | "source": [ 208 | "scaler = StandardScaler()\n", 209 | "X_train_scaled = scaler.fit_transform(x_new_train.astype(np.float64))" 210 | ] 211 | }, 212 | { 213 | "cell_type": "markdown", 214 | "metadata": {}, 215 | "source": [ 216 | "# Using 5-fold cross-validation, optimize hyperparameters" 217 | ] 218 | }, 219 | { 220 | "cell_type": "markdown", 221 | "metadata": {}, 222 | "source": [ 223 | "First technique\n", 224 | "\n", 225 | "LogisticRegression" 226 | ] 227 | }, 228 | { 229 | "cell_type": "code", 230 | "execution_count": 22, 231 | "metadata": {}, 232 | "outputs": [], 233 | "source": [ 234 | "from sklearn.model_selection import GridSearchCV\n", 235 | "dual=[True,False]\n", 236 | "max_iter=[100,110,120,130,140]\n", 237 | "param_grid = dict(dual=dual,max_iter=max_iter)\n", 238 | "import time\n", 239 | "\n", 240 | "from sklearn.linear_model import LogisticRegression" 241 | ] 242 | }, 243 | { 244 | "cell_type": "code", 245 | "execution_count": 23, 246 | "metadata": {}, 247 | "outputs": [ 248 | { 249 | "name": "stdout", 250 | "output_type": "stream", 251 | "text": [ 252 | "Best: 0.504833 using {'dual': False, 'max_iter': 100}\n", 253 | "Execution time: 3.01692795753479 ms\n" 254 | ] 255 | } 256 | ], 257 | "source": [ 258 | "lr = LogisticRegression()\n", 259 | "grid = GridSearchCV(estimator=lr, param_grid=param_grid, cv = 5, n_jobs=-1)\n", 260 | "\n", 261 | "start_time = time.time()\n", 262 | "grid_result = grid.fit(x_new_train, Ytr)\n", 263 | "# Summarize results\n", 264 | "print(\"Best: %f using %s\" % (grid_result.best_score_, grid_result.best_params_))\n", 265 | "print(\"Execution time: \" + str((time.time() - start_time)) + ' ms')" 266 | ] 267 | }, 268 | { 269 | "cell_type": "code", 270 | "execution_count": null, 271 | "metadata": {}, 272 | "outputs": [], 273 | "source": [] 274 | }, 275 | { 276 | "cell_type": "markdown", 277 | "metadata": {}, 278 | "source": [ 279 | "Second technique\n", 280 | "\n", 281 | "Random Forest" 282 | ] 283 | }, 284 | { 285 | "cell_type": "code", 286 | "execution_count": 24, 287 | "metadata": {}, 288 | "outputs": [ 289 | { 290 | "name": "stdout", 291 | "output_type": "stream", 292 | "text": [ 293 | "Best: 0.500500 using {'max_features': 'sqrt', 'n_estimators': 10}\n", 294 | "0.500500 (0.003595) with: {'max_features': 'sqrt', 'n_estimators': 10}\n", 295 | "0.496750 (0.008245) with: {'max_features': 'sqrt', 'n_estimators': 100}\n", 296 | "0.500167 (0.009268) with: {'max_features': 'sqrt', 'n_estimators': 1000}\n", 297 | "0.494000 (0.007483) with: {'max_features': 'log2', 'n_estimators': 10}\n", 298 | "0.500167 (0.015362) with: {'max_features': 'log2', 'n_estimators': 100}\n", 299 | "0.498250 (0.011901) with: {'max_features': 'log2', 'n_estimators': 1000}\n" 300 | ] 301 | } 302 | ], 303 | "source": [ 304 | "from sklearn.model_selection import RepeatedStratifiedKFold\n", 305 | "from sklearn.model_selection import GridSearchCV\n", 306 | "from sklearn.ensemble import RandomForestClassifier\n", 307 | "# define models and parameters\n", 308 | "model = RandomForestClassifier()\n", 309 | "n_estimators = [10, 100, 1000]\n", 310 | "max_features = ['sqrt', 'log2']\n", 311 | "# define grid search\n", 312 | "grid = dict(n_estimators=n_estimators,max_features=max_features)\n", 313 | "grid_search = GridSearchCV(estimator=model, param_grid=grid, n_jobs=-1, cv=5, scoring='accuracy',error_score=0)\n", 314 | "grid_result = grid_search.fit(x_new_train, Ytr)\n", 315 | "# summarize results\n", 316 | "print(\"Best: %f using %s\" % (grid_result.best_score_, grid_result.best_params_))\n", 317 | "means = grid_result.cv_results_['mean_test_score']\n", 318 | "stds = grid_result.cv_results_['std_test_score']\n", 319 | "params = grid_result.cv_results_['params']\n", 320 | "for mean, stdev, param in zip(means, stds, params):\n", 321 | " print(\"%f (%f) with: %r\" % (mean, stdev, param))" 322 | ] 323 | }, 324 | { 325 | "cell_type": "code", 326 | "execution_count": 24, 327 | "metadata": {}, 328 | "outputs": [], 329 | "source": [ 330 | "# using two techniques. firstly logistic regression and secondly descion tree\n" 331 | ] 332 | }, 333 | { 334 | "cell_type": "markdown", 335 | "metadata": {}, 336 | "source": [ 337 | "Third tech\n", 338 | "\n" 339 | ] 340 | }, 341 | { 342 | "cell_type": "code", 343 | "execution_count": 31, 344 | "metadata": {}, 345 | "outputs": [ 346 | { 347 | "data": { 348 | "text/plain": [ 349 | "array([0.49645981, 0.49916667, 0.49541667, 0.49291667, 0.48770321])" 350 | ] 351 | }, 352 | "execution_count": 31, 353 | "metadata": {}, 354 | "output_type": "execute_result" 355 | } 356 | ], 357 | "source": [ 358 | "from sklearn.model_selection import cross_val_score\n", 359 | "from sklearn.neighbors import KNeighborsClassifier\n", 360 | "knn = KNeighborsClassifier(n_neighbors=5)\n", 361 | "scores = cross_val_score(knn, x_new_train , Ytr, cv=5, scoring='accuracy')\n", 362 | "scores" 363 | ] 364 | }, 365 | { 366 | "cell_type": "code", 367 | "execution_count": null, 368 | "metadata": {}, 369 | "outputs": [], 370 | "source": [] 371 | }, 372 | { 373 | "cell_type": "code", 374 | "execution_count": null, 375 | "metadata": {}, 376 | "outputs": [], 377 | "source": [] 378 | }, 379 | { 380 | "cell_type": "code", 381 | "execution_count": null, 382 | "metadata": {}, 383 | "outputs": [], 384 | "source": [] 385 | }, 386 | { 387 | "cell_type": "code", 388 | "execution_count": null, 389 | "metadata": {}, 390 | "outputs": [], 391 | "source": [] 392 | } 393 | ], 394 | "metadata": { 395 | "kernelspec": { 396 | "display_name": "Python 3", 397 | "language": "python", 398 | "name": "python3" 399 | }, 400 | "language_info": { 401 | "codemirror_mode": { 402 | "name": "ipython", 403 | "version": 3 404 | }, 405 | "file_extension": ".py", 406 | "mimetype": "text/x-python", 407 | "name": "python", 408 | "nbconvert_exporter": "python", 409 | "pygments_lexer": "ipython3", 410 | "version": "3.7.3" 411 | } 412 | }, 413 | "nbformat": 4, 414 | "nbformat_minor": 2 415 | } 416 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/model/RandomforestForMinist.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/model/RandomforestForMinist.pkl -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/model/myPredictions.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/model/myPredictions.csv -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/test.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 8, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import numpy as np\n", 10 | "import pandas as pd\n", 11 | "import matplotlib.pyplot as plt\n", 12 | "%matplotlib inline" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 4, 18 | "metadata": {}, 19 | "outputs": [], 20 | "source": [ 21 | "import pickle\n", 22 | "with open(\"D:/freeLancing/Mini ML As-2/model/RandomforestForMinist.pkl\", 'rb') as file:\n", 23 | " mymodel = pickle.load(file)" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": 9, 29 | "metadata": {}, 30 | "outputs": [], 31 | "source": [ 32 | "Xts=np.loadtxt(\"D:/freeLancing/Mini ML As-2/TestData.csv\")" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 11, 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [ 41 | "Yts=mymodel.predict(Xts)" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 12, 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "np.savetxt(\"D:/freeLancing/Mini ML As-2/model/myPredictions.csv\", Yts)" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [] 59 | } 60 | ], 61 | "metadata": { 62 | "kernelspec": { 63 | "display_name": "Python 3", 64 | "language": "python", 65 | "name": "python3" 66 | }, 67 | "language_info": { 68 | "codemirror_mode": { 69 | "name": "ipython", 70 | "version": 3 71 | }, 72 | "file_extension": ".py", 73 | "mimetype": "text/x-python", 74 | "name": "python", 75 | "nbconvert_exporter": "python", 76 | "pygments_lexer": "ipython3", 77 | "version": "3.7.3" 78 | } 79 | }, 80 | "nbformat": 4, 81 | "nbformat_minor": 2 82 | } 83 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Computer Vision/T-shirts and dress shirts Images CLassification from Fashion MNIST/training.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import pandas as pd\n", 10 | "import numpy as np\n", 11 | "import matplotlib.pyplot as plt\n", 12 | "%matplotlib inline" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": 3, 18 | "metadata": {}, 19 | "outputs": [], 20 | "source": [ 21 | "import warnings\n", 22 | "warnings.filterwarnings('ignore')" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": 4, 28 | "metadata": {}, 29 | "outputs": [], 30 | "source": [ 31 | "Xtr=np.loadtxt(\"D:/freeLancing/Mini ML As-2/TrainData.csv\") \n", 32 | "Ytr=np.loadtxt(\"D:/freeLancing/Mini ML As-2/TrainLabels.csv\")\n", 33 | "Xts=np.loadtxt(\"D:/freeLancing/Mini ML As-2/TestData.csv\")" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": 5, 39 | "metadata": {}, 40 | "outputs": [ 41 | { 42 | "data": { 43 | "text/plain": [ 44 | "" 45 | ] 46 | }, 47 | "execution_count": 5, 48 | "metadata": {}, 49 | "output_type": "execute_result" 50 | }, 51 | { 52 | "data": { 53 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFOxJREFUeJzt3Xt0ldWZBvDnTXKSAAmXEEi4RO6CDCitkapYwWFQ8YZ2lo6sroqVirRlKjPOWrL4R5ZrOsPqtLa2ta7ByogjWnHUwqgzojiKUqUGinJXRC6BkBCuIRdyOe/8kYMravb7xXP7TtzPby1XTs5z9jk7n3n5zsn+9t6iqiAi/2SF3QEiCgeLn8hTLH4iT7H4iTzF4ifyFIufyFMsfiJPsfiJPMXiJ/JUTjpfLFfyNB+90vmSFDKJRJyZtrbajVN59akE5N30wtcm1KNZzwb9dAASLH4RuRbAwwCyAfxeVZdaj89HL3xLpifykvGTgOORyC9aKp+7m8spGezM2mqPmW317Nlkd+czkmP/6m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8i83Yerz22SGvtaE3J/PpNJOzd3trM0MuDYZdKO12EU//sAxojICBHJBXA7gDUh9ONLRKRX7A8xEJFeAK5G5u0+vAbAnNjtOQBWh9iXz8mUnZtdO0sj5GOXaTteh3KRT2wo41cAsgEsV9Wfpr0TnRCRkWg/2wPtKxs/HWbfROQZANPQPuurGsADAP4IYBWA8wAcAHCrqqb9D2+Ovk1D+1vXz3ZuPvcZO819uwLA2wC2Aji3xO9itH++Du3YGf2ajRCOG6/wI/IUr/Aj8hSLn8hTLH4iT7H4iTzF4ifyFIufyFMsfiJPsfiJPPX/5jL0UE7l3gAAAAAASUVORK5CYII=\n", 54 | "text/plain": [ 55 | "
" 56 | ] 57 | }, 58 | "metadata": { 59 | "needs_background": "light" 60 | }, 61 | "output_type": "display_data" 62 | } 63 | ], 64 | "source": [ 65 | "plt.imshow(Xts[1].reshape(28,28))" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": 17, 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [ 74 | "np.random.seed(10)\n", 75 | "shuffle_index = np.random.permutation(12000)\n", 76 | "X_train, y_train = Xtr[shuffle_index], Ytr[shuffle_index]" 77 | ] 78 | }, 79 | { 80 | "cell_type": "markdown", 81 | "metadata": {}, 82 | "source": [ 83 | "# Feature extraction" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": 18, 89 | "metadata": {}, 90 | "outputs": [], 91 | "source": [ 92 | "from sklearn.preprocessing import StandardScaler\n", 93 | "from sklearn.metrics import accuracy_score\n", 94 | "from sklearn.datasets import make_classification\n", 95 | "from sklearn.feature_selection import SelectKBest\n", 96 | "from sklearn.feature_selection import f_classif\n" 97 | ] 98 | }, 99 | { 100 | "cell_type": "code", 101 | "execution_count": 19, 102 | "metadata": {}, 103 | "outputs": [ 104 | { 105 | "data": { 106 | "text/plain": [ 107 | "(12000, 10)" 108 | ] 109 | }, 110 | "execution_count": 19, 111 | "metadata": {}, 112 | "output_type": "execute_result" 113 | } 114 | ], 115 | "source": [ 116 | "def featureExtraction(X,Y):\n", 117 | " # define feature selection\n", 118 | " fs = SelectKBest(score_func=f_classif,)\n", 119 | " # apply feature selection\n", 120 | " X_selected = fs.fit_transform(X,Y)\n", 121 | " return X_selected\n", 122 | "x_new_train=featureExtraction(X_train,y_train)\n", 123 | "x_new_train.shape\n" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": 29, 129 | "metadata": {}, 130 | "outputs": [ 131 | { 132 | "data": { 133 | "text/plain": [ 134 | "" 135 | ] 136 | }, 137 | "execution_count": 29, 138 | "metadata": {}, 139 | "output_type": "execute_result" 140 | }, 141 | { 142 | "data": { 143 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFUNJREFUeJzt3WtsnNWdBvDnP+Px3Y7jJHYMSXBC00vKJbCGLpddcSksLV0Fui1qPnRZgRo+gNpK1WoR0i582JVQtxSQlu0qlKiwBVq6LQ3bRVuidFVKLwFD00ISSIAaGhLsOHESO77N5b8fPFQB/D6v8VzeSc7zk6LY85/jOX49j98Zn/ecY+4OEQlPKukOiEgyFH6RQCn8IoFS+EUCpfCLBErhFwmUwi8SKIVfJFAKv0ig6qr5YPXW4I1oqeZDnhCsqZHWJ7v57+hUuhBZK0yladu6CVpGIVNaHeQC0obD0f0GAIzFdE7eZxLHMO1TNpf7lhR+M7sKwL0A0gC+7e53svs3ogWfsMtLeciTUuqja2j95a800Xr7wvHI2rE9HbTtwp20jMkl/Hl0bFme1lPT0e1XPT5J29ovt9N6oiwmXwldNr/Nt875vvN+2W9maQD3AfgUgDUA1psZfxaLSM0o5T3/+QBedffX3X0awPcArCtPt0Sk0koJ/6kA/njc53uL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ADM2sBcCVqb/fhJwBcX/z4egCbE+zLu9TKzs1RO0sj4WNXazteJ3KRT3Eo4x4AaQCb3P1fqt6JWZjZKsyc7YGZTUwfSbJvZvYogEswM+trEMDtAH4M4DEAKwC8CeDz7l71P7xF9O0SzLx0/dPOze+8x65y3y4G8AsALwIoFG++DTPvrxM7dqRf65HAcdMVfiKB0hV+IoFS+EUCpfCLBErhFwmUwi8SKIVfJFAKv0igFH6RQP0/8vUW7RQoTMAAAAAASUVORK5CYII=\n", 144 | "text/plain": [ 145 | "
" 146 | ] 147 | }, 148 | "metadata": { 149 | "needs_background": "light" 150 | }, 151 | "output_type": "display_data" 152 | } 153 | ], 154 | "source": [ 155 | "plt.imshow(X_train[1].reshape(28,28))" 156 | ] 157 | }, 158 | { 159 | "cell_type": "markdown", 160 | "metadata": {}, 161 | "source": [ 162 | "# Training a model\n", 163 | "\n", 164 | "Random Forest Algorithm" 165 | ] 166 | }, 167 | { 168 | "cell_type": "code", 169 | "execution_count": 20, 170 | "metadata": {}, 171 | "outputs": [], 172 | "source": [ 173 | "from sklearn.model_selection import RepeatedStratifiedKFold\n", 174 | "from sklearn.model_selection import GridSearchCV\n", 175 | "from sklearn.ensemble import RandomForestClassifier\n", 176 | "# define models and parameters\n", 177 | "model = RandomForestClassifier()\n", 178 | "n_estimators = [10, 100, 1000]\n", 179 | "max_features = ['sqrt', 'log2']\n", 180 | "# define grid search\n", 181 | "grid = dict(n_estimators=n_estimators,max_features=max_features)\n", 182 | "grid_search = GridSearchCV(estimator=model, param_grid=grid, n_jobs=-1, cv=5, scoring='accuracy',error_score=0)\n", 183 | "grid_result = grid_search.fit(X_train, Ytr)\n", 184 | "# summarize results\n" 185 | ] 186 | }, 187 | { 188 | "cell_type": "code", 189 | "execution_count": 33, 190 | "metadata": {}, 191 | "outputs": [ 192 | { 193 | "data": { 194 | "text/plain": [ 195 | "0.5018333333333334" 196 | ] 197 | }, 198 | "execution_count": 33, 199 | "metadata": {}, 200 | "output_type": "execute_result" 201 | } 202 | ], 203 | "source": [ 204 | "grid_result.best_score_" 205 | ] 206 | }, 207 | { 208 | "cell_type": "code", 209 | "execution_count": 43, 210 | "metadata": {}, 211 | "outputs": [ 212 | { 213 | "data": { 214 | "text/plain": [ 215 | "array([-1., 1., 1., ..., 1., -1., -1.])" 216 | ] 217 | }, 218 | "execution_count": 43, 219 | "metadata": {}, 220 | "output_type": "execute_result" 221 | } 222 | ], 223 | "source": [ 224 | "grid_result.predict(X_train)\n" 225 | ] 226 | }, 227 | { 228 | "cell_type": "code", 229 | "execution_count": 58, 230 | "metadata": {}, 231 | "outputs": [], 232 | "source": [ 233 | "pkl_filename = \"D:/freeLancing/Mini ML As-2/model/RandomforestForMinist.pkl\"\n", 234 | "with open(pkl_filename, 'wb') as file:\n", 235 | " pickle.dump(grid_result, file)" 236 | ] 237 | }, 238 | { 239 | "cell_type": "code", 240 | "execution_count": null, 241 | "metadata": {}, 242 | "outputs": [], 243 | "source": [] 244 | }, 245 | { 246 | "cell_type": "code", 247 | "execution_count": null, 248 | "metadata": {}, 249 | "outputs": [], 250 | "source": [] 251 | } 252 | ], 253 | "metadata": { 254 | "kernelspec": { 255 | "display_name": "Python 3", 256 | "language": "python", 257 | "name": "python3" 258 | }, 259 | "language_info": { 260 | "codemirror_mode": { 261 | "name": "ipython", 262 | "version": 3 263 | }, 264 | "file_extension": ".py", 265 | "mimetype": "text/x-python", 266 | "name": "python", 267 | "nbconvert_exporter": "python", 268 | "pygments_lexer": "ipython3", 269 | "version": "3.7.3" 270 | } 271 | }, 272 | "nbformat": 4, 273 | "nbformat_minor": 2 274 | } 275 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Cyber security with AI/DDoS Attack Classification/README.md: -------------------------------------------------------------------------------- 1 | ### Introduction 2 | 3 | Distributed Denial of Service (DDoS) attacks are significant threats to the stability and reliability of online services. Detecting and mitigating these attacks is crucial to maintaining the integrity of networks and services. This project focuses on classifying DDoS attacks using various machine learning models. The dataset used for this project is the IDS 2017 dataset, which is publicly available and provides a comprehensive set of features for detecting DDoS attacks. 4 | 5 | The project involves several key steps: data preprocessing, exploration, splitting, model training, evaluation, and comparison. Each step is crucial to building an effective DDoS detection model. We employ multiple machine learning algorithms, including Random Forest, Logistic Regression, and Neural Networks, to classify the attacks and evaluate their performance using various metrics. 6 | 7 | ### Table of Contents 8 | 9 | 1. **Importing Libraries** 10 | 2. **Data Pre-processing** 11 | 3. **Data Exploring** 12 | 4. **Data Splitting** 13 | 5. **Model Training** 14 | - Random Forest 15 | - Logistic Regression 16 | - Neural Network 17 | 6. **Model Evaluation** 18 | - Accuracy 19 | - F1 Score 20 | - Recall 21 | - Precision 22 | - Confusion Matrix 23 | 7. **Model Comparison** 24 | 25 | ### Chapters Overview 26 | 27 | #### 1. Importing Libraries 28 | This chapter covers the importation of essential libraries used for data manipulation, visualization, model training, and evaluation. Libraries such as Pandas, NumPy, Matplotlib, Seaborn, and Scikit-learn are utilized. 29 | 30 | #### 2. Data Pre-processing 31 | This section involves preparing the data for analysis by cleaning and transforming it. Steps include handling missing values, converting categorical labels to numerical values, and ensuring data types are appropriate for analysis. 32 | 33 | #### 3. Data Exploring 34 | Data exploration involves generating descriptive statistics and visualizations to understand the distribution and relationships within the dataset. This step helps in identifying important features and potential issues with the data. 35 | 36 | #### 4. Data Splitting 37 | In this chapter, the data is split into training and testing sets. This step is crucial for evaluating the model's performance on unseen data, ensuring that the model generalizes well. 38 | 39 | #### 5. Model Training 40 | This section covers the training of different machine learning models: 41 | - **Random Forest**: An ensemble method that uses multiple decision trees to improve predictive accuracy. 42 | - **Logistic Regression**: A statistical model used for binary classification. 43 | - **Neural Network**: A computational model inspired by the human brain, capable of capturing complex patterns in the data. 44 | 45 | #### 6. Model Evaluation 46 | The trained models are evaluated using various metrics: 47 | - **Accuracy**: The proportion of correctly predicted instances. 48 | - **F1 Score**: The harmonic mean of precision and recall, useful for imbalanced datasets. 49 | - **Recall**: The ability of the model to identify all relevant instances. 50 | - **Precision**: The accuracy of the positive predictions. 51 | - **Confusion Matrix**: A table that describes the performance of the classification model. 52 | 53 | #### 7. Model Comparison 54 | In this chapter, the performance of the different models is compared using ROC curves and AUC scores. This comparison helps in identifying the best-performing model for DDoS attack classification. 55 | 56 | ### Conclusion 57 | The project systematically addresses the detection and classification of DDoS attacks using multiple machine learning models. By following the structured approach outlined in the chapters, we aim to build a robust model that can effectively distinguish between benign and malicious network traffic. 58 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Cyber security with AI/Detect AI-Generated Phishing Emails with BERT/Presentation.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Cyber security with AI/Detect AI-Generated Phishing Emails with BERT/Presentation.pptx -------------------------------------------------------------------------------- /Machine learning & Deep learning/Cyber security with AI/Detect AI-Generated Phishing Emails with BERT/README.md: -------------------------------------------------------------------------------- 1 | Dataset link: https://www.kaggle.com/datasets/naserabdullahalam/phishing-email-dataset?select=phishing_email.csv 2 | 3 | # 📧 Phishing Email Detection using BERT 4 | 5 | A deep learning-based project to detect phishing emails using **BERT (Bidirectional Encoder Representations from Transformers)**. This project showcases how transformer-based models can be fine-tuned for binary text classification to improve email security against AI-generated phishing attempts. 6 | 7 | --- 8 | 9 | ## 🔍 Project Overview 10 | 11 | With phishing emails becoming more sophisticated due to AI-generated content, traditional rule-based filters are no longer effective. This project uses the BERT model to classify emails as either phishing or legitimate by analyzing their textual content. By fine-tuning BERT on a labeled dataset, we aim to create a highly accurate and automated email classifier. 12 | 13 | --- 14 | 15 | ## 📂 Table of Contents 16 | 17 | 1. [Dataset Loading](#dataset-loading) 18 | 2. [Exploratory Data Analysis (EDA)](#exploratory-data-analysis-eda) 19 | 3. [Data Preprocessing](#data-preprocessing) 20 | 4. [Train-Validation-Test Split](#train-validation-test-split) 21 | 5. [Tokenization using BERT](#tokenization-using-bert) 22 | 6. [Dataset Preparation](#dataset-preparation) 23 | 7. [Model Setup and Training](#model-setup-and-training) 24 | 8. [Model Evaluation](#model-evaluation) 25 | 9. [Model Saving and Deployment](#model-saving-and-deployment) 26 | 10. [Future Work](#future-work) 27 | 28 | --- 29 | 30 | ## 📁 Dataset Loading 31 | 32 | - Raw dataset of emails with labels (`1` = phishing, `0` = legitimate) 33 | - Loaded using `pandas` for processing 34 | 35 | --- 36 | 37 | ## 📊 Exploratory Data Analysis (EDA) 38 | 39 | - 📊 Label Distribution 40 | - 🧾 Text Length Distribution 41 | - 🔗 Special Character & URL Analysis 42 | - ☁️ WordCloud of most frequent words in phishing emails 43 | 44 | --- 45 | 46 | ## 🧹 Data Preprocessing 47 | 48 | - Lowercasing text 49 | - Removing stopwords (`nltk`) 50 | - Filtering special characters 51 | - Encoding labels into integers 52 | 53 | --- 54 | 55 | ## 🔀 Train-Validation-Test Split 56 | 57 | - 70% Training 58 | - 10% Validation 59 | - 20% Testing 60 | - Using `train_test_split` with stratification 61 | 62 | --- 63 | 64 | ## 🔠 Tokenization using BERT 65 | 66 | - `bert-base-uncased` tokenizer from Hugging Face Transformers 67 | - Converts text into input IDs and attention masks 68 | 69 | --- 70 | 71 | ## 📦 Dataset Preparation 72 | 73 | - Custom `EmailDataset` class extends `torch.utils.data.Dataset` 74 | - Batches handled with Hugging Face `DataCollatorWithPadding` 75 | 76 | --- 77 | 78 | ## ⚙️ Model Setup and Training 79 | 80 | - Model: `BertForSequenceClassification` 81 | - Trainer API (`transformers`) with: 82 | - Learning rate: `2e-5` 83 | - Epochs: `5` 84 | - Batch size: `16` 85 | - Weight decay: `0.01` 86 | - Metrics: Accuracy, F1, Precision, Recall 87 | 88 | --- 89 | 90 | ## 🧪 Model Evaluation 91 | 92 | - Evaluated on validation and test sets 93 | - Plotted training vs validation loss and accuracy 94 | - Confusion matrix and classification report 95 | 96 | --- 97 | 98 | ## 💾 Model Saving and Deployment 99 | 100 | - Saved model and tokenizer for reuse 101 | - Ready for deployment in a web application or API 102 | - Model saved using `.save_pretrained()` and `.push_to_hub()` (optional) 103 | 104 | --- 105 | 106 | ## 🔮 Future Work 107 | 108 | - Web app with email upload interface 109 | - Gmail/Outlook API integration 110 | - Real-time phishing detection engine 111 | - Domain/sender-based feature enhancements 112 | 113 | --- 114 | 115 | ## ▶️ Video Demo 116 | 117 | 🎬 Watch full explanation and tutorial: 118 | [🔗 YouTube Link](https://youtube.com/your-link-here) 119 | 120 | --- 121 | 122 | ## 🛠️ Installation 123 | 124 | ```bash 125 | pip install transformers 126 | pip install torch 127 | pip install pandas 128 | pip install scikit-learn 129 | pip install nltk 130 | pip install matplotlib seaborn 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Cyber security with AI/Detect AI-Generated Phishing Emails with BERT/Read.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Cyber security with AI/Malware-detection-with-ML-and-deep-learning-main/MalwareData.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsimGull/Data-Science-Projects/398991bab68f2973e4594e95f67c9538b3a2e960/Machine learning & Deep learning/Cyber security with AI/Malware-detection-with-ML-and-deep-learning-main/MalwareData.zip -------------------------------------------------------------------------------- /Machine learning & Deep learning/Cyber security with AI/Malware-detection-with-ML-and-deep-learning-main/README.md: -------------------------------------------------------------------------------- 1 | # Project Overview 2 | 3 | This project focuses on the classification of DDoS (Distributed Denial of Service) attacks using machine learning techniques. DDoS attacks are a prevalent form of cyber threat wherein attackers overwhelm a target system with a flood of incoming traffic, rendering it inaccessible to legitimate users. 4 | 5 | ## Dataset 6 | 7 | The dataset utilized in this project consists of a collection of binaries, including legitimate files and malware samples. Through exploratory data analysis, data cleaning, and model building, the aim is to develop robust classifiers capable of distinguishing between legitimate files and those associated with malware, which could potentially be used in DDoS attacks. 8 | 9 | ## Key Chapters 10 | 11 | ### 1. Data Exploration and Preprocessing 12 | This chapter delves into the initial steps of understanding the dataset, including its structure, features, and basic statistics. Data cleaning processes are implemented to prepare the dataset for model training. 13 | 14 | ### 2. Model Building - Random Forest 15 | The Random Forest classifier is employed in this chapter to build a model for classifying legitimate files and malware samples. Evaluation metrics such as accuracy, F1-score, and confusion matrices are utilized to assess the performance of the model. 16 | 17 | ### 3. Model Building - Logistic Regression 18 | Logistic Regression, another popular classification algorithm, is implemented in this chapter. Despite encountering convergence warnings, the model's performance is evaluated using accuracy, F1-score, and confusion matrices. 19 | 20 | ### 4. Model Building - Neural Network 21 | A Neural Network model is constructed in this chapter, leveraging the TensorFlow library. The architecture of the neural network is defined, and the model is trained and evaluated using accuracy, F1-score, and confusion matrices. 22 | 23 | These chapters collectively showcase the process of developing and evaluating machine learning models for DDoS attack classification, offering insights into the effectiveness of various algorithms in addressing cybersecurity challenges. 24 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Cyber security with AI/read me: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Natural language processing/Sentiment analysis with twitter tweet/Sentiment analysis with twitter tweets/README.md: -------------------------------------------------------------------------------- 1 | # Sentiment Analysis on Electricity Tweets in India and UK 2 | 3 | ## Project Overview 4 | 5 | This project performs sentiment analysis on tweets related to electricity in India and the UK. By analyzing public sentiment towards electricity-related topics, the project provides insights that can aid policymakers, businesses, and researchers in understanding public opinions and trends. The analysis involves data collection, preprocessing, sentiment classification, and model evaluation. 6 | 7 | ## Key Components 8 | 9 | 1. **Data Collection** 10 | - Tweets are collected using the Twitter API with the Tweepy library. 11 | - Tweets are fetched based on specific hashtags and geolocations for India and the UK. 12 | 13 | 2. **Data Preprocessing** 14 | - **Removing Patterns:** Strips out unwanted patterns such as mentions, retweets, and other irrelevant text. 15 | - **Filtering Links:** Removes words containing links. 16 | - **Removing Duplicates:** Eliminates duplicate tweets to ensure unique entries. 17 | - **Cleaning Text:** Removes punctuation, numbers, and special characters; filters out common stopwords. 18 | - **Tokenization and Lemmatization:** Splits the text into tokens, lemmatizes words to their base forms, and reassembles the tokens into cleaned sentences. 19 | 20 | 3. **Sentiment Analysis** 21 | - Utilizes the VADER sentiment analyzer from the NLTK library to classify tweets as positive or negative. 22 | - Adds sentiment labels to the tweets, providing insights into public sentiment. 23 | 24 | 4. **Model Training and Evaluation** 25 | - Trains and evaluates several machine learning models, including Decision Tree, Random Forest, Logistic Regression, and Naive Bayes. 26 | - Compares model performance based on metrics such as accuracy and F1 score to identify the most effective model for sentiment classification. 27 | 28 | ## Requirements 29 | 30 | Ensure you have the following Python libraries installed: 31 | 32 | - `numpy` 33 | - `pandas` 34 | - `matplotlib` 35 | - `seaborn` 36 | - `re` 37 | - `time` 38 | - `string` 39 | - `warnings` 40 | - `nltk` 41 | - `wordcloud` 42 | - `scikit-learn` 43 | - `tweepy` 44 | - `textblob` 45 | - `tensorflow` 46 | - `keras` 47 | 48 | Install these libraries using pip: 49 | 50 | ```bash 51 | pip install numpy pandas matplotlib seaborn nltk wordcloud scikit-learn tweepy textblob tensorflow keras 52 | ``` 53 | 54 | ## Setup 55 | 56 | 1. **Clone the Repository:** 57 | 58 | ```bash 59 | git clone https://github.com/yourusername/your-repository.git 60 | cd your-repository 61 | ``` 62 | 63 | 2. **Download NLTK Data:** 64 | 65 | Run the following commands in a Python environment to download required NLTK datasets: 66 | 67 | ```python 68 | import nltk 69 | nltk.download('stopwords') 70 | nltk.download('wordnet') 71 | nltk.download('vader_lexicon') 72 | nltk.download('averaged_perceptron_tagger') 73 | nltk.download('movie_reviews') 74 | nltk.download('punkt') 75 | nltk.download('conll2000') 76 | nltk.download('brown') 77 | ``` 78 | 79 | 3. **Twitter API Credentials:** 80 | 81 | Replace the placeholders in your script with your Twitter API credentials: 82 | 83 | ```python 84 | consumer_key = 'YOUR_CONSUMER_KEY' 85 | consumer_secret = 'YOUR_CONSUMER_SECRET' 86 | access_token = 'YOUR_ACCESS_TOKEN' 87 | access_token_secret = 'YOUR_ACCESS_TOKEN_SECRET' 88 | ``` 89 | 90 | ## Usage 91 | 92 | 1. **Data Collection:** 93 | - Use the `Tweets_extractor` function to fetch tweets based on hashtags and geolocations. 94 | 95 | 2. **Data Preprocessing:** 96 | - Apply the `data_preprocessing` method from the `Preprocessing` class to clean the collected tweets. 97 | 98 | 3. **Sentiment Analysis:** 99 | - Utilize the `Sentiment_analysis` class to perform sentiment classification on the cleaned tweets. 100 | 101 | 4. **Model Training:** 102 | - Train and evaluate machine learning models to determine the best algorithm for sentiment analysis. 103 | 104 | ## Results 105 | 106 | - The project provides a detailed analysis of sentiment trends in electricity-related tweets. 107 | - Model performance is compared to identify the most accurate sentiment classifier. 108 | 109 | ## License 110 | 111 | This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. 112 | 113 | ## Acknowledgements 114 | 115 | - Thanks to the developers of the Tweepy, NLTK, TextBlob, and scikit-learn libraries. 116 | - Special thanks to the contributors of the open-source tools used in this project. 117 | 118 | ## Contact 119 | 120 | For any questions or feedback, please contact me at ( Check my github profile contact section ). 121 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Predictive Modelling/Heart disease prediction by voting algorithms/README.md: -------------------------------------------------------------------------------- 1 | # Heart-Disease-prediction-by-Voting-machine-learning 2 | ## Dataset files Description: 3 | 1. X_Train.csv: It contains all Training Dataset on which you are going to build your ML Model 4 | 2. X_text.csv: It contains total Test Dataset on which you are going to test your ML Model 5 | 3. Y_train.csv: It contains all Training Dataset label. 6 | #### some outcomes of the project 7 | 1. Data Preprocessing and situations that are problematic for our algorithms, such as the “curse of dimensionality” or the difficulty of learning from unbalanced training data and missing values problem. You might want to explore techniques for handling these problems in the given dataset. 8 | 2. Applying more than 5 Machine Learning algorithms for the prediction and apply majority voting concept for the final output. Majority voting means to take Predicted labels from all applied classifiers and assign final label according to majority vote. 9 | 3. Exploratory Data Analysis 10 | 4. Accuracy, F Score. 11 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Predictive Modelling/Heart disease prediction by voting algorithms/Testing.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import numpy as np \n", 10 | "import pandas as pd" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 3, 16 | "metadata": {}, 17 | "outputs": [], 18 | "source": [ 19 | "# Loading test dataabs\n", 20 | "testdata=pd.read_csv('D:/freeLancing/mini_Final_ML_Project/Selected_test_data.csv')" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": 4, 26 | "metadata": {}, 27 | "outputs": [], 28 | "source": [ 29 | "#Loading model\n", 30 | "import pickle\n", 31 | "with open(\"D:/freeLancing/mini_Final_ML_Project/heartDiseaseModel.pkl\", 'rb') as file:\n", 32 | " mymodel = pickle.load(file)" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 6, 38 | "metadata": {}, 39 | "outputs": [], 40 | "source": [ 41 | "#Make prediction \n", 42 | "prediction=mymodel.predict(testdata)" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": 7, 48 | "metadata": {}, 49 | "outputs": [ 50 | { 51 | "data": { 52 | "text/html": [ 53 | "
\n", 54 | "\n", 67 | "\n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | "
Idlabel
012
121
232
341
452
\n", 103 | "
" 104 | ], 105 | "text/plain": [ 106 | " Id label\n", 107 | "0 1 2\n", 108 | "1 2 1\n", 109 | "2 3 2\n", 110 | "3 4 1\n", 111 | "4 5 2" 112 | ] 113 | }, 114 | "execution_count": 7, 115 | "metadata": {}, 116 | "output_type": "execute_result" 117 | } 118 | ], 119 | "source": [ 120 | "Id=np.arange(1,30531)\n", 121 | "myprediction=pd.DataFrame(Id , columns = ['Id'], index=None)\n", 122 | "myprediction['label'] = prediction\n", 123 | "myprediction.head(5)\n" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": 9, 129 | "metadata": {}, 130 | "outputs": [ 131 | { 132 | "data": { 133 | "text/html": [ 134 | "
\n", 135 | "\n", 148 | "\n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | "
Idlabel
01NO
12>5
23NO
34>5
45NO
\n", 184 | "
" 185 | ], 186 | "text/plain": [ 187 | " Id label\n", 188 | "0 1 NO\n", 189 | "1 2 >5\n", 190 | "2 3 NO\n", 191 | "3 4 >5\n", 192 | "4 5 NO" 193 | ] 194 | }, 195 | "execution_count": 9, 196 | "metadata": {}, 197 | "output_type": "execute_result" 198 | } 199 | ], 200 | "source": [ 201 | "# Convert prediction into Labels\n", 202 | "myprediction['label']=myprediction['label'].replace(2, 'NO')\n", 203 | "myprediction['label']=myprediction['label'].replace(0,'<30')\n", 204 | "myprediction['label']=myprediction['label'].replace(1,'>5')\n", 205 | "myprediction.head(5)" 206 | ] 207 | }, 208 | { 209 | "cell_type": "code", 210 | "execution_count": 10, 211 | "metadata": {}, 212 | "outputs": [], 213 | "source": [ 214 | "# store label into the prediction file\n", 215 | "myprediction.to_csv(\"D:/freeLancing/mini_Final_ML_Project/myPredictions.csv\", index=False)" 216 | ] 217 | }, 218 | { 219 | "cell_type": "code", 220 | "execution_count": null, 221 | "metadata": {}, 222 | "outputs": [], 223 | "source": [] 224 | } 225 | ], 226 | "metadata": { 227 | "kernelspec": { 228 | "display_name": "Python 3", 229 | "language": "python", 230 | "name": "python3" 231 | }, 232 | "language_info": { 233 | "codemirror_mode": { 234 | "name": "ipython", 235 | "version": 3 236 | }, 237 | "file_extension": ".py", 238 | "mimetype": "text/x-python", 239 | "name": "python", 240 | "nbconvert_exporter": "python", 241 | "pygments_lexer": "ipython3", 242 | "version": "3.7.3" 243 | } 244 | }, 245 | "nbformat": 4, 246 | "nbformat_minor": 2 247 | } 248 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Predictive Modelling/read me: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Read me: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Machine learning & Deep learning/Time Series/Read me: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Python programming/Read.MD: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Data Science Projects 2 | 3 | ## Overview 4 | Welcome to my Data Science repository! This repository is a comprehensive collection of projects that showcase various techniques and applications in data science, including machine learning and deep learning. Each project is designed to address specific real-world problems using advanced analytical and predictive modeling techniques. 5 | 6 | ## Repository Structure 7 | The repository is organized into two main categories: **Machine Learning** and **Deep Learning**. Within each of these categories, you will find projects further divided into subcategories based on the application area, such as Computer Vision, Natural Language Processing (NLP), Time Series Analysis, and Predictive Modeling (e.g., regression). 8 | 9 | ### Main Categories 10 | 11 | #### Machine Learning 12 | - **Computer Vision** 13 | - **Natural Language Processing (NLP)** 14 | - **Time Series Analysis** 15 | - **Predictive Modeling (Regression, Classification)** 16 | 17 | #### Deep Learning 18 | - **Computer Vision** 19 | - **Natural Language Processing (NLP)** 20 | - **Time Series Analysis** 21 | - **Predictive Modeling (Regression, Classification)** 22 | 23 | ## How to Navigate 24 | Each project directory contains: 25 | - **README.md**: Detailed documentation about the project, including its objective, dataset description, methodology, and how to run the code. 26 | - **Source Code**: The main codebase for the project. 27 | - **Datasets**: Links or references to the datasets used in the projects. 28 | - **Results**: Outputs and results from the model, including visualizations and performance metrics. 29 | 30 | ## Contributing 31 | Contributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a pull request. 32 | 33 | ## License 34 | This repository is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details. 35 | --------------------------------------------------------------------------------