TO DO

  • Why does the code fail ?
  • Histogram how to handle the precision effect ? np.around(data, decimal=2)
  • Why in move base the base footprint dsnt ave zero entropy ? changed the range in histogram
  • Remove cases where both initial and final are same
    • approach both conditional entorpy are same
    • Compare in direct data and find a thershold of change in data
  • Create Database for skill to template or feature
  • Re do the relative distance movebase experiment -> Experiments not correct .
  • Evaluation : Total number of demonstration required for sucessfully determining the importatn features
  • Experiments :
    • Move to Base Absolute
    • Move to Base Relative
    • Move to Arm Absolute
    • Move to Arm Relative
    • Pick up Pre grasp
    • Place
    • Press
  • Determine if a feature has changed ? Filter out first all the features who have not changed
  • Template creation -> need to find alternatives
    • using just the robot feature and calculating all the environment feature
    • adding environment feature in the template

In [133]:
#%matplotlib inline
import glob
import json
import pandas.io as io
import pandas as pd
import numpy as np
import quaternion
import sklearn.preprocessing as pre
import pprint
import matplotlib.pyplot as plt
from collections import defaultdict

##Library based on statsmodel for information theory
import infotheo

class DataAnalyzer:
    def __init__(self, folderPath, skill):
        self.skill_being_learned = skill
        self.initial = io.json.read_json( folderPath + "/INITIAL.json", typ='frame')
        self.final = io.json.read_json( folderPath + "/FINAL.json", typ='frame')

        #Deleting state column as not reqired for calculations
        del self.initial['state']
        del self.final['state']
        
        print "Are the inital and final features equal : ", (self.initial.columns.values==self.final.columns.values).all()
        
        self.readExpertKnowledgeBase()
        number_of_demonstrations = self.initial['arm_joint_1'].count()
        print("Data has been succesfully read. Nu of Demonstrations : ", number_of_demonstrations)
        
        #Duplication rows if the Number of Demonstrations are less than 3
        if (number_of_demonstrations < 3):
            self.initial_copy = self.initial
            self.final_copy = self.final
            
            for i in range(number_of_demonstrations-3):
                self.initial = self.initial.append(self.initial)
                self.final = self.final.append(self.final)
        
            number_of_demonstrations = self.initial['arm_joint_1'].count()
            print("Data Duplication, No of Demonstrations : ", number_of_demonstrations)
            
        print self.initial['arm_joint_1'][0], self.final['arm_joint_1'][0]
        print self.initial['base_link_y'][0], self.final['base_link_y'][0]
        
    def mad_based_outlier(self, points, thresh=3.5):
        """
        http://stackoverflow.com/questions/22354094/pythonic-way-of-detecting-outliers-in-one-dimensional-observation-data
        Removes outliers based on MAD.
        Returns boolean map with false value in outliers
        """
        if len(points.shape) == 1:
            points = points[:,None]
        median = np.median(points, axis=0)
        diff = np.sum((points - median)**2, axis=-1)
        diff = np.sqrt(diff)
        med_abs_deviation = np.median(diff)

        modified_z_score = 0.6745 * diff / med_abs_deviation

        return modified_z_score > thresh
        
    def readExpertKnowledgeBase(self):
        '''
        The function reads the knowledge base to extract the mappings between the 
        skill to features.
        
        ---------------------------------------------------------------
        |skill \ Features || Feature1 | Feature2 | Feature3 | Feature4 |
        ---------------------------------------------------------------
        |skill1           ||    *     |          |          |          |
        |skill2           ||          |     *    |     *    |          |
        |skill3           ||          |          |          |     *    |
        |skill4           ||     *    |          |     *    |     *    |
        ---------------------------------------------------------------
        
        TODO :
        how to represent the knoweldge base
        how to intutively add the knowledge base
        
        '''
        #Database Path
        self.skills_db = './knowledge_base/skills.csv'
        self.robot_features_db = './knowledge_base/robot_features.csv'
        self.environment_features_db = './knowledge_base/environment_features.csv'
        self.templates_db = './knowledge_base/templates.csv'
        
        #Reading knowledge Base
        self.skills = []
        self.robot_features = []
        self.environment_features = []
        templates = []
        self.templates = defaultdict(list)
        with open(self.skills_db, 'rb') as f:
            for line in f:
                self.skills.append(line.rstrip('\n'))
        with open(self.robot_features_db, 'rb') as f:
            for line in f:
                self.robot_features.append(line.rstrip('\n'))
        with open(self.environment_features_db, 'rb') as f:
            for line in f:
                self.environment_features.append(line.rstrip('\n'))
        with open(self.templates_db, 'rb') as f:
            for i, line in enumerate(f):
                templates.append(line.rstrip('\n').split())
                for temp in line.rstrip('\n').split():
                    self.templates[i].append(temp)
                    
        self.features_without_positions = {'arm_joint_1','arm_joint_2','arm_joint_3','arm_joint_4','arm_joint_5'}        
        self.manipulate_templates()
        
                
        print "Database reading Complete:"
        print "Skills : ",len(self.skills)," Robot Features : ",len(self.robot_features)
        print "Environment Features : ",len(self.environment_features)," Templates : ", len(self.templates)
        
            
    def manipulate_templates(self):
        '''
        The expert only specifies the feature name in the template
        Internal replresentation conatins splitting data in x y z and orientation
        This funciton splits the template feature name into internal representation
        
        This function also adds the distance feature of all the features with the environment features.
        
        '''
        for i, temp in self.templates.iteritems():
            for feature in temp[1:]:
                if feature not in self.features_without_positions:
                    self.templates[i].remove(feature)
                    self.templates[i].extend([feature + "_x", feature + "_y", feature + "_z",
                                              feature + "_ox",feature + "_oy",feature + "_oz", feature + "_ow"])
                    for env_feature in self.environment_features:
                        self.templates[i].append("d_linear_"+feature+"_"+env_feature)
                        
                        
    def recommend_using_knowledge_base(self):
        """
        After Calculation of the entropy.
        The Templates for each action are used to determine the feature 
        with lowest entropy
        """

        print "skill being learnt : ", self.skill_being_learned
        for key, temp in self.templates.iteritems():
            entropy_sum_template = 0
            if self.skill_being_learned == temp[0]:
                for feature in temp[1:]:
                    try:
                        entropy_sum_template += self.condEntropyFinalGivenInitial[feature]
                    except :
                        print "feature not available : ", feature
                        continue
                        
            print "FOR template : ", key, " Summed Entropy : ",entropy_sum_template
                    
    def dataManipulation(self):
        '''
        TODO : Remove this once the camera based object detector is ready
        '''
        #Assigning griper palm co - ordinates as the object point
        self.final = self.final.assign(object_1_x = self.final.gripper_palm_link_x, 
                     object_1_y = self.final.gripper_palm_link_y,
                     object_1_z = self.final.gripper_palm_link_z,
                     object_1_ox = self.final.gripper_palm_link_ox,
                     object_1_oy = self.final.gripper_palm_link_oy,
                     object_1_oz = self.final.gripper_palm_link_oz,
                     object_1_ow = self.final.gripper_palm_link_ow)

        self.initial = self.initial.assign(object_1_x = self.final.gripper_palm_link_x, 
                             object_1_y = self.final.gripper_palm_link_y,
                             object_1_z = self.final.gripper_palm_link_z,
                             object_1_ox = self.final.gripper_palm_link_oy, #mixing the pose to get different pose between initial and final
                             object_1_oy = self.final.gripper_palm_link_ox,
                             object_1_oz = self.final.gripper_palm_link_ow,
                             object_1_ow = self.final.gripper_palm_link_oz)

                
        
        
    def dataCalculatingRelativeDistances(self, from_frame, to_frame):
        '''
        This function calculates all the relative distance between all the frames .
        Both linear distance and angular distance.
        '''
        linear_distance = "d_linear_"+from_frame+"_"+to_frame
        angular_distance = "d_angular_"+from_frame+"_"+to_frame
        from_x = from_frame+"_x"
        from_y = from_frame+"_y"
        from_z = from_frame+"_z"
        to_x = to_frame+"_x"
        to_y = to_frame+"_y"
        to_z = to_frame+"_z"
        from_ox = from_frame+"_ox"
        from_oy = from_frame+"_oy"
        from_oz = from_frame+"_oz"
        from_ow = from_frame+"_ow"
        to_ox = to_frame+"_ox"
        to_oy = to_frame+"_oy"
        to_oz = to_frame+"_oz"
        to_ow = to_frame+"_ow"
        
        '''
        self.final = self.final.assign(d_linear_m0_gripper = lambda x: np.sqrt((x.gripper_palm_link_x - x.object_1_x)**2 +
                                                              (x.gripper_palm_link_y - x.object_1_y)**2 +
                                                              (x.gripper_palm_link_z - x.object_1_z)**2 ))
        
        self.initial = self.initial.assign(d_linear_m0_gripper = lambda x: np.sqrt((x.gripper_palm_link_x - x.object_1_x)**2 +
                                                                      (x.gripper_palm_link_y - x.object_1_y)**2 +
                                                                      (x.gripper_palm_link_z - x.object_1_z)**2 ))
        '''
        try :
            # Calculating Distance between gripper and object and assigning 
            final_distance_col = np.sqrt((self.final[from_x] - self.final[to_x])**2 +
                                         (self.final[from_y] - self.final[to_y])**2 +
                                         (self.final[from_z] - self.final[to_z])**2 )
            init_distance_col = np.sqrt((self.initial[from_x] - self.initial[to_x])**2 +
                                        (self.initial[from_y] - self.initial[to_y])**2 +
                                        (self.initial[from_z] - self.initial[to_z])**2 )

            self.final[linear_distance] = final_distance_col
            self.initial[linear_distance] = init_distance_col
            #self.final = self.final.assign(linear_distance = final_distance_col)
            #self.initial = self.initial.assign(linear_distance = init_distance_col)

            # Calculating angular distances between the frames 
            diffAngle = []

            for index, row in self.final.iterrows():
                q0 = np.quaternion(row[to_ox], row[to_oy], row[to_oz], row[to_ow])
                q1 = np.quaternion(row[from_ox], row[from_oy], row[from_oz], row[from_ow])
                _ = q0.inverse()*q1
                diffAngle.append(_.angle())

            self.final[angular_distance] = diffAngle

            diffAngle = []
            for index, row in self.initial.iterrows():
                q0 = np.quaternion(row[to_ox], row[to_oy], row[to_oz], row[to_ow])
                q1 = np.quaternion(row[from_ox], row[from_oy], row[from_oz], row[from_ow])
                _ = q0.inverse()*q1
                diffAngle.append(_.angle())

            self.initial[angular_distance] = diffAngle

        except :
            print "Feature not present in Readings : ", from_frame," ",to_frame
        
    def createRelativeDistanceData(self):
        '''
        Calculates the relative distance between the features which are relevant
        This is a general function to keep adding the features between which the 
        data has to be calculated.
        The the distance between Robot features and environment features.
        Features :
        Robot Features :
        "arm_link_0", "arm_link_1", "arm_link_2", "arm_link_3", "arm_link_4",
        "arm_link_5", "gripper_palm_link", "gripper_finger_link_l","gripper_finger_link_r",
        "base_footprint", "base_link", "wheel_link_bl", "wheel_link_br", "wheel_link_fl", "wheel_link_fr" 
        
        Environment Features :
        "table_1","table_2","table_3","table_4","table_5","table_6","table_7","object_1"
        '''
        
        #TODO the base frame for TF transformation was taken as arm_link_1 so its missing in the 
        #data collection. So need to update .
        robot_features = ["arm_link_0", "arm_link_2", "arm_link_3", "arm_link_4",
        "arm_link_5", "gripper_palm_link", "gripper_finger_link_l","gripper_finger_link_r",
        "base_footprint", "base_link", "wheel_link_bl", "wheel_link_br", "wheel_link_fl", "wheel_link_fr" ]
        
        env_features = ["table_1","table_2","table_3","table_4","table_5","table_6","table_7"]
        print "env : ",self.environment_features

        for robot_feature in self.robot_features:
            if robot_feature not in self.features_without_positions:
                for env_feature in self.environment_features:
                    self.dataCalculatingRelativeDistances(robot_feature, env_feature)
                
        print("Relative Distances are calculated . Data is ready for analysis")
        print "Total number of features : ",len(self.initial.columns.values)

        
        
    def discribeData(self):
        #print "INTIAL DATA :", self.initial.describe()
        #print "FINAL DATA :", self.final.describe()
        self.initial.boxplot()
        self.final.boxplot()
        
    def discribeParameter(self, name):
        print "Parameter :", name 
        print "INITIAL :", self.initial[name]
        print "FINAL :", self.final[name]
        #plt.savefig("/data/dataDeebul/rnd/RecommenderSystemInRobotics/experiments/" + name + "Box")

        pdf, H, xedges, yedges = self.jointProbabilityDensityFunction(name)
        px = pdf.sum(0)
        py = pdf.sum(1)
        print "pdf Initial Values, pdf Final Values  :", px, py
        print "check sumpx, sum py, sumpxpy : ", sum(px), sum(py), sum(px)+sum(py)
        print "H_FinalGivenInitial : ",  np.float16(infotheo.condentropy(py, px, pdf)), "H_InitialGivenFinal :", np.float16(infotheo.condentropy(px, py, pdf))
        
        initialValue = np.asarray( self.initial[name] )
        finalValue = np.asarray( self.final[name])
        
        
        labels = list('IF')
        plt.boxplot(np.vstack((initialValue,finalValue)).T, labels=labels)
        plt.show()
        #min_max_scaler = preprocessing.MinMaxScaler()
        #initialValue = min_max_scaler.fit_transform(initialValue)
        #finalValue = min_max_scaler.fit_transform(finalValue)
        
        initialValue = np.around(initialValue, decimals=4)
        finalValue = np.around(finalValue, decimals=4)
        
        #Return a boolean map of data, with false at place of all outliers
        #So replacing all the outliers with the std mean 
        initialValue[self.mad_based_outlier(initialValue)] = np.median(initialValue, axis=0)
        finalValue[self.mad_based_outlier(finalValue)] = np.median(finalValue, axis=0)
  
  
        myextent  =[xedges[0],xedges[-1],yedges[0],yedges[-1]]
        plt.imshow(H.T,origin='low',extent=myextent,interpolation='nearest',aspect='auto')
        plt.plot(finalValue, initialValue,'ro')
        plt.colorbar()
        plt.ylabel("Initial Values")
        plt.xlabel("Final Values")
        plt.title("Parameter : "+name )
        #plt.savefig("/data/dataDeebul/rnd/RecommenderSystemInRobotics/experiments/" + name + "JoinPDF")
        plt.show()

        xx = np.floor(100 * initialValue )
        yy = np.floor(100 * finalValue )
        
        
        
    def jointProbabilityDensityFunction(self, feature, bins=5):
        """
        Creates the Joint probability distribution based on the initial
        and final values of the feature.

        """
        initialValue = np.asarray( self.initial[feature] )
        finalValue = np.asarray( self.final[feature])
        
        if (np.allclose(initialValue, finalValue)):
            print "feature same final intial : ", feature
        
        #min_max_scaler = preprocessing.MinMaxScaler()
        #initialValue = min_max_scaler.fit_transform(initialValue)
        #finalValue = min_max_scaler.fit_transform(finalValue)
        
        initialValue = np.around(initialValue, decimals=3)
        finalValue = np.around(finalValue, decimals=3)
        
        #Return a boolean map of data, with false at place of all outliers
        #So replacing all the outliers with the std mean 
        initialValue[self.mad_based_outlier(initialValue)] = np.median(initialValue, axis=0)
        finalValue[self.mad_based_outlier(finalValue)] = np.median(finalValue, axis=0)
        pre.normalize((initialValue,finalValue),copy=False)

        #scalling both the axes on the same scale 
        #since intital and final values are measured of a single feature
        #The histogram should be on same scale 
        #from larget value of both to smallest value of both
        value_max = max(initialValue.max(), finalValue.max())
        value_min = min(initialValue.min(), finalValue.min())
        range_value = [[value_min, value_max],[value_min, value_max]]
        H, xedges, yedges = np.histogram2d(finalValue, initialValue, bins=bins, range=range_value)
        return H/float(len(initialValue)), H, xedges, yedges 

    def condEntropyFinalGivenInitial(self):
        """
        Calculates the conditional entropy of the features. It calculates the 
        final entropy given initial 
        """
        
        self.condEntropyFinalGivenInitial = {}
        for featureName in self.initial.columns.values:
            pdf, _, __, ___ = self.jointProbabilityDensityFunction(featureName, 5)
            #pdf of initial values
            pInitial = pdf.sum(0)
            #pdf of final values
            pFinal = pdf.sum(1)
            
            #Entropy of Final given Initial
            self.condEntropyFinalGivenInitial[featureName] = np.float16(infotheo.condentropy( pFinal, pInitial, pdf))
            #self.condEntropyInitialGivenFinal[featureName] = np.float16(infotheo.condentropy( pInitial, pFinal, pdf))
            #print "Entropy : ",featureName," : ",self.condEntropyFinalGivenInitial[featureName]," : ", np.float16(infotheo.condentropy( pInitial, pFinal, pdf))
            
        print sum( x == 0.0 for x in self.condEntropyFinalGivenInitial.values() )
        return(self.condEntropyFinalGivenInitial)

    def condEntropyInitialGivenFinal(self):
        """
        Calculates the conditional entropy of the features. It calculates the 
        final entropy given initial 
        """
        
        if (self.initial.columns.values==self.final.columns.values).all() == False :
            print ("Columns are not same. Error in data collection")
        
        self.condEntropyInitialGivenFinal = {}
        for featureName in self.initial.columns.values:
            pdf, _, __, ___ = self.jointProbabilityDensityFunction(featureName, 5)
            #pdf of initial values
            pInitial = pdf.sum(0)
            #pdf of final values
            pFinal = pdf.sum(1)
            
            #Entropy of Final given Initial
            self.condEntropyInitialGivenFinal[featureName] = np.float16(infotheo.condentropy( pInitial, pFinal, pdf))
            

        return(self.condEntropyInitialGivenFinal)

