Skip to content

Python #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 341 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
341 commits
Select commit Hold shift + click to select a range
861bd7f
Create Multiple Linear Regression.py
Friedrich94326 Oct 9, 2020
ca2397e
Update and rename Machine Learning/Supervised Learning/Multiple Linea…
Friedrich94326 Oct 10, 2020
223e70f
Create The Basics.py
Friedrich94326 Oct 11, 2020
35a042e
Create K-Neighbours.py
Friedrich94326 Oct 12, 2020
556114a
Update K-Neighbours.py
Friedrich94326 Oct 13, 2020
ea621e3
Update K-Neighbours.py
Friedrich94326 Oct 13, 2020
dcfdc4f
Create KNN Algorithm.py
Friedrich94326 Oct 13, 2020
7b57ee2
Create KNN_with_sklearn.py
Friedrich94326 Oct 13, 2020
62fc8fe
Update KNN_with_sklearn.py
Friedrich94326 Oct 13, 2020
040f0b9
Create Project: Breast Cancer Classifier.py
Friedrich94326 Oct 13, 2020
cd9386c
Update Project: Breast Cancer Classifier.py
Friedrich94326 Oct 13, 2020
c833829
Create KNN regressor.py
Friedrich94326 Oct 13, 2020
a2748fe
Create Scikit-learn.py
Friedrich94326 Oct 13, 2020
84548b2
Create Accuracy, Recall, Precision, and F1 Score.py
Friedrich94326 Oct 14, 2020
9f26df1
Create Tutorial.py
Friedrich94326 Oct 14, 2020
4809ef6
Create Tutorial_Logistic_Regression.py
Friedrich94326 Oct 14, 2020
e1b2119
Update Tutorial_Logistic_Regression.py
Friedrich94326 Oct 15, 2020
0196eab
Update Tutorial_Logistic_Regression.py
Friedrich94326 Oct 16, 2020
53e52ff
Create Logistic_Regrssion_with_Scikit-learn.py
Friedrich94326 Oct 16, 2020
98d98ee
Create Project: Titanic Survival.py
Friedrich94326 Oct 16, 2020
6b81e26
Update Project: Titanic Survival.py
Friedrich94326 Oct 16, 2020
b243da2
Create The Basics.py
Friedrich94326 Oct 17, 2020
bf0a933
Update The Basics.py
Friedrich94326 Oct 17, 2020
1437aa1
Update The Basics.py
Friedrich94326 Oct 17, 2020
91d36c2
Update The Basics.py
Friedrich94326 Oct 17, 2020
c2f216b
Create Project: Sports Vector Machine.py
Friedrich94326 Oct 17, 2020
c83e352
Create Tutorial.py
Friedrich94326 Oct 19, 2020
3429194
Update Tutorial.py
Friedrich94326 Oct 20, 2020
cff8501
Create Decision Trees in Scikit-Learn.py
Friedrich94326 Oct 20, 2020
d0680af
Rename Decision Trees in Scikit-Learn.py to Decision Trees with Sciki…
Friedrich94326 Oct 21, 2020
0b86875
Create Project: Find the Flag.py
Friedrich94326 Oct 21, 2020
ba16233
Create The Basics of Random Forests.py
Friedrich94326 Oct 25, 2020
c4888ed
Update The Basics of Random Forests.py
Friedrich94326 Oct 25, 2020
5eda1cf
Create Random Forest with Scikit-Learn.py
Friedrich94326 Oct 25, 2020
ce0ce76
Update and rename The Basics of Random Forests.py to Principles of Ra…
Friedrich94326 Oct 25, 2020
8ae8581
Create Project: Predicting Income with Random Forests.py
Friedrich94326 Oct 25, 2020
6bd5ea7
Create Twitter Classification: Part I.py
Friedrich94326 Oct 26, 2020
a3f5f52
Create Twitter Classification: Part II.py
Friedrich94326 Oct 26, 2020
557085d
Update and rename Twitter Classification: Part I.py to Classification…
Friedrich94326 Oct 27, 2020
51ce83e
Add files via upload
Friedrich94326 Oct 27, 2020
ad767ed
Rename Twitter Classification: Part II.py to Classifying Tweet Locati…
Friedrich94326 Oct 27, 2020
d1d587f
Rename Classification of Viral Tweets.py to Classifying Viral Tweets …
Friedrich94326 Oct 27, 2020
0d51957
Update Classifying Tweet Locations with Naive Bayes Classifier.py
Friedrich94326 Oct 27, 2020
5abf2fb
Create Bayes' Theorem.py
Friedrich94326 Oct 27, 2020
4165ed6
Create Principles of Naïve Bayes Classifier.py
Friedrich94326 Oct 27, 2020
ae1bce0
Update Principles of Naïve Bayes Classifier.py
Friedrich94326 Oct 28, 2020
20c4abe
Add files via upload
Friedrich94326 Oct 28, 2020
bf3dfbf
Create Naive Bayes Classifier with Scikit-Learn.py
Friedrich94326 Oct 28, 2020
259d574
Create Project: Email Similarity.py
Friedrich94326 Oct 29, 2020
20e7e38
Rename Code Challenge: Aggregate Functions to SQL/Code Challenge/ Agg…
Friedrich94326 Nov 7, 2020
a9e14b4
Rename Code Challenge: QUERIES 1 to SQL/Code Challenges/ QUERIES 1
Friedrich94326 Nov 7, 2020
49207f1
Rename SQL/Code Challenge/ Aggregate Functions to SQL/Code Challenges…
Friedrich94326 Nov 7, 2020
86b9df9
Rename Code Challenge: QUERIES 2 to SQL/Code Challenges/ QUERIES 2
Friedrich94326 Nov 7, 2020
913e746
Update SQL_QUERIES 2
Friedrich94326 Nov 7, 2020
b82ac48
Rename Code Challenge: QUERIES 3 to SQL/Code Challenges/ QUERIES 3
Friedrich94326 Nov 7, 2020
6b8867c
Rename Project: Cryptocurrency Exchange to SQL/Projects/ Cryptocurren…
Friedrich94326 Nov 7, 2020
ee3f32b
Rename Project: Data manipulation on a table.txt to SQL/Projects/ Dat…
Friedrich94326 Nov 7, 2020
3b86701
Rename Project: Davie's Burgers Subway Ad to SQL/Projects/ Davie's Bu…
Friedrich94326 Nov 7, 2020
ba2ed42
Rename Project: How to Hack Hacker News to SQL/Projects/ How to Hack …
Friedrich94326 Nov 7, 2020
c0acca8
Rename Project: New York Restaurants to SQL/Projects/ New York Restau…
Friedrich94326 Nov 7, 2020
51e6a20
Rename Project: RPA Customer Segmentation to SQL/Project: RPA Custome…
Friedrich94326 Nov 7, 2020
4b088f0
Rename Project: RPA Fraud Detection to SQL/Projects/RPA Fraud Detection
Friedrich94326 Nov 7, 2020
ca13430
Rename Project: The Metropolitan Museum of Art to SQL/Projects/ The M…
Friedrich94326 Nov 7, 2020
453a8bb
Rename Project: Trends in Startups to SQL/Projects/Trends in Startups
Friedrich94326 Nov 7, 2020
9ecb7c2
Rename SQL commands tutorials.txt to SQL/Fundamental commands tutoria…
Friedrich94326 Nov 7, 2020
d2c27bb
Rename Writing Queries to SQL/Writing Queries
Friedrich94326 Nov 7, 2020
6ebeb9b
Rename Tutorials: Working with Multiple Tables to SQL/ Working with M…
Friedrich94326 Nov 7, 2020
c47c726
Delete KNN_永祥.py
Friedrich94326 Nov 7, 2020
e8568e2
Create Math Fundations.py
Friedrich94326 Nov 7, 2020
342d4ce
Update and rename Math Fundations.py to Perceptrons.py
Friedrich94326 Nov 8, 2020
c1ca246
Create Advanced: The Perceptron Algorithm.py
Friedrich94326 Nov 8, 2020
6564e5a
Update and rename Deep Learning/Advanced: The Perceptron Algorithm.py…
Friedrich94326 Nov 8, 2020
0c21869
Rename Deep Learning/Perceptrons.py to Deep Learning/Perceptron/Funda…
Friedrich94326 Nov 8, 2020
e408d8b
Create Project: Logic Gates Using Perceptrons.py
Friedrich94326 Nov 8, 2020
3cbe05d
Update and rename Project: Logic Gates Using Perceptrons.py to Projec…
Friedrich94326 Nov 8, 2020
9fc3802
Create Implementing Neural Networks.py
Friedrich94326 Nov 8, 2020
7632636
Update Implementing Neural Networks.py
Friedrich94326 Nov 8, 2020
4b1f28a
Update Implementing Neural Networks.py
Friedrich94326 Nov 8, 2020
7a83ceb
Update Implementing Neural Networks.py
Friedrich94326 Nov 9, 2020
ddf6935
Create Neural network model: tf.keras.Sequential.py
Friedrich94326 Nov 9, 2020
4f33e9f
Update and rename Neural network model: tf.keras.Sequential.py to Neu…
Friedrich94326 Nov 9, 2020
fb5e2b3
Rename Neural Network Models.py to Construct Neural Network Models wi…
Friedrich94326 Nov 9, 2020
d7e3503
Rename Construct Neural Network Models with TensorFlow.py to Building…
Friedrich94326 Nov 9, 2020
89ffefd
Update and rename Building Neural Network Models with TensorFlow.py t…
Friedrich94326 Nov 9, 2020
50e17e3
Create Step 3: Train and Test Neural Networks.py
Friedrich94326 Nov 9, 2020
7f13046
Rename Implementing Neural Networks.py to Step 1: Implementing Neural…
Friedrich94326 Nov 9, 2020
9bf1f47
Rename Building Neural Network Models in TensorFlow with Keras.py to …
Friedrich94326 Nov 9, 2020
bd061c1
Update and rename Deep Learning/Neural Networks/Step 3: Train and Tes…
Friedrich94326 Nov 9, 2020
5de4b3d
Rename Deep Learning/Neural Networks/Step 1: Implementing Neural Netw…
Friedrich94326 Nov 9, 2020
6d702f6
Rename Deep Learning/Neural Networks/Step 2: Building Neural Network …
Friedrich94326 Nov 9, 2020
112d43a
Create Hyperparameter Tuning.py
Friedrich94326 Nov 9, 2020
215dc23
Update and rename Hyperparameter Tuning.py to Hyperparameter Tuning M…
Friedrich94326 Nov 9, 2020
fd327be
Create Automated Hyperparameter Tuning.py
Friedrich94326 Nov 9, 2020
9f6e869
Update Automated Hyperparameter Tuning.py
Friedrich94326 Nov 9, 2020
74d976d
Create Predicting Life Expectancy with a Neural Network.py
Friedrich94326 Nov 9, 2020
cd8687e
Update Predicting Life Expectancy with a Neural Network.py
Friedrich94326 Nov 10, 2020
e39efa6
Create Elements of Classification.py Tasks.py
Friedrich94326 Nov 10, 2020
e1d18c1
Update Elements of Classification.py Tasks.py
Friedrich94326 Nov 10, 2020
7ceeffb
Update Elements of Classification.py Tasks.py
Friedrich94326 Nov 10, 2020
f1b529a
Create Classification Loss Alternative: Sparse Cross-entropy.py
Friedrich94326 Nov 10, 2020
0565a81
Create main.py
Friedrich94326 Nov 10, 2020
916daa3
Update main.py
Friedrich94326 Nov 10, 2020
851ca32
Add files via upload
Friedrich94326 Nov 10, 2020
a037568
Create Preprocessing Image Data.py
Friedrich94326 Nov 11, 2020
531082b
Rename Preprocessing Image Data.py to Preprocessing_Image_Data.py
Friedrich94326 Nov 11, 2020
cb9868f
Create Loading_Image_Data.py
Friedrich94326 Nov 11, 2020
8799f11
Create Modifying_our_Feed-Forward_Classification_Model.py
Friedrich94326 Nov 11, 2020
30e8226
Create Convolutional_Neural_Networks.py
Friedrich94326 Nov 11, 2020
7037e78
Rename Deep Learning/Classifying Biomedical Convolutional Neural Netw…
Friedrich94326 Nov 11, 2020
6e05724
Rename Deep Learning/Classifying Biomedical Convolutional Neural Netw…
Friedrich94326 Nov 11, 2020
ed6bf80
Rename Deep Learning/Classifying Biomedical Convolutional Neural Netw…
Friedrich94326 Nov 11, 2020
70321e6
Rename Deep Learning/Classifying Biomedical Convolutional Neural Netw…
Friedrich94326 Nov 11, 2020
94464fe
Create Configuring a Convolutional Layer- Stride and Padding.py
Friedrich94326 Nov 11, 2020
e77378d
Update and rename Convolutional_Neural_Networks.py to Convolutional_L…
Friedrich94326 Nov 11, 2020
e8bb16d
Update Convolutional_Layers.py
Friedrich94326 Nov 11, 2020
96babe3
Create Pooling_Layers.py
Friedrich94326 Nov 11, 2020
a4c41fb
Create Training_Our_Model.py
Friedrich94326 Nov 11, 2020
5794a46
Create main_galaxies.py
Friedrich94326 Nov 11, 2020
a18278c
Create utils.py
Friedrich94326 Nov 11, 2020
1ee2292
Create visualize.py
Friedrich94326 Nov 11, 2020
9ef8b08
Create app.py
Friedrich94326 Nov 11, 2020
eafcd5b
Rename main_galaxies.py to main_training_CNN.py
Friedrich94326 Nov 11, 2020
458db32
Update and rename main_training_CNN.py to main_galaxies_CNN.py
Friedrich94326 Nov 11, 2020
6f92461
Rename Deep Learning/Projects/Predicting Life Expectancy with a Neura…
Friedrich94326 Nov 11, 2020
3f207c1
Create main_pneumonia_calssification.py
Friedrich94326 Nov 13, 2020
aa5e6c2
Rename Elements of Classification.py Tasks.py to Elements of Classifi…
Friedrich94326 Nov 13, 2020
9c10806
Update main_galaxies_CNN.py
Friedrich94326 Nov 13, 2020
bd7144d
Update main_galaxies_CNN.py
Friedrich94326 Nov 13, 2020
22a1b11
Update main_pneumonia_calssification.py
Friedrich94326 Nov 13, 2020
4882e3e
Update and rename main_pneumonia_calssification.py to main_pneumonia_…
Friedrich94326 Nov 13, 2020
a5a6788
Create main_pneumonia_calssification_ver2.py
Friedrich94326 Nov 13, 2020
9963727
Update main_pneumonia_calssification_ver1.py
Friedrich94326 Nov 13, 2020
888d7a7
Update main_pneumonia_calssification_ver2.py
Friedrich94326 Nov 13, 2020
0b60cff
Create main_forest_cover.py
Friedrich94326 Nov 18, 2020
3539e70
Create web_scraping_script.py
Friedrich94326 Nov 19, 2020
d7e3a29
Update and rename Web Scraping with Beautiful Soup/web_scraping_scrip…
Friedrich94326 Nov 19, 2020
c8804e4
Update main_pneumonia_calssification_ver2.py
Friedrich94326 Dec 7, 2020
ffd5d2a
Update Step 3: Training and Evaluating Neural Networks.py
Friedrich94326 Dec 19, 2020
ef9ea00
Create README.md
Friedrich94326 Dec 19, 2020
9ac2cb6
Rename Deep Learning/Projects/Portfolio_Projects/Forest_Cover_Classif…
Friedrich94326 Dec 19, 2020
f991713
Create main.py
Friedrich94326 Dec 19, 2020
294ed62
Add files via upload
Friedrich94326 Dec 19, 2020
a404f0e
Add files via upload
Friedrich94326 Dec 19, 2020
97d00ea
Update README.md
Friedrich94326 Dec 19, 2020
ab83bf7
Update README.md
Friedrich94326 Dec 19, 2020
45dd6de
Create README.md
Friedrich94326 Dec 19, 2020
e3f550b
Update README.md
Friedrich94326 Dec 19, 2020
c3202b8
Update README.md
Friedrich94326 Dec 20, 2020
a66e8c1
Update README.md
Friedrich94326 Dec 20, 2020
d3d2577
Update README.md
Friedrich94326 Dec 20, 2020
b74e082
Update README.md
Friedrich94326 Dec 20, 2020
e25c765
Update README.md
Friedrich94326 Dec 20, 2020
81c5847
Update README.md
Friedrich94326 Dec 20, 2020
69db751
Update README.md
Friedrich94326 Dec 20, 2020
d964e2d
Create README.md
Friedrich94326 Dec 20, 2020
3af0a8e
Update README.md
Friedrich94326 Dec 20, 2020
443b811
Update README.md
Friedrich94326 Dec 20, 2020
b4f12c9
Update README.md
Friedrich94326 Dec 20, 2020
c523a1d
Delete main_forest_cover.py
Friedrich94326 Dec 20, 2020
7503af2
Add files via upload
Friedrich94326 Dec 20, 2020
ac869f2
Update README.md
Friedrich94326 Dec 20, 2020
6f7b8f9
Update README.md
Friedrich94326 Dec 20, 2020
2dee7d8
Add files via upload
Friedrich94326 Dec 20, 2020
e880777
Add files via upload
Friedrich94326 Dec 20, 2020
7315607
Add files via upload
Friedrich94326 Dec 20, 2020
e54aa70
Create README.md
Friedrich94326 Dec 20, 2020
dcbcc21
Create README.md
Friedrich94326 Dec 21, 2020
94bf6bf
Update README.md
Friedrich94326 Dec 21, 2020
c00a553
Add files via upload
Friedrich94326 Dec 26, 2020
f7c80ec
Delete variables.data-00000-of-00001
Friedrich94326 Dec 26, 2020
5ef8795
Delete variables.index
Friedrich94326 Dec 26, 2020
4578e10
Delete saved_model.pb
Friedrich94326 Dec 26, 2020
be59b88
Delete Prediction_1.png
Friedrich94326 Dec 26, 2020
643612a
Delete model accuracy.png
Friedrich94326 Dec 26, 2020
15e2310
Add files via upload
Friedrich94326 Dec 26, 2020
8435864
Update README.md
Friedrich94326 Dec 26, 2020
409df9d
Add files via upload
Friedrich94326 Dec 26, 2020
86df589
Rename main_pneumonia_calssification_ver1.py to main_draft_1.py
Friedrich94326 Dec 26, 2020
cf6b4d1
Rename main_pneumonia_calssification_ver2.py to main_draft_2.py
Friedrich94326 Dec 26, 2020
65d6ca1
Update README.md
Friedrich94326 Dec 27, 2020
c45cfc6
Update README.md
Friedrich94326 Dec 27, 2020
6eaf7d6
Create Tutorial.py
Friedrich94326 Dec 27, 2020
af9c78d
Create README.md
Friedrich94326 Dec 27, 2020
64acacf
Update Tutorial.py
Friedrich94326 Dec 27, 2020
08b497d
Delete Intro to Unsupervised Learning.py
Friedrich94326 Dec 28, 2020
233bde9
Update Tutorial.py
Friedrich94326 Dec 28, 2020
7d937c7
Update README.md
Friedrich94326 Dec 28, 2020
37acc18
Update README.md
Friedrich94326 Dec 28, 2020
9eac54c
Update README.md
Friedrich94326 Dec 28, 2020
c7174cf
Update Tutorial.py
Friedrich94326 Dec 28, 2020
9bbbac8
Rename Tutorial.py to Principle_Tutorial.py
Friedrich94326 Dec 28, 2020
37f0f46
Create Implmenting_with_Sklearn.py
Friedrich94326 Dec 28, 2020
4733ad8
Rename Principle_Tutorial.py to Implementation_from_scratch_tutorial.py
Friedrich94326 Dec 28, 2020
9cda15a
Update and rename Implmenting_with_Sklearn.py to Implmentation_with_S…
Friedrich94326 Dec 28, 2020
753369a
Update Implmentation_with_Sklearn.py
Friedrich94326 Dec 28, 2020
1efd14f
Update README.md
Friedrich94326 Dec 28, 2020
03c94ad
Update README.md
Friedrich94326 Dec 28, 2020
063c337
Update README.md
Friedrich94326 Dec 28, 2020
062c32f
Update README.md
Friedrich94326 Dec 28, 2020
faa9977
Update README.md
Friedrich94326 Dec 28, 2020
93eb626
Update README.md
Friedrich94326 Dec 28, 2020
91bd2bf
Update README.md
Friedrich94326 Dec 28, 2020
339797d
Update README.md
Friedrich94326 Dec 28, 2020
6953d8d
Update README.md
Friedrich94326 Dec 28, 2020
d0ef1f2
Update README.md
Friedrich94326 Dec 28, 2020
3871fa5
Create K-Means++.py
Friedrich94326 Dec 28, 2020
9928330
Update K-Means++.py
Friedrich94326 Dec 28, 2020
90185c7
Add files via upload
Friedrich94326 Dec 28, 2020
8af2421
Update README.md
Friedrich94326 Dec 28, 2020
b5967df
Update README.md
Friedrich94326 Dec 28, 2020
1dd8f02
Update README.md
Friedrich94326 Dec 28, 2020
d4580cc
Update README.md
Friedrich94326 Dec 28, 2020
1b97174
Update README.md
Friedrich94326 Dec 28, 2020
652dcf0
Update README.md
Friedrich94326 Dec 28, 2020
9e8df5e
Update README.md
Friedrich94326 Dec 28, 2020
4b3cc34
Update README.md
Friedrich94326 Dec 28, 2020
55ad93c
Update README.md
Friedrich94326 Dec 28, 2020
2c347a8
Update README.md
Friedrich94326 Dec 29, 2020
bd19b29
Update README.md
Friedrich94326 Dec 29, 2020
036c497
Update README.md
Friedrich94326 Dec 29, 2020
faea9ec
Update README.md
Friedrich94326 Dec 29, 2020
5039ee2
Update README.md
Friedrich94326 Dec 29, 2020
1ae6149
Create Tutorial_Linked_Lists.py
Friedrich94326 Jan 2, 2021
13fd532
Update Tutorial_Linked_Lists.py
Friedrich94326 Jan 2, 2021
c1aa521
Update Tutorial_Linked_Lists.py
Friedrich94326 Jan 3, 2021
98f0b11
Update Tutorial_Linked_Lists.py
Friedrich94326 Jan 3, 2021
0dfe251
Add files via upload
Friedrich94326 Jan 18, 2021
f3b1d05
Add files via upload
Friedrich94326 Jan 18, 2021
b8b9988
Add files via upload
Friedrich94326 Jan 18, 2021
867f5d3
Delete Forest_Cover_Classification.ipynb
Friedrich94326 Jan 18, 2021
84c4472
Add files via upload
Friedrich94326 Jan 18, 2021
dbbd737
Delete Trained_Models directory
Friedrich94326 Jan 18, 2021
c30b87b
Delete Deep Learning/Projects/Forest_Covertype_Classification/Outputs…
Friedrich94326 Jan 19, 2021
625db90
Create nn.py
Friedrich94326 Jan 19, 2021
cef9272
Add files via upload
Friedrich94326 Jan 19, 2021
c5005e2
Update README.md
Friedrich94326 Jan 19, 2021
95efdec
Delete nn.py
Friedrich94326 Jan 19, 2021
75b47dd
Delete Deep Learning/Projects/Forest_Covertype_Classification/Trained…
Friedrich94326 Jan 19, 2021
e1ec4f7
Add files via upload
Friedrich94326 Jan 19, 2021
6b64591
Add files via upload
Friedrich94326 Jan 19, 2021
705cae5
Update README.md
Friedrich94326 Jan 19, 2021
8a443bb
Add files via upload
Friedrich94326 Jan 19, 2021
e5a66f9
Add files via upload
Friedrich94326 Jan 19, 2021
19f2390
Add files via upload
Friedrich94326 Jan 19, 2021
33382bd
Add files via upload
Friedrich94326 Jan 19, 2021
a6053ea
Update README.md
Friedrich94326 Jan 20, 2021
d70fe6d
Update README.md
Friedrich94326 Jan 20, 2021
a73f475
Update README.md
Friedrich94326 Jan 20, 2021
8641751
Update README.md
Friedrich94326 Jan 20, 2021
0b581c3
Update README.md
Friedrich94326 Jan 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
""" Requests """

