小编Tom*_*omG的帖子

使用scikit-learn.mixture.GMM查找条件高斯混合模型

我正在使用scikit-learn来将多元高斯混合模型拟合到某些数据(这些数据非常出色).但我需要能够以某些变量为条件获得新的GMM条件,并且scikit工具包似乎无法做到这一点,这让我感到惊讶,因为它似乎是一件非常基本的事情.

维基百科对我正在尝试做的事情有很好的解释(对于单个高斯,而不是GMM),而且我可能能够自己实现它,但我的矩阵数学不是很好,我可以看到它花了很长时间.

有人已经这样做了吗?使用NumPy/SciPy/Scikit-learn有一种简单的方法吗?

python normal-distribution gaussian scikit-learn

5
推荐指数
1
解决办法
1303
查看次数

从Python访问OrientDB

我想将> 1mn记录的MySQL数据库转换为图形数据库,因为它是重度链接的网络类型数据.Neo4J的免费版本有一些我认为可能会遇到的限制,因此我安装了OrientDB(Community 2.2.0)(在Ubuntu Server 16.04上)并使其正常运行.现在我需要从Python(3.5.1+)访问它,所以我正在尝试pyorient(1.5.2).(我尝试使用TinkerPop,因为我最终想要使用Gremlin,并且无法让gremlin控制台与OrientDB交谈.)

以下简单的Python代码,用于连接到OrientDB中的一个测试图:

import pyorient

username="user"
password="password"

client = pyorient.OrientDB("localhost", 2424)
session_id = client.connect( username, password )

print("SessionID=",session_id)

db_name="GratefulDeadConcerts"

if client.db_exists( db_name, pyorient.STORAGE_TYPE_MEMORY ):
    print("Database",db_name,"exists")
    client.db_open( db_name, username, password )
else:
    print("Database",db_name,"doesn't exist")
Run Code Online (Sandbox Code Playgroud)

给出了一个奇怪的错误:

SessionID= 27
Database GratefulDeadConcerts exists
Traceback (most recent call last):
  File "FirstTest.py", line 18, in <module>
    client.db_open( db_name, username, password )
  File "/home/tom/MyProgs/TestingPyOrient/env/lib/python3.5/site-packages/pyorient/orient.py", line 379, in db_open
    .prepare((db_name, user, password, db_type, client_id)).send().fetch_response()
  File "/home/tom/MyProgs/TestingPyOrient/env/lib/python3.5/site-packages/pyorient/messages/database.py", line 141, in fetch_response
    info = OrientVersion(release)
  File "/home/tom/MyProgs/TestingPyOrient/env/lib/python3.5/site-packages/pyorient/otypes.py", …
Run Code Online (Sandbox Code Playgroud)

python orientdb pyorient

5
推荐指数
1
解决办法
952
查看次数