in their Nature Medicine article "The Artificial Intelligence Clinician learns optimal treatment strategies for sepsis in intensive care." This repository contains the MATLAB code used to recreate their AI clinician, and produce the individual patient dosing figures in that post. In the post we attempt to recreate the AI Clinician detailed by Komorowski, et al. This is the companion GitHub repository for the point85 blog post found here. tBackground( Iteration for Treating Sepsis Patients % Note: MJComboBox is better than JComboBox: the popup panel has more width than the base control if needed HContainer.UserData = įunction hContainer = createComboSelector(hParent, strings, callback, isEditable) Set(jComboField, 'KeyPressedCallback', 'FocusLostCallback', % hide the popup when another component is selected JComboField = handle(jCombo.getComponent(2), 'CallbackProperties') Set(hjSearchField, 'KeyPressedCallback', = handle(hContainer1.UserData, 'CallbackProperties') Set(hjSearchButton, 'MouseClickedCallback', = handle(jAssetComponent.getComponent(0), 'CallbackProperties') HjSearchButton = handle(jAssetComponent.getComponent(1), 'CallbackProperties') JAssetComponent.getComponent(0).setPreferredSize(jSize) JAssetComponent.getComponent(0).setMaximumSize(jSize) % Expand the SearchTextField component to max available width Setappdata(hContainer,'jAssetChooser',jAssetChooser) Set(hContainer2, 'tag','hAssetContainer', 'UserData',jAssetChooser, 'Units','norm', 'Position',) = javacomponent(jAssetComponent,hContainer) JAssetComponent = jAssetChooser.getComponent % Create a SearchTextField control on top of the combo-box Set(hContainer1, 'Units','pixels', 'Position',) For example, we can use Matlab’s internal widget: These two functionalities are often correlated, and today’s article will discuss both.īefore I dive into details of the implementation I ended up with, note that there are simpler alternatives. Auto-completion is usually reserved for the case of the user-entered text being automatically completed as they type, whereas auto-winnowing only updates the drop-down options on-the-fly. The correct term should actually be “auto-winnowing” or “auto-filtering”. Note that in this particular case, I use the term “auto-completion” loosely. Interactive Matlab auto-completion widget The idea was for Matlab to automatically auto-complete the financial instruments matching the entered text, as it is being typed, similarly to other standard auto-completion widgets (e.g., Google’s search box), including the use of wildcards and regular expressions: The idea was simple enough: the user selects a class of financial assets from a drop-down, then one or more actual financial securities from a dynamically-populated drop-down (based on the asset class), then the date range and analysis function, and finally the results are plotted in the main panel. Such a case happened to me, when a consulting client asked me to integrate an auto-completion widget in a GUI that I designed for them. Do you ever get a feeling when designing a Matlab GUI, that existing components/controls are simply not enough to achieve the desired functionality/appearance?