我想建立一个多项逻辑回归模型来预测类别。为了确保模型的预测能力不会因新数据而异,我尝试通过 ResourceOwnerPasswordResourceDetails resource = new ResourceOwnerPasswordResourceDetails();
resource.setAccessTokenUri(MyApi.instance().getAccessTokenEndpoint());
resource.setClientId(Constants.CLIENT_ID);
resource.setUsername("**********");
resource.setPassword("**********");
resource.setGrantType(GrantType.PASSWORD.getValue() );
resource.setAuthenticationScheme( AuthenticationScheme.none );
resource.setClientAuthenticationScheme( AuthenticationScheme.none );
resource.setTokenName("access-token");
List<String> scopes = new ArrayList<>( );
scopes.add( "Mail.ReadWrite.Shared" );
resource.setScope( scopes );
return resource;
}
public OAuth2RestOperations restTemplate() {
return new OAuth2RestTemplate(resource(), new DefaultOAuth2ClientContext(new DefaultAccessTokenRequest()));
}
包使用重复的交叉验证过程。我无法理解如何解释输出。我拥有的数据非常大,因此出于可重复性的目的,我以caret
数据集为例。代码如下
iris
上面的代码产生了100次交叉验证迭代(10倍交叉验证重复10次),以下是输出之一。
library(caret)
library(nnet)
iris_data <- iris
## Base Class against which log odds are calculated
iris_data$Species <- relevel(iris_data$Species,ref='setosa')
train_control <- trainControl(method='repeatedcv',number=10,repeats = 10,verboseIter = TRUE)
model_cv <- caret::train(Species~.,data=iris_data,trControl=train_control,
method='multinom')
我无法理解输出- Fold10.Rep10: decay=1e-04
Aggregating results
Selecting tuning parameters
Fitting decay = 0.1 on full training set
# weights: 18 (10 variable)
initial value 164.791843
iter 10 value 29.291910
iter 20 value 26.055889
iter 30 value 26.039352
iter 30 value 26.039352
iter 30 value 26.039352
final value 26.039352
converged
的含义。这是剩余的偏差吗?
模型稳定性
为了评估模型的稳定性,我使用了命令value
,该命令给了我以下结果。(被截断)是否应该通过查看准确性得分的偏差来评估模型的稳定性?还是我错过了model_cv$resample
中的一项关键功能?预先谢谢您!
caret