//TODO
/**
* Put your code for adding information to your NB classifier here
* 读入数据,注意建立好数据结构
**/
public void addExample(String klass, List<String> words) {
}
//TODO
/*
* 判断测试集为pos或neg
* Put your code here for deciding the class of the input file.
* Currently, it just randomly chooses "pos" or "negative"
*/
public String classify(List<String> words) {
if(new Random().nextDouble() < 0.5) {
return "pos";
} else {
return "neg";
}
}
补充完整这两个函数
/**
* Put your code for adding information to your NB classifier here
* 读入数据,注意建立好数据结构
**/
public void addExample(String klass, List<String> words) {
}
//TODO
/*
* 判断测试集为pos或neg
* Put your code here for deciding the class of the input file.
* Currently, it just randomly chooses "pos" or "negative"
*/
public String classify(List<String> words) {
if(new Random().nextDouble() < 0.5) {
return "pos";
} else {
return "neg";
}
}
补充完整这两个函数
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货