Ejemplo n.º 1
0
 public static VectorPointBase ToVectorPoint(this KeyFeature data, IEmbeddingModel model, int id)
 {
     if (model is Ip2VecModel || model is NeVeModel)
     {
         return(new DoubleVectorPoint
         {
             TimeTick = DateTime.Parse(data.Timestamp).SecondsTick(),
             Vector = data.VectorByModel(model),
             Id = id
         });
     }
     else if (model is StringEmbeddingModel)
     {
         return(new StringVectorPoint
         {
             TimeTick = DateTime.Parse(data.Timestamp).SecondsTick(),
             Vector = ((StringEmbeddingModel)model).GetStringVector(data),
             Id = id
         });
     }
     else
     {
         throw new InvalidCastException(string.Format("Unknown type of {0}", model.GetType()));
     }
 }
Ejemplo n.º 2
0
        public void BeginEasyAccess(int times, IEmbeddingModel model, DoWorkEventHandler embeddingHandler)
        {
            this.ClusteringController.EmbeddingModel = model;
            var worker = new BackgroundWorker();

            worker.DoWork += this.EasyAccess;
            worker.RunWorkerAsync(new object[] { times, embeddingHandler });
        }
Ejemplo n.º 3
0
 public static double[] VectorByModel(this KeyFeature x, IEmbeddingModel model)
 {
     return(model.LookupVectorByWord(x.SourceIp)
            .Zip(model.LookupVectorByWord(x.TargetIp), Sum)
            .Zip(model.LookupVectorByWord(x.TargetPort), Sum)
            .Zip(model.LookupVectorByWord(x.Protocol), Sum)
            .ToArray());
 }
Ejemplo n.º 4
0
        public void BeginMeasurement(IEmbeddingModel model)
        {
            this.ClusteringController.EmbeddingModel = model;

            var worker = new BackgroundWorker();

            worker.DoWork += this.ClusteringController.ClusteringMeasurementWorker;
            worker.RunWorkerAsync();
        }
Ejemplo n.º 5
0
        public void BeginDBScan(IEmbeddingModel model)
        {
            this.ClusteringController.EmbeddingModel = model;

            var worker = new BackgroundWorker();

            worker.DoWork += ClusteringController.DBScanWorker;
            worker.RunWorkerAsync();
        }
Ejemplo n.º 6
0
        public void BeginKDisCurveCalculator(IEmbeddingModel model)
        {
            this.ClusteringController.EmbeddingModel = model;

            var worker = new BackgroundWorker();

            worker.DoWork += ClusteringController.CalcInflectionPointWorker;
            worker.RunWorkerAsync();
        }
Ejemplo n.º 7
0
        public void BeginTSNETransform(IEmbeddingModel model)
        {
            this.ClusteringController.EmbeddingModel = model;

            var worker = new BackgroundWorker();

            worker.DoWork += this.ClusteringController.TSNETransformWorker;
            worker.RunWorkerAsync();
        }
Ejemplo n.º 8
0
 public static VectorPointBase ToVectorPoint(this KeyFeatureClustered data, IEmbeddingModel model)
 {
     return(ToVectorPoint(data, model, data.Id));
 }