feature-extraction

Texture for Superpixels?

一曲冷凌霜 提交于 2019-12-12 02:55:19
问题 Since superpixels have irregular shape, I am not sure how to extract the texture features for them. All the techniques that I have found online require a rectangular image for extracting texture information. 回答1: There are at least two methods I can think of. Either compute the filter response on the entire undivided image and group the responses in each superpixel, or compute color histogram of the superpixel as an approximation for a texture feature. 回答2: There is also another way. Find

Unexpected results using ColumnTransformer() in Python Scikit-learn for predicting numerical values

我与影子孤独终老i 提交于 2019-12-11 16:11:19
问题 I would like to build a predictive model to predict the following numerical label self.varname_label = ['SUMMED_ALLCAUSE_NUM_POST2YR', 'SUMMED_DXTARGET_NUM_POST2YR', 'SUMMED_ALLCAUSE_COST_POST2YR', 'SUMMED_DXTARGET_COST_POST2YR'] . These refers to 1) the number of healthcare visits post index, 2) the number of healthcare visits for a specific medical condition post index, 3) the cost of healthcare visits post index, and 4) the cost of healthcare visits for a specific medical condition post

Using SVM with HOG Features to Classify Vehicles

自作多情 提交于 2019-12-11 15:48:09
问题 My goal here is to classify between SUVs and sedans using SVMs and HOG features. First I read 86 training images, calculate the HOG features for each of them, and put them in a training Mat that is of size 86xdescriptorSize called HOGFeat_train. Mat HOGFeat_train(num_train_images, derSize, CV_32FC1); //86xdescriptor size training Mat for (int file_count = 1; file_count < (num_train_images + 1); file_count++) { ss << name << file_count << type; //'Vehicle_1.jpg' ... 'Vehicle_2.jpg' ... etc ...

Undefined function 'extractHOGFeatures' for input arguments of type 'uint8'

試著忘記壹切 提交于 2019-12-11 13:58:54
问题 I am trying to extract HOG features from an image in MATLAB R2013a. This is the code I copied from MATLAB documentation website: input='1.png'; Z=imread(input); %Z=rgb2gray(Z); [featureVector, hogVisualization] = extractHOGFeatures(Z); The error I get is: Undefined function 'extractHOGFeatures' for input arguments of type 'uint8'. Error in hogfeatureextractor (line 6) [featureVector, hogVisualization] = extractHOGFeatures(Z); I think this is due to the computer vision toolbox not installed

How to remove particular attributes from arff file and produce modified arff?

被刻印的时光 ゝ 提交于 2019-12-11 13:28:48
问题 (not manually) i have 96 features and want to remove some 20 features from arff and produce modified arff. used weka for feature selection now want to remove those less imp features. can anyone suggest code for this 回答1: Here you go... just change the source and destination file path... import java.io.File; import weka.core.Instances; import weka.core.converters.ArffLoader; import weka.core.converters.ArffSaver; import weka.filters.Filter; import weka.filters.unsupervised.attribute.Remove;

HOG descriptor is rotation invariant?

爱⌒轻易说出口 提交于 2019-12-11 10:39:13
问题 I am working grass weed detection. I have started to extract features from the HoG descriptor. As studied from the HoG literature that the HoG is not rotation invariant. I have total 18 images of each class of grass weed and there is two classes. In my training and testing database I have rotated each image [5 10 15 20 ... 355] degree. training and testing is done using LibSVM package. and I am getting accuracy of about 80%. My question is if the HoG is not rotation invariant then how can I

TypeError: a float is required in sklearn.feature_extraction.FeatureHasher

天涯浪子 提交于 2019-12-11 09:55:15
问题 I'm using sklearn version 0.16.1. It seems that FeatureHasher doesn't support strings (as DictVectorizer does). For example: values = [ {'city': 'Dubai', 'temperature': 33.}, {'city': 'London', 'temperature': 12.}, {'city': 'San Fransisco', 'temperature': 18.} ] print("Starting FeatureHasher ...") hasher = FeatureHasher(n_features=2) X = hasher.transform(values).toarray() print X But the following error is received: _hashing.transform(raw_X, self.n_features, self.dtype) File "_hashing.pyx",

How to Perform Consecutive Counts of Column by Group Conditionally Upon Another Column

风格不统一 提交于 2019-12-11 06:08:11
问题 I'm trying to get consecutive counts from the Noshow column grouped by the PatientID column. The below code that I am using is very close to the results that I wish to attain. However, using the sum function returns the sum of the whole group. I would like the sum function to only sum the current row and only the rows that have a '1' above it. Basically, I'm trying to count the consecutive amount of times a patient noshows their appointment for each row and then reset to 0 when they do show.

Vectorization in sklearn seems to be very memory expensive. Why?

白昼怎懂夜的黑 提交于 2019-12-11 05:56:47
问题 I need to process more than 1,000,000 text records. I am employing CountVectorizer to transform my data. I have the following code. TEXT = [data[i].values()[3] for i in range(len(data))] #these are the text records from sklearn.feature_extraction.text import CountVectorizer vectorizer = CountVectorizer(min_df=1) X = vectorizer.fit_transform(TEXT) X_list = X.toarray().tolist() As I run this code, it turns out MemoryError . The text records I have are mostly in short paragraphs (~100 words).

Training a Keras model on multiple feature files that are read in sequentially to save memory

烂漫一生 提交于 2019-12-11 05:55:31
问题 I'm running into memory issues when trying to read in massive feature files (see below). I figured I'd split the training files and read them in sequentially. What is the best approach to do that? x_train = np.load(path_features + 'x_train.npy) y_train = np.load(path_features + 'y_train.npy) x_test = np.load(path_features + 'x_test.npy) y_test = np.load(path_features + 'y_test.npy) path_models = '../pipelines/' + pipeline + '/models/' # global params verbose_level = 1 inp_shape = x_train