小编the*_*ina的帖子

如何在sklearn中打印聚类结果

我有一个稀疏矩阵

from scipy.sparse import *
M = csr_matrix((data_np, (rows_np, columns_np)));
Run Code Online (Sandbox Code Playgroud)

然后我正在以这种方式进行聚类

from sklearn.cluster import KMeans
km = KMeans(n_clusters=n, init='random', max_iter=100, n_init=1, verbose=1)
km.fit(M)
Run Code Online (Sandbox Code Playgroud)

我的问题是非常的菜鸟:如何在没有任何额外信息的情况下打印聚类结果.我不关心密谋或距离.我只需要那样的聚集行

Cluster 1
row 1
row 2
row 3

Cluster 2
row 4
row 20
row 1000
...
Run Code Online (Sandbox Code Playgroud)

我怎么才能得到它?对不起,请原谅我这个问题.

python cluster-analysis k-means scikit-learn

11
推荐指数
1
解决办法
1万
查看次数

对不起!Kibana 和 Amazon Cognito 之间的身份验证过程中出现问题

我正在将 AWS ElasticSearch 与 Cognito 结合使用,并在尝试登录时收到以下错误

Sorry! Something went wrong during authentication between Kibana and Amazon Cognito. What happened? User: x:x:x::xx:x is not authorized to perform: es:ESHttpGet

我的 AWS ES 集群访问策略看起来像

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::xxxxxxxxx:role/service-role/CognitoAccessForAmazonES"
      },
      "Action": "es:ESHttp*",
      "Resource": "arn:aws:es:xxxxxxx:xxxxxxx:domain/elastic-blah/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": "xx.xx.xx.xx/32"
        }
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-cognito amazon-elasticsearch

10
推荐指数
1
解决办法
5879
查看次数

使用 Graphite+Grafana 测量服务的正常运行时间

我的问题有点哲学:您将如何根据 Graphite 指标计算流程的正常运行时间?

我有很多 jvm-process (Apache Spark) 实例。在 Graphite 处于活动状态时,每 5 分钟向其报告一次指标。我想计算每个流程的正常运行时间以及本周和本月所有流程的平均正常运行时间。

现在我没有运气在 Graphite 或 Grafana 中找到合适的方法来计算每次测量的时间。也许我需要使用外部脚本。在 Grafana 中将平均正常运行时间显示为单统计面板也很不错。

performance graphite apache-spark grafana

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