Remove unnecessary DMatrix methods (#5324)

This commit is contained in:
Rory Mitchell
2020-02-25 12:40:39 +13:00
committed by GitHub
parent 655cf17b60
commit b0ed3f0a66
10 changed files with 43 additions and 72 deletions

View File

@@ -16,21 +16,6 @@ MetaInfo& SimpleDMatrix::Info() { return info; }
const MetaInfo& SimpleDMatrix::Info() const { return info; }
float SimpleDMatrix::GetColDensity(size_t cidx) {
size_t column_size = 0;
// Use whatever version of column batches already exists
if (sorted_column_page_) {
auto batch = this->GetBatches<SortedCSCPage>();
column_size = (*batch.begin())[cidx].size();
} else {
auto batch = this->GetBatches<CSCPage>();
column_size = (*batch.begin())[cidx].size();
}
size_t nmiss = this->Info().num_row_ - column_size;
return 1.0f - (static_cast<float>(nmiss)) / this->Info().num_row_;
}
BatchSet<SparsePage> SimpleDMatrix::GetRowBatches() {
// since csr is the default data structure so `source_` is always available.
auto begin_iter = BatchIterator<SparsePage>(
@@ -76,8 +61,6 @@ BatchSet<EllpackPage> SimpleDMatrix::GetEllpackBatches(const BatchParam& param)
return BatchSet<EllpackPage>(begin_iter);
}
bool SimpleDMatrix::SingleColBlock() const { return true; }
template <typename AdapterT>
SimpleDMatrix::SimpleDMatrix(AdapterT* adapter, float missing, int nthread) {
// Set number of threads but keep old value so we can reset it after