当前位置:   article > 正文

微服务 restful_Jupyter Notebook作为RESTful微服务

notebook restfulapi

微服务 restful

“Data science enables the creation of data products.” – Mike Loukides in What is data science?

“数据科学可以创建数据产品。” – Mike Loukides,《 什么是数据科学》?

Data products take on many forms. Web articles, dashboard applications, and cloud services are all common vehicles for delivering value from data. Tools that help produce artifacts such as these are a necessary part of any data mining methodology.

数据产品采用多种形式。 Web文章仪表板应用程序云服务都是从数据传递价值的常见工具。 帮助产生此类工件的工具是任何数据挖掘方法的必要组成部分。

In the Project Jupyter ecosystem, many tools exist to aid the creation of data products from notebooks:

Jupyter项目生态系统中,存在许多工具可以帮助从笔记本计算机创建数据产品:

Today, I’d like to introduce a new tool and capability. The Jupyter kernel gateway can turn notebooks into RESTful web APIs, giving notebook authors a way of making their work immediately useful to software developers, particularly in microservice architectures. Consider the following use cases:

今天,我想介绍一种新的工具和功能。 Jupyter内核网关可以将笔记本变成RESTful Web API,为笔记本作者提供了一种使他们的工作立即对软件开发人员有用的方法,特别是在微服务体系结构中 。 考虑以下用例:

  • A data scientist prototypes a model for suggesting last-minute purchases to users at checkout. She writes a notebook with code for invoking the model and saving scoring results. She publishes her notebook as a simple API for her web dev team to fit into their check-out system and invoke on a trial basis. Later, she pulls click-through metrics from her service in order to improve her model.
  • 数据科学家为在结帐时向用户建议最后购买的模型建立了原型。 她编写了一个笔记本,其中包含用于调用模型和保存评分结果的代码。 她将笔记本作为简单的API发布,供Web开发团队使用,以适合他们的结帐系统并在试用的基础上进行调用。 后来,她从服务中提取了点击率指标,以改善其模型。
  • A software developer writes a bit of “glue code” in a notebook to accept a search string, query a data source, pass results to a concept tagging API, and respond with the tagged data. The developer deploys this service to the cloud for use in various departmental applications. He makes improvements to the original notebook over time and redeploys it as a web service.
  • 软件开发人员在笔记本中写一些“胶水代码”以接受搜索字符串,查询数据源,将结果传递给概念标记API并使用标记的数据进行响应。 开发人员将此服务部署到云中,以供各种部门应用程序使用。 随着时间的推移,他对原始笔记本进行了改进,并将其重新部署为Web服务。

To explain the mechanics of turning notebooks into APIs, let’s walk through a simple example: the scotch recommendation engine from our prior dashboards post. This time, we’ll outline how to create and deploy a web API from the notebook instead of a visual dashboard:

为了说明将笔记本转换为API的机制,让我们来看一个简单的示例:先前仪表板帖子中的苏格兰威士忌推荐引擎。 这次,我们将概述如何从笔记本而不是可视仪表板创建和部署Web API:

  • GET /scotches – returns a list of all known scotches as JSON
  • GET /scotches/:scotch – returns the features of a particular scotch as JSON
  • GET /scotches/:scotch/similar?count=N – returns the names and scores of N similar scotches as JSON
  • GET /scotches –以JSON返回所有已知苏格兰威士忌的列表
  • GET /scotches/:scotch –将特定苏格兰威士忌的特征作为JSON返回
  • GET /scotches/:scotch/similar?count=N –以JSON形式返回N个相似GET /scotches/:scotch/similar?count&
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/893180
推荐阅读
  

闽ICP备14008679号