Fsx script not working
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- fsharp
调研方向
首先运行提供的 .fsx 脚本,并检查 Project.fsproj.fsx trace 中 LoadFromEnumerable 处的失败,尤其是 F# option 成员 Price。确定此示例是否支持 .fsx 脚本,以及报告的 IDataView 类型错误是否属于预期情况;完成的标准是得出确认的诊断,并且示例能够运行,或已记录该限制。
由索引模型根据 Issue 内容生成。
描述
Is .fsx not supported ?
I can't reproduce the simple demo in F# script , this doesnt seem to work
#r "nuget: Microsoft.ML"
open Microsoft.ML
open Microsoft.ML.Data
[<CLIMutable>]
type HouseData =
{ [<ColumnName("Size")>] Size: float32
[<ColumnName("Price")>] Price: float32 option }
[<CLIMutable>]
type Prediction =
{ [<ColumnName("Score")>] Price: float32 }
let mlContext = new MLContext()
// 1. Import or create training data
let houseData = [| { Size = 1.1F; Price = Some(1.2F) };
{ Size = 1.9F; Price = Some(2.3F) };
{ Size = 2.8F; Price = Some(3.0F) };
{ Size = 3.4F; Price = Some(3.7F) } |]
let trainingData = mlContext.Data.LoadFromEnumerable(houseData)
// 2. Specify data preparation and model training pipeline
let pipeline =
EstimatorChain()
.Append(
mlContext.Transforms.Concatenate("Features", [| "Size" |])
)
.Append(
mlContext.Regression.Trainers
.Sdca(labelColumnName = "Price", maximumNumberOfIterations = 100)
)
// 3. Train model
let model = pipeline.Fit(trainingData)
// 4. Make a prediction
let size = { Size = 2.5F ; Price = None }
let predictionFunc =
mlContext.Model.CreatePredictionEngine<HouseData, Prediction>(model)
let price = predictionFunc.Predict(size)
printfn "Predicted price for size: %f sq ft= %f" (size.Size * 1000.0F) (price.Price * 100.0F)
// Predicted price for size: 2500.0 sq ft= 261.979980
here is the error
/Users/admin/.packagemanagement/nuget/Projects/54657--8671ee2c-1953-4d65-be3f-818b53cc0f76/Project.fsproj : warning NU1701: Package 'System.Xml.Linq 3.5.21022.801' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.
/Users/admin/.packagemanagement/nuget/Projects/54657--8671ee2c-1953-4d65-be3f-818b53cc0f76/Project.fsproj : warning NU1701: Package 'System.Xml.Linq 3.5.21022.801' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.
[Loading /Users/admin/.packagemanagement/nuget/Projects/54657--8671ee2c-1953-4d65-be3f-818b53cc0f76/Project.fsproj.fsx]
module FSI_0015.Project.fsproj
System.ArgumentOutOfRangeException: Could not determine an IDataView type and registered custom types for member Price@ (Parameter 'rawType')
at Microsoft.ML.Data.InternalSchemaDefinition.GetVectorAndItemType(String name, Type rawType, IEnumerable`1 attributes, Boolean& isVector, Type& itemType)
at Microsoft.ML.Data.InternalSchemaDefinition.GetVectorAndItemType(MemberInfo memberInfo, Boolean& isVector, Type& itemType)
at Microsoft.ML.Data.SchemaDefinition.Create(Type userType, Direction direction)
at Microsoft.ML.Data.InternalSchemaDefinition.Create(Type userType, Direction direction)
at Microsoft.ML.Data.DataViewConstructionUtils.CreateFromEnumerable[TRow](IHostEnvironment env, IEnumerable`1 data, SchemaDefinition schemaDefinition)
at Microsoft.ML.DataOperationsCatalog.LoadFromEnumerable[TRow](IEnumerable`1 data, SchemaDefinition schemaDefinition)
at <StartupCode$FSI_0016>.$FSI_0016.main@() in /Users/admin/Repositories/scripts/mlanonimizer.fsx:line 380
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Stopped due to error
- 主要语言
- PowerShell
- 星标
- 4.7k
- 派生
- 2.7k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/machinelearning-samples 的其他 Issue
-
Missing "Anomaly Detection of Numbers of Phone Calls sample" link on main readme可能已有人在做 @tomaszcekalo 于 1963 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
-
Missing “DeepLearning Binary classification sample" link on main readme可能已有人在做 @tomaszcekalo 于 1963 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 68/100
-
难度 5/5 一周以上 新手友好度 25/100
dotnet/machinelearning-samples#1048 ·
-
难度 4/5 3-5 天 新手友好度 20/100
dotnet/machinelearning-samples#1044 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 15/100
dotnet/machinelearning-samples#1043 · 1 条评论 ·
查看 dotnet/machinelearning-samples 的全部 Issue
相似的 Issue
-
[Bug]: iter_prefetch crashes on accelerators without record_stream (MPS)可能已有人在做 @begcdn 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
vllm-project/llm-compressor#3269 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 60/100
维护者通常 2 天内回复
-
Potential Bug
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ostris/ai-toolkit#1076 ·
维护者通常 2 天内回复