Error in .per_cell_qc_metrics(assay(x, assay.type), subsets = subsets, : unused argument (cell_controls = list(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212r语言报错如何解决
时间: 2023-06-10 14:02:30 浏览: 467
这个错误提示看起来是在使用 R 语言时出现的,其中 .per_cell_qc_metrics 有一个无法使用的参数 cell_controls。如果你之前使用了这个函数并且添加了 cell_controls 参数,那么你需要删除这个参数来解决报错。另外,也可能是你的参数输入有误,你需要检查你的输入是否正确,比如是否有拼写错误、参数的类型是否正确等。如果以上方法都解决不了问题,你可以尝试在 R 语言的社区中搜索该问题,也可以向 R 语言的维护者寻求帮助。
相关问题
output = tf.keras.rnn.static_rnn(cell, seqTimeSteps, dtype = tf.float64)
在 TensorFlow 2.x 中,`tf.keras.rnn.static_rnn` 函数已经被弃用,如果想要在 TensorFlow 2.x 中使用 RNN 网络,可以使用 `tf.keras.layers.RNN` 类,或者使用 `tf.keras.layers.SimpleRNN`、`tf.keras.layers.LSTM`、`tf.keras.layers.GRU` 等层来构建 RNN 网络。
如果你想使用类似 `tf.keras.rnn.static_rnn` 的函数,可以使用 `tf.compat.v1.nn.static_rnn` 函数来代替,如下所示:
```python
import tensorflow as tf
# 定义 RNN 网络结构
cell = tf.compat.v1.nn.rnn_cell.BasicRNNCell(num_units=128)
inputs = tf.random.normal(shape=(32, 10, 10))
seqTimeSteps = tf.unstack(inputs, axis=1)
outputs, state = tf.compat.v1.nn.static_rnn(cell, seqTimeSteps, dtype=tf.float64)
# 定义模型
model = tf.keras.Model(inputs=inputs, outputs=outputs)
# 编译模型
model.compile(optimizer='adam', loss='mse', metrics=['mae'])
# 训练模型
x_train = tf.random.normal(shape=(32, 10, 10))
y_train = tf.random.normal(shape=(32, 10, 128))
model.fit(x_train, y_train, batch_size=8, epochs=10)
```
在上面的代码中,我们首先使用 `tf.compat.v1.nn.rnn_cell.BasicRNNCell` 定义了一个基础的 RNN 单元,然后使用 `tf.compat.v1.nn.static_rnn` 函数对输入数据进行处理。最后使用 `tf.keras.Model` 定义了一个完整的模型,并使用 `model.compile` 和 `model.fit` 进行模型的编译和训练。需要注意的是,在使用 `tf.compat.v1.nn.static_rnn` 函数时,需要将输入数据转换为 `list` 类型的张量,并且需要指定 `dtype` 参数。
将skplt.metrics.plot_roc中的(area=)改成中文
您可以使用 `plt.title` 函数来更改 ROC 曲线图的标题,例如:
```python
import scikitplot as skplt
import matplotlib.pyplot as plt
from sklearn.datasets import load_breast_cancer
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)
svm = SVC(probability=True)
svm.fit(X_train, y_train)
y_pred_proba = svm.predict_proba(X_test)
skplt.metrics.plot_roc(y_test, y_pred_proba)
plt.xlabel("假正率")
plt.ylabel("真正率")
plt.title("ROC 曲线(面积=0.95)")
plt.show()
```
这样就可以将 ROC 曲线的标题改为中文了。