In [134]:
move_arm = DataAnalyzer("./movetoArmSingleDemo", "move_to")
move_arm.createRelativeDistanceData()
h_F_I = move_arm.condEntropyFinalGivenInitial()

move_arm.recommend_using_knowledge_base()
'''
h_I_F = move_arm.condEntropyInitialGivenFinal()
zeroEntropy = []
for key1, key2 in zip(h_F_I.keys(), h_I_F.keys()):
    
    if h_F_I[key1] == 0.0 and h_I_F[key2] != 0.0:
        zeroEntropy.append(key1)
        
pprint.pprint(sorted(zeroEntropy))
'''


Are the inital and final features equal :  True
Database reading Complete:
Skills :  13  Robot Features :  20
Environment Features :  11  Templates :  4
('Data has been succesfully read. Nu of Demonstrations : ', 1)
('Data Duplication, No of Demonstrations : ', 1)
2.54486122593 2.424795999
0.251524564165 0.157192282386
env :  ['table_1', 'table_2', 'table_3', 'table_4', 'table_5', 'table_6', 'table_7', 'object_1', 'object_2', 'object_3', 'object_4']
Feature not present in Readings :  arm_link_0   object_4
Feature not present in Readings :  arm_link_1   object_4
Feature not present in Readings :  arm_link_2   object_4
Feature not present in Readings :  arm_link_3   object_4
Feature not present in Readings :  arm_link_4   object_4
Feature not present in Readings :  arm_link_5   object_4
Feature not present in Readings :  gripper_palm_link   object_4
Feature not present in Readings :  gripper_finger_link_l   object_4
Feature not present in Readings :  gripper_finger_link_r   object_4
Feature not present in Readings :  base_footprint   object_4
Feature not present in Readings :  base_link   object_4
Feature not present in Readings :  wheel_link_bl   object_4
Feature not present in Readings :  wheel_link_br   object_4
Feature not present in Readings :  wheel_link_fl   object_4
Feature not present in Readings :  wheel_link_fr   object_4
Relative Distances are calculated . Data is ready for analysis
Total number of features :  480
feature same final intial :  arm_link_0_ow
feature same final intial :  arm_link_0_ox
feature same final intial :  arm_link_0_oy
feature same final intial :  arm_link_0_z
feature same final intial :  arm_link_1_ox
feature same final intial :  arm_link_1_oy
feature same final intial :  arm_link_1_z
feature same final intial :  d_angular_wheel_link_br_table_1
feature same final intial :  d_angular_wheel_link_br_table_2
feature same final intial :  d_angular_wheel_link_br_table_3
feature same final intial :  d_angular_wheel_link_br_table_4
feature same final intial :  d_angular_wheel_link_br_table_5
feature same final intial :  d_angular_wheel_link_br_table_6
feature same final intial :  d_angular_wheel_link_br_table_7
feature same final intial :  d_angular_wheel_link_fl_table_6
feature same final intial :  d_angular_wheel_link_fl_table_7
feature same final intial :  d_angular_wheel_link_fr_table_1
feature same final intial :  d_angular_wheel_link_fr_table_2
feature same final intial :  d_angular_wheel_link_fr_table_3
feature same final intial :  d_angular_wheel_link_fr_table_4
feature same final intial :  d_angular_wheel_link_fr_table_5
feature same final intial :  d_angular_wheel_link_fr_table_6
feature same final intial :  d_angular_wheel_link_fr_table_7
480
skill being learnt :  move_to
feature not available :  d_linear_gripper_palm_link_object_4
feature not available :  d_linear_base_link_object_4
feature not available :  d_linear_base_footprint_object_4
FOR template :  0  Summed Entropy :  0.0
FOR template :  1  Summed Entropy :  0.0
feature not available :  d_linear_base_link_object_4
feature not available :  d_linear_base_footprint_object_4
FOR template :  2  Summed Entropy :  0.0
feature not available :  d_linear_gripper_palm_link_object_4
FOR template :  3  Summed Entropy :  0.0
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
Out[134]:
'\nh_I_F = move_arm.condEntropyInitialGivenFinal()\nzeroEntropy = []\nfor key1, key2 in zip(h_F_I.keys(), h_I_F.keys()):\n    \n    if h_F_I[key1] == 0.0 and h_I_F[key2] != 0.0:\n        zeroEntropy.append(key1)\n        \npprint.pprint(sorted(zeroEntropy))\n'

