FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
DataMiningAlgorithm/Others/DataMining_RandomForest/Client.java at master · feiva/DataMiningAlgorithm · GitHub
feiva
DataMiningAlgorithm
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
DataMiningAlgorithm
/
Others
/
DataMining_RandomForest
/
Client.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (28 loc) · 839 Bytes
Breadcrumbs
DataMiningAlgorithm
/
Others
/
DataMining_RandomForest
/
Client.java
Copy path
File metadata and controls
33 lines (28 loc) · 839 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package
DataMining_RandomForest
;
import
java
.
text
.
MessageFormat
;
/**
* 随机森林算法测试场景
*
* @author lyq
*
*/
public
class
Client
{
public
static
void
main
(
String
[]
args
) {
String
filePath
=
"C:
\\
Users
\\
lyq
\\
Desktop
\\
icon
\\
input.txt"
;
String
queryStr
=
"Age=Youth,Income=Low,Student=No,CreditRating=Fair"
;
String
resultClassType
=
""
;
// 决策树的样本占总数的占比率
double
sampleNumRatio
=
0.4
;
// 样本数据的采集特征数量占总特征的比例
double
featureNumRatio
=
0.5
;
RandomForestTool
tool
=
new
RandomForestTool
(
filePath
,
sampleNumRatio
,
featureNumRatio
);
tool
.
constructRandomTree
();
resultClassType
=
tool
.
judgeClassType
(
queryStr
);
System
.
out
.
println
();
System
.
out
.
println
(
MessageFormat
.
format
(
"查询属性描述{0},预测的分类结果为BuysCompute:{1}"
,
queryStr
,
resultClassType
));
}
}
Back
|
FazBrowse Home
|
New Git URL