/*! For license information please see dll.225.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[225],{3428:function(e,t,a){"use strict";a.r(t);var n=a(14),r=a.n(n),i=a(12),c=a.n(i),o=a(10),s=a.n(o),l=a(15),u=a.n(l),d=a(16),f=a.n(d),p=a(8),g=a.n(p),m=a(7),h=a.n(m),v=a(0),y=a.n(v),E=a(1),R=a.n(E),S=a(1100),q=a.n(S),C=a(75),b=a(86),x=a(965),_=a(66),O=a(39),w=a.n(O),A=a(201),P=a.n(A),k=a(138),M=a.n(k),V=a(203),G=a(207),I=a(200),L=a(1217),j=a(1832),D=a(991);function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,n=g()(e);if(t){var r=g()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return f()(this,a)}}var J=function(e){u()(a,e);var t=T(a);function a(e){var n,i,c,o;return r()(this,a),n=t.call(this,e),h()(s()(n),"compute",(function(){var e=n.state,t=e.y,a=e.success,r=e.x,i=e.intercept,c=e.omitMissing,o=y.a.createElement(j.default,{data:n.props.data,x:r,y:t,success:a,intercept:i,omitMissing:c,quantitative:n.props.quantitative,onPredict:function(e,t,a,r){var i=M()(n.props.data,1),c=n.props.quantitative.slice(),o=n.props.categorical.slice(),s="probs_logis"+r;i[s]=t,P()(c,s)||c.push(s),i[s="pred_logis"+r]=e,P()(o,s)||o.push(s),s="resid_logis"+r,P()(c,s)||c.push(s),i[s]=a,n.props.onGenerate(c,o,i)}});n.props.logAction(I.DATA_EXPLORER_LOGISTIC_REGRESSION,{y:t,x:r,intercept:i}),n.props.onCreated(o)})),w()(e.categorical)&&e.categorical.length>0?(c=e.categorical[0],o=(i=Object(L.default)(e.data[c],c))[i.length-1]):(i=[],o=null),n.state={categories:i,y:c,success:o,x:e.quantitative[0],intercept:!0,omitMissing:!1},n}return c()(a,[{key:"render",value:function(){var e=this,t=this.props,a=t.categorical,n=t.quantitative,r=t.data,i=this.state,c=i.x,o=i.y,s=i.categories,l=i.success,u=i.intercept;return y.a.createElement(b.default,{style:{fontSize:"14px",maxWidth:500}},y.a.createElement(b.default.Header,{as:"h4"},"Logistic Regression",y.a.createElement(D.default,{title:"Logistic Regression",content:"Predict a categorical response variable using one or more explanatory variables."})),y.a.createElement(b.default.Body,null,y.a.createElement(x.default,null,y.a.createElement(_.default,{md:6},y.a.createElement(V.default,{legend:"Outcome (Y):",options:a,defaultValue:o,onChange:function(t){var a=Object(L.default)(r[t],t);e.setState({categories:a,success:a[a.length-1],y:t})}})),y.a.createElement(_.default,{md:6},y.a.createElement(V.default,{legend:"Success (Y = 1):",defaultValue:l,options:s,onChange:function(t){e.setState({success:t})}}))),y.a.createElement(V.default,{legend:"Predictors (X):",multi:!0,options:q()(n.concat(a)),defaultValue:c||"",onChange:function(t){return e.setState({x:t})},closeMenuOnSelect:!1,selectAllOption:!0}),y.a.createElement(G.default,{legend:"Include intercept?",defaultValue:u,onChange:function(t){return e.setState({intercept:t})}}),y.a.createElement(G.default,{legend:"Omit missing values",defaultValue:!1,onChange:function(t){return e.setState({omitMissing:t})}}),y.a.createElement(C.default,{disabled:!c||0===c.length,variant:"primary",block:!0,onClick:this.compute},"Calculate")))}}]),a}(v.Component);J.defaultProps={logAction:function(){}},J.propTypes={categorical:R.a.array.isRequired,quantitative:R.a.array.isRequired,data:R.a.object.isRequired,logAction:R.a.func,onGenerate:R.a.func.isRequired,onCreated:R.a.func.isRequired},t.default=J}}]);