コード例 #1
0
        private void RunAssociationRulesMining()
        {
            TypeOfPreferrence typeOfPreferrence = TypeOfPreferrence.Both_PositiveAndNegativePreferrence;

            if (rdoPositive.Checked == true)
            {
                typeOfPreferrence = TypeOfPreferrence.PositivePreferrence;
            }
            else
            if (rdoNegative.Checked == true)
            {
                typeOfPreferrence = TypeOfPreferrence.NegativePreferrence;
            }
            else
            if (rdoBoth.Checked == true)
            {
                typeOfPreferrence = TypeOfPreferrence.Both_PositiveAndNegativePreferrence;
            }

            float supportlevel = float.Parse(txtMinSupportLevel.Text);

            MAPresApplication.Workspace.PerformAssociationRulesMining(OnAssociationRuleMiningProgress, typeOfPreferrence, supportlevel, false);
            MAPResDatasetViewer dtw = new MAPResDatasetViewer();

            dtw.ShowAllAssociationRules();
            Dispose();
        }
コード例 #2
0
        public bool IsPreferred(Rule rule, TypeOfPreferrence typeOfPreferrence)
        {
            int  ctr = 0;
            Site site;

            for (int index = 0; index < rule.Count; index++)
            {
                site = rule[index];
                if (_preferrenceResult.IsPreferred(site, typeOfPreferrence) == true)
                {
                    ctr++;
                }
                else
                {
                    index = rule.Count + 1;
                    ctr   = 0;
                }
            }

            if (ctr == rule.Count)
            {
                return(true);
            }

            return(false);
        }
コード例 #3
0
        public AssociationRulesMining(WorkSpace workspace, TypeOfPreferrence typeOfPreferrence, float minSupportLevel, bool useVariantSupport)
        {
            _workspace                 = workspace;
            _typeOfPreferrence         = typeOfPreferrence;
            _minSupportLevelPercentage = minSupportLevel;
            minSupportLevel            = minSupportLevel / 100;
            _minSupportLevel           = minSupportLevel * _workspace.SubjectsHash[_workspace.SelectedSubject].PeptideDataTable.Rows.Count;
            _useVariantSupport         = useVariantSupport;

            armArg = new AssociationRulesMiningProgressArg();

            if (typeOfPreferrence == TypeOfPreferrence.Both_PositiveAndNegativePreferrence)
            {
                _lstOfPreferredSites = _workspace.PreferrenceEstimationResultSet.BothPositivelyAndNegativelyPreferredSites;
            }
            else
            if (typeOfPreferrence == TypeOfPreferrence.PositivePreferrence)
            {
                _lstOfPreferredSites = _workspace.PreferrenceEstimationResultSet.PositivelyPreferredSites;
            }
            else
            if (typeOfPreferrence == TypeOfPreferrence.NegativePreferrence)
            {
                _lstOfPreferredSites = _workspace.PreferrenceEstimationResultSet.NegativelyPreferredSites;
            }
        }
コード例 #4
0
 public bool IsPreferred(Site site, TypeOfPreferrence typeOfPreferrence)
 {
     if (typeOfPreferrence == TypeOfPreferrence.Both_PositiveAndNegativePreferrence)
     {
         return(bothPositiveAndNegativePreferredSites.Contains(site));
     }
     else if (typeOfPreferrence == TypeOfPreferrence.NegativePreferrence)
     {
         return(negativelyPreferredSites.Contains(site));
     }
     else if (typeOfPreferrence == TypeOfPreferrence.PositivePreferrence)
     {
         return(positivelyPreferredSites.Contains(site));
     }
     return(false);
 }
コード例 #5
0
        public void PerformAssociationRulesMining(WorkProgressEventHandler onEventFunction, TypeOfPreferrence typeOfPreferrence, float minSupportLevel, bool useVariantSupport)
        {
            AssociationRulesMining arm;
            string subjectBookmarked = SelectedSubject;

            foreach (string subject in this.SubjectNames)
            {
                SelectedSubject = subject;
                using (arm = new AssociationRulesMining(this, typeOfPreferrence, minSupportLevel, useVariantSupport))
                {
                    if (onEventFunction != null)
                    {
                        arm.AssociationRulesMiningProgress += new WorkProgressEventHandler(onEventFunction);
                    }
                    arm.RunAssociationRulesMining();
                    _isDirty = true;
                }
            }
            SelectedSubject = subjectBookmarked;

            project.AssociationAnalysisPerformed = true;
        }