{"id":3997,"date":"2023-07-14T06:45:38","date_gmt":"2023-07-14T06:45:38","guid":{"rendered":"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/"},"modified":"2023-07-14T06:45:38","modified_gmt":"2023-07-14T06:45:38","slug":"rde-bir-bolum-olusturuldu","status":"publish","type":"post","link":"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/","title":{"rendered":"R&#39;de createdatapartition() i\u015flevi nas\u0131l kullan\u0131l\u0131r?"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Model olu\u015fturma amac\u0131yla bir veri \u00e7er\u00e7evesini e\u011fitim ve test k\u00fcmelerine b\u00f6lmek i\u00e7in R&#8217;deki <strong>caret<\/strong> paketinin <strong>createDataPartition()<\/strong> i\u015flevini kullanabilirsiniz.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Bu i\u015flev a\u015fa\u011f\u0131daki temel s\u00f6zdizimini kullan\u0131r:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>createDataPartition(y, kere = 1, p = 0,5, liste = DO\u011eRU, \u2026)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Alt\u0131n:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>y<\/strong> : sonu\u00e7lar\u0131n vekt\u00f6r\u00fc<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>kez<\/strong> : olu\u015fturulacak b\u00f6l\u00fcm say\u0131s\u0131<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>p<\/strong> : e\u011fitim setinde kullan\u0131lacak veri y\u00fczdesi<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>list<\/strong> : sonu\u00e7lar\u0131n listede saklan\u0131p saklanmayaca\u011f\u0131<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki \u00f6rnekte bu fonksiyonun pratikte nas\u0131l kullan\u0131laca\u011f\u0131 g\u00f6sterilmektedir.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>\u00d6rnek: R&#8217;de createDataPartition() i\u015flevinin kullan\u0131lmas\u0131<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">R&#8217;de \u00f6\u011frencilerin \u00e7al\u0131\u015ft\u0131klar\u0131 <strong>saatler<\/strong> ve final s\u0131nav\u0131ndaki kar\u015f\u0131l\u0131k gelen <strong>puanlar\u0131<\/strong> hakk\u0131nda bilgi i\u00e7eren 1000 sat\u0131rl\u0131k bir veri \u00e7er\u00e7evemiz oldu\u011funu varsayal\u0131m:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#make this example reproducible\n<\/span>set. <span style=\"color: #3366ff;\">seeds<\/span> (0)\n\n<span style=\"color: #008080;\">#create data frame\n<\/span>df &lt;- data. <span style=\"color: #3366ff;\">frame<\/span> (hours=runif(1000, min=0, max=10),\n                 score=runif(1000, min=40, max=100))\n\n<span style=\"color: #008080;\">#view head of data frame\n<\/span>head(df)\n\n     hours score\n1 8.966972 55.93220\n2 2.655087 71.84853\n3 3.721239 81.09165\n4 5.728534 62.99700\n5 9.082078 97.29928\n6 2.016819 47.10139<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">Final s\u0131nav\u0131 notunu tahmin etmek i\u00e7in \u00e7al\u0131\u015f\u0131lan saatleri kullanan <a href=\"https:\/\/statorials.org\/tr\/dogrusal-regresyon-1\/\" target=\"_blank\" rel=\"noopener\">basit bir do\u011frusal regresyon modeline<\/a> uymak istedi\u011fimizi varsayal\u0131m.<\/span><\/span><\/p>\n<p> <span style=\"color: #000000;\">Diyelim ki modeli veri \u00e7er\u00e7evesindeki sat\u0131rlar\u0131n %80&#8217;inde e\u011fitmek ve geri kalan %20&#8217;lik sat\u0131rlarda test etmek istiyoruz.<\/span><\/p>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki kod, veri \u00e7er\u00e7evesini e\u011fitim ve test k\u00fcmelerine b\u00f6lmek i\u00e7in <strong>caret<\/strong> paketinin <strong>createDataPartition()<\/strong> i\u015flevinin nas\u0131l kullan\u0131laca\u011f\u0131n\u0131 g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008000;\">library<\/span> (caret)\n\n<span style=\"color: #008080;\">#partition data frame into training and testing sets\n<\/span>train_indices &lt;- createDataPartition(df$score, times= <span style=\"color: #008000;\">1<\/span> , p= <span style=\"color: #008000;\">.8<\/span> , list= <span style=\"color: #008000;\">FALSE<\/span> )\n\n<span style=\"color: #008080;\">#create training set\n<\/span>df_train &lt;- df[train_indices, ]\n\n<span style=\"color: #008080;\">#create testing set\n<\/span>df_test &lt;- df[-train_indices, ]\n\n<span style=\"color: #008080;\">#view number of rows in each set\n<\/span>nrow(df_train)\n\n[1] 800\n\nnrow(df_test)\n\n[1] 200\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">E\u011fitim veri setimizin orijinal veri setinin %80&#8217;i olan 800 sat\u0131r i\u00e7erdi\u011fini g\u00f6rebiliriz.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Benzer \u015fekilde test veri setimizin orijinal veri setinin %20&#8217;si olan 200 sat\u0131r i\u00e7erdi\u011fini g\u00f6rebiliriz.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Ayr\u0131ca her setin ilk sat\u0131rlar\u0131n\u0131 da g\u00f6rselle\u015ftirebiliriz:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#view head of training set<\/span>\nhead(df_train)\n\n     hours score\n1 8.966972 55.93220\n2 2.655087 71.84853\n3 3.721239 81.09165\n4 5.728534 62.99700\n5 9.082078 97.29928\n7 8.983897 42.34600\n\n<span style=\"color: #008080;\">#view head of testing set\n<\/span>head(df_test)\n\n      hours score\n6 2.016819 47.10139\n12 2.059746 96.67170\n18 7.176185 92.61150\n23 2.121425 89.17611\n24 6.516738 50.47970\n25 1.255551 90.58483\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Daha sonra e\u011fitim setini kullanarak regresyon modelini e\u011fitmeye ve test setini kullanarak performans\u0131n\u0131 de\u011ferlendirmeye devam edebiliriz.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Ek kaynaklar<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki e\u011fitimlerde R&#8217;deki di\u011fer yayg\u0131n i\u015flevlerin nas\u0131l kullan\u0131laca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/tr\/rde-k-kat-capraz-dogrulama\/\" target=\"_blank\" rel=\"noopener\">R&#8217;de K-Fold \u00e7apraz do\u011frulama nas\u0131l ger\u00e7ekle\u015ftirilir?<\/a><br \/> <a href=\"https:\/\/statorials.org\/tr\/coklu-dogrusal-regresyon-r\/\" target=\"_blank\" rel=\"noopener\">R&#8217;de \u00e7oklu do\u011frusal regresyon nas\u0131l ger\u00e7ekle\u015ftirilir<\/a><br \/> R&#8217;de lojistik regresyon nas\u0131l ger\u00e7ekle\u015ftirilir<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Model olu\u015fturma amac\u0131yla bir veri \u00e7er\u00e7evesini e\u011fitim ve test k\u00fcmelerine b\u00f6lmek i\u00e7in R&#8217;deki caret paketinin createDataPartition() i\u015flevini kullanabilirsiniz. Bu i\u015flev a\u015fa\u011f\u0131daki temel s\u00f6zdizimini kullan\u0131r: createDataPartition(y, kere = 1, p = 0,5, liste = DO\u011eRU, \u2026) Alt\u0131n: y : sonu\u00e7lar\u0131n vekt\u00f6r\u00fc kez : olu\u015fturulacak b\u00f6l\u00fcm say\u0131s\u0131 p : e\u011fitim setinde kullan\u0131lacak veri y\u00fczdesi list : sonu\u00e7lar\u0131n [&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-3997","post","type-post","status-publish","format-standard","hentry","category-rehber"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>R \u2013 Statorials&#039;ta createDataPartition() i\u015flevi nas\u0131l kullan\u0131l\u0131r?<\/title>\n<meta name=\"description\" content=\"Bu e\u011fitimde, bir veri k\u00fcmesini e\u011fitim ve test k\u00fcmelerine b\u00f6lmek i\u00e7in R&#039;deki createDataPartition() i\u015flevinin nas\u0131l kullan\u0131laca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r.\" \/>\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\/tr\/rde-bir-bolum-olusturuldu\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"R \u2013 Statorials&#039;ta createDataPartition() i\u015flevi nas\u0131l kullan\u0131l\u0131r?\" \/>\n<meta property=\"og:description\" content=\"Bu e\u011fitimde, bir veri k\u00fcmesini e\u011fitim ve test k\u00fcmelerine b\u00f6lmek i\u00e7in R&#039;deki createDataPartition() i\u015flevinin nas\u0131l kullan\u0131laca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-14T06:45:38+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=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/\",\"url\":\"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/\",\"name\":\"R \u2013 Statorials&#39;ta createDataPartition() i\u015flevi nas\u0131l kullan\u0131l\u0131r?\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/tr\/#website\"},\"datePublished\":\"2023-07-14T06:45:38+00:00\",\"dateModified\":\"2023-07-14T06:45:38+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\"},\"description\":\"Bu e\u011fitimde, bir veri k\u00fcmesini e\u011fitim ve test k\u00fcmelerine b\u00f6lmek i\u00e7in R&#39;deki createDataPartition() i\u015flevinin nas\u0131l kullan\u0131laca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ev\",\"item\":\"https:\/\/statorials.org\/tr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"R&#39;de createdatapartition() i\u015flevi nas\u0131l kullan\u0131l\u0131r?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/tr\/#website\",\"url\":\"https:\/\/statorials.org\/tr\/\",\"name\":\"Statorials\",\"description\":\"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/tr\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil\",\"sameAs\":[\"https:\/\/statorials.org\/tr\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"R \u2013 Statorials&#39;ta createDataPartition() i\u015flevi nas\u0131l kullan\u0131l\u0131r?","description":"Bu e\u011fitimde, bir veri k\u00fcmesini e\u011fitim ve test k\u00fcmelerine b\u00f6lmek i\u00e7in R&#39;deki createDataPartition() i\u015flevinin nas\u0131l kullan\u0131laca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r.","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\/tr\/rde-bir-bolum-olusturuldu\/","og_locale":"tr_TR","og_type":"article","og_title":"R \u2013 Statorials&#39;ta createDataPartition() i\u015flevi nas\u0131l kullan\u0131l\u0131r?","og_description":"Bu e\u011fitimde, bir veri k\u00fcmesini e\u011fitim ve test k\u00fcmelerine b\u00f6lmek i\u00e7in R&#39;deki createDataPartition() i\u015flevinin nas\u0131l kullan\u0131laca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r.","og_url":"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/","og_site_name":"Statorials","article_published_time":"2023-07-14T06:45:38+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Dr.benjamin anderson","Tahmini okuma s\u00fcresi":"2 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/","url":"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/","name":"R \u2013 Statorials&#39;ta createDataPartition() i\u015flevi nas\u0131l kullan\u0131l\u0131r?","isPartOf":{"@id":"https:\/\/statorials.org\/tr\/#website"},"datePublished":"2023-07-14T06:45:38+00:00","dateModified":"2023-07-14T06:45:38+00:00","author":{"@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48"},"description":"Bu e\u011fitimde, bir veri k\u00fcmesini e\u011fitim ve test k\u00fcmelerine b\u00f6lmek i\u00e7in R&#39;deki createDataPartition() i\u015flevinin nas\u0131l kullan\u0131laca\u011f\u0131 a\u00e7\u0131klanmaktad\u0131r.","breadcrumb":{"@id":"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/tr\/rde-bir-bolum-olusturuldu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Ev","item":"https:\/\/statorials.org\/tr\/"},{"@type":"ListItem","position":2,"name":"R&#39;de createdatapartition() i\u015flevi nas\u0131l kullan\u0131l\u0131r?"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/tr\/#website","url":"https:\/\/statorials.org\/tr\/","name":"Statorials","description":"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/tr\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"tr"},{"@type":"Person","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil","sameAs":["https:\/\/statorials.org\/tr"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/3997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/comments?post=3997"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/3997\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/media?parent=3997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/categories?post=3997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/tags?post=3997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}