Notes with tag #problem

16 Oct 2023

Negative MSE

from sklearn.svm import SVR

SVM_reg = SVR()
param_grid = [
        {'kernel': ['linear'], 'C': [10., 30., 100., 300., 1000., 3000.]},
        {'kernel': ['rbf'], 'C': [1.0, 3.0, 10., 30., 100., 300., 1000.0],
         'gamma': [0.01, 0.03, 0.1, 0.3, 1.0, 3.0]},
    ]

grid_search = GridSearchCV(SVM_reg, param_grid, cv=5,
                            scoring='neg_mean_squared_error',
                            verbose=2)
# grid_search.fit(housing_prepared, housing_labels)

negative_mse = grid_search.best_score_
rmse = np.sqrt(-negative_mse)
rmse

Why is the MSE negative in this case?

The scoring parameter expects a utility function, where higher values indicate better performance. However, mean squared error (MSE) is an error metric, where lower values indicate better performance. To convert the MSE into a utility function, the negative value is used.

By using negative MSE as the scoring metric, the grid search algorithm will try to maximize the negative MSE, which is equivalent to minimizing the MSE.

15 Apr 2023

Powerlvl10k Icons Not Working

  1. Download these four ttf files (most likely you’ll only need this one MesloLGS NF Regular.ttf):
  2. Double-click on each file and click "Install". This will make MesloLGS NF font available to all applications on your system.

  3. Open Settings in Visual Studio Code: Code → Preferences → Settings.

  4. Enter terminal.integrated.fontFamily in the search box at the top of Settings tab and set the value below to MesloLGS NF.

11 Apr 2023

Node.js OpenSSL issue

The algorithm being used for hashing is not supported by your version of OpenSSL.

library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'

Solution

Add this to your .zshrc

export NODE_OPTIONS=--openssl-legacy-provider

31 Jan 2023

Creating a new Rails page

Scaffolding

Creates a new page with model, view, and controller, including CRUD operations.

rails g scaffold Person name:string quote:text
rails db:migrate

Simple Page

Does not create a model or CRUD operations.

rails g controller Person index

09 Jan 2019

Add SSH key to GitLab

  1. In terminal ssh-keygen -t ed25519
  2. Go to directory where it was created and copy the contents of the .pub file into gitlab ssh keys