Giter Site home page Giter Site logo

yangjin-kai / knnmtd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jsivaku1/knnmtd

0.0 0.0 0.0 424 KB

论文代码:Synthetic sampling from small datasets: A modified mega-trend diffusion approach using k-nearest neighbors

Python 78.32% Jupyter Notebook 21.68%

knnmtd's Introduction

Synthetic sampling from small datasets: A modified mega-trend diffusion approach using k-nearest neighbors

Overview

The repository implements the synthetic sampling technique called kNNMTD using the small datasets. The algorithm uses a three-step procedure.

  • Firstly, the k-Nearest Neighbor (kNN) algorithm is applied on each of the instances
  • Secondly, the neighboring samples are diffused using mega-trend diffusion (MTD)
  • Finally, the samples are generated using the domain ranges from MTD through plausibility assessment mechanism, then kNN is applied on the synthetic samples to select the closest acceptable samples

The following illustration show how the algorithm generates artificial samples. For more information, refer the original paper.


All the final benchmark datasets used in the paper after preprocessing is available inside the data folder.

  • mode = -1 → Unsupervised
  • mode = 0 → Classification
  • mode = 1 → Regression

Usage

import pandas as pd
import numpy as np
from kNNMTD import *
from utils import *

# Generate samples for unsupervised learning task
real = pd.read_csv('../Data/wisconsin_breast.csv')
model = kNNMTD(n_obs = 300,k=3,mode=-1)
synthetic = model.fit(real)
pcd = PCD(real,synthetic)

# Generate samples for classification task
real = pd.read_csv('../Data/cervical.csv')
model = kNNMTD(n_obs = 100,k=3,mode=0)
synthetic = model.fit(real,class_col='ca_cervix')
pcd = PCD(real,synthetic)

# Generate samples for regression task
real = pd.read_csv('../Data/prostate.csv')
model = kNNMTD(n_obs = 100,k=4,mode=1)
synthetic = model.fit(real,class_col='lpsa')
pcd = PCD(real,synthetic)

Citing kNNMTD

Please cite the following work if you are using the source code:

  • Jayanth Sivakumar, Karthik Ramamurthy, Menaka Radhakrishnan, and Daehan Won. "Synthetic sampling from small datasets: A modified mega-trend diffusion approach using k-nearest neighbors." Knowledge-Based Systems (2021): 107687.
@article{sivakumar2021synthetic,
  title={Synthetic sampling from small datasets: A modified mega-trend diffusion approach using k-nearest neighbors},
  author={Sivakumar, Jayanth and Ramamurthy, Karthik and Radhakrishnan, Menaka and Won, Daehan},
  journal={Knowledge-Based Systems},
  pages={107687},
  year={2021},
  publisher={Elsevier}
}

knnmtd's People

Contributors

jsivaku1 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.