资源算法IForest-On-Spark

IForest-On-Spark

2020-01-03 | |  39 |   0 |   0

This project Implement the article of :

Liu, Fei Tony, Kai Ming Ting, and Zhi-Hua Zhou. "Isolation forest."Data Mining, 2008. ICDM'08. Eighth IEEE International Conference on. IEEE, 2008.

IForest On Spark use spark to sampling data, and separate each partitoin to a spark worker. Each partition train n isolate trees. The train process is runing on paralle mode.

The prediction uses all isolation trees trained by spark, to predict the outlier factors.

SKLearn Iforest:http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html

Comparation: SKLearn Iforest:http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html

SVM OneClass: SVM OneClass Result:image

IForest On Spark:

IForest On Spark Test Result:image

Project rely on spark-2.1.0-bin-hadoop2.7.Download at :http://spark.apache.org/downloads.html

How To Use:

   var prop = new IForestProperty
    prop.max_sample = 5000
    prop.n_estimators = 1500
    prop.max_depth_limit = (math.log(prop.max_sample) / math.log(2)).toInt
    prop.bootstrap = true
    prop.partition = 10
    
    var ift = new IForestOnSpark(prop)    var data_mtx:DenseMatrix[Double] = ... (train data in matrix)
    ift.fit(data_mtx, spark)    
    x: DenseVector[Double] = ... (test data)    var output = ift.predict(x)    
    //Serialize model to HDFS
    var if_seralizer = new IForestSerializer
    if_seralizer.serialize("hdfs://127.0.0.1/ifserialized", ift)    //Load model from HDFS
    var if_loader = new IForestSerializer
    var localmodel = if_loader.deserialize("hdfs://172.16.22.14:9000/ifserialized")


上一篇:go-iforest

下一篇:ssd_tensorflow_traffic_sign_detection

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...