我使用命令在Ubuntu上安装了R-3.1.2
wget http://cran.r-project.org/src/base/R-3/R-3.1.2.tar.gz
tar xvfz R-3.1.2.tar.gz
cd R-3.1.2
./configure
make
sudo make install
Run Code Online (Sandbox Code Playgroud)
当我尝试启动RStudio时,我收到了错误
找不到R共享库(/usr/local/lib/R/lib/libR.so).如果这是R的自定义构建,是否使用--enable-R-shlib选项构建?
所以我回去试图重新配置
./configure --enable-R-shlib=yes
make
Run Code Online (Sandbox Code Playgroud)
但我得到了错误
collect2: error: ld returned 1 exit status
make[3]: *** [libR.so] Error 1
make[3]: Leaving directory `/usr/local/lib/R-3.1.2/src/main'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/usr/local/lib/R-3.1.2/src/main'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/usr/local/lib/R-3.1.2/src'
make: *** [R] Error 1
Run Code Online (Sandbox Code Playgroud)
当搜索堆栈溢出时,我在这里找到了一个答案: 如何使用--enable-R-shlib配置R-3.0.1, 这表明问题是我试图在我之前编译的目录中编译而没有" --enable-R-shlib"选项
我试图通过使用命令来解决问题
make uninstall
Run Code Online (Sandbox Code Playgroud)
这并没有给出任何错误"没有什么可以做'卸载'." 语句,但它确实成功卸载了R.
./configure --enable-R-shlib=yes
Run Code Online (Sandbox Code Playgroud)
这给出了错误
config.status: error: cannot find input file: `src/library/base/DESCRIPTION.in'
Run Code Online (Sandbox Code Playgroud)
然后
make …Run Code Online (Sandbox Code Playgroud) 我使用的功能confusionMatrix在[R包caret来计算一些数据我有一些统计数字.我一直把我的预测以及我的实际值放到函数中,以便table在confusionMatrix函数中使用表格,如下所示:
table(predicted,actual)
Run Code Online (Sandbox Code Playgroud)
但是,有多种可能的结果(例如A,B,C,D),我的预测并不总是代表所有可能性(例如只有A,B,D).table函数的结果输出不包括缺少的结果,如下所示:
A B C D
A n1 n2 n2 n4
B n5 n6 n7 n8
D n9 n10 n11 n12
# Note how there is no corresponding row for `C`.
Run Code Online (Sandbox Code Playgroud)
该confusionMatrix函数无法处理缺失的结果并给出错误:
Error in !all.equal(nrow(data), ncol(data)) : invalid argument type
Run Code Online (Sandbox Code Playgroud)
有没有一种方法可以使用table不同的函数来获取缺少的零行或使用confusionMatrix不同的函数,以便将缺失的结果视为零?
作为注释:由于我随机选择要测试的数据,有时候实际结果中也没有表示类别,而只是预测.我不相信这会改变解决方案.
想要在同一个条形图上绘制以下数据。这是一个长度频率条形图,显示了人口中男性和女性的长度类别:
我对此很陌生,我不知道如何将我的数据放在这里,但这里有一个例子:
Lengthclass Both Males Females
60 7 5 2
70 10 5 5
80 11 6 5
90 4 2 2
100 3 3 0
110 3 0 3
120 1 1 0
130 0 0 0
140 1 0 1
150 2 0 2
Run Code Online (Sandbox Code Playgroud)
如果我使用此代码:
{barplot()}它不会在同一图上提供所有三个变量。
我需要一个看起来像这样但在 R 上的图表。

谢谢你:)
我试图将SqueezeDet模型的Keras实现适应新的数据集.在对我的配置文件进行适当的更改后,我尝试运行火车脚本,但它似乎在调用后挂起fit_generator().当我得到以下输出:
/anaconda/envs/py35/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Number of images: 536
Number of epochs: 100
Number of batches: 53
Batch size: 10
2018-07-04 14:18:49.711606: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-07-04 14:18:54.080912: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found …Run Code Online (Sandbox Code Playgroud) r ×3
bar-chart ×1
graph ×1
keras ×1
missing-data ×1
python ×1
python-3.x ×1
r-caret ×1
rstudio ×1
tensorflow ×1