Ejemplo n.º 1
0
 def _fetch_file(self, input_path, **param):
     if self.model == None:
         raise 'Please Train a model before predicting some thing'
     self.update_param(param)
     obj_dt = DataTransform(input_path, param)
     obj_dt.scan_data_type()
     x, y = obj_dt.fetch_data()
     return (x, y)
Ejemplo n.º 2
0
    def train(self,input_path,**param):
        self.update_param(param)
        obj_dt = DataTransform(input_path,param)
        obj_dt.scan_data_type()
        x,y = obj_dt.fetch_data()
        clf = linear_model.Lasso(alpha=0.01)
        model = clf.fit(x,y)
        self.model = model

        return model
Ejemplo n.º 3
0
    def train(self,input_path,**param):
        self.update_param(param)
        obj_dt = DataTransform(input_path,param)
        obj_dt.scan_data_type()
        x,y = obj_dt.fetch_data()
        clf = svm.SVC()
        model = clf.fit(x,y)
        self.model = model

        return model
    def train(self,input_path,**param):
        self.update_param(param)
        if not self.int_dimension == None:
            param['n_features'] = self.int_dimension
        obj_dt = DataTransform(input_path,param)
        obj_dt.scan_data_type()
        x,y = obj_dt.fetch_data()
        clf = tree.DecisionTreeClassifier()
        model = clf.fit(x,y)
        self.model = model

        return model