# Day 1+2 VISITED PAROJECT - RIC APP -> Anomaly detection xApp(ric-app/ad) #### Learned the following - Learned about influxdb database(BECAUSE THIS XAPP EXPECTS UE DATA FROM INFLUXDB DATABASE ) - HOW TO INTEGRATE INFLUXDB WITH XAPP PLATEFORM - Learned about joblib library - Learning ricxappframe pypi package - Why we remove heightly correlated data - Learned isolation foreset model for anomaly detection CODE FILE - preprocess.py PREPROCESS class is used for precessing raw data.It has method which helps to make convert data in required formet. It has following method and their task - variation: to drop the constant parameters - numerical_data: to Filter only numeric data types - drop_na: to drop observations having nan value - correlation: check and drop high correlation parameters - transform: check skewness of all parameters and use log transform if half of parameters are enough skewd otherwise use standardization - process:Calls the modules for the data preprocessing like dropping columns, normalization etc. - ad_model.py It has two classes: - modelling: It Filter dataframe based on paramters that were used to train model use transormer to transform the data load model and predict the label(normal/anomalous) - CAUSE:IT is a Rule basd method to find degradation type of anomalous sample - database.py It has a DATABASE class it takes an input as database name. It creates a client connection to influxDB and It reads/ writes UE data for a given dabtabase and a measurement. - ad_train.py - - It has a modelling class and takes input as dataframe or array and train Isolation Forest model - insert.py - This Module is temporary for pushing data into influxdb when AD xApp starts. It will depreciated in future, when data will be coming through KPIMON - main.py methods and their task: - entry:If ML model is not present in the path, It will trigger training module to train the model. Calls predict function every 10 millisecond(for now as we are using simulated data). - predict:Read the latest ue sample from influxDB and detects if that is anomalous or normal.. Send the UEID, DUID, Degradation type and timestamp for the anomalous samples to Traffic Steering (rmr with the message type as 30003) Get the acknowledgement of sent message from the traffic steering. - predict_anomaly:calls ad_predict to detect if given sample is normal or anomalous find out the degradation type if sample is anomalous write given sample along with predicted label to AD measurement - msg_to_ts: send messege from ad to ts - connectdb: Create a connection to InfluxDB if thread=True, otherwise it will create a dummy data instance - start:Initiates xapp api and runs the entry() using xapp.run()