In [135]:
move_base_relative = DataAnalyzer("./movetoBaseRelativePosition", "move_to")

move_base_relative.createRelativeDistanceData()
h_F_I = move_base_relative.condEntropyFinalGivenInitial()

move_base_relative.recommend_using_knowledge_base()

'''
move_base_relative.discribeParameter('d_linear_base_footprint_object_1')

h_F_I = move_base_relative.condEntropyFinalGivenInitial()
h_I_F = move_base_relative.condEntropyInitialGivenFinal()
zeroEntropy = []
for key1, key2 in zip(h_F_I.keys(), h_I_F.keys()):
    
    if h_F_I[key1] == 0.0 and h_I_F[key2] != 0.0:
        zeroEntropy.append(key1)
        
pprint.pprint(sorted(zeroEntropy))
'''


Are the inital and final features equal :  True
Database reading Complete:
Skills :  13  Robot Features :  20
Environment Features :  11  Templates :  4
('Data has been succesfully read. Nu of Demonstrations : ', 12)
0.00884526338301 2.29815502717e-06
0.203341135413 0.26976739659
env :  ['table_1', 'table_2', 'table_3', 'table_4', 'table_5', 'table_6', 'table_7', 'object_1', 'object_2', 'object_3', 'object_4']
Feature not present in Readings :  arm_link_0   object_2
Feature not present in Readings :  arm_link_0   object_3
Feature not present in Readings :  arm_link_0   object_4
Feature not present in Readings :  arm_link_1   table_1
Feature not present in Readings :  arm_link_1   table_2
Feature not present in Readings :  arm_link_1   table_3
Feature not present in Readings :  arm_link_1   table_4
Feature not present in Readings :  arm_link_1   table_5
Feature not present in Readings :  arm_link_1   table_6
Feature not present in Readings :  arm_link_1   table_7
Feature not present in Readings :  arm_link_1   object_1
Feature not present in Readings :  arm_link_1   object_2
Feature not present in Readings :  arm_link_1   object_3
Feature not present in Readings :  arm_link_1   object_4
Feature not present in Readings :  arm_link_2   object_2
Feature not present in Readings :  arm_link_2   object_3
Feature not present in Readings :  arm_link_2   object_4
Feature not present in Readings :  arm_link_3   object_2
Feature not present in Readings :  arm_link_3   object_3
Feature not present in Readings :  arm_link_3   object_4
Feature not present in Readings :  arm_link_4   object_2
Feature not present in Readings :  arm_link_4   object_3
Feature not present in Readings :  arm_link_4   object_4
Feature not present in Readings :  arm_link_5   object_2
Feature not present in Readings :  arm_link_5   object_3
Feature not present in Readings :  arm_link_5   object_4
Feature not present in Readings :  gripper_palm_link   object_2
Feature not present in Readings :  gripper_palm_link   object_3
Feature not present in Readings :  gripper_palm_link   object_4
Feature not present in Readings :  gripper_finger_link_l   object_2
Feature not present in Readings :  gripper_finger_link_l   object_3
Feature not present in Readings :  gripper_finger_link_l   object_4
Feature not present in Readings :  gripper_finger_link_r   object_2
Feature not present in Readings :  gripper_finger_link_r   object_3
Feature not present in Readings :  gripper_finger_link_r   object_4
Feature not present in Readings :  base_footprint   object_2
Feature not present in Readings :  base_footprint   object_3
Feature not present in Readings :  base_footprint   object_4
Feature not present in Readings :  base_link   object_2
Feature not present in Readings :  base_link   object_3
Feature not present in Readings :  base_link   object_4
Feature not present in Readings :  wheel_link_bl   object_2
Feature not present in Readings :  wheel_link_bl   object_3
Feature not present in Readings :  wheel_link_bl   object_4
Feature not present in Readings :  wheel_link_br   object_2
Feature not present in Readings :  wheel_link_br   object_3
Feature not present in Readings :  wheel_link_br   object_4
Feature not present in Readings :  wheel_link_fl   object_2
Feature not present in Readings :  wheel_link_fl   object_3
Feature not present in Readings :  wheel_link_fl   object_4
Feature not present in Readings :  wheel_link_fr   object_2
Feature not present in Readings :  wheel_link_fr   object_3
Feature not present in Readings :  wheel_link_fr   object_4
Relative Distances are calculated . Data is ready for analysis
Total number of features :  383
feature same final intial :  arm_link_0_ow
feature same final intial :  arm_link_0_ox
feature same final intial :  arm_link_0_oy
feature same final intial :  arm_link_0_oz
feature same final intial :  arm_link_0_x
feature same final intial :  arm_link_0_y
feature same final intial :  arm_link_0_z
feature same final intial :  arm_link_2_z
110
skill being learnt :  move_to
feature not available :  d_linear_gripper_palm_link_object_2
feature not available :  d_linear_gripper_palm_link_object_3
feature not available :  d_linear_gripper_palm_link_object_4
feature not available :  d_linear_base_link_object_2
feature not available :  d_linear_base_link_object_3
feature not available :  d_linear_base_link_object_4
feature not available :  d_linear_base_footprint_object_2
feature not available :  d_linear_base_footprint_object_3
feature not available :  d_linear_base_footprint_object_4
FOR template :  0  Summed Entropy :  25.498046875
FOR template :  1  Summed Entropy :  0.0
feature not available :  d_linear_base_link_object_2
feature not available :  d_linear_base_link_object_3
feature not available :  d_linear_base_link_object_4
feature not available :  d_linear_base_footprint_object_2
feature not available :  d_linear_base_footprint_object_3
feature not available :  d_linear_base_footprint_object_4
FOR template :  2  Summed Entropy :  17.4599609375
feature not available :  d_linear_gripper_palm_link_object_2
feature not available :  d_linear_gripper_palm_link_object_3
feature not available :  d_linear_gripper_palm_link_object_4
FOR template :  3  Summed Entropy :  8.0380859375
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
Out[135]:
"\nmove_base_relative.discribeParameter('d_linear_base_footprint_object_1')\n\nh_F_I = move_base_relative.condEntropyFinalGivenInitial()\nh_I_F = move_base_relative.condEntropyInitialGivenFinal()\nzeroEntropy = []\nfor key1, key2 in zip(h_F_I.keys(), h_I_F.keys()):\n    \n    if h_F_I[key1] == 0.0 and h_I_F[key2] != 0.0:\n        zeroEntropy.append(key1)\n        \npprint.pprint(sorted(zeroEntropy))\n"

In [68]:
movebase = DataAnalyzer("./movetoBaseAbsolutePositionWithEnv")

#movebase.dataManipulation()
movebase.createRelativeDistanceData()

#movebase.condEntropyFinalGivenInitial()
#movebase.discretizeData()
#movebase.discribeParameter('base_footprint_y')

h_F_I = movebase.condEntropyFinalGivenInitial()
h_I_F = movebase.condEntropyInitialGivenFinal()
zeroEntropy = []
for key1, key2 in zip(h_F_I.keys(), h_I_F.keys()):
    
    if h_F_I[key1] == 0.0 and h_I_F[key2] != 0.0:
        zeroEntropy.append(key1)
        
pprint.pprint(sorted(zeroEntropy))


 Are the inital and final features equal :  True
