小编Mir*_*dil的帖子

如何将2个字段数据复制到Solr上的一个字段

我在solr with LatLngfields中有一个文档.我需要添加一个名为store包含来自Lat和的数据的新字段Lng.我试图使用copyField字段,但我收到错误:

字段存储不是多值和多个copyFields的目标(2)

这是我的配置:

<fields>
  <field name="lat" type="sdouble" indexed="true" stored="true" required="true" multiValued="false" />
  <field name="lng" type="sdouble" indexed="true" stored="true" required="true" multiValued="false" /> 
  <field name="store" type="text" indexed="true" stored="true"/>
</fields> 

<copyField source="lat" dest="store"/> 
<copyField source="lng" dest="store"/> 
Run Code Online (Sandbox Code Playgroud)

是否可以复制同一目标字段中两个字段的内容?

solr

8
推荐指数
3
解决办法
2万
查看次数

Tensorflow尺寸大小必须可以被N整除,但对于“ linear / linear_model / x / Reshape”必须为M

我一直在尝试使用tensorflow tf.estimator,但是关于输入/输出数据的形状却遇到了以下错误。

ValueError:尺寸大小必须被9整除,但对于'linear / linear_model / x / Reshape'(op:'Reshape'),输入形状为[4,3],[2],且输入张量计算为部分时,尺寸为12形状:输入[1] = [?,9]。

这是代码:

data_size = 3
iterations = 10
learn_rate = 0.005
# generate test data
input = np.random.rand(data_size,3)
output = np.dot(input, [2, 3 ,7]) + 4
output = np.transpose([output])

feature_columns = [tf.feature_column.numeric_column("x", shape=(data_size, 3))]
estimator = tf.estimator.LinearRegressor(feature_columns=feature_columns)

input_fn = tf.estimator.inputs.numpy_input_fn({"x":input}, output, batch_size=4, num_epochs=None, shuffle=True)

estimator.train(input_fn=input_fn, steps=iterations)
Run Code Online (Sandbox Code Playgroud)

输入数据的形状为shape=(3, 3)

[[ 0.06525168  0.3171153   0.61675511]
 [ 0.35166298  0.71816544  0.62770994]
 [ 0.77846666  0.20930611  0.1710842 ]]
Run Code Online (Sandbox Code Playgroud)

输出数据形状为 shape=(3, 1)

[[  9.399135  ] …
Run Code Online (Sandbox Code Playgroud)

machine-learning shape reshape tensorflow

5
推荐指数
0
解决办法
4459
查看次数

MongoDB按计数提取文档

我有一个子文档的文档,看起来像:

{ 
    "name" : "some name1" 
    "like" : [      
            {  "date" : ISODate("2012-11-30T19:00:00Z") },
            {  "date" : ISODate("2012-12-02T19:00:00Z") },     
            {  "date" : ISODate("2012-12-01T19:00:00Z") },
            {  "date" : ISODate("2012-12-03T19:00:00Z") } 
    ]       
}
Run Code Online (Sandbox Code Playgroud)

是否可以获取"最喜欢"的文档(过去7天的平均值)并按计数排序?

mongodb

4
推荐指数
2
解决办法
7804
查看次数

标签 统计

machine-learning ×1

mongodb ×1

reshape ×1

shape ×1

solr ×1

tensorflow ×1