Exemplo n.º 1
0
	def widget(self):
		pbox=[]

		# ファイル名とファイル内容
		self.iName_w =widgets.Text(description="トランザクション",value="",layout=Layout(width='99%'),disabled=True)
		self.iText_w =widgets.Textarea(value="",rows=5,layout=Layout(width='99%'),disabled=True)
		pbox.append(self.iName_w)
		pbox.append(self.iText_w)
		self.oPath_w =widgets.Text(description="出力パス",value="",layout=Layout(width='100%'),disabled=False)
		pbox.append(self.oPath_w)
		self.oDir_w =widgets.Text(description="出力dir名",value="",layout=widgets.Layout(width='100%'),disabled=False)
		pbox.append(self.oDir_w)

		# traID 項目
		config_t={
			"options":[],
			"title":"トランザクションID項目",
			"rows":5,
			"width":300,
			"multiSelect":False,
			"message":None
		}
		self.traID_w=selfield_w(config_t)

		# item 項目
		config_i={
			"options":[],
			"title":"アイテム項目",
			"rows":5,
			"width":300,
			"multiSelect":False,
			"message":None
		}
		self.item_w=selfield_w(config_i)

		pbox.append(widgets.HBox([self.traID_w.widget(),self.item_w.widget()]))

		# 各種しきい値
		self.minSup_w=widgets.FloatSlider(description='minSup', value=0.01, min=0.0, max=1.0, step=0.01)
		pbox.append(self.minSup_w)

		self.edgeType_w=widgets.RadioButtons(description='edge条件',options=['minConf', 'minPMI'])
		self.minConf_w=widgets.FloatSlider(description='minConf', value=0.01, min=0.0, max=1.0, step=0.01)
		self.minPMI_w=widgets.FloatSlider(description='minPMI', value=0.0, min=-1.0, max=1.0, step=0.01)
		pbox.append(widgets.HBox([self.edgeType_w,self.minConf_w,self.minPMI_w]))

		self.nodeSup_w=widgets.Checkbox( value=True, description='nodeにもminSupを適用する', disabled=False)
		pbox.append(self.nodeSup_w)

		box=widgets.VBox(pbox)
		return box
Exemplo n.º 2
0
	def widget(self):
		pbox=[]

		# ファイル名とファイル内容
		self.iName_w =widgets.Text(description="トランザクション",value="",layout=Layout(width='99%'),disabled=True)
		self.iText_w =widgets.Textarea(value="",rows=5,layout=Layout(width='99%'),disabled=True)
		pbox.append(self.iName_w)
		pbox.append(self.iText_w)
		self.oPath_w =widgets.Text(description="出力パス",value="",layout=Layout(width='100%'),disabled=False)
		pbox.append(self.oPath_w)
		self.oDir_w =widgets.Text(description="ディレクトリ名",value="",layout=Layout(width='100%'),disabled=False)
		pbox.append(self.oDir_w)

		# id 項目
		config_t={
			"options":[],
			"title":"サンプルID項目",
			"rows":5,
			"blank":True,
			"width":300,
			"multiSelect":False,
			"message":None
		}
		self.id_w=selfield_w(config_t)

		# 入力変数項目
		config_i={
			"options":[],
			"title":"数値説明変数",
			"rows":5,
			#"blank":True,
			"width":300,
			"multiSelect":True,
			"message":None
		}
		self.x_w=selfield_w(config_i)

		pbox.append(widgets.HBox([self.x_w.widget()]))

		self.algo_w=widgets.RadioButtons(options=['k-means'],
				value='k-means', description='algorithm:', disabled=False)
		pbox.append(self.algo_w)

		self.k_w=widgets.BoundedIntText(description='クラスタ数',value=5,min=2,style={'description_width': 'initial'})
		#print("k",self.k_w.keys)
		pbox.append(self.k_w)

		box=widgets.VBox(pbox)
		return box
