小编Ali*_*Ali的帖子

安装Graphviz 2.36.在macOS Sierra上

我正在尝试在Protege上安装GraphViz plugIn.我先安装Graphviz2.36软件包但它不起作用.然后我用brew install graphviz我得到了这个错误Warning: graphviz-2.38.0_1 already installed, it's just not linked.因此,我使用brew link graphviz但是我得到了这个错误

错误:无法符号链接bin /非循环
目标/ usr/local/bin/acyclic
已存在.你可能想删除它:
rm'/ usr/local/bin/acyclic'

因为这个,我使用brew link --overwrite graphviz了我得到这个错误:

错误:无法使用符号链接/ graphviz/arith.h/usr/local/include/graphviz不可写.

任何人都知道如何解决这个问题?

graphviz protege

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

使用来自pandas DataFrame的数据拟合sklearn的SVM分类器

我正在尝试使用SVM,但是当我使用pandas数据帧时,我不知道如何适应模型.如果我的数据如下所示:

df = pd.DataFrame({"x": ['011', '100', '111'] , "y": [0,1,0]})
df.x.apply(lambda x: np.array(list(map(int,x))))
>>>df
    x           y
0   [0, 1, 1]   0
1   [1, 0, 0]   1
2   [1, 1, 1]   0
Run Code Online (Sandbox Code Playgroud)

如果我尝试以这种方式拟合模型:

clf = svm.SVC().fit(df.x, df.y)
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

ValueError: setting an array element with a sequence.
Run Code Online (Sandbox Code Playgroud)

使用此数据框适合SVM的正确方法是什么?

python numpy dataframe pandas scikit-learn

0
推荐指数
1
解决办法
3531
查看次数

标签 统计

dataframe ×1

graphviz ×1

numpy ×1

pandas ×1

protege ×1

python ×1

scikit-learn ×1