import requests # import the requests library

# My request to the URL
webpage_response = requests.get('https://content.codecademy.com/courses/beautifulsoup/shellter.html')
print(webpage_response.text)

# See the content of this HTML
webpage = webpage_response.content
print(webpage)


""" BeautifulSoup is a Python library that makes it easy for us to traverse an HTML page and pull out the parts we’re interested in """
from bs4 import BeautifulSoup

# convert the HTML document to a BeautifulSoup object
soup = BeautifulSoup(webpage, "html.parser") # html.parser as an indicated parser
# print(type(soup))
print(soup)

""" Accessing Tags from a BeautifulSoup object """
# get the first <p> tag of that type on the requested page (<p> defines a paragraph)
print(soup.p)

# the string associated with the first p tage on the requested page
print(soup.p.string)


""" Navigating Tags: HTML Parent-Child Relationship """

# Print out all of the parents of the first <div>
print("all of the parents of the first <div>:\n")
for parent in soup.div.parents:
print(parent)


# Print out all of the children of the first <div>- HEAD and BODY are child nodes of the HTML element.
print("all of the children of the first <div>:\n")
for child in soup.div.children: # Tag <div> defines a section in a document
print(child)








Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
""" Classification Loss Alternative: Sparse Cross-entropy-
which is a computationally modified categorical cross-entropy loss that allows you
to leave the integer labels as they are and skip the entire procedure of encoding. """


