Coder Social home page Coder Social logo

After converting via the code, there is nothing in arff file format when I open it with text editor about convert-csv-to-arff HOT 4 CLOSED

anaavila avatar anaavila commented on September 14, 2024
After converting via the code, there is nothing in arff file format when I open it with text editor

from convert-csv-to-arff.

Comments (4)

SilGervasoni avatar SilGervasoni commented on September 14, 2024 1

Hi!

Thanks a lot for sharing your work! that was really useful and easy to run, so great job!!!
This is really just to thank you, however, if you want to look it up, I've spotted a typo (no big deal, really; for the rest, presentation is be spot on):

check for comams or blanks and adds single quotes

***** commas *****

for j in range(0,totalCols):
for i in range(1,totalRows):
allData[i][j] = allData[i][j].lower()

Another little issue I found while trying to use your code is that the .arff created by it was using just the first column as attribute. I solved this by changing a single line of code, so maybe it was a personal issue, not found in other factspecies. I'll post what I've done so that you might look this up as well, shall you feel like it....

Assigns numeric or nominal to each cell

for j in range(1,totalRows):
for i in range(0,totalCols):

###[...]

for j in range(0,totalCols):
p = j
for i in range(0,(totalRows-1)):
dataTypeTemp.append(dataType[p])
p += totalCols
if "nominal" in dataTypeTemp:
finalDataType .append("nominal")

I just commented out p = j, and everything runs smoothly now...
I hope you have a great day, and keep up the good work!!! we all need it so much ;-)

from convert-csv-to-arff.

j00n162 avatar j00n162 commented on September 14, 2024

Thank you so much for your comment. I appreciate your help.
I have one extra question, if you don't mind. What should be changed for assigning only nominal to each cell, not numeric, in this code? The code author tried to assign numeric or nominal to each cell based on the type of data (letter or number). However, is it possible to assign nominal to each cell even the value is numeric data? For example, the position in the dataset is deemed as numeric, but I want to assign the position as a nominal value.

from convert-csv-to-arff.

SilGervasoni avatar SilGervasoni commented on September 14, 2024

Hi, j00n162!!!
About the issue of the program returning a blank .arff file, I think there might be a couple of instances that might cause the problem. I'll try to review them as they come up to me, I hope this will be of some help...

  1. You are running the program, but you did not specify the directory where your #fileToRead and #fileToWrite are stored... try creating a variable storing those directories, and make sure the program is actually able to find the file's storing location in your system.

  2. You did not rename #fileToRead and #fileToWrite at all, and it remained
    fileToRead = "worldcup2014.csv"
    fileToWrite = "worldcup2014.arff"
    instead of
    fileToRead = your .csv file
    fileToWrite = your .arff file
    I know it's an off chance, but making banal mistakes can happen to the very best, so I'll put it out there...

  3. you might have accidentaly altered the indentation, in suche a way that this prevents the program from running smoothly... to check if this is the case, I suggest you copypaste anaavila's script and start from scratch...

  4. you inserted lines of code before or after anaavila's script, that somehow mingle with it... I have obviously no way to know this for sure, but yu might want to check it out...

this are the first couple of instances I could think of on the top of my mind, I hope I somehow nailed it, but remember there might be a good amount of reasons why the program does not run properly...
just know that it works for me, so there's no reason why it should not be made to work for you, if you attentively work on it, so don't give up!!!

About the other question, I'm honestly not sure... sorry... :-/ :-(

from convert-csv-to-arff.

j00n162 avatar j00n162 commented on September 14, 2024

Thank you so much! Your comment was really helpful. Thank you!

from convert-csv-to-arff.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.