{"id":1067,"date":"2023-07-27T19:03:03","date_gmt":"2023-07-27T19:03:03","guid":{"rendered":"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/"},"modified":"2023-07-27T19:03:03","modified_gmt":"2023-07-27T19:03:03","slug":"python-test-uitvoeren","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/","title":{"rendered":"Runtimetests uitvoeren in python"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\"><strong>Runtesten<\/strong> zijn een statistische test die wordt gebruikt om te bepalen of een dataset al dan niet afkomstig is van een willekeurig proces.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De<\/span> <a href=\"https:\/\/statorials.org\/nl\/hypothesetesten-1\/\" target=\"_blank\" rel=\"noopener noreferrer\">nul- en alternatieve hypothesen<\/a> <span style=\"color: #000000;\">van de test zijn als volgt:<\/span><\/p>\n<p> <span style=\"color: #000000;\">H <sub>0<\/sub> (nul): de gegevens zijn willekeurig geproduceerd.<\/span><\/p>\n<p> <span style=\"color: #000000;\">H <sub>a<\/sub> (alternatief): De gegevens zijn <em>niet<\/em> willekeurig gegenereerd.<\/span><\/p>\n<p> <span style=\"color: #000000;\">In deze tutorial worden twee methoden uitgelegd die u kunt gebruiken om testruns in Python uit te voeren.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld: voer een test uit in Python<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">We kunnen testruns uitvoeren op een bepaalde dataset in Python met behulp van de <a href=\"https:\/\/www.statsmodels.org\/stable\/generated\/statsmodels.sandbox.stats.runs.runstest_1samp.html?highlight=runstest#statsmodels.sandbox.stats.runs.runstest_1samp\" target=\"_blank\" rel=\"noopener noreferrer\">runtest_1samp()<\/a> functie uit de <strong>statsmodels-<\/strong> bibliotheek, die de volgende syntaxis gebruikt:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>runstest_1samp(x, cutoff=&#8217;gemiddelde&#8216;, correctie=True)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>x:<\/strong> Array van gegevenswaarden<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>cutoff:<\/strong> De drempelwaarde die moet worden gebruikt om de gegevens in grote en kleine waarden te verdelen. De standaardwaarde is \u2018gemiddeld\u2019, maar u kunt als alternatief ook \u2018mediaan\u2019 opgeven.<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>Correctie:<\/strong> Voor een steekproefomvang kleiner dan 50 trekt deze functie 0,5 af als correctie. U kunt False opgeven om deze oplossing uit te schakelen.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Deze functie produceert een z-teststatistiek en de bijbehorende p-waarde als uitvoer.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u Test Run uitvoert met deze functie in Python:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">from<\/span> statsmodels. <span style=\"color: #3366ff;\">sandbox<\/span> . <span style=\"color: #3366ff;\">stats<\/span> . <span style=\"color: #3366ff;\">runs<\/span> <span style=\"color: #008000;\">import<\/span> runstest_1samp \n\n<span style=\"color: #008080;\">#create dataset<\/span>\ndata = [12, 16, 16, 15, 14, 18, 19, 21, 13, 13]\n\n<span style=\"color: #008080;\">#Perform Runs test\n<\/span>runstest_1samp(data, correction= <span style=\"color: #008000;\">False<\/span> )\n\n(-0.6708203932499369, 0.5023349543605021)\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De z-teststatistiek blijkt <strong>-0,67082<\/strong> te zijn en de overeenkomstige p-waarde is <strong>0,50233<\/strong> . Omdat deze p-waarde niet kleiner is dan \u03b1 = 0,05, slagen we er niet in de nulhypothese te verwerpen. We hebben genoeg bewijs om te zeggen dat de gegevens willekeurig zijn gegenereerd.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Opmerking<\/strong> : voor dit voorbeeld hebben we de correctie uitgeschakeld bij het berekenen van de teststatistiek. Dit komt overeen met de formule die wordt gebruikt om <a href=\"https:\/\/statorials.org\/nl\/test-uitvoeren-in-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Test Runs in R<\/a> uit te voeren, waarbij geen correctie wordt gebruikt bij het uitvoeren van de test.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Runtesten zijn een statistische test die wordt gebruikt om te bepalen of een dataset al dan niet afkomstig is van een willekeurig proces. De nul- en alternatieve hypothesen van de test zijn als volgt: H 0 (nul): de gegevens zijn willekeurig geproduceerd. H a (alternatief): De gegevens zijn niet willekeurig gegenereerd. In deze tutorial worden [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1067","post","type-post","status-publish","format-standard","hentry","category-gids"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tests uitvoeren in Python - Statorials<\/title>\n<meta name=\"description\" content=\"Een eenvoudige uitleg over het uitvoeren van Test Runs in Python, inclusief een voorbeeld.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tests uitvoeren in Python - Statorials\" \/>\n<meta property=\"og:description\" content=\"Een eenvoudige uitleg over het uitvoeren van Test Runs in Python, inclusief een voorbeeld.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T19:03:03+00:00\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u00a0Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/\",\"url\":\"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/\",\"name\":\"Tests uitvoeren in Python - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-27T19:03:03+00:00\",\"dateModified\":\"2023-07-27T19:03:03+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"Een eenvoudige uitleg over het uitvoeren van Test Runs in Python, inclusief een voorbeeld.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Runtimetests uitvoeren in python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/nl\/#website\",\"url\":\"https:\/\/statorials.org\/nl\/\",\"name\":\"Statorials\",\"description\":\"Uw gids voor statistische competentie\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder\",\"sameAs\":[\"http:\/\/statorials.org\/nl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tests uitvoeren in Python - Statorials","description":"Een eenvoudige uitleg over het uitvoeren van Test Runs in Python, inclusief een voorbeeld.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/","og_locale":"de_DE","og_type":"article","og_title":"Tests uitvoeren in Python - Statorials","og_description":"Een eenvoudige uitleg over het uitvoeren van Test Runs in Python, inclusief een voorbeeld.","og_url":"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/","og_site_name":"Statorials","article_published_time":"2023-07-27T19:03:03+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"1\u00a0Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/","url":"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/","name":"Tests uitvoeren in Python - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-27T19:03:03+00:00","dateModified":"2023-07-27T19:03:03+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"Een eenvoudige uitleg over het uitvoeren van Test Runs in Python, inclusief een voorbeeld.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/python-test-uitvoeren\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/python-test-uitvoeren\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Runtimetests uitvoeren in python"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/nl\/#website","url":"https:\/\/statorials.org\/nl\/","name":"Statorials","description":"Uw gids voor statistische competentie","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder","sameAs":["http:\/\/statorials.org\/nl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/comments?post=1067"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1067\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}