Member-only story

Gridsearch for tuning neural networks and SVM using RDKIT

Patrick Chirdon
7 min readOct 16, 2020

--

Creating neural networks takes a lot of time…. You want to pick the network with the best fit for the most accuracy. Neural networks and SVM are common methods used by machine learning practitioners to make predictions on data.

The code below shows you how to perform a gridsearch for gamma and C parameters for SVM.

The output was graphed below.

print(__doc__)

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize

from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
from sklearn.datasets import load_iris
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.model_selection import GridSearchCV

import numpy as np
from matplotlib import cm
from rdkit import Chem
from rdkit.Chem import AllChem, DataStructs
from rdkit.Chem.Draw import SimilarityMaps
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
import os
import joblib
import numpy as np
from matplotlib import cm
from rdkit import Chem
from rdkit.Chem import AllChem, DataStructs
from rdkit.Chem.Draw import…

--

--

No responses yet