import pandas as pd
from collections import Counter
from sklearn.preprocessing import LabelEncoder
import tensorflow
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import InputLayer
from tensorflow.keras.layers import Dense
from sklearn.metrics import classification_report
import numpy as np
#your code here

train_data = pd.read_csv("air_quality_train.csv")
test_data = pd.read_csv("air_quality_test.csv")

#print columns and their respective types
print(train_data.info())
#print the class distribution
print(Counter(train_data["Air_Quality"]))
#extract the features from the training data
x_train = train_data[['PM2.5', 'PM10', 'NO', 'NO2', 'NOx', 'NH3', 'CO', 'SO2', 'O3', 'Benzene', 'Toluene', 'Xylene', 'AQI']]
#extract the label column from the training data
y_train = train_data["Air_Quality"]
#extract the features from the test data
x_test = test_data[['PM2.5', 'PM10', 'NO', 'NO2', 'NOx', 'NH3', 'CO', 'SO2', 'O3', 'Benzene', 'Toluene', 'Xylene', 'AQI']]
#extract the label column from the test data
y_test = test_data["Air_Quality"]

#encode the labels into integers
le = LabelEncoder()
#convert the integer encoded labels into binary vectors
y_train=le.fit_transform(y_train.astype(str))
y_test=le.transform(y_test.astype(str))
#convert the integer encoded labels into binary vectors
#we comment it here because we need only integer labels for
#sparse cross-entropy
#y_train = tensorflow.keras.utils.to_categorical(y_train, dtype = 'int64')
#y_test = tensorflow.keras.utils.to_categorical(y_test, dtype = 'int64')

