mirror of
https://github.com/simtactics/servo.git
synced 2025-03-21 11:01:20 +00:00
- WIP decision engine - Redesigned choice dataset - Moved data, images and models folders into notebooks directory for easier eaccess
79 lines
No EOL
1.7 KiB
Text
79 lines
No EOL
1.7 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"#r \"nuget:Microsoft.ML\"\n",
|
|
"#r \"nuget:Microsoft.ML.AutoML\""
|
|
],
|
|
"outputs": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"using Microsoft.ML;\n",
|
|
"using Microsoft.ML.Data;\n",
|
|
"using Microsoft.ML.AutoML;\n",
|
|
"using System.IO;"
|
|
],
|
|
"outputs": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"class NeedsInput {\n",
|
|
" [LoadColumn(0)] public string Action { get; set; }\n",
|
|
" [LoadColumn(1)] public string Need { get; set; }\n",
|
|
" [LoadColumn(2,3)] public float[] Threshold { get; set; }\n",
|
|
"}\n",
|
|
"\n",
|
|
"class NeedsOutput {\n",
|
|
" public int Score { get; set; }\n",
|
|
"}"
|
|
],
|
|
"outputs": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"var dataPath = Path.Combine(Environment.CurrentDirectory, \"data\", \"choice.csv\");"
|
|
],
|
|
"outputs": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"source": [
|
|
"var ctx = new MLContext();\n",
|
|
"var trainingData = ctx.Data.LoadFromTextFile<NeedsInput>(dataPath, hasHeader: true);\n",
|
|
"var recSettings = new RecommendationExperimentSettings();"
|
|
],
|
|
"outputs": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": ".NET (C#)",
|
|
"language": "C#",
|
|
"name": ".net-csharp"
|
|
},
|
|
"language_info": {
|
|
"file_extension": ".cs",
|
|
"mimetype": "text/x-csharp",
|
|
"name": "C#",
|
|
"pygments_lexer": "csharp",
|
|
"version": "8.0"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 4
|
|
} |