public DbToolSyntaxParser(ISyntaxProvider syntaxProvider)
 {
     _tags = new List<Tag>();
     _suggestions = new List<Suggestion>();
     _syntaxProvider = syntaxProvider;
     _logger = DebugLogger.Instance;
 }
        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));
        }
Exemple #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);
 }
Exemple #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);
 }
Exemple #5
0
 public static void LogWarning(this IDebugLogger self, object message)
 {
     if (!self.IsEnable)
     {
         return;
     }
     self._LogWarningImpl(message, null);
 }
 public static void LogIf(this IDebugLogger self, bool condition, object message)
 {
     if (!condition)
     {
         return;
     }
     self.Log(message);
 }
 public static void LogWarningIf(this IDebugLogger self, bool condition, object message, Object context)
 {
     if (!condition)
     {
         return;
     }
     self.LogWarning(message, context);
 }
 public static void LogFormatIf(this IDebugLogger self, bool condition, Object context, string format, params object[] args)
 {
     if (!condition)
     {
         return;
     }
     self.LogFormat(context, format, args);
 }
Exemple #9
0
 public static void Log(this IDebugLogger self, object message, Object context)
 {
     if (!self.IsEnable)
     {
         return;
     }
     self._LogImpl(message, context);
 }
Exemple #10
0
        public DebugTimer(string name, IDebugLogger log)
        {
#if TIMER
            _name = name;
            _log  = log;
            _sw   = new Stopwatch();
            _sw.Start();
#endif
        }
Exemple #11
0
        public AppHttpClient(HttpClientHandler handler, IAppCenterLogger appCenterLogger, IDebugLogger debugLogger)
        {
            _httpClient = new HttpClient(handler)
            {
                Timeout = TimeSpan.FromSeconds(30)
            };

            _appCenterLogger = appCenterLogger;
            _debugLogger     = debugLogger;
        }
Exemple #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();
        }
Exemple #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]);
 }
Exemple #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)
            };
        }
Exemple #16
0
 public OtsuBinarizationFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
Exemple #17
0
 public DetectAndCropPlateNumberFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
 public TeseractOcrFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
Exemple #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;
 }
Exemple #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);
        }
 public Logger(IAppCenterLogger appCenterLogger, IDebugLogger debugLogger)
 {
     _appCenterLogger = appCenterLogger;
     _debugLogger     = debugLogger;
 }
 public ReadImageFromBytesFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
 public VendingMenu(Machine machineMenuIsRunningOn, IDebugLogger debugLogger)
 {
     this.machine = machineMenuIsRunningOn;
     this.logger  = debugLogger;
 }
 public StringAgregateFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
 public FindContoursFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
 public SalesforceDebugLogger(
     IDebugLogger debugLogger)
 {
     DebugLogger = debugLogger;
 }
Exemple #28
0
 public static void Add(IDebugLogger logger)
 {
     loggers.Add(logger);
 }
Exemple #29
0
 public HSTraceListener(IDebugLogger logger)
 {
     loggerWeakReference = new WeakReference(logger);
 }
Exemple #30
0
 public CropLettersFilter(IDebugLogger debugLogger)
 {
     _debugLogger = debugLogger;
 }
Exemple #31
0
 public Machine(string name, IDebugLogger debugLogger)
 {
     MachineName = name;
     logger      = debugLogger;
 }