#design the model
model = Sequential()
#add the input layer
model.add(InputLayer(input_shape = (x_train.shape[1], )))
#add a hidden layer
model.add(Dense(10, activation = 'relu'))
#add an output layer
model.add(Dense(6, activation = 'softmax'))

#compile the model
#model.compile(loss = 'categorical_crossentropy', optimizer = 'adam', metrics = ['accuracy'])
model.compile(loss = 'sparse_categorical_crossentropy', optimizer = 'adam', metrics = ['accuracy'])

#train and evaluate the model
model.fit(x_train, y_train, epochs = 20, batch_size = 16, verbose = 0)

#get additional statistics
y_estimate = model.predict(x_test, verbose = 0)
y_estimate = np.argmax(y_estimate, axis = 1)
print(classification_report(y_test, y_estimate))





Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
""" Cross-Entropy: a score that summarizes the average difference between the actual and predicted probability distributions for all classes. """

from sklearn.metrics import log_loss

#the first class is set to probability 1, all others are 0; this example belongs to class #1
ex_1_true = [1, 0, 0]
#the second class is set to probability 1, all others are 0; this example belongs to class #2
ex_2_true = [0, 1, 0]
#the third class is set to probability 1, all others are 0; this example belongs to class #3
ex_3_true = [0, 0, 1]

#the highest probability is given to class #1
ex_1_predicted = [0.7, 0.2, 0.1]
#the highest probability is given to class #2
ex_2_predicted = [0.1, 0.8, 0.1]
#the highest probability is given to class #3
ex_3_predicted = [0.2, 0.2, 0.6]

#the highest probability given to class #3, true labels is class #1
ex_1_predicted_bad = [0.1, 0.1, 0.7]
#the highest probability given to class #1, true labels is class #2
ex_2_predicted_bad = [0.8, 0.1, 0.1]
#the highest probability given to class #1, true labels is class #3
ex_3_predicted_bad = [0.6, 0.2, 0.2]

true_labels = [ex_1_true, ex_2_true, ex_3_true]
predicted_labels = [ex_1_predicted, ex_2_predicted, ex_3_predicted]
predicted_labels_bad = [ex_1_predicted_bad, ex_2_predicted_bad, ex_3_predicted_bad]

ll = log_loss(true_labels, predicted_labels)
print('Average Log Loss (good prediction): %.3f' % ll) # 0.364

ll = log_loss(true_labels, predicted_labels_bad)
print('Average Log Loss (bad prediction): %.3f' % ll) # 2.036

ll = log_loss(true_labels, true_labels)
print('(TODO)Average Log Loss (true prediction): %.3f' % ll) # 0.000


""" Loading and Analyzing Data """

import pandas as pd
from collections import Counter

#your code here
train_data = pd.read_csv('air_quality_train.csv')
test_data = pd.read_csv('air_quality_test.csv')

#print columns and their respective types
print(train_data.info())

#print the class distribution
print(Counter(train_data['Air_Quality']))

#extract the features from the training data
x_train = train_data[ ['PM2.5', 'PM10', 'NO', 'NO2', 'NOx', 'NH3', 'CO', 'SO2', 'O3', 'Benzene', 'Toluene', 'Xylene', 'AQI'] ]

#extract the label column from the training data
y_train = train_data["Air_Quality"]

#extract the features from the test data
x_test = test_data[['PM2.5', 'PM10', 'NO', 'NO2', 'NOx', 'NH3', 'CO', 'SO2', 'O3', 'Benzene', 'Toluene', 'Xylene', 'AQI']]

#extract the label column from the test data
y_test = test_data["Air_Quality"]

""" Preparing the Data """

from sklearn.preprocessing import LabelEncoder
import tensorflow

#encode the labels into integers
le = LabelEncoder()
y_train = le.fit_transform(y_train.astype(str))
y_test = le.transform(y_test.astype(str))

print("integer-encoded labels:")
print("the first 5 y_train's:")
print(y_train[0:5])
print("the first 5 y_test's:")
print(y_test[0:5])


