Release 0.0.2
[ric-app/ad.git] / README.txt
index 6099b02..5831b2a 100644 (file)
 # ==================================================================================
 
 Usage of all the programs and files have been mentioned below for the reference.
+For AD xapp we require ueMeasReport(UE related dataset)
+
+AD xApp expect UE data from influxDB database in following structure:
+       * There exists database with name "UEData"
+       * Inside "UEData" database we have three measurments namely "liveUE", "train", "valid"
+       
+Note: *We need to specify influxdb service ruuning in RIC platform in database.py(host = <service name>.<namespace>)
+         *InfluxDB will be populated when xApp starts via insert.py. This will be depreciated in next release when there will be data coming from KPIMON
+       
 Need to update this file each time when there is any modifications in the following components. 
 
 main.py: 
-* Initiates xapp api and runs the entry() using xapp.run()
-* If hdbscan is not present in the current path, run train() to train the model for the prediction.
-* Call predict function to perform the following activities for every 1 second. 
-   a) Read the input csv file( 1000 UEID samples)
-   b) Predict the anomaly records for the randomly selected UEID
-   c) send the UEID and timestamp for the anomalous entries to the Traffic Steering (rmr with the message type as 30003)
-   d) Get the acknowledgement message from the traffic steering.
+* Initiates xapp api, populated influxDB with data and runs the entry() using xapp.run()
+* If Model is not present in the current path, run train() to train the model for the prediction.
+* Call predict function to perform the following activities for every 10 milisecond. 
+   a) Currently read the input from "liveUE" measurments and iterate through it. (Needs to update: To iterate every 10 miliseconds and fetch latest sample from influxDB) 
+   b) Detect anomalous records for the inputs
+   c) send the UEID, DU-ID, Degradation type and timestamp for the anomalous records to the Traffic Steering (via rmr with the message type as 30003)
+   d) Get the acknowledgement message from the traffic steering 
 
-Note: Need to handle the logic if we do not get the acknowledgment from the TS.
-      How xapp api handle this logic
+Note: Need to implement the logic if we do not get the acknowledgment from the TS. (How xapp api handle this?)
 
-ad_train.py - train hdbscan model using the input csv files and save the model. 
-
-dbscan: Model has been trained using the train dataset(train sampling for prediction)
-
-ue_test.csv: Input csv file has 1000 samples and for each UEID has one or more than one entries for poor signal.
+ad_train.py - Fetch "train" and "valid"(labelled dataset) measurments from influxDB for build and testing Isolation Forest model. Save final model. 
+                         
+       Model: Model has been trained using history data feteched from influxdb for all UE's 
+       validation: we need to have smaller sample dataset(labelled) for validation in influxDB for model validation.
 
 processing.py:
 It performs the following activities:
 * Columns that are not useful for the prediction will be dropped(UEID, Category, & Timestamp)
-* Convert integer and float type into numeric data type.
-* verify and drop the highly correlated parameters.
-* returns UEID, timestamp and category for the anamolous entries.
+* Filetered numeric data type(as per problem need)
+* verify and drop the highly correlated parameters
+* Use Transformation for makine all parameters in same scale and saved transformer info.
+* returns remaining parameters required for training and testing
 
 
 ad_model.py: 
-* Extract all the unique UEID and filters only the randomly selected UEID(this step will be removed when we implement in sdl way of getting the UEID).
-* Call Predict method to get the final data for the randomly selected UEID.
+* Call Predict method to get the anomalous users and send information related to anomalous user to Traffic steering xapp
 
+database.py
+* This module creates connection to influxDB and have methods to read and write data into influxDB
 
-tb_format.py:
-* start the preprocessing, processing steps using the keycolumns
-* populate current timestamp value for MeasTimestampRF