ml.net

ML.NET生成器带来了许多错误修复和增强功能以及新功能

我只是一个虾纸丫 提交于 2021-02-10 09:30:45
ML.NET是一个开源的跨平台机器学习框架,适合 .NET 开发人员。它允许将机器学习集成到 .NET 应用中,而无需离开 .NET 生态系统,甚至拥有 ML 或数据科学背景。ML.NET工具(Visual Studio 中的 UI 模型生成器和跨平台 ML.NET CLI),可根据您的场景和数据自动训练自定义机器学习模型。 此版本ML.NET生成器带来了许多错误修复和增强功能以及新功能,包括高级数据加载选项和来自 SQL Server的流训练数据。 高级数据加载选项 以前,模型生成器不提供任何数据加载选项,它依赖于 AutoML 来检测列、标头和分隔符以及十进制分隔符样式。 让我们看一下模型生成器中使用出租车费数据集中新的高级数据加载选项。这是一个回归问题,您可以根据旅行距离、付款类型和乘客人数等几个因素预测出租车票价金额。 在模型生成器中, 选择值预测方案和本地训练环境后,您将最终进入 "数据" 步骤。选择 "文件" 作为数据源类型 ,浏览出租车票价数据集,选择数据集后,将 "列"更改为"预测" fare_amount。 选择 "高级数据"选项以打开高级数据加载选项对话框。 在此对话框中,有两个部分 - 列设置 和数据格式 。 列设置 在" 列设置 "部分中,您可以将每个要素列(用于预测标签的列)的列更改为 分类、 文本 、数字或 忽略: 分类列包含在标记组离散数量中的数据

Load model with ML.NET saved with keras

倖福魔咒の 提交于 2021-02-08 19:57:19
问题 I have a Neural Network implemented in Python with Keras. Once I have trained it I have exported the model and I have got two files: model.js and model.h5. Now I want to classify in real time inside a .NET project and I want to use the trained Neural Network for it. Is there a way in ML.NET of loading the model and trained weights exported with python into a model object? I have seen in the documentation[1] that a previous saved model can be loaded, but apparently is storage in a .zip and I

ML.NET fails to run on uwp

蹲街弑〆低调 提交于 2021-02-08 05:38:37
问题 I built a UWP App in Visual Studio 2017 and also added a class library in the solution to run ML.NET but every time I run the application I get an exception PlatformNotSupportedException . Retrieving information about local processes is not supported on this platform What could be the problem? 回答1: This is a .NET Standard exception that happens when the a library tries to access an API which is not actually implemented on the platform but is present to make the platform .NET Standard

Is it possible to add a service from a controller or manager class other than the ConfigureService method

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-29 17:31:05
问题 I want to Use services.AddPredictionEnginePool<..> When I use "IServiceCollection DI" I receive the notification below Cannot instantiate implementation type 'Microsoft.Extensions.DependencyInjection.IServiceCollection' for service type 'Microsoft.Extensions.DependencyInjection.IServiceCollection'. How can I Use this; services.AddPredictionEnginePool<..> From other classes. Why I want do; The reason of the usage of the service is to add a new object in runtime. 回答1: IServiceCollection is the

Retrain Multiclassification ITransformer

