Convert some R code to Python code (<400 lines of code)
£20-250 GBP
In Progress
Posted almost 9 years ago
£20-250 GBP
Paid on delivery
We need five small R files ported from R to Python. The R code is on github ([login to view URL]).
We only need three of the classes (SelfLearning.R, LinearDiscriminantClassifier.R, and ICLinearDiscriminantClassifier.R) and the base classes and helper functions they use (NormalBasedClassifier.R, Classifier.R).
In total, without comments, this is less than 400 lines of code to be ported to Python. Any publicly available python libraries, and existing code, may be used as part of the solution (but the mechanism of the solution needs to be the same, e.g. the optimization-based solution in LinearDiscriminantClassifier).
Upon completion, the following test code (and its python equivalent) should work equivalently in R and Python:
# Generate dataset
df <- generate2ClassGaussian(d=2,expected=TRUE)
df_lab <- df[sample(nrow(df),10),]
df_unlab <- df[sample(nrow(df),500),]
df_unlab$Class <- NA
df_combined <- rbind(df_lab, df_unlab)
# Train Classifiers
t_sup <- LinearDiscriminantClassifier(Class~., df_lab)
t_self <- SelfLearning(Class~., df_combined, method=LinearDiscriminantClassifier)
t_ic <- ICLinearDiscriminantClassifier(Class~., df_combined)
# Evaluate performance: Squared Loss & Error Rate
mean(loss(t_sup,df))
mean(loss(t_self,df))
mean(loss(t_ic,df))
mean(predict(t_sup,df)!=df$Class)
mean(predict(t_self,df)!=df$Class)
mean(predict(t_ic,df)!=df$Class)
Hello! I have experience with both R and python. It seems like the core of your project is implementing the R algorithms within your classes in python. I can compete this task for you.
ITHelpForAll provides many IT Solutions for the following :
- Fresh installation of corporate systems, servers.
- Doing systems migrations.
- Provide IT services and online support.
- Programming languages (C,C++,C#.NET,[login to view URL], PHP, Python).
- Training for different Systems and platforms (windows, Linux, vmware).
£150 GBP in 3 days
5.0 (1 review)
2.7
2.7
3 freelancers are bidding on average £161 GBP for this job