• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python trustedanalytics.connect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中trustedanalytics.connect函数的典型用法代码示例。如果您正苦于以下问题:Python connect函数的具体用法?Python connect怎么用?Python connect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了connect函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: connect

def connect():
    import trustedanalytics as ta
    ta.server.uri = "atk-34157d69-65f4-426f-ac14.demo-gotapaas.com"
    ta.loggers.set_api()
    ta.connect('/root/demo.creds')

    return ta if ta is not None else None
开发者ID:575098618,项目名称:paper,代码行数:7,代码来源:connect.py


示例2: test_create_from_csv

 def test_create_from_csv(self, patched_be):
     connect()
     f = Frame(CsvFile("dummy.csv", [('A', int32), ('B', int64)]))
     self.assertEqual(0, len(f))
     try:
         c = f['C']
         self.fail()
     except KeyError:
         pass
开发者ID:AllanY,项目名称:atk,代码行数:9,代码来源:test_core_frame.py


示例3: get_simple_frame_abfgh

def get_simple_frame_abfgh():
    schema = [('A', int32),  ('B', int64), ('F', float32), ('G', float64), ('H', str)]
    f = Frame(CsvFile("dummy.csv", schema))
    connect()
    try:
        del _BaseFrame.schema
    except:
        pass
    setattr(f, "schema", schema)
    return f
开发者ID:AllanY,项目名称:atk,代码行数:10,代码来源:test_core_frame.py


示例4: ModelNaiveBayesTest

#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#


import unittest
import trustedanalytics as ta

# show full stack traces
ta.errors.show_details = True
ta.loggers.set_api()
# TODO: port setup should move to a super class
if ta.server.port != 19099:
    ta.server.port = 19099
ta.connect()

class ModelNaiveBayesTest(unittest.TestCase):
    def test_naive_bayes(self):
        print "define csv file"
        schema = [("Class", ta.int32),("Dim_1", ta.int32),("Dim_2", ta.int32),("Dim_3",ta.int32)]
        train_file = ta.CsvFile("/datasets/naivebayes_spark_data.csv", schema= schema)
        print "creating the frame"
        train_frame = ta.Frame(train_file)

        print "initializing the naivebayes model"
        n = ta.NaiveBayesModel()

        print "training the model on the frame"
        n.train(train_frame, 'Class', ['Dim_1', 'Dim_2', 'Dim_3'])
开发者ID:AllanY,项目名称:atk,代码行数:30,代码来源:model_naive_bayes_test.py


示例5: ModelNaiveBayesTest

#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#


import unittest
import trustedanalytics as ta

# show full stack traces
ta.errors.show_details = True
ta.server.uri = "atk-c4510a4d-f1ce-44f8-b4a6.10.239.165.216.xip.io"
ta.loggers.set_http()
#ta.loggers.set_api()

ta.connect("/home/yilan/atk/atk_poc/demo.creds")

