Commit 862c1637 by Vik Paruchuri

Working on a generic ml algorithm

parent c6664d06
...@@ -43,3 +43,7 @@ def create(text,score,prompt_string,model_path): ...@@ -43,3 +43,7 @@ def create(text,score,prompt_string,model_path):
return results return results
def create_generic(numeric_values, textual_values, target, model_path):
pass
...@@ -100,6 +100,4 @@ def grade(grader_data,grader_config,submission): ...@@ -100,6 +100,4 @@ def grade(grader_data,grader_config,submission):
return results return results
import numpy
import nltk
import sys
import random
import os
import logging
base_path = os.path.dirname(__file__)
sys.path.append(base_path)
import util_functions
if not base_path.endswith("/"):
base_path=base_path+"/"
log=logging.getLogger(__name__)
class AlgorithmTypes(object):
regression = "regression"
classification = "classifiction"
class PredictorSet(object):
def __init__(self, type="train", algorithm = AlgorithmTypes.regression):
"""
Initialize variables and check essay set type
"""
if(type != "train" and type != "test"):
type = "train"
if(algorithm not in [AlgorithmTypes.regression, AlgorithmTypes.classification]):
algorithm = AlgorithmTypes.regression
self._type = type
self._target=[]
self._textual_features=[]
self._numeric_features=[]
self.essay_sets=[]
def add_row(self, numeric_features, textual_features, target):
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment