Edited, memorised or added to reading queue

on 21-May-2024 (Tue)

Do you want BuboFlash to help you learning these things? Click here to log in or create user.

Flashcard 7096377937164

Tags
#causality #statistics
Question
A potential outcome [...(symbol?)] is distinct from the observed outcome 𝑌 in that not all potential outcomes are observed
Answer
𝑌(𝑡)

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it

Original toplevel document (pdf)

cannot see any pdfs







#tensorflow #tensorflow-certificate

# Create X and y values (features and labels)

y = insurance_one_hot['charges']

X = insurance_one_hot.drop('charges', axis=1)

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

TfC_01_FINAL_EXAMPLE.ipynb
r example: Use pandas get_dummies() function insurance_one_hot = pd.get_dummies(insurance,dtype="int32") #to avoid bool which generate problem with model fitting in TensorFlow insurance_one_hot <span># Create X and y values (features and labels) y = insurance_one_hot['charges'] X = insurance_one_hot.drop('charges', axis=1) #y = y.values # This is not necessary #X = X.values #X, y, X.shape, y.shape # Create training and test datasets #my way: from sklearn.model_selection import train_test_split X_train, X_




Flashcard 7627468311820

Tags
#tensorflow #tensorflow-certificate
Question

Preprocessing data

ct = make_column_transformer((OneHotEncoder(dtype="int32"), ['Sex']), remainder="passthrough") #other columns unchangaed
ct.fit([...]) 
X_train_transformed = ct.transform(X_train)
X_test_transformed = ct.transform(X_test)
Answer
X_train

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Preprocessing data ct = make_column_transformer((OneHotEncoder(dtype="int32"), ['Sex']), remainder="passthrough") #other columns unchangaed ct.fit(X_train) X_train_transformed = ct.transform(X_train) X_test_transformed = ct.transform(X_test)

Original toplevel document

TfC_01_ADDITIONAL_01_Abalone.ipynb
Preprocessing data ct = make_column_transformer((OneHotEncoder(dtype="int32"), ['Sex']), remainder="passthrough") #other columns unchangaed ct.fit(X_train) X_train_transformed = ct.transform(X_train) X_test_transformed = ct.transform(X_test) Predictions valuation_predicts = model.predict(X_valuation_transformed) (array([[ 9.441547], [10.451973], [10.48082 ], ..., [10.401164], [13.13452 ], [ 8.081818]], dtype=float32), (6041







[unknown IMAGE 7626420784396] #has-images #tensorflow #tensorflow-certificate

Tracking your experiments

One really good habit is to track the results of your experiments. There are tools to help us!

Resource: Try:

  • Tensorboard - a component of Tensorflow library to help track modelling experiments
  • Weights & Biase
statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

