{"id":114,"date":"2024-11-10T18:00:19","date_gmt":"2024-11-10T18:00:19","guid":{"rendered":"https:\/\/akosgombkoto.info\/?page_id=114"},"modified":"2025-01-15T09:02:24","modified_gmt":"2025-01-15T09:02:24","slug":"korrelacios-hoterkep","status":"publish","type":"page","link":"https:\/\/akosgombkoto.info\/en\/korrelacios-hoterkep\/","title":{"rendered":"Korrel\u00e1ci\u00f3s h\u0151t\u00e9rk\u00e9p Magyarorsz\u00e1g gazdas\u00e1gi szektorair\u00f3l"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;Header&#8221; _builder_version=&#8221;4.27.3&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;0px||0px||false|false&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row column_structure=&#8221;1_2,1_2&#8243; _builder_version=&#8221;4.27.3&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;0px|||||&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_image src=&#8221;https:\/\/akosgombkoto.info\/wp-content\/uploads\/2025\/01\/data-science-070-2.png&#8221; title_text=&#8221;data-science-070-2&#8243; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; max_width_tablet=&#8221;500px&#8221; max_width_phone=&#8221;220px&#8221; max_width_last_edited=&#8221;off|tablet&#8221; max_height_tablet=&#8221;200px&#8221; max_height_phone=&#8221;100px&#8221; max_height_last_edited=&#8221;on|phone&#8221; custom_margin=&#8221;|||-8vw|false|false&#8221; custom_margin_tablet=&#8221;|||0vw|false|false&#8221; custom_margin_phone=&#8221;&#8221; custom_margin_last_edited=&#8221;on|tablet&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; sticky_enabled=&#8221;0&#8243;][\/et_pb_image][\/et_pb_column][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;4.27.3&#8243; _module_preset=&#8221;default&#8221; custom_padding=&#8221;||||false|false&#8221; custom_padding_tablet=&#8221;0px||||false|false&#8221; custom_padding_last_edited=&#8221;off|desktop&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.27.3&#8243; _module_preset=&#8221;d72c0383-6487-4f2c-ac5c-7d48a6376757&#8243; header_font=&#8221;Roboto Slab||||||||&#8221; header_text_color=&#8221;#000000&#8243; header_font_size=&#8221;46px&#8221; header_line_height=&#8221;1.2em&#8221; custom_margin=&#8221;||10px||false|false&#8221; header_font_size_tablet=&#8221;40px&#8221; header_font_size_phone=&#8221;20px&#8221; header_font_size_last_edited=&#8221;on|phone&#8221; locked=&#8221;off&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<h1>Correlation Heatmap of Hungary's Economic Sectors<\/h1>\n<p>&nbsp;<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; text_font=&#8221;Roboto Mono||||||||&#8221; text_text_color=&#8221;#fcb03a&#8221; text_font_size=&#8221;18px&#8221; text_line_height=&#8221;1.8em&#8221; background_color=&#8221;#042f4f&#8221; custom_padding=&#8221;15px||15px|20px|true|false&#8221; global_module=&#8221;471&#8243; saved_tabs=&#8221;all&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p><strong>Scroll down to the first section for industrial and e.g. HR application examples.<\/strong><\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/akosgombkoto.info\/wp-content\/uploads\/2024\/11\/heatmap.jpg&#8221; title_text=&#8221;heatmap&#8221; show_in_lightbox=&#8221;on&#8221; _builder_version=&#8221;4.27.3&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_image][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;Blog&#8221; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.27.3&#8243; _module_preset=&#8221;default&#8221; text_font=&#8221;Roboto Mono||||||||&#8221; text_text_color=&#8221;#fcb03a&#8221; text_font_size=&#8221;18px&#8221; text_line_height=&#8221;1.8em&#8221; background_color=&#8221;#042f4f&#8221; custom_padding=&#8221;15px||15px|20px|true|false&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p><strong>Industrial and e.g. HR Application Examples\n(Non-industrial examples, such as HR, are located below the industrial example block.):<\/strong><\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; text_font=&#8221;Roboto Mono||||||||&#8221; text_text_color=&#8221;#FFFFFF&#8221; text_font_size=&#8221;16px&#8221; text_line_height=&#8221;1.8em&#8221; background_color=&#8221;#042f4f&#8221; custom_padding=&#8221;20px|20px|20px|20px|true|true&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p style=\"text-align: justify;\">Industrial Example:<\/p>\n<p style=\"text-align: justify;\">The Meaning and Usefulness of Correlation (Exploratory Data Analysis \u2013 EDA) in Searching for Industrial Relationships:<br \/>Exploratory Data Analysis (EDA) aims to visualize, understand, and draw preliminary conclusions from data without predefined hypotheses. During EDA, we explore data patterns, trends, and potential relationships.<\/p>\n<p style=\"text-align: justify;\">In focus with correlation analysis<br \/>Correlation analysis is a key tool in EDA that determines whether there is a relationship between two or more variables. Correlation indicates the strength and direction of a relationship: it can be positive (both variables increase together), negative (one increases as the other decreases), or absent (the variables are independent).<\/p>\n<p style=\"text-align: justify;\">The Role of Correlation Analysis in EDA: Unveiling Relationships Between Data:<\/p>\n<p style=\"text-align: justify;\">During EDA, correlation helps reveal how variables influence each other. For example, in a manufacturing database, examining the relationship between machine temperature and product quality can help determine whether high temperatures lead to poor quality.<\/p>\n<p style=\"text-align: justify;\">Detecting Trends and Patterns:<\/p>\n<p style=\"text-align: justify;\">Correlation analysis can uncover trends and patterns. If two variables strongly correlate, they may move together, indicating a shared effect or cause.<\/p>\n<p style=\"text-align: justify;\">Recognizing Multicollinearity:<\/p>\n<p style=\"text-align: justify;\">Multicollinearity occurs when two or more independent variables strongly correlate. This can pose challenges in regression modeling, as it may distort results. Correlation analysis in EDA helps identify such issues.<br \/>Laying the Foundation for Further Analysis:<\/p>\n<p style=\"text-align: justify;\">Correlation aids in the initial understanding of data and lays the groundwork for further analysis, such as regression modeling, where the goal might be to predict one variable based on others.<\/p>\n<p style=\"text-align: justify;\">Data Cleaning:<\/p>\n<p style=\"text-align: justify;\">Correlation analysis can also assist in data cleaning. If two variables strongly correlate, removing one from further analysis may reduce redundancy and complexity.<\/p>\n<p style=\"text-align: justify;\">Practical Example:<br \/>Suppose we are working with production data from a manufacturing plant and want to identify factors that most influence product quality. During EDA, we examine the correlation between different variables, such as:<\/p>\n<p style=\"text-align: justify;\">Temperature vs. Product Quality<br \/>Pressure vs. Product Quality<br \/>Speed vs. Product Quality<\/p>\n<p style=\"text-align: justify;\">A correlation matrix and visualizations (e.g., heatmaps) can quickly highlight the most significant factors to consider for optimizing production.<\/p>\n<p style=\"text-align: justify;\">Correlation analysis in EDA is a powerful tool for uncovering relationships in data, detecting anomalies, and preparing for deeper analysis. Properly conducted correlation analysis can provide a solid foundation for predictive models and other statistical analyses.<\/p>\n<p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.3&#8243; _module_preset=&#8221;default&#8221; text_font=&#8221;Roboto Mono||||||||&#8221; text_text_color=&#8221;#FFFFFF&#8221; text_font_size=&#8221;16px&#8221; text_line_height=&#8221;1.8em&#8221; background_color=&#8221;#042f4f&#8221; custom_padding=&#8221;20px|20px|20px|20px|true|true&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p style=\"text-align: justify;\">HR Example:<\/p>\n<p style=\"text-align: justify;\">1. Training Programs and Performance Improvement:<br \/>Correlation analysis can determine whether employee performance improves after participating in various training programs. For example, it can examine the correlation between training hours and annual performance evaluation results. A positive correlation suggests that training contributes to improved performance, making it worthwhile to offer additional training.<\/p>\n<p style=\"text-align: justify;\">2. Workplace Atmosphere and Sick Leave:<br \/>The relationship between workplace atmosphere (e.g., relationships with colleagues) and sick leave data can also be analyzed. A strong correlation between negative workplace relationships and frequent sick leave could indicate the need to improve the workplace environment through team-building activities or conflict resolution training.<\/p>\n<p>[\/et_pb_text][et_pb_toggle title=&#8221;Korrel\u00e1ci\u00f3s Heatmap Magyarorsz\u00e1g gazdas\u00e1gi szektorair\u00f3l (leny\u00edl\u00f3 tartalom &#8211; kattints a jobb sz\u00e9ls\u0151 + ikonra)&#8221; open_toggle_text_color=&#8221;#fcb03a&#8221; open_toggle_background_color=&#8221;#042f4f&#8221; closed_toggle_text_color=&#8221;#fcb03a&#8221; closed_toggle_background_color=&#8221;#042f4f&#8221; icon_color=&#8221;#fcb03a&#8221; open_icon_color=&#8221;#fcb03a&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; title_font_size=&#8221;18px&#8221; title_line_height=&#8221;1.6em&#8221; closed_title_font_size=&#8221;18px&#8221; body_text_color=&#8221;#FFFFFF&#8221; body_font_size=&#8221;16px&#8221; body_line_height=&#8221;1.8em&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p style=\"text-align: justify;\" class=\"translation-block\">Based on data from the UNIDO website, the correlation matrix shows the relationships between the output values of Hungary's economic sectors.\n\nA \"heatmap\" provides an excellent basis for identifying basic relationships in exploratory data analysis (EDA).\nHowever, we must understand the concept of correlation and apply critical thinking!\nThe chart has a flaw: time \u2013 years do not correlate with anything (despite the chart showing different values), as time was the variable along which the data was collected. This is why it is indicated in the matrix.<\/p>\n<p style=\"text-align: justify;\">A correlation heatmap is one of the best tools in Exploratory Data Analysis (EDA) for visualizing relationships.<\/p>\n<p>[\/et_pb_toggle][et_pb_toggle title=&#8221;Korrel\u00e1ci\u00f3 \u00e9s kritikus gondolkod\u00e1s: (leny\u00edl\u00f3 tartalom &#8211; kattints a jobb sz\u00e9ls\u0151 + ikonra)&#8221; open_toggle_text_color=&#8221;#fcb03a&#8221; open_toggle_background_color=&#8221;#042f4f&#8221; closed_toggle_text_color=&#8221;#fcb03a&#8221; closed_toggle_background_color=&#8221;#042f4f&#8221; icon_color=&#8221;#fcb03a&#8221; open_icon_color=&#8221;#fcb03a&#8221; _builder_version=&#8221;4.27.3&#8243; _module_preset=&#8221;default&#8221; title_font_size=&#8221;18px&#8221; title_line_height=&#8221;1.6em&#8221; closed_title_font_size=&#8221;18px&#8221; body_text_color=&#8221;#FFFFFF&#8221; body_font_size=&#8221;16px&#8221; body_line_height=&#8221;1.8em&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p style=\"text-align: justify;\">Correlation measures the strength and direction of the relationship between two or more variables. Mathematically, it shows how one variable changes with another. The most common form is linear correlation, where the relationship between variables can be represented by a straight line.<\/p>\n<p style=\"text-align: justify;\">The correlation coefficient (usually denoted as r) expresses the strength and direction of the relationship:<\/p>\n<p style=\"text-align: justify;\" class=\"translation-block\">r = +1: Perfect positive correlation (both variables increase together).\nr = -1: Perfect negative correlation (one increases as the other decreases).\nr = 0: No linear correlation (no obvious relationship between the variables).\n\nPearson's correlation coefficient is the most commonly used, but there are other types, such as Spearman rank correlation.<\/p>\n<p style=\"text-align: justify;\"><strong>Why is Critical Thinking Important When Interpreting Correlation?<\/strong><br \/>While correlation is a valuable tool for studying relationships between variables, it\u2019s essential to interpret it critically because the results can be misleading for several reasons:<\/p>\n<p style=\"text-align: justify;\" class=\"translation-block\">Correlation Does Not Imply Causation:\nCorrelation does not mean that one variable causes the other. Two variables may correlate closely without a causal relationship. For example, research shows a correlation between frozen food consumption and divorce rates, but this does not imply a causal link.<\/p>\n<p style=\"text-align: justify;\" class=\"translation-block\">Third Variable (Confounding Factor):\nSometimes the relationship between two variables arises due to a third variable. For example, there might be a positive correlation between ice cream sales and sunburn, but the actual relationship is likely due to summer weather (the confounding factor), which drives both activities.<\/p>\n<p style=\"text-align: justify;\" class=\"translation-block\">Correlation Traps:\nThe value of the correlation coefficient can be misleading if we don\u2019t understand the context. For instance, a non-linear relationship may not show up well with Pearson\u2019s coefficient, even if a strong connection exists.<\/p>\n<p style=\"text-align: justify;\" class=\"translation-block\">Sample Size:\nSmall sample sizes can distort the correlation coefficient and fail to reflect the true relationship in the entire population. Ensuring a sufficiently large sample size is crucial for statistical validity.<\/p>\n<p style=\"text-align: justify;\" class=\"translation-block\">Effect of Outliers:\nExtreme values (outliers) can significantly impact the correlation coefficient, as Pearson\u2019s correlation is sensitive to them. A few outliers can increase variance and skew the correlation.<\/p>\n<p style=\"text-align: justify;\" class=\"translation-block\">Summary:\nCorrelation is a valuable tool for exploring relationships between variables, but it is crucial to understand that correlation does not imply causation. Correlation analyses should always be interpreted critically, considering possible confounding factors, sample size, and data type.<\/p>\n<p>[\/et_pb_toggle][et_pb_toggle title=&#8221;K\u00f3dmag: (leny\u00edl\u00f3 tartalom &#8211; kattints a jobb sz\u00e9ls\u0151 + ikonra)&#8221; open_toggle_text_color=&#8221;#fcb03a&#8221; open_toggle_background_color=&#8221;#042f4f&#8221; closed_toggle_text_color=&#8221;#fcb03a&#8221; closed_toggle_background_color=&#8221;#042f4f&#8221; icon_color=&#8221;#fcb03a&#8221; open_icon_color=&#8221;#fcb03a&#8221; _builder_version=&#8221;4.27.3&#8243; _module_preset=&#8221;default&#8221; title_font_size=&#8221;18px&#8221; title_line_height=&#8221;1.6em&#8221; closed_title_font_size=&#8221;18px&#8221; body_text_color=&#8221;#FFFFFF&#8221; body_font_size=&#8221;16px&#8221; body_line_height=&#8221;1.8em&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<pre>import pandas as pd<br \/>\nimport seaborn as sns<br \/>\nimport matplotlib.pyplot as plt<\/p>\n<p># CSV f\u00e1jl beolvas\u00e1sa (cser\u00e9ld ki a f\u00e1jl el\u00e9r\u00e9si \u00fatj\u00e1t)<\/p>\n<p>file_path = r'C:\\\\Users\\\\Akos\\\\Desktop\\\\Python\\\\UNIDO_MO_Gazdas\u00e1ga\\\\Mo_gazdasaga_korrelacio_csv_01.csv' # A f\u00e1jl el\u00e9r\u00e9si \u00fatja<\/p>\n<p>data = pd.read_csv(file_path)<\/p>\n<p># Korrel\u00e1ci\u00f3s m\u00e1trix kisz\u00e1m\u00edt\u00e1sa<\/p>\n<p>corr_matrix = data.corr()<\/p>\n<p># Heatmap k\u00e9sz\u00edt\u00e9se<\/p>\n<p>plt.figure(figsize=(16, 12))<\/p>\n<p>sns.heatmap(corr_matrix, annot=True, cmap='coolwarm', fmt='.2f', linewidths=0.5)<\/p>\n<p>plt.title(\"Part of Correlation Matrix of Hungary's Economic Sectors (Heatmap) from 2005 to 2021: source: UNIDO\")<\/p>\n<p>plt.subplots_adjust(top=0.97)<\/p>\n<p>plt.subplots_adjust(bottom=0.36)<\/p>\n<p>plt.subplots_adjust(left=0.215, right=1.0)<\/p>\n<p>plt.show()[\/et_pb_toggle][et_pb_text _builder_version=\"4.27.3\" _module_preset=\"default\" text_font=\"Roboto Mono||||||||\" text_text_color=\"#fcb03a\" text_font_size=\"18px\" text_line_height=\"1.8em\" background_color=\"#042f4f\" custom_padding=\"15px||15px|20px|true|false\" global_colors_info=\"{}\"]<\/p>\n<p><strong>Data source:<\/strong><\/p>\n<p>[\/et_pb_text][et_pb_image src=\"https:\/\/akosgombkoto.info\/wp-content\/uploads\/2024\/11\/5_Adatforras_UNIDOKepernyokep-2024-11-09-235155.png\" title_text=\"5_Adatforras_UNIDOK\u00e9perny\u0151k\u00e9p 2024-11-09 235155\" _builder_version=\"4.27.3\" _module_preset=\"default\" global_colors_info=\"{}\"][\/et_pb_image][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>","protected":false},"excerpt":{"rendered":"<p>Korrel\u00e1ci\u00f3s Heatmap Magyarorsz\u00e1g gazdas\u00e1gi szektorair\u00f3l &nbsp;Az ipari \u00e9s p\u00e9ld\u00e1ul HR-es alkalmaz\u00e1si p\u00e9ld\u00e1\u00e9rt g\u00f6rgess lejjebb az els\u0151 bekezd\u00e9sre. Ipari \u00e9s p\u00e9ld\u00e1ul HR-es alkalmaz\u00e1si p\u00e9ld\u00e1k (nem ipari p\u00e9ld\u00e1k mint p\u00e9ld\u00e1ul a HR-es az ipari p\u00e9lda blokk alatt tal\u00e1lhat\u00f3):Ipari p\u00e9lda: A korrel\u00e1ci\u00f3 (felt\u00e1r\u00f3 adatelemz\u00e9s &#8211; EDA) \u00e9rtelme \u00e9s haszn\u00e1lhat\u00f3s\u00e1ga ipari \u00f6sszef\u00fcgg\u00e9sek keres\u00e9se eset\u00e9n:A fet\u00e1r\u00f3 adatelemz\u00e9s (Exploratory Data Analysis, [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-114","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/akosgombkoto.info\/en\/wp-json\/wp\/v2\/pages\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/akosgombkoto.info\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/akosgombkoto.info\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/akosgombkoto.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/akosgombkoto.info\/en\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":53,"href":"https:\/\/akosgombkoto.info\/en\/wp-json\/wp\/v2\/pages\/114\/revisions"}],"predecessor-version":[{"id":682,"href":"https:\/\/akosgombkoto.info\/en\/wp-json\/wp\/v2\/pages\/114\/revisions\/682"}],"wp:attachment":[{"href":"https:\/\/akosgombkoto.info\/en\/wp-json\/wp\/v2\/media?parent=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}