#Help with Julia and LIBSVM

1 messages · Page 1 of 1 (latest)

prisma shoal
#

Hello. I'm... not exactly where to post this, but, I'm in absolutely desperate need of help with Julia. My college course is awful, but makes use of Julia.

Topic at hand is SVM's, using the LIBSVM (which seems to be VERY outdated). Safe to say, we were given no materials. Not directions. Nothing. I do understand the concept, but, not how to implement it with LIBSVM, and LIBSVM even seems to be not really compatible with what we've been working with so far. Any guidance would be REALLY appreciated.

sudden plume
#

You could share code if you can

#

I can try to reproduce it to see what problems do you have

prisma shoal
#

That's the package. I'll copy what I have:

#
using StatsModels
using GLM
using DataFrames
using CSV
using Lathe.preprocess: TrainTestSplit
using Plots
using Statistics
using StatsBase
using MLBase
using LIBSVM

data = DataFrame(CSV.File("data.csv"))
X = select(data, Not(:pol))
Y = select(data, :pol)

      
xTrain, xTest = TrainTestSplit(X,.80)

yTrain, yTest = TrainTestSplit(Y,.80)

model = LIBSVM.svmtrain(xTrain, yTrain)

ŷ, decision_values = LIBSVM.svmpredict(model, xTest);

print("Accuracy: %.2f%%\n", mean(ŷ .== yTest) * 100)
#

Sorry that some stuff is not on English. The gist of it is:

pol -> Gender
Visina -> Height
Kilaza -> Weight

alpine spruce
#

It seems like you're asking for someone to do your homework for you. It'd be a lot easier to help if you had a specific problem or question. It is currently unclear what you're asking for help with

prisma shoal
junior kestrel
#

You just make a matrix and pass it to the svmtrain function there. There is no more help that can really be given without just doing your homework problem at that point, it's literally a one line of code change.

prisma shoal
#

Solved it. It was most DEFINITELY not a one line of code change.

#

Long story short. A lot of conversions. Splitting. Refactoring just to make this work