混江龙づ霸主 提交于 2021-01-29 12:38:41
问题 I created a ITransformer model based on the SdcaMaximumEntropy trainer from the MulticlassClassification : var trainingPipeline = pipeline.Append(mlContext.MulticlassClassification.Trainers.SdcaMaximumEntropy()) .Append(mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel")); ITransformer trainedModel = trainingPipeline.Fit(splitTrainSet); Now I want to retrain it with the Fit method by applying the original model parameters : var originalModelParameters = (

ML.NET MakePredictionFunction dynamic type?

天涯浪子 提交于 2021-01-29 07:16:36
问题 I am able to dynamically train and create my regression model just fine from a string[] of column names. However, when I try to pass in a dynamic object with the same Parameter names as Dictionary Key Pair properties it throw the error: System.ArgumentOutOfRangeException: 'Could not find input column '<MyColumn>'' Where <MyColumn> is the first parameter that the model is looking for. private static void TestSinglePrediction(MLContext mlContext, dynamic ratingDataSample, int actual) {

ML.Net sentimental analysis prediction of comments not working in ASP.NET MVC web application

我怕爱的太早我们不能终老 提交于 2021-01-29 02:43:34
问题 I am trying to make project in .NET framework in which the controller code is as below: [HttpGet] public ActionResult Analysis() { return View(); } [HttpPost] public ActionResult Analysis(ModelInput input) { // Load the model MLContext mlContext = new MLContext(); ITransformer mlModel = mlContext.Model.Load(@"C:\Users\samya\source\repos\riya123\riya123ML.Model\MLModel.zip", out var modelInputSchema); // Create prediction engine related to the loaded train model var predEngine = mlContext

System.InvalidOperationException : The asynchronous operation has not completed

萝らか妹 提交于 2021-01-28 04:00:44
问题 Fitting the pipeline causing exception in Ml.net. The Fit is not an awaitable and I'm confused why this happens. Any help is appreciable var model = pipeline.Fit(dataView); Stack trace at System.Threading.Channels.AsyncOperation.ThrowIncompleteOperationException() at System.Threading.Channels.AsyncOperation 1.GetResult(Int16 token) at Microsoft.ML.Transforms.RowShufflingTransformer.Cursor.MoveNextCore() at Microsoft.ML.Data.RootCursorBase.MoveNext() at Microsoft.ML.Trainers.TrainingCursorBase

System.InvalidOperationException : The asynchronous operation has not completed

巧了我就是萌 提交于 2021-01-28 03:43:52
问题 Fitting the pipeline causing exception in Ml.net. The Fit is not an awaitable and I'm confused why this happens. Any help is appreciable var model = pipeline.Fit(dataView); Stack trace at System.Threading.Channels.AsyncOperation.ThrowIncompleteOperationException() at System.Threading.Channels.AsyncOperation 1.GetResult(Int16 token) at Microsoft.ML.Transforms.RowShufflingTransformer.Cursor.MoveNextCore() at Microsoft.ML.Data.RootCursorBase.MoveNext() at Microsoft.ML.Trainers.TrainingCursorBase

ML.NET 推荐引擎中一类矩阵因子分解的缺陷

守給你的承諾、 提交于 2021-01-16 13:21:27
ML.NET 作为 .NET 跨平台的机器学习套件,在回归、预测、分类甚至是图像识别、异常检测都展现出简洁快速的优势,以往的文章已介绍过不再赘述。其实机器学习场景中还有一类非常常见的,就是推荐,特别是在线购物、文娱产品为了提升用户体验,一个比较好的主意就是让用户优先看到他需要的物品、内容,甚至提供用户意料之外又情理之中的产商品。推荐算法正好能够通过数据实现这一目标。 如上图所示,如果我们有用户、商品的购买关系,并且还有用户的评级、评分、评价内容,那么矩阵因子分解算法非常适用。如果我们还能获取到商品本身的一些属性,比如名称、分类、简介、价格的话,那么场感知分解机算法就能发挥特别好的作用。当然,推荐算法比较难的就是冷启动阶段,可能什么数据都没有,初始阶段没有更多选择,那么也只能从相似用户消费记录入手做推荐了,获取用户与购买商品编号的对应关系也算是容易的,此时用得比较多的是一类矩阵因子分解算法。仍然举一个例子,刚刚营业的某书店,基于借阅书的记录,我们给借了《三国志》的读者小强推荐同样借过这本书的小王借看的其他书,可能不一定是名著,不过没关系,这足够达到推荐的效果,因为算法背后的逻辑是相信他们总有其他书是都喜欢看的。 了解到前面的背景知识后,回头我们再看看 ML.NET 的推荐引擎,它同时支持矩阵因子分解和场感知分解算法,官网文档在《教程:使用矩阵因子分解和 ML.NET 生成影片推荐系统