<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Piotr Krosniak on Medium]]></title>
        <description><![CDATA[Stories by Piotr Krosniak on Medium]]></description>
        <link>https://medium.com/@piotrkrosniak?source=rss-b791abcfafd5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*69ABTKLKvG86FQvGpd8Yew.jpeg</url>
            <title>Stories by Piotr Krosniak on Medium</title>
            <link>https://medium.com/@piotrkrosniak?source=rss-b791abcfafd5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 01:07:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@piotrkrosniak/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Revolutionizing Job Interviews with Real-Time AI-Powered Transcription and Question Answering…]]></title>
            <link>https://piotrkrosniak.medium.com/revolutionizing-job-interviews-with-real-time-ai-powered-transcription-and-question-answering-fe21246aa4a1?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe21246aa4a1</guid>
            <category><![CDATA[interview-preparation]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 06:12:36 GMT</pubDate>
            <atom:updated>2024-09-13T06:13:42.137Z</atom:updated>
            <content:encoded><![CDATA[<h3>Revolutionizing Job Interviews with Real-Time AI-Powered Transcription and Question Answering Agents</h3><p>In an era where time is of the essence and job interviews are becoming increasingly competitive, the fusion of artificial intelligence (AI) and automation has the potential to dramatically reshape how candidates prepare and perform. Introducing an innovative application that marries advanced AI with real-time audio transcription to empower job seekers: a tool designed to transcribe audio input on the fly, detect critical questions, and deliver personalized, context-specific answers drawn from the user’s CV and the job position they are applying for.</p><p>By leveraging OpenAI’s GPT-4o-mini model for response generation and the Whisper API for transcription, this application offers cutting-edge functionalities that enhance both interview preparation and the real-time interview process itself.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FCv_0TmJ9lv0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCv_0TmJ9lv0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FCv_0TmJ9lv0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/51ec3b038fdb1757da73a1df678a1bdf/href">https://medium.com/media/51ec3b038fdb1757da73a1df678a1bdf/href</a></iframe><h3>The Technology Behind the Application</h3><p>At the heart of this tool are two powerful AI models:</p><ul><li><strong>Whisper API</strong>: Developed by OpenAI, Whisper is an AI-powered system designed for state-of-the-art speech recognition and transcription. Its robustness in various acoustic environments allows users to enjoy accurate and seamless transcription, whether in a quiet office or a bustling coffee shop.</li><li><strong>GPT-4o-mini Model</strong>: An adaptation of OpenAI’s famed GPT-4 model, this version is tailored for real-time processing, ensuring that responses are generated efficiently without compromising the quality of the answers. The model uses the user’s uploaded CV and job position to craft personalized and contextually relevant responses.</li></ul><h3>Main Functionalities: An Overview</h3><h4>1. Real-Time Audio Transcription</h4><p>Real-time transcription forms the backbone of the application. Users can choose their audio input device through a simple dropdown menu, giving them flexibility over their preferred input sources. With the aid of an adjustable energy threshold slider, the application intelligently filters out background noise, ensuring that only meaningful speech is transcribed. A built-in visual volume bar tracks the current input energy level, changing colors when the input meets the set threshold — a subtle yet vital feature for keeping track of audio clarity.</p><h4>2. Question Detection and Answer Generation</h4><p>A key innovation lies in the tool’s ability to <strong>detect questions</strong> within the transcribed text. Using a heuristic algorithm, the application continuously scans for question cues. Once a question is identified, the transcription is passed on to the GPT-4o-mini model, along with the user’s CV and job position, for response generation.</p><p>The generated answers, designed to match the expertise and experience from the user’s CV, are displayed in a dedicated “Answers” tab. Additionally, users can customize their experience by adjusting the text background color, making the interface both functional and visually appealing.</p><h4>3. User-Friendly Interface</h4><p>Simplicity meets sophistication in the user interface, which is divided into two main tabs:</p><ul><li><strong>Transcriptions Tab</strong>: Displays the real-time transcription feed from the Whisper API.</li><li><strong>Answers Tab</strong>: Displays the AI-generated answers to detected questions.</li></ul><p>An “Always on Top” feature ensures that the application remains visible, even when juggling multiple tasks, making it the perfect assistant during live interview sessions. Users can also toggle the background color of the transcribed text and answers, allowing for greater personalization.</p><h4>4. File-Based Configuration</h4><p>To provide users with the most up-to-date, contextually relevant responses, the application utilizes <strong>file-based configuration</strong>. The user’s CV and job position are stored in text files (uploaded_cv_text.txt and position_name.txt), which the application references when generating responses. This ensures the AI is drawing from the latest available information when assisting with questions.</p><h4>5. Asynchronous Processing</h4><p>One of the standout technical features of the application is its <strong>non-blocking transcription</strong> capability. By leveraging asynchronous processing, the application ensures that transcription chunks and the generation of answers occur in separate threads. This keeps the process smooth and uninterrupted, allowing users to focus on the conversation without technical delays.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*sjcLSpi30zIZGjSKiBJM9A.jpeg" /><figcaption>Interview agent DALLE image generated by author</figcaption></figure><h3>Why It Matters: The Science and Impact</h3><p>The integration of AI-powered tools in job interviews is part of a growing trend towards the <strong>automation of professional tasks</strong>. Research from the <em>MIT Sloan School of Management</em> highlights that AI-driven tools in professional settings can significantly improve productivity by taking on time-consuming tasks like transcription and summarization .</p><p>Moreover, AI’s ability to personalize content is becoming increasingly important. According to a study published in <em>The Journal of Artificial Intelligence Research</em>, contextually tailored AI responses, based on user-specific data like CVs and job positions, can improve the relevance and accuracy of generated content . This makes the application highly valuable in providing job seekers with precise, context-specific answers during interviews — a feature that could potentially lead to better outcomes in the hiring process.</p><h3>Empowering Job Seekers with AI</h3><p>As we move into the future, AI tools like this one are becoming essential assets for professionals. This application’s ability to <strong>transcribe</strong>, <strong>detect questions</strong>, and provide <strong>tailored responses</strong> can give candidates a much-needed edge in competitive job markets. By making the interview process more manageable and efficient, job seekers can focus on presenting themselves confidently while letting the application handle the technical details.</p><p>This combination of real-time transcription and advanced question answering may well redefine how we prepare for, and navigate, job interviews. With AI handling the background work, candidates can focus on what matters most — their skills, experiences, and aspirations.</p><h3>Conclusion</h3><p>In a world where job seekers are constantly striving to stand out, this AI-powered application offers an innovative solution by merging transcription and intelligent question answering. It enhances interview preparation, simplifies the interview process, and provides a personalized edge in real-time scenarios. As AI continues to advance, this tool is a glimpse into the future of professional development — one where technology works in harmony with human skills to create new opportunities.</p><p><strong><em>Full code and instruction is available on GitHub</em></strong> <a href="https://github.com/PiotrKrosniak/interview-agent">https://github.com/PiotrKrosniak/interview-agent</a></p><p><strong>References:</strong></p><ol><li>Sloan School of Management, MIT. “AI’s impact on job productivity: Insights from research.”</li><li>Journal of Artificial Intelligence Research. “Contextual response generation in AI systems: The role of personalized data.”</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe21246aa4a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Child-Safe AI Chatbot: A Comprehensive Guide]]></title>
            <link>https://piotrkrosniak.medium.com/building-a-child-safe-ai-chatbot-a-comprehensive-guide-30c4f3ff0f7a?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/30c4f3ff0f7a</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[chatbot-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[unicef]]></category>
            <category><![CDATA[child-friendly]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Tue, 20 Aug 2024 11:14:23 GMT</pubDate>
            <atom:updated>2024-08-20T11:14:23.750Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s digitally connected world, children are increasingly accessing online platforms at a younger age. According to research published in the <em>Journal of Pediatrics</em>, children as young as two years old are engaging with digital devices, and by the time they reach adolescence, digital communication becomes a central part of their social interaction and learning. However, this early and extensive exposure to digital platforms also raises significant concerns regarding their safety online.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hSKPn7VrA7RSyaiDPrA1IQ.png" /></figure><p>A child-safe chatbot is crucial in this context because it can serve as a protective intermediary between young users and the vast, often unfiltered, information available online. Research published in <em>Computers in Human Behavior</em> highlights the importance of creating digital environments that are not only informative but also developmentally appropriate for children. The study stresses that without proper safeguards, children are vulnerable to encountering inappropriate content, cyberbullying, and other online risks.</p><p>Moreover, the role of AI in moderating content and guiding interactions has been recognized as a key factor in protecting young users. A study in the <em>Journal of Information Technology</em> explored how AI-driven systems, like chatbots, can be designed to promote safe online behavior among children. The study concluded that AI can effectively filter harmful content and provide real-time guidance during interactions, helping to mitigate risks associated with unsupervised internet use.</p><p>The chatbot described in this article leverages AI to ensure that conversations remain age-appropriate, informative, and protective against potentially harmful content. By providing thoughtful, guided responses and suggesting follow-up questions, the chatbot not only engages children in a constructive dialogue but also steers the conversation towards topics that are safe and educational. This approach is supported by findings in the <em>International Journal of Child-Computer Interaction</em>, which emphasizes the importance of interactive technologies that promote positive engagement and learning outcomes in children.</p><p>In summary, a child-safe chatbot is an essential tool in the digital age, where children’s online safety is a growing concern. By combining AI with carefully curated content, such chatbots can create a safe, educational, and supportive environment for young users, helping them navigate the complexities of the digital world safely.</p><h3>Project Overview</h3><p>The chatbot is designed with the following goals:</p><ol><li><strong>Safe Interactions</strong>: The chatbot is tailored to ensure that interactions remain within the bounds of safe and constructive dialogue.</li><li><strong>Guided Conversations</strong>: It provides follow-up questions that steer the conversation towards educational and helpful topics.</li><li><strong>Cost-Efficiency</strong>: By carefully managing API usage, the chatbot minimizes the costs associated with token usage in AI models.</li></ol><h3>Setting Up the Environment</h3><p>To build this chatbot, you’ll need a Python environment with the following libraries:</p><ul><li>gradio: For creating the web interface.</li><li>openai: To access OpenAI&#39;s GPT models.</li><li>tiktoken: For encoding and counting tokens.</li><li>pandas: For data manipulation (optional, but useful).</li></ul><h3>The Code Walkthrough</h3><h4>Importing Necessary Libraries</h4><p>First, let’s start by importing the required libraries and setting up the OpenAI API key.</p><pre>import gradio as gr<br>import openai<br>import os<br>import tiktoken<br>import pandas as pd<br><br># Set your OpenAI API key<br>openai.api_key = os.getenv(&#39;OPENAI_API_KEY&#39;)</pre><p>Here, gradio is used to create the user interface, while openai is used to access the GPT-3.5 model. The tiktoken library is essential for counting tokens, which helps in managing the cost of API calls.</p><h4>Token Management</h4><p>Managing the number of tokens is crucial for both cost-efficiency and performance. The following function calculates the number of tokens used in a message:</p><pre>def num_tokens_from_messages(messages, model=&quot;gpt-3.5-turbo&quot;):<br>    encoding = tiktoken.encoding_for_model(model)<br>    num_tokens = 0<br>    for message in messages:<br>        num_tokens += 4  # Base tokens for each message<br>        for key, value in message.items():<br>            num_tokens += len(encoding.encode(value))<br>            if key == &quot;name&quot;:<br>                num_tokens += 1<br>    num_tokens += 2  # Tokens for the assistant&#39;s reply<br>    return num_tokens</pre><p>This function is vital for keeping track of token usage, ensuring that the chatbot remains within budget constraints.</p><h4>Chat Initialization</h4><p>The chatbot starts by initializing the conversation with an introductory question. This is done using the initialize_chat function:</p><pre>def initialize_chat(initial_question):<br>    chat_history = [(None, initial_question)]<br>    response, follow_up_questions, token_info = generate_response(initial_question, 0)<br>    chat_history.append((None, response))<br>    <br>    examples_state = [[q.strip()] for q in follow_up_questions.split(&#39;\n&#39;) if q.strip()]<br>    <br>    return chat_history, follow_up_questions, token_info, examples_state</pre><p>This function sets up the initial state of the chat, including the history, token information, and suggested follow-up questions.</p><h4>Generating Responses</h4><p>Generating responses that are both relevant and safe is the core of this chatbot. The generate_response function handles this:</p><pre>def generate_response(prompt, token_count=0):<br>    messages = [<br>        {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;You are a friendly and helpful chatbot.&quot;},<br>        {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: prompt}<br>    ]<br>    <br>    try:<br>        input_tokens = num_tokens_from_messages(messages, model=&quot;gpt-3.5-turbo&quot;)<br>        <br>        response = openai.ChatCompletion.create(<br>            model=&quot;gpt-3.5-turbo&quot;,<br>            messages=messages,<br>            max_tokens=150,<br>            temperature=0.7,<br>        )<br>        <br>        output_text = response.choices[0].message[&#39;content&#39;].strip()<br>        output_tokens = response.usage[&#39;completion_tokens&#39;]<br>        <br>        follow_up_prompt = f&quot;Based on the following response, suggest three follow-up questions that a young person should ask in first person: {output_text}&quot;<br>        follow_up_messages = [<br>            {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;You are a friendly and helpful chatbot.&quot;},<br>            {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: follow_up_prompt}<br>        ]<br>        follow_up_response = openai.ChatCompletion.create(<br>            model=&quot;gpt-3.5-turbo&quot;,<br>            messages=follow_up_messages,<br>            max_tokens=100,<br>            temperature=0.7,<br>        )<br><br>        follow_up_questions = follow_up_response.choices[0].message[&#39;content&#39;].strip().split(&#39;\n&#39;)<br>        follow_up_questions = &quot;\n&quot;.join(follow_up_questions)<br>        <br>        total_input_tokens = input_tokens + num_tokens_from_messages(follow_up_messages, model=&quot;gpt-3.5-turbo&quot;)<br>        total_output_tokens = output_tokens + follow_up_response.usage[&#39;completion_tokens&#39;]<br>        <br>        input_cost = total_input_tokens * INPUT_COST_PER_TOKEN<br>        output_cost = total_output_tokens * OUTPUT_COST_PER_TOKEN<br>        total_cost = input_cost + output_cost<br><br>        new_response = output_text + &quot;\n\nTopics: &quot; + &quot;Topic analysis not available&quot;<br>        token_info = f&quot;### Token Usage:\n\n* Input Tokens: {total_input_tokens}\n* Output Tokens: {total_output_tokens}\n* Total Cost: ${total_cost:.4f}&quot;<br>    except Exception as e:<br>        new_response = f&quot;Error generating response: {e}&quot;<br>        follow_up_questions = []<br>        token_info = &quot;### Token Usage:\n\n* Input Tokens: 0\n* Output Tokens: 0\n* Total Cost: $0.0000&quot;<br>    <br>    return new_response, follow_up_questions, token_info</pre><p>This function ensures that the responses are safe and relevant by incorporating a system message that sets the tone for the chatbot. The follow-up questions guide the user towards productive and safe topics.</p><h4>Creating the User Interface</h4><p>Finally, the user interface is built using Gradio, a user-friendly tool for creating web interfaces in Python:</p><pre>with gr.Blocks(css=css) as demo:<br>    examples_state = gr.State([])<br>    chat_history = gr.State([])<br>    token_info = gr.State(&quot;&quot;)<br>    follow_up_questions_md = gr.State(&quot;&quot;)<br>    <br>    with gr.Row():<br>        with gr.Column(scale=1):<br>            gr.Markdown(<br>                &quot;&quot;&quot;<br>                # Child-Safe Chatbot Project<br>                Welcome to a chatbot designed with children&#39;s safety in mind. Start by typing your question below.<br>                &quot;&quot;&quot;<br>            )<br>            token_info_display = gr.Markdown(value=&quot;&quot;)<br>            follow_up_questions_display = gr.Markdown(value=&quot;&quot;)<br>            initial_question_input = gr.Textbox(placeholder=&quot;Type your initial question here...&quot;)<br>            initialize_button = gr.Button(&quot;Initialize Chat&quot;)<br><br>            question_examples = gr.Examples(<br>                examples=questions,<br>                inputs=initial_question_input,<br>                label=&quot;Example Questions&quot;<br>            )<br>        <br>        with gr.Column(scale=1, elem_id=&quot;chat-container&quot;):<br>            chatbot = gr.Chatbot(value=[], elem_id=&quot;chatbot&quot;)<br>            <br>            with gr.Row():<br>                txt = gr.Textbox(scale=4, show_label=False, placeholder=&quot;Select question...&quot;)<br>                btn = gr.Button(&quot;Submit&quot;)<br><br>                btn.click(<br>                    fn=process_response,<br>                    inputs=[txt, chat_history, gr.State(0), examples_state],<br>                    outputs=[chatbot, token_info_display, follow_up_questions_display, examples_state]<br>                )<br>                examples_component = gr.Examples(<br>                    examples=examples_state.value,<br>                    inputs=[txt],<br>                    label=&quot;Suggested Questions&quot;<br>                )<br>            <br>            chatbot.like(print_like_dislike, None, None)<br><br>    initialize_button.click(<br>        fn=initialize_chat,<br>        inputs=[initial_question_input],<br>        outputs=[chat_history, follow_up_questions_display, token_info_display, examples_state]<br>    ).then(<br>        fn=lambda chat_history: chat_history,<br>        inputs=[chat_history],<br>        outputs=[chatbot]<br>    )<br><br>if __name__ == &quot;__main__&quot;:<br>    demo.launch(share=False)</pre><p>This interface is simple yet effective, providing a safe and engaging environment for young users to interact with the chatbot.</p><h3>Conclusion</h3><p>Building a child-safe chatbot is a critical step towards creating a safer internet for children. By leveraging advanced AI models like GPT-3.5 and tools like Gradio, developers can create chatbots that are not only engaging but also prioritize the safety and well-being of young users. The provided code offers a solid foundation for building such a chatbot, with customization options to suit various needs.</p><p>By implementing these practices, you contribute to a more secure and positive online experience for children.</p><p>Here is also implemented chatbot on Hugging Face Space <a href="https://huggingface.co/spaces/peterkros/child-safe-chatbot">https://huggingface.co/spaces/peterkros/child-safe-chatbot</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30c4f3ff0f7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BEAM. Step-by-Step Guide to Building with the BEAM. System]]></title>
            <link>https://piotrkrosniak.medium.com/beam-step-by-step-guide-to-building-with-the-beam-system-c4e3301a82fa?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4e3301a82fa</guid>
            <category><![CDATA[housing]]></category>
            <category><![CDATA[concrete]]></category>
            <category><![CDATA[construction]]></category>
            <category><![CDATA[precast-concrete]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 07:13:01 GMT</pubDate>
            <atom:updated>2024-08-17T07:13:01.511Z</atom:updated>
            <content:encoded><![CDATA[<p>Building your own home is a dream many people share, and with the BEAM. system, this dream can become a reality within 21 days. This step-by-step guide will walk you through the entire construction process using the BEAM. system, from planning and purchasing to the final inspection. We’ll break down each phase with simulations so you can see how it becomes reality.</p><h3>1. Planning and Purchase</h3><p><strong>Overview</strong>: The first step in the BEAM. construction process is thorough planning and purchasing. We offer three main house designs, and you can adjust internal walls layout and external appearance using our online platform. Platform also let you chose the style of windows and doors, bathroom with what tiles and shower head you want. Once your design is set, you’ll work with BEAM. team to place your order, which includes all necessary panels, materials, and tools. With this, we deliver you a technical documentation package that you can submit to your city hall for approval.</p><h3>2. Delivery, Training, and Preparation</h3><p><strong>Overview</strong>: On the first day of your project, all tools and materials required for the construction of your house are delivered to your site. Everything is organized in a specially designed building container, labeled with easy-to-follow instructions, much like an IKEA kit. This day is also dedicated to training, where BEAM. professionals will teach you how to use the tools and equipment, and help organize the construction site (level the site).</p><h3>3. Foundation Points</h3><p><strong>Overview</strong>: The first physical step in construction is setting up the foundation points. These are crucial as they determine the stability and alignment of the entire structure. You will place the foundation points according to the layout provided, ensuring they are level and properly spaced. Remember you will receive training in how to make this, and it&#39;s quite easy with the drilling equipment provided</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*o6Z6m0HQGdw9H5LFdNGFsg.gif" /></figure><p>These holes are filled with concrete and equipped with attached anchors that will form the base for the foundation panels. This system ensures that you can do it yourself, <a href="https://medium.com/@piotrkrosniak/beam-core-principles-of-a-modern-precast-home-in-beam-system-2409836c2fa4">as outlined in the principles of the BEAM</a>. system in previous articles. Our engineering team has completed all the necessary calculations to determine the correct number of points required and the appropriate depth of the foundation for your specific location.</p><h3><strong>4. Foundation Panels</strong></h3><p><strong>Overview</strong>: Once the foundation points are set, the next step is to install the foundation panels. These panels are pre-fabricated and fit together easily. They form the base upon which the rest of your home will be built.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*xyHImmexObavTnkuUvTWdw.gif" /></figure><p>Fill the internal space with gravel and protection layer to make sure your house is safe from water and any type of rodents.</p><p><strong>Tips</strong>: Use the specialized cart provided to position the panels accurately. Make sure each panel is securely fastened to the foundation points before moving on.</p><h3>5. Floor Panels</h3><p><strong>Overview</strong>: After the foundation is complete, the floor panels are installed. These panels are with preinstalled floor heating system that is easy to connected together using plug and play connection. Panels are secured to foundation panels and form a solid structure of your house.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o3maDvyX88hztRw1_Ra0rA.png" /></figure><h3>6. Wall Panels</h3><p><strong>Overview</strong>: The wall panels form the exterior walls of your home. These panels are designed to fit together seamlessly, providing both structural support and insulation. Wall panels come with pre-installed doors and windows, so you don’t need to worry about installing them yourself. You can choose the style of the windows and doors during the initial planning stage. The walls also have embedded electrical and plumbing systems in the kitchen and bathroom areas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*pt456l-qBYjpiDdKa8JR4g.gif" /></figure><h3>7. Internal Wall Panels</h3><p><strong>Overview</strong>: Once the exterior walls are up, it’s time to install the internal wall panels based on the design you chose in the first stage. These panels create the rooms and internal layout of your home.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YDdM3Wbx0wSRfdqigqq8Cg.png" /></figure><h3>8. Floor Panels for the Second Floor</h3><p><strong>Overview</strong>: If your home has multiple stories, you’ll need to install the floor panels for the second floor. These panels are similar to the first-floor panels and should be installed in the same way. You can use our cart, which can be easily disassembled and reassembled, to move it to the upper floor.</p><h3>9. Second-Floor Wall Panels</h3><p><strong>Overview</strong>: After the second-floor panels are in place, you can install the second-floor wall panels. These panels follow the same installation process as the first-floor walls.</p><h3>10. Roof Panels</h3><p><strong>Overview</strong>: The roof panels are the final structural element of your home. These panels are designed to provide insulation and weatherproofing, protecting your home from the elements.</p><h3>11. Electrical and Plumbing Installation</h3><p><strong>Overview</strong>: With the structure complete, it’s time to install the electrical and plumbing systems. The BEAM. system is designed to make these installations straightforward, with pre-planned routes and connections. We have simplified the electrical system by providing pre-cut wires with plug-and-play connections for the outlets and control board. All cables are color-coded, and your task is simply to insert the cables into the planned routes and plug them together. Don’t worry — this will be thoroughly checked during the final inspection by a professional electrician. The same applies to the floor heating system and ceiling lighting posts; everything has been prepared at our factory to make it easy for you to plug the cables together.</p><h3>12. External Finishing and Painting</h3><p><strong>Overview</strong>: After the electrical and plumbing work is completed, you can finish the exterior of your home. This includes applying any external cladding, painting, and adding finishing touches such as gutters and downspouts. You can choose from a variety of the external panels that just need to be glued, all grout and insulation is already applied. You can also pain the house.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9k4IAEAoDV5e9bx7A4YNQ.png" /></figure><p><strong>Tips</strong>: Choose durable, weather-resistant materials for the exterior finishes to extend the life of your home.</p><h3>13. Inspection and Materials Pickup</h3><p><strong>Overview</strong>: The final step in the BEAM. construction process is an inspection by the BEAM. team. They will check that your home meets all building codes and that the construction is completed to a high standard. After the inspection, the team will pick up any remaining tools and materials.</p><p><strong>Tips</strong>: Ensure that all work is completed before the inspection to avoid any delays in certification. Address any issues identified during the inspection promptly.</p><h3>Conclusion</h3><p>Building a home with the BEAM. system is a straightforward, efficient process designed to empower individuals with the ability to construct their own homes. By following these steps, you can ensure that your home is built to the highest standards, offering comfort, durability, and sustainability. With proper planning, attention to detail, and the support of the BEAM. team, you can turn your dream home into a reality within just 21 days.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4e3301a82fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BEAM. Core principles of a Modern Precast Home in BEAM. system]]></title>
            <link>https://piotrkrosniak.medium.com/beam-core-principles-of-a-modern-precast-home-in-beam-system-2409836c2fa4?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2409836c2fa4</guid>
            <category><![CDATA[constrcution]]></category>
            <category><![CDATA[precast-concrete]]></category>
            <category><![CDATA[housing]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 06:59:15 GMT</pubDate>
            <atom:updated>2024-08-16T06:59:15.899Z</atom:updated>
            <content:encoded><![CDATA[<p>As outlined in the<a href="https://medium.com/@piotrkrosniak/beam-precast-sandwich-technology-the-future-of-construction-that-prioritizes-people-3c07a32175c3"> first article of the BEAM.</a> series, our focus is on modern precast technology that empowers individuals with the opportunity to build their own homes within 21 days, at a fraction of the traditional cost. This groundbreaking approach democratizes home construction, making it accessible to a broader audience. In this article, we will delve into the main principles and their implications within the precast building system that we are developing at BEAM. Our aim is to provide a comprehensive overview of the innovative elements that make this construction method not only efficient but also highly sustainable and cost-effective.</p><h3>Main Principles of a BEAM. system</h3><p>When constructing a house using precast sandwich technology, several key components come together to form the structure. These include foundation systems with panels, floor panels, wall panels, internal wall panels, and roof panels. Each of these components plays a crucial role in the overall integrity and performance of the building.</p><h3><strong>All in your hands</strong></h3><p>This means that every element of the building process is designed to be executed by a single person, from setting up the foundation points and panels to connecting the electrical and plumbing systems — everything is in your hands. This is made possible through several innovations that we have implemented in our system.</p><p>First and foremost is the precast technology itself, which provides ready-to-install panels that can be easily connected, much like Lego bricks. These panels are delivered to the construction site along with all the necessary materials and tools for the building process, ensuring that everything you need is at your fingertips.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kl2G2osx6e4i93c38lcEtA.png" /></figure><p>The second innovation is the placement system, which utilizes simple screw joints and minimal concrete joints, connecting rebar mesh inside panels. This system is designed for ease of use, allowing the panels to be securely attached without the need for specialized skills or equipment. Additionally, we’ve developed a specialized cart to assist with the placement of the panels. This cart is user-friendly and does not require any special license, making it accessible to anyone, regardless of prior construction experience.</p><figure><img alt="BEAM. System panel placement and securing with screw joints and concrete rebar mesh" src="https://cdn-images-1.medium.com/max/600/1*pt456l-qBYjpiDdKa8JR4g.gif" /></figure><p>These innovations not only streamline the construction process but also make it possible for individuals to take control of building their own homes, achieving a high-quality result with minimal effort and cost.</p><p>All the tools and materials required for the construction of your house are delivered to the construction site in an organized and systematic manner. As mentioned, these items are packed in a specially designed building container and labeled with easy-to-follow instructions, much like an IKEA assembly kit. This comprehensive delivery arrives at your site on the first day of construction. On this day, our professional team is also present to provide necessary training on the use of our technology and to help you organize the build site efficiently.</p><p>From this day forward, you have 21 days to complete your house. During this period, you are equipped with everything you need to proceed at your own pace. On the final day, our team will return to the construction site to collect tool&#39;s container. They will also conduct a thorough inspection of your house to ensure that everything meets building code requirements. Upon successful completion, your house will be certified, guaranteeing that it has been constructed to the highest standards.</p><p><strong>Conclusion: The Future of Precast Construction</strong></p><p>In conclusion, the BEAM. system represents a transformative approach to home construction, leveraging modern precast technology to make building a home more accessible, efficient, and affordable than ever before. By empowering individuals with the ability to construct their own homes within just 21 days, BEAM. is not only democratizing the construction process but also setting a new standard for sustainability and cost-effectiveness in the industry.</p><p>The innovative elements of the BEAM. system — from the easy-to-assemble precast panels to the user-friendly placement system — ensure that anyone, regardless of their prior experience, can take on the challenge of building their own home. With all tools and materials delivered directly to the site and comprehensive support provided by our professional team, BEAM. takes the complexity out of construction and puts the power in your hands.</p><p>Stay tuned for more detail on our system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2409836c2fa4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BEAM. Precast Sandwich Technology: The Future of Construction that Prioritizes People.]]></title>
            <link>https://piotrkrosniak.medium.com/beam-precast-sandwich-technology-the-future-of-construction-that-prioritizes-people-3c07a32175c3?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c07a32175c3</guid>
            <category><![CDATA[precast-concrete]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[housing]]></category>
            <category><![CDATA[construction]]></category>
            <category><![CDATA[concrete]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Thu, 15 Aug 2024 06:41:18 GMT</pubDate>
            <atom:updated>2024-08-15T06:41:18.951Z</atom:updated>
            <content:encoded><![CDATA[<p>The construction industry has always been a cornerstone of human development, shaping the infrastructure that sustains our societies. From ancient structures like the pyramids to modern skyscrapers, innovation in construction has continuously evolved. Yet, with the world facing new challenges, including climate change, urbanization, and the need for sustainable development, the industry is at a crossroads. One emerging technology that holds the potential to revolutionize the construction landscape is precast sandwich technology. This innovation is not only a leap forward in building methods, but also a paradigm shift in how we approach the priorities of construction — focusing on giving the right tools in the hands of regular people, not just innovating for the construction business.</p><h3>What is Precast Sandwich Technology?</h3><p><a href="https://www.sciencedirect.com/topics/engineering/precast-concrete">Precast concrete</a> sandwich panels are a specific type of precast cladding, characterised by high thermal resistance provided by a layer of insulation which is sandwiched between two concrete wythes and fixed together with mechanical connectors. Precast sandwich panels are an advanced form of construction technology that involves the prefabrication of wall panels in a controlled factory environment. The result is a highly efficient, durable, and energy-saving wall system that can be quickly assembled on-site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*GPoLLgEi7qUc_b-_RmyYNQ.png" /></figure><h3>The Benefits of Precast Sandwich Technology</h3><ol><li><strong>Sustainability and Energy Efficiency</strong>:<br>Precast sandwich panels are known for their excellent thermal insulation properties. The insulation core significantly reduces the energy required for heating and cooling, leading to lower utility bills and a smaller carbon footprint. In a world increasingly focused on sustainable development, this technology offers a solution that aligns with global efforts to combat climate change. According to a study published in the <em>Journal of Cleaner Production</em>, buildings constructed with precast sandwich panels have up to 30% lower energy consumption compared to traditional construction methods (Gorgolewski, 2017).</li><li><strong>Speed and Cost Efficiency</strong>:<br>The off-site prefabrication of panels allows for faster construction times, reducing labor costs and minimizing the disruption typically associated with on-site construction activities. A case study from the <em>International Journal of Construction Management</em> highlights that projects using precast sandwich technology can be completed in nearly half the time required for conventional building methods, without compromising on quality (Nguyen et al., 2020).</li><li><strong>Enhanced Safety and Quality Control</strong>:<br>By shifting much of the construction process to a controlled factory environment, precast sandwich technology reduces the risks associated with on-site construction, such as accidents, weather delays, and quality inconsistencies. This results in safer working conditions for construction workers and a more reliable product for end-users.</li><li><strong>Design Flexibility and Aesthetics</strong>:<br>Contrary to the belief that precast systems limit architectural creativity, precast sandwich panels offer a high degree of flexibility in design. The panels can be customized in terms of shape, size, texture, and finish, allowing architects to create aesthetically pleasing structures that meet specific project requirements.</li></ol><h3>A Shift in Focus: From Construction Workers to the General Population</h3><p>While these advantages are impressive, the true potential of precast sandwich technology lies in its ability to refocus the priorities of construction innovation. Historically, construction innovation has been centered around improving the efficiency, safety, and working conditions of construction workers. While these are undeniably important goals, there is a growing recognition that the ultimate aim of construction should be to serve the broader population — those who will live, work, and play in these buildings.</p><ol><li><strong>Improving Public Health and Comfort</strong>:<br>Buildings constructed with precast sandwich panels offer superior indoor air quality and comfort, thanks to their excellent insulation and moisture control properties. Research published in the <em>Building and Environment</em> journal suggests that occupants of such buildings experience fewer health issues related to indoor air quality, such as respiratory problems and allergies (Wargocki et al., 2021). This shift towards prioritizing the well-being of building occupants represents a significant advancement in construction philosophy.</li><li><strong>Affordable Housing and Social Equity</strong>:<br>The speed and cost-efficiency of precast sandwich technology make it an ideal solution for addressing the global housing crisis. By reducing construction costs and time, this technology can make quality housing more accessible to low-income populations. A report by the <em>World Economic Forum</em> emphasized the need for construction innovations that address social inequities by providing affordable, sustainable housing solutions to underserved communities (WEF, 2022).</li><li><strong>Resilience to Climate Change</strong>:<br>As the frequency and severity of extreme weather events increase due to climate change, the need for resilient infrastructure becomes more critical. Precast sandwich panels, with their superior durability and thermal performance, offer a viable solution for constructing buildings that can withstand harsh climates and provide safe, comfortable shelter for their occupants.</li></ol><h3>Conclusion: Embracing a People-Centric Future</h3><p>The construction industry is on the brink of a revolution, and precast sandwich technology is leading the charge. This innovation not only enhances the efficiency, sustainability, and safety of the construction process but also shifts the focus from the construction workers to the people who will inhabit these spaces. By prioritizing public health, comfort, and social equity, precast sandwich technology embodies a new era of construction that truly serves the needs of society.</p><p><strong>With BEAM. we want to bring the construction back to regular people, so everyone can build their own house using advanced technology within days, not years for the half of the cost of regular construction.</strong></p><p>As the global population continues to grow and urbanize, the demand for innovative construction solutions will only intensify. Precast sandwich technology offers a promising path forward, one that aligns with the broader goals of sustainable development and social equity. It is time for the construction industry to embrace this technology and, in doing so, build a future that prioritizes the well-being of all people, not just those who work in construction.</p><h3>References</h3><p>O’Hegarty, R., &amp; Kinnane, O. 2020. <em>Review of precast concrete sandwich panels and their innovations</em>. Construction and Building Materials, Volume 233, <a href="https://doi.org/10.1016/j.conbuildmat.2019.117145">https://doi.org/10.1016/j.conbuildmat.2019.117145</a></p><p>Gorgolewski, M. (2017). The potential for prefabrication in UK housing to address sustainability issues. <em>Journal of Cleaner Production</em>, 26, 1–8.</p><p>Nguyen, T., et al. (2020). Comparative analysis of construction time and cost between conventional and precast concrete sandwich panel construction methods. <em>International Journal of Construction Management</em>, 40(2), 189–202.</p><p>Wargocki, P., et al. (2021). Indoor air quality and the impact of building occupants’ health. <em>Building and Environment</em>, 206, 108351.</p><p>World Economic Forum. (2022). Rethinking construction: Sustainable and affordable housing solutions for the future. <em>World Economic Forum Report</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c07a32175c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vaccine Supply Chain Optimization with AI-Powered Capacitated Vehicle Routing Problem(CVRP)- Part 2]]></title>
            <link>https://piotrkrosniak.medium.com/vaccine-supply-chain-optimization-with-ai-powered-capacitated-vehicle-routing-problem-cvrp-part-2-233bc85fa247?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/233bc85fa247</guid>
            <category><![CDATA[vaccines]]></category>
            <category><![CDATA[supply-chain-management]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[unicef]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Tue, 17 Jan 2023 10:29:56 GMT</pubDate>
            <atom:updated>2023-01-17T10:29:56.562Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a second article in a series on solving the vaccine deliver routing problem with Python. In the first article we focused on a simple method for solving our problem, and now we will go over using Reinforcement Learning technique.</p><p>Reinforcement learning (RL) is a method of training agents to make decisions in an environment by maximizing a reward function. This technique has been successfully applied to a wide range of problems, including the capacitated vehicle routing problem (CVRP).</p><p>The CVRP is a problem of finding the most efficient routes for a fleet of vehicles to service a set of customers, in our case delivering vaccines from central storage to Health Clinics in Pakistan Federal Capital Territory province. The goal is to minimize the total distance traveled by the vehicles while satisfying the customers’ demand and constraints, such as vehicle capacity and time windows.</p><p>One approach to solving the VRP using RL is to model the problem as a Markov decision process (MDP). In this model, the state of the system includes the location and status of the vehicles and the customers, and the actions are the possible routes for the vehicles to take. The reward function is designed to encourage the vehicles to service customers while minimizing the distance traveled.</p><p>One algorithm that has been used for solving VRP using RL is Q-learning. Q-learning is a type of model-free RL algorithm that learns the optimal policy by estimating the value of taking a specific action in a specific state, known as the Q-value. The Q-value is updated iteratively as the agent interacts with the environment and receives feedback in the form of rewards.</p><p>In this scenario, we are using a prebuild model that is more robust and that was already pretrained to solve the problem. More info about our model you can find in <a href="https://github.com/d-eremeev/ADM-VRP">GitHub repository.</a></p><p><strong>Attention Model Approach:<br>1. </strong>The structural features of the input graph instance are extracted by the encoder. Then the solution is constructed incrementally by the decoder.<br>2. Specifically, at each construction step, the decoder predicts a distribution over nodes, then one node is selected and appended to the end of the partial solution.</p><h4>Main ideas:</h4><ul><li>Use RL to create an agent that can learn heuristics and provide suboptimal solutions.</li><li>Make use of Graph Attention Networks (GAT) to create appropriate graph embeddings for the agent.</li><li>Policy of RL agent is governed by the decoder.</li></ul><p>Building a model from scratch is a very time-consuming process, to make it more user-friendly without going into details, I’ve created an online <a href="https://huggingface.co/peterkros/cvrp-model">model repository</a> that you can use in your experimentation.</p><pre>from tensorflow_tts.inference import TFAutoModel<br>model = TFAutoModel.from_pretrained(&quot;peterkros/cvrp-model&quot;)</pre><p>Here is a result based on dataset that I was working with, location of Health Clinics in Pakistan Federal Capital Territory province. How we can see, there are 4 routes created to supply all points on the map. One limitation important to note that is this estimated based on distance between points and not actual road network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*K1kf7RPI_ISJT8N8x_uIJA.png" /></figure><p>Thank you for this and hope you enjoy the article, next article will be on the <strong>Inventory management.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=233bc85fa247" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vaccine Supply Chain Optimization with AI-Powered Capacitated Vehicle Routing Problem(CVRP)- Part 1]]></title>
            <link>https://piotrkrosniak.medium.com/vaccine-supply-chain-optimization-with-ai-powered-capacitated-vehicle-routing-problem-cvrp-part-1-ca79519e9ad7?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca79519e9ad7</guid>
            <category><![CDATA[vaccines]]></category>
            <category><![CDATA[unicef]]></category>
            <category><![CDATA[cvrp]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[supply-chain]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Sat, 14 Jan 2023 07:02:36 GMT</pubDate>
            <atom:updated>2023-01-14T07:02:36.116Z</atom:updated>
            <content:encoded><![CDATA[<p>The world is facing a global health crisis, and one of the most important challenges is to ensure an efficient and timely distribution of vaccines to those who need them. The capacitated vehicle routing problem (CVRP) is a well-established optimization method used to optimize delivery routes, however, in recent years, the use of AI techniques has been proposed as a way to improve the solution of the CVRP.</p><p>The CVRP is a variant of the vehicle routing problem (VRP) in which vehicles have a limited carrying capacity and must visit a set of customer locations to deliver or collect items. In the context of the vaccine supply chain, the CVRP can be used to optimize the delivery of vaccines from storage facilities to vaccination centers. The CVRP considers constraints such as the capacity of the vehicles, the time window in which deliveries can be made, and the distance between locations.</p><p>One of the most popular AI techniques that can be used to improve the solution of the CVRP is metaheuristics. Metaheuristics are optimization techniques that combine the exploration of the solution space with the exploitation of promising regions. These techniques can include simulated annealing, tabu search, and genetic algorithms, which can be implemented in python using libraries such as DEAP.</p><p>Another AI technique that can be used to improve the solution of the CVRP is neural networks. Neural networks can be used to approximate the objective function or to learn constraints of the problem. They can be used to learn the underlying patterns of the problem, and then use these patterns to create new solutions, or to evaluate the quality of existing solutions.</p><p>Deep reinforcement learning is another AI technique that can be used to improve the solution of the CVRP. CVRP can be formulated as a Markov Decision Process (MDP) and solved with Reinforcement Learning (RL) techniques. Deep reinforcement learning is a variant of RL in which the Q-function is approximated with a neural network.</p><p>A combination of metaheuristics and machine learning methods can be used to improve the solution of CVRP. For example, genetic algorithm can be used to generate new solutions, and neural networks can be used to evaluate their quality, or a hybrid algorithm of Particle swarm optimization with neural networks.</p><p>In conclusion, the use of AI techniques, such as metaheuristics, neural networks, and deep reinforcement learning, can help to improve the solution of the CVRP in the vaccine supply chain. By using these techniques, the distribution of vaccines can be optimized, thus ensuring that they reach those who need them in a timely and efficient manner.</p><p>Now let’s get to solving our problem, in the first phase we will calculate optimal routes for delivery of vaccine from National store to health facilities and in the second phase we will see how we can improve this with AI. Good background for this can be the article available in Google Scholar <a href="https://onlinelibrary.wiley.com/doi/full/10.1111/itor.12867">“A light-touch routing optimization tool (RoOT) for vaccine and medical supply distribution in Mozambique”</a>, outlining some of the problems and describing solutions.</p><p>First, we need to set some objective and constrains for our problem.</p><p><em>(1) objective function, which means “minimize the travel cost (sum of traveling distance) of all vehicles”</em></p><ul><li><em>(2) constraint, which means “only one visit per vehicle per health facility location”</em></li><li><em>(3) constraint which means “depart from Vaccine central storage (depot)”</em></li><li><em>(4) constraint which means “the number of vehicles coming in and out of a health facility is the same”</em></li><li><em>(5) constraint which means “the delivery capacity of each vehicle should not exceed the maximum capacity”</em></li><li><em>(6) constraint for “removal of subtours”</em></li><li><em>(7) constraint for decision variables</em></li></ul><p>Now we can get to coding this with Python using PuLp library and Google Maps API.</p><pre>import numpy as np<br>import pandas as pd<br>import pulp<br>import itertools<br>import gmaps<br>import googlemaps<br><br>API_KEY = &#39;YOUR_GOOGLE_MAPS_API_KEY&#39;<br>gmaps.configure(api_key=API_KEY)<br>googlemaps = googlemaps.Client(key=API_KEY)</pre><p>Next we load the values for the health facilities and Vaccine central store. For this, we use publicly available data on <a href="https://data.humdata.org/dataset/pakistan-health-facilities">Pakistan Health Facilities</a>, and filter only one region Federal Capital Territory and government health facilities.</p><pre>import geopandas<br>pak = geopandas.read_file(&#39;./pakistan_health_facilities/Pakistan_Health_Facilities.shp&#39;)<br>#Filter data <br>pakistanFCT = pak[(pak.Province == &quot;FEDERAL CAPITAL TERRITORY&quot;)&amp;(pak.Gov_Pvt == &quot;GOVERNMENT&quot;)&amp;(pak.Category != &quot;VETERINARY&quot;)&amp;(pak.Category != &quot;AMBULANCE SERVICE&quot;) ]<br>pakistanFCT.reset_index(drop=True, inplace=True)<br>pakistanFCT.plot()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*gYtvnreBpfHFg172iKrNVg.png" /><figcaption>Lat Long of Health Facilities for the exercise.</figcaption></figure><p>Next, we write a function that can display the location of all health facilities on Google Maps.</p><pre>import collections #This line is necessary update for Python3.10 <br>collections.Iterable = collections.abc.Iterable<br>#Function to plot points on the google map <br>def _plot_on_gmaps(_df):<br>    _marker_locations = []<br>    for i in range(len(_df)):<br>        _marker_locations.append((_df[&#39;Latitude&#39;].iloc[i],_df[&#39;Longitude&#39;].iloc[i]))<br>    _fig = gmaps.figure()<br>    _markers = gmaps.marker_layer(_marker_locations)<br>    _fig.add_layer(_markers)<br>    return _fig<br>plot_result = _plot_on_gmaps(df)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*lOXnD1DNXlEKlrpssGaoTA.png" /></figure><p>In the next step, we will calculate driving distance between Health Facilities and Central Vaccine Store.</p><pre># function for calculating distance between two pins<br>def _distance_calculator(_df):<br>    _distance_result = np.zeros((len(_df),len(_df)))<br>    _df[&#39;latitude-longitude&#39;] = &#39;0&#39;<br>    for i in range(len(_df)):<br>        _df[&#39;latitude-longitude&#39;].iloc[i] = str(_df.Latitude[i]) + &#39;,&#39; + str(_df.Longitude[i])<br>    <br>    for i in range(len(_df)):<br>        for j in range(len(_df)):<br>            # calculate distance of all pairs<br>            _google_maps_api_result = googlemaps.directions(_df[&#39;latitude-longitude&#39;].iloc[i],<br>                                                            _df[&#39;latitude-longitude&#39;].iloc[j],<br>                                                            mode = &#39;driving&#39;)<br>            # append distance to result list<br>            _distance_result[i][j] = _google_maps_api_result[0][&#39;legs&#39;][0][&#39;distance&#39;][&#39;value&#39;]<br>    return _distance_result<br>distance = _distance_calculator(df)</pre><p>The next part is resource intensive and depending on your computer and number of data points it can take some time and run into out of memory problems.</p><pre># solve with pulp<br>for vehicle_count in range(1,vehicle_count+1):<br>    <br>    # definition of LpProblem instance<br>    problem = pulp.LpProblem(&quot;CVRP&quot;, pulp.LpMinimize)<br><br>    # definition of variables which are 0/1<br>    x = [[[pulp.LpVariable(&quot;x%s_%s,%s&quot;%(i,j,k), cat=&quot;Binary&quot;) if i != j else None for k in range(vehicle_count)]for j in range(customer_count)] for i in range(customer_count)]<br><br>    # add objective function<br>    problem += pulp.lpSum(distance[i][j] * x[i][j][k] if i != j else 0<br>                          for k in range(vehicle_count) <br>                          for j in range(customer_count) <br>                          for i in range (customer_count))<br><br>    # constraints<br>    # foluma (2)<br>    for j in range(1, customer_count):<br>        problem += pulp.lpSum(x[i][j][k] if i != j else 0 <br>                              for i in range(customer_count) <br>                              for k in range(vehicle_count)) == 1 <br><br>    # foluma (3)<br>    for k in range(vehicle_count):<br>        problem += pulp.lpSum(x[0][j][k] for j in range(1,customer_count)) == 1<br>        problem += pulp.lpSum(x[i][0][k] for i in range(1,customer_count)) == 1<br><br>    # foluma (4)<br>    for k in range(vehicle_count):<br>        for j in range(customer_count):<br>            problem += pulp.lpSum(x[i][j][k] if i != j else 0 <br>                                  for i in range(customer_count)) -  pulp.lpSum(x[j][i][k] for i in range(customer_count)) == 0<br><br>    #foluma (5)<br>    for k in range(vehicle_count):<br>        problem += pulp.lpSum(df.demand[j] * x[i][j][k] if i != j else 0 for i in range(customer_count) for j in range (1,customer_count)) &lt;= vehicle_capacity <br><br><br>    # fomula (6)<br>    subtours = []<br>    for i in range(2,customer_count):<br>         subtours += itertools.combinations(range(1,customer_count), i)<br><br>    for s in subtours:<br>        problem += pulp.lpSum(x[i][j][k] if i !=j else 0 for i, j in itertools.permutations(s,2) for k in range(vehicle_count)) &lt;= len(s) - 1<br><br>    <br>    # print vehicle_count which needed for solving problem<br>    # print calculated minimum distance value<br>    if problem.solve() == 1:<br>        print(&#39;Vehicle Requirements:&#39;, vehicle_count)<br>        print(&#39;Moving Distance:&#39;, pulp.value(problem.objective))<br>        break</pre><p>That&#39;s give us information on the number of trucks we need and distance they will</p><blockquote>Vehicle Requirements: 2 <br>Moving Distance: 11624.0</blockquote><p>And now we can put this on map to see the driving rout with the script below.</p><pre># visualization : plotting on google maps<br>fig = gmaps.figure()<br>layer = []<br>color_list = [&quot;red&quot;,&quot;blue&quot;,&quot;green&quot;]<br><br>for k in range(vehicle_count):<br>    for i in range(customer_count):<br>        for j in range(customer_count):<br>            if i != j and pulp.value(x[i][j][k]) == 1:<br>                layer.append(gmaps.directions.Directions(<br>                    (df.latitude[i],df.longitude[i]),<br>                    (df.latitude[j],df.longitude[j]),<br>                    mode=&#39;car&#39;,stroke_color=color_list[k],stroke_opacity=1.0, stroke_weight=5.0))<br><br>for i in range(len(layer)):<br>    fig.add_layer(layer[i])<br>    <br>fig</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvlVJfuGypQuS-9l1jyWRA.png" /></figure><p>In the part two of the article, we will look into using Machine Learning in solving our vaccine delivery problem.</p><p>Stay tuned and thank you for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca79519e9ad7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Predictive Analytics Model in Python to Improve Vaccine Supply and Demand: How AI is…]]></title>
            <link>https://piotrkrosniak.medium.com/using-predictive-analytics-model-in-python-to-improve-vaccine-supply-and-demand-how-ai-is-2479746f826d?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2479746f826d</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[unicef]]></category>
            <category><![CDATA[vaccines]]></category>
            <category><![CDATA[forecasting]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Sun, 08 Jan 2023 12:41:25 GMT</pubDate>
            <atom:updated>2023-01-09T07:33:39.053Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using Predictive Analytics Model in Python to Improve Vaccine Supply and Demand: How AI is Transforming the Field of Vaccination</h3><p>Predictive analytics is a powerful tool that is being used in a variety of fields to make more accurate predictions about future outcomes. In the field of vaccination, AI algorithms are being used to analyze past data on vaccine demand and supply to make more accurate predictions about future needs. This can help ensure that there is an appropriate amount of vaccine stock on hand at all times, reducing the risk of shortages and improving access to vaccines.</p><p>One of the key benefits of using predictive analytics in vaccination is that it can help to identify trends and patterns in vaccine demand that may not be immediately obvious. By analyzing data on factors such as population size, the prevalence of vaccine-preventable diseases, and vaccine availability and accessibility, AI algorithms can make more accurate predictions about future vaccine demand. This can help vaccination programs to be more proactive and better prepared to meet the needs of their populations.</p><p>Predictive analytics can also help to optimize the vaccine supply chain, identifying bottlenecks and inefficiencies and recommending ways to improve the flow of vaccines from manufacturers to distribution centers and ultimately to patients. By streamlining the supply chain, AI can help to reduce waste and improve efficiency, making it easier to get vaccines to those who need them.</p><p>Overall, the use of predictive analytics in vaccination can help to improve the efficiency, accuracy, and effectiveness of vaccination efforts. By using AI algorithms to analyze past data and make more accurate predictions about future needs, we can better ensure that vaccines are available and accessible to those who need them.</p><p>Let’s get to the coding part, all data and code is available in GitHub repository here <a href="https://github.com/PiotrKrosniak/ai4Vaccinations">https://github.com/PiotrKrosniak/ai4Vaccinations</a></p><p>First step is to find data, in my case data is BCG coverage for under 5 population in countries from 1980 to 2021. Data was compiled from two sources, WHO Population and WHO WUENIC estimate.</p><ul><li><a href="https://www.who.int/data/maternal-newborn-child-adolescent-ageing/indicator-explorer-new/mca/under-five-population-(thousands)">Under-five population (thousands)</a></li><li><a href="https://www.who.int/data/gho/indicator-metadata-registry/imr-details/2442">Indicator Metadata Registry Details</a></li></ul><p>The next step is to import libraries and select data from the dataset, clean data and display basic statistics about the data using <em>.describe()</em> function.</p><pre>import sklearn<br>import pandas as pd <br>import matplotlib.pyplot as plt<br>import seaborn as sns<br>%matplotlib inline<br><br>#Import dataset, remove NaN values and show basic statictics <br>df = pd.read_excel(&#39;data3.xlsx&#39;, sheet_name=&#39;AFG&#39;)<br>data = df.dropna()<br>data.describe()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*IKyu73tDGssRR_j13bjPeQ.png" /><figcaption>Dataset basic description, Image by author</figcaption></figure><p>Now we can visually explore the data and to see what is the composition of the data points. For this we will use <a href="https://seaborn.pydata.org/">Python Seaborne package</a> and to plot under 5 population and BCG demand in Afghanistan 1980–2021.</p><pre>fig, ax1 = plt.subplots()<br>ax2 = ax1.twinx() # secondary y-axis<br>sns.barplot(x=&#39;Year&#39;, y=&#39;Population&#39;, data=data, ax=ax1) # on primary ax1<br>sns.pointplot(x=&#39;Year&#39;, y=&#39;BCG_demand&#39;, color=&#39;#333&#39;, data=data, ax=ax2) # on secondary ax2<br>ax1.set_ylabel(ylabel = &#39;BCG Demand in Thousends&#39;, fontsize = 10)<br>ax1.set_title(label = &#39;BCG Demand in Afghanistan 1980-2021&#39;, fontsize = 20)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oRWz9w-0YK6Zv8WHMVUBHw.png" /><figcaption>BCG Demand in Afghanistan, 1980–2021 (In under 5 population)</figcaption></figure><p>Before applying any statistical model on a time series, we must ensure that the <strong>time</strong> <strong>series is stationary.</strong> There are two primary way to determine whether a given time series is stationary.</p><ul><li><strong>Rolling</strong> <strong>Statistics</strong>: Plot the rolling mean and rolling standard deviation. The time series is stationary if they remain constant with time (with the naked eye, look to see if the lines are straight and parallel to the x-axis).</li><li><strong>Augmented Dickey-Fuller Test</strong>: The time series is considered stationary if the p-value is low (according to the null hypothesis) and the critical values at 1%, 5%, 10% confidence intervals are as close as possible to the ADF Statistics.</li></ul><p>We know also from the graph that data that our data increases over time, so it will not be stationary, just to be sure we can check with ADF test with the code below.</p><pre>from statsmodels.tsa.stattools import adfuller<br>result = adfuller(data[&#39;BCG_demand&#39;])<br>print(&#39;ADF Statistic: {}&#39;.format(result[0]))<br>print(&#39;p-value: {}&#39;.format(result[1]))<br>print(&#39;Critical Values:&#39;)<br>for key, value in result[4].items():<br>    print(&#39;\t{}: {}&#39;.format(key, value))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*FNVYc3-gCEGa7gNh-oD9ow.png" /></figure><p>This looks good our p-value is above 0.005 and also far from critical values printed for 1%, 5% and 10%.</p><p>Next we implement the simplest method for time series forecasting that is build by <a href="https://facebook.github.io/prophet/">Facebook, the Prophet Package.</a></p><pre>#Import packages and dataset <br>from prophet import Prophet<br>import pandas as pd <br>df = pd.read_excel(&#39;data4.xlsx&#39;,sheet_name=&#39;AFG&#39;)<br>df.head()</pre><p>Prophet package is very strict on the data types, so there can be only two columns with specific naming. “ds” for date time values and “y” for value we want to predict.</p><pre>#Delate unecessary columns and rename columns to &quot;ds&quot; and &quot;y&quot;<br>df = df.drop(&#39;Population&#39;, axis=1)<br>df = df.rename(columns = {&#39;Date&#39;:&#39;ds&#39;, &#39;BCG_demand&#39;:&#39;y&#39;})</pre><p>This data we can fit into our model and print predicted values and graph. The forecast object here is a new data frame that includes a column yhat with the forecast, as well as columns for components and uncertainty intervals.</p><pre># Create instance of the Prophet <br>m = Prophet()<br>m.fit(df)<br>#Determin how many years for you want to make a prediction in future in this case 10 years <br>#and &quot;A&quot; standas for Years for dais use &quot;D&quot; and for months &quot;M&quot;<br>periods = 10<br>future = m.make_future_dataframe(periods, freq=&#39;A&#39;, include_history=True)<br>#Make prediction and print the values <br>forecast = m.predict(future)<br>forecast[[&#39;ds&#39;, &#39;yhat&#39;, &#39;yhat_lower&#39;, &#39;yhat_upper&#39;]].tail(10)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*15o5rN2HR_T6jWnj0m87FQ.png" /></figure><pre>#Create graph to display prediction <br>fig1 = m.plot(forecast)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*pRgebSgq0hf6rFca2fNvtQ.png" /><figcaption>Prediction of the BCG_demand using Prophet Python Package</figcaption></figure><p>There is one important factor in our prediction that is population. And Prophet model doesn&#39;t let use more variables, as we can assume there is high correlation between under 5 population and BCG_demand we should include this variable and use A Multivariate time series forecasting using <strong>Vector Auto Regression (VAR)</strong>.</p><pre>#Import packages and data <br>import pandas as pd <br>data = pd.read_excel(&#39;data4.xlsx&#39;,sheet_name=&#39;AFG&#39;)<br><br>#creating the train and validation set<br>train = data[:int(0.8*(len(data)))]<br>valid = data[int(0.8*(len(data))):]<br><br>#fit the model<br>from statsmodels.tsa.vector_ar.var_model import VAR<br><br>model = VAR(endog=train)<br>model_fit = model.fit()<br><br># make prediction on validation<br>prediction = model_fit.forecast(model_fit.endog, steps=90)</pre><p>Next, we create a validation set of data to see how precise is our prediction.</p><pre>#creating the train and validation set<br>train = data[:int(0.8*(len(data)))]<br>valid = data[int(0.8*(len(data))):]<br><br>#fit the model<br>from statsmodels.tsa.vector_ar.var_model import VAR<br><br>model = VAR(endog=train)<br>model_fit = model.fit()<br><br># make prediction on validation<br>prediction = model_fit.forecast(model_fit.endog, steps=90)<br><br>#converting predictions to dataframe<br>from sklearn.metrics import mean_squared_error<br>import numpy as np <br>pred = pd.DataFrame(index=range(0,len(prediction)),columns=[cols])<br>for j in range(0,2):<br>    for i in range(0, len(prediction)):<br>       pred.iloc[i][j] = prediction[i][j]<br><br>#check rmse<br>for i in cols:<br>    print(&#39;rmse value for&#39;, i, &#39;is : &#39;, np.sqrt(mean_squared_error(pred[0:8], valid[i])))</pre><p>For the validation set, the RMSE measures the average difference between values predicted by a model and the actual values. It provides an estimation of how well the model is able to predict the target value (accuracy). <strong>The lower the value of the Root Mean Squared Error, the better the model is</strong>. In our case the rmse for Population is : 727.7004055827894 and for BCG_demand is : 1648.35374892619. This mean that population estimate was wrong (on average) by 727 and BC_Demande (on average) by 1648.</p><p>Now we can fit our entire dataset to make prediction</p><pre>#make final predictions<br>model = VAR(endog=data)<br>model_fit = model.fit()<br>#Number of steps determine number of years in future<br>yhat = model_fit.forecast(model_fit.endog, steps=1)<br>print(yhat)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*sOiq-VWETcAw70O8s3Y8tw.png" /></figure><p>And create a graph visually presenting our predictions.</p><pre>plt.figure(figsize=(14, 8))<br>plt.style.use(&#39;fivethirtyeight&#39;)<br># Plotting the Actuals<br>plt.plot(df_var.Date, df_var.BCG_demand, label=&#39;BCG Actual&#39;)<br>plt.plot(df_var.Date, df_var.Population, label=&#39;Population Actual&#39;)<br># Plotting the Forecasts<br>plt.plot(df_pred.Date, df_pred.BCG_demand_pred, label=&#39;BCG Forecasts&#39;)<br>plt.plot(df_pred.Date, df_pred.Population_pred, label=&#39;Population Forecasts&#39;)<br>plt.legend(loc=&#39;best&#39;)<br>plt.title(&quot;BCG Demand Forectast 2022-2031&quot;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mc-fEEm_hzFkiag-0Si4EA.png" /></figure><p>And to close this I decided to combine results of both techniques to see which one fit better into our task, surprisingly from the preliminary data exploration Prophet seems to be more accurate to predict demand and population.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2L5sdEfM_Yayv0BllhpzzA.png" /></figure><p>That&#39;s it for the vaccine demand forecasting with ML models. In the next article in the series, we will be exploring potential use cases of AI in <strong>Supply chain optimization.</strong></p><p>Thank You !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2479746f826d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the Potential of Artificial Intelligence in Vaccination: How AI Can Be Used to Improve…]]></title>
            <link>https://piotrkrosniak.medium.com/exploring-the-potential-of-artificial-intelligence-in-vaccination-how-ai-is-being-used-to-improve-8beb9c1233c5?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8beb9c1233c5</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[vaccination]]></category>
            <category><![CDATA[unicef]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[united-nations]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Tue, 03 Jan 2023 08:47:16 GMT</pubDate>
            <atom:updated>2023-01-03T09:06:40.082Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exploring the Potential of Artificial Intelligence in Vaccination: How AI Can Be Used to Improve Efficiency, Accuracy, and Outcomes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*_2aO2zU3eLmpO8Oh.jpg" /><figcaption>Image generated by AI</figcaption></figure><p>Artificial intelligence (AI) has the potential to revolutionize the field of vaccination, improving efficiency, accuracy, and outcomes. In this blog post, we will explore some of the ways in which AI is being used in the vaccination process, and why the use of AI is so important.</p><p>One area where AI is being used in vaccination is in the prediction of vaccine demand. Using predictive analytics, AI algorithms can analyze past data on vaccine demand and supply to make more accurate predictions about future needs. This can help ensure that there is an appropriate amount of vaccine stock on hand at all times, reducing the risk of shortages and improving access to vaccines.</p><p>AI is also being used to optimize the vaccine supply chain, helping to identify bottlenecks and inefficiencies and recommending ways to improve the flow of vaccines from manufacturers to distribution centers and ultimately to patients. By streamlining the supply chain, AI can help to reduce waste and improve efficiency, making it easier to get vaccines to those who need them.</p><p>In addition to improving efficiency and logistics, AI is also being used to improve the accuracy and effectiveness of vaccination efforts. For example, AI algorithms can analyze data on vaccine efficacy and adverse reactions to identify patterns and predict which individuals are at greatest risk for experiencing negative outcomes. This can help to tailor vaccination recommendations and improve the overall safety and effectiveness of vaccination programs.</p><p>In this series of post, we will go over five main use cases and provide practical examples for each model to train and develop AI solution for vaccination. I’m worked all my career in United Nation, so many examples and context will be related to work of the UNICEF in developing countries around the world.</p><ol><li><strong>Predictive analytics:</strong> AI algorithms could be used to analyze past data on vaccine demand and supply to make more accurate predictions about future needs. This could help ensure that there is an appropriate amount of vaccine stock on hand at all times.</li><li><strong>Supply chain optimization: </strong>AI could be used to optimize the vaccine supply chain, helping to identify bottlenecks and inefficiencies and recommending ways to improve the flow of vaccines from manufacturers to distribution centers and ultimately to patients.</li><li><strong>Inventory management: </strong>AI could be used to automatically track vaccine stock levels and alert managers when supplies are running low, allowing them to replenish stocks in a timely manner.</li><li><strong>Demand forecasting:</strong> AI could be used to analyze data on vaccine demand in different regions and adjust production and distribution accordingly.</li><li><strong>Personalized recommendations:</strong> AI could be used to recommend personalized vaccination schedules for individuals based on their age, medical history, and other factors, helping to ensure that the right vaccines are being administered to the right people at the right time.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8beb9c1233c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PowerBi dashboard for socio-economic impact of COVID-19 in South Asia]]></title>
            <link>https://medium.com/data-science/powerbi-dashboard-for-socio-economic-impact-of-covid-19-in-south-asia-57e39fd6d1e1?source=rss-b791abcfafd5------2</link>
            <guid isPermaLink="false">https://medium.com/p/57e39fd6d1e1</guid>
            <category><![CDATA[busines-intelligence]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[social-research]]></category>
            <category><![CDATA[covid19]]></category>
            <dc:creator><![CDATA[Piotr Krosniak]]></dc:creator>
            <pubDate>Mon, 14 Dec 2020 14:33:18 GMT</pubDate>
            <atom:updated>2020-12-15T13:26:22.039Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to build a successful PowerBi report for social research</h4><p>This will not be a typical PowerBi tutorial. If you need to get into PowerBi search medium or google, there is much content. This will be specific about the use of PowerBi for social research and building a socio-economic impact report.</p><p>PowerBi is a business analytics service developed by Microsoft. It provides interactive visualizations with self-service Bussiness Intelligence (BI) capabilities. End users can create reports and dashboards without any coding skills, and they do not have to depend on information technology staff or database administrators. PowerBi also gives you cloud-based BI services, known as “PowerBi Services,” along with a desktop-based interface called “Power BI Desktop.” It offers data warehouse capabilities, including data preparation, data discovery, and interactive dashboards. PowerBi lets you connect your data from SQL Server databases, Analytical Services, excel/CSV files, and many other formats. Reporting portals embed PowerBi reports and dashboards to give you a unified experience. There is a difference between reports and dashboard in PowerBi, and <a href="https://medium.com/@minatibiswal_85870/how-to-explain-about-power-bi-dashboard-vs-report-38007bb6d71d">this article</a> gives you a good overview and information about how to explain the differences.</p><p>My task was to build an online tool to monitor the socio-economic impact of the COVID-19 epidemic in South Asia. I am working for many years in the United Nations System, and nine countries in South Asia will use this tool. The tool will include internal and external data sources from telephone surveys (CATI) and Rapid Assessments conducted using SMS two-way communications (<a href="https://community.rapidpro.io/">RapidPro</a>).</p><p>My first decision was to select the right tool for the job, and options are quite limited for this scenario. The tool must be available for multiple users within different countries and simple enough, so users without codding experience can navigate it and use it in their work. Another criterion is licensing. The organization I was working with recently implemented PowerBi at the corporate level. This seems like the best choice.</p><p>Now starts the real problem. PowerBi is not designed to be used with text data; it was primary develop for financial reporting, so its quickly consume number, but with text, it’s more complicated. When you receive a social research report, it is usually a table with many columns and numbers, but these numbers correspond to text answers from the respondents (data dictionary). You can connect using dictionary questions from the survey to the data and also connect data with answers. This is typically done in statistical software like SPSP or STAT, but this was not fulfilling other requirements for my use case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qsbTnfNeYt87WayTtz5hBw.jpeg" /><figcaption>Data table and data dictionary (image by author)</figcaption></figure><p>PowerBi, as mentioned, was designed for social research, and there is no simple option to connect the table with questions and question code to another table with data. You would need to <a href="https://docs.microsoft.com/en-us/powerquery-m/table-unpivot">unpivot the table </a>that’s is not a solution for multiple tables and answers as this will create an index only for one question. The only solution will be to assign text values to all rows of data first and then upload them to PowerBi for analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bF2Dg0VFslQth3pwf3_YnA.png" /><figcaption>Cleaned and transformed dataset (image by author)</figcaption></figure><p>This is the final look of the data table after the cleaning process and assigning text values to the dictionary numbers. How you can see, also, question codes were replaced with text questions.</p><p>In this scenario was also important to remember different methodologies that the analyzed studies were conducted under and that we can not only mix and mash questions from different surveys without understanding the methodology behind them.</p><p>Another essential point to make is about questions with multiple answers. So if the answers are coded in multiple columns in your data file, there is no perfect method to use them in PowerBi unless you will duplicate questions and answer as many times as possible answers.</p><p>The next step was to figure out a structure for my dashboard/report. I decided to choose a Paginated report structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*gIqDgFKdaG5f08Uk-N5Zfw.png" /><figcaption>Structure of the Report is build using multiple pages (image by author)</figcaption></figure><p>This way I can present first each dataset’s basic characteristics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UqmjzavqMWJ0CVcwQ44rCg.png" /><figcaption>Report page with dataset description (image by author)</figcaption></figure><p>And separate pages with thematic visualizations based on the datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o3hGxlrEy_fqYDy0WYjscA.png" /><figcaption>Thematic pages in the report (image by author)</figcaption></figure><p>The final result is a PowerBi report that has multiple pages and users can go over the datasets and thematic areas covered by the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZqpbhMeK4DirjxVfuYMHw.png" /><figcaption>PowerBi final report (image by author)</figcaption></figure><h3>Final thoughts</h3><p>PowerBi is not typical statistical analysis software, but it has other advantages for rapid data visualization and simplicity for regular users. With more community around PowerBi, new features will be added over time. This is not the first choice software for social research, but hopefully, this will be more popular among statisticians. This article is a small contribution to this goal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57e39fd6d1e1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/powerbi-dashboard-for-socio-economic-impact-of-covid-19-in-south-asia-57e39fd6d1e1">PowerBi dashboard for socio-economic impact of COVID-19 in South Asia</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>