我有一个列表列表,其中每个列表代表一个时间序列:
tsli=[[43,65,23,765,233,455,7,32,57,78,4,32],[34,32,565,87,23,86,32,56,32,57,78,32],[87,43,12,46,32,46,13,23,6,90,67,8],[1,2,3,3,4,5,6,7,8,9,0,9],[12,34,56,76,34,12,45,67,34,21,12,22]]
Run Code Online (Sandbox Code Playgroud)
我想使用代码使用 tsfresh 包从该数据集中提取特征:
import tsfresh
tf=tsfresh.extract_features(tsli)
Run Code Online (Sandbox Code Playgroud)
当我运行它时,我收到值错误,即:
> ValueError: You have to set the column_id which contains the ids of the different time series
But i don't know how to deal with this and how to define column id for this problem.
Run Code Online (Sandbox Code Playgroud)
编辑1: 正如建议的那样,我尝试将数据集转换为数据,然后尝试:
import tsfresh
df=pd.DataFrame(tsli)
tf=tsfresh.extract_features(df)
Run Code Online (Sandbox Code Playgroud)
但值错误是相同的
> ValueError: You have to set the column_id which contains the ids of the different time series
Run Code Online (Sandbox Code Playgroud)
任何资源或参考都会有所帮助。
谢谢
我在C中实施统一的LBP.但我对这个概念感到困惑.我已经实施了LBP.假设我有512*512尺寸的图像.在LBP之后它将是510*510.现在如何从这个LBP图像中获得256个像素/像素.
for(i=1; i < image_src->width - 1; i++)
{
for(j=1; j < image_src->height - 1; j++)
{
const unsigned char center = image_get_pixel_value(image_src, i, j , 0);
unsigned char code = 0;
if(center <= image_get_pixel_value(image_src, i-1, j-1 , 0))
code += 128;
if(center <= image_get_pixel_value(image_src, i-1, j , 0))
code += 64;
if(center <= image_get_pixel_value(image_src, i-1, j+1 , 0))
code += 32;
if(center <= image_get_pixel_value(image_src, i, j+1 , 0))
code += 16;
if(center <= image_get_pixel_value(image_src, i+1, j+1 , 0))
code …Run Code Online (Sandbox Code Playgroud) c image-processing pattern-matching feature-extraction computer-vision
我一直在尝试执行以下操作 - 当用户在我的网络应用程序中上传图像时,我想在其中检测到他/她的脸并从中提取脸部(从额头到下巴和脸颊到脸颊).
我尝试使用Haar Cascade进行OpenCV/C++人脸检测,但问题在于它给出了面部所在位置的概率,因为图像背景进入ROI内部甚至整个面部都没有进入ROI.我也想检测面部内的眼睛,并且在使用上述技术时,眼睛检测并不准确.
我已经阅读了一种名为Active Appearance Model(AAM)的新技术.我在这里阅读的博客表明,这正是我想要的,但我对如何实现这一点感到很遗憾.
我的疑问是 -
任何这些的任何帮助非常感谢.
谢谢 !
c++ opencv feature-extraction face-detection feature-detection
我正在使用两个特征描述符,HOG和LBP进行人员检测.到目前为止,我使用简单的连接组合了这两个功能.但它有时会显示由于大矢量引起的问题.这是我的代码.
%extract features from negative and positive images
[HOGpos,HOGneg] = features(pathPos, pathNeg);
% loading and labeling each training example
HOG_featV = HOGfeature(fpos,fneg);
% get label of training data from HOG
HOGlabel = cell2mat(HOG_featV(2,:));
% get the feature vector value from HOG
HOGfeatureVector = HOG_featV(3,:)';
C = cell2mat(HOGfeatureVector); % each row of P correspond to a training example
%extract features from LBP
[LBPpos,LBPneg] = LBPfeatures(pathPos, pathNeg);
% loading and labeling each training example
LBP_featV = loadingV(LBPpos, LBPneg);
% get label of …Run Code Online (Sandbox Code Playgroud) 我的问题在某种程度上是simelar: 使用OpenCV从小图像中提取点描述符
我想从小图像(Orb,BRISK,FAST)中提取关键点,但如果图像的大小低于100x160,则我的关键点向量为空([]).
我在文档中找不到解决方案.
谢谢您的帮助.
我在Pandas中有一个数据框,其形状为(136,1445)。我尝试为我的136行创建correlation(Pearson)矩阵。因此,结果是,我需要一个尺寸为136x136的矩阵。
我尝试了两种不同的方法,但是无法从中获得结果,或者当我创建136x136相关矩阵时,我丢失了数据框的列名。
第一,
gene_expression = pd.read_csv('padel_all_drug_results_original.csv',dtype='unicode')
gene_expression = gene_expression.convert_objects(convert_numeric=True)
gene_expression.corr()
Run Code Online (Sandbox Code Playgroud)
这给出了基于列的皮尔逊相关矩阵(1445 * 1445),当我尝试转置我的数据框然后尝试找到相关时,数据框的结构被破坏(例如列名丢失或我什至不确定该相关性是正确的)。
其次,
distance = lambda column1, column2: pearsonr(column1,column2)[0]
result = gene_expression.apply(lambda col1: gene_expression.apply(lambda col2: distance(col1, col2)))
Run Code Online (Sandbox Code Playgroud)
我应该如何计算136x136皮尔逊相关矩阵,以不更改原始数据帧?
另外,我有1445个功能,有些列几乎全为零。因此,我删除了这些列,因为它们是嘈杂的列,但是您有另一个想法来实现重用吗?
提前致谢
我试图使用OpenSMILE从音频样本中提取一些功能,但我意识到设置配置文件有多困难.
文档不是很有帮助.我能做的最好的事情是运行一些提供的示例配置文件,看看是什么,然后进入配置文件并尝试确定功能的指定位置.这是我做的:
我使用了INTERSPEECH 2010 Paralinguistic Challenge(IS10_paraling.conf)中使用的默认功能集.
我把它放在一个示例的audiofile上.
我看了看出来了.然后我深入阅读配置文件,试图找出指定功能的位置.
这是一个小的降价表,显示了我的探索结果:
| Feature generated | instruction in the conf file |
|-------------------|---------------------------------------------------------|
| pcm_loudness | I see: 'loudness=1' |
| mfcc | I see a section: [mfcc:cMfcc] |
| lspFreq | no matches for the text 'lspFreq' anywhere |
| F0finEnv | I seeF0finalEnv = 1 under [pitchSmooth:cPitchSmoother] |
Run Code Online (Sandbox Code Playgroud)
我所看到的是4个不同的功能,全部由配置文件中的不同指令生成.好吧,对于其中一个,我找不到配置文件中没有令人费解的指令.没有模式或直观的语法或明显的系统,我不知道如何最终弄清楚如何指定我想要生成的自己的功能.
没有教程,没有YouTube视频,没有StackOverflow问题,也没有关于如何做到这一点的博客文章.这真是令人惊讶,因为这显然是使用OpenSMILE的一个重要部分.
如果有人发现这个,请你告诉我如何创建OpenSMILE的自定义配置文件?谢谢!
尝试读取大量功能文件时遇到内存问题(请参阅下文)。我想我会分割训练文件并按顺序阅读。最好的方法是什么?
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.shape[1:]
# models
if model_type == 'standard_4':
print('Starting to train ' + feature_type + '_' + model_type + '.')
num_classes = 1
dropout_prob = 0.5
activation_function = 'relu'
loss_function = 'binary_crossentropy'
batch_size = 32
epoch_count = 100
opt = SGD(lr=0.001)
model = Sequential() …Run Code Online (Sandbox Code Playgroud) 我正在做二进制分类问题,我的模型架构如下
def CNN_model(height, width, depth):
input_shape = (height, width, depth)
model = Sequential()
# Block 1
model.add(Conv2D(64, kernel_size=(3, 3), strides=1, activation='relu', input_shape=input_shape, padding='VALID'))
model.add(Conv2D(64, kernel_size=(3, 3), strides=1, activation='relu', padding='VALID'))
model.add(MaxPooling2D(pool_size=(2, 2)))
# Block 2
model.add(Conv2D(128, kernel_size=(3, 3), strides=1, activation='relu', padding='VALID'))
model.add(Conv2D(128, kernel_size=(3, 3), strides=1, activation='relu', padding='VALID'))
model.add(AveragePooling2D(pool_size=(19, 19)))
# set of FC => RELU layers
model.add(Flatten())
model.add(Dense(128))
model.add(Activation('relu'))
model.add(BatchNormalization())
model.add(Dense(num_classes, activation='softmax'))
model.compile(loss=keras.losses.binary_crossentropy,
optimizer=keras.optimizers.Adadelta(),
metrics=['accuracy'])
return modelRun Code Online (Sandbox Code Playgroud)
我需要测试集上的每个图像,我得到一个从FC层收集的128-D特征向量用于SVM分类.更多细节,来自model.add(Dense(128)).你能告诉我如何解决这个问题吗?谢谢!
我正在处理包含类型为特征的电影数据集。数据集中的示例可能同时属于多个流派。因此,它们包含一个类型标签列表。
数据看起来像这样-
movieId genres
0 1 [Adventure, Animation, Children, Comedy, Fantasy]
1 2 [Adventure, Children, Fantasy]
2 3 [Comedy, Romance]
3 4 [Comedy, Drama, Romance]
4 5 [Comedy]
Run Code Online (Sandbox Code Playgroud)
我想向量化此功能。我已经尝试过LabelEncoder和OneHotEncoder,但是它们似乎无法直接处理这些列表。
我可以手动将其向量化,但是我还有其他相似的功能,其中包含太多的类别。对于那些我更喜欢直接使用FeatureHasher类的方法。
有什么方法可以使这些编码器类在这种功能上工作?还是有更好的方法来表示这样的功能,从而使编码更容易?我很欢迎任何建议。
machine-learning feature-extraction pandas scikit-learn categorical-data
python ×3
keras ×2
opencv ×2
pandas ×2
audio ×1
c ×1
c++ ×1
correlation ×1
matlab ×1
numpy ×1
scikit-learn ×1
tensorflow ×1
time-series ×1
tsfresh ×1