小编Mik*_*keL的帖子

Scikit中的随机状态(伪随机数)学习

我想在scikit中实现一个机器学习算法,但是我不明白这个参数random_state是做什么的?我为什么要用它?

我也无法理解什么是伪随机数.

python scikit-learn

122
推荐指数
4
解决办法
12万
查看次数

在 Docker 容器内运行应用程序单元测试

我最近开始使用 docker 并且我容器化了一个 python 应用程序。我使用了以下 Dockerfile。

FROM python:3.6.5

# working directory
WORKDIR /usr/src/app

# copy requirement file to working directory
COPY requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

ENTRYPOINT ["python", "./run.py"]
Run Code Online (Sandbox Code Playgroud)

我有一些使用 pytest 调用的单元测试。我在想如何将它包含在 docker 容器中,以便单元测试可以在 docker 容器内运行。我应该为它建立一个不同的形象。您对此有何建议。

python-3.x docker

6
推荐指数
3
解决办法
8037
查看次数

在android上打开主要的SMS会话意图

如何从我自己的活动中启动android mms/sms主要会话意图?我发现到目前为止最好的答案是:

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName("com.android.mms", "com.android.mms.ui.ConversationList");
context.startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

我认为它在其中一个设备上运行此代码时甚至有效,但现在我收到以下错误:

Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.mms/.ui.ConversationList } from ProcessRecord{460a37f8 6949:msc.test/10081} (pid=6949, uid=10081) requires null
Run Code Online (Sandbox Code Playgroud)

注意: 我不打开sms/mms编辑器屏幕来发送短信,但是主sms屏幕存储所有到达的sms/mms消息.

sms android mms android-intent

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

标签 统计

android ×1

android-intent ×1

docker ×1

mms ×1

python ×1

python-3.x ×1

scikit-learn ×1

sms ×1