servo/notebooks/decision.ipynb
Tony Bark 929b96b07b Temporarily removed Visual Studio solution
- WIP decision engine
- Redesigned choice dataset
- Moved data, images and models folders into notebooks directory for easier eaccess
2020-12-04 16:59:17 -05:00

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
}