Code Monkey home page Code Monkey logo

ml-cpp's Introduction

Machine Learning in C++

Trying to implement some of machine learning algorithms and techniques on C++. The aim of doing this is not replacing python with C++ but to learn C++ for practical purposes.

How?

To run my current progress, compile and run.cpp as follows:

g++ run.cpp -std=c++17 -o run.o
./run.o

I am using std::any for which C++17 is required, hence the -std=c++17 flag.

bash run.sh

^faster. TODO: MAKEFILE.

Done:

Data

  • A simple CSV reader. See CSVReader.h.
  • A label encoder for categorical variables. See preprocess.h.
  • Summarizer in preprocess.h. Prints "mean", "stdv", "count", "min", "20%", "40%", "50%", "60%", "80%", "max" for each numerical column.
  • Summarizer updated in preprocess.h. Prints "count", "unique", "mostfrq", "lstfrq" for each categorical column.
  • FillNA added in preprocess.h. Supports mean (mostfreq for categorical) and zero value filling for all columns.
  • Feature engineering - Added pearson correlation for all pairs of numcols in featureengine.h.
  • Data slicing: (See CSVReader.h)
    • Supports negative index (-i means i indices from end)
    • Asserts for ranges
    • Inplace update for saving memory
    • Default arguments for start and end index of both rows and cols

Loss functions

  • Implemented some loss functions (losses.h):
    • MSE
    • RMSE
    • MAE
    • Huber
  • Implemented some metrics:
    • Accuracy
    • Multi label confusion matrix
    • Precision
    • Recall
    • F1
    • Fbeta

Todo:

Data

  • A versatile feature engineering engine.
  • Image data - resize, crop, negative, blur, etc.

Visualizations

  • Line plot
  • Bar plot
  • Point plot

Loss functions

  • Cross entropy, negative log loss, Hinge
  • KL Divergence

Models

  • KNN
  • Linear regression
  • Polynomial regression
  • Logistic regression
  • Kmeans
  • PCA
  • GMM
  • tSNE
  • MLP
  • Random forests
  • Gradient engine??!
  • DNNs??

ml-cpp's People

Contributors

vaibkumr avatar

Stargazers

Shreya Gupta avatar Vaibhav kumar avatar

Watchers

James Cloos avatar  avatar  avatar

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.