Data has been succesfully read.
Relative Distances are calculated . Data is ready for analysis
Total number of features :  348
Entropy :  arm_joint_1  :  0.0  :  0.0
Entropy :  arm_joint_2  :  0.0  :  0.0
Entropy :  arm_joint_3  :  0.0  :  0.0
Entropy :  arm_joint_4  :  0.0  :  -inf
Entropy :  arm_joint_5  :  0.0  :  -inf
Entropy :  arm_link_0_ow  :  0.0  :  0.0
Entropy :  arm_link_0_ox  :  0.0  :  0.0
Entropy :  arm_link_0_oy  :  0.0  :  0.0
Entropy :  arm_link_0_oz  :  0.0  :  0.0
Entropy :  arm_link_0_x  :  0.0  :  0.0
Entropy :  arm_link_0_y  :  0.0  :  0.0
Entropy :  arm_link_0_z  :  0.0  :  0.0
Entropy :  arm_link_2_ow  :  0.0  :  0.0
Entropy :  arm_link_2_ox  :  0.0  :  0.0
Entropy :  arm_link_2_oy  :  0.0  :  0.0
Entropy :  arm_link_2_oz  :  0.0  :  0.0
Entropy :  arm_link_2_x  :  0.0  :  0.0
Entropy :  arm_link_2_y  :  0.0  :  0.0
Entropy :  arm_link_2_z  :  0.0  :  0.0
Entropy :  arm_link_3_ow  :  0.0  :  0.0
Entropy :  arm_link_3_ox  :  0.0  :  0.0
Entropy :  arm_link_3_oy  :  0.0  :  0.0
Entropy :  arm_link_3_oz  :  0.0  :  0.0
Entropy :  arm_link_3_x  :  0.0  :  0.0
Entropy :  arm_link_3_y  :  0.0  :  0.0
Entropy :  arm_link_3_z  :  0.0  :  0.0
Entropy :  arm_link_4_ow  :  0.0  :  0.0
Entropy :  arm_link_4_ox  :  0.0  :  0.0
Entropy :  arm_link_4_oy  :  0.0  :  0.0
Entropy :  arm_link_4_oz  :  0.0  :  -inf
Entropy :  arm_link_4_x  :  0.0  :  0.0
Entropy :  arm_link_4_y  :  0.0  :  0.0
Entropy :  arm_link_4_z  :  0.0  :  -inf
Entropy :  arm_link_5_ow  :  0.0  :  -inf
Entropy :  arm_link_5_ox  :  0.0  :  0.0
Entropy :  arm_link_5_oy  :  0.0  :  -inf
Entropy :  arm_link_5_oz  :  0.0  :  -inf
Entropy :  arm_link_5_x  :  0.0  :  -inf
Entropy :  arm_link_5_y  :  0.0  :  -inf
Entropy :  arm_link_5_z  :  0.0  :  -inf
Entropy :  base_footprint_ow  :  0.0  :  -inf
Entropy :  base_footprint_ox  :  0.0  :  -inf
Entropy :  base_footprint_oy  :  0.0  :  -inf
Entropy :  base_footprint_oz  :  0.0  :  -inf
Entropy :  base_footprint_x  :  0.0  :  -inf
Entropy :  base_footprint_y  :  0.0  :  -inf
Entropy :  base_footprint_z  :  0.0  :  -inf
Entropy :  base_link_ow  :  0.0  :  -inf
Entropy :  base_link_ox  :  0.0  :  -inf
Entropy :  base_link_oy  :  0.0  :  -inf
Entropy :  base_link_oz  :  0.0  :  -inf
Entropy :  base_link_x  :  0.0  :  -inf
Entropy :  base_link_y  :  0.0  :  -inf
Entropy :  base_link_z  :  0.0  :  -inf
Entropy :  gripper_finger_link_l_ow  :  0.0  :  -inf
Entropy :  gripper_finger_link_l_ox  :  0.0  :  -inf
Entropy :  gripper_finger_link_l_oy  :  0.0  :  -inf
Entropy :  gripper_finger_link_l_oz  :  0.0  :  -inf
Entropy :  gripper_finger_link_l_x  :  0.0  :  0.0
Entropy :  gripper_finger_link_l_y  :  0.0  :  -inf
Entropy :  gripper_finger_link_l_z  :  0.0  :  -inf
Entropy :  gripper_finger_link_r_ow  :  0.0  :  0.0
Entropy :  gripper_finger_link_r_ox  :  0.0  :  -inf
Entropy :  gripper_finger_link_r_oy  :  0.0  :  -inf
Entropy :  gripper_finger_link_r_oz  :  0.0  :  -inf
Entropy :  gripper_finger_link_r_x  :  0.0  :  -inf
Entropy :  gripper_finger_link_r_y  :  0.0  :  -inf
Entropy :  gripper_finger_link_r_z  :  0.0  :  -inf
Entropy :  gripper_palm_link_ow  :  0.0  :  -inf
Entropy :  gripper_palm_link_ox  :  0.0  :  -inf
Entropy :  gripper_palm_link_oy  :  0.0  :  -inf
Entropy :  gripper_palm_link_oz  :  0.0  :  -inf
Entropy :  gripper_palm_link_x  :  0.0  :  -inf
Entropy :  gripper_palm_link_y  :  0.0  :  -inf
Entropy :  gripper_palm_link_z  :  0.0  :  -inf
Entropy :  table_1_ow  :  0.0  :  -inf
Entropy :  table_1_ox  :  0.72705  :  -inf
Entropy :  table_1_oy  :  1.0459  :  -inf
Entropy :  table_1_oz  :  0.0  :  -inf
Entropy :  table_1_x  :  0.50977  :  -inf
Entropy :  table_1_y  :  0.0  :  -inf
Entropy :  table_1_z  :  0.86475  :  -inf
Entropy :  table_2_ow  :  0.0  :  -inf
Entropy :  table_2_ox  :  0.0  :  -inf
Entropy :  table_2_oy  :  1.1777  :  -inf
Entropy :  table_2_oz  :  0.0  :  -inf
Entropy :  table_2_x  :  0.0  :  -inf
Entropy :  table_2_y  :  0.0  :  -inf
Entropy :  table_2_z  :  0.0  :  -inf
Entropy :  table_3_ow  :  0.0  :  -inf
Entropy :  table_3_ox  :  0.97754  :  -inf
Entropy :  table_3_oy  :  0.69434  :  -inf
Entropy :  table_3_oz  :  0.0  :  -inf
Entropy :  table_3_x  :  0.65869  :  -inf
Entropy :  table_3_y  :  0.0  :  -inf
Entropy :  table_3_z  :  0.0  :  -inf
Entropy :  table_4_ow  :  0.76025  :  -inf
Entropy :  table_4_ox  :  0.69189  :  -inf
Entropy :  table_4_oy  :  0.65869  :  -inf
Entropy :  table_4_oz  :  0.0  :  -inf
Entropy :  table_4_x  :  0.0  :  -inf
Entropy :  table_4_y  :  0.0  :  -inf
Entropy :  table_4_z  :  0.0  :  -inf
Entropy :  table_5_ow  :  0.29492  :  -inf
Entropy :  table_5_ox  :  0.80518  :  -inf
Entropy :  table_5_oy  :  0.50098  :  -inf
Entropy :  table_5_oz  :  0.0  :  -inf
Entropy :  table_5_x  :  0.0  :  -inf
Entropy :  table_5_y  :  0.69189  :  -inf
Entropy :  table_5_z  :  1.3418  :  -inf
Entropy :  table_6_ow  :  0.0  :  -inf
Entropy :  table_6_ox  :  0.0  :  -inf
Entropy :  table_6_oy  :  0.97754  :  -inf
Entropy :  table_6_oz  :  0.0  :  -inf
Entropy :  table_6_x  :  0.0  :  -inf
Entropy :  table_6_y  :  0.0  :  -inf
Entropy :  table_6_z  :  1.1592  :  -inf
Entropy :  table_7_ow  :  0.29492  :  -inf
Entropy :  table_7_ox  :  0.0  :  -inf
Entropy :  table_7_oy  :  0.43237  :  -inf
Entropy :  table_7_oz  :  0.0  :  -inf
Entropy :  table_7_x  :  0.54541  :  -inf
Entropy :  table_7_y  :  0.0  :  -inf
Entropy :  table_7_z  :  1.1592  :  -inf
Entropy :  wheel_link_bl_ow  :  0.43237  :  -inf
Entropy :  wheel_link_bl_ox  :  0.0  :  -inf
Entropy :  wheel_link_bl_oy  :  0.44141  :  -inf
Entropy :  wheel_link_bl_oz  :  0.0  :  -inf
Entropy :  wheel_link_bl_x  :  0.0  :  -inf
Entropy :  wheel_link_bl_y  :  0.36353  :  -inf
Entropy :  wheel_link_bl_z  :  0.0  :  -inf
Entropy :  wheel_link_br_ow  :  0.25049  :  -inf
Entropy :  wheel_link_br_ox  :  0.0  :  -inf
Entropy :  wheel_link_br_oy  :  0.0  :  -inf
Entropy :  wheel_link_br_oz  :  0.0  :  -inf
Entropy :  wheel_link_br_x  :  0.0  :  -inf
Entropy :  wheel_link_br_y  :  0.36353  :  -inf
Entropy :  wheel_link_br_z  :  0.0  :  -inf
Entropy :  wheel_link_fl_ow  :  0.0  :  -inf
Entropy :  wheel_link_fl_ox  :  0.0  :  -inf
Entropy :  wheel_link_fl_oy  :  0.0  :  -inf
Entropy :  wheel_link_fl_oz  :  0.0  :  -inf
Entropy :  wheel_link_fl_x  :  0.47681  :  -inf
Entropy :  wheel_link_fl_y  :  0.25049  :  -inf
Entropy :  wheel_link_fl_z  :  0.0  :  -inf
Entropy :  wheel_link_fr_ow  :  0.0  :  -inf
Entropy :  wheel_link_fr_ox  :  0.72705  :  -inf
Entropy :  wheel_link_fr_oy  :  0.86475  :  -inf
Entropy :  wheel_link_fr_oz  :  0.0  :  -inf
Entropy :  wheel_link_fr_x  :  0.7959  :  -inf
Entropy :  wheel_link_fr_y  :  0.50098  :  -inf
Entropy :  wheel_link_fr_z  :  0.86475  :  -inf
Entropy :  d_linear_arm_link_0_table_1  :  0.7959  :  -inf
Entropy :  d_angular_arm_link_0_table_1  :  0.0  :  -inf
Entropy :  d_linear_arm_link_0_table_2  :  0.47681  :  -inf
Entropy :  d_angular_arm_link_0_table_2  :  0.0  :  -inf
Entropy :  d_linear_arm_link_0_table_3  :  0.54541  :  -inf
Entropy :  d_angular_arm_link_0_table_3  :  0.0  :  -inf
Entropy :  d_linear_arm_link_0_table_4  :  0.54541  :  -inf
Entropy :  d_angular_arm_link_0_table_4  :  0.32812  :  -inf
Entropy :  d_linear_arm_link_0_table_5  :  0.0  :  -inf
Entropy :  d_angular_arm_link_0_table_5  :  0.0  :  -inf
Entropy :  d_linear_arm_link_0_table_6  :  1.1729  :  -inf
Entropy :  d_angular_arm_link_0_table_6  :  0.0  :  -inf
Entropy :  d_linear_arm_link_0_table_7  :  0.44141  :  -inf
Entropy :  d_angular_arm_link_0_table_7  :  0.25049  :  -inf
Entropy :  d_linear_arm_link_2_table_1  :  0.93311  :  -inf
Entropy :  d_angular_arm_link_2_table_1  :  0.0  :  -inf
Entropy :  d_linear_arm_link_2_table_2  :  0.43237  :  -inf
Entropy :  d_angular_arm_link_2_table_2  :  0.0  :  -inf
Entropy :  d_linear_arm_link_2_table_3  :  0.54541  :  -inf
Entropy :  d_angular_arm_link_2_table_3  :  0.54541  :  -inf
Entropy :  d_linear_arm_link_2_table_4  :  0.54541  :  -inf
Entropy :  d_angular_arm_link_2_table_4  :  0.25049  :  -inf
Entropy :  d_linear_arm_link_2_table_5  :  0.32812  :  -inf
Entropy :  d_angular_arm_link_2_table_5  :  0.0  :  -inf
Entropy :  d_linear_arm_link_2_table_6  :  1.1592  :  -inf
Entropy :  d_angular_arm_link_2_table_6  :  0.50098  :  -inf
Entropy :  d_linear_arm_link_2_table_7  :  0.44141  :  -inf
Entropy :  d_angular_arm_link_2_table_7  :  0.0  :  -inf
Entropy :  d_linear_arm_link_3_table_1  :  0.93311  :  -inf
Entropy :  d_angular_arm_link_3_table_1  :  0.54541  :  -inf
Entropy :  d_linear_arm_link_3_table_2  :  0.43237  :  -inf
Entropy :  d_angular_arm_link_3_table_2  :  0.72705  :  -inf
Entropy :  d_linear_arm_link_3_table_3  :  0.50977  :  -inf
Entropy :  d_angular_arm_link_3_table_3  :  0.18176  :  -inf
Entropy :  d_linear_arm_link_3_table_4  :  0.54541  :  -inf
Entropy :  d_angular_arm_link_3_table_4  :  0.29492  :  -inf
Entropy :  d_linear_arm_link_3_table_5  :  0.57861  :  -inf
Entropy :  d_angular_arm_link_3_table_5  :  0.47681  :  -inf
Entropy :  d_linear_arm_link_3_table_6  :  1.0459  :  -inf
Entropy :  d_angular_arm_link_3_table_6  :  0.43237  :  -inf
Entropy :  d_linear_arm_link_3_table_7  :  0.44141  :  -inf
Entropy :  d_angular_arm_link_3_table_7  :  0.7959  :  -inf
Entropy :  d_linear_arm_link_4_table_1  :  0.93311  :  -inf
Entropy :  d_angular_arm_link_4_table_1  :  0.7959  :  -inf
Entropy :  d_linear_arm_link_4_table_2  :  0.43237  :  -inf
Entropy :  d_angular_arm_link_4_table_2  :  0.0  :  -inf
Entropy :  d_linear_arm_link_4_table_3  :  0.0  :  -inf
Entropy :  d_angular_arm_link_4_table_3  :  0.98682  :  -inf
Entropy :  d_linear_arm_link_4_table_4  :  0.62305  :  -inf
Entropy :  d_angular_arm_link_4_table_4  :  0.32812  :  -inf
Entropy :  d_linear_arm_link_4_table_5  :  0.57861  :  -inf
Entropy :  d_angular_arm_link_4_table_5  :  0.54932  :  -inf
Entropy :  d_linear_arm_link_4_table_6  :  1.0459  :  -inf
Entropy :  d_angular_arm_link_4_table_6  :  0.0  :  -inf
Entropy :  d_linear_arm_link_4_table_7  :  0.36353  :  -inf
Entropy :  d_angular_arm_link_4_table_7  :  0.0  :  -inf
Entropy :  d_linear_arm_link_5_table_1  :  0.61426  :  -inf
Entropy :  d_angular_arm_link_5_table_1  :  1.0557  :  -inf
Entropy :  d_linear_arm_link_5_table_2  :  0.54541  :  -inf
Entropy :  d_angular_arm_link_5_table_2  :  0.0  :  -inf
Entropy :  d_linear_arm_link_5_table_3  :  0.50977  :  -inf
Entropy :  d_angular_arm_link_5_table_3  :  0.97754  :  -inf
Entropy :  d_linear_arm_link_5_table_4  :  0.25049  :  -inf
Entropy :  d_angular_arm_link_5_table_4  :  0.0  :  -inf
Entropy :  d_linear_arm_link_5_table_5  :  0.69189  :  -inf
Entropy :  d_angular_arm_link_5_table_5  :  0.93311  :  -inf
Entropy :  d_linear_arm_link_5_table_6  :  0.62305  :  -inf
Entropy :  d_angular_arm_link_5_table_6  :  0.0  :  -inf
Entropy :  d_linear_arm_link_5_table_7  :  0.62305  :  -inf
Entropy :  d_angular_arm_link_5_table_7  :  0.43237  :  -inf
Entropy :  d_linear_gripper_palm_link_table_1  :  0.50977  :  -inf
Entropy :  d_angular_gripper_palm_link_table_1  :  0.47681  :  -inf
Entropy :  d_linear_gripper_palm_link_table_2  :  0.54541  :  -inf
Entropy :  d_angular_gripper_palm_link_table_2  :  0.54541  :  -inf
Entropy :  d_linear_gripper_palm_link_table_3  :  0.84033  :  -inf
Entropy :  d_angular_gripper_palm_link_table_3  :  0.65869  :  -inf
Entropy :  d_linear_gripper_palm_link_table_4  :  0.43237  :  -inf
Entropy :  d_angular_gripper_palm_link_table_4  :  0.0  :  -inf
Entropy :  d_linear_gripper_palm_link_table_5  :  0.73096  :  -inf
Entropy :  d_angular_gripper_palm_link_table_5  :  0.62305  :  -inf
Entropy :  d_linear_gripper_palm_link_table_6  :  0.87354  :  -inf
Entropy :  d_angular_gripper_palm_link_table_6  :  0.25049  :  -inf
Entropy :  d_linear_gripper_palm_link_table_7  :  1.1592  :  -inf
Entropy :  d_angular_gripper_palm_link_table_7  :  0.0  :  -inf
Entropy :  d_linear_gripper_finger_link_l_table_1  :  0.68262  :  -inf
Entropy :  d_angular_gripper_finger_link_l_table_1  :  0.43237  :  -inf
Entropy :  d_linear_gripper_finger_link_l_table_2  :  0.43237  :  -inf
Entropy :  d_angular_gripper_finger_link_l_table_2  :  0.78662  :  -inf
Entropy :  d_linear_gripper_finger_link_l_table_3  :  0.25049  :  -inf
Entropy :  d_angular_gripper_finger_link_l_table_3  :  0.25049  :  -inf
Entropy :  d_linear_gripper_finger_link_l_table_4  :  0.44141  :  -inf
Entropy :  d_angular_gripper_finger_link_l_table_4  :  0.36353  :  -inf
Entropy :  d_linear_gripper_finger_link_l_table_5  :  0.0  :  -inf
Entropy :  d_angular_gripper_finger_link_l_table_5  :  0.61426  :  -inf
Entropy :  d_linear_gripper_finger_link_l_table_6  :  1.1592  :  -inf
Entropy :  d_angular_gripper_finger_link_l_table_6  :  0.43237  :  -inf
Entropy :  d_linear_gripper_finger_link_l_table_7  :  0.69189  :  -inf
Entropy :  d_angular_gripper_finger_link_l_table_7  :  0.61426  :  -inf
Entropy :  d_linear_gripper_finger_link_r_table_1  :  0.61426  :  -inf
Entropy :  d_angular_gripper_finger_link_r_table_1  :  0.0  :  -inf
Entropy :  d_linear_gripper_finger_link_r_table_2  :  0.0  :  -inf
Entropy :  d_angular_gripper_finger_link_r_table_2  :  0.50098  :  -inf
Entropy :  d_linear_gripper_finger_link_r_table_3  :  0.54541  :  -inf
Entropy :  d_angular_gripper_finger_link_r_table_3  :  0.43237  :  -inf
Entropy :  d_linear_gripper_finger_link_r_table_4  :  0.53613  :  -inf
Entropy :  d_angular_gripper_finger_link_r_table_4  :  0.65869  :  -inf
Entropy :  d_linear_gripper_finger_link_r_table_5  :  0.0  :  -inf
Entropy :  d_angular_gripper_finger_link_r_table_5  :  0.69189  :  -inf
Entropy :  d_linear_gripper_finger_link_r_table_6  :  0.73633  :  -inf
Entropy :  d_angular_gripper_finger_link_r_table_6  :  0.47681  :  -inf
Entropy :  d_linear_gripper_finger_link_r_table_7  :  0.69189  :  -inf
Entropy :  d_angular_gripper_finger_link_r_table_7  :  0.32812  :  -inf
Entropy :  d_linear_base_footprint_table_1  :  0.86475  :  -inf
Entropy :  d_angular_base_footprint_table_1  :  0.65869  :  -inf
Entropy :  d_linear_base_footprint_table_2  :  0.43237  :  -inf
Entropy :  d_angular_base_footprint_table_2  :  0.93311  :  -inf
Entropy :  d_linear_base_footprint_table_3  :  0.72705  :  -inf
Entropy :  d_angular_base_footprint_table_3  :  0.0  :  -inf
Entropy :  d_linear_base_footprint_table_4  :  0.62305  :  -inf
Entropy :  d_angular_base_footprint_table_4  :  0.25049  :  -inf
Entropy :  d_linear_base_footprint_table_5  :  0.0  :  -inf
Entropy :  d_angular_base_footprint_table_5  :  0.86475  :  -inf
Entropy :  d_linear_base_footprint_table_6  :  1.0557  :  -inf
Entropy :  d_angular_base_footprint_table_6  :  1.1592  :  -inf
Entropy :  d_linear_base_footprint_table_7  :  0.65869  :  -inf
Entropy :  d_angular_base_footprint_table_7  :  0.65869  :  -inf
Entropy :  d_linear_base_link_table_1  :  0.68262  :  -inf
Entropy :  d_angular_base_link_table_1  :  0.7959  :  -inf
Entropy :  d_linear_base_link_table_2  :  0.36353  :  -inf
Entropy :  d_angular_base_link_table_2  :  0.93311  :  -inf
Entropy :  d_linear_base_link_table_3  :  0.36353  :  -inf
Entropy :  d_angular_base_link_table_3  :  0.57861  :  -inf
Entropy :  d_linear_base_link_table_4  :  0.54932  :  -inf
Entropy :  d_angular_base_link_table_4  :  0.25049  :  -inf
Entropy :  d_linear_base_link_table_5  :  0.0  :  -inf
Entropy :  d_angular_base_link_table_5  :  0.32812  :  -inf
Entropy :  d_linear_base_link_table_6  :  0.97754  :  -inf
Entropy :  d_angular_base_link_table_6  :  0.84033  :  -inf
Entropy :  d_linear_base_link_table_7  :  0.69189  :  -inf
Entropy :  d_angular_base_link_table_7  :  0.47681  :  -inf
Entropy :  d_linear_wheel_link_bl_table_1  :  0.50098  :  -inf
Entropy :  d_angular_wheel_link_bl_table_1  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_bl_table_2  :  0.62305  :  -inf
Entropy :  d_angular_wheel_link_bl_table_2  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_bl_table_3  :  0.54541  :  -inf
Entropy :  d_angular_wheel_link_bl_table_3  :  0.43237  :  -inf
Entropy :  d_linear_wheel_link_bl_table_4  :  0.0  :  -inf
Entropy :  d_angular_wheel_link_bl_table_4  :  0.25049  :  -inf
Entropy :  d_linear_wheel_link_bl_table_5  :  0.0  :  -inf
Entropy :  d_angular_wheel_link_bl_table_5  :  0.98682  :  -inf
Entropy :  d_linear_wheel_link_bl_table_6  :  0.0  :  -inf
Entropy :  d_angular_wheel_link_bl_table_6  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_bl_table_7  :  0.0  :  -inf
Entropy :  d_angular_wheel_link_bl_table_7  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_br_table_1  :  0.50977  :  -inf
Entropy :  d_angular_wheel_link_br_table_1  :  0.54541  :  -inf
Entropy :  d_linear_wheel_link_br_table_2  :  0.18176  :  -inf
Entropy :  d_angular_wheel_link_br_table_2  :  0.68262  :  -inf
Entropy :  d_linear_wheel_link_br_table_3  :  0.43237  :  -inf
Entropy :  d_angular_wheel_link_br_table_3  :  0.43237  :  -inf
Entropy :  d_linear_wheel_link_br_table_4  :  0.73633  :  -inf
Entropy :  d_angular_wheel_link_br_table_4  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_br_table_5  :  0.58984  :  -inf
Entropy :  d_angular_wheel_link_br_table_5  :  0.54541  :  -inf
Entropy :  d_linear_wheel_link_br_table_6  :  0.43237  :  -inf
Entropy :  d_angular_wheel_link_br_table_6  :  0.43237  :  -inf
Entropy :  d_linear_wheel_link_br_table_7  :  0.0  :  -inf
Entropy :  d_angular_wheel_link_br_table_7  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fl_table_1  :  0.54932  :  -inf
Entropy :  d_angular_wheel_link_fl_table_1  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fl_table_2  :  0.36353  :  -inf
Entropy :  d_angular_wheel_link_fl_table_2  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fl_table_3  :  0.54541  :  -inf
Entropy :  d_angular_wheel_link_fl_table_3  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fl_table_4  :  0.73096  :  -inf
Entropy :  d_angular_wheel_link_fl_table_4  :  0.25049  :  -inf
Entropy :  d_linear_wheel_link_fl_table_5  :  0.35449  :  -inf
Entropy : 
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
 d_angular_wheel_link_fl_table_5  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fl_table_6  :  0.0  :  -inf
Entropy :  d_angular_wheel_link_fl_table_6  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fl_table_7  :  0.25049  :  -inf
Entropy :  d_angular_wheel_link_fl_table_7  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fr_table_1  :  0.72705  :  -inf
Entropy :  d_angular_wheel_link_fr_table_1  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fr_table_2  :  0.18176  :  -inf
Entropy :  d_angular_wheel_link_fr_table_2  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fr_table_3  :  0.43237  :  -inf
Entropy :  d_angular_wheel_link_fr_table_3  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fr_table_4  :  0.47681  :  -inf
Entropy :  d_angular_wheel_link_fr_table_4  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fr_table_5  :  0.73096  :  -inf
Entropy :  d_angular_wheel_link_fr_table_5  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fr_table_6  :  0.0  :  -inf
Entropy :  d_angular_wheel_link_fr_table_6  :  0.0  :  -inf
Entropy :  d_linear_wheel_link_fr_table_7  :  0.0  :  -inf
Entropy :  d_angular_wheel_link_fr_table_7  :  0.0  :  -inf
Columns are not same. Error in data collection
[u'arm_joint_4',
 u'arm_joint_5',
 u'arm_link_4_oz',
 u'arm_link_4_z',
 u'arm_link_5_ow',
 u'arm_link_5_oy',
 u'arm_link_5_oz',
 u'arm_link_5_x',
 u'arm_link_5_y',
 u'arm_link_5_z',
 u'base_footprint_ow',
 u'base_footprint_ox',
 u'base_footprint_oy',
 u'base_footprint_oz',
 u'base_footprint_x',
 u'base_footprint_y',
 u'base_footprint_z',
 u'base_link_ow',
 u'base_link_ox',
 u'base_link_oy',
 u'base_link_oz',
 u'base_link_x',
 u'base_link_y',
 u'base_link_z',
 'd_angular_arm_link_0_table_1',
 'd_angular_arm_link_0_table_2',
 'd_angular_arm_link_0_table_3',
 'd_angular_arm_link_0_table_5',
 'd_angular_arm_link_0_table_6',
 'd_angular_arm_link_2_table_1',
 'd_angular_arm_link_2_table_2',
 'd_angular_arm_link_2_table_5',
 'd_angular_arm_link_2_table_7',
 'd_angular_arm_link_4_table_2',
 'd_angular_arm_link_4_table_6',
 'd_angular_arm_link_4_table_7',
 'd_angular_arm_link_5_table_2',
 'd_angular_arm_link_5_table_4',
 'd_angular_arm_link_5_table_6',
 'd_angular_base_footprint_table_3',
 'd_angular_gripper_finger_link_r_table_1',
 'd_angular_gripper_palm_link_table_4',
 'd_angular_gripper_palm_link_table_7',
 'd_angular_wheel_link_bl_table_1',
 'd_angular_wheel_link_bl_table_2',
 'd_angular_wheel_link_bl_table_6',
 'd_angular_wheel_link_bl_table_7',
 'd_angular_wheel_link_br_table_4',
 'd_angular_wheel_link_br_table_7',
 'd_angular_wheel_link_fl_table_1',
 'd_angular_wheel_link_fl_table_2',
 'd_angular_wheel_link_fl_table_3',
 'd_angular_wheel_link_fl_table_5',
 'd_angular_wheel_link_fl_table_6',
 'd_angular_wheel_link_fl_table_7',
 'd_angular_wheel_link_fr_table_1',
 'd_angular_wheel_link_fr_table_2',
 'd_angular_wheel_link_fr_table_3',
 'd_angular_wheel_link_fr_table_4',
 'd_angular_wheel_link_fr_table_5',
 'd_angular_wheel_link_fr_table_6',
 'd_angular_wheel_link_fr_table_7',
 'd_linear_arm_link_0_table_5',
 'd_linear_arm_link_4_table_3',
 'd_linear_base_footprint_table_5',
 'd_linear_base_link_table_5',
 'd_linear_gripper_finger_link_l_table_5',
 'd_linear_gripper_finger_link_r_table_2',
 'd_linear_gripper_finger_link_r_table_5',
 'd_linear_wheel_link_bl_table_4',
 'd_linear_wheel_link_bl_table_5',
 'd_linear_wheel_link_bl_table_6',
 'd_linear_wheel_link_bl_table_7',
 'd_linear_wheel_link_br_table_7',
 'd_linear_wheel_link_fl_table_6',
 'd_linear_wheel_link_fr_table_6',
 'd_linear_wheel_link_fr_table_7',
 u'gripper_finger_link_l_ow',
 u'gripper_finger_link_l_ox',
 u'gripper_finger_link_l_oy',
 u'gripper_finger_link_l_oz',
 u'gripper_finger_link_l_y',
 u'gripper_finger_link_l_z',
 u'gripper_finger_link_r_ox',
 u'gripper_finger_link_r_oy',
 u'gripper_finger_link_r_oz',
 u'gripper_finger_link_r_x',
 u'gripper_finger_link_r_y',
 u'gripper_finger_link_r_z',
 u'gripper_palm_link_ow',
 u'gripper_palm_link_ox',
 u'gripper_palm_link_oy',
 u'gripper_palm_link_oz',
 u'gripper_palm_link_x',
 u'gripper_palm_link_y',
 u'gripper_palm_link_z',
 u'table_1_ow',
 u'table_1_oz',
 u'table_1_y',
 u'table_2_ow',
 u'table_2_ox',
 u'table_2_oz',
 u'table_2_x',
 u'table_2_y',
 u'table_2_z',
 u'table_3_ow',
 u'table_3_oz',
 u'table_3_y',
 u'table_3_z',
 u'table_4_oz',
 u'table_4_x',
 u'table_4_y',
 u'table_4_z',
 u'table_5_oz',
 u'table_5_x',
 u'table_6_ow',
 u'table_6_ox',
 u'table_6_oz',
 u'table_6_x',
 u'table_6_y',
 u'table_7_ox',
 u'table_7_oz',
 u'table_7_y',
 u'wheel_link_bl_ox',
 u'wheel_link_bl_oz',
 u'wheel_link_bl_x',
 u'wheel_link_bl_z',
 u'wheel_link_br_ox',
 u'wheel_link_br_oy',
 u'wheel_link_br_oz',
 u'wheel_link_br_x',
 u'wheel_link_br_z',
 u'wheel_link_fl_ow',
 u'wheel_link_fl_ox',
 u'wheel_link_fl_oy',
 u'wheel_link_fl_oz',
 u'wheel_link_fl_z',
 u'wheel_link_fr_ow',
 u'wheel_link_fr_oz']
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)

