{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "___\n", "___\n", "# Turicreate: Departure from Graphlab\n", "\n", "Turi Create simplifies the development of custom machine learning models. \n", "___\n", "___\n", "\n", "https://github.com/apple/turicreate\n" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "You don't have to be a machine learning expert to add\n", "- recommendations, \n", "- object detection, \n", "- image classification, \n", "- image similarity \n", "- activity classification \n", "\n", "to your app.\n", " \n", "- https://apple.github.io/turicreate/docs/userguide/\n", "- https://apple.github.io/turicreate/docs/api/index.html" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "\n", "# pip install -U turicreate" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-06-14T12:41:50.673926Z", "start_time": "2019-06-14T12:41:38.643517Z" }, "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "
Finished parsing file /Users/datalab/bigdata/cjc/ml-1m/ratings.dat
" ], "text/plain": [ "Finished parsing file /Users/datalab/bigdata/cjc/ml-1m/ratings.dat" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Parsing completed. Parsed 100 lines in 0.348264 secs.
" ], "text/plain": [ "Parsing completed. Parsed 100 lines in 0.348264 secs." ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "------------------------------------------------------\n", "Inferred types from first 100 line(s) of file as \n", "column_type_hints=[str]\n", "If parsing fails due to incorrect types, you can correct\n", "the inferred type list above and pass it to read_csv in\n", "the column_type_hints argument\n", "------------------------------------------------------\n" ] }, { "data": { "text/html": [ "
Finished parsing file /Users/datalab/bigdata/cjc/ml-1m/ratings.dat
" ], "text/plain": [ "Finished parsing file /Users/datalab/bigdata/cjc/ml-1m/ratings.dat" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Parsing completed. Parsed 1000209 lines in 0.376001 secs.
" ], "text/plain": [ "Parsing completed. Parsed 1000209 lines in 0.376001 secs." ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import turicreate as tc\n", "actions = tc.SFrame.read_csv('/Users/datalab/bigdata/cjc/ml-1m/ratings.dat', delimiter='\\n', \n", " header=False)['X1'].apply(lambda x: x.split('::')).unpack()\n", "for col in actions.column_names():\n", " actions[col] = actions[col].astype(int)\n", "actions = actions.rename({'X.0': 'user_id', 'X.1': 'movie_id', 'X.2': 'rating', 'X.3': 'timestamp'})\n", "#actions.save('ratings')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Slideshow", "kernelspec": { "display_name": "Python [conda env:anaconda]", "language": "python", "name": "conda-env-anaconda-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.4" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autoclose": false, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": false, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }