Ejemplo n.º 1
0
 public DbToolSyntaxParser(ISyntaxProvider syntaxProvider)
 {
     _tags = new List<Tag>();
     _suggestions = new List<Suggestion>();
     _syntaxProvider = syntaxProvider;
     _logger = DebugLogger.Instance;
 }
Ejemplo n.º 2
0
        internal static BinaryClassificationResult AutoFit(this BinaryClassificationContext context,
                                                           IDataView trainData,
                                                           string label,
                                                           IDataView validationData            = null,
                                                           InferredColumn[] inferredColumns    = null,
                                                           AutoFitSettings settings            = null,
                                                           CancellationToken cancellationToken = default,
                                                           IProgress <BinaryClassificationItertionResult> iterationCallback = null,
                                                           IDebugLogger debugLogger = null)
        {
            // run autofit & get all pipelines run in that process
            var(allPipelines, bestPipeline) = AutoFitApi.Fit(trainData, validationData, label, inferredColumns,
                                                             settings, TaskKind.BinaryClassification, OptimizingMetric.Accuracy,
                                                             debugLogger);

            var results = new BinaryClassificationItertionResult[allPipelines.Length];

            for (var i = 0; i < results.Length; i++)
            {
                var iterationResult = allPipelines[i];
                var result          = new BinaryClassificationItertionResult(iterationResult.Model, (BinaryClassificationMetrics)iterationResult.EvaluatedMetrics, iterationResult.ScoredValidationData);
                results[i] = result;
            }
            var bestResult = new BinaryClassificationItertionResult(bestPipeline.Model, (BinaryClassificationMetrics)bestPipeline.EvaluatedMetrics, bestPipeline.ScoredValidationData);

            return(new BinaryClassificationResult(bestResult, results));
        }
Ejemplo n.º 3
0
 public static void LogErrorFormat(this IDebugLogger self, string format, params object[] args)
 {
     if (!self.IsEnable)
     {
         return;
     }
     self._LogErrorImpl(string.Format(format, args), null);
 }
Ejemplo n.º 4
0
 public static void LogFormat(this IDebugLogger self, Object context, string format, params object[] args)
 {
     if (!self.IsEnable)
     {
         return;
     }
     self._LogImpl(string.Format(format, args), context);
 }
Ejemplo n.º 5
0
 public static void LogWarning(this IDebugLogger self, object message)
 {
     if (!self.IsEnable)
     {
         return;
     }
     self._LogWarningImpl(message, null);
 }
Ejemplo n.º 6
0
 public static void LogIf(this IDebugLogger self, bool condition, object message)
 {
     if (!condition)
     {
         return;
     }
     self.Log(message);
 }
Ejemplo n.º 7
0
 public static void LogWarningIf(this IDebugLogger self, bool condition, object message, Object context)
 {
     if (!condition)
     {
         return;
     }
     self.LogWarning(message, context);
 }
Ejemplo n.º 8
0
 public static void LogFormatIf(this IDebugLogger self, bool condition, Object context, string format, params object[] args)
 {
     if (!condition)
     {
         return;
     }
     self.LogFormat(context, format, args);
 }
Ejemplo n.º 9
0
 public static void Log(this IDebugLogger self, object message, Object context)
 {
     if (!self.IsEnable)
     {
         return;
     }
     self._LogImpl(message, context);
 }
Ejemplo n.º 10
0
        public DebugTimer(string name, IDebugLogger log)
        {
#if TIMER
            _name = name;
            _log  = log;
            _sw   = new Stopwatch();
            _sw.Start();
#endif
        }
Ejemplo n.º 11
0
        public AppHttpClient(HttpClientHandler handler, IAppCenterLogger appCenterLogger, IDebugLogger debugLogger)
        {
            _httpClient = new HttpClient(handler)
            {
                Timeout = TimeSpan.FromSeconds(30)
            };

            _appCenterLogger = appCenterLogger;
            _debugLogger     = debugLogger;
        }
Ejemplo n.º 12
0
        static void Main(string[] args)
        {
            // Create a debug logger
            logger = new FileLogger();

            // Create vending machine and turn it on, showing the menu
            // Also inject logger to the machine
            Machine vMachine = new Machine("Vending Extravaganza", logger);

            vMachine.TurnMachineOn();
        }
Ejemplo n.º 13
0
 public Catalogue(IDebugLogger logger)
 {
     debugLogger      = logger;
     cataloguePath    = Directory.GetCurrentDirectory() + @"\catalogues\";
     catalogueChoices = Directory.GetFiles(cataloguePath);
     debugLogger.LogMessage("Found " + catalogueChoices.Length + " catalogue choices.");
     foreach (string s in catalogueChoices)
     {
         debugLogger.LogMessage("Catalogue name " + s);
     }
     GetNewCatalogue(catalogueChoices[0]);
 }
Ejemplo n.º 14
0
 public AutoFitter(MLContext mlContext, OptimizingMetricInfo metricInfo, AutoFitSettings settings,
                   TaskKind task, string label, PurposeInference.Column[] puproseOverrides,
                   IDataView trainData, IDataView validationData, IDebugLogger debugLogger)
 {
     _debugLogger          = debugLogger;
     _history              = new List <PipelineRunResult>();
     _label                = label;
     _mlContext            = mlContext;
     _optimizingMetricInfo = metricInfo;
     _settings             = settings ?? new AutoFitSettings();
     _puproseOverrides     = puproseOverrides;
     _trainData            = trainData;
     _task           = task;
     _validationData = validationData;
 }
        public HttpService(IAppCenterLogger appCenterLogger, IDebugLogger debugLogger)
        {
            if (Cookie == null)
            {
                Cookie = new CookieContainer();
            }
            if (HttpClientHandler == null)
            {
                HttpClientHandler = new HttpClientHandler {
                    CookieContainer = Cookie, UseCookies = true
                }
            }
            ;

            _appCenterLogger = appCenterLogger;
            _debugLogger     = debugLogger;

            AppHttpClient = new AppHttpClient(HttpClientHandler, _appCenterLogger, _debugLogger)
            {
                BaseAddress = new Uri(Server.ApiBaseAddress)
            };
        }
Ejemplo n.º 16
0
 public OtsuBinarizationFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
Ejemplo n.º 17
0
 public DetectAndCropPlateNumberFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
 public TeseractOcrFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
Ejemplo n.º 19
0
 public void Setup()
 {
     // Setup machine with a dummy logger for each test
     fl = new FakeLogger();
     m  = new Machine("TestMachine", fl);
 }
 public ExactlyOnceProcessor(ISideEffectsHandler[] sideEffectsHandlers, IDebugLogger log)
 {
     this.sideEffectsHandlers = sideEffectsHandlers;
     this.log = log;
 }
Ejemplo n.º 21
0
        public static (PipelineRunResult[] allPipelines, PipelineRunResult bestPipeline) Fit(IDataView trainData,
                                                                                             IDataView validationData, string label, InferredColumn[] inferredColumns, AutoFitSettings settings,
                                                                                             TaskKind task, OptimizingMetric metric, IDebugLogger debugLogger)
        {
            // hack: init new MLContext
            var mlContext = new MLContext();

            // infer pipelines
            var optimizingMetricfInfo = new OptimizingMetricInfo(metric);
            var autoFitter            = new AutoFitter(mlContext, optimizingMetricfInfo, settings, task,
                                                       label, ToInternalColumnPurposes(inferredColumns),
                                                       trainData, validationData, debugLogger);
            var allPipelines = autoFitter.Fit(1);

            var bestScore    = allPipelines.Max(p => p.Score);
            var bestPipeline = allPipelines.First(p => p.Score == bestScore);

            return(allPipelines, bestPipeline);
        }
Ejemplo n.º 22
0
 public Logger(IAppCenterLogger appCenterLogger, IDebugLogger debugLogger)
 {
     _appCenterLogger = appCenterLogger;
     _debugLogger     = debugLogger;
 }
 public ReadImageFromBytesFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
Ejemplo n.º 24
0
 public VendingMenu(Machine machineMenuIsRunningOn, IDebugLogger debugLogger)
 {
     this.machine = machineMenuIsRunningOn;
     this.logger  = debugLogger;
 }
 public StringAgregateFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
 public FindContoursFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
Ejemplo n.º 27
0
 public SalesforceDebugLogger(
     IDebugLogger debugLogger)
 {
     DebugLogger = debugLogger;
 }
Ejemplo n.º 28
0
 public static void Add(IDebugLogger logger)
 {
     loggers.Add(logger);
 }
Ejemplo n.º 29
0
 public HSTraceListener(IDebugLogger logger)
 {
     loggerWeakReference = new WeakReference(logger);
 }
Ejemplo n.º 30
0
 public CropLettersFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
Ejemplo n.º 31
0
 public Machine(string name, IDebugLogger debugLogger)
 {
     MachineName = name;
     logger      = debugLogger;
 }