#print the integer mappings
integer_mapping = {l: i for i, l in enumerate(le.classes_)}
print("The integer mapping:\n", integer_mapping)

#convert the integer encoded labels into binary vectors
y_train = tensorflow.keras.utils.to_categorical(y_train, dtype = 'int64')
y_test = tensorflow.keras.utils.to_categorical(y_test, dtype = 'int64')

print("one-hot-encoded labels:")
print("the first 5 y_train's:")
print(y_train[0:5])
print("the first 5 y_test's:")
print(y_test[0:5])


""" Designing a Deep Learning Model for Classification """

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import IutLayer
from tensorflow.keras.layers import Dense

#design the model
model = Sequential()

#add the input layer
model.add(InputLayer(input_shape = (x_train.shape[1], )))

#add a hidden layer
model.add(Dense(10, activation = 'relu'))

#add an output layer
model.add(Dense(y_train.shape[1], activation = 'softmax'))


""" Setting Up the Optimiser """

#compile the model
model.compile(loss = 'categorical_crossentropy', optimizer = 'adam', metrics = ['accuracy'])


""" Train and Evaluate the Model """

#train and evaluate the model
model.fit(x_train, y_train, epochs = 20, batch_size = 4, verbose = 1)
res_mse, res_accu = model.evaluate(x_test, y_test, verbose = 1)

