基于层次聚类、异常检测器、分类器和快速模型重建的小样本包异常检测

h-anomal的Python项目详细描述


h\U异常

一个使用分层聚类、异常检测器、分类器和快速模型重建的小示例包异常检测

运行所需的包-

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

安装程序包

^{pr2}$

要使用软件包:

输入h\U异常

import h_anomaly - 'from h_anomaly import driver'

首次建树

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

加载新数据进行测试

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

存储测试数据以备将来使用

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

性能监控认证模型:

cluster.certify_model(cluster_tree,test_y)

检查重新培训的集群模型

cluster.check_model(cluster_tree,threshold)

可用功能:

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)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java CXF和授权   java在网站中部署使用swing创建的表单   java为什么getHeaderField()返回一个字符串,其中getHeaderFields()返回HttpUrlConnection中的Map<String,List<String>>   java如何检测恶意数据包?   webview中的java网页为空   java SWT图像资源,用于将我的所有图像存储在一个位置   java计算数组的最大长度,使平均值小于给定值   java“发件人电话号码无效”和美国号码   将Swing组件作为内容的自定义Java工具提示不会显示   在并发HashMap中重新灰化期间的java检索   Java 7和Tomcat 7.0.64 ClassFormatException:常量池中的字节标记无效   使用JUnit的java assertNull因NullPointerException失败   java内存中的文件是否与文件系统中的文件大小相同?   循环内实例化的类型的java注入依赖项