问题标签 [incanter]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
17 浏览

clojure - 一些咒语功能有问题

在使用 Incanter 1.5.5 时,我想使用这个函数:(sample-neg-binomial 10),它给出了一个未解决的符号错误。为了确保项目依赖项是最新的,我重新运行了 Lein deps。同样的错误。这个 (:use [incanter core charts io datasets stats ]) 在我的命名空间函数中。在 Stackoverflow 中的搜索表明这是可行的(sample-normal 100 :mean -2 :sd (sqrt 0.5)),但也给出了一个未解析的符号;这篇文章是 3 年前的。如果有人知道如何解决这个问题,我将不胜感激?

0 投票
2 回答
169 浏览

clojure - lein deps 在从 github 克隆的 incanter 上失败

从 github 克隆的 incanter。当我尝试做一个 lein deps 时,我得到了一堆错误:

不确定是什么问题。我已经在不同的时间尝试过这个,看看它是否与网络问题有关,但问题仍然存在。

0 投票
1 回答
462 浏览

clojure - 正下方的中心 Incanter 直方图 x 轴刻度线

我想在 Incanter 的直方图中对齐我的 x 轴标签(基于 JFreeChart),以便它们在条形下方居中。我也想摆脱分数轴刻度线。

我的问题与JFreeChart: Aligning domain axis with histogram bins非常相似。

以下是其他语言的相关问题:

Incanter 示例直方图

PS 直方图也不吸引人,因为 6 的条形图位于刻度线的左侧。其他条在其刻度线的右侧!

更新:另见:

0 投票
1 回答
278 浏览

clojure - 一起使用 Incanter 和 Clojure Soup

我正在学习 Clojure - 这很有趣!我正在尝试在同一个文件中使用 Incanter 和 Clojure Soup:

我收到以下错误:

我想我明白为什么,但我该如何解决这个问题?欣赏这个网站和上面的所有大师!

谢谢。

0 投票
1 回答
68 浏览

plot - 在 Incanter 中使用 :group-by 散点图选项时出现 ClassCastException

我正在使用 Incanter 1.9,但无法:group-by在散点图功能中使用选项。我目前正在尝试的声明是:

它会产生此错误:

我究竟做错了什么?这是:group-by散点图中的正确用法吗?

0 投票
1 回答
187 浏览

clojure - 有没有一种方便的方法可以将非 utf8 编码文件读入 incanter?

似乎Incanter只能识别utf-8编码文件,而native clojure slurp可以读取带有关键字的非utf8编码文件:encoding,所以是否可以将这两个功能结合在一起,但我不知道该怎么做!

0 投票
1 回答
224 浏览

java - 使用 incanter 从 clojure 中的数组中获取均值和协方差矩阵

我正在尝试从正在1000x2使用的数据结构中获取数组均值和协方差矩阵incanter

我的测试用例看起来像这样

我在 LightTable 中运行。

我得到的错误是这样的:

我不能说我明白这一点,不幸的是我的谷歌搜索没有帮助。有人可以提供一个简单的解释和解决方案吗?

自然地,一种可怕的做法是

完全披露:我是clojure的新手。

谢谢

0 投票
1 回答
150 浏览

clojure - 使用 profile.clj 中指定的插件

我在 profile.clj 中添加了一些插件。当我开始一个新的 repl 时,它们会正确下载到.m2/repository directory(use '...)FileNotFoundException. 那么如何在项目外部的默认 repl 中使用这些插件呢?

  • 赢 7
  • clojure 1.7
  • 莱宁根 2.5.3
  • jdk1.8.0_25

    user=> (use 'hiccup.core)

    FileNotFoundException Could not locate hiccup/core...

与新下载的 Incanter 1.9.0 相同

我知道这个错误有几个问题,但都是在项目的上下文中,而不是默认的 repl。或者我只能在项目 repl 中使用插件?

提前致谢!

这是我的profiles.clj

0 投票
1 回答
684 浏览

clojure - Clojure : Group-by too slow (13 million-lines file)

Situation

I have a 13 million-lines CSV on which I want to perform logistic regression (incanter) for each group. My file is like that (values are just sample)

So I first read it with a csv-reader, everithing is fine.

I have then something like that :

I want to group-by these values by Id, If I remember correctly, there are around 1.2 millions of Ids. (I did it in Python with pandas and it is super fast)

This is my function to read and format the file (it works fine on smaller datasets) :

I want finally to have something like that to perform the logistic regression (I'm flexible about that, does not need vectors for :x and :y , seqs are ok)

Problem

I have trouble with the group-by operation. I tried it separately on the output from CSV and this is taking forever when it does not dies out because of the Java Heap Space memory. I thought that the problem was my mapv thing but this is the group-by.

I thought about using reduce or reduce-kv but I do not know how to use these functions for this kind of purposes.

I do not care about the order of ":x" and ":y" (as soon as they are the same between them, I mean that x and y has the same index ... not a problem because they are on the same line) and of Ids on the final result and I read that group-by keep the order. Maybe that is that which is costly for the operation ?

I give you sample data if any person has encountered that :

Other alternatives

I have other ideas but i'm not sure they are "Clojure"-friendly.

  • In Python, because of the nature of the function and because the file is already ordered, instead of using group-by, I wrote in a dataframe beginning and end indexes for each group so that I just had to select directly the sub-datatab.

  • I can also load a list of the ids instead of computing it from Clojure. Like

    (def ids '("1" "2" etc.

So maybe it is possible to begin with :

from the previous seq and then match the big file on each ID.

I don't know if it's more efficient in fact.

I have all the other functions for logistic regression, I just lack this part ! Thanks !

EDIT

Thanks for the answers, I finally have this solution.

In my project.clj file

Code :

I wrapped all my code and it works. The split takes about 5 minutes but I do not need mega-speed. Memory usage can go up to all memory for file reading then less for sigmoid.

0 投票
0 回答
103 浏览

charts - 组合 Incanter 图表对象以通过一次视图调用显示多个图表

我有这样的事情:

显示模拟中的三行。现在,我不想在一张图表中绘制三条线,我想绘制三个图表,每条线只使用一次查看。这可能使用 Incanter 吗?