@@ -24,6 +24,7 @@ const std::string ITERATION_TAG{"iteration"};
2424const std::string JOB_ID_TAG{" job_id" };
2525const std::string MEMORY_TYPE_TAG{" analytics_memory_usage" };
2626const std::string OUTLIER_DETECTION_STATS{" outlier_detection_stats" };
27+ const std::string PARAMETERS_TAG{" parameters" };
2728const std::string PEAK_MEMORY_USAGE_TAG{" peak_usage_bytes" };
2829const std::string PROGRESS_TAG{" progress" };
2930const std::string REGRESSION_STATS_TAG{" regression_stats" };
@@ -59,7 +60,7 @@ const std::string REGULARIZATION_TREE_SIZE_PENALTY_MULTIPLIER_TAG{"regularizatio
5960
6061// Outlier detection parameters
6162const std::string N_NEIGHBORS{" n_neighbors" };
62- const std::string METHODS{ " methods " };
63+ const std::string METHOD{ " method " };
6364const std::string COMPUTE_FEATURE_INFLUENCE{" compute_feature_influence" };
6465const std::string FEATURE_INFLUENCE_THRESHOLD{" feature_influence_threshold" };
6566const std::string OUTLIER_FRACTION{" outlier_fraction" };
@@ -114,7 +115,7 @@ void CDataFrameAnalysisInstrumentation::resetProgress() {
114115}
115116
116117void CDataFrameAnalysisInstrumentation::nextStep (const std::string& /* phase */ ) {
117- // TODO reactivate once Java part is ready
118+ // reactivate once java side is ready
118119 // this->writeState();
119120}
120121
@@ -171,10 +172,69 @@ void CDataFrameOutliersInstrumentation::writeAnalysisStats(std::int64_t timestam
171172 writer->String (this ->jobId ());
172173 writer->Key (TIMESTAMP_TAG);
173174 writer->Int64 (timestamp);
175+
176+ rapidjson::Value parametersObject{writer->makeObject ()};
177+ this ->writeParameters (parametersObject);
178+ writer->Key (PARAMETERS_TAG);
179+ writer->write (parametersObject);
180+
181+ rapidjson::Value timingStatsObject{writer->makeObject ()};
182+ this ->writeTimingStats (timingStatsObject);
183+ writer->Key (TIMING_STATS_TAG);
184+ writer->write (timingStatsObject);
185+
174186 writer->EndObject ();
175187 }
176188}
177189
190+ void CDataFrameOutliersInstrumentation::parameters (const maths::COutliers::SComputeParameters& parameters) {
191+ m_Parameters = parameters;
192+ }
193+
194+ void CDataFrameOutliersInstrumentation::elapsedTime (std::uint64_t time) {
195+ m_ElapsedTime = time;
196+ }
197+
198+ void CDataFrameOutliersInstrumentation::featureInfluenceThreshold (double featureInfluenceThreshold) {
199+ m_FeatureInfluenceThreshold = featureInfluenceThreshold;
200+ }
201+
202+ void CDataFrameOutliersInstrumentation::writeTimingStats (rapidjson::Value& parentObject) {
203+ auto * writer = this ->writer ();
204+ if (writer != nullptr ) {
205+ writer->addMember (TIMING_ELAPSED_TIME_TAG,
206+ rapidjson::Value (m_ElapsedTime).Move (), parentObject);
207+ }
208+ }
209+
210+ void CDataFrameOutliersInstrumentation::writeParameters (rapidjson::Value& parentObject) {
211+ auto * writer = this ->writer ();
212+
213+ if (writer != nullptr ) {
214+
215+ writer->addMember (
216+ N_NEIGHBORS,
217+ rapidjson::Value (static_cast <std::uint64_t >(this ->m_Parameters .s_NumberNeighbours ))
218+ .Move (),
219+ parentObject);
220+ writer->addMember (
221+ COMPUTE_FEATURE_INFLUENCE,
222+ rapidjson::Value (this ->m_Parameters .s_ComputeFeatureInfluence ).Move (),
223+ parentObject);
224+ writer->addMember (OUTLIER_FRACTION,
225+ rapidjson::Value (this ->m_Parameters .s_OutlierFraction ).Move (),
226+ parentObject);
227+ writer->addMember (FEATURE_INFLUENCE_THRESHOLD,
228+ rapidjson::Value (this ->m_FeatureInfluenceThreshold ).Move (),
229+ parentObject);
230+ writer->addMember (
231+ STANDARDIZATION_ENABLED,
232+ rapidjson::Value (this ->m_Parameters .s_StandardizeColumns ).Move (), parentObject);
233+ writer->addMember (METHOD, maths::COutliers::print (this ->m_Parameters .s_Method ),
234+ parentObject);
235+ }
236+ }
237+
178238void CDataFrameTrainBoostedTreeInstrumentation::type (EStatsType type) {
179239 m_Type = type;
180240}
0 commit comments