sklearn.fit_两个小时后仍在运行吗? 如何控制您的sklearn.fit。

sklearn.fit

by Nathan Toubiana

内森·图比亚纳(Nathan Toubiana)

两个小时后仍在运行吗? 如何控制您的sklearn.fit (Two hours later and still running? How to keep your sklearn.fit under control)

Written by Gabriel Lerner and Nathan Toubiana

加布里埃尔·勒纳 ( Gabriel Lerner)内森·图比亚 ( Nathan Toubiana)撰写

All you wanted to do was test your code, yet two hours later your Scikit-learn fit shows no sign of ever finishing. Scitime is a package that predicts the runtime of machine learning algorithms so that you will not be caught off guard by an endless fit.

您要做的只是测试您的代码,但是两个小时后,您的Scikit学习适应度却没有任何提高的迹象。 Scitime是一个可预测机器学习算法运行时间的软件包,因此您不会因无休止的选择而措手不及。

Whether you are in the process of building a machine learning model or deploying your code to production, knowledge of how long your algorithm will take to fit is key to streamlining your workflow. With Scitime you will be able in a matter of seconds to estimate how long the fit should take for the most commonly used Scikit Learn algorithms.

无论您是在构建机器学习模型还是在将代码部署到生产中,了解算法所需的适应时间是简化工作流程的关键。 使用Scitime,您将能够在几秒钟内估算出最常用的Scikit Learn算法的拟合时间。

There have been a couple of research articles (such as this one) published on that subject. However, as far as we know, there’s no practical implementation of it. The goal here is not to predict the exact runtime of the algorithm but more to give a rough approximation.

关于该主题已经发表了几篇研究文章(例如文章)。 但是,据我们所知,还没有实际的实现。 这里的目标不是预测算法的确切运行时间,而是给出一个大概的近似值。

什么是Scitime? (What is Scitime?)

Scitime is a python package requiring at least python 3.6 with pandas, scikit-learn, psutil and joblib dependencies. You will find the Scitime repo here.

Scitime是一个Python软件包,至少需要python 3.6,并带有pandasscikit-learnpsutiljoblib依赖项。 您可以在此处找到Scitime回购。

The main function in this package is called “time”. Given a matrix vector X, the estimated vector Y along with the Scikit Learn model of your choice, time will output both the estimated time and its confidence interval. The package currently supports the following Scikit Learn algorithms with plans to add more in the near future:

该软件包的主要功能称为“ 时间 ”。 给定矩阵向量X,估计向量Y以及您选择的Scikit Learn模型, 时间将同时输出估计时间及其置信区间。 该软件包当前支持以下Scikit Learn算法,并计划在不久的将来添加更多算法:

快速开始 (Quick Start)

Let’s install the package and run the basics.

让我们安装软件包并运行基础知识。

First create a new virtualenv (this is optional, to avoid any version conflicts!)

首先创建一个新的virtualenv(这是可选的,以避免任何版本冲突!)

❱ virtualenv env❱ source env/bin/activate

and then run:

然后运行:

❱ (env) pip install scitime

or with conda:

或使用conda:

❱ (env) conda install -c conda-forge scitime

Once the installation has succeeded, you are ready to estimate the time of your first algorithm.

一旦安装成功,您就可以估计第一个算法的时间。

Let’s say you wanted to train a kmeans clustering, for example. You would first need to import the scikit-learn package, set the kmeans parameters, and also choose the inputs (a.k.a X), here generated randomly for simplicity.

举例来说,假设您想训练kmeans聚类。 您首先需要导入scikit-learn程序包,设置kmeans参数,还需要选择输入(aka X) ,为简单起见&

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值