| 119 | } |
| 120 | |
| 121 | void TKNNCalcer::LoadLargeParameters(IInputStream* stream) { |
| 122 | if (IsClassification) { |
| 123 | ::Load(stream, TargetClasses); |
| 124 | } else { |
| 125 | ::Load(stream, Targets); |
| 126 | } |
| 127 | size_t indexSize = ::LoadSize(stream); |
| 128 | TLengthLimitedInput indexArrayStream(stream, indexSize); |
| 129 | auto indexArray = TBlob::FromStream(indexArrayStream); |
| 130 | CB_ENSURE(indexArray.Size() == indexSize); |
| 131 | TVector<float> points(TotalDimension * Size); |
| 132 | ::Load(stream, points); |
| 133 | Cloud = MakeHolder<TKNNCloud>( |
| 134 | std::move(indexArray), |
| 135 | std::move(points), |
| 136 | Size, |
| 137 | TotalDimension |
| 138 | ); |
| 139 | } |
| 140 | |
| 141 | TEmbeddingFeatureCalcerFactory::TRegistrator<TKNNCalcer> KNNRegistrator(EFeatureCalcerType::KNN); |
| 142 | |