Exemplo n.º 3
0
    def widget(self):
        pbox = []
        # ファイル名とファイル内容
        self.iName_w = widgets.Text(description="入力ファイル",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=True)
        self.iText_w = widgets.Textarea(value="",
                                        rows=5,
                                        layout=Layout(width='100%'),
                                        disabled=False)
        pbox.append(self.iName_w)
        pbox.append(self.iText_w)
        self.oPath_w = widgets.Text(description="出力パス",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=False)
        pbox.append(self.oPath_w)
        self.oFile_w = widgets.Text(description="ファイル名",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=False)
        pbox.append(self.oFile_w)

        # key 項目
        config_tid = {
            "options": [],
            "title": "トランザクションID項目",
            "rows": 5,
            "width": 300,
            "multiSelect": False,
            "message": None
        }
        self.tid_w = selfield_w(config_tid)

        # item 項目
        config_item = {
            "options": [],
            "title": "アイテム項目",
            "rows": 5,
            "width": 300,
            "multiSelect": False,
            "message": None
        }
        self.item_w = selfield_w(config_item)
        pbox.append(widgets.HBox([self.tid_w.widget(), self.item_w.widget()]))

        # 集計 項目
        config_agg = {
            "options": [],
            "title": "集計項目",
            "rows": 5,
            "blank": True,
            "width": 300,
            "multiSelect": False,
            "message": None
        }
        self.agg_w = selfield_w(config_agg)

        # クラス項目
        config_klass = {
            "options": [],
            "title": "目的変数項目",
            "rows": 5,
            "blank": True,
            "width": 300,
            "multiSelect": False,
            "message": None
        }
        self.klass_w = selfield_w(config_klass)
        pbox.append(widgets.HBox([self.agg_w.widget(), self.klass_w.widget()]))

        # その他パラメータ
        self.null_w = widgets.Text(description="nullの置換値",
                                   value="0",
                                   style={'description_width': 'initial'})
        self.dummy_w = widgets.Checkbox(
            value=True,
            description='dummy化(アイテムが存在するかどうかの0/1)',
            style={'description_width': 'initial'})
        statsList = [
            "sum", "mean", "count", "ucount", "devsq", "var", "uvar", "sd",
            "usd", "USD", "cv", "min", "qtile1", "median", "qtile3", "max",
            "range", "qrange", "mode", "skew", "uskew", "kurt", "ukurt"
        ]
        self.stat_w = widgets.Dropdown(description="統計量",
                                       options=statsList,
                                       value='sum',
                                       disabled=False)
        pbox.append(widgets.VBox([self.null_w, self.dummy_w, self.stat_w]))

        box = widgets.VBox(pbox)
        return box
Exemplo n.º 4
0
    def widget(self):
        pbox = []
        # ファイル名とファイル内容
        self.iName_w = widgets.Text(description="入力ファイル",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=True)
        self.iText_w = widgets.Textarea(value="",
                                        rows=5,
                                        layout=Layout(width='100%'),
                                        disabled=True)
        pbox.append(self.iName_w)
        pbox.append(self.iText_w)
        self.oPath_w = widgets.Text(description="出力パス",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=False)
        pbox.append(self.oPath_w)
        self.oFile_w = widgets.Text(description="ファイル名",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=False)
        pbox.append(self.oFile_w)

        # key 項目
        config_k = {
            "options": [],
            "title": "key単位選択の項目",
            "rows": 5,
            "width": 300,
            "blank": True,
            "multiSelect": False,
            "message": None
        }
        self.key_w = selfield_w(config_k)

        # field 項目
        config_f = {
            "options": [],
            "title": "アイテム項目",
            "rows": 5,
            "width": 300,
            "multiSelect": False,
            "message": None
        }
        self.field_w = selfield_w(config_f)
        pbox.append(widgets.HBox([self.field_w.widget(), self.key_w.widget()]))

        # 値
        self.value_w = widgets.Text(description="値",
                                    value="",
                                    layout=Layout(width='300px'))
        search_w = widgets.Button(description="値のみで検索")
        search_w.on_click(self.search_h)
        self.result_w = widgets.Select(options=[], rows=14)
        subbox1 = widgets.VBox([self.value_w, search_w, self.result_w])

        # その他parameters
        self.head_w = widgets.Checkbox(value=False,
                                       description='先頭一致',
                                       disabled=False)
        self.tail_w = widgets.Checkbox(value=False,
                                       description='末尾一致',
                                       disabled=False)
        self.reverse_w = widgets.Checkbox(value=False,
                                          description='条件反転',
                                          disabled=False)
        subbox2 = widgets.VBox([self.head_w, self.tail_w, self.reverse_w])
        pbox.append(widgets.HBox([subbox1, subbox2]))

        box = widgets.VBox(pbox)
        return box
Exemplo n.º 5
0
    def widget(self):
        # parameters
        pbox = []

        # 入力ファイル名とファイル内容
        self.fName_w = widgets.Text(description="入力ファイル",
                                    value="",
                                    layout=widgets.Layout(width='99%'),
                                    disabled=True)
        self.fText_w = widgets.Textarea(value="",
                                        rows=5,
                                        layout=widgets.Layout(width='99%'),
                                        disabled=True)
        pbox.append(self.fName_w)
        pbox.append(self.fText_w)
        self.oPath_w = widgets.Text(description="出力パス",
                                    value="",
                                    layout=widgets.Layout(width='100%'),
                                    disabled=False)
        pbox.append(self.oPath_w)
        self.oDir_w = widgets.Text(description="出力dir名",
                                   value="",
                                   layout=widgets.Layout(width='100%'),
                                   disabled=False)
        pbox.append(self.oDir_w)

        # id 項目
        config_id = {
            "options": [],
            "title": "サンプルID項目(指定しなくても良い)",
            "rows": 5,
            "width": 300,
            "blank": True,
            "multiSelect": False,
            "message": None
        }
        self.id_w = selfield_w(config_id)

        # 数値変数 項目
        config_n = {
            "options": [],
            "title": "数値説明変数(複数選択可)",
            "rows": 5,
            "width": 300,
            "blank": True,
            "multiSelect": True,
            "message": None
        }
        self.num_w = selfield_w(config_n)

        # cat変数 項目
        config_c = {
            "options": [],
            "title": "カテゴリ説明変数(複数選択可)",
            "rows": 5,
            "width": 300,
            "blank": True,
            "multiSelect": True,
            "message": None
        }
        self.cat_w = selfield_w(config_c)

        # y 項目
        config_y = {
            "options": [],
            "title": "目的変数",
            "rows": 5,
            "width": 300,
            "multiSelect": False,
            "message": None
        }
        self.y_w = selfield_w(config_y)
        pbox.append(widgets.HBox([self.id_w.widget(), self.y_w.widget()]))
        pbox.append(widgets.HBox([self.num_w.widget(), self.cat_w.widget()]))

        # 各種しきい値
        self.minSamplesLeaf_w = widgets.FloatSlider(description='枝刈度',
                                                    value=0.0,
                                                    min=0.0,
                                                    max=0.5,
                                                    step=0.01,
                                                    disabled=False,
                                                    orientation='horizontal')
        label = widgets.Textarea(
            rows=3,
            disabled=True,
            layout=widgets.Layout(width="65%"),
            value="""枝刈度にはリーフの最小サンプル数(min_samples_leaf)を利用する。
値は、全サンプル数に対する割合で指定する(min_samples_leaf=(0.0,0.5])。
0.0に設定すると、cross-validationでテスト誤差最小の枝刈度を自動選択する。
""")
        pbox.append(widgets.VBox([label, self.minSamplesLeaf_w]))

        box = widgets.VBox(pbox)
        return box