class ModelNaiveBayesTest(unittest.TestCase):

    def test_naive_bayes(self):
        print "define csv file"

        csv = ta.CsvFile("hdfs://nameservice1/org/intel/hdfsbroker/userspace/ae6a38d3-191f-494f-86a6-3fe1b2255902/e3327582-f475-4dc9-8efa-96070abb606d/000000_1",
                         schema=[
                          ("GXY",ta.int32),
                          #("HPI",ta.ignore),
                          ("Age",ta.int32),
                          ("Sex",ta.int32),
                          ("Height",ta.float64),
                          ("Weight",ta.float64),
                          ("BMI",ta.float64),
开发者ID:575098618,项目名称:paper,代码行数:31,代码来源:model_naive_bayes_test.py


示例6: test_create

 def test_create(self, patched_be):
     connect()
     f = Frame()
     self.assertEqual(None, f.uri)
开发者ID:AllanY,项目名称:atk,代码行数:4,代码来源:test_core_frame.py


示例7: test_create

 def test_create(self, patched_be):
     connect()
     f = Frame()
     self.assertEqual(0, f._id)
     self.assertEqual(None, f._error_frame_id)
开发者ID:xoltar,项目名称:atk,代码行数:5,代码来源:test_core_frame.py


示例8: ModelRandomForestTest

#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#


import unittest
import trustedanalytics as ta

# show full stack traces
ta.errors.show_details = True
ta.server.uri = "ly_test_a-73f30cfd.10.239.165.214.xip.io"
#ta.loggers.set_http()
ta.loggers.set_api()

ta.connect("~/workspace/atktest/demo.creds")

class ModelRandomForestTest(unittest.TestCase):

    def testLinearRegression(self):
        print "define csv file"

        csv = ta.CsvFile("hdfs://nameservice1/org/intel/hdfsbroker/userspace/9bb351fa-7b17-4a81-b3b0-521639c1d473/d342214b-c4c0-4963-aeaf-5adf054e22b6/000000_1",
                         schema=[
                          ("GXY",ta.int32),
                          #("HPI",ta.ignore),
                          ("Age",ta.int32),
                          ("Sex",ta.int32),
                          ("Height",ta.float64),
                          ("Weight",ta.float64),
                          ("BMI",ta.float64),
开发者ID:575098618,项目名称:paper,代码行数:31,代码来源:model_random_forest_classifier.py


示例9: test_meta

 def test_meta(self):
     import trustedanalytics as ta
     ta.connect()
开发者ID:AllanY,项目名称:atk,代码行数:3,代码来源:test_rest_frame.py


示例10: ModelRandomForestTest

#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#


import unittest
import trustedanalytics as ta

# show full stack traces
ta.errors.show_details = True
ta.server.uri = "atk-bcc31ff0-b3c2-4059-9749.10.239.165.216.xip.io"
#ta.loggers.set_http()
ta.loggers.set_api()

ta.connect("/home/yilan/tap/atk/atkPoc/demo.creds")


class ModelRandomForestTest(unittest.TestCase):

    def testLinearRegression(self):
        print "define csv file"

        csv = ta.CsvFile("hdfs://nameservice1/org/intel/hdfsbroker/userspace/ae6a38d3-191f-494f-86a6-3fe1b2255902/e3327582-f475-4dc9-8efa-96070abb606d/000000_1",
                         schema=[
                          ("GXY",ta.int32),
                          #("HPI",ta.ignore),
                          ("Age",ta.int32),
                          ("Sex",ta.int32),
                          ("Height",ta.float64),
                          ("Weight",ta.float64),
开发者ID:575098618,项目名称:paper,代码行数:31,代码来源:model_random_forest_regressor.py


示例11: connect

def connect():
    import trustedanalytics as ta

    ta.connect()

    return ta
开发者ID:rainiraj,项目名称:atk,代码行数:6,代码来源:__init__.py


示例12: ModelRandomForestTest

# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

import unittest
import trustedanalytics as ia

# show full stack traces
ia.errors.show_details = True
ia.loggers.set_api()
# TODO: port setup should move to a super class
if ia.server.port != 19099:
    ia.server.port = 19099
ia.connect()

class ModelRandomForestTest(unittest.TestCase):
    def testSvm(self):
        print "define csv file"
        csv = ia.CsvFile("/datasets/RandomForest.csv", schema= [('Class', int),
                                                               ('Dim_1', ia.float64),
                                                               ('Dim_2',ia.float64)])

        print "create frame"
        frame = ia.Frame(csv)

        print "Initializing the classifier model object"
        classifier = ia.RandomForestClassifierModel()

        print "Training the model on the Frame"
开发者ID:rainiraj,项目名称:atk,代码行数:31,代码来源:model_random_forest.py


示例13:

#-------------------------------------------------------------------------------
# Name:        DataProcess_ATK
# Purpose:
# Author:      xlin1x
# Email:       [email protected]
# Created:     25/1/2016
#-------------------------------------------------------------------------------

# coding: utf-8

# In[10]:

# create connect to server
import trustedanalytics as ta
ta.server.uri='it_flex-e9c6c0af.demo-gotapaas.com'
ta.connect("/root/demo.creds")


# In[11]:

#create an array to maintain frame column
featureList = ["GXY", "Age", "Sex", "Height", "BMI", "DBP", "Cr", "HCT"];
#create an array to maintain classfiy opertion
classfiyList = ["DBP","HCT"];


# In[12]:

#create a schema 
csv = ta.CsvFile("hdfs://nameservice1/org/intel/hdfsbroker/userspace/b61d4808-e761-45c3-bd54-afcb05b84a8b/ef53c275-e12d-49ea-b2dd-bce12717b72b/000000_1",        
                  schema=[
开发者ID:575098618,项目名称:paper,代码行数:31,代码来源:DataProcess_ATK.py



注:本文中的trustedanalytics.connect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python trustedanalytics.get_frame函数代码示例发布时间:2022-05-27
下一篇:
Python utils.print_list函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap