Skip to main content

A small example package Anomaly detection using hierarchical clustering, anomaly detector, classifiers and fast model rebuilding

Project description

h_anomaly

A small example package Anomaly detection using hierarchical clustering, anomaly detector, classifiers and fast model rebuilding

Required Packages to run -

1) pandas
2) numpy
3) pickle
4) scipy
5) freediscovery
6) sklearn
7) matplotlib

Install the Package

pip install -U h_anomaly

To Use the Package:

Import h_anomaly

import h_anomaly - 'from h_anomaly import driver'

Building Tree for the 1st time

cluster,cluster_tree,max_depth = driver.cluster_driver(file_path,target_class,default_class)

Loading New data for testing

df,train_X,train_y = driver.get_data(file_path,target_class,default_class)

Storing Test Data for future uses

test_df,test_X,test_y = driver.get_data(file_path,target_class,default_class)
cluster.set_test(test_X,test_y)

Certify Model for performance monitoring:

cluster.certify_model(cluster_tree,test_y)

Check Cluster model for retraining

cluster.check_model(cluster_tree,threshold)

Available Functions:

1) fit - Fit the Data into the Birch algorithm to create the clusters
  def fit(self,data,y)
2) set_test - Store the test data for future uses
  set_test(self,data,y)
3) get_cluster_tree - For each cluster at every level creates the bcluster objects
  get_cluster_tree(self)
4) model_adder - Classification model added to each cluster by this function (Change this function to add different model)
  def model_adder(self,cluster_tree)
5) update_model - Classification model is updated with new data
   update_model(self,cluster_tree,cluster_id)
6) outlier_model_adder - Outlier detection model is added to each cluster (Change this function to add different model)
  outlier_model_adder(self,cluster_tree)
7) certify_model - Scores are calculated in this function
  certify_model(self,cluster_tree,test_y)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for h-anomaly, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size h_anomaly-0.0.6-py3-none-any.whl (7.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size h_anomaly-0.0.6.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page