Exemplo n.º 6
0
    def widget(self):
        pbox = []
        # ファイル名とファイル内容
        self.fName_w = widgets.Text(description="file name",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=True)
        self.fText_w = widgets.Textarea(value="",
                                        rows=5,
                                        layout=Layout(width='100%'),
                                        disabled=True)
        pbox.append(self.fName_w)
        pbox.append(self.fText_w)
        self.oPath_w = widgets.Text(description="出力パス",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=True)
        pbox.append(self.oPath_w)
        self.oFile_w = widgets.Text(description="ファイル名",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=False)
        pbox.append(self.oFile_w)

        # key 項目
        config_k = {
            "options": [],
            "title": "集計単位の項目",
            "rows": 5,
            "width": 300,
            "blank": True,
            "multiSelect": False,
            "message": None
        }
        self.key_w = selfield_w(config_k)

        # field 項目
        config_f = {
            "options": [],
            "title": "集計対象の項目",
            "rows": 5,
            "width": 300,
            "multiSelect": False,
            "message": None
        }
        self.field_w = selfield_w(config_f)
        pbox.append(widgets.HBox([self.field_w.widget(), self.key_w.widget()]))

        # 新項目名
        self.newfld_w = widgets.Text(description="出力項目名",
                                     value="",
                                     layout=Layout(width='300px'))
        newfldL_w = widgets.Label(value="指定しなければ集計対象項目名と同じ名前になる",
                                  disabled=True)
        pbox.append(widgets.HBox([self.newfld_w, newfldL_w]))

        # 統計量
        statsList = [
            "sum", "mean", "count", "ucount", "devsq", "var", "uvar", "sd",
            "usd", "USD", "cv", "min", "qtile1", "median", "qtile3", "max",
            "range", "qrange", "mode", "skew", "uskew", "kurt", "ukurt"
        ]
        self.stat_w = widgets.Dropdown(description="統計量",
                                       options=statsList,
                                       value='sum',
                                       disabled=False)
        pbox.append(self.stat_w)

        help_w = widgets.Textarea(value=self.help(),
                                  rows=4,
                                  layout=Layout(width='100%'),
                                  disabled=True)
        pbox.append(help_w)

        box = widgets.VBox(pbox)
        return box
Exemplo n.º 7
0
	def widget(self):
		# parameters
		pbox=[]

		# 入力ファイル名とファイル内容
		self.fName_w =widgets.Text(description="入力ファイル",value="",layout=widgets.Layout(width='99%'),disabled=True)
		self.fText_w =widgets.Textarea(value="",rows=5,layout=widgets.Layout(width='99%'),disabled=True)
		pbox.append(self.fName_w)
		pbox.append(self.fText_w)
		self.oPath_w =widgets.Text(description="出力パス",value="",layout=widgets.Layout(width='100%'),disabled=False)
		pbox.append(self.oPath_w)
		self.oDir_w =widgets.Text(description="出力dir名",value="",layout=widgets.Layout(width='100%'),disabled=False)
		pbox.append(self.oDir_w)

		# id 項目
		config_id={
			"options":[],
			"title":"サンプルID項目(指定しなくても良い)",
			"rows":5,
			"width":300,
			"blank":True,
			"multiSelect":False,
			"message":None
		}
		self.id_w=selfield_w(config_id)
	
		# 数値変数 項目
		config_n={
			"options":[],
			"title":"数値説明変数(複数選択可)",
			"rows":5,
			"width":300,
			"blank":True,
			"multiSelect":True,
			"message":None
		}
		self.num_w=selfield_w(config_n)

		# cat変数 項目
		config_c={
			"options":[],
			"title":"カテゴリ説明変数(複数選択可)",
			"rows":5,
			"width":300,
			"blank":True,
			"multiSelect":True,
			"message":None
		}
		self.cat_w=selfield_w(config_c)

		# y 項目
		config_y={
			"options":[],
			"title":"目的変数項目",
			"rows":5,
			"width":300,
			"multiSelect":False,
			"message":None
		}
		self.y_w=selfield_w(config_y)
		pbox.append(widgets.HBox([self.id_w.widget(),self.y_w.widget()]))
		pbox.append(widgets.HBox([self.num_w.widget(),self.cat_w.widget()]))

		# 各種しきい値
		label=widgets.Textarea(rows=3,disabled=True,layout=widgets.Layout(width="65%"),
    value=
"""
""")
		pbox.append(widgets.VBox([label]))

		box=widgets.VBox(pbox)
		return box