print("MSE test: ", res_mse) # MSE test: 0.4955960214138031
print("ACCU test: ", res_accu) # ACCU test: 0.8285509347915649


""" Additional Evaluation Statistics """

import numpy as np
from sklearn.metrics import classification_report

#get additional statistics
y_estimate = model.predict(x_test)
print("one-hot encoded y_estimate")
print(y_estimate[0:5])

#convert one-hot encoded labels into the index of the class the sample belongs to
print("after conversion y_estimate")
y_estimate = np.argmax(y_estimate, axis = 1)
print(y_estimate[0:5])

y_true = np.argmax(y_test, axis = 1)

#F1-score
print(classification_report(y_true, y_estimate))





















Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
""" Two hyperparameters in a convolutional layer: Stride & Padding """
import tensorflow as tf

print("Model with 16 filters:")

model = tf.keras.Sequential()
model.add(tf.keras.Input(shape=(256, 256, 1)))

#Adds a Conv2D layer with 16 filters, each size 7x7, and uses a stride of 2 with valid padding:
model.add(tf.keras.layers.Conv2D(16, 7,
strides = 1,
padding = "same",
activation = "relu"))
model.summary()
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
""" Configuring Convolutional Layer-Filters """

import tensorflow as tf

model = tf.keras.Sequential()
model.add(tf.keras.Input(shape = (256, 256, 1)))

#Adds a Conv2D layer with 8 filters, each size 3x3:
print("\n\nModel with 8 filters of size 3x3:")
model.add(tf.keras.layers.Conv2D(8, 3, activation = "relu"))

#Modify change the number of filters to 16
#print("\n\nModel with 16 filters of size 3x3:")
#model.add(tf.keras.layers.Conv2D(16, 3, activation = "relu"))

#Modify the Conv2D layer to have filters of size 7x7
#print("\n\nModel with 16 filters of size 7x7:")
#model.add(tf.keras.layers.Conv2D(16, 7, activation = "relu"))

model.summary()


""" Configuring Convolutional Layers- Stride and Padding """

print("Model with 16 filters:")

model_2 = tf.keras.Sequential()
model_2.add(tf.keras.Input(shape = (256, 256, 1)))

#Adds a Conv2D layer with 16 filters, each size 7x7, and uses a stride of 2 with valid padding:
model_2.add(tf.keras.layers.Conv2D(16, 7,
strides = 2,
padding = "same",
activation = "relu"))
model.summary()

""" Adding a Single Convolutional Layer to the Sequential Model """


#Add a Conv2D layer, with 2 filters of size 5x5, strides of 3, valid padding
model.add(tf.keras.layers.Conv2D(
filters = 2,
kernel_size = 5,
strides = 3,
padding = "valid",
activation = "relu"
))

""" Stack Multiple Layers """
#Add another Conv2D layer, with 4 filters of size 3x3, strides of 1, valid padding
model.add(tf.keras.layers.Conv2D(
filters = 4,
kernel_size = 3,
strides = 1,
padding = "valid",
activation = "relu"
))


model.add(tf.keras.layers.Flatten())

# #Remove these two dense layers:
#model.add(tf.keras.layers.Dense(100, activation="relu"))
#model.add(tf.keras.layers.Dense(50, activation="relu"))

model.add(tf.keras.layers.Dense(2, activation = "softmax"))

#Print model information:
model.summary()




Loading