Creating own dataset

dreamer: <p>Hi everyone, i want to build my own dataset. I searched this topic on forum but examples are not same as my datasets. I have three different .txt file which are contains float numbers. These 3 .txt files will be mine inputs but i do not have any labels. How can I create my own dataset?<br>
I am going to put my one of the dataset file here:</p>
<blockquote>
<p>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.40139,-0.3999,-0.39836,-0.39678,-0.39647,-0.39083,-0.39642,-0.398,-0.39678,-0.39874,-0.3979,-0.39558,-0.39488,-0.40159,-0.39283,-0.396,-0.39641,-0.40043,-0.39269,-0.39241,-0.39713,-0.39307,-0.39429,-0.39759,-0.39755,-0.39559,-0.39275,-0.39558,-0.39083,-0.39596,-0.39042,-0.39163,-0.39555,-0.38846,-0.39321,-0.39196,-0.39196,-0.39326,-0.39003,-0.39552,-0.39038,-0.38841,-0.39044,-0.3923,-0.39,-0.38876,-0.38921,-0.38842,-0.39038,-0.39,-0.38964,-0.39005,-0.38768,-0.38923,-0.38602,-0.38957,-0.39362,-0.3848,-0.38841,-0.38921,-0.38636,-0.38598,-0.38559,-0.38718,-0.38598,-0.38559,-0.38239,-0.38564,-0.37961,-0.38481,-0.384,-0.38836,-0.38439,-0.38311,-0.38481,-0.38122,-0.38523,-0.38359,-0.37601,-0.38439,-0.38046,-0.3852,-0.38483,-0.38836,-0.3756,-0.38156,-0.38558,-0.38321,-0.38358,-0.38759,-0.37957,-0.3748,-0.38043,-0.37922,-0.3856,-0.3836,-0.37679,-0.37841,-0.37921,-0.3832,-0.3852,-0.38359,-0.3764,-0.3728,-0.37522,-0.38117,-0.38359,-0.37879,-0.3796,-0.3736,-0.37559,-0.37959,-0.3824,-0.37681,-0.374,-0.37478,-0.37596,-0.3776,-0.38358,-0.37841,-0.36883,-0.372,-0.37718,-0.37559,-0.38158,-0.37683,-0.36367,-0.36759,-0.37317,-0.37716,-0.37366,-0.36925,-0.36241,-0.36675,-0.37516,-0.37716,-0.37568,-0.36683,-0.37473,-0.36643,-0.37271,-0.37986,-0.36726,-0.37157,-0.36687,-0.36557,-0.374,-0.376,-0.36844,-0.36844,-0.37156,-0.37156,-0.368,-0.37669,-0.37756,-0.36444,-0.36244,-0.36869,-0.37666,-0.374,-0.366,-0.368,-0.36,-0.36266,-0.3731,-0.3742,-0.3669,-0.36,-0.35691,-0.37128,-0.37045,-0.36845,-0.36868,-0.36245,-0.362,-0.36709,-0.37092,-0.3669,-0.36446,-0.36091,-0.35584,-0.364,-0.36645,-0.366,-0.36693,-0.36153,-0.356,-0.36154,-0.366,-0.36494,-0.3599,-0.35647,-0.35447,-0.36058,-0.36448,-0.36448,-0.35944,-0.36047,-0.35944,-0.35904,-0.36352,-0.36552,-0.36095,-0.35848,-0.35897,-0.36551,-0.36351,-0.36144,-0.36103,-0.35951,-0.35699,-0.36,-0.41637,-0.43954,-0.43299,-0.4365,-0.4385,-0.44501,-0.4355,-0.441,-0.441,-0.44449,-0.478,-0.48349,-0.43098,-0.43301,-0.47499,-0.48502,-0.416,-0.416,-0.4145,-0.4165,-0.4155,-0.41549,-0.41451,-0.41754,-0.41451,-0.416,-0.41896,-0.412,-0.414,-0.41748,-0.416,-0.416,-0.41158,-0.41347,-0.412,-0.41452,-0.41547,-0.412,-0.40852,-0.40747,-0.41157,-0.40547,-0.41,-0.41054,-0.40947,-0.411,-0.41,-0.41387,-0.40946,-0.408,-0.40946,-0.40838,-0.40618,-0.406,-0.44933,-0.42358,-0.42945,-0.42454,-0.42745,-0.428,-0.42891,-0.42709,-0.426,-0.4251,-0.43324,-0.42108,-0.43092,-0.42055,-0.434,-0.428,-0.42779,-0.42945,-0.43,-0.42768,-0.43544,-0.43744,-0.43344,-0.43288,-0.434,-0.42287,-0.43057,-0.428,-0.43028,-0.43142,-0.59478,-1.1942,-0.54881,-0.77985,-1.3753,-0.75752,-0.81028,-1.2039,-1.4793,-1.6478,-1.6843,-1.6891,-1.59,-1.4848,-1.6849,-1.9841,-2.4618,-2.3989,-2.4914,-2.7966,-3.3461,-2.9245,-2.7487,-3.3341,-4.0765,-4.2197,-4.4234,-3.9726,-3.7445,-4.2346,-5.7134,-7.5998,-6.584,-7.617,-8.4383,-8.0122,-8.8407,-9.2153,-10.814,-12.305,-11.69,-11.804,-12.33,-12.31,-12.51,-13.449,-13.511,-13.879,-14.179,-14.636,-15.126,-15.222,-15.8,-16.209,-17.031,-18.038,-17.785,-17.934,-18.261,-18.024,-17.412,-17.567,-16.806,-16.757,-16.592,-16.828,-18.015,-18.711,-19.463,-19.879,-20.248,-20.701,-20.85,-21.085,-21.594,-24.339,-29.393,-30.207,-31.078,-32.585,-31.521,-31.719,-33.197,-34.524,-36.11,-37.141,-38.865,-39.614,-40.023,-42.008,-42.893,-43.641,-44.935,-45.792,-46.914,-47.595,-48.439,-47.132,-47.154,-48.631,-48.109,-51.832,-54.166,-56.134,-58.47,-59.472,-60.412,-61.425,-60.025,-59.407,-59.933,-58.539,-56.867,-51.192,-52.077,-51.053,-50.556,-41.308,-24.75,-11.105,-6.0969,-3.7905,-2.4182,-1.2207,-0.14451,-0.050676,-0.085366,-0.078651,-0.093326,-0.084,-0.067407,-0.05667,-0.049361,-0.057953,-0.035272,-0.048682,-0.050683,-0.058,-0.057372,-0.039315,-0.047309,-0.033371,-0.031309,-0.030075,-0.023384,-0.033462,-0.035309,-0.035919,-0.031303,-0.025391,-0.03,-0.020616,-0.0287,-0.030699,-0.028,-0.016,-0.028,-0.022601,-0.028096,-0.022701,-0.028594,-0.031902,-0.03024,-0.030588,-0.039294,-0.026235,-0.021187,-0.030709,-0.028,-0.030578,-0.030291,-0.024,-0.024291,-0.028713,-0.035286,-0.065854,-0.14059,-0.071155,-0.056865,-0.072875,-0.086721,-0.09057,-0.087611,-0.078,-0.09945,-0.104,-0.10983,-0.12255,-0.3553,-0.17307,-0.13819,-0.14018,-0.079467,-0.079267,-0.090734,-0.093656,-0.096934,-0.072527,-0.084524,-0.089717,-0.082744,-0.11041,-0.10126,-0.10921,-0.11949,-0.12028,-0.11926,-0.12424,-0.10951,-0.12486,-0.56902,-0.61725,-0.17664,-0.086494,-0.084,-0.088501,-0.082999,-0.41748,-1.9425,-4.9296,-7.3518,-10.131,-13.186,-13.635,-13.745,-14.273,-15.601,-11.849,-9.8619,-10.647,-12.412,-15.204,-15.802,-15.557,-12.904,-13.025,-13.164,-12.183,-12.123,-12.2,-12.675,-12.569,-12.593,-13.315,-13.352,-13.154,-13.856,-13.82,-13.819,-13.933,-13.723,-13.794,-9.3086,-5.1594,-3.6245,-2.7545,-1.9512,-1.0231,-0.22418,-0.42241,-0.079186,-0.07229,-0.093203,-0.086041,-1.0383,-4.0464,-5.6861,-8.0327,-10.854,-10.864,-10.142,-11.072,-11.629,-10.988,-6.576,-4.2035,-3.2572,-2.136,-2.2695,-4.2763,-6.8671,-10.606,-14.974,-17.273,-16.423,-16.516,-16.477,-16.492,-16.812,-20.292,-22.437,-24.169,-25.328,-25.836,-26.962,-28.705,-31.509,-35.557,-36.663,-37.268,-38.052,-39.077,-39.642,-41.844,-41.642,-45.001,-46.674,-47.77,-49.749,-50.159,-50.923,-52.808,-54.26,-54.808,-55.663,-57.128,-57.855,-61.041,-62.908,-64.112,-69.512,-71.165,-73.994,-76.591,-76.333,-77.481,-79.951,-89.916,-93.744,-97.209,-99.326,-98.845,-89.319,-87.79,-87.577,-89.115,-90.804,-91.321,-98.003,-110.53,-123.44,-129.71,-132.71,-130.86,-128.11,-121.95,-118.24,-116.33,-116.82,-114.31,-114.04,-115.04,-118.34,-119.73,-121.23,-120.58,-119.97,-122.53,-125.09,-123.57,-124.05,-123.72,-127.62,-128.47,-129.35,-128.56,-129.59,-130.17,-131.96,-130.36,-130.61,-132.81,-131.58,-134.64,-134.33,-134.36,-136.73,-134.6,-134.09,-136.99,-137.88,-138.05,-136.72,-136.8,-137.26,-140.3,-141.03,-139.55,-139.32,-137.44,-140.74,-138.83,-141.32,-141.84,-141.2,-142.32,-142.26,-140.23,-141.96,-144.08,-142.9,-141.97,-142.72,-139.42,-132.1,-116.8,-112.71,-101.37,-67.207,-33.749,-17.939,-13.131,-9.7993,-6.4907,-4.2059,-1.9476,1.5367,4.7462,4.4499,4.5229,4.4311,4.4026,4.319,4.211,4.1957,4.0889,4.0532,3.7051,4.1094,3.9537,4.1766,3.7138,3.7586,3.9898,3.7537,3.6785,3.7313,3.6956,3.6266,3.5259,3.5343,3.4785,3.4206,3.3793,3.3185,3.2987,3.2669,3.2137,3.1519,3.1449,3.1133,3.0669,3.0104,2.9614,2.9435,2.8923,3.5285,3.5446,3.3652,3.034,2.9761,2.8227,3.1496,3.071,2.8481,3.0991,2.9965,2.7934,3.1284,3.0198,3.1289,3.4616,3.5662,3.2016,3.1903,3.1445,3.1145,3.0103,3.0767,3.0362,3.0632,3.0921,3.1157,3.1663,3.1391,3.1361,3.1372,3.113,3.1389,3.1044,3.1097,3.5568,3.525,3.5029,3.5,3.5189,3.5222,3.5541,3.546,3.5409,3.467,3.168,3.162,3.14,3.141,3.149,3.158,3.166,3.167,3.198,3.18,3.174,3.181,3.192,3.159,3.112,3.143,3.1541,3.1171,3.0941,3.405,3.189,3.2812,3.317,3.311,3.3391,3.337,3.3842,3.438,2.9738,2.9649,2.9461,2.9402,3.0067,3.0129,2.9919,2.961,2.9458,2.9116,2.9037,2.8692,2.841,2.8069,2.7989,3.1365,3.2297,3.2119,3.163,3.141,3.1206,3.0716,2.6494,2.6379,2.5942,2.6363,2.6263,2.6112,2.6408,2.7455,3.062,3.0497,2.6352,2.758,2.7647,2.5624,1.0901,0.55178,0.4965,0.20258,0.080826,0.10427,0.176,0.15432,-0.023788,-0.43511,-1.261,-0.87845,-1.079,-1.2829,-1.936,-2.7283,-3.3569,-3.9916,-3.8476,-3.6448,-3.713,-3.8129,-4.5863,-6.2155,-8.4981,-11.144,-11.083,-11.184,-11.678,-11.566,-11.079,-11.311,-11.634,-12.424,-12.549,-12.218,-10.844,-7.5204,-7.259,-7.1785,-4.9223,-3.9538,-3.1733,-2.8563,-2.4654,-2.3138,-3.4543,-3.3595,-2.8413,-2.9027,-3.5282,-5.0238,-7.044,-8.7446,-10.507,-12.976,-13.471,-13.767,-14.368,-14.681,-15.494,-15.041,-15.195,-15.593,-15.932,-16.329,-19.229,-20.369,-20.579,-20.942,-21.652,-22.14,-21.839,-22.787,-22.945,-23.894,-24.938,-26.262,-27.706,-28.697,-31.6,-33.286,-34.38,-34.956,-35.918,-36.41,-37.146,-37.788,-40.313,-45.015,-52.078,-55.575,-58.334,-62.187,-64.115,-67.387,-73.18,-77.281,-83.032,-87.197,-90.824,-92.841,-95.12,-96.004,-98.87,-98.984,-102.99,-110.11,-124.45,-124.91,-125.09,-128.87,-127.47,-125.17,-130.14,-125.79,-126.42,-127.77,-127.45,-122.88,-122.85,-121.13,-118.34,-116.28,-114.67,-114.57,-113.04,-113.47,-116.26,-117.64,-121.46,-123.16,-124.63,-123.56,-123.59,-125.68,-125.39,-125.34,-126.63,-128.5,-131.45,-131.96,-129.84,-132.34,-132.45,-133.23,-135.75,-134.32,-131.77,-137.55,-134.75,-135.87,-134.68,-136.91,-137.15,-136.09,-138.88,-172.14,-171.76,-170.26,-171.38,-172.07,-172.37,-172.47,-172.56,-170.81,-172.33,-170.41,-172.55,-171.33,-172.11,-170.91,-173.22,-172.92,-171.43,-170.58,-169.69,-171.74,-172.97,-174.78,-173.45,-173.32,-174.51,-173.53,-171.88,-173.13,-172.91,-173.15,-173.05,-174.86,-172.58,-172.86,-172.67,-172,-172.47,-172.97,-174.24,-173.34,-172.38,-171.33,-172.7,-172.38,-172.69,-172.61,-172.93,-172.88,-152.31,-128.12,-75.047,-38.588,-21.693,-14.486,-9.8152,-5.1682,-2.92,0.96396,7.1392,9.3543,10.482,10.386,10.901,11.381,11.276,11.22,11.067,11.085,10.96,10.81,10.784,11.657,11.644,11.46,11.413,11.457,11.307,11.189,11.12,11.191,11.021,10.778,11.252,11.598,12.037,11.613,11.506,11.391,10.818,11.239,10.77,11.099,10.722,11.476,11.158,11.172,11.733,11.908,11.461,10.979,10.808,10.638,10.545,10.624,10.931,10.513,10.719,10.771,10.469,10.67,10.879,10.873,11.373,11.252,11.011,11.026,11.017,10.924,10.872,10.946,11.021,11.387,11.289,11.206,11.102,11.328,11.131,10.939,11.14,11.111,11.046,10.971,10.872,10.993,11.374,11.01,11.177,11.067,11.191,11.086,10.864,10.905,10.936,10.866,10.728,10.873,10.794,10.616,10.947,10.739,11.035,10.959,11.303,11.212,11.184,11.125,10.804,10.987,10.842,10.852,11.158,10.306,10.392,10.439,10.147,10.638,10.341,10.516,10.448,10.53,10.416,10.269,10.162,10.503,10.667,10.612,10.445,10.5,10.202,10.477,10.505,-110.81,-109.35,-109.52,-107.67,-107.49,-108.57,-106.76,-110.33,-81.688,-44.444,-20.248,-12.764,-7.6634,-4.6429,-2.2129,1.5533,6.5638,9.97,10.239,11.345,11.034,10.73,10.5,11.37,11.202,11.498,11.922,11.519,11.302,11.039,11.107,10.595,10.806,10.56,11.419,11.343,11.324,11.096,10.941,10.852,10.795,10.708,10.674,10.476,10.485,11.203,11.093,10.956,10.885,10.859,10.624,10.539,10.429,10.346,10.239,11.099,19.366,22.215,25.789,31.47,36.106,37.89,40.359,44.225,44.462,44.496,44.552,44.808,44.863,45.307,45.848,46.547,47.231,47.826,46.749,45.255,44.498,43.177,41.56,41.045,41.151,41.014,40.979,41.091,41.382,41.166,39.296,35.105,33.332,32.466,30.956,28.479,26.56,24.36,21.742,17.683,13.66,10.241,6.4583,3.4691,0.51115,-0.30891,-0.40096,-0.49115,-0.76438,-0.86387,-1.2633,-2.5215,-3.61,-4.6365,-5.5799,-5.6331,-6.3369,-6.8678,-7.3588,-6.8003,-7.3965,-7.1453,-7.1555,-6.8617,-7.0547,-7.0832,-7.0782,-7.0846,-6.7226,-6.7686,-6.7145,-6.7829,-6.8472,-6.8753,-6.8665,-6.9609,-6.158,-6.1351,-6.1697,-5.8168,-5.8201,-5.6432,-5.4063,-5.473,-5.0511,-5.0327,-5.0878,-4.7109,-4.6856,-4.6846,-4.421,-4.3815,-4.3801,-4.4183,-5.138,-7.2436,-10.324,-14.45,-17.791,-18.042,-17.634,-17.432,-17.165,-17.235,-18.357,-19.799,-20.778,-22.113,-23,-23.168,-23.458,-24.093,-23.966,-23.436,-23.278,-23.659,-24.06,-23.891,-24.709,-24.21,-25.082,-26.148,-25.4,-26.182,-22.112,-13.264,-6.7191,-4.8813,-3.1999,-2.2883,-1.0959,-0.2149,0.94924,0.97147,-0.024704,-1.5024,-5.5891,-8.8162,-12.174,-17.462,-25.697,-27.72,-28,-28.017,-28.554,-31.982,-37.546,-41.022,-41.978,-43.939,-45.053,-44.977,-48.181,-56.179,-59.762,-67.681,-74.292,-78.9,-82.773,-85.599,-84.254,-77.382,-77.851,-77.446,-78.745,-81.39,-82.245,-70.32,-65.277,-53.726,-32.695,-13.675,-6.4351,-3.5398,-1.5787,0.26799,3.2124,5.4019,7.1116,7.0738,7.0756,6.8627,6.6953,6.9402,7.1263,6.7486,6.6113,6.5871,6.6175,6.6985,6.6547,6.6385,6.6385,6.1615,6.1273,6.199,6.1421,6.1606,6.1659,6.1882,6.1807,6.1729,5.6772,5.5993,5.6315,5.6395,3.2293,-0.093806,-6.8736,-12.879,-18.197,-27.874,-38.4,-37.16,-35.757,-35.773,-35.11,-29.219,-26.737,-25.509,-22.567,-14.85,-7.3908,-4.9209,-2.7231,-1.2671,0.77822,3.3489,5.0471,5.5686,5.6324,5.6669,5.6055,5.6414,5.6375,5.6292,5.607,5.6082,5.577,5.5044,5.5171,5.0165,5.0389,4.9814,4.9887,4.9172,4.9106,4.9036,4.911,4.3401,4.3457,4.3199,4.2646,4.2663,4.2713,4.2424,4.1206,3.7071,3.6542,3.662,3.6379,3.6087,3.5956,3.4944,2.9997,6.8647,8.8544,12.971,14.446,16.062,15.431,14.531,13.899,13.028,10.864,7.7346,4.2684,1.2247,-0.071107,0.10682,-0.27036,-0.33522,-0.5322,-0.91043,-1.5003,-3.0523,-3.6757,-4.4154,-4.6322,-4.8188,-4.9931,-5.5201,-5.3716,-5.2443,-5.4123,-5.8867,-5.8267,-5.4112,-5.4618,-5.5486,-5.5907,-5.6182,-5.7376,-5.3995,-5.3177,-5.3811,-5.4504,-5.3416,-4.8237,-4.7752,-4.8049,-4.758,-4.7572,-4.8056,-4.8352,-4.844,-4.782,-4.7144,-4.6231,-4.1618,-3.3903,-2.4931,-3.7369,-2.9525,-2.8398,-2.9212,-3.6763,-4.3853,-5.0397,-6.2716,-6.7874,-7.4917,-8.4262,-9.353,-8.3536,-9.126,-9.5281,-9.6213,-8.5501,-8.7615,-8.2589,-7.7806,-7.8767,-8.1849,-7.9654,-7.9537,-7.9439,-7.8659,-8.1094,-8.2607,-7.4265,-7.4213,-7.5507,-7.4251,-7.2164,-7.2879,-7.3281,-7.272,-7.2827,-7.3634,-7.3989,-7.4829,-7.5106,-7.5666,-7.2316,-7.1333,-7.1731,-7.1828,-7.1942,-7.1718,-7.2059,-7.2724,-6.5189,-5.1399,-4.0112,-3.3118,-2.897,-2.5531,-2.5603,-2.5778,-2.585,-2.6474,-2.9007,-2.8684,-2.8235,-3.0687,-2.9843,-2.698,-2.4831,-2.2663,-2.1033,-2.0355,-1.9502,-1.8312,-1.8675,-1.704,-1.7605,-1.7102,-1.0747,-1.1052,-1.7029,-1.7418,-2.8375,-3.2607,-3.2959,-3.0909,-2.5226,-2.213,-2.7227,-3.2132,-3.2079,-3.1247,-3.2833,-3.505,-3.488,-2.7273,-3.1097,-3.6495,-3.503,-3.6604,-3.8665,-3.0862,-3.1656,-3.3158,-3.3943,-3.2091,-4.2733,-5.0246,-4.405,-4.9993,-5.4502,-5.0753,-4.9693,-5.367,-5.3713,-5.3438,-5.5848,-5.5144,-5.639,-5.857,-5.7791,-5.9804,-5.6356,-5.8239,-6.0915,-6.0534,-6.0876,-6.4824,-6.4853,-6.2395,-6.3196,-6.6196,-6.4625,-6.352,-6.5909,-6.6257,-6.4981,-6.2889,-6.0999,-5.476,-5.1195,-4.6986,-4.4794,-4.2143,-4.1772,-4.1258,-4.4798,-5.0331,-5.1245,-5.3307,-5.6103,-5.4841,-5.6623,-5.6031,-5.1247,-5.0459,-4.8208,-4.4818,-4.3611,-4.1989,-4.4659,-4.9763,-5.0092,-5.4609,-5.5793,-5.4738,</p>
</blockquote>

IAmIronMan: <p>You can build your own dataset by using Dataset Class</p>
<blockquote>
<p>class my dataset (Dataset):</p>
</blockquote>
<p>You have to over ride two function -  len() and getitem()</p>
<p>Now,<br>
len() returns the length of the dataset, which you need, so that you can iterate over it getitem() returns the item</p>
<pre><code class="lang-auto">class myDataset(Dataset):
   def __init__(self):
      self.load_files = []
      load_file = pd.csv(filename)
      load_files.append(load_file)
  
   def __len__(self):
      return len(self.load_files)
   
   def __getitem__(self,idx):
      sample = self.load_files[idx]
      # type of sample would be of dataframe, we need to convert it into Tensor and then return
     return sample 
</code></pre>
<p>It is not necessary to have labels. Only, thing is that you need to have tensor output from getitem() and when you iterate over dataset, extract the data carefully. And override those two functions</p>
<p>Check this :<a href="https://pytorch.org/tutorials/beginner/data_loading_tutorial.html" class="inline-onebox" rel="noopener nofollow ugc">Writing Custom Datasets, DataLoaders and Transforms — PyTorch Tutorials 2.1.1+cu121 documentation</a><br>
It has explained it beautifully</p>