Geographic Information Systems Asked by hashalluring on January 23, 2021
I’m looking for a way to reduce the time taken by SVM classifier (without changing the dimenisons of my training data or data on which prediction has to be done) to predict the raster image data.
I have used the below classifier to predict the data .
from sklearn.svm import SVC
import numpy as np
clf = SVC(C=4, kernel = 'rbf',gamma= 0.25)
clf.fit(X, y)
bands_data = np.dstack(bands_data) #bands_data is the stack of raster images(there are around 11 files) data in a ndarray.
bands_data =np.nan_to_num(bands_data)
rows, cols, n_bands= bands_data.shape
n_samples = rows * cols
flat_pixels = bands_data.reshape((n_samples,n_bands))
r = clf.predict(flat_pixels)
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP