Build status Build Status Windows https://circleci.com/gh/sdpython/csharpyml/tree/master.svg?style=svg https://badge.fury.io/py/csharpyml.svg GitHub Issues MIT License Requirements Status https://codecov.io/github/sdpython/csharpyml/coverage.svg?branch=master Notebook Coverage

Links: github, documentation README, blog

What is it?

csharpyml implements an easy way to play with C#, Python and ML.net. The module relies in pythonnet and adds continuous integration other projects could leverage.


It can easily compile and wrap a C# function into Python:


from csharpyml.binaries import maml


    Available commands:
      Chain: Chain Command
      CV: Cross Validation
      Evaluate: Evaluate Predictor
      GamVisualization: GAM Vizualization Command
        Aliases: gamviz
      GenerateSamplePredictionCode: Generate Sample Prediction Code
        Aliases: codegen
      Help: MAML Help Command
        Aliases: ?
      SaveData: Save Data
        Aliases: save
      SaveOnnx: Save ONNX
      SavePfa: Save PFA
      SavePredictorAs: Save Predictor As
        Aliases: SavePredictor, SaveAs, SaveModel
      Score: Score Predictor
      ShowData: Show Data
        Aliases: show
      ShowSchema: Show Schema
        Aliases: schema
      Sweep: Sweep
      Test: Test Predictor
      Train: Train Predictor
      TrainTest: Train Test
      Version: Version Command

The list of available trainers can be obtained with:


from csharpyml.binaries import maml
print(maml('? kind=trainer')[0])


    Available components for kind 'Trainer':
      AveragedPerceptron: Averaged Perceptron
        Aliases: avgper, ap
      BinaryClassificationGamTrainer: Generalized Additive Model for Binary Classification
        Aliases: gam
      BinarySGD: Hogwild SGD (binary)
        Aliases: sgd
      FastForestClassification: Fast Forest Classification
        Aliases: FastForest, ff, ffc
      FastForestRegression: Fast Forest Regression
        Aliases: ffr
      FastTreeBinaryClassification: FastTree (Boosted Trees) Classification
        Aliases: FastTreeClassification, FastTree, ft, ftc, FastRankBinaryClassification, FastRankBinaryClassificationWrapper, FastRankClassification, fr, btc, frc, fastrank, fastrankwrapper
      FastTreeRanking: FastTree (Boosted Trees) Ranking
        Aliases: ftrank, FastRankRanking, FastRankRankingWrapper, rank, frrank, btrank
      FastTreeRegression: FastTree (Boosted Trees) Regression
        Aliases: ftr, FastRankRegression, FastRankRegressionWrapper, frr, btr
      FastTreeTweedieRegression: FastTree (Boosted Trees) Tweedie Regression
        Aliases: fttweedie
      KMeansPlusPlus: KMeans++ Clustering
        Aliases: KM, KMeans
      LinearSVM: SVM (Pegasos-Linear)
        Aliases: svm
      LogisticRegression: Logistic Regression
        Aliases: lr, logisticregressionwrapper
      MultiClassLogisticRegression: Multi-class Logistic Regression
        Aliases: MulticlassLogisticRegressionPredictorNew, mlr, multilr
      MultiClassNaiveBayes: Multiclass Naive Bayes
        Aliases: MNB
      OLSLinearRegression: Ordinary Least Squares (Regression)
        Aliases: ols
      OnlineGradientDescent: Stochastic Gradient Descent (Regression)
        Aliases: ogd, sgdr, stochasticgradientdescentregression
      OVA: One-vs-All
      pcaAnomaly: PCA Anomaly Detector
        Aliases: pcaAnom
      PKPD: Pairwise coupling (PKPD)
      PoissonRegression: Poisson Regression
        Aliases: PoissonRegressionNew, Poisson, PR
      PriorPredictor: Prior Predictor
        Aliases: prior, constant
      RandomPredictor: Random Predictor
        Aliases: random
      RegressionGamTrainer: Generalized Additive Model for Regression
        Aliases: gamr
      SDCA: Fast Linear (SA-SDCA)
        Aliases: LinearClassifier, lc, sasdca
      SDCAMC: Fast Linear Multi-class Classification (SA-SDCA)
        Aliases: sasdcamc
      SDCAR: Fast Linear Regression (SA-SDCA)
        Aliases: sasdcar

This function also exists as a magic command %%maml.



Follow the instructions described in appveyor.yml.


Follow the instructions described in config.yml.