In [139]:
reachData = DataAnalyzer("./reach")
reachData.dataManipulation()
reachData.dataCalculatingRelativeDistances()

reachData.condEntropyFinalGivenInitial()
#reachData.discretizeData()
reachData.discribeParameter('arm_joint_2')


Data has been succesfully read.
Relative Distances are calculated . Data is ready for analysis
Columns are not same. Error in data collection
Entropy :  arm_joint_1  :  0.0
Entropy :  arm_joint_2  :  0.0
Entropy :  arm_joint_3  :  1.7754
Entropy :  arm_joint_4  :  0.0
Entropy :  arm_joint_5  :  0.0
Entropy :  arm_link_0_ow  :  0.0
Entropy :  arm_link_0_ox  :  0.0
Entropy :  arm_link_0_oy  :  0.0
Entropy :  arm_link_0_oz  :  0.0
Entropy :  arm_link_0_x  :  0.0
Entropy :  arm_link_0_y  :  0.0
Entropy :  arm_link_0_z  :  0.0
Entropy :  arm_link_2_ow  :  0.53027
Entropy :  arm_link_2_ox  :  1.5801
Entropy :  arm_link_2_oy  :  1.1455
Entropy :  arm_link_2_oz  :  0.27759
Entropy :  arm_link_2_x  :  0.0
Entropy :  arm_link_2_y  :  0.21191
Entropy :  arm_link_2_z  :  0.0
Entropy :  arm_link_3_ow  :  1.2891
Entropy :  arm_link_3_ox  :  1.5215
Entropy :  arm_link_3_oy  :  0.91553
Entropy :  arm_link_3_oz  :  1.4053
Entropy :  arm_link_3_x  :  1.3848
Entropy :  arm_link_3_y  :  1.4219
Entropy :  arm_link_3_z  :  0.99561
Entropy :  arm_link_4_ow  :  0.61865
Entropy :  arm_link_4_ox  :  0.67334
Entropy :  arm_link_4_oy  :  0.21191
Entropy :  arm_link_4_oz  :  0.82715
Entropy :  arm_link_4_x  :  0.24963
Entropy :  arm_link_4_y  :  0.83496
Entropy :  arm_link_4_z  :  0.52734
Entropy :  arm_link_5_ow  :  1.8262
Entropy :  arm_link_5_ox  :  0.68115
Entropy :  arm_link_5_oy  :  1.251
Entropy :  arm_link_5_oz  :  0.94336
Entropy :  arm_link_5_x  :  0.57764
Entropy :  arm_link_5_y  :  0.51953
Entropy :  arm_link_5_z  :  0.0
Entropy :  gripper_finger_link_l_ow  :  1.1934
Entropy :  gripper_finger_link_l_ox  :  1.1631
Entropy :  gripper_finger_link_l_oy  :  1.5088
Entropy :  gripper_finger_link_l_oz  :  1.4053
Entropy :  gripper_finger_link_l_x  :  1.0469
Entropy :  gripper_finger_link_l_y  :  0.68115
Entropy :  gripper_finger_link_l_z  :  0.58545
Entropy :  gripper_finger_link_r_ow  :  0.89307
Entropy :  gripper_finger_link_r_ox  :  0.15381
Entropy :  gripper_finger_link_r_oy  :  0.79736
Entropy :  gripper_finger_link_r_oz  :  0.58545
Entropy :  gripper_finger_link_r_x  :  1.0771
Entropy :  gripper_finger_link_r_y  :  0.82715
Entropy :  gripper_finger_link_r_z  :  1.3574
Entropy :  gripper_palm_link_ow  :  0.73926
Entropy :  gripper_palm_link_ox  :  1.3262
Entropy :  gripper_palm_link_oy  :  0.73145
Entropy :  gripper_palm_link_oz  :  0.37354
Entropy :  gripper_palm_link_x  :  0.64355
Entropy :  gripper_palm_link_y  :  0.36572
Entropy :  gripper_palm_link_z  :  0.21191
Entropy :  marker_0_ow  :  0.24963
Entropy :  marker_0_ox  :  1.2012
Entropy :  marker_0_oy  :  0.65332
Entropy :  marker_0_oz  :  0.74902
Entropy :  marker_0_x  :  0.0
Entropy :  marker_0_y  :  0.0
Entropy :  marker_0_z  :  0.0
Entropy :  d_linear_m0_gripper  :  0.0
Entropy :  d_angular_m0_gripper  :  0.0
Parameter : arm_joint_2
INITIAL : 0     1.107059
1     0.926407
2     0.943948
3     0.957602
4     0.656764
5     1.058616
6     1.058626
7     0.976129
8     0.976129
9     0.355977
10    0.656915
11    1.004393
12    1.224939
Name: arm_joint_2, dtype: float64
FINAL : 0     0.057868
1     0.029140
2     0.055199
3     0.060838
4     0.077029
5     0.077029
6     0.064715
7     0.064715
8     0.084813
9     0.084803
10    0.104760
11    0.104760
12    0.059529
Name: arm_joint_2, dtype: float64
pdf Initial Values, pdf Final Values  : [ 0.          0.          0.15384615  0.46153846  0.38461538] [ 1.  0.  0.  0.  0.]
check sumpx, sum py, sumpxpy :  1.0 1.0 2.0
H_FinalGivenInitial :  0.0 H_InitialGivenFinal : -inf
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)

