We recommend using our predictions as one tool among many in your betting strategy. Combining our insights with your own research can lead to more informed decisions. Remember that responsible gambling involves considering multiple factors before placing a bet.
How often are updates made?
Predictions are updated daily before each new round of matches begins. This ensures that you have access to the latest information regarding team form, player injuries, weather conditions, and other relevant factors that could influence match outcomes.
Are there any subscription fees?
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NuGet.Common;
namespace Microsoft.ML.Probabilistic.Compiler;
/// A builder for creating an instance of NuGetPackageExporter
/// which is responsible for exporting compiled probabilistic models as NuGet packages.
public sealed class NuGetPackageExporterBuilder : IExporterBuilder
{
/// Logger
private readonly ILogger? _logger;
/// List of directories containing model files.
private readonly List? _modelDirectories;
/// Configuration options.
private readonly IConfiguration? _configuration;
/// Path where NuGet packages will be exported.
private string _outputPath = ".";
/// Name used as prefix when generating NuGet package IDs.
private string _idPrefix = "Microsoft.ML.Probabilistic";
/// Default constructor.
public NuGetPackageExporterBuilder(ILogger? logger = null)
{
_logger = logger;
}
/// Set directories containing model files.
public NuGetPackageExporterBuilder SetModelDirectories(params string[] modelDirectories)
{
if (modelDirectories == null || modelDirectories.Length == 0)
throw new ArgumentException("No model directories specified");
_modelDirectories = modelDirectories.ToList();
return this;
}
/// Set configuration options.
public NuGetPackageExporterBuilder SetConfiguration(IConfiguration configuration)
{
if (configuration == null)
throw new ArgumentNullException(nameof(configuration));
if (_configuration != null)
throw new InvalidOperationException("Configuration has already been set");
_configuration = configuration;
return this;
}
/// Set path where NuGet packages will be exported.
public NuGetPackageExporterBuilder SetOutputPath(string outputPath)
{
if (string.IsNullOrWhiteSpace(outputPath))
throw new ArgumentException("Output path must not be null or empty", nameof(outputPath));
if (!Directory.Exists(outputPath))
throw new DirectoryNotFoundException($"Output path '{outputPath}' does not exist");
if (_outputPath != "." && outputPath != _outputPath)
throw new InvalidOperationException("Output path has already been set");
if (_configuration != null && _configuration["Export:NuGet:OutputPath"] != null)
throw new InvalidOperationException("Output path has already been set via configuration");
if (outputPath != ".")
Path.GetFullPath(outputPath);
return this;
}
private string GetOutputPath()
{
if (_outputPath != ".")
return _outputPath;
#if NET6_0_OR_GREATER
#pragma warning disable CS0618 // Type or member is obsolete
#endif
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0618 // Type or member is obsolete
#if NET6_0_OR_GREATER
// Net6+ use IHostEnvironment
var environment = ActivatorUtilities.CreateInstance(new ServiceCollection().BuildServiceProvider());
return environment.ContentRootPath ?? ".";
#else
// Net5 uses IHostingEnvironment
var hostingEnvironment = ActivatorUtilities.CreateInstance(new ServiceCollection().BuildServiceProvider());
return hostingEnvironment.ContentRootPath ?? ".";
#endif
}
private void EnsureSet()
{
#if NET6_0_OR_GREATER
#pragma warning disable CS0618 // Type or member is obsolete
#endif
// Net6+ use IHostEnvironment
var environment = ActivatorUtilities.CreateInstance(new ServiceCollection().BuildServiceProvider());
#pragma warning restore CS0618 // Type or member is obsolete
#if NET6_0_OR_GREATER
// Net6+ use IHostEnvironment
if (string.IsNullOrWhiteSpace(_idPrefix))
{
var assemblyName = Assembly.GetEntryAssembly()?.GetName() ?? Assembly.GetCallingAssembly()?.GetName();
if (assemblyName?.Name == null)
#if NET7_0_OR_GREATER
throw new InvalidOperationException(
#else
throw new InvalidOperationException(
#endif
"Cannot determine assembly name"
);
}
else if (_idPrefix.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
throw new ArgumentException($"Invalid characters found in id prefix '{_idPrefix}'", nameof(_idPrefix));
#else
// Net5 uses IHostingEnvironment
if (string.IsNullOrWhiteSpace(_idPrefix))
{
var assemblyName = Assembly.GetEntryAssembly()?.GetName() ?? Assembly.GetCallingAssembly()?.GetName();
if (assemblyName?.Name == null)
#if NET7_0_OR_GREATER
throw new InvalidOperationException(
#else
throw new InvalidOperationException(
#endif
"Cannot determine assembly name"
);
}
else if (_idPrefix.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
throw new ArgumentException($"Invalid characters found in id prefix '{_idPrefix}'", nameof(_idPrefix));
#endif
#if NET6_0_OR_GREATER
// Net6+ use IHostEnvironment
if (!Directory.Exists(GetOutputPath()))
throw new DirectoryNotFoundException($"Output path '{GetOutputPath()}' does not exist");
#else
// Net5 uses IHostingEnvironment
if (!Directory.Exists(GetOutputPath()))
throw new DirectoryNotFoundException($"Output path '{GetOutputPath()}' does not exist");
#endif
#if NET6_0_OR_GREATER
// Net6+ use IHostEnvironment
if (!_modelDirectories?.Any() ?? false)
throw new InvalidOperationException("No model directories specified");
#else
// Net5 uses IHostingEnvironment
if (!_modelDirectories?.Any() ?? false)
throw new InvalidOperationException("No model directories specified");
#endif
#if NET6_0_OR_GREATER
// Net6+ use IHostEnvironment
if (!File.Exists(Path.Combine(GetOutputPath(), "nuget.exe")))
throw new FileNotFoundException($"Could not find nuget.exe in '{GetOutputPath()}'", "nuget.exe");
#else
// Net5 uses IHostingEnvironment
if (!File.Exists(Path.Combine(GetOutputPath(), "nuget.exe")))
throw new FileNotFoundException($"Could not find nuget.exe in '{GetOutputPath()}'", "nuget.exe");
#endif
#if NET6_0_OR_GREATER
// Net6+ use IHostEnvironment + ConfigurationBuilder()
var builder = new ConfigurationBuilder()
.AppendConfiguration(_configuration ?? environment.Configuration);
#else
// Net5 uses IHostingEnvironment + ConfigurationBuilder()
var builder = new ConfigurationBuilder()
.AppendConfiguration(_configuration ?? hostingEnvironment.Configuration);
#endif
builder.AddInMemoryCollection(new Dictionary()
{
{"Export:NuGet:IdPrefix", _idPrefix},
{"Export:NuGet:Version", $"1.0.{Guid.NewGuid():N}"},
{"Export:NuGet:ProjectUrl", "https://github.com/dotnet/machinelearning-probabilistic"},
{"Export:NuGet:IconUrl", "https://raw.githubusercontent.com/dotnet/machinelearning-probabilistic/main/docs/images/logo.png"},
});
var configuration = builder.Build();
if (string.IsNullOrWhiteSpace(configuration["Export:NuGet:Description"]))
#if NET7_0_OR_GREATER
throw new ArgumentException(
#else
throw new ArgumentException(
#endif
$"Description cannot be null or whitespace",
nameof(configuration["Export:NuGet:Description"])
);
if (string.IsNullOrWhiteSpace(configuration["Export:NuGet:Authors"]))
#if NET7_0_OR_GREATER
throw new ArgumentException(
#else
throw new ArgumentException(
#endif
$"Authors cannot be null or whitespace",
nameof(configuration["Export:NuGet:Authors"])
);
if (string.IsNullOrWhiteSpace(configuration["Export:NuGet:Copyright"]))
#if NET7_0_OR_GREATER
throw new ArgumentException(
#else
throw new ArgumentException(
#endif
$"Copyright cannot be null or whitespace",
nameof(configuration["Export:NuGet:Copyright"])
);
}
public INuGetPackageExporter Build()
{
#if NET6_0_OR_GREATER
// Net6+ use IHostEnvironment + ConfigurationBuilder()
var environment = ActivatorUtilities.CreateInstance(new ServiceCollection().BuildServiceProvider());
var builder = new ConfigurationBuilder()
.AppendConfiguration(_configuration ?? environment.Configuration);
#else
// Net5 uses IHostingEnvironment + ConfigurationBuilder()
var hostingEnvironment = ActivatorUtilities.CreateInstance(new ServiceCollection().BuildServiceProvider());
var builder = new ConfigurationBuilder()
.AppendConfiguration(_configuration ?? hostingEnvironment.Configuration);
#endif
builder.AddInMemoryCollection(new Dictionary()
{
{"Export:NuGet:IdPrefix", _idPrefix},
{"Export:NuGet:Version", $"1.0.{Guid.NewGuid():N}"},
{"Export:NuGet:ProjectUrl", "https://github.com/dotnet/machinelearning-probabilistic"},
{"Export:NuGet:IconUrl", "https://raw.githubusercontent.com/dotnet/machinelearning-probabilistic/main/docs/images/logo.png"},
});
var configuration = builder.Build();
SetOutputPath(configuration["Export:NuGet:Output"]);
SetIdPrefix(configuration["Export:NuSetIdPrefix"]);
return Build();
}
private void SetIdPrefix(string idPrefix)
{
if (string.IsNullOrWhiteSpace(idPrefix))
#if NET7_0_OR_GREATER
throw new ArgumentException(
#else
throw new ArgumentException(
#endif
$"Id prefix cannot be null or whitespace",
nameof(idPrefix)
);
if (_idPrefix.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
#if NET7_0_OR_GREATER
throw new ArgumentException(
#else
throw new ArgumentException(
#endif
$"Invalid characters found in id prefix '{idPrefix}'",
nameof(idPrefix)
);
_idPrefix = idPrefix;
}
public INuSetPackageExporter Build()
{
try {
EnsureSet();
}
catch (Exception ex) {
if (_logger != null)
_logger.LogError(ex.ToString());
throw ex;
}
return CreateNuSetPackageExporter();
}
private INuSetPackageExporter CreateNuSetPackageExporter()
{
return ActivatorUtilities.CreateInstance(
new ServiceCollection().AddLogging(l => l.AddConsole())
.ConfigureLogging(logging =>
logging.ClearProviders()
.AddProvider(new LoggerProvider())
.AddConsole())
.BuildServiceProvider(),
_logger,
_modelDirectories,
_outputPath,
_idPrefix,
_configuration!
);
}
}<|repo_name|>dotnet/machinelearning-probabilistic<|file_sep|>/src/probabilistic/Compiler/IR/Models/ISpecializedModel.cs
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Collections.Generic;
namespace Microsoft.ML.Probabilistic.Compiler;
public interface ISpecializedModel : IPackageModel {
IList? ModelParameters { get; }
IList? ModelVariables { get; }
IList? PackageMethods { get; }
IList? PackageProperties { get; }
IList? ModelConstructors { get; }
IList? ModelMethods { get; }