Skip to content

Commit

Permalink
configs for run rf test
Browse files Browse the repository at this point in the history
  • Loading branch information
xieguigang committed Feb 22, 2025
1 parent 062a11e commit e05ecfa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
30 changes: 30 additions & 0 deletions Data_science/MachineLearning/MachineLearning/test/rf.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Imports Microsoft.VisualBasic.MachineLearning.RandomForests
Imports Microsoft.VisualBasic.Scripting.Runtime

Module rf

Sub Main()
Dim y As New List(Of Double)
Dim id As New List(Of String)
Dim v As New List(Of Double())

For Each line In "G:\GCModeller\src\runtime\sciBASIC#\Data_science\MachineLearning\MachineLearning\RandomForests\training_regression.txt".IterateAllLines

Dim t = line.StringSplit("\s+")
y.Add(Val(t(0)))
id.Add(t(1))
v.Add(t.Skip(2).AsDouble)
Next

Dim ref As New Data With {
.attributeNames = v(0).Sequence(offSet:=1).Select(Function(i) $"#{i}").ToArray,
.Genotype = v.ToArray,
.ID = id.ToArray,
.phenotype = y.ToArray
}
Dim tree As New RanFog
Dim result = tree.Run(ref)

Pause()
End Sub
End Module
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3E1122C1-25C9-47E0-8697-004D353C75FD}</ProjectGuid>
<OutputType>Exe</OutputType>
<StartupObject>test.simpleANNtest</StartupObject>
<StartupObject>test.rf</StartupObject>
<RootNamespace>test</RootNamespace>
<AssemblyName>test</AssemblyName>
<FileAlignment>512</FileAlignment>
Expand Down Expand Up @@ -96,6 +96,7 @@
<Compile Include="Module1.vb" />
<Compile Include="FileTest.vb" />
<Compile Include="activeTest.vb" />
<Compile Include="rf.vb" />
<Compile Include="simpleANNtest.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
Expand Down

0 comments on commit e05ecfa

Please sign in to comment.