In [179]:
reachData.discribeParameter('arm_joint_1')


Parameter : arm_joint_1
pdf Initial Values, pdf Final Values  : [ 0.23076923  0.30769231  0.15384615  0.23076923  0.07692308] [ 0.23076923  0.30769231  0.15384615  0.15384615  0.15384615]
check sumpx, sum py, sumpxpy :  1.0 1.0 2.0
H_FinalGivenInitial :  0.21191 H_InitialGivenFinal : 0.15381
SINGLE pdf Initial Values, pdf Final Values  : [ 0.23076923  0.30769231  0.15384615  0.23076923  0.07692308]
INITIAL : 
[ 5.52168137  4.39171494  3.48558698  2.30818451  2.13802498  1.30728517
  0.57634128  0.07523712  0.91886551  1.5767573   2.02673003  2.61355336
  3.56882912]
FINAL : 
\begin{tabular}{lrrrrr}
\toprule
{} &  Discrete actual &  Discrete mul &    actual &  mul by 100 &  normalized \\
\midrule
0  &                5 &             5 &  5.444571 &         544 &    5.445312 \\
1  &                5 &             5 &  4.391725 &         439 &    4.390625 \\
2  &                4 &             4 &  3.485587 &         348 &    3.486328 \\
3  &                4 &             4 &  2.308185 &         230 &    2.308594 \\
4  &                3 &             3 &  2.138035 &         213 &    2.138672 \\
5  &                2 &             2 &  1.307285 &         130 &    1.307617 \\
6  &                1 &             1 &  0.489937 &          49 &    0.489990 \\
7  &                1 &             1 &  0.075257 &           7 &    0.075256 \\
8  &                2 &             2 &  0.918866 &          91 &    0.918945 \\
9  &                2 &             2 &  1.418902 &         141 &    1.418945 \\
10 &                3 &             3 &  2.026730 &         202 &    2.027344 \\
11 &                4 &             4 &  2.613563 &         261 &    2.613281 \\
12 &                5 &             5 &  3.568839 &         356 &    3.568359 \\
\bottomrule
\end{tabular}


In [168]:
reachData.discribeParameter('d_linear_m0_gripper')


Parameter : d_linear_m0_gripper
pdf Initial Values, pdf Final Values  : [ 0.23076923  0.15384615  0.53846154  0.          0.07692308] [ 0.  0.  1.  0.  0.]
check sumpx, sum py, sumpxpy :  1.0 1.0 2.0
H_FinalGivenInitial :  0.0 H_InitialGivenFinal : -inf
SINGLE pdf Initial Values, pdf Final Values  : [ 0.23076923  0.15384615  0.53846154  0.          0.07692308]
INITIAL : 
[ 0.87399842  0.55698544  0.53254873  0.37791788  0.32340168  0.48135461
  0.55050018  0.56948357  0.51526644  0.192667    0.31971078  0.38866229
  0.60102601]
FINAL : 
[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]

In [129]:
reachData.discribeParameter('marker_0_x')


Parameter : marker_0_x
check pdf : [[ 0.38461538  0.          0.          0.          0.        ]
 [ 0.          0.07692308  0.          0.          0.        ]
 [ 0.          0.          0.23076923  0.          0.        ]
 [ 0.          0.          0.          0.07692308  0.        ]
 [ 0.          0.          0.          0.          0.23076923]] [[ 5.  0.  0.  0.  0.]
 [ 0.  1.  0.  0.  0.]
 [ 0.  0.  3.  0.  0.]
 [ 0.  0.  0.  1.  0.]
 [ 0.  0.  0.  0.  3.]]
pdf Initial Values, pdf Final Values  : [ 0.38461538  0.07692308  0.23076923  0.07692308  0.23076923] [ 0.38461538  0.07692308  0.23076923  0.07692308  0.23076923]
check sumpx, sum py, sumpxpy :  1.0 1.0 2.0
H_FinalGivenInitial :  0.0 H_InitialGivenFinal : 0.0
INITIAL : 
    Discrete actual  Discrete mul    actual  mul by 100  normalized
0                 5             5  0.895326          89    0.895508
1                 3             3  0.378905          37    0.378906
2                 2             2 -0.039802          -4   -0.039795
3                 2             2  0.018108           1    0.018112
4                 2             2  0.080845           8    0.080872
5                 4             4  0.533948          53    0.534180
6                 5             5  0.958832          95    0.958984
7                 5             5  1.058258         105    1.058594
8                 4             4  0.770940          77    0.770996
9                 4             4  0.475365          47    0.475342
10                3             3  0.100056          10    0.100037
11                1             1 -0.143746         -15   -0.143799
12                1             1 -0.064413          -7   -0.064392
FINAL : 
    Discrete actual  Discrete mul    actual  mul by 100  normalized
0                 5             5  0.895326          89    0.895508
1                 3             3  0.378905          37    0.378906
2                 2             2 -0.039802          -4   -0.039795
3                 2             2  0.018108           1    0.018112
4                 2             2  0.080845           8    0.080872
5                 4             4  0.533948          53    0.534180
6                 5             5  0.958832          95    0.958984
7                 5             5  1.058258         105    1.058594
8                 4             4  0.770940          77    0.770996
9                 4             4  0.475365          47    0.475342
10                3             3  0.100056          10    0.100037
11                1             1 -0.143746         -15   -0.143799
12                1             1 -0.064413          -7   -0.064392

In [176]:
#ceDict = reachData.condEntropyFinalGivenInitial()
zeroEntropy = []
for key in ceDict.keys():
    if ceDict[key] == 0.0:
        zeroEntropy.append(key)

pprint.pprint(sorted(zeroEntropy))
pd.DataFrame.to_latex(sorted(zeroEntropy))


[u'arm_joint_5',
 u'arm_link_0_ow',
 u'arm_link_0_ox',
 u'arm_link_0_oy',
 u'arm_link_0_oz',
 u'arm_link_0_x',
 u'arm_link_0_y',
 u'arm_link_0_z',
 u'arm_link_2_ow',
 u'arm_link_2_x',
 u'arm_link_2_z',
 'd_angular_m0_gripper',
 'd_linear_m0_gripper',
 'marker_0_ow',
 'marker_0_ox',
 'marker_0_oy',
 'marker_0_oz',
 'marker_0_x',
 'marker_0_y',
 'marker_0_z']
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-176-e79e3543717c> in <module>()
      6 
      7 pprint.pprint(sorted(zeroEntropy))
----> 8 pd.DataFrame.to_latex(sorted(zeroEntropy))

TypeError: unbound method to_latex() must be called with DataFrame instance as first argument (got list instance instead)

In [22]:
toolTipAllign = DataAnalyzer("./reach")
toolTipAllign.dataManipulation()
toolTipAllign.dataCalculatingRelativeDistances()

toolTipAllign.condEntropyFinalGivenInitial()


Data has been succesfully read.
Relative Distances are calculated . Data is ready for analysis
Columns are not same. Error in data collection
{u'arm_joint_1': 0.15381,
 u'arm_joint_2': 1.0771,
 u'arm_joint_3': -inf,
 u'arm_joint_4': -0.79834,
 u'arm_joint_5': -inf,
 u'arm_link_0_ow': 0.0,
 u'arm_link_0_ox': 0.0,
 u'arm_link_0_oy': 0.0,
 u'arm_link_0_oz': 0.0,
 u'arm_link_0_x': 0.0,
 u'arm_link_0_y': 0.0,
 u'arm_link_0_z': 0.0,
 u'arm_link_2_ow': 0.0,
 u'arm_link_2_ox': 0.14075,
 u'arm_link_2_oy': -0.21362,
 u'arm_link_2_oz': 0.1781,
 u'arm_link_2_x': -inf,
 u'arm_link_2_y': 0.15381,
 u'arm_link_2_z': 0.0,
 u'arm_link_3_ow': -0.0057831,
 u'arm_link_3_ox': -inf,
 u'arm_link_3_oy': -inf,
 u'arm_link_3_oz': 0.82471,
 u'arm_link_3_x': 0.53271,
 u'arm_link_3_y': -inf,
 u'arm_link_3_z': 0.91162,
 u'arm_link_4_ow': 0.39185,
 u'arm_link_4_ox': 0.09906,
 u'arm_link_4_oy': 0.47461,
 u'arm_link_4_oz': 1.1895,
 u'arm_link_4_x': -inf,
 u'arm_link_4_y': 0.41528,
 u'arm_link_4_z': 0.82715,
 u'arm_link_5_ow': -0.16101,
 u'arm_link_5_ox': 0.26147,
 u'arm_link_5_oy': -inf,
 u'arm_link_5_oz': 0.68701,
 u'arm_link_5_x': 0.48779,
 u'arm_link_5_y': 0.15381,
 u'arm_link_5_z': 0.87207,
 'd_angular_m0_gripper': -inf,
 'd_linear_m0_gripper': -inf,
 u'gripper_finger_link_l_ow': 0.75635,
 u'gripper_finger_link_l_ox': -inf,
 u'gripper_finger_link_l_oy': 1.251,
 u'gripper_finger_link_l_oz': 0.70557,
 u'gripper_finger_link_l_x': -inf,
 u'gripper_finger_link_l_y': 0.44849,
 u'gripper_finger_link_l_z': 0.73926,
 u'gripper_finger_link_r_ow': 0.32666,
 u'gripper_finger_link_r_ox': -0.013069,
 u'gripper_finger_link_r_oy': 0.67529,
 u'gripper_finger_link_r_oz': 0.089966,
 u'gripper_finger_link_r_x': -inf,
 u'gripper_finger_link_r_y': -inf,
 u'gripper_finger_link_r_z': 0.15649,
 u'gripper_palm_link_ow': -inf,
 u'gripper_palm_link_ox': 0.63428,
 u'gripper_palm_link_oy': 1.0391,
 u'gripper_palm_link_oz': 0.7334,
 u'gripper_palm_link_x': 0.36768,
 u'gripper_palm_link_y': 0.302,
 u'gripper_palm_link_z': 0.50635,
 'marker_0_ow': 0.0,
 'marker_0_ox': 0.0,
 'marker_0_oy': 0.0,
 'marker_0_oz': 0.0,
 'marker_0_x': 0.0,
 'marker_0_y': 0.0,
 'marker_0_z': 0.0}