Exemplo n.º 8
0
	def widget(self):
		pbox=[]

		# ファイル名とファイル内容
		self.iName_w =widgets.Text(description="トランザクション",value="",layout=Layout(width='99%'),disabled=True)
		self.iText_w =widgets.Textarea(value="",rows=5,layout=Layout(width='99%'),disabled=True)
		pbox.append(self.iName_w)
		pbox.append(self.iText_w)
		self.oPath_w =widgets.Text(description="出力パス",value="",layout=Layout(width='100%'),disabled=False)
		pbox.append(self.oPath_w)
		self.oDir_w =widgets.Text(description="ディレクトリ名",value="",layout=Layout(width='100%'),disabled=False)
		pbox.append(self.oDir_w)

		# traID 項目
		config_t={
			"options":[],
			"title":"トランザクションID",
			"rows":5,
			"width":300,
			"multiSelect":False,
			"message":None
		}
		self.traID_w=selfield_w(config_t)

		# item 項目
		config_i={
			"options":[],
			"title":"アイテム項目",
			"rows":5,
			"width":300,
			"multiSelect":False,
			"message":None
		}
		self.item_w=selfield_w(config_i)

		# class 項目
		config_c={
			"options":[],
			"title":"目的変数項目",
			"rows":5,
			"blank":True,
			"width":300,
			"multiSelect":False,
			"message":None
		}
		self.class_w=selfield_w(config_c)
		pbox.append(widgets.HBox([self.traID_w.widget(),self.item_w.widget(),self.class_w.widget()]))

		# 各種しきい値
		self.type_w=widgets.RadioButtons(options=['F:頻出集合', 'C:飽和集合', 'M:極大集合'],
				value='F:頻出集合', description='type:', disabled=False)
		pbox.append(self.type_w)

		self.minSup_w=widgets.FloatSlider(description='minSup', value=0.01, min=0.0, max=1.0, step=0.01)
		self.maxSup_w=widgets.FloatSlider(description='maxSup', value=1.0, min=0.0, max=1.0, step=0.01)
		pbox.append(widgets.HBox([self.minSup_w,self.maxSup_w]))

		self.minLen_w=widgets.IntSlider(description='minLen', value=1, min=1, max=10, step=1)
		self.maxLen_w=widgets.IntSlider(description='maxLen', value=10, min=1, max=10, step=1)
		pbox.append(widgets.HBox([self.minLen_w,self.maxLen_w]))

		self.minGR_w=widgets.FloatSlider(description='minGR', value=1.2, min=1.1, max=20.0, step=0.2)
		pbox.append(self.minGR_w)

		self.usetop_w=widgets.Checkbox(value=False, description='上位top番目のsupportをminSupに再設定する', disabled=False,style={'description_width': 'initial'})
		self.top_w=widgets.IntSlider(description='topの値', value=1000, min=1, max=10000, step=1)
		pbox.append(widgets.HBox([self.usetop_w,self.top_w]))

		box=widgets.VBox(pbox)
		return box
Exemplo n.º 9
0
	def widget(self):

		# ボタン系
		#exeButton_w=widgets.Button(description="スクリプト生成")
		#exeButton_w.style.button_color = 'lightgreen'
		#exeButton_w.on_click(self.exe_h)
		#buttons_w=widgets.HBox([exeButton_w])

		pbox=[]
		# ファイル名とファイル内容
		self.iName_w =widgets.Text(description="入力ファイル",value="",layout=Layout(width='100%'),disabled=True)
		self.iText_w =widgets.Textarea(value="",rows=5,layout=Layout(width='100%'),disabled=True)
		pbox.append(self.iName_w)
		pbox.append(self.iText_w)
		self.oPath_w =widgets.Text(description="出力パス",value="",layout=Layout(width='100%'),disabled=False)
		pbox.append(self.oPath_w)
		self.oFile_w =widgets.Text(description="ファイル名",value="",layout=Layout(width='100%'),disabled=False)
		pbox.append(self.oFile_w)

		# key 項目
		config_k={
			"options":[],
			"title":"key単位選択の項目",
			"rows":5,
			"width":300,
			"blank":True,
			"multiSelect":False,
			"message":None
		}
		self.key_w=selfield_w(config_k)

		# field 項目
		config_f={
			"options":[],
			"title":"数値項目",
			"rows":5,
			"width":300,
			"multiSelect":False,
			"message":None
		}
		self.field_w=selfield_w(config_f)
		pbox.append(widgets.HBox([self.field_w.widget(),self.key_w.widget()]))

		# 範囲
		self.vFr_w=widgets.Text(description="from:",value="",layout=Layout(width='300px'))
		self.vFrEq_w=widgets.Checkbox(value=True, description='以上', disabled=False)
		frBox=widgets.HBox([self.vFr_w,self.vFrEq_w])
		self.vTo_w=widgets.Text(description="to:",value="",layout=Layout(width='300px'))
		self.vToEq_w=widgets.Checkbox(value=True, description='以下', disabled=False)
		toBox=widgets.HBox([self.vTo_w,self.vToEq_w])
		pbox.append(frBox)
		pbox.append(toBox)

		# その他parameters
		self.reverse_w=widgets.Checkbox(value=False, description='条件反転', disabled=False)
		pbox.append(self.reverse_w)

		search_w=widgets.Button(description="項目統計")
		search_w.on_click(self.stats_h)
		self.result_w=widgets.Textarea(rows=4,disabled=True,layout=widgets.Layout(width='99%'))
		subbox1=widgets.VBox([search_w,self.result_w])
		pbox.append(subbox1)

		box=widgets.VBox(pbox)
		return box
Exemplo n.º 10
0
    def widget(self):
        pbox = []

        # ファイル名とファイル内容
        self.iName_w = widgets.Text(description="入力ファイル",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=True)
        self.iText_w = widgets.Textarea(value="",
                                        rows=5,
                                        layout=Layout(width='100%'),
                                        disabled=True)
        pbox.append(self.iName_w)
        pbox.append(self.iText_w)
        self.mName_w = widgets.Text(description="参照ファイル",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=True)
        self.mText_w = widgets.Textarea(value="",
                                        rows=5,
                                        layout=Layout(width='100%'),
                                        disabled=True)
        pbox.append(self.mName_w)
        pbox.append(self.mText_w)
        self.oPath_w = widgets.Text(description="出力パス",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=False)
        pbox.append(self.oPath_w)
        self.oFile_w = widgets.Text(description="ファイル名",
                                    value="",
                                    layout=Layout(width='100%'),
                                    disabled=False)
        pbox.append(self.oFile_w)

        # key 項目(入力)
        config_k = {
            "options": [],
            "title": "入力key項目",
            "rows": 5,
            "width": 300,
            "blank": False,
            "multiSelect": False,
            "message": None
        }
        self.iKey_w = selfield_w(config_k)

        # key 項目(参照)
        config_K = {
            "options": [],
            "title": "参照key項目(無選択=入力keyに同じ)",
            "rows": 5,
            "width": 300,
            "blank": True,
            "multiSelect": False,
            "message": None
        }
        self.mKey_w = selfield_w(config_K)

        # field 項目
        config_f = {
            "options": [],
            "title": "結合する項目",
            "rows": 5,
            "width": 300,
            "multiSelect": True,
            "message": None
        }
        self.field_w = selfield_w(config_f)
        pbox.append(
            widgets.HBox([
                self.iKey_w.widget(),
                self.mKey_w.widget(),
                self.field_w.widget()
            ]))

        # その他parameters
        self.iOuter_w = widgets.Checkbox(value=False,
                                         description='入力outer join',
                                         disabled=False)
        self.mOuter_w = widgets.Checkbox(value=False,
                                         description='参照outer join',
                                         disabled=False)
        subbox2 = widgets.HBox([self.iOuter_w, self.mOuter_w])
        pbox.append(subbox2)

        box = widgets.VBox(pbox)
        return box