TfC 01 regression
Take away: You should minimize the time between your experiments (that's way you should start with smaller models). The more experiments you do, the more things you figure out that don't work. <span>Tracking your experiments One really good habit is to track the results of your experiments. There are tools to help us! Resource: Try: Tensorboard - a component of Tensorflow library to help track modelling experiments Weights & Biases Saving and loading models Two formats: SavedModel format (including optimizer's step) HDF5 format What about TensorFlow Serving format? # Save the entire model using SavedModel model_3




Flashcard 7627728096524

Tags
#tensorflow #tensorflow-certificate
Question
[...] classification - a sample can be assigned to one label but from more than 2 label options
Answer
Multiclass

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Multiclass classification - a sample can be assigned to one label but from more than 2 label options

Original toplevel document

TfC_02_classification-PART_1
ms Three types of classification problems: binary classification multiclass multilabel Multilabel classification - a sample can be assigned to more than one label from more than 2 label options <span>Multiclass classification - a sample can be assigned to one label but from more than 2 label options Multiclass image classificaton: pizza, steak, sushi Input_shape = [None, 224, 224, 3] - single image Input shape = [32, 224, 224, 3] - common batch size of images 32 is a common batch s







Flashcard 7627729931532

Tags
#has-images #tensorflow #tensorflow-certificate
[unknown IMAGE 7626420784396]
Question
MAE
  • [...]()
  • tf.metrics.mean_absolute_error()
  • great starter metrics for any regression problem
Answer
tf.keras.losses.MAE

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
MAE tf.keras.losses.MAE() tf.metrics.mean_absolute_error() great starter metrics for any regression problem

Original toplevel document

TfC 01 regression
st_labels, c="green", label="Testing data") plt.scatter(test_data, predictions, c="red", label="Predictions") plt.legend(); Common regression evaluation metrics keyboard_arrow_down Introduction <span>For regression problems: MAE tf.keras.losses.MAE() tf.metrics.mean_absolute_error() great starter metrics for any regression problem MSE tf.keras.losses.MSE() tf.metrics.mean_square_error() when larger errors are more significant that smaller errors Huber tf.keras.losses.Huber() combintion of MSE and MAE less sensitive to outliers than MSE Take away: You should minimize the time between your experiments (that's way you should start with smaller models). The more experiments you do, the more things you figure out that don't work. Tracking your experiments One really good habit is to track the results of your experiments. There are tools to help us! Resource: Try: Tensorboard - a component of Tensorflow library t







Flashcard 7627731766540

Tags
#has-images #tensorflow #tensorflow-certificate
[unknown IMAGE 7626420784396]
Question

How we can improve model (in the particular stage of the process)?

# 2. [...]: change optimizer or its parameters (eg. learning rate)

Answer
Compiling

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
How we can improve model (in the particular stage of the process)? # 2. Compiling: change optimizer or its parameters (eg. learning rate)

Original toplevel document

TfC 01 regression
#### How we can improve model # 1. Creating model: add more layers, increase numbers of hidden neurons, change activation functions # 2. Compiling: change optimizer or its parameters (eg. learning rate) # 3. Fitting: more epochs, more data ### How? # from smaller model to larger model Evaluating models Typical workflow: build a model -> fit it -> evaulate -> tweak -> fit > evaluate -> .... Building model: experiment Evaluation model: visualize What







Flashcard 7627735174412

Tags
#tensorflow #tensorflow-certificate
Question

# Create X and y values (features and labels)

y = insurance_one_hot['charges']

X = insurance_one_hot.[...]('charges', axis=1)

Answer
drop

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
# Create X and y values (features and labels) y = insurance_one_hot['charges'] X = insurance_one_hot.drop('charges', axis=1)

Original toplevel document

TfC_01_FINAL_EXAMPLE.ipynb
r example: Use pandas get_dummies() function insurance_one_hot = pd.get_dummies(insurance,dtype="int32") #to avoid bool which generate problem with model fitting in TensorFlow insurance_one_hot <span># Create X and y values (features and labels) y = insurance_one_hot['charges'] X = insurance_one_hot.drop('charges', axis=1) #y = y.values # This is not necessary #X = X.values #X, y, X.shape, y.shape # Create training and test datasets #my way: from sklearn.model_selection import train_test_split X_train, X_







Flashcard 7627737009420

Tags
#has-images #tensorflow #tensorflow-certificate
[unknown IMAGE 7626420784396]
Question

Saving and loading models

Two formats:

  • SavedModel format (including optimizer's [...])
  • HDF5 format
Answer
step

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Saving and loading models Two formats: SavedModel format (including optimizer's step) HDF5 format

Original toplevel document

TfC 01 regression
is to track the results of your experiments. There are tools to help us! Resource: Try: Tensorboard - a component of Tensorflow library to help track modelling experiments Weights & Biases <span>Saving and loading models Two formats: SavedModel format (including optimizer's step) HDF5 format What about TensorFlow Serving format? # Save the entire model using SavedModel model_3.save("best_model_3_SavedModel") # SavedModel is in principle protobuff)pb file # Save model in HDF5 format: model_3.save("best_model_3_HDF5.h5") Load model loaded_model_SM = tf.keras.models.load_model('/content/best_model_3_SavedModel') loaded_model_SM.summary() <span>







#tensorflow #tensorflow-certificate

# Create training and test datasets
#my way:

from sklearn.model_selection import train_test_split 

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state=42)

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

TfC_01_FINAL_EXAMPLE.ipynb
nsurance_one_hot # Create X and y values (features and labels) y = insurance_one_hot['charges'] X = insurance_one_hot.drop('charges', axis=1) #y = y.values # This is not necessary #X = X.values <span>#X, y, X.shape, y.shape # Create training and test datasets #my way: from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state=42) Preprocessing data (normalization and standardization) Preprocessing steps: Turn all data into numbers Make sure your tensors are in the right shape Scale features (normalize or standardize) Neural networks tend to pre




#tensorflow #tensorflow-certificate
Preprocessing data (normalization and standardization)

Preprocessing steps:

  1. Turn all data into numbers
  2. Make sure your tensors are in the right shape
  3. Scale features (normalize or standardize) Neural networks tend to prefer normalization.

Normalization - adjusting values measured on different scales to a notionally common scale

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

TfC_01_FINAL_EXAMPLE.ipynb
ape # Create training and test datasets #my way: from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state=42) <span>Preprocessing data (normalization and standardization) Preprocessing steps: Turn all data into numbers Make sure your tensors are in the right shape Scale features (normalize or standardize) Neural networks tend to prefer normalization. Normalization - adjusting values measured on different scales to a notionally common scale Normalization # Start from scratch import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf ## Borrow a few classes from sci-kit learn from sklearn.compose import mak




[unknown IMAGE 7626420784396] #has-images #tensorflow #tensorflow-certificate
MSE
  • tf.keras.losses.MSE()
  • tf.metrics.mean_square_error()
  • when larger errors are more significant that smaller errors
statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on


Parent (intermediate) annotation

Open it
For regression problems: MAE tf.keras.losses.MAE() tf.metrics.mean_absolute_error() great starter metrics for any regression problem MSE tf.keras.losses.MSE() tf.metrics.mean_square_error() when larger errors are more significant that smaller errors Huber tf.keras.losses.Huber() combintion of MSE and MAE less sensitive to outliers than MSE Take away: You should minimize the time between your experiments (that's way you should start

Original toplevel document

TfC 01 regression
st_labels, c="green", label="Testing data") plt.scatter(test_data, predictions, c="red", label="Predictions") plt.legend(); Common regression evaluation metrics keyboard_arrow_down Introduction <span>For regression problems: MAE tf.keras.losses.MAE() tf.metrics.mean_absolute_error() great starter metrics for any regression problem MSE tf.keras.losses.MSE() tf.metrics.mean_square_error() when larger errors are more significant that smaller errors Huber tf.keras.losses.Huber() combintion of MSE and MAE less sensitive to outliers than MSE Take away: You should minimize the time between your experiments (that's way you should start with smaller models). The more experiments you do, the more things you figure out that don't work. Tracking your experiments One really good habit is to track the results of your experiments. There are tools to help us! Resource: Try: Tensorboard - a component of Tensorflow library t




Flashcard 7627744611596

Tags
#has-images #tensorflow #tensorflow-certificate
[unknown IMAGE 7626420784396]
Question
Typical workflow: [...] a model -> fit it -> evaulate -> tweak -> fit > evaluate -> ....
Answer
build

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Parent (intermediate) annotation

Open it
Typical workflow: build a model -> fit it -> evaulate -> tweak -> fit > evaluate -> ....

Original toplevel document

TfC 01 regression
activation functions # 2. Compiling: change optimizer or its parameters (eg. learning rate) # 3. Fitting: more epochs, more data ### How? # from smaller model to larger model Evaluating models <span>Typical workflow: build a model -> fit it -> evaulate -> tweak -> fit > evaluate -> .... Building model: experiment Evaluation model: visualize What can visualize? the data model itself the training of a model predictions ## The 3 sets (or actually 2 sets: training and test