infotheo.py:237: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if pxpy != None and not _isproperdist(pxpy):
infotheo.py:239: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if pxpy == None:

In [140]:
toolTipAllign = DataAnalyzer("./toolTipAllign")
toolTipAllign.dataManipulation()
toolTipAllign.dataCalculatingRelativeDistances()

ceDict = toolTipAllign.condEntropyFinalGivenInitial()
zeroEntropy = []
for key in ceDict.keys():
    if ceDict[key] == 0.0:
        zeroEntropy.append(key)
        
pprint.pprint(sorted(zeroEntropy))


Data has been succesfully read.
Relative Distances are calculated . Data is ready for analysis
Columns are not same. Error in data collection
Entropy :  arm_joint_1  :  0.0
Entropy :  arm_joint_2  :  0.0
Entropy :  arm_joint_3  :  0.0
Entropy :  arm_joint_4  :  0.0
Entropy :  arm_joint_5  :  0.72461
Entropy :  arm_link_0_ow  :  0.0
Entropy :  arm_link_0_ox  :  0.0
Entropy :  arm_link_0_oy  :  0.0
Entropy :  arm_link_0_oz  :  0.0
Entropy :  arm_link_0_x  :  0.0
Entropy :  arm_link_0_y  :  0.0
Entropy :  arm_link_0_z  :  0.0
Entropy :  arm_link_2_ow  :  0.0
Entropy :  arm_link_2_ox  :  0.0
Entropy :  arm_link_2_oy  :  0.0
Entropy :  arm_link_2_oz  :  0.0
Entropy :  arm_link_2_x  :  0.0
Entropy :  arm_link_2_y  :  0.0
Entropy :  arm_link_2_z  :  0.0
Entropy :  arm_link_3_ow  :  0.0
Entropy :  arm_link_3_ox  :  0.0
Entropy :  arm_link_3_oy  :  0.0
Entropy :  arm_link_3_oz  :  0.0
Entropy :  arm_link_3_x  :  0.0
Entropy :  arm_link_3_y  :  0.0
Entropy :  arm_link_3_z  :  0.0
Entropy :  arm_link_4_ow  :  0.0
Entropy :  arm_link_4_ox  :  0.0
Entropy :  arm_link_4_oy  :  0.0
Entropy :  arm_link_4_oz  :  0.0
Entropy :  arm_link_4_x  :  0.0
Entropy :  arm_link_4_y  :  0.0
Entropy :  arm_link_4_z  :  0.0
Entropy :  arm_link_5_ow  :  1.0
Entropy :  arm_link_5_ox  :  0.87549
Entropy :  arm_link_5_oy  :  0.87549
Entropy :  arm_link_5_oz  :  1.0264
Entropy :  arm_link_5_x  :  0.19995
Entropy :  arm_link_5_y  :  1.2002
Entropy :  arm_link_5_z  :  0.0
Entropy :  gripper_finger_link_l_ow  :  0.75098
Entropy :  gripper_finger_link_l_ox  :  0.75098
Entropy :  gripper_finger_link_l_oy  :  0.92432
Entropy :  gripper_finger_link_l_oz  :  0.75098
Entropy :  gripper_finger_link_l_x  :  1.2754
Entropy :  gripper_finger_link_l_y  :  1.0752
Entropy :  gripper_finger_link_l_z  :  0.47559
Entropy :  gripper_finger_link_r_ow  :  0.0
Entropy :  gripper_finger_link_r_ox  :  0.0
Entropy :  gripper_finger_link_r_oy  :  0.0
Entropy :  gripper_finger_link_r_oz  :  0.0
Entropy :  gripper_finger_link_r_x  :  0.27539
Entropy :  gripper_finger_link_r_y  :  0.6001
Entropy :  gripper_finger_link_r_z  :  0.36108
Entropy :  gripper_palm_link_ow  :  0.36108
Entropy :  gripper_palm_link_ox  :  0.0
Entropy :  gripper_palm_link_oy  :  0.0
Entropy :  gripper_palm_link_oz  :  0.0
Entropy :  gripper_palm_link_x  :  0.75098
Entropy :  gripper_palm_link_y  :  0.3999
Entropy :  gripper_palm_link_z  :  0.76074
Entropy :  marker_0_ow  :  0.87549
Entropy :  marker_0_ox  :  1.2852
Entropy :  marker_0_oy  :  0.6001
Entropy :  marker_0_oz  :  0.87549
Entropy :  marker_0_x  :  0.0
Entropy :  marker_0_y  :  0.0
Entropy :  marker_0_z  :  0.0
Entropy :  d_linear_m0_gripper  :  0.0
Entropy :  d_angular_m0_gripper  :  0.0
[u'arm_joint_1',
 u'arm_joint_2',
 u'arm_joint_3',
 u'arm_joint_4',
 u'arm_link_0_ow',
 u'arm_link_0_ox',
 u'arm_link_0_oy',
 u'arm_link_0_oz',
 u'arm_link_0_x',
 u'arm_link_0_y',
 u'arm_link_0_z',
 u'arm_link_2_ow',
 u'arm_link_2_ox',
 u'arm_link_2_oy',
 u'arm_link_2_oz',
 u'arm_link_2_x',
 u'arm_link_2_y',
 u'arm_link_2_z',
 u'arm_link_3_ow',
 u'arm_link_3_ox',
 u'arm_link_3_oy',
 u'arm_link_3_oz',
 u'arm_link_3_x',
 u'arm_link_3_y',
 u'arm_link_3_z',
 u'arm_link_4_ow',
 u'arm_link_4_ox',
 u'arm_link_4_oy',
 u'arm_link_4_oz',
 u'arm_link_4_x',
 u'arm_link_4_y',
 u'arm_link_4_z',
 u'arm_link_5_z',
 'd_angular_m0_gripper',
 'd_linear_m0_gripper',
 u'gripper_finger_link_r_ow',
 u'gripper_finger_link_r_ox',
 u'gripper_finger_link_r_oy',
 u'gripper_finger_link_r_oz',
 u'gripper_palm_link_ox',
 u'gripper_palm_link_oy',
 u'gripper_palm_link_oz',
 'marker_0_x',
 'marker_0_y',
 'marker_0_z']
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)
/home/deebuls/anaconda/lib/python2.7/site-packages/sklearn/utils/extmath.py:68: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.
  np.sqrt(norms, norms)

In [32]:
a = [ 0.07354736, 0.07354736,  0.07348633,  0.07354736,  0.07348633,  0.0736084,
  0.07348633,  0.0736084,   0.07354736,  0.07348633,  0.07366943,  0.07354736] 
b = [ 0.07354736,  0.07354736,  0.0736084,   0.07513428,  0.07354736,  0.07348633,
  0.07446289,  0.07366943,  0.07501221,  0.07537842,  0.07354736,  0.07348633]

np.histogram2d(b,a,bins=5)


Out[32]:
(array([[ 2.,  3.,  0.,  2.,  1.],
        [ 0.,  0.,  0.,  0.,  0.],
        [ 1.,  0.,  0.,  0.,  0.],
        [ 0.,  0.,  0.,  0.,  0.],
        [ 1.,  2.,  0.,  0.,  0.]]),
 array([ 0.07348633,  0.07386475,  0.07424317,  0.07462158,  0.075     ,
         0.07537842]),
 array([ 0.07348633,  0.07352295,  0.07355957,  0.07359619,  0.07363281,
         0.07366943]))

In [174]:
from sklearn import preprocessing

data_start = np.arange(10,20.0)
data_start = np.array([5,5,5,5,5,5,5,5,5.0])

data_end = np.arange(0.1,1.1,0.1)
'''
data = np.append(data_start,data_end)
print data
min_max_scaler = preprocessing.MinMaxScaler()
data = min_max_scaler.fit_transform(data)
print data
data_start, data_end = np.split(data,2)
data_start = min_max_scaler.fit_transform(data_start)
data_end = min_max_scaler.fit_transform(data_end)
print data_start
print data_end
'''

data_max = max(data_start.max(), data_end.max())
data_min = min(data_end.min(), data_end.min())
print x_max, x_min


H, xedges, yedges = np.histogram2d(data_start, data_start, bins=5)
pdf = H/float(len(data_start))
px = pdf.sum(0)
py = pdf.sum(1)
print "pdf Initial Values, pdf Final Values  :", px, py
print "check sumpx, sum py, sumpxpy : ", sum(px), sum(py), sum(px)+sum(py)
print "H_FinalGivenInitial : ",  np.float16(infotheo.condentropy(py, px, pdf)), "H_InitialGivenFinal :", np.float16(infotheo.condentropy(px, py, pdf))

myextent  =[xedges[0],xedges[-1],yedges[0],yedges[-1]]
plt.imshow(H.T,origin='low',extent=myextent,interpolation='nearest',aspect='auto')
plt.plot(data_start, data_start,'ro')
plt.colorbar()
plt.ylabel("Initial Values")
plt.xlabel("Final Values")
plt.show()


19.0 0.1
pdf Initial Values, pdf Final Values  : [ 0.  0.  1.  0.  0.] [ 0.  0.  1.  0.  0.]
check sumpx, sum py, sumpxpy :  1.0 1.0 2.0
H_FinalGivenInitial :  0.0 H_InitialGivenFinal : 0.0