项目作者: nagdevAmruthnath

项目描述 :
Includes a package for rank order clustering and modified rank order clustering proposed by Amruthnath (2016)
高级语言: R
项目地址: git://github.com/nagdevAmruthnath/Modified-Rank-Order-Clustering.git


Binder

Modified Rank Order Clustering

This REPO contains source code (in -mod—Rank-order-clustering/ROC/R/ROC.R) as well as package file (ROC_0.1.0.zip file in root) for Modified & Rank Order clustering. This package contains two functions ROC() and MROC(). ROC function runs based on algorithm proposed by King in 1980. MROC function is based on the algorithm proposed by Amruthnath in 2016. The package includes documentation.

Installation of package

The following package has been tested by installing them directly through R

  1. # install devtools
  2. install.packages("devtools")
  3. # load library
  4. library(devtools)
  5. # install MROC package
  6. devtools::install_github("nagdevAmruthnath/Modified-Rank-Order-Clustering")
  7. # Load ROC library
  8. library(ROC)

Create Machine Component Data

  1. # A function to create a random data matrix
  2. # Reference: http://dirk.eddelbuettel.com/blog/2012/09/02/#faster_binomial_matrix_creation
  3. createData = function(N, K) {
  4. matrix(rbinom(N * K, 1, 0.5), ncol = K, nrow = N)
  5. }
  6. # use above function to create 10 x 10 matrix
  7. data = as.data.frame(createData(10,10))
  8. # view that random data
  9. data
  10. # V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
  11. # 1 0 1 0 0 0 1 1 0 0 1
  12. # 2 0 0 0 0 1 0 0 0 1 0
  13. # 3 0 0 1 0 0 1 0 1 0 1
  14. # 4 1 0 1 1 0 0 0 0 0 1
  15. # 5 0 1 1 0 1 0 1 1 0 1
  16. # 6 1 0 1 1 1 0 1 1 0 1
  17. # 7 1 1 0 0 1 1 0 0 0 0
  18. # 8 0 0 1 0 1 0 1 0 0 0
  19. # 9 1 1 1 0 1 0 1 1 0 1
  20. # 10 0 1 1 0 0 1 1 1 1 0

ROC: Rank Order Clustering

Description

This performs Rank Order Clustering matrix for production flow analysis. The result matrix can be used to cluster machines and part numbers

Usage

ROC(x)

Arguments

x is a data frame without column names or row names. Columns are partnumbers and rows are machines

Details

This function takes any number of machines or partnumbers to generate a Rank Order Clustering Matrix. This algorithm is based on Kings (1981) algorithm for production flow analysis. Maximum iterations are set to 50.

Value

result is a data frame consisting of final matrix from the algorithm

Note:

This algorithm is tested out for upto 100 x 100 matrix

Examples

  1. # load ROC library
  2. library(ROC)
  3. # run ROC algorithm
  4. ROC(data)
  5. # 1 5 2 3 10 7 8 6 4 9 V11
  6. # 9 1 1 1 1 1 1 1 0 0 0 1016
  7. # 7 1 1 1 0 0 0 0 1 0 0 900
  8. # 6 1 1 0 1 1 1 1 0 1 0 890
  9. # 4 1 0 0 1 1 0 0 0 1 0 610
  10. # 5 0 1 1 1 1 1 1 0 0 0 504
  11. # 8 0 1 0 1 0 1 0 0 0 0 336
  12. # 2 0 1 0 0 0 0 0 0 0 1 257
  13. # 10 0 0 1 1 0 1 1 1 0 1 221
  14. # 1 0 0 1 0 1 1 0 1 0 0 180
  15. # 3 0 0 0 1 1 0 1 1 0 0 108
  16. # 11 960 952 806 757 739 694 677 263 192 12 NA

MROC Modified Rank Order Clustering

Description

This function provides the Modified Rank Order Clustering result matrix. This can be used to cluster the machines and components.

Usage

MROC(data, compWeight, machineWeight)

Arguments

data: a data frame without row names and column names. Just include the machine component matrix
compWeight: a single data frame containing numerical component weighs
machineWeight: a single data frame containing numerical machine weighs

Details

This function is built for product flow in cellular manufacturing. This function is built based on Modified Rank Order Clustering proposed by Amruthnath and Gupta (2016). This algorithm is an extension of Rank Order Clustering but, it uses weight to reorder the initial matrix first.

Value
result: MROC matrix as a data frame

Examples

  1. # create random 10 weights for components
  2. compWeight = sample(1:100, 10)
  3. compWeight
  4. # [1] 100 74 50 85 7 46 87 92 36 59
  5. # create random 10 weights for machines
  6. machineWeight = sample(1:100, 10)
  7. machineWeight
  8. # [1] 98 37 48 50 15 23 18 19 77 2
  9. # run MROC algorithm with weights
  10. MROC(data, compWeight , machineWeight)
  11. # X5 X9 X2 X1 X6 X3 X7 X8 X10 X4 V11
  12. # 2 1 1 0 0 0 0 0 0 0 0 768
  13. # 7 1 0 1 1 1 0 0 0 0 0 657
  14. # 9 1 0 1 1 0 1 1 1 1 0 631
  15. # 5 1 0 1 0 0 1 1 1 1 0 630
  16. # 6 1 0 0 1 0 1 1 1 1 1 623
  17. # 8 1 0 0 0 0 1 1 0 0 0 580
  18. # 10 0 1 1 0 1 1 1 1 0 0 470
  19. # 3 0 0 0 0 1 1 0 1 1 0 226
  20. # 1 0 0 1 0 1 0 1 0 1 0 180
  21. # 4 0 0 0 1 0 1 0 0 1 1 105
  22. # 11 1008 520 458 417 270 253 250 236 231 33 NA

References

J. R. KING (1980), Machine-component grouping in production flow analysis: an approach using a rank order clustering algorithm International Journal of Production Research Vol. 18 , Iss. 2,1980

Amruthnath, N., & Gupta, T. (2016). Modified Rank Order Clustering Algorithm Approach by Including Manufacturing Data. IFAC-PapersOnLine, 49(5), 138-142.