-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
062a11e
commit e05ecfa
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters