<?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 Herwin Abedes on Medium]]></title>
        <description><![CDATA[Stories by Herwin Abedes on Medium]]></description>
        <link>https://medium.com/@jwbvjnsddz?source=rss-b4234422b7cb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Herwin Abedes on Medium</title>
            <link>https://medium.com/@jwbvjnsddz?source=rss-b4234422b7cb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:22:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jwbvjnsddz/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[Porter’s Five Forces Model — The Competitive Dynamics in Industry]]></title>
            <link>https://medium.com/@jwbvjnsddz/porters-five-forces-model-the-competitive-dynamics-in-industry-6a027d626ed9?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a027d626ed9</guid>
            <category><![CDATA[mba]]></category>
            <category><![CDATA[procurement]]></category>
            <category><![CDATA[porters-five-forces]]></category>
            <category><![CDATA[business-strategy]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Mon, 16 Jun 2025 00:58:12 GMT</pubDate>
            <atom:updated>2025-06-16T00:58:12.070Z</atom:updated>
            <content:encoded><![CDATA[<h3>Porter’s Five Forces Model — The Competitive Dynamics in Industry</h3><p>Every business aims to protect its profits from competitors.</p><p>In today’s fast-changing business environment, it is not a question of if you will face competition — but how.</p><p>That is where Porter’s Five Forces comes in: A strategic framework that helps you understand your industry’s dynamics and make smarter, more informed decisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rP7xKlVDynEwauIoAvfDbg.png" /></figure><h3>What is Porter’s Five Forces?</h3><p>Developed by Harvard Business School professor Michael Porter in 1979, the Five Forces framework helps companies analyze the competitive environment in any industry. By understanding these forces, you can:</p><ul><li>Identify what drives profitability in your field</li><li>Pinpoint where threats and opportunities lie</li><li>Find a defensible, profitable position among competitors</li></ul><p>While SWOT analysis looks at both internal and external factors, Porter’s model focuses on external, industry-level forces that impact your business’s ability to earn profits.</p><h3><strong>The Five Forces Explained.</strong></h3><p>Porter’s Model identifies five core competitive forces:</p><ol><li><em>Threat of New Entrants</em></li><li><em>Bargaining Power of Suppliers</em></li><li><em>Bargaining Power of Buyers</em></li><li><em>Threat of Substitute Products or Services</em></li><li><em>Competitive Rivalry among Existing Firms</em></li></ol><p>Let’s break down each force, with practical examples and questions to guide your analysis.</p><h3><strong>1. The Threat of New Entrants</strong></h3><p>When an industry becomes more profitable, it attracts new players eager to grab a slice of the pie. If barriers to entry are low, new competitors can quickly undercut prices and take market share. High barriers — like economies of scale, strong brands, patents, exclusive access to distribution, or heavy regulation — make entry more difficult.</p><p>Example:</p><p><em>Apple’s launch of the iPod revolutionized music distribution, disrupting existing players with a new business model.</em></p><p>Barriers to Entry to Consider:</p><ul><li><em>Economies of Scale: Can new entrants match your production cost?</em></li><li><em>Network Effects: Does your product get better as more people use it?</em></li><li><em>Switching costs for Customers: Is it hard to move to a new provider?</em></li><li><em>Capital Requirements: How much investment is needed?</em></li><li><em>Access to Distribution Channels: Can newcomers get on store shelves or online?</em></li><li><em>Government Policy: Licenses, Regulations, &amp; Subsidies</em></li><li><em>Potential for Retaliation by Incumbents: Will established firms fight back?</em></li></ul><p>Key Questions:</p><ul><li><em>How expensive or time-consuming would it be for a new competitor to enter the market?</em></li><li><em>Does strong customer loyalty exist?</em></li><li><em>Are there regulations, patents, or exclusive agreements that protect incumbents?</em></li></ul><h3><strong>2. Bargaining Power of Suppliers</strong></h3><p>Suppliers provide the raw materials, components, or services your business needs. If you have many suppliers to choose from, their power is low. If only a few suppliers exist, or if switching is costly, then can demand higher prices or lower quality.</p><p>Example:</p><p><em>Volkswagen works with numerous suppliers worldwide, giving it leverage. By contrast, specialized automotive suppliers often depend on a few large clients and have less bargaining power.</em></p><p>What Increases Supplier Power?</p><ul><li><em>Few suppliers, many buyers</em></li><li><em>Suppliers offer unique or highly valued products</em></li><li><em>Suppliers can threaten to “integrate forward” (become your competitor)</em></li><li><em>High switching costs for buyers</em></li></ul><p>Key Questions:</p><ul><li><em>Who are your key suppliers, and how many alternatives do you have?</em></li><li><em>How difficult or costly is it to switch suppliers?</em></li><li><em>Could suppliers start competing with you directly?</em></li></ul><h3>3. Bargaining Power of Buyers</h3><p>Buyers are your customers. When they have many choices or buy in large volumes, they can demand better prices, higher quality, or more services — squeezing your margins.</p><p>Example:</p><p><em>Fashion brands such as Zara and H&amp;M face strong buyer power, as shoppers have endless alternatives and can push for better deals or more sustainable options.</em></p><p>What Increases Buyer Power?</p><ul><li><em>Small number of powerful buyers, many sellers</em></li><li><em>Products are standardized and easy to compare</em></li><li><em>Buyers can “integrate backward” (start making the product themselves)</em></li><li><em>Low switching costs</em></li></ul><p>Key Questions:</p><ul><li><em>Do a few buyers make up most of your revenue?</em></li><li><em>How many alternative sellers do buyers have?</em></li><li><em>How easy is it for them to switch to another provider?</em></li></ul><h3>4. Threat of Substitute Products or Services</h3><p>Substitutes are products or services from outside your industry that serve the same need. A high threat of substitute how much you can charge and can erode your profits.</p><p>Example:</p><p><em>The rise of health drinks is a major threat to traditional soda companies, as consumers switch to alternatives with less sugar and more health benefits.</em></p><p>What Increases the Threat?</p><ul><li><em>Many substitutes exist</em></li><li><em>Substitutes are affordable and easy to access</em></li><li><em>Low switching costs for buyers</em></li></ul><p>Key Questions:</p><ul><li><em>How many substitutes exist for your product or service?</em></li><li><em>How similar are they in terms of function and price?</em></li><li><em>What sets you apart from these substitutes?</em></li></ul><h3><strong>5. Competitive Rivalry among Existing Firms</strong></h3><p>This force looks at how fierce the competition is within your industry. Intense rivalry can lead to price wards, higher marketing costs, and lower profits.</p><p>Example:</p><p><em>Fast food giants like McDonald’s and Burger King compete aggressively on price, menu innovation, and customer experience.</em></p><p>What Increases Rivalry?</p><ul><li><em>Many equally sized competitors</em></li><li><em>Slow industry growth</em></li><li><em>Low product differentiation (commodities)</em></li><li><em>High exit barriers (hard or costly to leave the market)</em></li></ul><p>Key Questions:</p><ul><li><em>How many competitors are there, and how big are they?</em></li><li><em>What makes your product or service different?</em></li><li><em>Are there barriers that keep customers loyal?</em></li></ul><h3>How to Use Porter’s Five Forces?</h3><ol><li><strong>Map out each Force:</strong> Use the guiding questions above and score each force as high, medium, or low threat.</li><li><strong>Identify your Position:</strong> Where are forces weakest? Where can you defend or exploit opportunities?</li><li><strong>Develop Strategy:</strong> Porter suggest three generic strategies — Cost Leadership, be the lowest cost provider. Differentiation, offer unique value or features. Focus, target a niche market better than anyone else.</li><li><strong>Stay Focused:</strong> Avoid being “stuck in the middle,” pick a strategy that matches your strengths and is hard for competitors to copy.</li><li><strong>Review and Revise:</strong> Revisit your analysis regularly, as industry forces are always evolving.</li></ol><h3>Conclusion</h3><p>Porter’s Five Forces is more than a theoretical model — it is a practical tool that helps you understand your industry, outmaneuver competitors, and find your path to long-term profitability. Use it alongside other frameworks, keep your strategy focused, and revisit your analysis as the business world evolves.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a027d626ed9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyzing Globalization Opportunities]]></title>
            <link>https://medium.com/@jwbvjnsddz/analyzing-globalization-opportunities-8703216ffdcb?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8703216ffdcb</guid>
            <category><![CDATA[procurement]]></category>
            <category><![CDATA[supply-management]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Wed, 03 Jul 2024 02:33:53 GMT</pubDate>
            <atom:updated>2024-07-03T02:33:53.391Z</atom:updated>
            <content:encoded><![CDATA[<p>When a company decides to expand globally, it commits significant resources and faces opportunity costs. Funds allocated for international expansion are not available for domestic growth or shareholder dividends, so it’s essential to thoroughly evaluate the potential benefits, requirements, and risks of such opportunities.</p><p>PESTEL and SWOT analysis tools are invaluable for understanding the macro environment that can impact the success of a global venture, helping to identify the specific opportunities and risks in a given region or country. Often, global organizations will hire local experts to gather the necessary information.</p><p>Let’s explore how PESTEL factors influence globalization decisions:</p><p><strong>Political Considerations</strong></p><p>The term “host country” refers to the nation or region where a global organization is contemplating expansion. Political conditions and attitudes in the host country can either hinder or facilitate a global venture. Protective government actions, such as implementing complicated import procedures, quotas, or tariffs, can pose challenges. Some governments might mandate purchasing supplies locally or limit credit to foreign businesses.</p><p>Conversely, positive government actions aimed at boosting employment and living standards can include tax incentives, lower loan interest rates, free land, and the provision of necessary infrastructure, like roads.</p><p><strong>Economic Considerations</strong></p><p>Several economic issues can impact the success of a global venture:</p><ul><li><strong>Price fluctuations</strong>: Changes in the cost of materials, labor, land, and energy can affect the financial viability of operating in a country. A sharp increase in material costs can erode projected profits.</li><li><strong>Economic trends</strong>: Recession, inflation, or currency destabilization in the host country can influence demand and interest rates.</li><li><strong>Currency exchange rates</strong>: Fluctuations in exchange rates can affect cost advantages. A devalued host country currency might make manufacturing there more advantageous for export, while the opposite scenario could negate cost benefits.</li></ul><p><strong>Social Considerations</strong></p><p>Host country demographics are crucial for determining product/service demand and labor availability. Additionally, the cultural gap between the global organization and the host country must be considered. Can the organization market its product/service without significant changes? Will it be able to establish the necessary relationships to manage operations? Will the local population accept the organization’s policies, or will adjustments be needed?</p><p><strong>Technological Considerations</strong></p><p>The quality of the host country’s infrastructure is a significant technological issue. Key factors include the reliability of power, the adequacy of transportation networks (highways, railroads, ports), and the security of information systems.</p><p><strong>Environmental Considerations</strong></p><p>Water availability is an increasingly important factor in operational planning. Access to inexpensive power sources, such as hydroelectric power, can also influence investment decisions.</p><p><strong>Legal Considerations</strong></p><p>Global organizations must consider the stability and rule of law in the host country. Risks include potential government collapse leading to social unrest, the possibility of business seizures by new governments, fair treatment in legal disputes, and the protection of intellectual property rights.</p><blockquote>Intellectual property (IP) encompasses legal entitlements for names, media, and inventions, which can be significant organizational assets. The ethical climate is also important. Some countries may have business practices involving special payments or bribes, which could conflict with the organization’s ethical standards and, in some cases, violate home country laws.</blockquote><p>By thoroughly examining these PESTEL factors, organizations can make informed decisions about global expansion, mitigating risks and maximizing opportunities for success.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8703216ffdcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing and Implementing a Supplier Diversity Program]]></title>
            <link>https://medium.com/@jwbvjnsddz/developing-and-implementing-a-supplier-diversity-program-7fe00e5dfa63?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fe00e5dfa63</guid>
            <category><![CDATA[supplier-diversity]]></category>
            <category><![CDATA[procurement]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Wed, 12 Jun 2024 00:30:06 GMT</pubDate>
            <atom:updated>2024-06-12T00:30:06.887Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s competitive business landscape, organizations are constantly seeking ways to enhance their operational efficiencies and foster innovation. One of the most effective strategies to achieve these goals is by implementing a supplier diversity program. Supplier diversity programs involve the proactive inclusion of suppliers from diverse backgrounds, including minority-owned, women-owned, veteran-owned, LGBTQ-owned, and other historically underrepresented groups, into the supply chain. These programs have evolved from being merely compliance-driven initiatives to becoming integral components of a company’s strategic operations, offering significant competitive advantages.</p><p>The concept of supplier diversity has its roots in the social and political movements of the 1960s in the United States. Initially designed to address economic inequalities and provide opportunities for minority communities, these programs were largely seen as social responsibilities. Over time, however, the perception and importance of supplier diversity have shifted dramatically. Businesses have recognized that diverse suppliers bring unique perspectives, innovative solutions, and agile responses to market demands. This recognition has been bolstered by increasing evidence that diverse suppliers can contribute to lower costs, improved quality, on-time delivery, and enhanced customer service.</p><p>Organizations are now viewing supplier diversity as a strategic imperative rather than a mere compliance requirement. The global proliferation of corporate social responsibility (CSR) initiatives and the recognition of diverse communities’ economic power have further propelled the importance of these programs. Governments worldwide have also adopted supplier diversity regulations to stimulate economic growth, reduce unemployment, and foster the development of minority communities. For instance, the Canadian Aboriginal and Minority Supplier Council exemplifies international efforts to promote supplier diversity.</p><p>This comprehensive guide outlines the rationale behind developing supplier diversity programs, highlights the benefits and challenges associated with them, and provides practical steps for successful implementation. By integrating supplier diversity into their core business strategies, organizations can not only comply with regulatory mandates but also drive innovation, expand market reach, and build sustainable communities.</p><p><strong>Rationale in Developing Programs</strong></p><p>a. Organization Policies</p><p>Organizations should develop comprehensive supplier diversity policies that outline goals, objectives, and expected outcomes, guiding sourcing decisions and including clear guidelines on diversity targets. Additionally, these policies must be communicated effectively to all stakeholders, including suppliers, employees, and customers, to ensure alignment and support for the diversity initiatives.</p><p>b. Impediments</p><p>To overcome impediments in supplier diversity programs, organizations must identify and support small and diverse suppliers that may initially lack the capability to meet all organizational requirements. Implementing mentorship, training, and financial assistance programs can help these suppliers build capacity and meet performance standards effectively.</p><p>c. Benefits</p><p>Implementing a supplier diversity program can lead to significant benefits, including cost savings from diverse suppliers who often offer innovative approaches and competitive pricing. It also encourages the introduction of new ideas and technologies, enhances reputation and goodwill in communities by supporting local and minority-owned businesses, and provides access to new markets through suppliers with unique insights into diverse customer segments.</p><p>d. Assessing Program Goals</p><p>To effectively assess the progress of a supplier diversity program, organizations should establish Key Performance Indicators (KPIs) such as the percentage of spend with diverse suppliers, the number of diverse suppliers in the supply chain, the quality and delivery performance of diverse suppliers, and customer satisfaction related to products from diverse suppliers. Utilizing data visualization tools to create dashboards that display real-time progress against these goals is crucial. Regularly reviewing these dashboards in management meetings ensures continuous monitoring and improvement of the program.</p><p>e. Disparity Studies</p><p>Conducting disparity studies involves analyzing the level of participation across different supplier tiers (Tier 1, Tier 2, Tier 3) and professional categories to understand where gaps and opportunities exist. Additionally, benchmarking your organization’s performance against industry standards and best practices is essential for identifying areas for improvement and ensuring your supplier diversity program remains competitive and effective.</p><p>f. Customer-Driven Requirements</p><p>To meet customer-driven requirements, organizations must ensure compliance with government mandates on supplier diversity and align their efforts with broader corporate social responsibility (CSR) initiatives. This alignment not only enhances brand perception but also fosters customer loyalty by demonstrating a commitment to socially responsible practices.</p><p>g. Subcontracting Plans</p><p>To incorporate diversity in subcontracting plans, organizations should require prime contractors to include diverse suppliers and actively monitor their compliance. Additionally, offering incentives for meeting or exceeding supplier diversity goals can encourage prime contractors to prioritize and support diverse supplier inclusion.</p><p><strong>Sources of Information on Socially or Economically Disadvantaged Suppliers</strong></p><p>a. Small Business Administration (SBA)</p><p>Accessing the Small Business Administration’s (SBA) directory provides organizations with a valuable resource to identify small and disadvantaged businesses efficiently. The SBA’s directory offers a comprehensive database of diverse suppliers, making it easier for procurement professionals to locate potential partners who align with their supplier diversity objectives. By leveraging this directory, organizations can streamline their supplier discovery process and ensure inclusivity in their supply chain practices. Furthermore, the SBA directory often includes detailed information about the capabilities and certifications of listed businesses, allowing procurement teams to make informed decisions when selecting suppliers. Overall, utilizing the SBA’s directory enables organizations to fulfill their supplier diversity goals effectively while supporting the growth and development of small and disadvantaged businesses in their communities.</p><p>b. Minority/ Women Business Development Agency</p><p>The Minority/Women Business Development Agency’s regional offices serve as invaluable hubs of resources and support for organizations seeking to engage with minority-owned businesses. By leveraging the expertise and networks available at these regional offices, businesses can establish meaningful connections with diverse suppliers and strengthen their supplier diversity initiatives. These offices often offer tailored assistance and guidance to both minority entrepreneurs and corporations, facilitating mutually beneficial partnerships. Through proactive engagement with regional offices, organizations can gain access to a wide range of minority-owned businesses spanning various industries and geographical regions. Additionally, the support provided by these offices extends beyond mere introductions, encompassing mentorship, training, and other capacity-building initiatives. Ultimately, by tapping into the resources offered by the Minority/Women Business Development Agency’s regional offices, businesses can foster inclusive procurement practices and contribute to the growth and empowerment of minority-owned enterprises.</p><p>c. Business Directories</p><p>Accessing published resources such as directories provided by organizations like the National Minority Supplier Development Council (NMSDC), Women’s Business Enterprise National Council (WBENC), and Dun &amp; Bradstreet offers organizations a wealth of information on both certified and non-certified diverse suppliers. These directories serve as centralized repositories of supplier information, making it convenient for procurement professionals to identify potential partners who align with their diversity objectives. By leveraging these resources, organizations can gain access to a wide range of suppliers from diverse backgrounds, including minority-owned, women-owned, and other underrepresented groups. Moreover, these directories often include detailed profiles of listed businesses, allowing procurement teams to evaluate their capabilities, certifications, and track records effectively. This comprehensive information empowers organizations to make informed decisions when selecting suppliers, ensuring that their supply chains reflect their commitment to diversity and inclusion. Overall, accessing business directories from reputable organizations facilitates the establishment of robust supplier relationships and supports the growth and sustainability of diverse businesses.</p><p>d. Minority/ Women Business Development Councils</p><p>Certification from Minority/Women Business Development Councils serves as a vital tool for organizations striving to uphold diversity criteria within their supply chains. These councils rigorously evaluate and certify businesses owned by minorities and women, ensuring they meet specific diversity standards and criteria. By utilizing certification from these councils, organizations can confidently engage with suppliers that align with their diversity objectives and contribute to their supplier diversity goals. Certification signifies that a business has undergone a thorough verification process, instilling trust and confidence in its ability to meet diversity requirements. Furthermore, certified businesses often receive additional support and resources from these councils, including access to networking opportunities, training programs, and business development initiatives. Leveraging certification from Minority/Women Business Development Councils not only helps organizations meet regulatory compliance but also fosters partnerships with diverse suppliers, driving innovation, and creating opportunities for economic empowerment within marginalized communities.</p><p>e. Local Minority/ Women Chambers of Commerce</p><p>Networking with local Minority/Women Chambers of Commerce provides organizations with a valuable opportunity to connect with diverse suppliers and strengthen their supplier diversity efforts. These chambers serve as vibrant ecosystems where businesses from minority and women communities come together to support and empower each other. By actively engaging with these chambers, organizations can build meaningful relationships with potential suppliers who represent diverse backgrounds and perspectives. Networking events, workshops, and seminars hosted by these chambers offer platforms for procurement professionals to discover new opportunities, exchange ideas, and foster collaborations with minority and women-owned businesses. Furthermore, participation in local chambers demonstrates a commitment to supporting the economic growth and development of marginalized communities. By networking with local Minority/Women Chambers of Commerce, organizations not only expand their supplier base but also contribute to building more inclusive and resilient supply chains.</p><p>f. Business Fairs</p><p>Participating in business fairs presents organizations with a dynamic opportunity to meet and evaluate potential diverse suppliers firsthand. These events serve as bustling marketplaces where businesses of all sizes and backgrounds converge to showcase their products and services. By actively participating in business fairs, procurement professionals can engage directly with diverse suppliers, assess their offerings, and establish initial connections. These face-to-face interactions allow for meaningful conversations and exchanges, enabling organizations to gain insights into the capabilities, values, and cultural nuances of potential suppliers. Moreover, business fairs often feature networking sessions, panel discussions, and workshops, providing additional avenues for building relationships and sharing best practices in supplier diversity. By attending these events, organizations demonstrate their commitment to fostering diversity and inclusion in their supply chains while also uncovering new opportunities for collaboration and growth. Overall, participation in business fairs facilitates the discovery of diverse suppliers and fosters the development of mutually beneficial partnerships.</p><p><strong>Small Business/ Small Disadvantaged Business (SB/ SDB) Requirements</strong></p><p>a. Certification</p><p>Ensuring suppliers meet the eligibility criteria for certification as small or disadvantaged businesses is essential for upholding the integrity of supplier diversity initiatives. Certification typically requires businesses to demonstrate ownership and control by individuals from disadvantaged backgrounds, such as minorities, women, veterans, or individuals with disabilities. By verifying that suppliers meet these criteria, organizations can effectively support the inclusion of underrepresented groups in their supply chains and promote economic empowerment within marginalized communities. Additionally, certification serves as a reliable means of identifying suppliers who have undergone a formal validation process, instilling confidence in their ability to contribute to supplier diversity objectives. Through diligent verification of eligibility criteria, organizations can uphold the principles of fairness and equity in their procurement practices, ultimately driving positive social impact and fostering inclusive economic growth.</p><p>b. Registration</p><p>Encouraging suppliers to register with national or local small business agencies is instrumental in facilitating easy identification and engagement within the supplier diversity framework. Database registration with these agencies streamlines the procurement process by providing a centralized repository of information on small and disadvantaged businesses. By actively promoting registration, organizations create opportunities for diverse suppliers to showcase their capabilities and connect with potential buyers more effectively. Moreover, registration with small business agencies often opens doors to additional resources and support services, empowering suppliers to navigate complex procurement landscapes and compete on a level playing field. Through proactive engagement and encouragement of registration, organizations not only strengthen their supplier diversity programs but also contribute to the growth and sustainability of small and disadvantaged businesses in their communities.</p><p>c. Applicable Classifications</p><p>Following the Small Business Administration’s (SBA) classification criteria is essential for accurately identifying eligible small disadvantaged businesses. The SBA provides specific guidelines and criteria that businesses must meet to qualify as small disadvantaged businesses (SDBs). These criteria typically include factors such as the size of the business, its ownership structure, and the socio-economic background of its owners. By adhering to the SBA’s classification criteria, organizations can ensure consistency and fairness in their assessment of suppliers’ eligibility for small disadvantaged business status. This alignment with established standards also enhances transparency and credibility in supplier diversity efforts, fostering trust among stakeholders. Additionally, following the SBA’s criteria enables organizations to leverage existing frameworks and resources provided by government agencies to support the growth and development of SDBs. By embracing these classifications, organizations demonstrate their commitment to promoting diversity and inclusion in their supply chains while also complying with regulatory requirements.</p><p><strong>Program Elements</strong></p><p>a. Top Management Support</p><p>Securing strong support and resources from senior management is vital for supplier diversity success. Leadership commitment sets the tone, showing dedication to diversity and inclusion. This support provides necessary resources and signals the program’s importance to employees and stakeholders. Leadership buy-in empowers coordinators and teams to drive change effectively. Prioritizing supplier diversity inspires engagement across all levels, establishing credibility and accountability for equitable business practices and social responsibility.</p><p>b. Organization Policy</p><p>Developing a comprehensive policy framework is crucial for implementing a supplier diversity program effectively. Detailed policies and procedures outlining program goals, responsibilities, and reporting mechanisms serve as guiding principles for procurement professionals and stakeholders. They ensure consistency and alignment with organizational objectives, clarifying the commitment to supplier diversity and setting clear expectations. Additionally, these policies provide a roadmap for program implementation, outlining steps to achieve diversity goals and monitor progress. By establishing a robust policy framework, organizations demonstrate dedication to fostering diversity and inclusion in their supply chains, promoting transparency and accountability in procurement practices.</p><p>c. Program Coordinator</p><p>Appointing a dedicated program coordinator is vital for a successful supplier diversity program. This coordinator drives the program forward, serving as the main contact for stakeholders. Empowered with decision-making authority and strong leadership skills, they implement initiatives to achieve diversity goals. With their expertise in supplier diversity principles, they ensure continuity and accountability in the program. By entrusting them with oversight, organizations promote collaboration, enhance stakeholder engagement, and foster a culture of diversity and inclusion.</p><p>d. Buyer Diversity Goals</p><p>To foster significant progress in supplier diversity, it’s crucial to define specific diversity objectives for procurement teams and hold them responsible for meeting these goals. This involves integrating diversity targets into performance assessments, ensuring that buyers are appraised based on their contributions to supplier diversity efforts alongside other performance metrics. By establishing clear and measurable diversity objectives, companies provide procurement teams with a roadmap for success and emphasize the importance of diversity in procurement decision-making. Holding buyers accountable for diversity goals ensures their continued focus on promoting supplier diversity and actively seeking out opportunities to engage diverse suppliers. Moreover, linking diversity performance to evaluations underscores the organization’s dedication to diversity and inclusion, promoting alignment across departments and nurturing a culture of accountability and openness. Ultimately, instituting buyer diversity objectives and accountability mechanisms is crucial for ingraining supplier diversity principles into the organization’s fabric and effecting meaningful change in the supply chain.</p><p><strong>Implementation Steps</strong></p><ol><li>Define Objectives and Scope</li></ol><ul><li>Clearly define what the organization aims to achieve with the supplier diversity program.</li><li>Determine the scope, including which categories of suppliers will be targeted and what percentage of procurement spend will be allocated to diverse suppliers.</li></ul><p>2. Develop Policies and Procedures</p><ul><li>Draft comprehensive policies that detail the supplier diversity goals, processes, and expectations.</li><li>Establish procedures for identifying, qualifying, and engaging diverse suppliers.</li></ul><p>3. Secure Management Buy-in</p><ul><li>Present the business case for supplier diversity to senior management.</li><li>Obtain commitment and resources necessary for the successful implementation of the program.</li></ul><p>4. Identify and Engage Diverse Suppliers</p><ul><li>Use directories, business councils, and local chambers of commerce to identify potential suppliers.</li><li>Conduct outreach efforts, including attending business fairs and hosting supplier diversity events.</li></ul><p>5. Support and Develop Suppliers</p><ul><li>Provide training, mentorship, and financial support to help diverse suppliers meet organizational requirements.</li><li>Establish feedback mechanisms to help suppliers improve their performance.</li></ul><p>6. Implement Metrics and Reporting</p><ul><li>Define KPIs and set up Dashboards to track progress against goals.</li><li>Regularly review metrics and make adjustments as needed to stay on track.</li></ul><p>7. Continuous Improvement</p><ul><li>Continuously assess and refine the program based on performance data, feedback from stakeholders, and evolving best practices.</li></ul><p>By following these steps, organizations can develop and implement a supplier diversity program that not only meets regulatory requirements but also drives significant business benefits.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fe00e5dfa63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assess Stakeholder Needs and Integrate Them into Sourcing Plans]]></title>
            <link>https://medium.com/@jwbvjnsddz/assess-stakeholder-needs-and-integrate-them-into-sourcing-plans-c29af57dfaa1?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c29af57dfaa1</guid>
            <category><![CDATA[strategic-sourcing]]></category>
            <category><![CDATA[procurement]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Sat, 08 Jun 2024 08:36:56 GMT</pubDate>
            <atom:updated>2024-06-08T08:36:56.674Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s dynamic business environment, effective procurement is more critical than ever. Understanding and aligning stakeholder needs with sourcing plans can significantly enhance procurement efficiency and contribute to the overall success of the organization. This article explores how to identify stakeholder needs and integrate them seamlessly into sourcing plans, ensuring that procurement activities are both strategic and value-driven.</p><p><strong>Identifying Stakeholders in the Procurement Process</strong></p><p>Who are Stakeholders?</p><ol><li>Stakeholders are individuals or groups with a vested interest in the procurement process. They can be affected by or have the power to influence procurement decisions. Stakeholders are categorized into two main groups: internal and external.</li></ol><p>Internal to the buying organization</p><ul><li>Departments or Business Units directly involved in the Purchase: These are the departments that will directly use or be impacted by the products or services being procured. Examples are Operations, IT, Marketing, Human Resource &amp; Finance.</li><li>Top Management: Senior leadership and executives who oversee the overall performance and profitability of the organization. Their strategic goals and perspectives are crucial for aligning sourcing decisions with the company’s objectives. Examples are CEO, CFO, COO.</li><li>Finance Department: Manages budgets and financial controls related to procurement. Ensures that sourcing plans are financially viable and aligned with fiscal policies.</li><li>Legal and Compliance Department: Ensures all procurement activities adhere to legal and regulatory requirements. Mitigates risk by ensuring contracts and purchases comply with laws and regulations.</li><li>Supply Chain Management: Responsible for the logistics and supply chain aspects of procurement. Ensures smooth and efficient delivery of procured goods and services.</li><li>Procurement/ Purchasing Department: Directly responsible for managing the procurement process from vendor selection to contract negotiation and purchase order management. Central to developing and executing sourcing plans.</li></ul><p>External to the buying organization</p><ul><li>Suppliers/ Vendors: Companies or individuals providing goods and services. Key partners in fulfilling the procurement needs of the organizations.</li><li>Customers: End-users of the organization’s products and services. Their needs and preferences can influence procurement decisions.</li><li>Regulatory Bodies: Government or industry bodies that impose regulations. Compliance with regulations is mandatory for lawful operation.</li><li>Community and Environment: Local communities and environmental groups impacted by the organization’s activities. Sustainability and corporate social responsibility considerations can affect procurement choices</li></ul><p>2. Have a direct need for the procured goods or services.</p><p>3. Provide input on specifications, requirements, and selection criteria (technical).</p><p>4. Have the authority to approve or influence procurement decisions.</p><p>5. Responsible for managing budgets, ensuring legal compliance, and overseeing logistics related to procurement.</p><p><strong>Integrating Stakeholder needs into Sourcing Plans</strong></p><p>This process involves identifying the requirements and expectations of various stakeholders and translating these needs into comprehensive sourcing strategies and plans.</p><ol><li>Aligning with Organizational Goals: Ensure that stakeholder needs are considered at each stage of the sourcing cycle to align with the overall business strategy.</li><li>Market Analysis and Risk Management: Conduct thorough research to identify potential suppliers, market trends, and risks. Also, develop risk mitigation plans to address potential sourcing challenges.</li><li>Supplier Selection Criteria: Develop criteria for selecting supplier based on stakeholder requirements, including quality, cost, reliability, and sustainability.</li><li>Defining Sourcing Objectives and Goals: Set clear objectives and goals for the sourcing plan based on stakeholder needs and organizational strategy.</li><li>Develop an Action Plan: Outline the steps, timelines, and responsibilities for executing the sourcing strategy.</li><li>Communication Plan: Keep all stakeholders informed about the sourcing process, progress, and decisions.</li><li>Implementation and Monitoring: Implement the sourcing plan according to the defined action plan.</li><li>Performance Measurement: Use key performance indicators (KPIs) to monitor the sourcing process and supplier performance.</li><li>Continuous Improvement: Collect feedback from stakeholders and suppliers to continuously refine the sourcing process.</li></ol><p>Incorporating stakeholder needs into sourcing plans is crucial for strategic procurement. By efficiently identifying, collecting, and integrating stakeholder requirements, organizations can improve procurement efficiency, reduce risks, and meet their strategic goals. This systematic approach ensures that procurement activities are aligned with organizational objectives, strengthens relationships with stakeholders and suppliers, and drives long-term success.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c29af57dfaa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SRM: Identify Opportunities and Benefits for Rationalizing Supply Base]]></title>
            <link>https://medium.com/@jwbvjnsddz/srm-identify-opportunities-and-benefits-for-rationalizing-supply-base-2a0f5ca24082?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a0f5ca24082</guid>
            <category><![CDATA[procurement-management]]></category>
            <category><![CDATA[procurement]]></category>
            <category><![CDATA[supplier-relationship]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Sat, 25 May 2024 14:31:03 GMT</pubDate>
            <atom:updated>2024-06-04T13:14:18.406Z</atom:updated>
            <content:encoded><![CDATA[<p>Supply base optimization, also known as rationalization, involves determining the optimal mix and number of suppliers to effectively fulfill the organization’s needs. Within procurement, it’s crucial to maintain an ongoing process that aims for the ideal combination of capable suppliers, regardless of their geographical location.</p><p>Optimization goes beyond simply adding or reducing suppliers; it may also involve switching suppliers when necessary. Therefore, optimizing or rationalizing the supply base doesn’t necessarily entail reducing the number of suppliers. As organizations increasingly rely on a smaller pool of suppliers, the selection process becomes even more critical.</p><p>To ensure that the remaining suppliers meet the organization’s requirements and uphold high standards of quality and reliability, effective supplier management strategies must be implemented. This includes thorough evaluation and continuous monitoring of supplier performance.</p><h3><strong>1. SWOT Analysis</strong></h3><p>A commonly utilized approach for assessing the supply base is through SWOT analysis. This acronym stems from the key components of this evaluation method: assessing the organization’s internal strengths (S) and weaknesses (W), and examining the external environment for opportunities (O) and threats (T)</p><h3><strong>2. Data Mining tools</strong></h3><p>To optimize the supply base, it’s essential to thoroughly assess the performance history of each supplier to categorize them effectively. Data mining plays a pivotal role in this optimization or rationalization process, involving the meticulous extraction of pertinent information from the vast datasets associated with each supplier. This data can be sourced from various channels such as the ERP system, accounting records, supplier portals, commodity councils, and direct communication with suppliers, among others. Once the relevant information is gathered, the next crucial step is to classify the suppliers accordingly.</p><h3><strong>3. Supply Base Rationalization</strong></h3><p>It identifies and sustains the optimal number of suppliers per category or item, considering the risk and value associated with each. Initially, rationalization typically involves reducing the size of the supply base. Over time, the emphasis shifts towards effectively managing the supply base size, especially in response to evolving market dynamics. This approach helps minimize the costs associated with qualifying and managing extensive supplier networks. Key factors contributing to the success of supply base rationalization or optimization encompass:<br> • Allowing adequate time for the process<br> • Using cross-functional teams <br> • Implementing a supplier measurement system and data warehouse<br> • Developing a strategy that considers optimization goals<br> • Having an articulated overall supply base vision with management support.</p><h3><strong>4. Supply Categories</strong></h3><p>Not all suppliers are alike. The nature of the relationship between the organization and its suppliers, as well as the degree of scrutiny and authorization needed for each supplier and purchase, can vary. Below are the common categories of suppliers.<br> • <strong><em>Approved Suppliers </em></strong>— suppliers have passed a review and evaluation process and are approved for certain types and levels of purchases.<br> • <strong><em>Preferred Suppliers </em></strong>— are a group of suppliers that an organization has determined meets its expectations for quality, delivery, and/ or prices and that are able to respond to unexpected changes. Often, the organization establishes master price agreements with preferred suppliers. For items where preferred suppliers have been identified, the entire organization is required to by from these suppliers.<br> • <strong><em>Partnered Suppliers </em></strong>— are suppliers that the procurement function has developed a close relationship. This close relationship is developed between a buyer and seller in order to attain some advantages from each other in a positive way. A partnership in this context does not imply a legal relationship. Buyer-seller partnerships may be of operational importance, such as a long-term, single-source with an office supplier or of strategic importance, such as a long-term, single-source relationship with a supplier of a good or service of strategic importance.<br> • <strong><em>Certified Suppliers</em></strong> — have completed a process of certification that qualifies them to provide a certain service or product. For example, an organization may require its part suppliers to complete a certification process before being allowed to supply parts. Certification often implies a certain level of quality or capability in a supplier.<br> • <strong><em>Prequalified Suppliers</em></strong> — qualification requires that a supplier pass a review and approval process in order to offer a certain product or service to the organization. Often several suppliers are prequalified so that the supply management professional has a choice of suppliers.<br> • <strong><em>Certifiable Suppliers </em></strong>— are understood to be able to pass the certification process but have not yet completed the process.<br> • <strong><em>Disqualified Suppliers </em></strong>— are individuals, companies or other organizations that fail to meet the standards established by a buying organization and are barred from competing for that organization’s business.<br> • <strong><em>Debarred Suppliers </em></strong>— are individuals companies or other organizations that are suspended, usually on a temporary basis, from selling or otherwise doing business with a buying organization.<br> • <strong><em>Diverse Suppliers</em></strong> — are those that meet the requirements of the diversity programs defined by the organization.</p><h3><strong>5. Supplier Segmentation</strong></h3><p>By adopting a standardized model, procurement experts employ a uniform process and technological solution across all suppliers. Consequently, they risk losing the ability to effectively engage with their suppliers, as proposed solutions may either be overly intricate or overly simplistic for their requirements. Instead, organizations should strategically evaluate each supplier to gauge how their products contribute to the core capabilities and competitive edge of the purchasing entity. Categorizing suppliers based on competencies enables the organization to efficiently leverage relationships throughout the enterprise.</p><p>Procurement Strategy Council Research identified there problem areas that organizations lacking a sound supplier segmentation strategy encounter:</p><ul><li><strong><em>Difficulty in evaluating supplier performance and the impact of the supplier relationship</em></strong> — viewing all suppliers as a single entity makes it difficult for the organization to identify opportunities for supplier consolidation and augmentation. The organization is unable to assess the major risks and exposures that the supplier relationship brings to its performance. Failing to differentiate between suppliers prevents the organization from anticipating an individual supplier’s actions and reacting properly to particular dimensions of a supplier’s performance. When suppliers are not provided specific criteria, it is difficult for them to evaluate their product’s performance and tailer their prices and service offerings to the needs of the organization.</li><li><strong><em>Inability to focus organization resources to maximize the supply base</em></strong> — strategic supplier selection is an important process for any organization. Research indicates that organizations often commit thousands of dollars to startup of a new strategic supplier relationship, in costs such as contract management, logistics development, and integration of technology. Because supplier relationships are costly to set up and maintain, organizations must allocate resources wisely to avoid the costs of changing suppliers that result from inappropriate supplier selection. Because extensive expenditures of time and resources are required to commit to an alliance, organizations must limit the number of successful alliances they attempt to maintain, in order to add value to supplier relationships.</li><li><strong><em>Ineffective management of suppliers as an undifferentiated group</em></strong> — Without segmenting the supplier base, the organization cannot easily determine when a supplier fails to deliver a product or service adequately. Similarly, the organization cannot recognize suppliers that exceed expectations, and it fails to provide incentives for suppliers to improve performance levels. The management of suppliers as an undifferentiated group rests on the false assumption that all suppliers require similar levels of communication, managerial assistance, exchange personnel and relation-specific investments.</li></ul><p>Through strategic supplier analysis, procurement professionals can assess how each supplier contributes to the organization’s core competencies. Segmenting suppliers and dedicating additional time and expertise to strategic relationships bolster the organization’s capacity to attain its business objectives.</p><p>Procurement Strategy Council research indicates that procurement professionals should consider using the following important tactics for segmenting suppliers:</p><ul><li><strong><em>Determine each supplier’s potential by identifying criteria for supplier segmentation</em></strong> — should analyze suppliers based on their global presence, financial stability, technological operations, quality of service and nature of competitive pricing. Employing formal supplier selection criteria provides clarity. It also encourage prospective suppliers to meet the high standards required, and improve service and product offerings.</li><li><strong><em>Segment suppliers according to the strategic value of the relationship</em></strong> — Pinpointing strategic suppliers and allocating more time and expertise to these suppliers enables the organization to achieve significant savings by using resources strategically for maximum value. The organization should provide different levels of assistance to suppliers depending on the nature of the product and value of the relationship, to maximize the potential of the supplier base while minimizing costs.</li><li><strong><em>Invest resources in the development and use of effective supplier management tools</em> </strong>— Aligning suppliers with sourcing strategies and tailoring supplier management tools to the organization’s sourcing strategies allow grater investments to value-added assets. Coordinating relationship management tools with the purchase patterns of suppliers encourages higher levels of information and trust, enhancing the organization’s ability to achieve strategic goals.</li></ul><p>Segmenting suppliers based on the significance of their goods and services is a widespread approach. Procurement experts typically assess the revenue generated and overall appeal of each supplier, prioritizing those that contribute substantial revenue or offer additional advantages. These suppliers are often receptive to negotiations aimed at retaining or securing their services. Effective supplier management has become vital to an organization’s competitiveness due to its significant influence on quality, costs, delivery, and profitability. From both practical application and academic inquiry, two distinct supplier management models have emerged, reflecting differing perspectives on how to optimize supplier relationships.</p><p>Traditional supplier relationship models may be divided into the following categories:<br> <em>a. </em>The arms-length model advocates minimizing dependence on suppliers by avoiding any form of commitment.<em><br> b. </em>In the partner model, organization share information and coordinate interdependent task by developing long-term relationships, to invest in relationship specific assets that lower costs, improve quality and speed product development.</p><p>Regardless of the approach, organizations establish supplier relationships guided by criteria such as product or service criticality, risk assessment, market sector prominence, and expenditure volume. Arm’s-length relationships and supplier partnerships differ significantly across various dimensions, including contract duration, relationship continuity, information exchange, and trust level. Arm’s-length relationships typically involve short-term contracts, frequent re-bidding, limited information sharing, and lower levels of trust. Conversely, partner suppliers often secure longer-term contracts due to their likelihood of consistently winning business from the purchasing organization.</p><h3><strong>Supplier Relationship Model: Organizations rely on collaborative relationships</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*8e9UgigOi0xAGagJFiJ5uQ.png" /><figcaption>image by the author</figcaption></figure><p>Strategic alliance relationships imply a long-term commitment and strategically are the most important relationships because the suppliers involved are of the highest business importance. Strategic relationships also involve the sharing of cost data and cross investment. Alliance partners often provide the organization a competitive advantage by providing crucial technology or superior integration with its processes.</p><p>Collaborative relationships are less important on a strategic level and are less volume. There is generally sharing no sharing of cost data or cross-investment. A continuing relationship with collaborative segments is desirable, since suppliers may elevate to the strategic alliance category with improved performance.</p><p>The transactional segment includes suppliers used for standard supplies. Price is the main factor considered when working with commodity suppliers. Transactional relationships are least important strategically and are typically the lowest in physical and spend volume. Low- value purchases may include purchases that are high in unit cost but low in strategic important or required infrequently.</p><h3>ABC Supplier Relationship Model: Suppliers segmented according to value and spend</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*TEvYt_-BKGdB6u9lB4aYeQ.png" /><figcaption>image by the author</figcaption></figure><p>Supplier segmentation processes include identifying important suppliers, developing appropriate actions and managing transactions. The following steps outline the supplier segmentation process:</p><ul><li>Identify the main strategies of the business to determine the supplier relationships that are essential to the overall organization.</li><li>Review strategically important commodities and services and determine suppliers’ long-range potential, technological innovation and possible changes in offerings.</li><li>Identify suppliers that have the capability (or potential capability) to meet strategic supply requirements. Coordinate the supplier base across the organization.</li><li>Develop a supplier segmentation plan, including implementation steps and management tools.</li></ul><p>Here are some pictures of the dashboard I have created, implementing the ABC classification for suppliers with a current purchase agreement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*eOG1oINEQiZBjit0s76i7Q.png" /><figcaption>image by the author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXGejiKss9nhn_HGgQJfHQ.png" /><figcaption>image by the author</figcaption></figure><p>Dashboard link: <a href="https://public.tableau.com/app/profile/herwin.abedes/viz/supplier_segmentation/Dashboard1">Click here</a></p><h3>Bibliography</h3><p>According to a report by The Procurement Strategy Council (2002), titled ‘Supplier Relationship and Segmentation Models: Project Support Memorandum,’...</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a0f5ca24082" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consolidate by Commodity Description or by Vendor Name?]]></title>
            <link>https://medium.com/@jwbvjnsddz/consolidate-by-commodity-description-or-by-vendor-name-08f715a1ece6?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/08f715a1ece6</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[procurement]]></category>
            <category><![CDATA[tail-spend]]></category>
            <category><![CDATA[spend-analysis]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Fri, 06 Oct 2023 03:17:13 GMT</pubDate>
            <atom:updated>2023-10-06T03:19:48.040Z</atom:updated>
            <content:encoded><![CDATA[<h3>Consolidate by Commodity Description or by Vendors?</h3><p>From our dataset <a href="https://github.com/sedeba19/Tail-Spend-Analysis/blob/main/b.%20consolidate-by-description-or-by-vendors/df-preprocessed-main.xlsx">here</a>, we are trying to identify and generate cost savings opportunity on vendors &amp; commodity (item) description but how do we consolidate our data, should we go with consolidating ‘by item description or should we go with consolidating ‘by vendors’?</p><p>On this study, I will show you how and what are the differences of those two questions, what approaches and insights are available.</p><p>Here is a simple rule to remember before we proceed with the following:</p><blockquote>We should always look for smallest pool with highest value to reduce.</blockquote><p>I am saying that, we should always aim to look for the lowest or smallest pool either vendor or items with highest value to reduce.</p><p>We have two approaches here:</p><ol><li>High frequency PO (More than 12) &amp; High number of vendors (More than 5)| Strategy: Consolidate by item description</li><li>High number of POs (Between 1 and 5) and Multiple Vendors(Between 1 and 5) for Same items| Strategy: Consolidate by Vendors</li></ol><p>Let’s start with</p><h4>1. High frequency PO (More than 12) &amp; High number of vendors (More than 5)| Strategy: Consolidate by Commodity Description</h4><p>I filtered out using pivot table the conditions stated on this section from our dataset and we come up with this result. To find our smallest pool with the highest value, we need to see our two possible options.</p><h4>Option a. Arrange by Vendor Name</h4><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*4LwAIqxVoWbZn2RWXjILvg.png" /></figure><p>Here is the top 10 Vendor based on the value spend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*jGkKTGwllL2lUFbaZ9TceQ.png" /></figure><p>We have a summary of 975 vendor names (LGL_NM) with a total of $13,504,328.6 spend for top 10 vendors.</p><h4>Option b. Arrange by Commodity Description</h4><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*DeYXhyAzHkWmzPo9ktTkSg.png" /></figure><p>Here is the top 10 Commodity Description based on the value spend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*C8wo0uUTs37aBJ4vW8Mu9A.png" /></figure><p>We have a summary of 222 commodity items with a total of $16,011,147.47 spend for top 10 commodity items.</p><p>For each of the commodity description shown here, we have more than 5 vendors. So we can possibly do a reverse auction for these items.</p><p>Opting for Option b presents a stronger opportunity for spend consolidation with a smaller list of items (222 items for Option b compared to 975 vendors for Option a). Given this, I am inclined to select Option b as the foundation for my strategy. Option b aligns well with the concept of a reverse auction, allowing us to conduct competitive bidding with vendors and ultimately choose only one or two vendors. This approach not only offers the potential for more favorable negotiations and cost savings but also streamlines our vendor database, focusing it on these select items.</p><h4>2. High frequency PO (More than 12) and Multiple Vendors(Between 1 and 5) for Same items| Strategy: Consolidate by Vendors</h4><p>We are now poised to analyze the image below, with our focus on consolidating it by vendors. Employing the same strategy outlined earlier, I have generated the following image as a result.</p><figure><img alt="image.png" src="https://cdn-images-1.medium.com/proxy/1*k3F2qeC8pk1kRcYjn4OCZA.png" /></figure><p>Let’s keep in mind that the dataset we’re working with exhibits specific traits. These include the absence of a contract, a significant volume of purchase orders, and each commodity being procured from a range of two to five vendors. These characteristics collectively create an ideal scenario for instigating contract negotiations, presenting a valuable opportunity to achieve cost savings by formalizing contractual agreements.</p><p>Here is the top 10 spend consolidated by vendors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*qY1lt57hDWEJWEsPfrL7GQ.png" /></figure><p>We have a summary of 407 vendor names with a total of $15,860,826.78 spend for top 10 vendors.</p><p>We have discussed the two spend as shown on the image below and highlighted with yellow.</p><figure><img alt="image.png" src="https://cdn-images-1.medium.com/proxy/1*M7QtGnv3qzh0exbJPl5t3g.png" /></figure><p>Remember, the dataset that we are studying for cost saving opportunity has the following characteristics:</p><ol><li>Contract is not yet made</li><li>High number of POs</li><li>Each commodity is being procured with at least 2 and a maximum of 5 number of vendors</li></ol><p>This is an ideal condition to call for a contract and make use of the cost saving opportunity.</p><p>The files are all uploaded <a href="https://github.com/sedeba19/Tail-Spend-Analysis/tree/main/b.%20consolidate-by-description-or-by-vendors">here</a></p><p>Thank you so much for your reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08f715a1ece6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyze and Identify Cost Savings for Single-Vendor Items]]></title>
            <link>https://medium.com/@jwbvjnsddz/analyze-and-identify-cost-savings-for-single-vendor-items-20176c876329?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/20176c876329</guid>
            <category><![CDATA[tail-spend]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[procurement]]></category>
            <category><![CDATA[spend-analysis]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Wed, 04 Oct 2023 01:59:37 GMT</pubDate>
            <atom:updated>2023-10-04T01:59:37.394Z</atom:updated>
            <content:encoded><![CDATA[<p>I have numerous items with only one supplier. Can I still explore cost-saving opportunities?</p><p>Certainly! I’ll demonstrate how you can uncover these opportunities.</p><p>The data used for this study is uploaded on this <a href="https://isscgt-my.sharepoint.com/:x:/g/personal/herwinabedes_isscgt_onmicrosoft_com/EWx7XNjPfDZGu7H48VSUumwBB2LjvV-G3eQIPHvZ5f34rQ?e=pQmZNu">link</a>.</p><p>We are about to do the process of identifying “Low-Value Sourcing” that can be consolidated. But how do we determine if it qualifies as low-value sourcing? We look for single-source suppliers. I’ll guide you through the process using MS Excel.</p><h4>Data Preprocessing</h4><p>To move forward and attain our specific objectives for this study, we must initiate an initial data exploration using MS Excel’s Pivot Table feature.</p><p>Our initial step involves creating a pivot table to generate a summary of the spending amounts that lack a contract. In our dataset, these are represented as ‘Contract NOT Available’ in the contract column.</p><p>Follow below steps carefully.</p><blockquote>a. Rows: Select &amp; input contract, spend_class, PO Availability<br> b. Values: Select &amp; input ITM_TOT_AM (Note: I renamed it to Total values)</blockquote><p>We will generate the outcome based on the image below.</p><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*r6_rmn85CY6F-s_ETauYpg.png" /></figure><p>When we are looking for new contract consolidation opportunities, we should not limit ourselves just to Tail Spend only. Therefore, I will find the consolidation opportunity for both Major Spend and Tail Spend together (highlighted in yellow).</p><p>We will make use of our “PO Class” and “Vendor Class” columns to analyze and determine the number of vendors &amp; PO associated with each item.</p><p>For image below, we have added the “PO Class” on our pivot table.</p><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*Bo2lCe9cCRBDNJxXPVq7vQ.png" /></figure><p>I added some details into our pivot table.</p><blockquote>a. Filters: contract and select only to ‘Contract NOT Available’.<br> b. Filters: spend_class and select all.<br> c. Rows: PO Class &amp; PO_availability<br> d. Values: ITM_TOT_AM (changed name to ‘Total Value’), Count of COMMODITY_DESCRIPTION, &amp; Count of Number of POs</blockquote><p>Below image is the result.</p><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*L3BJKLOOVM0At_kwneUzHA.png" /></figure><p>If you followed along, this will be the pivot table set up.</p><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*9Mx-Kj5nJiPMNlE_fs82Gg.png" /></figure><p>To provide more details, we will proceed by introducing ‘Vendor Class’ on pivot table column to categorize values in the following manner:</p><blockquote>a. Single Vendor<br> b. Between 1 &amp; 5 Vendors<br> c. More than 5 Vendors</blockquote><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*J89nWJcpM3j3FmsTRZvPIg.png" /></figure><p>Here is the pivot table set up for the above image.</p><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*-gXd4pdWbXgtrLoSdaBh0A.png" /></figure><p>We’re good to go! This table serves the purpose we outlined from the outset. It will be instrumental in identifying opportunities for consolidation. Let’s begin by familiarizing ourselves with the table’s structure.</p><p>In the rows, we observe a classification based on PO class, offering three alternatives (single PO, between 1 and 12, and more than 12). Within the columns, there’s a two-tier structure. The upper tier comprises Vendor Class, presenting three choices (Single Vendor, Between 1 &amp; 5, and More than 5). The lower tier displays expenditure and item counts. This data equips us to explore various scenarios, including:</p><ol><li>Items with Single PO &amp; Single Vendor and their Spend.</li><li>Items with High Number of POs (More than 12) and High Number of Vendors (More than 5) and their Spend.</li></ol><p><strong>1. Single Vendor — Single PO | Strategy: Consolidate by Vendor</strong></p><p>Let us now focus on our 1st area to explore cost-savings opportunities. That is on the items that have a Single Vendor and Single PO scenario. The below mentioned picture is a subsection of our pivot table and clearly highlights the Single Vendor-Single PO case.</p><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*JiHQqGOoPfNRyaCBQjPopg.png" /></figure><p>We can see on the image, the single source-cost breakdown with respect to each supplier and commodity description. Please note that certain columns have been omitted for the sake of clarity in this illustration. I have added the Count of Commodity Description and the Count of Number of PO for us to determine whether this represents a one-to-one relationship. In such a relationship, each supplier would have one unique commodity description and one unique PO.</p><p><strong>2. Single Vendor- High Number of PO (“More than 12 POs”) | Strategy: Consolidate by Vendor</strong></p><p>We now move to our second opportunity. Single Vendor- More than 12 POs. I have followed the same approach as mentioned above.</p><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*GsqFDraF42F_shqHhVgf_w.png" /></figure><h3>Conclusion</h3><p>By employing this strategy, we’ve established a maximum limit of 12 vendors for a given commodity. Here are a few potential benefits of this decision:</p><ol><li>Cost control</li><li>Quality Assurance</li><li>Relationship Building</li><li>Risk mitigation</li><li>Strategic Sourcing</li></ol><p>Please be aware that this pertains exclusively to tail spend management: Single vendor. In this context, we are aiming to capitalize on cost-saving opportunities (21% of the tail spend- Single source) and develop strategies to efficiently manage low-risk spending, all while enhancing supplier accountability. By conducting a thorough analysis of these areas, including factors like purchase dates and locations, we can proactively prepare and establish contracts for improved management.</p><p>Below are the images or list of purchase orders that highlight the Top 10 purchase orders for items meeting two distinct criteria:</p><ol><li>Top 10 purchase orders for items with a single purchase order and a single vendor, along with their corresponding spend amounts.</li></ol><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*sBiW2pnBl72vh1NzT2FRdw.png" /></figure><ol><li>Top 10 purchase orders for items with a high number of purchase orders (more than 12) and a high number of vendors (more than 5), along with their corresponding spend amounts.</li></ol><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*QW3BpKYEjFTMOgebDZKJpA.png" /></figure><p>Some data visualizations.</p><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*hm_Qt_fvlwnvA_QJGbWf9Q.png" /></figure><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*SGGH8vPtCsFrS3sSHuCBgw.png" /></figure><p>If you’d like to explore more of my work or have any questions, please don’t hesitate to reach out. Thank you for taking the time to read!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20176c876329" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling the Hidden Potential of Tail Spend Analysis: A Comprehensive Guide to Excel Data…]]></title>
            <link>https://medium.com/@jwbvjnsddz/unveiling-the-hidden-potential-of-tail-spend-analysis-a-comprehensive-guide-to-excel-data-b81409fb3d44?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b81409fb3d44</guid>
            <category><![CDATA[procurement]]></category>
            <category><![CDATA[tail-spend]]></category>
            <category><![CDATA[spend-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Mon, 02 Oct 2023 06:38:57 GMT</pubDate>
            <atom:updated>2023-10-02T06:38:57.889Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unveiling the Hidden Potential of Tail Spend Analysis: A Comprehensive Guide to Excel Data Preparation with Python</h4><h4>Table of Contents</h4><ul><li><a href="#intro">📝 Introduction</a></li><li><a href="#objective">🧐 Objective</a></li><li><a href="#preparation">📑 Data Preparation</a></li><li><a href="#result">🕵️‍♂️ Result</a></li><li><a href="#dataset">⚙️ Generating a new Dataset</a></li><li><a href="#conclusion">✍🏻 Conclusion</a></li></ul><h3>📝 Introduction</h3><p>Tail Spend Analysis has a history dating back to World War II, and it has been elucidated through various guidelines. Perhaps the most renowned of these is the 80/20 rule, also known as the Pareto principle. While having a conceptual understanding is invaluable, the practical implementation of such principles presents its own set of challenges.</p><p>In the realm of procurement, datasets are frequently beset with issues of cleanliness, and a multitude of complexities often render the straightforward application of the 80/20 rule unfeasible. To address these challenges, a plethora of spend analysis tools have emerged in the market. Many of these tools boast advanced machine learning or AI capabilities, promising seemingly magical cost-saving outcomes. However, it’s essential to note that reality doesn’t always align with these claims.</p><p>The true identification of cost-saving opportunities hinges not solely on the capabilities of the tool but on the skill set of the buyer. While these tools can certainly streamline the process, the buyer’s ability to discern what they are seeking within the data remains paramount. In essence, no tool can replace the buyer’s expertise in this regard.</p><p>Join us on a journey through this comprehensive guide as we uncover the latent potential within tail spend management, leveraging the formidable capabilities of Python to prepare Excel data.</p><h3>🧐 Objective</h3><p>Before we proceed to define our objective, let’s begin by addressing the question: What is tail spend?</p><p>Tail spend is a term used to describe the portion of an organization’s expenditures allocated to purchases that represent roughly 80% of transactions but contribute only about 20% to the total spend volume. To help visualize this concept, refer to the accompanying image for a practical example.</p><figure><img alt="Alt text" src="https://cdn-images-1.medium.com/proxy/1*14Y8Dw57qNh-LKAjFV3fzg.png" /></figure><p>Source: <a href="https://simfoni.com/tail-spend-management-guide/">https://simfoni.com/tail-spend-management-guide/</a></p><p><strong>Objective</strong></p><p>The objective of this study is to chart the data for Hidden Tail from our given dataset using Python.</p><h3>📑 Data Preparation</h3><p>Prior to initiating any analytical activities, it is imperative to gain a comprehensive understanding of the dataset in its current state and the information it encompasses. This preliminary step is mandatory and serves as the foundation upon which we can craft an effective strategy for further dataset processing. Below, I outline a series of swift assessments that I routinely conduct before embarking on any analysis:</p><ol><li><strong>Data Completeness:</strong> Verify if the dataset is complete and if there are any missing values that need to be addressed.</li><li><strong>Data Quality:</strong> Assess the overall quality of the data, including potential errors, inconsistencies, or outliers.</li><li><strong>Data Structure:</strong> Understand the structure of the dataset, including the types of variables, their formats, and relationships between them.</li><li><strong>Data Distribution:</strong> Examine the distribution of key variables to identify potential patterns or anomalies.</li><li><strong>Data Relevance:</strong> Determine if the dataset contains the necessary information for the intended analysis or if additional data sources are required.</li><li><strong>Data Documentation:</strong> Review any available documentation or metadata to understand the context and source of the data.</li><li><strong>Data Security:</strong> Ensure that data handling and analysis comply with data security and privacy regulations.</li><li><strong>Data Exploration:</strong> Conduct initial data exploration to identify potential trends or insights that may guide the analysis.</li></ol><p>By diligently conducting these checks, we establish a solid groundwork for robust and informed data analysis and strategy development.</p><p>The dataset used for this study is in Github, you may find the link here: <a href="https://github.com/sedeba19/Tail-Spend-Dataset">Tail Spend Dataset</a></p><p>We are about to add now new columns to increase our dataset’s depth and range of information. These additional columns are:</p><ul><li><strong>Spend Class:</strong> is to separate Major Spend from Tail Spend as a group. By successfully dividing Major spend commodity items from Tail spend item, we can develop different strategies for both accordingly. To decide whether a particular commodity item belongs to either Tail or Major spend category, we will use our good old Pareto or 80/20 principle. Every commodity item that belongs within the Top 80% spend class will be labeled as Major. Every commodity item that belongs to the bottom 20% spend class will be labeled as Tail Spend.</li><li><strong>Contract:</strong> measures whether a particular commodity item has been sourced from a via contract or not (i.e. Spot Purchase). The objective is to find commodities that are produced outside of the Contracts or commodities that do not have any contract. We should always strive for securing have a longer duration and often with fixed quantity and/or price commitments, the buyer is likely to get a better price per unit that from that Individual/Spot purchase. Like Spend Class, this label is also a binary field. For every item that is purchased, if the contract number exists, we will write “Contract Avaialable, otherwise, we will write “Contract Not Available”</li><li><strong>PO Availability:</strong> measures whether a particular commodity item has been purchased via a Purchase Order or not. Please note purchases conducted with a PO are often termed as “Maverick Purchases” and the spend value under such purchases is often called “Maverick Spend”. The best practice suggest minimizing the Maverick Spend as much as possible. By adding this label to our dataset, our objective is to find the following answers:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*ISfa8i3vKqK9XBb7cv5jXg.png" /></figure><ul><li><strong>Number of Vendors:</strong> measures the count of vendor for every commodity item in the dataset. We need this for further segmentation into the following: High number of vendors, Medium number of vendors, and the low number of vendor classes. This is aid us to form different procurement strategies for commodity items belonging to different classes. As an example:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*bjPRGgLuCc_gS1gHaO71rw.png" /></figure><ul><li><strong>Vendor Classification:</strong> is to measure the number of vendor available in a certain type of commodity. By using this, we can get insights on our supplier base. Commodities with a single vendor might be riskier due to supplier dependency, while with multiple vendors provide more flexibility. One benefit example of this is.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*ggUhLCrcQBIu13OmqSLQKA.png" /></figure><ul><li><strong>PO Classification:</strong> is to measure and analyze the spending patterns. Such as for product or service categories helps in monitoring and controlling expenditues within specific categories, ensuring compliance with budgetary constraints.</li></ul><pre># Import the libraries that would be needed for the data exploration<br>import pandas as pd<br>import matplotlib.pyplot as plt</pre><pre>file_dir = r&#39;/home/sedeba19/medium_content/ai_procurement/data/spend_tail_dataset.xlsx&#39;<br>df = pd.read_excel(file_dir)</pre><pre>df.shape</pre><pre>(72853, 21)</pre><pre>df.columns</pre><pre>Index([&#39;COMMODITY&#39;, &#39;COMMODITY_DESCRIPTION&#39;, &#39;EXTENDED_DESCRIPTION&#39;,<br>       &#39;QUANTITY&#39;, &#39;UNIT_OF_MEASURE&#39;, &#39;UNIT_OF_MEAS_DESC&#39;, &#39;UNIT_PRICE&#39;,<br>       &#39;ITM_TOT_AM&#39;, &#39;MASTER_AGREEMENT&#39;, &#39;CONTRACT_NAME&#39;, &#39;PURCHASE_ORDER&#39;,<br>       &#39;AWARD_DATE&#39;, &#39;VENDOR_CODE&#39;, &#39;LGL_NM&#39;, &#39;AD_LN_1&#39;, &#39;AD_LN_2&#39;, &#39;CITY&#39;,<br>       &#39;ST&#39;, &#39;ZIP&#39;, &#39;CTRY&#39;, &#39;DATA_BUILD_DATE&#39;],<br>      dtype=&#39;object&#39;)</pre><pre>comm_desc_sum = df.groupby(&#39;COMMODITY_DESCRIPTION&#39;)[&#39;ITM_TOT_AM&#39;].sum().reset_index()<br>comm_desc_sum[:5]</pre><figure><img alt="png" src="https://cdn-images-1.medium.com/proxy/1*ljPGRpe2CJq4kSI2M0tC6g.png" /></figure><pre>total_sum = comm_desc_sum[&#39;ITM_TOT_AM&#39;].sum()<br>comm_desc_sum[&#39;% Total Running In&#39;] = 0<br>comm_desc_sum.head()</pre><figure><img alt="png" src="https://cdn-images-1.medium.com/proxy/1*nH4jjjJWfPW4BuKEHW_EdA.png" /></figure><pre>comm_desc_sum[&#39;temp&#39;] = 0<br><br>length = len(comm_desc_sum)<br>comm_desc_sum.loc[0, &#39;temp&#39;] = comm_desc_sum.loc[0, &#39;ITM_TOT_AM&#39;]<br><br>for i in range(1, length):<br>    comm_desc_sum.loc[i, &#39;temp&#39;] = comm_desc_sum.loc[i - 1, &#39;temp&#39;] + comm_desc_sum.loc[i, &#39;ITM_TOT_AM&#39;]</pre><pre>/tmp/ipykernel_58262/392091930.py:4: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value &#39;337.92&#39; has dtype incompatible with int64, please explicitly cast to a compatible dtype first.<br>  comm_desc_sum.loc[0, &#39;temp&#39;] = comm_desc_sum.loc[0, &#39;ITM_TOT_AM&#39;]</pre><pre>comm_desc_sum[&#39;ITM_TOT_AM&#39;].sum()<br>for i in range(length):<br>    comm_desc_sum[&#39;% Total Running In&#39;][i] = (comm_desc_sum[&#39;temp&#39;][i] / comm_desc_sum[&#39;ITM_TOT_AM&#39;].sum()) * 100</pre><pre>/tmp/ipykernel_58262/863514314.py:3: SettingWithCopyWarning: <br>A value is trying to be set on a copy of a slice from a DataFrame<br><br>See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy<br>  comm_desc_sum[&#39;% Total Running In&#39;][i] = (comm_desc_sum[&#39;temp&#39;][i] / comm_desc_sum[&#39;ITM_TOT_AM&#39;].sum()) * 100<br>/tmp/ipykernel_58262/863514314.py:3: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value &#39;6.550441559317351e-05&#39; has dtype incompatible with int64, please explicitly cast to a compatible dtype first.<br>  comm_desc_sum[&#39;% Total Running In&#39;][i] = (comm_desc_sum[&#39;temp&#39;][i] / comm_desc_sum[&#39;ITM_TOT_AM&#39;].sum()) * 100</pre><pre>comm_desc_sum[&#39;% Total Running In&#39;].max()</pre><pre>100.00000000000009</pre><pre>comm_desc_sum[&#39;% Total Running In&#39;][:5]</pre><pre>0    0.000066<br>1    0.007546<br>2    0.009686<br>3    0.010527<br>4    0.019522<br>Name: % Total Running In, dtype: float64</pre><p><strong>Spend Class:</strong></p><p>We are about to add a new column (spend_class) in the dataset that will serve as an identifier for the distribution of spending across the dataset. Specifically, we will be introducing the ‘% Total Running’ column. Items falling within the range of 0% to 80% (the top 80% of spending) will be designated as ‘Major Spend’ items, while those falling within the range of 80% to 100% (the bottom 20% of spending) will be categorized as ‘Tail Spend.’</p><pre>comm_desc_sum[&#39;spend_class&#39;] = 0<br>for i in range(0, length):<br>    if comm_desc_sum[&#39;% Total Running In&#39;][i] &lt;= 80:<br>       comm_desc_sum.at[i, &#39;spend_class&#39;] = &#39;major_spend&#39;<br>    else:<br>       comm_desc_sum.at[i, &#39;spend_class&#39;] = &#39;tail_spend&#39;</pre><pre>/tmp/ipykernel_58262/1542164856.py:4: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value &#39;major_spend&#39; has dtype incompatible with int64, please explicitly cast to a compatible dtype first.<br>  comm_desc_sum.at[i, &#39;spend_class&#39;] = &#39;major_spend&#39;</pre><pre>comm_desc_sum.tail()</pre><figure><img alt="png" src="https://cdn-images-1.medium.com/proxy/1*6_8Gq54ufrO4g3Sc9yoWpg.png" /></figure><pre>comm_desc_sum.head()</pre><figure><img alt="png" src="https://cdn-images-1.medium.com/proxy/1*xtsfCdBeBpGSD3il4Z5OtA.png" /></figure><pre>comm_desc_sum.drop(&#39;temp&#39;, axis = 1, inplace = True)<br># Assign &#39;spend_class&#39; in df based on &#39;COMMODITY_DESCRIPTION&#39; in comm_desc_sum<br>df[&#39;spend_class&#39;] = df[&#39;COMMODITY_DESCRIPTION&#39;].map(comm_desc_sum.set_index(&#39;COMMODITY_DESCRIPTION&#39;)[&#39;spend_class&#39;])</pre><pre>df.shape</pre><pre>(72853, 22)</pre><pre>len(df)</pre><pre>72853</pre><pre>df[&#39;spend_class&#39;].value_counts()</pre><pre>spend_class<br>major_spend    61861<br>tail_spend     10992<br>Name: count, dtype: int64</pre><p>We can observe the aggregate values (count) of major spend and tail spend.</p><ul><li>Major spend (84.912%) typically encompasses substantial and strategically managed procurement activities, often entailing larger contracts or purchases.</li><li>In contrast, tail spend (15.088%) comprises numerous smaller, often impromptu purchases that may not receive as close scrutiny but, when combined, exert a notable impact on the organization’s financial performance.</li></ul><p>Despite the individual modest values of these purchases, their cumulative effect can be substantial.</p><pre>len(df[&#39;spend_class&#39;]) == df[&#39;spend_class&#39;].value_counts().sum()</pre><pre>True</pre><p><strong>Contract:</strong></p><p>Now, we’re going to add our second column, ‘Contract.’ It’s a straightforward task. Just look at the ‘Master_Agreement’ column in the dataset. If it’s empty, we’ll put ‘Contract Not Available,’ and if it has any content, we’ll write ‘Contract Available.’ We’ll apply this rule to all the cells in the column.</p><pre>df.columns</pre><pre>Index([&#39;COMMODITY&#39;, &#39;COMMODITY_DESCRIPTION&#39;, &#39;EXTENDED_DESCRIPTION&#39;,<br>       &#39;QUANTITY&#39;, &#39;UNIT_OF_MEASURE&#39;, &#39;UNIT_OF_MEAS_DESC&#39;, &#39;UNIT_PRICE&#39;,<br>       &#39;ITM_TOT_AM&#39;, &#39;MASTER_AGREEMENT&#39;, &#39;CONTRACT_NAME&#39;, &#39;PURCHASE_ORDER&#39;,<br>       &#39;AWARD_DATE&#39;, &#39;VENDOR_CODE&#39;, &#39;LGL_NM&#39;, &#39;AD_LN_1&#39;, &#39;AD_LN_2&#39;, &#39;CITY&#39;,<br>       &#39;ST&#39;, &#39;ZIP&#39;, &#39;CTRY&#39;, &#39;DATA_BUILD_DATE&#39;, &#39;spend_class&#39;],<br>      dtype=&#39;object&#39;)</pre><pre>df[&#39;MASTER_AGREEMENT&#39;]</pre><pre>0        MA2200GA140000076<br>1        MA1100GA130000040<br>2        MA8600GA090000006<br>3        MA7400GC100000003<br>4                      NaN<br>               ...        <br>72848    MA2200GA120000017<br>72849    MA2200GA110000059<br>72850                  NaN<br>72851    MA1100GA080000084<br>72852    MA6400GA110000076<br>Name: MASTER_AGREEMENT, Length: 72853, dtype: object</pre><pre>len(df[&#39;MASTER_AGREEMENT&#39;])</pre><pre>72853</pre><pre>df[&#39;MASTER_AGREEMENT&#39;].isna().sum()</pre><pre>17642</pre><pre>(df[&#39;MASTER_AGREEMENT&#39;].isna().sum()/len(df[&#39;MASTER_AGREEMENT&#39;]))*100</pre><pre>24.21588678571919</pre><p>We have 24.21% of missing values in Master_Agreement column (no contract).</p><pre>df[&#39;contract&#39;] = &#39;Contract NOT Available&#39;<br><br>for i in range(len(df)):<br>    if pd.notna(df[&#39;MASTER_AGREEMENT&#39;][i]):<br>        df.at[i, &#39;contract&#39;] = &#39;Contract Available&#39;</pre><pre>df[&#39;contract&#39;].value_counts()</pre><pre>contract<br>Contract Available        55211<br>Contract NOT Available    17642<br>Name: count, dtype: int64</pre><pre>df[&#39;contract&#39;].value_counts().sum() == len(df[&#39;MASTER_AGREEMENT&#39;])</pre><pre>True</pre><p>We have added the contract column with reference to Master_Agreement’s column.</p><p><strong>Purchase Order (PO):</strong></p><p>We will repeat the same steps as we did while adding our Contract Column. If “Purchase_Order” column is blank, we will write “PO Not Available” and if the “Purchase_Order” column is not blank, we will write “PO Available”.</p><pre>df[&#39;PURCHASE_ORDER&#39;].isna().sum()</pre><pre>921</pre><pre>(df[&#39;PURCHASE_ORDER&#39;].isna().sum() / len(df[&#39;PURCHASE_ORDER&#39;]))*100</pre><pre>1.264189532345957</pre><p>We have a 1.26% missing value on Purchase Order record.</p><pre>df[&#39;PO_availability&#39;] = &#39;PO NOT Available&#39;<br><br>for i in range(len(df)):<br>    if pd.notna(df[&#39;PURCHASE_ORDER&#39;][i]):<br>        df.at[i, &#39;PO_availability&#39;] = &#39;PO Available&#39;</pre><pre>df[&#39;PO_availability&#39;].value_counts()</pre><pre>PO_availability<br>PO Available        71932<br>PO NOT Available      921<br>Name: count, dtype: int64</pre><pre>df[&#39;PO_availability&#39;].value_counts().sum() == len(df[&#39;PO_availability&#39;])</pre><pre>True</pre><p>We have added the PO availability column with reference to Purchase Order’s column.</p><p><strong>Number of Vendors:</strong></p><p>A pivotal moment has arrived as we embark on the process of calculating the number of vendors for each commodity description. Our objective is to determine how many vendors are associated with each item, and subsequently, categorize them into High, Medium, and Low groups.</p><p>While the underlying logic is straightforward, it entails several steps. To begin, we will compile a list of unique vendor names for each commodity description. In simpler terms, this means establishing one-to-many relationships, where one commodity description may be associated with multiple vendor names.</p><pre>vendor_counts = df.groupby(&#39;COMMODITY_DESCRIPTION&#39;)[&#39;LGL_NM&#39;].nunique().reset_index()<br>vendor_counts.head()</pre><figure><img alt="png" src="https://cdn-images-1.medium.com/proxy/1*X_Zstx1KFaOJSpCEUcc0hA.png" /></figure><pre># Let&#39;s find and check row 1 from the vendor_counts df if LGL_NM is totally true<br>desired_commodity_description = &#39;0.9% Sodium Chloride 1000ml&#39;<br>filtered_data = df[df[&#39;COMMODITY_DESCRIPTION&#39;].str.startswith(desired_commodity_description)]<br><br>if not filtered_data.empty:<br>    vendor_names = filtered_data[&#39;LGL_NM&#39;].unique()<br>    unique_vendor_count = len(vendor_names)<br><br>    print(f&quot;Vendor names for &#39;{desired_commodity_description}&#39;: {&#39;, &#39;.join(vendor_names)}&quot;)<br>    print(f&quot;Number of unique vendors: {unique_vendor_count}&quot;)<br>else:<br>    print(f&quot;No matching rows found for &#39;{desired_commodity_description}&#39;.&quot;)</pre><pre>Vendor names for &#39;0.9% Sodium Chloride 1000ml&#39;: HENRY SCHEIN INC, MIDWEST MEDICAL SUPPLY COMPANY, LLC, SOUTHEASTERN EMERGENCY EQUIPMENT<br>Number of unique vendors: 3</pre><p>As we can see, row 2 (index 1) on vendor_counts dataframe has the same output.</p><pre># Check if MIDWEST MEDICAL SUPPLY COMPANY, LLC, is a totally 1 count vendor (get only the first 2)<br>df_subset = df[[&#39;LGL_NM&#39;]]<br>df_subset[df_subset[&#39;LGL_NM&#39;].str.startswith(&#39;MIDWEST MEDICAL SUPPLY&#39;)][:2]</pre><figure><img alt="png" src="https://cdn-images-1.medium.com/proxy/1*9c944DTJ4_FATGrWlVEA0w.png" /></figure><p>Yes, confirmed. It is one entity.</p><pre>vendor_counts[&#39;Total_Vendors&#39;] = vendor_counts[&#39;LGL_NM&#39;]<br>vendor_counts</pre><figure><img alt="png" src="https://cdn-images-1.medium.com/proxy/1*2DmHAfZLScF_suhou1vGVg.png" /></figure><pre># for i in range(len(vendor_counts)):<br>#     if vendor_counts[&#39;LGL_NM&#39;][i] == vendor_counts[&#39;Total_Vendors&#39;][i]:<br>#         print(f&quot;Match at index {i}: {vendor_counts[&#39;LGL_NM&#39;][i]} equals {vendor_counts[&#39;Total_Vendors&#39;][i]}&quot;)<br>#     else:<br>#         print(f&quot;No match at index {i}: {vendor_counts[&#39;LGL_NM&#39;][i]} does not equal {vendor_counts[&#39;Total_Vendors&#39;][i]}&quot;)</pre><pre>df[&#39;Number of vendors&#39;] = df[&#39;COMMODITY_DESCRIPTION&#39;].map(vendor_counts.set_index(&#39;COMMODITY_DESCRIPTION&#39;)[&#39;Total_Vendors&#39;])</pre><pre>df[&#39;Number of vendors&#39;].hist();</pre><figure><img alt="png" src="https://cdn-images-1.medium.com/proxy/1*LxxKc2oqyzmecBSiyQmFbA.png" /></figure><p>We can see a commodity description where in there is a total number of vendors equal or greater than 30. Let’s find out what is this commodity description.</p><pre>filtered_data = vendor_counts[vendor_counts[&#39;Total_Vendors&#39;] &gt;= 30]<br>print(filtered_data)</pre><pre>COMMODITY_DESCRIPTION  LGL_NM  Total_Vendors<br>341                 Application Software, Microcomputer     133            133<br>2385  Freight and Cargo Containers (Shipping) (See C...      56             56<br>5646          Souvenirs: Promotional, Advertising, etc.      51             51</pre><p><strong>Vendor Classification:</strong></p><p>This is among the newly introduced columns. Let’s generate a fresh column and name it ‘Vendor Classification’. We will further divide vendors into three distinct categories to enhance our analysis. Given that we have already computed the number of vendors for each material description, we can categorize them as follows:</p><ul><li>a. Single Vendor (when the vendor count is 1)</li><li>b. Between 1 and 5 (when the vendor count falls between 1 and 5)</li><li>c. More than 5 (when the vendor count exceeds 5)</li></ul><p>Note: I have selected 5 as the upper limit for vendor count, but you can adjust this limit as per your discretion, depending on prevailing market conditions in the commodity sector.</p><pre># Let&#39;s create a function that would help us aiding the categorization of vendors<br>def categorize_vendors(num_vendors):<br>    if num_vendors == 1:<br>        return &#39;Single Vendor&#39;<br>    elif 1 &lt; num_vendors &lt;= 5:<br>        return &#39;Between 1 and 5 Vendors&#39;<br>    else:<br>        return &#39;More than 5 Vendors&#39;<br><br>df[&#39;Vendor Class&#39;] = df[&#39;Number of vendors&#39;].apply(categorize_vendors)</pre><p><strong>Purchase Order Count:</strong></p><p>Just like we did for the “Number of Vendors,” we also need to compute the ‘Purchase Order Count’ column. Let’s introduce a new column into our dataset and name it ‘Purchase Order Count.’ It’s important to note that each line item in our dataset corresponds to one purchase order (PO). Additionally, we have several line items where the PO field is empty, and in those cases, we have indicated “PO NOT Available” in our “PO” column.</p><p>The logic for calculating the “Purchase Order Count” is straightforward. We simply need to tally how many times a commodity item description appears in the dataset, assuming that each occurrence represents a unique purchase order. However, it’s essential to acknowledge that in practical scenarios, this assumption may not always hold true. If you encounter such situations, I recommend adopting the same approach we used for the “Number of Vendors” column.</p><pre>df[&#39;Number of POs&#39;] = df.groupby(&#39;COMMODITY_DESCRIPTION&#39;)[&#39;COMMODITY_DESCRIPTION&#39;].transform(&#39;count&#39;)<br><br>print(df[[&#39;COMMODITY_DESCRIPTION&#39;, &#39;Number of POs&#39;]])</pre><pre>COMMODITY_DESCRIPTION  Number of POs<br>0                PARTS AND ACCESSORIES, FLOWMETER SYSTEM            316<br>1                             NUTS, LOCK, CONDUIT, STEEL              3<br>2                                           SAND, SILICA             27<br>3                                      Shoes, Safety Toe            955<br>4            TOOL STRAIGHTNER FOR TYPE K COPPER 3/4 INCH              1<br>...                                                  ...            ...<br>72848                        Lubricants, Industrial Type             98<br>72849  Chlorinating and Oxidizing Agents: Bromohydant...             66<br>72850                                V-Belts, Industrial             18<br>72851          BOLTS, ANCHOR, HOT ROLLED STEEL, W/2 NUTS            246<br>72852                                  LIGHTS, EMERGENCY            593<br><br>[72853 rows x 2 columns]</pre><p><strong>Purchase Order Classification (PO Class):</strong></p><p>Similar to the ‘Vendor Class’ column, we will categorize the ‘Purchase Order Count’ information into three distinct groups to aid our analysis. Since we’ve already determined the number of purchase orders (POs) for each material description, we can classify them as follows:</p><ul><li>a. Single PO (One-time Purchases: where the PO count is 1)</li><li>b. Between 1 and 12 (Spot POs: where the PO count falls in the range of 1 to 12)</li><li>c. More than 12 (High-Frequency POs: where the PO count exceeds 12)</li></ul><p>Our primary objective in this context is to identify high-frequency POs for potential consolidation.</p><p>Note: I have defined ‘high-frequency POs’ as those with at least 1 PO per month, equating to 12 POs per year. You can adjust this threshold based on your initial data analysis findings.</p><pre>def categorize_pos(num_pos):<br>    if num_pos == 1:<br>        return &#39;Single PO&#39;<br>    elif 1 &lt; num_pos &lt;= 12:<br>        return &#39;Between 1 and 12&#39;<br>    else:<br>        return &#39;More than 12&#39;<br><br>df[&#39;PO Class&#39;] = df[&#39;Number of POs&#39;].apply(categorize_pos)<br><br>print(df[[&#39;COMMODITY_DESCRIPTION&#39;, &#39;Number of POs&#39;, &#39;PO Class&#39;]])</pre><pre>COMMODITY_DESCRIPTION  Number of POs  \<br>0                PARTS AND ACCESSORIES, FLOWMETER SYSTEM            316   <br>1                             NUTS, LOCK, CONDUIT, STEEL              3   <br>2                                           SAND, SILICA             27   <br>3                                      Shoes, Safety Toe            955   <br>4            TOOL STRAIGHTNER FOR TYPE K COPPER 3/4 INCH              1   <br>...                                                  ...            ...   <br>72848                        Lubricants, Industrial Type             98   <br>72849  Chlorinating and Oxidizing Agents: Bromohydant...             66   <br>72850                                V-Belts, Industrial             18   <br>72851          BOLTS, ANCHOR, HOT ROLLED STEEL, W/2 NUTS            246   <br>72852                                  LIGHTS, EMERGENCY            593   <br><br>               PO Class  <br>0          More than 12  <br>1      Between 1 and 12  <br>2          More than 12  <br>3          More than 12  <br>4             Single PO  <br>...                 ...  <br>72848      More than 12  <br>72849      More than 12  <br>72850      More than 12  <br>72851      More than 12  <br>72852      More than 12  <br><br>[72853 rows x 3 columns]</pre><p>We have successfully incorporated the additional data from the dataset. Our next step is to proceed towards achieving our objective.</p><h3>📑 Result</h3><h3>Hidden Tail — Spend outsite negotiated contracts</h3><p>Which is the largest yet often ignored part of Tail Spend? Hidden Tail!</p><p>The hidden tail is probably one of the most under-reported tail spend as it is easy to be missed. <em>The hidden tail is the spend where we have a contract present but do NOT have a purchase order.</em> In simpler words, we are looking for commodity item descriptions where we have both types of transactions — with a contract and without a contract.</p><pre>rows = [&#39;contract&#39;]<br>values = [&#39;ITM_TOT_AM&#39;]<br><br>pivot_table = pd.pivot_table(<br>    df,<br>    values=values,<br>    index=rows,<br>    aggfunc=&#39;sum&#39;, <br>    fill_value=0)<br><br>pivot_table = pivot_table.reset_index()<br>pivot_table.columns = [&#39;contract&#39;, &#39;Total_ITM_TOT_AM&#39;]<br>pd.options.display.float_format = &#39;{:.2f}&#39;.format<br>print(pivot_table)</pre><pre>contract  Total_ITM_TOT_AM<br>0      Contract Available      407618318.17<br>1  Contract NOT Available      108255301.86</pre><p>On this result, we have a Contract Available amounting to 407M. Let’s investigate further.</p><pre>rows = [&#39;contract&#39;, &#39;PO_availability&#39;]<br>values = [&#39;ITM_TOT_AM&#39;]<br><br>pivot_table = pd.pivot_table(<br>    df,<br>    values=values,<br>    index=rows,<br>    aggfunc=&#39;sum&#39;,<br>    fill_value=0)<br><br>pivot_table = pivot_table.reset_index()<br>pivot_table.columns = [&#39;contract&#39;, &#39;PO_availability&#39;, &#39;Total_ITM_TOT_AM&#39;]<br>pd.options.display.float_format = &#39;{:.2f}&#39;.format<br>print(pivot_table)</pre><pre>contract   PO_availability  Total_ITM_TOT_AM<br>0      Contract Available      PO Available      401635212.82<br>1      Contract Available  PO NOT Available        5983105.35<br>2  Contract NOT Available      PO Available      108255301.86</pre><pre>401635212.82+5983105.35</pre><pre>407618318.17</pre><p>We thoroughly examined the output exceeding 407 million and noticed that the sole contract lacking a corresponding purchase order (PO) has a value of only 5.9 million.</p><p>Hence, we would say that our hidden tail is 5.9 million.</p><p>Now, let’s find out the hidden tail under Spend Class = Major Spend</p><pre>rows = [&#39;spend_class&#39;, &#39;contract&#39;, &#39;PO_availability&#39;]<br>values = [&#39;ITM_TOT_AM&#39;]<br><br>pivot_table = pd.pivot_table(<br>    df,<br>    values=values,<br>    index=rows,<br>    aggfunc=&#39;sum&#39;,<br>    fill_value=0)<br><br>pivot_table = pivot_table.reset_index()<br>pivot_table.columns = [&#39;spend_class&#39;, &#39;contract&#39;, &#39;PO_availability&#39;, &#39;Total_ITM_TOT_AM&#39;]<br>pd.options.display.float_format = &#39;{:.2f}&#39;.format<br>print(pivot_table)</pre><pre>spend_class                contract   PO_availability  Total_ITM_TOT_AM<br>0  major_spend      Contract Available      PO Available      330879268.68<br>1  major_spend      Contract Available  PO NOT Available        5149286.91<br>2  major_spend  Contract NOT Available      PO Available       76225846.43<br>3   tail_spend      Contract Available      PO Available       70755944.14<br>4   tail_spend      Contract Available  PO NOT Available         833818.44<br>5   tail_spend  Contract NOT Available      PO Available       32029455.43</pre><pre>5149286.91+833818.44</pre><pre>5983105.35</pre><p>We have the following:</p><ol><li>5149286.91</li><li>833818.44</li></ol><p>Creating a Hidden tail subset by suppliers.</p><pre># Filter the dataset by hidden tail criteria (major_spend)<br>filtered_df = df[(df[&#39;spend_class&#39;] == &#39;major_spend&#39;) &amp; (df[&#39;contract&#39;] == &#39;Contract Available&#39;) &amp; (df[&#39;PO_availability&#39;] == &#39;PO NOT Available&#39;)]<br>rows = [&#39;COMMODITY_DESCRIPTION&#39;, &#39;LGL_NM&#39;]<br>values = [&#39;ITM_TOT_AM&#39;]<br><br>pivot_table_major_spend = pd.pivot_table(<br>    filtered_df,<br>    values=values,<br>    index=rows,<br>    aggfunc=&#39;sum&#39;, <br>    fill_value=0)<br><br>pivot_table_major_spend = pivot_table_major_spend.reset_index()<br>pivot_table_major_spend.columns = [&#39;COMMODITY_DESCRIPTION&#39;, &#39;Total_ITM_TOT_AM&#39;, &#39;LGL_NM&#39;]<br>pd.options.display.float_format = &#39;{:.2f}&#39;.format<br>print(pivot_table_major_spend)</pre><pre>COMMODITY_DESCRIPTION  \<br>0                          332 TRAFFIC SIGNAL CABINETS   <br>1    A014.1    Kwik Cric MVP Kit Bound Tree # 35163...   <br>2    A085 i-gel O2 Resus Pack. Small adult. INTERSU...   <br>3    A105  CPAP Mask. Large Adult. O-Two Medical Te...   <br>4                      ACCESSORIES FOR LAPTOP COMPUTER   <br>..                                                 ...   <br>514                           TROUSERS APD MEN SIZE 37   <br>515                        TROUSERS APD MEN SIZE 37X30   <br>516                           TROUSERS APD MEN SIZE 44   <br>517                           TROUSERS WORK NAVY SZ 32   <br>518                TROUSERS WORK POSTMAN BLUE SZ 32X32   <br><br>                          Total_ITM_TOT_AM    LGL_NM  <br>0                           Mobotrex, Inc. 172095.00  <br>1                         HENRY SCHEIN INC    479.70  <br>2                 BOUND TREE MEDICAL L L C   1334.40  <br>3                         HENRY SCHEIN INC    215.60  <br>4    AUSTIN RIBBON &amp; COMPUTER SUPPLIES INC   1286.23  <br>..                                     ...       ...  <br>514                     FECHHEIMER BROS CO     82.46  <br>515                     FECHHEIMER BROS CO    242.40  <br>516                     FECHHEIMER BROS CO    350.10  <br>517                SERVICEWEAR APPAREL INC     54.56  <br>518                SERVICEWEAR APPAREL INC     68.20  <br><br>[519 rows x 3 columns]</pre><pre># Filter the dataset by hidden tail criteria (tail_spend)<br>filtered_df = df[(df[&#39;spend_class&#39;] == &#39;tail_spend&#39;) &amp; (df[&#39;contract&#39;] == &#39;Contract Available&#39;) &amp; (df[&#39;PO_availability&#39;] == &#39;PO NOT Available&#39;)]<br>rows = [&#39;COMMODITY_DESCRIPTION&#39;, &#39;LGL_NM&#39;]<br>values = [&#39;ITM_TOT_AM&#39;]<br><br>pivot_table_tail_spend = pd.pivot_table(<br>    filtered_df,<br>    values=values,<br>    index=rows,<br>    aggfunc=&#39;sum&#39;, <br>    fill_value=0)<br><br>pivot_table_tail_spend = pivot_table_tail_spend.reset_index()<br>pivot_table_tail_spend.columns = [&#39;COMMODITY_DESCRIPTION&#39;, &#39;Total_ITM_TOT_AM&#39;, &#39;LGL_NM&#39;]<br>pd.options.display.float_format = &#39;{:.2f}&#39;.format<br>print(pivot_table_tail_spend)</pre><pre>COMMODITY_DESCRIPTION  \<br>0                                    Tape, Electrical   <br>1                                    Tape, Electrical   <br>2   Telecommunication Parts and Accessories (Not O...   <br>3   Telephone Systems (2-60 Stations), Electronic Key   <br>4   Test Equipment and Supplies: Criminology Kits,...   <br>..                                                ...   <br>70                                       Work Clothes   <br>71                                       Work Clothes   <br>72                                       Work Clothes   <br>73                                       Work Clothes   <br>74                                 pillows disposable   <br><br>                   Total_ITM_TOT_AM   LGL_NM  <br>0                  STUART C IRBY CO   110.00  <br>1             STUART C IRBY COMPANY  3446.07  <br>2                       ANIXTER INC 11471.25  <br>3                       ANIXTER INC   128.48  <br>4   SIRCHIE ACQUISITION COMPANY LLC  6992.00  <br>..                              ...      ...  <br>70                        GALLS LLC   214.95  <br>71              GT DISTRIBUTORS INC  1054.10  <br>72    MILLER UNIFORMS &amp; EMBLEMS INC  4907.24  <br>73                SAFETY SUPPLY INC  7009.75  <br>74    MCKESSON MEDICAL-SURGICAL INC   343.68  <br><br>[75 rows x 3 columns]</pre><h3>⚙️ Generating a new Dataset</h3><pre># Save the file in excel file format<br>pivot_table_major_spend.to_excel(&#39;a1_major_spend_hidden_tail_by_vendors.xlsx&#39;, index=False)<br>pivot_table_tail_spend.to_excel(&#39;a2_tail_spend_hidden_tail_by_vendors.xlsx&#39;, index=False)</pre><p>Congratulations for reaching this point! We have done an excellent job in uncovering concealed tail spend (hidden tail) on our dataset. If you would like to have a copy. The files are uploaded <a href="https://github.com/sedeba19/Tail-Spend-Dataset/tree/main/a.%20hidden_tail_spend">here</a>.</p><p>We can use these files for further analysis having the tail spend by vendors.</p><h3>✍🏻 Conclusion</h3><p>Efficient tail spend management aims to streamline and optimize these smaller, less strategic purchases to reduce costs, improve supplier relationships, and enhance overall procurement efficiency. By gaining better visibility into tail spend, organizations can identify cost-saving opportunities, negotiate better terms with suppliers, and implement more effective procurement strategies.</p><p>Characteristics of tail spend include:</p><ol><li>High Volume, Low Value: Tail spend transactions are numerous but individually have low monetary value. They might include office supplies, small equipment, maintenance services, or even ad-hoc purchases.</li><li>Limited Oversight: Due to their small size and infrequency, tail spend items are often not subject to the same level of scrutiny and strategic sourcing as larger, more significant procurement categories.</li><li>Diverse Suppliers: Tail spend often involves a wide range of suppliers, as different departments or individuals within a company may make these purchases independently.</li><li>Inefficiencies: Because tail spend is often decentralized and not well-managed, it can lead to inefficiencies, higher costs, and missed opportunities for cost savings.</li><li>Cumulative Impact: Despite the relatively small value of each individual transaction, the cumulative impact of tail spend across an organization can be substantial and can account for a significant portion of overall procurement expenses.</li></ol><p>Remember that tail spend management is not a one-time effort but an ongoing commitment to optimizing your procurement processes.</p><p>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b81409fb3d44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assessing Wine Excellence: Exploring, Predicting, and Deployment]]></title>
            <link>https://medium.com/@jwbvjnsddz/assessing-wine-excellence-exploring-predicting-and-deployment-978f8e910108?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/978f8e910108</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-storytelling]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Fri, 18 Aug 2023 17:10:41 GMT</pubDate>
            <atom:updated>2023-08-18T17:10:41.556Z</atom:updated>
            <content:encoded><![CDATA[<p>I might not know much about wine tasting, but I’m genuinely fascinated by the concept of wine scoring. Over time, I’ve realized that some wines just click with me more than others. It’s curious that my idea of a good wine doesn’t always match its price, brand, or where it’s from. Sometimes, even pricey wines disappoint me. This goes for fancy brands and wines from places like France or Argentina.</p><p>To dodge the letdown of leaving unfinished wine bottles after gatherings, I’ve started a trick. I pick wines based on their scores. I get that these scores are pretty personal. Wine experts rate wines based on their own feelings, often giving them a number.</p><p>Confession time: I have to admit that this method of going for high-scored wines has worked out for me, even though it’s a bit subjective. But there’s a catch: I’m only considering wines that have been rated. This drawback makes me wish I could explore fantastic wines from places that aren’t reviewed by fancy (and pricey) critics.</p><p>This got me thinking: Could there be a way to score wines more systematically? Is it possible to create an automated method for wine scoring?</p><p>Stumbling upon a dataset has made me even more curious. I’m keen on figuring out how to connect my curiosity with what’s in the dataset. The idea of building a model that could generate wine scores using the Physicochemical Properties data has really caught my attention.</p><p><strong>Dataset and Features</strong></p><p>The dataset employed in this research was sourced from the UCI Machine Learning Repository [<a href="https://archive.ics.uci.edu/dataset/186/wine+quality">link</a>]. The dataset encompasses wines originating from Minho, Portugal, specifically focusing on two distinct variants: red and white “Vinho Verde” wines. The dataset comprises two subsets, each pertaining to one of the variants. Within these subsets, there are eleven variables encompassing both physicochemical attributes (outlined in the table below) and a sensory quality score, which is rated on a scale from 0 to 10. Notably, the dataset does not encompass information about grape types, wine brands, or wine selling prices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*_St10xMFobDpTOv3-WugQA.jpeg" /></figure><p>I’ve carried out an Exploratory Data Analysis (EDA), and here’s what I’ve uncovered:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*0bXGS341_v5KO5V5E8sW3w.png" /></figure><p>One noteworthy finding is that the attribute most strongly correlated with the target variable “quality” is “alcohol,” displaying a correlation coefficient of 0.48.</p><p>A noticeable positive correlation has been identified, with values of 0.23 for “citric acid,” 0.25 for “sulphates,” and 0.12 for “fixed acidity.” This suggests that wines with elevated levels of fixed acidity often correspond to increased levels of citric acid and sulphates.</p><p>Conversely, the most substantial negative correlation of -0.39 has been identified with “volatile acidity,” while a correlation of -0.19 is notable for “total sulfur dioxide.” This indicates that wines characterized by higher levels of fixed acidity tend to exhibit lower values of volatile acidity and total sulfur dioxide.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*od-jLs5zdCvSmbxrO91s8w.png" /></figure><p>The scatter plot depicting the relationship between “fixed acidity” and “citric acid” provides valuable insights into how these two attributes interact within the dataset.</p><p>Each individual point represents a specific wine sample, and its position on the plot is determined by the corresponding values of both attributes. The arrangement of these points across the plot provides insights into potential trends and patterns that might indicate a correlation between the two attributes.</p><p>The points form a relatively straight line that slopes upward from left to right, it suggests a positive correlation between the two attributes. This means that as “fixed acidity” increases, “citric acid” tends to increase as well.</p><p>Continuing my exploration of how wines are scored in this dataset, I chose to construct a histogram. This histogram serves to improve our understanding of the distribution of wine quality scores within the dataset. By doing so, we can uncover patterns, central tendencies, and even potential outliers, all of which contribute to a more profound insight into how quality scores are distributed across the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*zW4tFR-AKHlHltqCHdjbQw.png" /></figure><p>In the scope of further investigation, I merged the two datasets to facilitate the exploration of binary classification. The objective was to ascertain the optimal set of attributes that would yield the most effective outcomes in predicting whether a given sample corresponds to red or white wine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wssJWACECTIG66kOUK0lDg.png" /></figure><p><strong>Machine Learning Models</strong></p><p>Given the relative simplicity of creating a machine learning model for <strong>binary classification</strong>, I chose to begin with this approach. Here’s a concise overview of the process and results:</p><p>- K-Nearest Neighbors (KNN): 99.4%<br>- Logistic Regression (LR): 99.4%<br>- Naive Bayes (NB): 96.6%<br>- Gradient Boosting Classifier (GBC):99.4%<br>- Support Vector Classifier (SVC): 99.6%<br>- Random Forest Classifier (RFC): 99.5%<br>- Decision Tree Classifier (DT): 98.0%</p><p>These results showcase the accuracy achieved by each classifier in a binary classification setting. The Support Vector Classifier and Random Forest Classifier demonstrate particularly high accuracy rates.</p><p>Before embarking on the development of the deep neural network model aimed at solving the multiclassification challenge of wine scoring based on physicochemical properties, I conducted a concise exploration of the classification algorithms provided by Scikit-Learn. It’s worth noting that the models considered in this survey are the very same ones utilized in the previous binary classification task. Below are the scores:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*w2zLWvTd0XNkHL0GSDn0ow.jpeg" /></figure><p>These results highlight the accuracy achieved by each classifier in distinguishing between the different classes of wine, both White and Red. The Random Forest Classifier demonstrates the highest accuracy for both categories, while other models exhibit varying degrees of performance.</p><p><strong>Deep Neural Network Model</strong></p><p>I’ve devised and constructed a custom Deep Neural Network (DNN) model specifically designed for this dataset. Additionally, I’ve fine-tuned the learning rate to be better suited for this particular dataset. The visual representation of the learning rate curve shows that the minimum point of the curve occurs around the value of 10e-2.</p><pre>def create_uncompiled_model(input_shape, num_classes):<br>    model = tf.keras.models.Sequential([<br>        tf.keras.layers.Input(shape=(input_shape,)),<br>        tf.keras.layers.Dense(64, activation=&#39;relu&#39;),<br>        tf.keras.layers.Dense(32, activation=&#39;relu&#39;),<br>        tf.keras.layers.Dropout(0.3),<br>        tf.keras.layers.Dense(num_classes, activation=&#39;softmax&#39;)<br>    ])<br><br>    return model<br><br>def adjust_learning_rate(dataset, num_classes, epochs=100):<br>    x_train_wm_sc, y_train_wm_cat = dataset<br><br>    input_shape = x_train_wm_sc.shape[1]<br>    model = create_uncompiled_model(input_shape, num_classes)<br><br>    lr_schedule = tf.keras.callbacks.LearningRateScheduler(lambda epoch: 1e-6 * 10**(epoch / 20))<br><br>    optimizer = tf.keras.optimizers.Adam()<br><br>    model.compile(loss=tf.keras.losses.CategoricalCrossentropy(),<br>                  optimizer=optimizer,<br>                  metrics=[&quot;accuracy&quot;])<br><br>    callbacks = [lr_schedule]<br><br>    history = model.fit(x_train_wm_sc, y_train_wm_cat, epochs=epochs, callbacks=callbacks)<br><br>    return history<br><br># Define your dataset and num_classes<br>dataset = (x_train_wm_sc, y_train_wm_cat)<br>num_classes = 10<br><br># Run the training with dynamic LR<br>lr_history = adjust_learning_rate(dataset, num_classes)<br><br># Plot Learning Curve<br>learning_rates = lr_history.history[&#39;lr&#39;]<br>loss = lr_history.history[&#39;loss&#39;]<br><br>plt.semilogx(learning_rates, loss)<br>plt.xlabel(&#39;Learning Rate&#39;)<br>plt.ylabel(&#39;Loss&#39;)<br>plt.title(&#39;Learning Rate vs. Loss&#39;)<br>plt.grid()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*dEH1nCobl6p2xUI536xXLA.png" /></figure><p>Incorporating the specified learning rate adjustment into our DNN model. Please note that the following code is intended for modeling using the <strong>White Wine</strong> dataset.</p><pre># Define learning rate<br>learning_rates = [1e-2]<br>epochs_ = 70<br><br>lr_values = []<br>loss_values = []<br><br>for lr in learning_rates:<br>    nn_model = tf.keras.Sequential([<br>        tf.keras.layers.Input(shape=(x_train_wm_sc.shape[1],)),<br>        tf.keras.layers.Dense(64, activation=&#39;relu&#39;),<br>        tf.keras.layers.Dropout(0.5),<br>        tf.keras.layers.Dense(32, activation=&#39;relu&#39;),<br>        tf.keras.layers.Dropout(0.3),<br>        tf.keras.layers.Dense(num_classes, activation=&#39;softmax&#39;)<br>    ])<br>    <br>    nn_model.compile(loss=tf.keras.losses.CategoricalCrossentropy(), <br>                    optimizer=tf.keras.optimizers.Adam(learning_rate = lr),<br>                    metrics=[&#39;accuracy&#39;])<br>    lr_schedule = tf.keras.callbacks.LearningRateScheduler(lambda epoch: 1e-6 * 10**(epoch / 20))<br>    history_wm = nn_model.fit(x_train_wm_sc, <br>                           y_train_wm_cat, <br>                           epochs=epochs_, <br>                           verbose=0,<br>                           validation_data=(x_test_wm_sc, y_test_wm_cat), <br>                           callbacks=[lr_schedule])<br>    <br>    lr_values.append(lr)<br>    loss_values.append(history_wm.history[&#39;loss&#39;][-1])<br>    loss, accuracy = nn_model.evaluate(x_test_wm_sc, y_test_wm_cat, verbose=0)<br>    final_train_accuracy_wm = history_wm.history[&#39;accuracy&#39;][-1]<br>    final_val_accuracy_wm = history_wm.history[&#39;val_accuracy&#39;][-1]<br>    print(f&quot;Training Accuracy: {final_train_accuracy_wm:.4f}&quot;)<br>    print(f&quot;Validation Accuracy: {final_val_accuracy_wm:.4f}&quot;)<br><br>def plot_training_history_loss(history):<br>    plt.plot(history.history[&#39;loss&#39;])<br>    plt.plot(history.history[&#39;val_loss&#39;])<br>    plt.title(&#39;Model Loss&#39;)<br>    plt.xlabel(&#39;Epoch&#39;)<br>    plt.ylabel(&#39;Loss&#39;)<br>    plt.legend([&#39;Train&#39;, &#39;Validation&#39;], loc=&#39;upper right&#39;)<br>    plt.show()<br><br># Plot<br>plot_training_history_loss(history_wm)<br><br>def plot_training_history_accuracy(history):<br>    # Plot training &amp; validation accuracy values<br>    plt.plot(history.history[&#39;accuracy&#39;])<br>    plt.plot(history.history[&#39;val_accuracy&#39;])<br>    plt.title(&#39;Model Accuracy&#39;)<br>    plt.xlabel(&#39;Epoch&#39;)<br>    plt.ylabel(&#39;Accuracy&#39;)<br>    plt.legend([&#39;Train&#39;, &#39;Validation&#39;], loc=&#39;lower right&#39;)<br>    plt.show()<br><br>plot_training_history_accuracy(history_wm)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*KWMdHytZpG7GXhGhQXL-DQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*FgjwNfL2mkfasls9p_4hww.png" /></figure><p>Training Accuracy: 0.5350</p><p>Validation Accuracy: 0.5316</p><p>Below code is for <strong>Red Wine</strong> dataset.</p><pre>history_rm = nn_model.fit(x_train_rm_sc, <br>                            y_train_rm_cat, <br>                            epochs=epochs_, <br>                            verbose=0,<br>                            validation_data=(x_test_rm_sc, y_test_rm_cat), <br>                            callbacks=[lr_schedule])<br><br>final_train_accuracy_rm = history_rm .history[&#39;accuracy&#39;][-1]<br>final_val_accuracy_rm = history_rm .history[&#39;val_accuracy&#39;][-1]<br>print(f&quot;Training Accuracy: {final_train_accuracy_rm:.4f}&quot;)<br>print(f&quot;Validation Accuracy: {final_val_accuracy_rm:.4f}&quot;)<br>plot_training_history_loss(history_rm)<br>plot_training_history_accuracy(history_rm)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*DUCnRD75ddF33WX7HxxX7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*Fz-gTP-WmbT5DD1Dz2vI9g.png" /></figure><p>Training Accuracy: 0.6036</p><p>Validation Accuracy: 0.5875</p><p><strong>Summary</strong></p><h3>Assessing Wine Excellence: Exploring, Predicting, and Deployment</h3><p>I might not know much about wine tasting, but I’m genuinely fascinated by the concept of wine scoring. Over time, I’ve realized that some wines just click with me more than others. It’s curious that my idea of a good wine doesn’t always match its price, brand, or where it’s from. Sometimes, even pricey wines disappoint me. This goes for fancy brands and wines from places like France or Argentina.</p><p>To dodge the letdown of leaving unfinished wine bottles after gatherings, I’ve started a trick. I pick wines based on their scores. I get that these scores are pretty personal. Wine experts rate wines based on their own feelings, often giving them a number.</p><p>Confession time: I have to admit that this method of going for high-scored wines has worked out for me, even though it’s a bit subjective. But there’s a catch: I’m only considering wines that have been rated. This drawback makes me wish I could explore fantastic wines from places that aren’t reviewed by fancy (and pricey) critics.</p><p>This got me thinking: Could there be a way to score wines more systematically? Is it possible to create an automated method for wine scoring?</p><p>Stumbling upon a dataset has made me even more curious. I’m keen on figuring out how to connect my curiosity with what’s in the dataset. The idea of building a model that could generate wine scores using the Physicochemical Properties data has really caught my attention.</p><p><strong>Dataset and Features</strong></p><p>The dataset employed in this research was sourced from the UCI Machine Learning Repository [<a href="https://archive.ics.uci.edu/dataset/186/wine+quality">link</a>]. The dataset encompasses wines originating from Minho, Portugal, specifically focusing on two distinct variants: red and white “Vinho Verde” wines. The dataset comprises two subsets, each pertaining to one of the variants. Within these subsets, there are eleven variables encompassing both physicochemical attributes (outlined in the table below) and a sensory quality score, which is rated on a scale from 0 to 10. Notably, the dataset does not encompass information about grape types, wine brands, or wine selling prices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*_St10xMFobDpTOv3-WugQA.jpeg" /></figure><p>I’ve carried out an Exploratory Data Analysis (EDA), and here’s what I’ve uncovered:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*0bXGS341_v5KO5V5E8sW3w.png" /></figure><p>One noteworthy finding is that the attribute most strongly correlated with the target variable “quality” is “alcohol,” displaying a correlation coefficient of 0.48.</p><p>A noticeable positive correlation has been identified, with values of 0.23 for “citric acid,” 0.25 for “sulphates,” and 0.12 for “fixed acidity.” This suggests that wines with elevated levels of fixed acidity often correspond to increased levels of citric acid and sulphates.</p><p>Conversely, the most substantial negative correlation of -0.39 has been identified with “volatile acidity,” while a correlation of -0.19 is notable for “total sulfur dioxide.” This indicates that wines characterized by higher levels of fixed acidity tend to exhibit lower values of volatile acidity and total sulfur dioxide.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*od-jLs5zdCvSmbxrO91s8w.png" /></figure><p>The scatter plot depicting the relationship between “fixed acidity” and “citric acid” provides valuable insights into how these two attributes interact within the dataset.</p><p>Each individual point represents a specific wine sample, and its position on the plot is determined by the corresponding values of both attributes. The arrangement of these points across the plot provides insights into potential trends and patterns that might indicate a correlation between the two attributes.</p><p>The points form a relatively straight line that slopes upward from left to right, it suggests a positive correlation between the two attributes. This means that as “fixed acidity” increases, “citric acid” tends to increase as well.</p><p>Continuing my exploration of how wines are scored in this dataset, I chose to construct a histogram. This histogram serves to improve our understanding of the distribution of wine quality scores within the dataset. By doing so, we can uncover patterns, central tendencies, and even potential outliers, all of which contribute to a more profound insight into how quality scores are distributed across the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*zW4tFR-AKHlHltqCHdjbQw.png" /></figure><p>In the scope of further investigation, I merged the two datasets to facilitate the exploration of binary classification. The objective was to ascertain the optimal set of attributes that would yield the most effective outcomes in predicting whether a given sample corresponds to red or white wine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wssJWACECTIG66kOUK0lDg.png" /></figure><p><strong>Machine Learning Models</strong></p><p>Given the relative simplicity of creating a machine learning model for <strong>binary classification</strong>, I chose to begin with this approach. Here’s a concise overview of the process and results:</p><p>- K-Nearest Neighbors (KNN): 99.4%<br>- Logistic Regression (LR): 99.4%<br>- Naïve Bayes (NB): 96.6%<br>- Gradient Boosting Classifier (GBC):99.4%<br>- Support Vector Classifier (SVC): 99.6%<br>- Random Forest Classifier (RFC): 99.5%<br>- Decision Tree Classifier (DT): 98.0%</p><p>These accuracy values offer insights into the performance of each classifier across the classification tasks, illustrating the varying levels of success in accurately categorizing the data.</p><p>Before embarking on the development of the deep neural network model aimed at solving the multiclassification challenge of wine scoring based on physicochemical properties, I conducted a concise exploration of the classification algorithms provided by Scikit-Learn. It’s worth noting that the models considered in this survey are the very same ones utilized in the previous binary classification task. Below are the scores:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*w2zLWvTd0XNkHL0GSDn0ow.jpeg" /></figure><p>These results highlight the accuracy achieved by each classifier in distinguishing between the different classes of wine, both White and Red. The Random Forest Classifier demonstrates the highest accuracy for both categories, while other models exhibit varying degrees of performance.</p><p><strong>Deep Neural Network Model</strong></p><p>I’ve devised and constructed a custom Deep Neural Network (DNN) model specifically designed for this dataset. Additionally, I’ve fine-tuned the learning rate to be better suited for this particular dataset. The visual representation of the learning rate curve shows that the minimum point of the curve occurs around the value of 10e-2.</p><pre>def create_uncompiled_model(input_shape, num_classes):<br>    model = tf.keras.models.Sequential([<br>        tf.keras.layers.Input(shape=(input_shape,)),<br>        tf.keras.layers.Dense(64, activation=&#39;relu&#39;),<br>        tf.keras.layers.Dense(32, activation=&#39;relu&#39;),<br>        tf.keras.layers.Dropout(0.3),<br>        tf.keras.layers.Dense(num_classes, activation=&#39;softmax&#39;)<br>    ])</pre><pre>    return model</pre><pre>def adjust_learning_rate(dataset, num_classes, epochs=100):<br>    x_train_wm_sc, y_train_wm_cat = dataset</pre><pre>    input_shape = x_train_wm_sc.shape[1]<br>    model = create_uncompiled_model(input_shape, num_classes)</pre><pre>    lr_schedule = tf.keras.callbacks.LearningRateScheduler(lambda epoch: 1e-6 * 10**(epoch / 20))</pre><pre>    optimizer = tf.keras.optimizers.Adam()</pre><pre>    model.compile(loss=tf.keras.losses.CategoricalCrossentropy(),<br>                  optimizer=optimizer,<br>                  metrics=[&quot;accuracy&quot;])</pre><pre>    callbacks = [lr_schedule]</pre><pre>    history = model.fit(x_train_wm_sc, y_train_wm_cat, epochs=epochs, callbacks=callbacks)</pre><pre>    return history</pre><pre># Define your dataset and num_classes<br>dataset = (x_train_wm_sc, y_train_wm_cat)<br>num_classes = 10</pre><pre># Run the training with dynamic LR<br>lr_history = adjust_learning_rate(dataset, num_classes)</pre><pre># Plot Learning Curve<br>learning_rates = lr_history.history[&#39;lr&#39;]<br>loss = lr_history.history[&#39;loss&#39;]</pre><pre>plt.semilogx(learning_rates, loss)<br>plt.xlabel(&#39;Learning Rate&#39;)<br>plt.ylabel(&#39;Loss&#39;)<br>plt.title(&#39;Learning Rate vs. Loss&#39;)<br>plt.grid()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*dEH1nCobl6p2xUI536xXLA.png" /></figure><p>Incorporating the specified learning rate adjustment into our DNN model. Please note that the following code is intended for modeling using the <strong>White Wine</strong> dataset.</p><pre># Define learning rate<br>learning_rates = [1e-2]<br>epochs_ = 70</pre><pre>lr_values = []<br>loss_values = []</pre><pre>for lr in learning_rates:<br>    nn_model = tf.keras.Sequential([<br>        tf.keras.layers.Input(shape=(x_train_wm_sc.shape[1],)),<br>        tf.keras.layers.Dense(64, activation=&#39;relu&#39;),<br>        tf.keras.layers.Dropout(0.5),<br>        tf.keras.layers.Dense(32, activation=&#39;relu&#39;),<br>        tf.keras.layers.Dropout(0.3),<br>        tf.keras.layers.Dense(num_classes, activation=&#39;softmax&#39;)<br>    ])<br>    <br>    nn_model.compile(loss=tf.keras.losses.CategoricalCrossentropy(), <br>                    optimizer=tf.keras.optimizers.Adam(learning_rate = lr),<br>                    metrics=[&#39;accuracy&#39;])<br>    lr_schedule = tf.keras.callbacks.LearningRateScheduler(lambda epoch: 1e-6 * 10**(epoch / 20))<br>    history_wm = nn_model.fit(x_train_wm_sc, <br>                           y_train_wm_cat, <br>                           epochs=epochs_, <br>                           verbose=0,<br>                           validation_data=(x_test_wm_sc, y_test_wm_cat), <br>                           callbacks=[lr_schedule])<br>    <br>    lr_values.append(lr)<br>    loss_values.append(history_wm.history[&#39;loss&#39;][-1])<br>    loss, accuracy = nn_model.evaluate(x_test_wm_sc, y_test_wm_cat, verbose=0)<br>    final_train_accuracy_wm = history_wm.history[&#39;accuracy&#39;][-1]<br>    final_val_accuracy_wm = history_wm.history[&#39;val_accuracy&#39;][-1]<br>    print(f&quot;Training Accuracy: {final_train_accuracy_wm:.4f}&quot;)<br>    print(f&quot;Validation Accuracy: {final_val_accuracy_wm:.4f}&quot;)</pre><pre>def plot_training_history_loss(history):<br>    plt.plot(history.history[&#39;loss&#39;])<br>    plt.plot(history.history[&#39;val_loss&#39;])<br>    plt.title(&#39;Model Loss&#39;)<br>    plt.xlabel(&#39;Epoch&#39;)<br>    plt.ylabel(&#39;Loss&#39;)<br>    plt.legend([&#39;Train&#39;, &#39;Validation&#39;], loc=&#39;upper right&#39;)<br>    plt.show()</pre><pre># Plot<br>plot_training_history_loss(history_wm)</pre><pre>def plot_training_history_accuracy(history):<br>    # Plot training &amp; validation accuracy values<br>    plt.plot(history.history[&#39;accuracy&#39;])<br>    plt.plot(history.history[&#39;val_accuracy&#39;])<br>    plt.title(&#39;Model Accuracy&#39;)<br>    plt.xlabel(&#39;Epoch&#39;)<br>    plt.ylabel(&#39;Accuracy&#39;)<br>    plt.legend([&#39;Train&#39;, &#39;Validation&#39;], loc=&#39;lower right&#39;)<br>    plt.show()</pre><pre>plot_training_history_accuracy(history_wm)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*KWMdHytZpG7GXhGhQXL-DQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*FgjwNfL2mkfasls9p_4hww.png" /></figure><p>Training Accuracy: 0.5350</p><p>Validation Accuracy: 0.5316</p><p>Below code is for <strong>Red Wine</strong> dataset.</p><pre>history_rm = nn_model.fit(x_train_rm_sc, <br>                            y_train_rm_cat, <br>                            epochs=epochs_, <br>                            verbose=0,<br>                            validation_data=(x_test_rm_sc, y_test_rm_cat), <br>                            callbacks=[lr_schedule])</pre><pre>final_train_accuracy_rm = history_rm .history[&#39;accuracy&#39;][-1]<br>final_val_accuracy_rm = history_rm .history[&#39;val_accuracy&#39;][-1]<br>print(f&quot;Training Accuracy: {final_train_accuracy_rm:.4f}&quot;)<br>print(f&quot;Validation Accuracy: {final_val_accuracy_rm:.4f}&quot;)<br>plot_training_history_loss(history_rm)<br>plot_training_history_accuracy(history_rm)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*DUCnRD75ddF33WX7HxxX7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*Fz-gTP-WmbT5DD1Dz2vI9g.png" /></figure><p>Training Accuracy: 0.6036</p><p>Validation Accuracy: 0.5875</p><p><strong>Summary</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*WEVidU3WXdC9a3dIQopVrw.jpeg" /></figure><p>It’s apparent that the models fall short of being optimal, particularly when dealing with multiclass classification tasks. Nevertheless, these results should not constrain our potential. Possibilities for enhancement remain accessible through meticulous refinement, with special attention directed towards the refinement of the Deep Neural Network model.</p><p>Given the exceptional results we’ve achieved in the binary classification problem, I opted not to incorporate it into the DNN modeling process.</p><p>The value of data-driven methodologies in the context of wine assessment becomes apparent. By synergizing data exploration, feature engineering, and advanced modeling techniques, we can uncover latent patterns and trends within the data. This journey doesn’t conclude here; the continuous fine-tuning of models and exploration of novel data sources have the potential to further enhance the precision and relevance of our predictions.</p><p>The models are deployed on huggingface. You may refer below links for your reference.</p><ul><li><a href="https://huggingface.co/spaces/sedeba19/Binary_Classification_Wine">wine_type_predictor_app</a></li><li><a href="https://huggingface.co/spaces/sedeba19/wine_prediction_streamlit">wine_quality_predictor_app</a></li></ul><p>If you’re interested in reviewing the code, it’s available in GitHub repository: <a href="https://github.com/sedeba19/Assessing-Wine-Excellence-Exploring-Predicting-and-Deployment">sedeba19</a></p><p>I trust you’ve gained valuable insights from this endeavor. Please do express your reflections and input in the comments section, and don’t hesitate to give it a thumbs up if you discovered merit in this undertaking.</p><p>Thank you for dedicating your time to read through this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=978f8e910108" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Exploration on Global Commodity Prices: Sugar Price]]></title>
            <link>https://medium.com/@jwbvjnsddz/data-exploration-on-global-commodity-prices-sugar-price-db83a9e36ee4?source=rss-b4234422b7cb------2</link>
            <guid isPermaLink="false">https://medium.com/p/db83a9e36ee4</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-exploration]]></category>
            <category><![CDATA[data-storytelling]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Herwin Abedes]]></dc:creator>
            <pubDate>Sun, 13 Aug 2023 08:12:14 GMT</pubDate>
            <atom:updated>2023-08-13T08:12:14.889Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>In this exploration, we embark on a comprehensive journey through a dataset that offers insights into the realm of global sugar prices. Our endeavor involves delving into a meticulous analysis of historical trends, intricate patterns, and distinct factors that influence the fluctuations within the world sugar market.</p><p><strong>Dataset Overview:</strong></p><p>The dataset in focus is drawn from Kaggle, specifically from the [<a href="https://www.kaggle.com/datasets/utkarshx27/select-world-bank-commodity-price-data">Kaggle: Global Commodity Prices: Monthly Data (1960–2022)</a>] repository. Within this dataset, we find a valuable collection of data points centered around world sugar prices.</p><p>Specifically centered around world sugar prices, the dataset offers a comprehensive historical time-series of observations. These observations provide an intricate record of sugar prices over time, enabling researchers and analysts to deeply investigate the complex patterns and fluctuations within this critical commodity market.</p><p>Presenting a specialized perspective on the historical price dynamics of one of the world’s most consumed commodities, this Exploratory Data Analysis (EDA) employs the provided dataset to unveil compelling insights. By meticulously analyzing the historical price data, we have enriched our comprehension of the factors that influence sugar price trends and their potential consequences.</p><p><strong>**Note:**</strong></p><p>Detail about the sugar (World) column, International Sugar Agreement (ISA) daily price, raw, f.o.b. and stowed at greater Caribbean ports ($/kg).</p><p>To explore this dataset we need to install pandas, seaborn and matplotlib. We are also doing some statistics analysis about mean, percentile &amp; others.</p><pre>pip install pandas matplotlib seaborn<br><br># Import libraries<br>import pandas as pd<br>import matplotlib.pyplot as plt<br>import random<br>import seaborn as sns<br>from statistics import mean<br>import numpy as np<br><br># Load in the directory of the dataset<br>file_dir = &#39;./global_commodity_prices/commodity_prices.csv&#39;<br><br># Load data into dataframe<br>df = pd.read_csv(file_dir)<br>df.drop([&#39;Unnamed: 0&#39;, &#39;oil_brent&#39;, &#39;oil_dubai&#39;, &#39;coffee_arabica&#39;,<br>       &#39;coffee_robustas&#39;, &#39;tea_columbo&#39;, &#39;tea_kolkata&#39;, &#39;tea_mombasa&#39;,<br>       &#39;sugar_eu&#39;, &#39;sugar_us&#39;], axis = 1, inplace = True)<br># Convert &#39;date&#39; column to datetime object<br>df[&#39;date&#39;] = pd.to_datetime(df[&#39;date&#39;])<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*fKcEve5gKH6Ue1vapM5N8g.jpeg" /></figure><p>We are confined to the `date` and `sugar_world` price columns. To enrich our dataset, we capitalize on the `date` column by incorporating additional features such as `month`, `day`, `weekday`, `year`, `is_weekend`, and `is_weekday`. These attributes are part of the time series functions available under the pandas library.</p><pre># Add &#39;month&#39; column<br>df[&#39;month&#39;] = df[&#39;date&#39;].dt.month<br>df[&#39;day&#39;] = df[&#39;date&#39;].dt.day<br>df[&#39;weekday&#39;] = df[&#39;date&#39;].dt.weekday # returns the day of the week as an integer, where Monday is 0 and Sunday is 6<br>df[&#39;year&#39;] = df[&#39;date&#39;].dt.year<br># Add column for weekend and weekday<br>df[&#39;is_weekend&#39;] = (df[&#39;date&#39;].dt.weekday &gt;= 5).astype(int)<br>df[&#39;is_weekday&#39;] = ((df[&#39;date&#39;].dt.weekday &gt;= 0) &amp; (df[&#39;date&#39;].dt.weekday &lt;= 4)).astype(int)<br><br># Display dataframe with new column<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*GZTXSAXMeNbKg1U3d9fHhw.jpeg" /></figure><p><strong>Weekday Column Exploration</strong></p><p>The exploration of weekday columns unveils intriguing insights into the rhythmic patterns that govern sugar prices within specific days of the week. This unique lens allows us to identify potential correlations between sugar prices and the days of the week.</p><p>By meticulously examining the relationship between sugar prices and weekdays, we aim to uncover whether certain days consistently exhibit distinctive price behaviors. Such revelations can have far-reaching implications for market strategies, risk management, and decision-making.</p><pre>counts = df[&#39;weekday&#39;].value_counts().sort_index()<br>ax = counts.plot(kind=&#39;bar&#39;)<br>for i, v in enumerate(counts):<br>    ax.text(i, v+1, str(v), ha=&#39;center&#39;)<br>ax.set_xticklabels([&#39;Monday&#39;, &#39;Tuesday&#39;, &#39;Wednesday&#39;, &#39;Thursday&#39;, &#39;Friday&#39;, &#39;Saturday&#39;, &#39;Sunday&#39;])<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*b-bUDhMYvoquClo53TTfuQ.jpeg" /></figure><p>Upon revisiting the distribution of sugar price data across weekdays, we observe the following pattern:</p><p>- <strong>**Monday (weekday 0)**</strong> to <strong>**Thursday (weekday 3)**</strong> consistently record 108 instances of sugar price observations each.</p><p>- <strong>**Friday (weekday 4)**</strong> exhibits the highest number of sugar price observations, with a count of 110 instances.</p><p>- Both <strong>**Saturday (weekday 5)**</strong> and <strong>**Sunday (weekday 6)**</strong> share the lowest number of sugar price observations, each with 107 instances.</p><p>This distribution reaffirms the varying frequency of sugar price observations across different weekdays. Recognizing these trends aids in uncovering potential correlations and patterns influenced by specific days of the week. Further exploration of such patterns can contribute to a more comprehensive understanding of how weekdays interplay with sugar price dynamics, informing strategic decision-making within the sugar market.</p><p>For insanity check, we can add theese values above on our graph and get the sum.</p><pre># Sum of the values represented on our graph<br>sum_vchart = 110 + 108 + 108 + 108 + 108 + 107 + 107<br>len(df) == sum_vchart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/54/1*iknhFBQPe20DxhXFlKjsXw.jpeg" /></figure><p><strong>Describe Function</strong></p><p>In Python, we will be utilizing the describe() method to obtain a comprehensive summary of statistics from a given dataframe. This summary encompasses essential metrics such as mean, count, standard deviation, percentiles, as well as minimum and maximum values for the features under consideration.</p><p>For a deeper understanding and additional information, you can refer to the official documentation: [<a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.describe.html">pandas.DataFrame.describe</a>].</p><pre>price_stats = df[&#39;sugar_world&#39;].describe()<br>print(price_stats)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*UroBqDODMbAO2xNnWF5dgQ.jpeg" /></figure><p><strong>Histogram</strong></p><p>Furthermore, we can enhance our analysis by creating histograms to visually represent the distribution of data. Histograms provide valuable insights into the frequency and spread of values within each feature.</p><pre>plt.hist(df[&#39;sugar_world&#39;], bins=20)<br>plt.xlabel(&#39;sugar_world&#39;)<br>plt.xticks(rotation=45)<br>plt.ylabel(&#39;Frequency&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*tm0awC6_gqxYRIAaID4vag.jpeg" /></figure><pre>sns.distplot(df[&#39;sugar_world&#39;], fit=norm)<br><br># Get the fitted parameters of the normal distribution<br>(mu, sigma) = norm.fit(df[&#39;sugar_world&#39;])<br>print(f&#39;Mean (mu) = {mu:.2f} and Standard Deviation (sigma) = {sigma:.2f}&#39;)<br><br># Add legend and labels to the plot<br>plt.legend([f&#39;Fitted Normal Distribution ($\mu=${mu:.2f} and $\sigma=${sigma:.2f})&#39;], loc=&#39;best&#39;)<br>plt.ylabel(&#39;Frequency&#39;)<br>plt.xlabel(&#39;Sugar World Price&#39;)<br>plt.title(&#39;Sugar Price Distribution&#39;)<br><br># Create a QQ-plot to assess normality<br>fig = plt.figure()<br>res = stats.probplot(df[&#39;sugar_world&#39;], plot=plt)<br>plt.ylabel(&#39;Price&#39;)<br>plt.title(&#39;Probability Plot of Sugar Price&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*6BFTgfgBsWFak97UmtLY5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*JKuilCa9g-Cyq3hGDqpnJw.png" /></figure><p>Here is how to interpret a Probability Plot:</p><p>* Straight Line: If the points lie approximately on a straight line, it indicates that the data is close to the normal distribution. This means that the data’s quantiles match those of the theoretical normal distribution.</p><p>* Curved Line: If the points curve away from the straight line in either direction, it suggests that the data deviates from normality. The direction of the curve indicates the type of deviation (skewness) in the data.</p><p>* S-Shaped Curve: An S-shaped curve suggests heavy-tailed or lighter-tailed distributions compared to the normal distribution.</p><p>* Points Outside Line: Points outside the line suggest outliers or extreme values.</p><p>Let’s calculate 95th percentile of ‘sugar_world’ prices</p><pre>percentile_95 = np.percentile(df[&#39;sugar_world&#39;], 95)<br>print(f&quot;The 95th percentile of &#39;sugar_world&#39; prices is: {percentile_95:.2f}&quot;)</pre><p>The 95th percentile, specifically, is the value below which 95% of the data points in a dataset lie. In other words, if you calculate the 95th percentile of a dataset, it indicates that 95% of the data points are below or equal to that value, and only 5% of the data points are above it. It’s often used to identify extreme values or outliers in a dataset and to understand the distribution of data beyond the bulk of the values.</p><p><strong>Performing random sampling on our dataset to observe the length of price data points per year</strong></p><pre>yr_list = df[&#39;year&#39;].unique()<br><br>rand_year = random.choice(yr_list)<br><br>print(rand_year)<br>print(len(df.loc[df[&#39;year&#39;] == rand_year, [&#39;year&#39;, &#39;sugar_world&#39;]]))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/78/1*wCS5TC7UV676r0DzWifnqA.jpeg" /></figure><p>Utilizing the findings from the random sampling regarding the length of price data points per year, we have determined that there are 12 prices recorded per year. This insight enables us to derive quarterly prices for the ‘sugar_world’ feature per year.</p><p>The following code snippet demonstrates the aggregation process and the creation of a quarterly dataframe for year 1960:</p><pre>df_sugar= df[[&#39;year&#39;, &#39;sugar_world&#39;]]<br>df_sugar_qrtr = df_sugar[:12].copy()<br>df_sugar_1960 = df_sugar_qrtr.copy()<br><br>df_sugar_1960[&#39;qrtr&#39;] = 0<br>df_sugar_1960.loc[:2, &#39;qrtr&#39;] = df_sugar_1960[&#39;sugar_world&#39;][:3].mean()<br>df_sugar_1960.loc[3:5, &#39;qrtr&#39;] = df_sugar_1960[&#39;sugar_world&#39;][3:6].mean()<br>df_sugar_1960.loc[6:8, &#39;qrtr&#39;] = df_sugar_1960[&#39;sugar_world&#39;][6:9].mean()<br>df_sugar_1960.loc[9:11,&#39;qrtr&#39;] = df_sugar_1960[&#39;sugar_world&#39;][9:12].mean()<br>df_sugar_1960[:12]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*FvJXk5ljPK7Rk68l3kPHig.jpeg" /></figure><pre>df_sugar_quarterly = df.copy()<br><br># Initialize the &#39;qrtr&#39; column with zeros<br>df_sugar_quarterly[&#39;price_quarterly&#39;] = 0<br><br># Define the range and step size<br>start = 0<br>end = len(df_sugar_quarterly)<br>step = 3<br><br># Loop through the specified range with the given step size<br>for i in range(start, end, step):<br>    current_range = (i, i+2)<br>    mean_qrtr = df_sugar_quarterly[&#39;sugar_world&#39;][current_range[0]:current_range[1]+1].mean()<br>    df_sugar_quarterly.loc[current_range[0]:current_range[1], &#39;price_quarterly&#39;] = mean_qrtr<br><br>df_sugar_quarterly</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*MU9CSnzJgRaXp4VbFfDE9A.jpeg" /></figure><p>By consolidating the data in this manner, we attain a finer perspective on the variances in sugar prices over the course of the year quarterly.</p><p><strong>Visualize Quarterly Sugar Trends</strong></p><p>In this section, we delve into the process of visualizing quarterly sugar price trends over the years using a carefully crafted code snippet. The primary objective is to provide insights into how sugar prices have fluctuated throughout time on a quarterly basis. The code performs multiple steps, including the creation of a subset dataframe that retains essential information while removing duplicates. Subsequently, it employs data visualization techniques to present the findings in a comprehensible manner.</p><p>Let’s explore the code that accomplishes these tasks and sheds light on the quarterly trends of sugar prices. Through the ensuing visualizations, we gain a clearer understanding of the dynamics and patterns that shape the sugar market.</p><pre># Create a new subset df for year and qrtr prices,removing duplicates<br>df_sugar_no_dup =  df_sugar_quarterly.copy()<br>df_sugar_no_dup = df_sugar_no_dup.drop(&#39;sugar_world&#39;, axis = 1)<br>df_sugar_no_dup = df_sugar_no_dup.drop_duplicates()<br><br># Plot<br>plt.style.use(&#39;seaborn&#39;)<br>ax = df_sugar_no_dup[[&#39;year&#39;, &#39;price_quarterly&#39;]].plot(kind=&#39;area&#39;, x=&#39;year&#39;, y=&#39;price_quarterly&#39;, figsize=(12, 8))<br>plt.grid(True, linestyle=&#39;--&#39;, alpha=0.7)<br>ax.fill_between(df_sugar_no_dup[&#39;year&#39;], df_sugar_no_dup[&#39;price_quarterly&#39;], color=&#39;skyblue&#39;, alpha=0.4)<br>plt.title(&#39;Quarterly Sugar Trends Over the Years&#39;)<br>plt.xlabel(&#39;Year&#39;)<br>plt.ylabel(&#39;Quarterly Average&#39;)<br>plt.legend([&quot;Quarterly Average&quot;])<br>plt.show();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*-rjqKj13KAagJ6lMHS57Bw.png" /></figure><p><strong>A Yearly Subset</strong></p><p>In our endeavor to gain deeper insights into the dynamics of sugar prices, we expand our analysis to encompass a yearly perspective. This undertaking entails the creation of a new subset derived from the main dataset, allowing us to cultivate a more comprehensive yearly outlook. Through the process of aggregating sugar prices over annual intervals, we can unveil broader patterns, identify enduring trends, and extract valuable insights that might be obscured within shorter timeframes. This approach empowers us to capture the overarching essence of the sugar market’s behavior and its interaction with the broader economic context.</p><pre># Subset for &#39;sugar_world&#39; &amp; &#39;year&#39; column<br>df_sugar = df[[&#39;year&#39;, &#39;sugar_world&#39;]]<br><br># Group by week and calculate mean of &#39;sugar_world&#39;, &#39;sugar_eu&#39;, and &#39;sugar_us&#39; columns<br>df_sugar_yearly = df_sugar.groupby(&#39;year&#39;).mean()<br>df_sugar_yearly</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/148/1*iRmKFEMhU1rt7DuoPpGCXQ.jpeg" /></figure><pre>df_sugar_yearly.plot(kind=&#39;line&#39;, y=&#39;sugar_world&#39;)<br>plt.xlabel(&#39;Year&#39;)<br>plt.ylabel(&#39;Sugar World Price&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*o-wVRnuia1FaHK1e13li5Q.png" /></figure><p><strong>Incorporate the graphical representation of both the quarterly and yearly price trends.</strong></p><pre># Set grid style<br>sns.set(style=&#39;darkgrid&#39;)<br><br># Create a figure and an array of subplots with 2 rows and 1 column<br>fig, axs = plt.subplots(2, 1, figsize=(12, 12))<br><br># Plot the line plot in the first subplot<br>df_sugar_yearly.plot(kind=&#39;line&#39;, y=&#39;sugar_world&#39;, ax=axs[0])<br>axs[0].set_title(&#39;Sugar World Price Over the Years&#39;)<br>axs[0].set_ylabel(&#39;Sugar World Price&#39;)<br>axs[0].set_xlabel(&#39;Year&#39;)<br>axs[0].legend([&quot;Yearly Sugar World Price&quot;])<br>axs[0].grid(True, linestyle=&#39;--&#39;, alpha=0.7)<br><br># Plot the area plot in the second subplot<br>ax = df_sugar_quarterly[[&#39;year&#39;, &#39;price_quarterly&#39;]].plot(kind=&#39;area&#39;, x=&#39;year&#39;, y=&#39;price_quarterly&#39;, ax=axs[1])<br>ax.grid(True, linestyle=&#39;--&#39;, alpha=0.7)<br>ax.fill_between(df_sugar_quarterly[&#39;year&#39;], df_sugar_quarterly[&#39;price_quarterly&#39;], color=&#39;skyblue&#39;, alpha=0.4)<br>ax.set_title(&#39;Quarterly Sugar Trends Over the Years&#39;)<br>ax.set_xlabel(&#39;Year&#39;)<br>ax.set_ylabel(&#39;Quarterly Price Average&#39;)<br>ax.legend([&quot;Quarterly Price Average&quot;])<br><br>plt.tight_layout()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPNvyDWZILVaG9RWEZvcAw.png" /></figure><p>Insights for use Cases:</p><p><strong>Industry Insights:</strong> Sugar producers, suppliers, and traders can gain insights into market dynamics to make informed decisions regarding production, inventory management, and trading strategies.</p><p><strong>Policy and Trade Analysis: </strong>Policymakers can use the data to understand the effects of trade policies, subsidies, and regulations on global sugar prices.</p><p><strong>Consumer Behavior:</strong> Understand how changes in sugar prices might influence consumer behavior, affecting consumption patterns and preferences.</p><p><strong>Investment Decisions:</strong> Investors can use price trend analysis to assess potential investment opportunities within the sugar industry.</p><p><strong>Conclusion:</strong></p><p>In the culmination of our Exploratory Data Analysis (EDA) journey, we have uncovered noteworthy insights, particularly in relation to the quarterly and yearly price trends of the global sugar market. These revelations contribute to a more comprehensive understanding of the intricate dynamics within this industry.</p><p>Our analysis included examining the distribution of sugar prices through a histogram, which provided a visual representation of the data’s frequency distribution. Additionally, we calculated percentiles, specifically focusing on the 95th percentile, to understand the range within which the majority of data points fall.</p><p>Furthermore, we employed a Quantile-Quantile (QQ) plot titled Probability Plot, which helped us assess the normality of the data distribution by comparing the quantiles of our dataset to those of a theoretical normal distribution. This plot served as an insightful diagnostic tool to evaluate the fit of our data to the normal distribution assumption.</p><p>Through meticulous data analysis and adept visualization techniques, we have highlighted significant patterns and trends, empowering stakeholders with the information necessary to make informed decisions and leverage the evolving prospects within the realm of sugar trading.</p><p>If you have any questions or suggestions, please don’t hesitate to reach out.</p><p>Thank you so much for reading!</p><p><strong>Herwin Abedes</strong></p><p>Let’s connect!🔗<br><a href="https://www.linkedin.com/in/herwin-abedes-12364796/">LinkedIn</a> • <a href="https://github.com/sedeba19">GitHub</a> •</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db83a9e36ee4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>