Giter Club home page Giter Club logo

2dv515-a4-machine-learning's Introduction

Machine Learning

My solution for assignment 4 in Web Intelligence (2DV515) at Linnaeus University

Description

The assingment.

  • In assignment 4 you shall implement the Naïve Bayes machine learning algorithm and use it on some datasets
  • It can be implemented in any programming language you like
  • You can work alone or in group of two students
  • You shall present your application and code at an oral examination
  • Note that you are not required to build a REST web service for this assignment

Requirements

Grade E

  • Implement the Naïve Bayes algorithm, using the code structure below (you are allowed to add more classes and methods if needed)
  • Train the model on the Iris and Banknote authentication datasets (see Datasets page)
  • Calculate classification accuracies for both datasets (use all data for both training and testing)

Grade C-D

  • Implement code for generating confusion matrices, using the code structure below

Grade A-B

  • Implement code for n-fold cross-validation, using the code structure below
  • It shall be possible to use 3, 5 or 10 folds (it is okay if your implementation supports other folds)
  • Calculate accuracy score for 5-fold cross-validation on both datasets

Code structure requirements

NaiveBayes class

void fit ( X:float[][], y:int[] )

Trains the model on input examples X and labels y.


int[] predict ( X:float[][] )

Classifies examples X and returns a list of predictions.


Other methods

float accuracy_score ( preds:int[], y:int[] )

Calculates accuracy score for a list of predictions.


int[][] confusion_matrix ( preds:int[], y:int[] )

Generates a confusion matrix and returns the result as an integer matrix.


int[] crossval_predict ( X:float[][], y:int[], folds:int )

Runs n-fold cross-validation and returns a list of predictions.


2dv515-a4-machine-learning's People

Contributors

antonstrand avatar

Watchers

 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.