blob: 6f77a897fb5804a6165ea83335a285c8aa11b678 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{113:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return c})),r.d(t,"metadata",(function(){return o})),r.d(t,"toc",(function(){return l})),r.d(t,"default",(function(){return u}));var n=r(3),a=r(7),i=(r(0),r(144)),c={title:"Tracking"},o={unversionedId:"userDocs/submarine-sdk/tracking",id:"userDocs/submarine-sdk/tracking",isDocsHomePage:!1,title:"Tracking",description:"\x3c!--",source:"@site/docs/userDocs/submarine-sdk/tracking.md",slug:"/userDocs/submarine-sdk/tracking",permalink:"/docs/userDocs/submarine-sdk/tracking",editUrl:"https://github.com/apache/submarine/edit/master/website/docs/userDocs/submarine-sdk/tracking.md",version:"current",sidebar:"docs",previous:{title:"Model Client",permalink:"/docs/userDocs/submarine-sdk/model-client"},next:{title:"Submarine Spark Security Plugin",permalink:"/docs/userDocs/submarine-security/spark-security/README"}},l=[{value:"Functions",id:"functions",children:[{value:"<code>submarine.get_tracking_uri() -&gt; str</code>",id:"submarineget_tracking_uri---str",children:[]},{value:"<code>submarine.set_tracking_uri(uri: str) -&gt; None</code>",id:"submarineset_tracking_uriuri-str---none",children:[]},{value:"<code>submarine.log_param(key: str, value: str) -&gt; None</code>",id:"submarinelog_paramkey-str-value-str---none",children:[]},{value:"<code>submarine.log_metric(key: str, value: float, step=0) -&gt; None</code>",id:"submarinelog_metrickey-str-value-float-step0---none",children:[]}]}],s={toc:l};function u(e){var t=e.components,r=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(n.a)({},s,r,{components:t,mdxType:"MDXLayout"}),Object(i.b)("p",null,"It helps developers use submarine's internal data caching,\ndata exchange, and task tracking capabilities to more efficiently improve the\ndevelopment and execution of machine learning productivity"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"Allow data scientist to track distributed ML experiment"),Object(i.b)("li",{parentName:"ul"},"Support store ML parameters and metrics in Submarine-server"),Object(i.b)("li",{parentName:"ul"},"Support hdfs, S3 and mysql (Currently we only support mysql)")),Object(i.b)("h2",{id:"functions"},"Functions"),Object(i.b)("h3",{id:"submarineget_tracking_uri---str"},Object(i.b)("inlineCode",{parentName:"h3"},"submarine.get_tracking_uri() -> str")),Object(i.b)("p",null,"Get the tracking URI. If none has been specified, check the environmental variables. If uri is still none, return the default submarine jdbc url."),Object(i.b)("blockquote",null,Object(i.b)("p",{parentName:"blockquote"},Object(i.b)("strong",{parentName:"p"},"Returns"))),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"The tracking URI.")),Object(i.b)("h3",{id:"submarineset_tracking_uriuri-str---none"},Object(i.b)("inlineCode",{parentName:"h3"},"submarine.set_tracking_uri(uri: str) -> None")),Object(i.b)("p",null,"set the tracking URI. You can also set the SUBMARINE_TRACKING_URI environment variable to have Submarine find a URI from there. The URI should be database connection string."),Object(i.b)("blockquote",null,Object(i.b)("p",{parentName:"blockquote"},Object(i.b)("strong",{parentName:"p"},"Parameters"))),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"uri")," ","-"," Submarine record data to Mysql server. The database URL is expected in the format ",Object(i.b)("inlineCode",{parentName:"li"},"<dialect>+<driver>://<username>:<password>@<host>:<port>/<database>"),".\nBy default it's ",Object(i.b)("inlineCode",{parentName:"li"},"mysql+pymysql://submarine:password@localhost:3306/submarine"),".\nMore detail : ",Object(i.b)("a",{parentName:"li",href:"https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls"},"SQLAlchemy docs"))),Object(i.b)("h3",{id:"submarinelog_paramkey-str-value-str---none"},Object(i.b)("inlineCode",{parentName:"h3"},"submarine.log_param(key: str, value: str) -> None")),Object(i.b)("p",null,"log a single key-value parameter. The key and value are both strings."),Object(i.b)("blockquote",null,Object(i.b)("p",{parentName:"blockquote"},Object(i.b)("strong",{parentName:"p"},"Parameters"))),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"key")," - Parameter name."),Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"value")," - Parameter value.")),Object(i.b)("h3",{id:"submarinelog_metrickey-str-value-float-step0---none"},Object(i.b)("inlineCode",{parentName:"h3"},"submarine.log_metric(key: str, value: float, step=0) -> None")),Object(i.b)("p",null,"log a single key-value metric. The value must always be a number."),Object(i.b)("blockquote",null,Object(i.b)("p",{parentName:"blockquote"},Object(i.b)("strong",{parentName:"p"},"Parameters"))),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"key")," - Metric name."),Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"value")," - Metric value."),Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"step")," - A single integer step at which to log the specified Metrics, by default it's 0.")))}u.isMDXComponent=!0},144:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return d}));var n=r(0),a=r.n(n);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=a.a.createContext({}),u=function(e){var t=a.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},b=function(e){var t=u(e.components);return a.a.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},m=a.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,c=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),b=u(r),m=n,d=b["".concat(c,".").concat(m)]||b[m]||p[m]||i;return r?a.a.createElement(d,o(o({ref:t},s),{},{components:r})):a.a.createElement(d,o({ref:t},s))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,c=new Array(i);c[0]=m;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o.mdxType="string"==typeof e?e:n,c[1]=o;for(var s=2;s<i;s++)c[s]=r[s];return a.a.createElement.apply(null,c)}return a.a.createElement.apply(null,r)}m.displayName="MDXCreateElement"}}]);