Giter Site home page Giter Site logo

jorgerodpen / drug-classiffier Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 44.51 MB

Used survey data with personality traits to predict cannabis consumption.

MATLAB 100.00%
decision-trees kfold-cross-validation bootstrap-validation random-forest drug-classiffier

drug-classiffier's Introduction

Cannabis consumption classiffier

Use Matlab2020a.

Folders

Code

Contains all the code used to train and evaluate our models. Some sections are commented out to skip parts of the code that take longer to run (some sections might take more than an hour). The data generated in those sections was save as a .mat file and is loaded at the beginning of the code. There are four models:

  • randomforest1.m
  • randomforest2.m
  • decisiontree1.m
  • decisiontree2.m

Each one with their correspondent .mat files containing the data to run them.

Inside this folder, the .csv file containing the data has been included as cleaned_drug_consumption.csv.

Other files in this folder are self-made functions to perform k-fold cross validation or bootstrap validation for each model, and all contain descriptions. In order to run the .m files, this functions need to be in the same folder as them, or alternatively, in a folder the user has destined to store and use MatLAB functions. This functions are:

  • AUCdttrain.m (To use as objective function in Bayesian optimization for decision trees)
  • AUCrftrain.m (To use as objective function in Bayesian optimization for random forest)
  • bootstrapdt.m (To perform bootstrap validation in decision trees)
  • bootstraprf.m (To perform out-of-bag bootstrap validation in random forests)
  • crossvalidationdt.m (To perform k-fold cross validation in decision trees)
  • crossvalidationrf.m (To perform k-fold cross validation in random forests)

An extra folder is included with the code used to clean the data (cleaned.m).

Models

Contains the four models implemented in this project. To load them, use the models.m file. This file automatically reads, and uses the models in the test set, returning the AUC score obtained. You just need to change two variables:

model_name: Type 'dt' for decision tree and 'rf' for random forest. model_version: Type 1 for models with all the variables and 2 for model excluding 'Country' and 'Ethnicity'

This file will evaluate and display on the command window the AUC of the test set with the best trained model for each combination of model_name and model_version.

PosterAndExtra

Contains the Poster and Suplementary Material as pdf files. Both the poster and the supplementary material contain all the information needed to understand the project and see its main results.

drug-classiffier's People

Contributors

jorgerodpen avatar

Stargazers

 avatar

Watchers

 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.