Kyosuke

Kyosuke

84. Keras Model Hyper-parameter Tuning

One way to tune your keras model is using random search. Here is one example with sklearn. from scipy.stats import reciprocal from sklearn.model_selection import RandomizedSearchCV #Specify range for random initialization param_distribs = { “n_hidden”: [0, 1, 2, 3], “n_neurons”: np.arange(1,…

83. Precision/Recall Tradeoff

How do you decide a threshold for, let’s say classification? The higher the threshold, the lower the recall, but the higher the precision, and vice versa. This is called the Precision/Recall Tradeoff. One way is to plot all possible thresholds.…

82. Data Cleaning Methods

Here are some methods for cleaning data when using pandas dataframe: Delete data with empty district df.dropna(subset=[“COLUMN_NAME”]) Delete the whole attribute which includes empty data df.drop(“COLUMN_NAME”,axis=1) Replace empty data with other elements(Such as median) median = df[“COLUMN_NAME”].median() df[“COLUMN_NAME”].fillna(median,inplace=True) When replacing…

81. ML Project Workflow

There are 8 main steps: Frame Problem and Look at the Big Picture Get Data Explore data to gain insights Prepare the data to better expose the underlying data patterns to Machine Learning Algorithms Explore many different models and shortlist…

80. Shift in Recommendation Filtering

Over the last several years, there has been a trend in recommendation systems shifting from COLLABORATIVE FILTERING to CONTENT-BASED FILTERING. Each workflow are the following. Let’s say we want to recommend a restaurant to a user. Collaborative Filtering 1. looks…

79. Generate TensorRT Engine with Unet

Here is 1 way to Generate an engine file with Unet Pre-requisites – Deepstream 5.0.1 – TensorRT 7.1.3 – Jetson XAVIER NX – CUDA 10.2 Load Model import torch unet = torch.hub.load(‘milesial/Pytorch-UNet’, ‘unet_carvana’, pretrained=True) unet.eval() Export Model path_to_onnx =”” dummy…

77. 「The Power of Habit」 in 1 Drawing

The basic workflow of a habit is the following: CUE ⇒ ROUTINE ⇒ REWARD ⇒ CUE We can’t distinguish between GOOD and BAD habits. By understanding the CUE and REWARD, we can do something about our ROUTINE Cravings DRIVES CUE…

76. Use BRAVE to block ADS

BRAVE is a web browser based on chrome, so if you are a heavy chrome user, this might be the tool for you. BRAVE helps you block all ads and trackers, so for example you won’t see any ads before…

75. MLOps Deployment Example

Let’s say we want to detect whether there are any scratches on a smartphone(Example from MLops Specialization by Andrew NG). In this case, MLops would go something like this. Fig.1 – MLOps Capture Image of Smartphone The Inspection software inside…